[WPE] Enable web process sandbox
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2019-03-04  Michael Catanzaro  <mcatanzaro@igalia.com>
2
3         [WPE] Enable web process sandbox
4         https://bugs.webkit.org/show_bug.cgi?id=195169
5
6         Reviewed by Daniel Bates.
7
8         * PlatformWPE.cmake:
9         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
10         (WebKit::bubblewrapSpawn):
11         * UIProcess/glib/WebProcessPoolGLib.cpp:
12         (WebKit::WebProcessPool::platformInitialize):
13
14 2019-03-04  Adrian Perez de Castro  <aperez@igalia.com>
15
16         [GTK][WPE] Wrong license header in WebKit{,WebExtension}Autocleanups.h
17         https://bugs.webkit.org/show_bug.cgi?id=195245
18
19         Reviewed by Carlos Garcia Campos.
20
21         Changed license headers to contain the LGPL, which is the correct one for the GTK
22         and WPE ports. The change was agreed by the contributors to the files involved.
23
24         * UIProcess/API/gtk/WebKitAutocleanups.h:
25         * UIProcess/API/wpe/WebKitAutocleanups.h:
26         * WebProcess/InjectedBundle/API/gtk/WebKitWebExtensionAutocleanups.h:
27         * WebProcess/InjectedBundle/API/wpe/WebKitWebExtensionAutocleanups.h:
28
29 2019-03-04  Commit Queue  <commit-queue@webkit.org>
30
31         Unreviewed, rolling out r242045.
32         https://bugs.webkit.org/show_bug.cgi?id=195273
33
34         WE not ready to enable PSON yet (Requested by KaL on #webkit).
35
36         Reverted changeset:
37
38         "[GTK] Enable PSON"
39         https://bugs.webkit.org/show_bug.cgi?id=194979
40         https://trac.webkit.org/changeset/242045
41
42 2019-03-04  Carlos Garcia Campos  <cgarcia@igalia.com>
43
44         [CoordinatedGraphics] Unify DrawingArea classes
45         https://bugs.webkit.org/show_bug.cgi?id=195167
46
47         Reviewed by Žan Doberšek.
48
49         Add DrawingAreaProxyCoordinatedGraphics and DrawingAreaCoordinatedGraphics.
50
51         * PlatformGTK.cmake:
52         * PlatformWPE.cmake:
53         * PlatformWin.cmake:
54         * Shared/DrawingAreaInfo.h:
55         * SourcesGTK.txt:
56         * SourcesWPE.txt:
57         * UIProcess/API/gtk/PageClientImpl.cpp:
58         (WebKit::PageClientImpl::createDrawingAreaProxy):
59         (WebKit::PageClientImpl::viewSize):
60         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
61         (webkitWebViewBaseRealize):
62         (webkitWebViewBaseUnrealize):
63         (webkitWebViewBaseDraw):
64         (webkitWebViewBaseSizeAllocate):
65         (webkitWebViewBaseDidRelaunchWebProcess):
66         (webkitWebViewBasePageClosed):
67         * UIProcess/API/wpe/PageClientImpl.cpp:
68         (WebKit::PageClientImpl::createDrawingAreaProxy):
69         * UIProcess/AcceleratedDrawingAreaProxy.cpp: Removed.
70         * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp: Added.
71         (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingAreaProxyCoordinatedGraphics):
72         (WebKit::DrawingAreaProxyCoordinatedGraphics::~DrawingAreaProxyCoordinatedGraphics):
73         (WebKit::DrawingAreaProxyCoordinatedGraphics::paint):
74         (WebKit::DrawingAreaProxyCoordinatedGraphics::sizeDidChange):
75         (WebKit::DrawingAreaProxyCoordinatedGraphics::deviceScaleFactorDidChange):
76         (WebKit::DrawingAreaProxyCoordinatedGraphics::waitForBackingStoreUpdateOnNextPaint):
77         (WebKit::DrawingAreaProxyCoordinatedGraphics::setBackingStoreIsDiscardable):
78         (WebKit::DrawingAreaProxyCoordinatedGraphics::update):
79         (WebKit::DrawingAreaProxyCoordinatedGraphics::didUpdateBackingStoreState):
80         (WebKit::DrawingAreaProxyCoordinatedGraphics::enterAcceleratedCompositingMode):
81         (WebKit::DrawingAreaProxyCoordinatedGraphics::exitAcceleratedCompositingMode):
82         (WebKit::DrawingAreaProxyCoordinatedGraphics::updateAcceleratedCompositingMode):
83         (WebKit::DrawingAreaProxyCoordinatedGraphics::incorporateUpdate):
84         (WebKit::DrawingAreaProxyCoordinatedGraphics::alwaysUseCompositing const):
85         (WebKit::DrawingAreaProxyCoordinatedGraphics::backingStoreStateDidChange):
86         (WebKit::DrawingAreaProxyCoordinatedGraphics::sendUpdateBackingStoreState):
87         (WebKit::DrawingAreaProxyCoordinatedGraphics::waitForAndDispatchDidUpdateBackingStoreState):
88         (WebKit::DrawingAreaProxyCoordinatedGraphics::discardBackingStoreSoon):
89         (WebKit::DrawingAreaProxyCoordinatedGraphics::discardBackingStore):
90         (WebKit::DrawingAreaProxyCoordinatedGraphics::setNativeSurfaceHandleForCompositing):
91         (WebKit::DrawingAreaProxyCoordinatedGraphics::destroyNativeSurfaceHandleForCompositing):
92         (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::DrawingMonitor):
93         (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::~DrawingMonitor):
94         (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::webViewDrawCallback):
95         (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::start):
96         (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::stop):
97         (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::didDraw):
98         (WebKit::DrawingAreaProxyCoordinatedGraphics::dispatchAfterEnsuringDrawing):
99         * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h: Renamed from Source/WebKit/UIProcess/AcceleratedDrawingAreaProxy.h.
100         * UIProcess/DrawingAreaProxyImpl.cpp: Removed.
101         * UIProcess/DrawingAreaProxyImpl.h: Removed.
102         * UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
103         (WebKit::AcceleratedBackingStoreX11::update):
104         * UIProcess/win/PageClientImpl.cpp:
105         (WebKit::PageClientImpl::createDrawingAreaProxy):
106         * UIProcess/win/WebView.cpp:
107         (WebKit::WebView::paint):
108         * WebProcess/WebPage/AcceleratedDrawingArea.cpp: Removed.
109         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp: Added.
110         (WebKit::DrawingAreaCoordinatedGraphics::DrawingAreaCoordinatedGraphics):
111         (WebKit::DrawingAreaCoordinatedGraphics::~DrawingAreaCoordinatedGraphics):
112         (WebKit::DrawingAreaCoordinatedGraphics::setNeedsDisplay):
113         (WebKit::DrawingAreaCoordinatedGraphics::setNeedsDisplayInRect):
114         (WebKit::DrawingAreaCoordinatedGraphics::scroll):
115         (WebKit::DrawingAreaCoordinatedGraphics::forceRepaint):
116         (WebKit::DrawingAreaCoordinatedGraphics::forceRepaintAsync):
117         (WebKit::DrawingAreaCoordinatedGraphics::setLayerTreeStateIsFrozen):
118         (WebKit::DrawingAreaCoordinatedGraphics::updatePreferences):
119         (WebKit::DrawingAreaCoordinatedGraphics::mainFrameContentSizeChanged):
120         (WebKit::DrawingAreaCoordinatedGraphics::deviceOrPageScaleFactorChanged):
121         (WebKit::DrawingAreaCoordinatedGraphics::didChangeViewportAttributes):
122         (WebKit::DrawingAreaCoordinatedGraphics::graphicsLayerFactory):
123         (WebKit::DrawingAreaCoordinatedGraphics::setRootCompositingLayer):
124         (WebKit::DrawingAreaCoordinatedGraphics::scheduleCompositingLayerFlush):
125         (WebKit::DrawingAreaCoordinatedGraphics::layerHostDidFlushLayers):
126         (WebKit::DrawingAreaCoordinatedGraphics::createDisplayRefreshMonitor):
127         (WebKit::DrawingAreaCoordinatedGraphics::setNativeSurfaceHandleForCompositing):
128         (WebKit::DrawingAreaCoordinatedGraphics::destroyNativeSurfaceHandleForCompositing):
129         (WebKit::DrawingAreaCoordinatedGraphics::activityStateDidChange):
130         (WebKit::DrawingAreaCoordinatedGraphics::attachViewOverlayGraphicsLayer):
131         (WebKit::DrawingAreaCoordinatedGraphics::updateBackingStoreState):
132         (WebKit::DrawingAreaCoordinatedGraphics::didUpdate):
133         (WebKit::DrawingAreaCoordinatedGraphics::sendDidUpdateBackingStoreState):
134         (WebKit::DrawingAreaCoordinatedGraphics::exitAcceleratedCompositingModeSoon):
135         (WebKit::DrawingAreaCoordinatedGraphics::exitAcceleratedCompositingModeNow):
136         (WebKit::DrawingAreaCoordinatedGraphics::discardPreviousLayerTreeHost):
137         (WebKit::DrawingAreaCoordinatedGraphics::suspendPainting):
138         (WebKit::DrawingAreaCoordinatedGraphics::resumePainting):
139         (WebKit::DrawingAreaCoordinatedGraphics::enterAcceleratedCompositingMode):
140         (WebKit::DrawingAreaCoordinatedGraphics::exitAcceleratedCompositingMode):
141         (WebKit::DrawingAreaCoordinatedGraphics::scheduleDisplay):
142         (WebKit::DrawingAreaCoordinatedGraphics::displayTimerFired):
143         (WebKit::DrawingAreaCoordinatedGraphics::display):
144         (WebKit::shouldPaintBoundsRect):
145         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h: Renamed from Source/WebKit/WebProcess/WebPage/AcceleratedDrawingArea.h.
146         * WebProcess/WebPage/DrawingArea.cpp:
147         (WebKit::DrawingArea::create):
148         * WebProcess/WebPage/DrawingArea.h:
149         (WebKit::DrawingArea::layerFlushThrottlingIsActive const):
150         * WebProcess/WebPage/DrawingAreaImpl.cpp: Removed.
151         * WebProcess/WebPage/DrawingAreaImpl.h: Removed.
152
153 2019-03-03  Zalan Bujtas  <zalan@apple.com>
154
155         [ContentChangeObserver] Content observation should be limited to the current document.
156         https://bugs.webkit.org/show_bug.cgi?id=195256
157         <rdar://problem/48544402>
158
159         Reviewed by Simon Fraser.
160
161         * WebProcess/WebPage/WebPage.h:
162         * WebProcess/WebPage/ios/WebPageIOS.mm:
163         (WebKit::WebPage::handleSyntheticClick):
164         (WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
165         (WebKit::WebPage::completeSyntheticClick):
166         (WebKit::WebPage::handleTap):
167         (WebKit::WebPage::handleTwoFingerTapAtPoint):
168         (WebKit::WebPage::commitPotentialTap):
169
170 2019-03-03  Tim Horton  <timothy_horton@apple.com>
171
172         Rid the world of WK_API_ENABLED
173         https://bugs.webkit.org/show_bug.cgi?id=195263
174
175         Reviewed by Dan Bernstein.
176
177         List of changed files elided because it's useless.
178
179 2019-03-03  Jiewen Tan  <jiewen_tan@apple.com>
180
181         Add a WebViewDidMoveToWindowObserver for WKWebView
182         https://bugs.webkit.org/show_bug.cgi?id=195223
183         <rdar://problem/48520161>
184
185         Reviewed by Darin Adler.
186
187         The load optimizer would only allow itself to optimize loads whenever the web view
188         who owns the page is (visible && focused), otherwises it will wait until the web view
189         becomes (visible && focused). Therefore, we need a way to notify the load optimizer
190         changes of statuses.
191
192         * UIProcess/API/Cocoa/WKWebView.mm:
193         (-[WKWebView didMoveToWindow]):
194         * UIProcess/Cocoa/WebViewImpl.mm:
195         (WebKit::WebViewImpl::viewDidMoveToWindow):
196         * UIProcess/WebPageProxy.cpp:
197         (WebKit::WebPageProxy::addWebViewDidMoveToWindowObserver):
198         (WebKit::WebPageProxy::removeWebViewDidMoveToWindowObserver):
199         (WebKit::WebPageProxy::webViewDidMoveToWindow):
200         * UIProcess/WebPageProxy.h:
201         * UIProcess/WebViewDidMoveToWindowObserver.h: Added.
202         * WebKit.xcodeproj/project.pbxproj:
203
204 2019-03-03  Andy Estes  <aestes@apple.com>
205
206         [Apple Pay] Untangle WebPageProxy and WebPaymentCoordinatorProxy
207         https://bugs.webkit.org/show_bug.cgi?id=195219
208         <rdar://problem/48518082>
209
210         Reviewed by Darin Adler.
211
212         Rather than having WebPaymentCoordinatorProxy know about WebPageProxy, give
213         WebPaymentCoordinatorProxy a client interface that WebPageProxy conforms to.
214
215         In a follow-on patch, WebPaymentCoordinatorProxy will have a non-WebPageProxy client.
216
217         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
218         (WebKit::WebPaymentCoordinatorProxy::WebPaymentCoordinatorProxy): Replaced use of
219         m_webPageProxy with m_client.
220         (WebKit::WebPaymentCoordinatorProxy::~WebPaymentCoordinatorProxy): Ditto.
221         (WebKit::WebPaymentCoordinatorProxy::messageSenderConnection const): Implemented
222         IPC::MessageSender via m_client.
223         (WebKit::WebPaymentCoordinatorProxy::messageSenderDestinationID const): Ditto.
224         (WebKit::WebPaymentCoordinatorProxy::canMakePaymentsWithActiveCard): Replaced use of
225         m_webPageProxy with m_client.
226         (WebKit::WebPaymentCoordinatorProxy::openPaymentSetup): Ditto.
227         (WebKit::WebPaymentCoordinatorProxy::didCancelPaymentSession): Called our own
228         MessageSender::send rather than going through m_webPageProxy.
229         (WebKit::WebPaymentCoordinatorProxy::validateMerchant): Ditto.
230         (WebKit::WebPaymentCoordinatorProxy::didAuthorizePayment): Ditto.
231         (WebKit::WebPaymentCoordinatorProxy::didSelectShippingMethod): Ditto.
232         (WebKit::WebPaymentCoordinatorProxy::didSelectShippingContact): Ditto.
233         (WebKit::WebPaymentCoordinatorProxy::didSelectPaymentMethod): Ditto.
234         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h: Defined the Client abstract class and
235         changed m_webPageProxy to m_client.
236         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h:
237         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
238         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard): Replaced use of
239         m_webPageProxy with m_client.
240         (WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest): Renamed from toPKPaymentRequest.
241         (WebKit::toPKPaymentRequest): Renamed to WebPaymentCoordinatorProxy::platformPaymentRequest.
242         * UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
243         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): Replaced use of m_webPageProxy
244         with m_client.
245         * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
246         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): Ditto.
247         * UIProcess/AuxiliaryProcessProxy.h:
248         (WebKit::AuxiliaryProcessProxy::messageReceiverMap): Added.
249         * UIProcess/WebPageProxy.cpp:
250         (WebKit::WebPageProxy::paymentCoordinatorConnection): Implemented WebPaymentCoordinatorProxy::Client.
251         (WebKit::WebPageProxy::paymentCoordinatorMessageReceiver): Ditto.
252         (WebKit::WebPageProxy::paymentCoordinatorSourceApplicationBundleIdentifier): Ditto.
253         (WebKit::WebPageProxy::paymentCoordinatorSourceApplicationSecondaryIdentifier): Ditto.
254         (WebKit::WebPageProxy::paymentCoordinatorDestinationID): Ditto.
255         * UIProcess/WebPageProxy.h: Made WebPageProxy derive from WebPaymentCoordinatorProxy::Client.
256         * UIProcess/ios/WebPageProxyIOS.mm:
257         (WebKit::WebPageProxy::paymentCoordinatorPresentingViewController): Implemented WebPaymentCoordinatorProxy::Client.
258         (WebKit::WebPageProxy::paymentCoordinatorCTDataConnectionServiceType): Ditto.
259         * UIProcess/mac/WebPageProxyMac.mm:
260         (WebKit::WebPageProxy::paymentCoordinatorPresentingWindow): Ditto.
261         * WebKit.xcodeproj/project.pbxproj:
262
263 2019-03-03  Tim Horton  <timothy_horton@apple.com>
264
265         Remove some more unused 32-bit code
266         https://bugs.webkit.org/show_bug.cgi?id=195255
267
268         Reviewed by Darin Adler.
269
270         * Platform/Module.cpp:
271         (WebKit::Module::Module):
272         * Platform/Module.h:
273         * Platform/cf/ModuleCF.cpp:
274         (WebKit::Module::unload):
275         (WebKit::Module::bundleResourceMap): Deleted.
276         * PluginProcess/mac/PluginProcessMac.mm:
277         (WebKit::initializeShim):
278         (WebKit::PluginProcess::platformInitializeProcess):
279         (WebKit::shouldCallRealDebugger): Deleted.
280         (WebKit::isWindowActive): Deleted.
281         (WebKit::getCurrentEventButtonState): Deleted.
282         (WebKit::carbonWindowShown): Deleted.
283         (WebKit::carbonWindowHidden): Deleted.
284         (WebKit::openCFURLRef): Deleted.
285         (WebKit::isMallocTinyMemoryTag): Deleted.
286         (WebKit::shouldMapMemoryExecutable): Deleted.
287         * PluginProcess/mac/PluginProcessShim.h:
288         * PluginProcess/mac/PluginProcessShim.mm:
289         (WebKit::shimDebugger): Deleted.
290         (WebKit::shimGetCurrentEventButtonState): Deleted.
291         (WebKit::shimIsWindowActive): Deleted.
292         (WebKit::shimModalDialog): Deleted.
293         (WebKit::shimAlert): Deleted.
294         (WebKit::shimShowWindow): Deleted.
295         (WebKit::shimHideWindow): Deleted.
296         (WebKit::shimLSOpenCFURLRef): Deleted.
297         (WebKit::shimMachVMMap): Deleted.
298         * Shared/API/Cocoa/WKFoundation.h:
299         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
300         (WebKit::XPCServiceMain):
301         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
302         (WebKit::NetscapePluginModule::tryLoad):
303         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
304         (WebKit::getPluginArchitecture):
305         (WebKit::NetscapePluginModule::determineQuirks):
306         * Shared/Plugins/PluginQuirks.h:
307         * Shared/cf/ArgumentCodersCF.cpp:
308         (IPC::sizeForNumberType):
309         * Shared/mac/WebEventFactory.mm:
310         (WebKit::mouseButtonForEvent):
311         (WebKit::globalPointForEvent):
312         (WebKit::pointForEvent):
313         (WebKit::WebEventFactory::createWebMouseEvent):
314         * UIProcess/API/C/mac/WKPagePrivateMac.h:
315         * UIProcess/API/C/mac/WKPagePrivateMac.mm:
316         (WKPageLoadFileReturningNavigation):
317         * UIProcess/Cocoa/WebViewImpl.mm:
318         (WebKit::WebViewImpl::pressureChangeWithEvent):
319         * UIProcess/Gamepad/cocoa/UIGamepadProviderCocoa.mm:
320         (WebKit::UIGamepadProvider::platformSetDefaultGamepadProvider):
321         * UIProcess/mac/ServicesController.mm:
322         (WebKit::ServicesController::ServicesController):
323         * UIProcess/mac/WebContextMenuProxyMac.mm:
324         (WebKit::WebContextMenuProxyMac::setupServicesMenu):
325         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
326         (WebKit::NPN_GetValue):
327         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
328         (WebKit::NetscapePlugin::NetscapePlugin):
329         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
330         (WebKit::NetscapePlugin::isWindowActive const): Deleted.
331         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
332         (WebKit::NetscapePlugin::setDrawingModel):
333         (WebKit::NetscapePlugin::setEventModel):
334         (WebKit::NetscapePlugin::platformPostInitialize):
335         (WebKit::NetscapePlugin::platformDestroy):
336         (WebKit::NetscapePlugin::platformGeometryDidChange):
337         (WebKit::NetscapePlugin::platformPaint):
338         (WebKit::NetscapePlugin::platformHandleMouseEvent):
339         (WebKit::NetscapePlugin::platformHandleWheelEvent):
340         (WebKit::NetscapePlugin::platformHandleMouseEnterEvent):
341         (WebKit::NetscapePlugin::platformHandleMouseLeaveEvent):
342         (WebKit::NetscapePlugin::platformHandleKeyboardEvent):
343         (WebKit::NetscapePlugin::platformSetFocus):
344         (WebKit::NetscapePlugin::windowFocusChanged):
345         (WebKit::NetscapePlugin::windowAndViewFramesChanged):
346         (WebKit::NetscapePlugin::sendComplexTextInput):
347         (): Deleted.
348         (WebKit::windowMap): Deleted.
349         (WebKit::NetscapePlugin::netscapePluginFromWindow): Deleted.
350         (WebKit::NetscapePlugin::windowRef const): Deleted.
351         (WebKit::NetscapePlugin::updateFakeWindowBounds): Deleted.
352         (WebKit::NetscapePlugin::buttonState): Deleted.
353         (WebKit::initializeEventRecord): Deleted.
354         (WebKit::anyMouseButtonIsDown): Deleted.
355         (WebKit::rightMouseButtonIsDown): Deleted.
356         (WebKit::modifiersForEvent): Deleted.
357         (WebKit::convertStringToKeyCodes): Deleted.
358         (WebKit::scriptCodeFromCurrentKeyboardInputSource): Deleted.
359         (WebKit::NetscapePlugin::nullEventTimerFired): Deleted.
360
361 2019-03-02  Zalan Bujtas  <zalan@apple.com>
362
363         [ContentChangeObserver] Introduce ContentChangeObserver::MouseMovedScope
364         https://bugs.webkit.org/show_bug.cgi?id=195252
365         <rdar://problem/48539446>
366
367         Reviewed by Simon Fraser.
368
369         * WebProcess/WebPage/ios/WebPageIOS.mm:
370         (WebKit::WebPage::handleSyntheticClick):
371
372 2019-03-02  Tim Horton  <timothy_horton@apple.com>
373
374         Move EditingRange <-> Range methods to EditingRange instead of WebPage
375         https://bugs.webkit.org/show_bug.cgi?id=195201
376
377         Reviewed by Sam Weinig.
378
379         * Shared/EditingRange.h:
380         * Shared/EditingRange.cpp:
381         Also, modernize the coders.
382
383         * Sources.txt:
384         * WebKit.xcodeproj/project.pbxproj:
385         * WebProcess/WebPage/WebPage.cpp:
386         (WebKit::WebPage::insertTextAsync):
387         (WebKit::WebPage::getMarkedRangeAsync):
388         (WebKit::WebPage::getSelectedRangeAsync):
389         (WebKit::WebPage::characterIndexForPointAsync):
390         (WebKit::WebPage::firstRectForCharacterRangeAsync):
391         (WebKit::WebPage::setCompositionAsync):
392         (WebKit::WebPage::rangeFromEditingRange): Deleted.
393         * WebProcess/WebPage/mac/WebPageMac.mm:
394         (WebKit::WebPage::insertDictatedTextAsync):
395         (WebKit::WebPage::attributedSubstringForCharacterRangeAsync):
396
397 2019-03-02  Wenson Hsieh  <wenson_hsieh@apple.com>
398
399         [iOS] Programmatic paste access should be granted when copying and pasting within the same origin
400         https://bugs.webkit.org/show_bug.cgi?id=195053
401         <rdar://problem/48134710>
402
403         Reviewed by Ryosuke Niwa.
404
405         Add support for automatically granting programmatic pasteboard access when the pasteboard identifier of the
406         document requesting programmatic paste matches the identifier in the custom pasteboard data blob in the
407         UIPasteboard. To do this, we send the pasteboard identifier of the document requesting the DOM paste to the UI
408         process, and check this against the pasteboard identifiers for each item on the platform pasteboard. If all
409         items in the platform pasteboard match the given pasteboard identifier (since we don't support writing multiple
410         pasteboard items via bindings, this should only be a single item), we skip showing the paste callout and
411         immediately invoke the programmatic paste handler.
412
413         * Scripts/webkit/messages.py:
414         * UIProcess/API/gtk/PageClientImpl.cpp:
415         (WebKit::PageClientImpl::requestDOMPasteAccess):
416         * UIProcess/API/gtk/PageClientImpl.h:
417         * UIProcess/API/wpe/PageClientImpl.cpp:
418         (WebKit::PageClientImpl::requestDOMPasteAccess):
419         * UIProcess/API/wpe/PageClientImpl.h:
420         * UIProcess/PageClient.h:
421         * UIProcess/WebPageProxy.cpp:
422         (WebKit::WebPageProxy::requestDOMPasteAccess):
423         * UIProcess/WebPageProxy.h:
424         * UIProcess/WebPageProxy.messages.in:
425
426         Add plumbing to deliver the pasteboard identifier to the client when requesting DOM paste.
427
428         * UIProcess/ios/PageClientImplIOS.h:
429         * UIProcess/ios/PageClientImplIOS.mm:
430         (WebKit::PageClientImpl::requestDOMPasteAccess):
431         * UIProcess/ios/WKContentViewInteraction.h:
432         * UIProcess/ios/WKContentViewInteraction.mm:
433         (-[WKContentView cleanupInteraction]):
434         (-[WKContentView resignFirstResponderForWebView]):
435         (-[WKContentView _webTouchEventsRecognized:]):
436         (-[WKContentView _willHideMenu:]):
437         (-[WKContentView pasteForWebView:]):
438         (-[WKContentView _handleDOMPasteRequestWithResult:]):
439         (-[WKContentView _willPerformAction:sender:]):
440         (-[WKContentView _didPerformAction:sender:]):
441         (-[WKContentView handleKeyWebEvent:withCompletionHandler:]):
442         (allPasteboardItemOriginsMatchOrigin):
443         (-[WKContentView _requestDOMPasteAccessWithElementRect:originIdentifier:completionHandler:]):
444         (-[WKContentView _requestDOMPasteAccessWithElementRect:completionHandler:]): Deleted.
445
446         Bail early in the case where all items' pasteboard identifiers (read via custom pasteboard data) match. When
447         this happens, we only grant access for the current paste command, rather than granting access for the user
448         gesture token.
449
450         * UIProcess/mac/PageClientImplMac.h:
451         * UIProcess/win/PageClientImpl.cpp:
452         (WebKit::PageClientImpl::requestDOMPasteAccess):
453         * UIProcess/win/PageClientImpl.h:
454         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
455         (WebKit::WebEditorClient::requestDOMPasteAccess):
456         * WebProcess/WebCoreSupport/WebEditorClient.h:
457         * WebProcess/WebPage/WebPage.cpp:
458         (WebKit::WebPage::requestDOMPasteAccess):
459         * WebProcess/WebPage/WebPage.h:
460
461 2019-02-27  Darin Adler  <darin@apple.com>
462
463         Fixed makeString(float) to do shortest-form serialization without first converting to double
464         https://bugs.webkit.org/show_bug.cgi?id=195142
465
466         Reviewed by Daniel Bates.
467
468         * UIProcess/PerActivityStateCPUUsageSampler.cpp: Removed unneeded include of DecimalNumber.h.
469
470 2019-03-02  Adrian Perez de Castro  <aperez@igalia.com>
471
472         [WPE] Public API headers are missing autocleanup definitions
473         https://bugs.webkit.org/show_bug.cgi?id=195211
474
475         Reviewed by Philippe Normand.
476
477         * PlatformWPE.cmake: List new API headers as installable.
478         * UIProcess/API/wpe/WebKitAutocleanups.h: Added. This is a copy of the header from the GTK
479         port, adapted to fit the WPE port.
480         * UIProcess/API/wpe/webkit.h: Add inclusion of WebKitAutocleanups.h
481         * WebProcess/InjectedBundle/API/wpe/WebKitWebExtensionAutocleanups.h: Added. Also adapted
482         from the equivalent header of the GTK port.
483         * WebProcess/InjectedBundle/API/wpe/webkit-web-extension.h: Add inclusion of
484         WebKitWebExtensionAutocleanups.h
485
486 2019-03-02  Michael Catanzaro  <mcatanzaro@igalia.com>
487
488         Remove unused WebPageProxy::m_navigationID
489         https://bugs.webkit.org/show_bug.cgi?id=195209
490
491         Reviewed by Darin Adler.
492
493         WebPageProxy::m_navigationID is never assigned to and is only used once by mistake in a
494         debug LOG(). It must be a refactoring mistake.
495
496         * UIProcess/WebPageProxy.cpp:
497         (WebKit::WebPageProxy::didCommitLoadForFrame):
498         * UIProcess/WebPageProxy.h:
499
500 2019-03-01  Darin Adler  <darin@apple.com>
501
502         Finish removing String::format
503         https://bugs.webkit.org/show_bug.cgi?id=194893
504
505         Reviewed by Daniel Bates.
506
507         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
508         (WebKit::LocalAuthenticator::getAssertion): Use makeString, attempting to fix
509         a problem where we passed an NSData * to format with a "%s"."
510
511 2019-03-01  Chris Dumez  <cdumez@apple.com>
512
513         Unreviewed Windows build fix after r242302.
514
515         * UIProcess/WebProcessPool.cpp:
516         (WebKit::WebProcessPool::ensureNetworkProcess):
517
518 2019-03-01  Alex Christensen  <achristensen@webkit.org>
519
520         NetworkDataTask redirection should not keep alive its NetworkSession
521         https://bugs.webkit.org/show_bug.cgi?id=194927
522
523         Reviewed by Darin Adler.
524
525         This should fix rdar://problem/47580502
526
527         * NetworkProcess/NetworkDataTask.h:
528         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
529         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
530
531 2019-03-01  Alex Christensen  <achristensen@webkit.org>
532
533         Revert r241223, r241235, and r241287
534         https://bugs.webkit.org/show_bug.cgi?id=194427
535         <rdar://48045861>
536
537         This caused crashes, and feature design has evolved away from needing the daemon in this form.
538
539         * NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.mm:
540         (WebKit::DaemonMain):
541         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h:
542         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
543         (WebKit::XPCServiceEventHandler):
544         (WebKit::XPCServiceMain):
545         (WebKit::XPCEventHandler): Deleted.
546         (WebKit::XPCInitializationHandler): Deleted.
547         * UIProcess/API/APIProcessPoolConfiguration.h:
548         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
549         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
550         (-[_WKProcessPoolConfiguration usesNetworkingDaemon]): Deleted.
551         (-[_WKProcessPoolConfiguration setUsesNetworkingDaemon:]): Deleted.
552         * UIProcess/AuxiliaryProcessProxy.cpp:
553         (WebKit::AuxiliaryProcessProxy::getLaunchOptions):
554         * UIProcess/Launcher/ProcessLauncher.h:
555         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
556         (WebKit::serviceName):
557         (WebKit::ProcessLauncher::launchProcess):
558         * UIProcess/Network/NetworkProcessProxy.cpp:
559         (WebKit::NetworkProcessProxy::getLaunchOptions):
560         * UIProcess/WebProcessPool.cpp:
561         (WebKit::WebProcessPool::usesNetworkingDaemon const): Deleted.
562         * UIProcess/WebProcessPool.h:
563
564 2019-03-01  Alex Christensen  <achristensen@webkit.org>
565
566         Add setters on WKWebsiteDataStore for sourceApplicationBundleIdentifier and sourceApplicationSecondaryIdentifier
567         https://bugs.webkit.org/show_bug.cgi?id=195229
568         <rdar://problem/48520362>
569
570         Reviewed by Chris Dumez.
571
572         Just like _setBoundInterfaceIdentifier, we need a way to set these properties after instantiation of a WKWebsiteDataStore,
573         but we need to make sure we don't set it after the parameters have been copied to the NetworkProcess.
574
575         Functionality verified by manual testing.  See radar.
576         Added an API test that verifies the setter restrictions work as expected.
577
578         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
579         (-[WKWebsiteDataStore _sourceApplicationBundleIdentifier]):
580         (-[WKWebsiteDataStore _setSourceApplicationBundleIdentifier:]):
581         (-[WKWebsiteDataStore _sourceApplicationSecondaryIdentifier]):
582         (-[WKWebsiteDataStore _setSourceApplicationSecondaryIdentifier:]):
583         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
584         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
585         (WebKit::toPKPaymentRequest):
586         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
587         (WebKit::WebsiteDataStore::parameters):
588         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
589         (WebKit::WebsiteDataStore::WebsiteDataStore):
590         (WebKit::WebsiteDataStore::setSourceApplicationSecondaryIdentifier):
591         (WebKit::WebsiteDataStore::setSourceApplicationBundleIdentifier):
592         * UIProcess/WebsiteData/WebsiteDataStore.h:
593         (WebKit::WebsiteDataStore::sourceApplicationBundleIdentifier):
594         (WebKit::WebsiteDataStore::sourceApplicationSecondaryIdentifier):
595
596 2019-03-01  Antoine Quint  <graouts@apple.com>
597
598         [iOS] Turn mouse event simulation on by default
599         https://bugs.webkit.org/show_bug.cgi?id=195218
600         <rdar://problem/48516794>
601
602         Reviewed by Dean Jackson.
603
604         * Shared/WebPreferences.yaml:
605
606 2019-03-01  Ross Kirsling  <ross.kirsling@sony.com>
607
608         EnvironmentUtilities::stripValuesEndingWithString isn't thread-safe
609         https://bugs.webkit.org/show_bug.cgi?id=194612
610
611         Reviewed by Alex Christensen.
612
613         This API test really shouldn't be verifying that the actual environment was successfully modified.
614
615         At its core, stripValuesEndingWithString is really just split-filter-join. By replacing it with a pair of
616         simple functions -- one for string processing, one for environment processing -- the API test only needs to
617         worry about the former.
618
619         * Platform/unix/EnvironmentUtilities.cpp:
620         (WebKit::EnvironmentUtilities::stripEntriesEndingWith):
621         (WebKit::EnvironmentUtilities::removeValuesEndingWith):
622         (WebKit::EnvironmentUtilities::stripValuesEndingWithString): Deleted.
623         * Platform/unix/EnvironmentUtilities.h:
624         Replace old function with a pair of simpler ones.
625
626         * NetworkProcess/EntryPoint/Cocoa/XPCService/NetworkServiceEntryPoint.mm:
627         (NetworkServiceInitializer):
628         * PluginProcess/EntryPoint/Cocoa/XPCService/PluginServiceEntryPoint.mm:
629         (PluginServiceInitializer):
630         * WebProcess/EntryPoint/Cocoa/XPCService/WebContentServiceEntryPoint.mm:
631         (WebContentServiceInitializer):
632         Update function name.
633
634 2019-03-01  Don Olmstead  <don.olmstead@sony.com>
635
636         Unify WebsiteDataStore::defaultDataStoreConfiguration across ports
637         https://bugs.webkit.org/show_bug.cgi?id=194844
638
639         Reviewed by Youenn Fablet.
640
641         Move the Cocoa implementation into APIWebsiteDataStore.cpp as the source of truth and
642         append configuration for Glib's DeviceIdHashSalts storage directory. This also fixes
643         a crash in Windows when running a Service Worker.
644
645         * UIProcess/API/APIWebsiteDataStore.cpp:
646         (API::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory):
647         (API::WebsiteDataStore::defaultDataStoreConfiguration):
648         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
649         (API::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory): Deleted.
650         (API::WebsiteDataStore::defaultDataStoreConfiguration): Deleted.
651         * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
652         (API::WebsiteDataStore::defaultDataStoreConfiguration): Deleted.
653         * UIProcess/API/win/APIWebsiteDataStoreWin.cpp:
654         (API::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory): Deleted.
655         (API::WebsiteDataStore::defaultDataStoreConfiguration): Deleted.
656
657 2019-03-01  John Wilander  <wilander@apple.com>
658
659         Resource Load Statistics: Further restrict client-side cookie persistence after cross-site navigations with link decoration
660         https://bugs.webkit.org/show_bug.cgi?id=195196
661         <rdar://problem/48006419>
662
663         Reviewed by Brent Fulgham.
664
665         Trackers abuse link query parameters to transport user identifiers cross-site.
666         This patch detects such navigations and applies further restrictions to
667         client-site cookies on the destination page.
668
669         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
670         (WebKit::NetworkConnectionToWebProcess::clearPageSpecificDataForResourceLoadStatistics):
671         (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForAllFramesOnPage): Deleted.
672             Renamed NetworkConnectionToWebProcess::clearPageSpecificDataForResourceLoadStatistics().
673         * NetworkProcess/NetworkConnectionToWebProcess.h:
674         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
675         * NetworkProcess/NetworkProcess.cpp:
676         (WebKit::NetworkProcess::committedCrossSiteLoadWithLinkDecoration):
677             Reporting IPC message when a link decorated cross-site navigation happens.
678         (WebKit::NetworkProcess::resetCrossSiteLoadsWithLinkDecorationForTesting):
679         * NetworkProcess/NetworkProcess.h:
680         * NetworkProcess/NetworkProcess.messages.in:
681         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
682         (WKWebsiteDataStoreStatisticsResetToConsistentState):
683             Added clearing of the new state between test runs.
684         * UIProcess/Network/NetworkProcessProxy.cpp:
685         (WebKit::NetworkProcessProxy::resetCrossSiteLoadsWithLinkDecorationForTesting):
686             Test infrastructure.
687         * UIProcess/Network/NetworkProcessProxy.h:
688         * UIProcess/WebPageProxy.cpp:
689         (WebKit::isNonUniqueNavigationWithLinkDecoration):
690             Convenience function.
691         (WebKit::WebPageProxy::didCommitLoadForFrame):
692             This function now reports to the network process when a link decorated
693             cross-site navigation happens.
694         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
695         (WebKit::WebsiteDataStore::resetCrossSiteLoadsWithLinkDecorationForTesting):
696             Test infrastructure.
697         * UIProcess/WebsiteData/WebsiteDataStore.h:
698         * WebProcess/WebPage/WebPage.cpp:
699         (WebKit::WebPage::close):
700             Name change of function called.
701
702 2019-03-01  Tim Horton  <timothy_horton@apple.com>
703
704         Remove unused code in WebKitLegacy
705         https://bugs.webkit.org/show_bug.cgi?id=189614
706
707         Reviewed by Simon Fraser.
708
709         * mac/MigrateHeadersFromWebKitLegacy.make:
710
711 2019-03-01  Tim Horton  <timothy_horton@apple.com>
712
713         Modernize WebKit::AttributedString a little bit
714         https://bugs.webkit.org/show_bug.cgi?id=195200
715
716         Reviewed by Wenson Hsieh.
717
718         * Shared/mac/AttributedString.h:
719         (WebKit::AttributedString::AttributedString):
720         (WebKit::AttributedString::operator NSAttributedString * const):
721         * Shared/mac/AttributedString.mm:
722         (IPC::ArgumentCoder<WebKit::AttributedString>::encode):
723         (IPC::ArgumentCoder<WebKit::AttributedString>::decode):
724         (WebKit::AttributedString::encode const): Deleted.
725         (WebKit::AttributedString::decode): Deleted.
726         * UIProcess/Cocoa/WebViewImpl.mm:
727         (WebKit::WebViewImpl::attributedSubstringForProposedRange):
728         * WebProcess/WebPage/mac/WebPageMac.mm:
729         (WebKit::WebPage::attributedSubstringForCharacterRangeAsync):
730         Modern coders, and a constructor and cast operator to/from NSAttributedString.
731         Also adopt those in a few places just for fun.
732
733 2019-03-01  Youenn Fablet  <youenn@apple.com>
734
735         Serialize IndexedDB::ObjectStoreOverwriteMode as an enum
736         https://bugs.webkit.org/show_bug.cgi?id=195213
737
738         Reviewed by Alex Christensen.
739
740         Make use of enum trait to automatically check for correct enum value when receiving a putOrAdd message.
741
742         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
743         (WebKit::WebIDBConnectionToClient::putOrAdd):
744         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
745         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
746         * Scripts/webkit/messages.py:
747         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
748         (WebKit::WebIDBConnectionToServer::putOrAdd):
749
750 2019-03-01  Don Olmstead  <don.olmstead@sony.com>
751
752         [WinCairo] Enable service worker
753         https://bugs.webkit.org/show_bug.cgi?id=188318
754
755         Reviewed by Youenn Fablet.
756
757         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
758         (WebKit::WebSWContextManagerConnection::terminateProcess):
759         * WebProcess/Storage/WebSWContextManagerConnection.h:
760         * config.h:
761
762 2019-03-01  Chris Dumez  <cdumez@apple.com>
763
764         Flaky API Test TestWebKitAPI.ProcessSwap.LoadUnload
765         https://bugs.webkit.org/show_bug.cgi?id=195110
766
767         Reviewed by Ryosuke Niwa.
768
769         The test was attempting to disable PageCache via view preferences instead of using the
770         process pool configuration flag. This would fail to disable PageCache because the
771         usesPageCache preference would not prevent the creation of SuspendedPageProxy objects.
772         As a result, the firing on the unload event would get delayed until the SuspendedPageProxy
773         objects would get destroyed, which would lead to flakiness.
774
775         This patch updates WebPageProxy::suspendCurrentPageIfPossible() to not create suspended
776         pages proxies when the usesPageCache preference is set to false.
777
778         * UIProcess/WebPageProxy.cpp:
779         (WebKit::WebPageProxy::suspendCurrentPageIfPossible):
780
781 2019-03-01  Carlos Garcia Campos  <cgarcia@igalia.com>
782
783         [ThreadedCompositor] Simply the compositing run loop worker thread
784         https://bugs.webkit.org/show_bug.cgi?id=195208
785
786         Reviewed by Don Olmstead.
787
788         We can remove the WorkQueuePool, since we never really supported more than one thread, and now that single
789         process model non longer exists it doesn't even make sense. We can simply use a RunLoop instead of a WorkQueue
790         so that the implementation is not specific to the generic WorkQueue implementation.
791
792         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
793         (WebKit::createRunLoop): Helper function to create the RunLoop in a worker thread before m_updateTimer is initialized.
794         (WebKit::CompositingRunLoop::CompositingRunLoop): Use createRunLoop().
795         (WebKit::CompositingRunLoop::~CompositingRunLoop): Stop the worker thread run loop in the next main run loop iteration.
796         (WebKit::CompositingRunLoop::performTask): Use m_runLoop.
797         (WebKit::CompositingRunLoop::performTaskSync): Ditto.
798         (WebKit::WorkQueuePool::singleton): Deleted.
799         (WebKit::WorkQueuePool::dispatch): Deleted.
800         (WebKit::WorkQueuePool::runLoop): Deleted.
801         (WebKit::WorkQueuePool::invalidate): Deleted.
802         (WebKit::WorkQueuePool::WorkQueuePool): Deleted.
803         (WebKit::WorkQueuePool::getOrCreateWorkQueueForContext): Deleted.
804         (): Deleted.
805         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
806
807 2019-03-01  Justin Fan  <justin_fan@apple.com>
808
809         [Web GPU] 32-bit builds broken by attempt to disable WebGPU on 32-bit
810         https://bugs.webkit.org/show_bug.cgi?id=195191
811
812         Rubber-stamped by Dean Jackson.
813
814         Dropping support for 32-bit entirely, so I'm intentionally leaving 32-bit broken.
815
816         * Configurations/FeatureDefines.xcconfig:
817
818 2019-02-28  Chris Dumez  <cdumez@apple.com>
819
820         HTTPSUpgradeList.db database should be opened in readonly mode
821         https://bugs.webkit.org/show_bug.cgi?id=195194
822         <rdar://problem/47103889>
823
824         Reviewed by Youenn Fablet.
825
826         HTTPSUpgradeList.db database should be opened in readonly mode since it is not meant to be
827         modified by WebKit. Opening it in ReadWrite mode causes sandbox violations.
828
829         * NetworkProcess/NetworkHTTPSUpgradeChecker.cpp:
830         (WebKit::NetworkHTTPSUpgradeChecker::NetworkHTTPSUpgradeChecker):
831
832 2019-02-28  David Quesada  <david_quesada@apple.com>
833
834         Expose APINavigationAction.shouldPerformDownload() on WKNavigationAction
835         https://bugs.webkit.org/show_bug.cgi?id=195121
836         rdar://problem/48450302
837
838         Reviewed by Alex Christensen.
839
840         * UIProcess/API/Cocoa/WKNavigationAction.mm:
841         (-[WKNavigationAction _shouldPerformDownload]):
842         * UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
843
844 2019-02-28  Antoine Quint  <graouts@apple.com>
845
846         Disable Web Animations in Safari Technology Preview
847         https://bugs.webkit.org/show_bug.cgi?id=194748
848         <rdar://problem/48139481>
849
850         Reviewed by Dean Jackson.
851
852         The test runners already opt into that feature explicitly, so all that is needed is to turn
853         the default setting value to false.
854
855         * Shared/WebPreferences.yaml:
856
857 2019-02-28  Antoine Quint  <graouts@apple.com>
858
859         Enable the Pointer Events runtime flag by default
860         https://bugs.webkit.org/show_bug.cgi?id=195156
861
862         Reviewed by Dean Jackson.
863
864         * Shared/WebPreferences.yaml:
865
866 2019-02-28  Sihui Liu  <sihui_liu@apple.com>
867
868         Revert r232263: it caused processes to crash because process was suspended with locked file
869         https://bugs.webkit.org/show_bug.cgi?id=195122
870         <rdar://problem/48444599>
871
872         Reviewed by Geoffrey Garen.
873
874         * NetworkProcess/NetworkProcess.cpp:
875         (WebKit::NetworkProcess::NetworkProcess):
876         * NetworkProcess/NetworkProcess.h:
877         * Shared/WebSQLiteDatabaseTracker.cpp:
878         (WebKit::WebSQLiteDatabaseTracker::WebSQLiteDatabaseTracker):
879         (WebKit::WebSQLiteDatabaseTracker::hysteresisUpdated):
880         * Shared/WebSQLiteDatabaseTracker.h:
881         * WebProcess/WebProcess.cpp:
882         (WebKit::m_webSQLiteDatabaseTracker):
883         (WebKit::m_nonVisibleProcessCleanupTimer): Deleted.
884         * WebProcess/WebProcess.h:
885
886 2019-02-28  Per Arne Vollan  <pvollan@apple.com>
887
888         [iOS] Move calls to [UIKeyboard isInHardwareKeyboardMode] to the UI process.
889         https://bugs.webkit.org/show_bug.cgi?id=193683
890         <rdar://problem/47634345>
891
892         Reviewed by Brent Fulgham.
893
894         When a keyboard is attached/deattached or the application becomes foreground, send a message from
895         the UI process to the WebContent process, notifying whether a keyboard is attached or not. Also,
896         cache the value of [UIKeyboard isInHardwareKeyboardMode] in the UI process, since this call seems
897         to be expensive.
898
899         * UIProcess/API/Cocoa/WKWebView.mm:
900         (hardwareKeyboardAvailabilityChangedCallback):
901         * UIProcess/WebPageProxy.h:
902         * UIProcess/WebProcessProxy.h:
903         (WebKit::WebProcessProxy::setKeyboardIsAttached):
904         (WebKit::WebProcessProxy::keyboardIsAttached const):
905         * UIProcess/ios/WKContentViewInteraction.mm:
906         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
907         * UIProcess/ios/WebPageProxyIOS.mm:
908         (WebKit::WebPageProxy::applicationWillEnterForeground):
909         (WebKit::WebPageProxy::hardwareKeyboardAvailabilityChanged):
910         * WebProcess/WebPage/WebPage.h:
911         * WebProcess/WebPage/WebPage.messages.in:
912         * WebProcess/WebPage/ios/WebPageIOS.mm:
913         (WebKit::WebPage::platformEditorState const):
914         (WebKit::WebPage::hardwareKeyboardAvailabilityChanged):
915
916 2019-02-28  Carlos Garcia Campos  <cgarcia@igalia.com>
917
918         [CoordinatedGraphics] Remove COORDINATED_GRAPHICS_THREADED option
919         https://bugs.webkit.org/show_bug.cgi?id=195159
920
921         Reviewed by Don Olmstead.
922
923         Use COORDINATED_GRAPHICS instead.
924
925         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
926         (WebKit::CoordinatedGraphicsScene::onNewBufferAvailable):
927         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
928         * Shared/CoordinatedGraphics/SimpleViewportController.cpp:
929         * Shared/CoordinatedGraphics/SimpleViewportController.h:
930         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
931         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
932         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
933         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
934         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp:
935         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.h:
936         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
937         (WebKit::AcceleratedDrawingArea::mainFrameContentSizeChanged):
938         (WebKit::AcceleratedDrawingArea::enterAcceleratedCompositingMode):
939         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
940         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h:
941         * WebProcess/WebPage/DrawingAreaImpl.cpp:
942         (WebKit::DrawingAreaImpl::updatePreferences):
943         * WebProcess/WebPage/WebPage.cpp:
944         (WebKit::WebPage::sendViewportAttributesChanged):
945         (WebKit::WebPage::viewportPropertiesDidChange):
946         * WebProcess/gtk/WebProcessMainGtk.cpp:
947
948 2019-02-28  Sihui Liu  <sihui_liu@apple.com>
949
950         Stop using legacy IDB path by default when creating WebProcessPool from websiteDataStore
951         https://bugs.webkit.org/show_bug.cgi?id=194958
952
953         Reviewed by Geoffrey Garen.
954
955         ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration should not use fixed IDB path.
956
957         * UIProcess/API/APIProcessPoolConfiguration.cpp:
958         (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
959         * UIProcess/API/APIWebsiteDataStore.cpp:
960         (API::WebsiteDataStore::createLegacy):
961         (API::indexedDBDatabaseDirectory):
962         * UIProcess/API/APIWebsiteDataStore.h:
963         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
964         (-[WKWebsiteDataStore _indexedDBDatabaseDirectory]):
965         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
966         * UIProcess/WebProcessPool.cpp:
967         (WebKit::legacyWebsiteDataStoreConfiguration):
968
969 2019-02-28  Carlos Garcia Campos  <cgarcia@igalia.com>
970
971         [CoordinatedGraphics] Unify all LayerTreeHost classes
972         https://bugs.webkit.org/show_bug.cgi?id=195094
973
974         Reviewed by Žan Doberšek.
975
976         There's no reason to have 3 classes, since currently LayerTreeHost is only used by coordinated graphics based
977         ports.
978
979         * PlatformWin.cmake:
980         * SourcesGTK.txt:
981         * SourcesWPE.txt:
982         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
983         (WebKit::AcceleratedDrawingArea::enterAcceleratedCompositingMode):
984         (WebKit::AcceleratedDrawingArea::exitAcceleratedCompositingModeNow):
985         * WebProcess/WebPage/AcceleratedDrawingArea.h:
986         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: Removed.
987         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h: Removed.
988         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp: Renamed from Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp.
989         (WebKit::LayerTreeHost::LayerTreeHost):
990         (WebKit::LayerTreeHost::~LayerTreeHost):
991         (WebKit::LayerTreeHost::setLayerFlushSchedulingEnabled):
992         (WebKit::LayerTreeHost::scheduleLayerFlush):
993         (WebKit::LayerTreeHost::cancelPendingLayerFlush):
994         (WebKit::LayerTreeHost::layerFlushTimerFired):
995         (WebKit::LayerTreeHost::setRootCompositingLayer):
996         (WebKit::LayerTreeHost::setViewOverlayRootLayer):
997         (WebKit::LayerTreeHost::invalidate):
998         (WebKit::LayerTreeHost::scrollNonCompositedContents):
999         (WebKit::LayerTreeHost::forceRepaint):
1000         (WebKit::LayerTreeHost::forceRepaintAsync):
1001         (WebKit::LayerTreeHost::sizeDidChange):
1002         (WebKit::LayerTreeHost::pauseRendering):
1003         (WebKit::LayerTreeHost::resumeRendering):
1004         (WebKit::LayerTreeHost::graphicsLayerFactory):
1005         (WebKit::LayerTreeHost::contentsSizeChanged):
1006         (WebKit::LayerTreeHost::didChangeViewportAttributes):
1007         (WebKit::LayerTreeHost::didChangeViewport):
1008         (WebKit::LayerTreeHost::setIsDiscardable):
1009         (WebKit::LayerTreeHost::setNativeSurfaceHandleForCompositing):
1010         (WebKit::LayerTreeHost::deviceOrPageScaleFactorChanged):
1011         (WebKit::LayerTreeHost::createDisplayRefreshMonitor):
1012         (WebKit::LayerTreeHost::didFlushRootLayer):
1013         (WebKit::LayerTreeHost::commitSceneState):
1014         (WebKit::LayerTreeHost::frameComplete):
1015         (WebKit::LayerTreeHost::nativeSurfaceHandleForCompositing):
1016         (WebKit::LayerTreeHost::didDestroyGLContext):
1017         (WebKit::LayerTreeHost::willRenderFrame):
1018         (WebKit::LayerTreeHost::didRenderFrame):
1019         (WebKit::LayerTreeHost::requestDisplayRefreshMonitorUpdate):
1020         (WebKit::LayerTreeHost::handleDisplayRefreshMonitorUpdate):
1021         (WebKit::LayerTreeHost::renderNextFrame):
1022         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h: Renamed from Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h.
1023         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1024         (WebKit::DrawingAreaImpl::setNeedsDisplay):
1025         (WebKit::DrawingAreaImpl::setNeedsDisplayInRect):
1026         * WebProcess/WebPage/LayerTreeHost.cpp: Removed.
1027         * WebProcess/WebPage/LayerTreeHost.h: Removed.
1028         * WebPage/win/LayerTreeHost.h: Added.
1029
1030 2019-02-28  Justin Fan  <justin_fan@apple.com>
1031
1032         [Web GPU] Enable Web GPU only on 64-bit
1033         https://bugs.webkit.org/show_bug.cgi?id=195139
1034
1035         Because Metal is only supported on 64 bit apps.
1036
1037         Unreviewed build fix.
1038
1039         * Configurations/FeatureDefines.xcconfig:
1040
1041 2019-02-27  Simon Fraser  <simon.fraser@apple.com>
1042
1043         Roll out r242014; it caused crashes in compositing logging (webkit.org/b/195141)
1044
1045         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
1046         (WebKit::LocalAuthenticator::getAssertion):
1047
1048 2019-02-27  Michael Catanzaro  <mcatanzaro@igalia.com>
1049
1050         Unreviewed, fix -Wformat warning
1051
1052         * WebProcess/WebPage/WebPage.cpp:
1053         (WebKit::WebPage::didCompletePageTransition):
1054
1055 2019-02-27  Brent Fulgham  <bfulgham@apple.com>
1056
1057         REGRESSION: Crash beneath ResourceLoadObserver::logSubresourceLoading
1058         https://bugs.webkit.org/show_bug.cgi?id=195072
1059
1060         Reviewed by Ryosuke Niwa.
1061
1062         ResourceLoadObserver and WebProcess should exist as long as the web page (process) is running. However,
1063         the NetworkProcess connection can close for a variety of reasons. If the ResourceLoadObserver observes
1064         a load or user gesture in the WebProcess, we should attempt to reconnect to the NetworkProcess (if it
1065         was disconnected), just like we do for other message send cases.
1066
1067         This patch switches from using the m_networkProcessConnection member (which might be null) to use the
1068         'ensureNetworkProcessConnection' accessor which ensures we have a valid connection for message sends.
1069
1070         * WebProcess/WebProcess.cpp:
1071         (WebKit::WebProcess::initializeWebProcess):
1072
1073 2019-02-27  Chris Dumez  <cdumez@apple.com>
1074
1075         Flaky API Test: TestWebKitAPI.ProcessSwap.SessionStorage
1076         https://bugs.webkit.org/show_bug.cgi?id=194480
1077
1078         Reviewed by Brady Eidson.
1079
1080         The StorageManager would only start listening for IPC on a given connection when
1081         StorageManager::processWillOpenConnection() is called. This gets called from
1082         WebsiteDataStore::webProcessWillOpenConnection() which gets called from
1083         WebProcessLifetimeTracker::webPageEnteringWebProcess().
1084
1085         webPageEnteringWebProcess() was called in WebPageProxy::finishAttachingToWebProcess()
1086         after process-swapping. This means that IPC comming from the *provisional* process
1087         would not get processed and we would only start processing IPC on the provisional
1088         process's connection when it would get committed.
1089
1090         To address the issue, this patch teaches WebProcessLifetimeTracker that a page can
1091         now have several processes. We also make sure that webPageEnteringWebProcess() gets
1092         called for the provisional process as soon as we create the provisional page, instead
1093         of waiting for it to get committed.
1094
1095         * UIProcess/ProvisionalPageProxy.cpp:
1096         (WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
1097         (WebKit::ProvisionalPageProxy::~ProvisionalPageProxy):
1098         (WebKit::ProvisionalPageProxy::connectionWillOpen):
1099         * UIProcess/ProvisionalPageProxy.h:
1100         * UIProcess/WebPageProxy.cpp:
1101         (WebKit::WebPageProxy::finishAttachingToWebProcess):
1102         (WebKit::WebPageProxy::connectionWillOpen):
1103         (WebKit::WebPageProxy::webProcessWillShutDown):
1104         (WebKit::WebPageProxy::processDidTerminate):
1105         * UIProcess/WebPageProxy.h:
1106         (WebKit::WebPageProxy::webProcessLifetimeTracker):
1107         * UIProcess/WebProcessLifetimeObserver.cpp:
1108         (WebKit::WebProcessLifetimeObserver::addWebPage):
1109         (WebKit::WebProcessLifetimeObserver::removeWebPage):
1110         * UIProcess/WebProcessLifetimeObserver.h:
1111         * UIProcess/WebProcessLifetimeTracker.cpp:
1112         (WebKit::WebProcessLifetimeTracker::addObserver):
1113         (WebKit::WebProcessLifetimeTracker::webPageEnteringWebProcess):
1114         (WebKit::WebProcessLifetimeTracker::webPageLeavingWebProcess):
1115         (WebKit::WebProcessLifetimeTracker::pageWasInvalidated):
1116         (WebKit::WebProcessLifetimeTracker::processIsRunning):
1117         * UIProcess/WebProcessLifetimeTracker.h:
1118         * UIProcess/WebProcessProxy.cpp:
1119         (WebKit::WebProcessProxy::connectionWillOpen):
1120         * UIProcess/WebStorage/StorageManager.cpp:
1121         (WebKit::StorageManager::SessionStorageNamespace::allowedConnections const):
1122         (WebKit::StorageManager::SessionStorageNamespace::addAllowedConnection):
1123         (WebKit::StorageManager::SessionStorageNamespace::removeAllowedConnection):
1124         (WebKit::StorageManager::addAllowedSessionStorageNamespaceConnection):
1125         (WebKit::StorageManager::removeAllowedSessionStorageNamespaceConnection):
1126         (WebKit::StorageManager::processWillOpenConnection):
1127         (WebKit::StorageManager::processDidCloseConnection):
1128         (WebKit::StorageManager::createSessionStorageMap):
1129         (WebKit::StorageManager::SessionStorageNamespace::allowedConnection const): Deleted.
1130         (WebKit::StorageManager::SessionStorageNamespace::setAllowedConnection): Deleted.
1131         (WebKit::StorageManager::setAllowedSessionStorageNamespaceConnection): Deleted.
1132         * UIProcess/WebStorage/StorageManager.h:
1133         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1134         (WebKit::WebsiteDataStore::webPageWillOpenConnection):
1135         (WebKit::WebsiteDataStore::webPageDidCloseConnection):
1136
1137 2019-02-27  Wenson Hsieh  <wenson_hsieh@apple.com>
1138
1139         [iOS] Web pages shouldn't be able to present a keyboard after the web view resigns first responder
1140         https://bugs.webkit.org/show_bug.cgi?id=195118
1141         <rdar://problem/43411940>
1142
1143         Reviewed by Tim Horton.
1144
1145         It's currently possible for websites to redirect focus into an editable element on the page by programmatically
1146         requesting focus within the "blur" event handler. This is because our current heuristics:
1147
1148         (1) Allow programmatic focus to show the keyboard when an element is already focused; this is meant to handle
1149             the case where the page moves focus between different elements on the page.
1150         (2) And also allow programmatic focus to show the keyboard when changing activity state; this is meant to handle
1151             the case where a focused element should show the keyboard when first responder is restored on a web view
1152             (e.g. in the case where a modal view controller is dismissed, and the web view regains first responder once
1153             again).
1154
1155         In both of these scenarios, we actually only want the keyboard to appear if the web view itself is either
1156         becoming the first responder, or is already the first responder. Importantly, when blurring the focused element
1157         by calling -[WKWebViewe resignFirstResponder] (as is the case when dismissing the keyboard by tapping 'Done' or
1158         focusing other platform UI), we don't want to allow the page to show the keyboard due to element focus.
1159
1160         To fix this issue, we enforce that we're either becoming the first responder or already are the first responder
1161         before showing the keyboard due to activity state change or focused element change.
1162
1163         Test: fast/events/ios/do-not-show-keyboard-when-focusing-after-blur.html
1164
1165         * UIProcess/ios/WKContentViewInteraction.h:
1166         * UIProcess/ios/WKContentViewInteraction.mm:
1167         (-[WKContentView setupInteraction]):
1168         (-[WKContentView textInputTraits]):
1169
1170         Quick drive-by tweak: rename _isBlurringFocusedNode to _isBlurringFocusedElement, to match the rest of the
1171         terminology used in WebKit.
1172
1173         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
1174
1175         Make our heuristics for determining whether to show the keyboard a tiny bit easier to follow, by moving the
1176         logic into a lambda function and using early returns. See above for more details.
1177
1178         (-[WKContentView _elementDidBlur]):
1179         (-[WKContentView focusedFormControllerDidUpdateSuggestions:]):
1180
1181 2019-02-27  John Wilander  <wilander@apple.com>
1182
1183         Adopt WebCore::RegistrableDomain in WebCore::ResourceLoadStatistics and WebKit::NetworkProcessProxy
1184         https://bugs.webkit.org/show_bug.cgi?id=195071
1185         <rdar://problem/48417690>
1186
1187         Reviewed by Alex Christensen and Brent Fulgham.
1188
1189         This patch adopts WebCore::RegistrableDomain in WebKit::NetworkProcessProxy
1190         and makes the necessary infrastructure changes to support that.
1191
1192         The previous HashCountedSets in WebCore::ResourceLoadStatistics are now just
1193         HashSets since we never used the counts for anything. This change simplified
1194         the IPC::ArgumentCoder<ResourceLoadStatistics> encode and decode functions.
1195
1196         The patch also makes WebCore::RegistrableDomain's String constructor private.
1197         A new create function WebCore::RegistrableDomain::uncheckedCreateFromString()
1198         is introduced to better signal to users that creating a registrable domain
1199         object with a string may create an object that doesn't match a registrable
1200         domain in a valid HTTP-family URL.
1201
1202         Finally, this patch harmonizes parameter and variable naming, going from
1203         "origin" to "domain" and "mainFrame" to "topFrame."
1204
1205         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
1206         (WebKit::ResourceLoadStatisticsMemoryStore::removeDataRecords):
1207         (WebKit::ResourceLoadStatisticsMemoryStore::recursivelyGetAllDomainsThatHaveRedirectedToThisDomain const):
1208         (WebKit::ResourceLoadStatisticsMemoryStore::markAsPrevalentIfHasRedirectedToPrevalent):
1209         (WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccess):
1210         (WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccessInternal):
1211         (WebKit::ResourceLoadStatisticsMemoryStore::logFrameNavigation):
1212         (WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceLoading):
1213         (WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceRedirect):
1214         (WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsSubresourceUnder const):
1215         (WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsSubFrameUnder const):
1216         (WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsRedirectingTo const):
1217         (WebKit::ResourceLoadStatisticsMemoryStore::setSubframeUnderTopFrameDomain):
1218         (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUnderTopFrameDomain):
1219         (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUniqueRedirectTo):
1220         (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUniqueRedirectFrom):
1221         (WebKit::ResourceLoadStatisticsMemoryStore::setTopFrameUniqueRedirectTo):
1222         (WebKit::ResourceLoadStatisticsMemoryStore::setTopFrameUniqueRedirectFrom):
1223         (WebKit::ResourceLoadStatisticsMemoryStore::createEncoderFromData const):
1224         (WebKit::ResourceLoadStatisticsMemoryStore::hasUserGrantedStorageAccessThroughPrompt):
1225         (WebKit::ResourceLoadStatisticsMemoryStore::hasHadUnexpiredRecentUserInteraction const):
1226         (WebKit::ResourceLoadStatisticsMemoryStore::setSubframeUnderTopFrameOrigin): Deleted.
1227         (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUnderTopFrameOrigin): Deleted.
1228         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
1229         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
1230         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessGranted):
1231         (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameDomain):
1232         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameDomain):
1233         (WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
1234         (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin): Deleted.
1235         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin): Deleted.
1236         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
1237         * NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.cpp:
1238         (WebKit::sortedPrevalentResourceTelemetry):
1239         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1240         * NetworkProcess/NetworkProcess.cpp:
1241         (WebKit::NetworkProcess::setSubframeUnderTopFrameDomain):
1242         (WebKit::NetworkProcess::setSubresourceUnderTopFrameDomain):
1243         (WebKit::filterForRegistrableDomains):
1244         (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
1245         (WebKit::NetworkProcess::registrableDomainsWithWebsiteData):
1246         (WebKit::NetworkProcess::setSubframeUnderTopFrameOrigin): Deleted.
1247         (WebKit::NetworkProcess::setSubresourceUnderTopFrameOrigin): Deleted.
1248         * NetworkProcess/NetworkProcess.h:
1249         * NetworkProcess/NetworkProcess.messages.in:
1250         * NetworkProcess/NetworkSession.cpp:
1251         (WebKit::NetworkSession::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
1252         * NetworkProcess/NetworkSession.h:
1253         * Platform/classifier/ResourceLoadStatisticsClassifier.cpp:
1254         (WebKit::ResourceLoadStatisticsClassifier::calculateResourcePrevalence):
1255         * Shared/WebCoreArgumentCoders.cpp:
1256         (IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
1257         (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
1258         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1259         (WKWebsiteDataStoreSetStatisticsSubframeUnderTopFrameOrigin):
1260         (WKWebsiteDataStoreSetStatisticsSubresourceUnderTopFrameOrigin):
1261         * UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm:
1262         (WebKit::ResourceLoadStatisticsMemoryStore::registerUserDefaultsIfNeeded):
1263         * UIProcess/Network/NetworkProcessProxy.cpp:
1264         (WebKit::NetworkProcessProxy::updatePrevalentDomainsToBlockCookiesFor):
1265         (WebKit::NetworkProcessProxy::isPrevalentResource):
1266         (WebKit::NetworkProcessProxy::isVeryPrevalentResource):
1267         (WebKit::NetworkProcessProxy::setPrevalentResource):
1268         (WebKit::NetworkProcessProxy::setPrevalentResourceForDebugMode):
1269         (WebKit::NetworkProcessProxy::setVeryPrevalentResource):
1270         (WebKit::NetworkProcessProxy::setLastSeen):
1271         (WebKit::NetworkProcessProxy::clearPrevalentResource):
1272         (WebKit::NetworkProcessProxy::logUserInteraction):
1273         (WebKit::NetworkProcessProxy::hasHadUserInteraction):
1274         (WebKit::NetworkProcessProxy::clearUserInteraction):
1275         (WebKit::NetworkProcessProxy::setSubframeUnderTopFrameDomain):
1276         (WebKit::NetworkProcessProxy::isRegisteredAsRedirectingTo):
1277         (WebKit::NetworkProcessProxy::isRegisteredAsSubFrameUnder):
1278         (WebKit::NetworkProcessProxy::setSubresourceUnderTopFrameDomain):
1279         (WebKit::NetworkProcessProxy::isRegisteredAsSubresourceUnder):
1280         (WebKit::NetworkProcessProxy::setSubresourceUniqueRedirectTo):
1281         (WebKit::NetworkProcessProxy::setSubresourceUniqueRedirectFrom):
1282         (WebKit::NetworkProcessProxy::setTopFrameUniqueRedirectTo):
1283         (WebKit::NetworkProcessProxy::setTopFrameUniqueRedirectFrom):
1284         (WebKit::NetworkProcessProxy::isGrandfathered):
1285         (WebKit::NetworkProcessProxy::setGrandfathered):
1286         (WebKit::NetworkProcessProxy::hasStorageAccessForFrame):
1287         (WebKit::NetworkProcessProxy::hasStorageAccess):
1288         (WebKit::NetworkProcessProxy::requestStorageAccess):
1289         (WebKit::NetworkProcessProxy::requestStorageAccessConfirm):
1290         (WebKit::NetworkProcessProxy::grantStorageAccess):
1291         (WebKit::NetworkProcessProxy::setSubframeUnderTopFrameOrigin): Deleted.
1292         (WebKit::NetworkProcessProxy::setSubresourceUnderTopFrameOrigin): Deleted.
1293         * UIProcess/Network/NetworkProcessProxy.h:
1294         * UIProcess/Network/NetworkProcessProxy.messages.in:
1295         * UIProcess/WebPageProxy.cpp:
1296         (WebKit::WebPageProxy::requestStorageAccessConfirm):
1297         * UIProcess/WebPageProxy.h:
1298         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1299         (WebKit::WebsiteDataStore::isPrevalentResource):
1300         (WebKit::WebsiteDataStore::setPrevalentResource):
1301         (WebKit::WebsiteDataStore::setPrevalentResourceForDebugMode):
1302         (WebKit::WebsiteDataStore::isVeryPrevalentResource):
1303         (WebKit::WebsiteDataStore::setVeryPrevalentResource):
1304         (WebKit::WebsiteDataStore::setSubframeUnderTopFrameDomain):
1305         (WebKit::WebsiteDataStore::isRegisteredAsSubFrameUnder):
1306         (WebKit::WebsiteDataStore::setSubresourceUnderTopFrameDomain):
1307         (WebKit::WebsiteDataStore::isRegisteredAsSubresourceUnder):
1308         (WebKit::WebsiteDataStore::setSubresourceUniqueRedirectTo):
1309         (WebKit::WebsiteDataStore::setSubresourceUniqueRedirectFrom):
1310         (WebKit::WebsiteDataStore::setTopFrameUniqueRedirectTo):
1311         (WebKit::WebsiteDataStore::setTopFrameUniqueRedirectFrom):
1312         (WebKit::WebsiteDataStore::isRegisteredAsRedirectingTo):
1313         (WebKit::WebsiteDataStore::clearPrevalentResource):
1314         (WebKit::WebsiteDataStore::setLastSeen):
1315         (WebKit::WebsiteDataStore::hasStorageAccess):
1316         (WebKit::WebsiteDataStore::requestStorageAccess):
1317         (WebKit::WebsiteDataStore::grantStorageAccess):
1318         (WebKit::WebsiteDataStore::logUserInteraction):
1319         (WebKit::WebsiteDataStore::hasHadUserInteraction):
1320         (WebKit::WebsiteDataStore::clearUserInteraction):
1321         (WebKit::WebsiteDataStore::setGrandfathered):
1322         (WebKit::WebsiteDataStore::setSubframeUnderTopFrameOrigin): Deleted.
1323         (WebKit::WebsiteDataStore::setSubresourceUnderTopFrameOrigin): Deleted.
1324         * UIProcess/WebsiteData/WebsiteDataStore.h:
1325         * WebProcess/WebPage/WebPage.cpp:
1326         (WebKit::WebPage::hasStorageAccess):
1327         (WebKit::WebPage::requestStorageAccess):
1328
1329 2019-02-27  Keith Rollin  <krollin@apple.com>
1330
1331         Fix Xcode project UUIDs for TextCheckerCompletion.cpp and TextCheckerCompletion.h
1332         https://bugs.webkit.org/show_bug.cgi?id=195109
1333         <rdar://problem/48442272>
1334
1335         Reviewed by Alexey Proskuryakov.
1336
1337         In r144436, TextCheckerCompletion.cpp and TextCheckerCompletion.h were
1338         added to WebKit2.xcodeproj with invalid UUIDs (they included Q's and
1339         Z's in hexadecimal strings). While these UUIDs haven't caused any
1340         problems in practice over the last six years, they are indeed invalid,
1341         and were discovered via an Xcode-project processing tool that did not
1342         anticipate their format. Fix this by removing the files from the
1343         project and re-adding them.
1344
1345         * WebKit.xcodeproj/project.pbxproj:
1346
1347 2019-02-27  Youenn Fablet  <youenn@apple.com>
1348
1349         Remove UserMediaProcessManager processState map
1350         https://bugs.webkit.org/show_bug.cgi?id=195056
1351
1352         Reviewed by Eric Carlson.
1353
1354         Before the patch, the WebProcessProxy->ProcessState map was storing the list of manager proxies and process state.
1355         To improve on this model, this patch does the following:
1356         - Move the process state to WebProcessProxy.
1357         - Remove the map and replace it by a set of all manager proxies.
1358
1359         This simplifies the handling.
1360         On WebProcess side, instead of storing the sandbox extensions in each WebPage, we handle them in WebProcess directly.
1361         This mirrors what is being done in UIProcess and reduces the risk of inconsistencies between the two, the risk being that capture would fail.
1362
1363         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1364         (WebKit::UserMediaPermissionRequestManagerProxy::forEach):
1365         (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy):
1366         (WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy):
1367         (WebKit::UserMediaPermissionRequestManagerProxy::captureStateChanged):
1368         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
1369         * UIProcess/UserMediaProcessManager.cpp:
1370         (WebKit::UserMediaProcessManager::muteCaptureMediaStreamsExceptIn):
1371         (WebKit::UserMediaProcessManager::willCreateMediaStream):
1372         (WebKit::UserMediaProcessManager::endedCaptureSession):
1373         (WebKit::UserMediaProcessManager::setCaptureEnabled):
1374         (WebKit::UserMediaProcessManager::captureDevicesChanged):
1375         (WebKit::ProcessState::ProcessState): Deleted.
1376         (WebKit::ProcessState::hasVideoExtension const): Deleted.
1377         (WebKit::ProcessState::grantVideoExtension): Deleted.
1378         (WebKit::ProcessState::revokeVideoExtension): Deleted.
1379         (WebKit::ProcessState::hasAudioExtension const): Deleted.
1380         (WebKit::ProcessState::grantAudioExtension): Deleted.
1381         (WebKit::ProcessState::revokeAudioExtension): Deleted.
1382         (WebKit::stateMap): Deleted.
1383         (WebKit::processState): Deleted.
1384         (WebKit::ProcessState::addRequestManager): Deleted.
1385         (WebKit::ProcessState::removeRequestManager): Deleted.
1386         (WebKit::UserMediaProcessManager::addUserMediaPermissionRequestManagerProxy): Deleted.
1387         (WebKit::UserMediaProcessManager::removeUserMediaPermissionRequestManagerProxy): Deleted.
1388         (WebKit::UserMediaProcessManager::startedCaptureSession): Deleted.
1389         * UIProcess/UserMediaProcessManager.h:
1390         * UIProcess/WebProcessProxy.h:
1391         (WebKit::WebProcessProxy::mediaCaptureSandboxExtensions const):
1392         (WebKit::WebProcessProxy::hasVideoCaptureExtension const):
1393         (WebKit::WebProcessProxy::grantVideoCaptureExtension):
1394         (WebKit::WebProcessProxy::revokeVideoCaptureExtension):
1395         (WebKit::WebProcessProxy::hasAudioCaptureExtension const):
1396         (WebKit::WebProcessProxy::grantAudioCaptureExtension):
1397         (WebKit::WebProcessProxy::revokeAudioCaptureExtension):
1398         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
1399         (WebKit::UserMediaPermissionRequestManager::~UserMediaPermissionRequestManager): Deleted.
1400         (WebKit::UserMediaPermissionRequestManager::clear): Deleted.
1401         (WebKit::UserMediaPermissionRequestManager::grantUserMediaDeviceSandboxExtensions): Deleted.
1402         (WebKit::UserMediaPermissionRequestManager::revokeUserMediaDeviceSandboxExtensions): Deleted.
1403         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
1404         * WebProcess/WebPage/WebPage.cpp:
1405         (WebKit::WebPage::close):
1406         (WebKit::WebPage::grantUserMediaDeviceSandboxExtensions): Deleted.
1407         (WebKit::WebPage::revokeUserMediaDeviceSandboxExtensions): Deleted.
1408         * WebProcess/WebPage/WebPage.h:
1409         * WebProcess/WebPage/WebPage.messages.in:
1410         * WebProcess/WebProcess.cpp:
1411         (WebKit::WebProcess::grantUserMediaDeviceSandboxExtensions):
1412         (WebKit::WebProcess::revokeUserMediaDeviceSandboxExtensions):
1413         * WebProcess/WebProcess.h:
1414         * WebProcess/WebProcess.messages.in:
1415
1416 2019-02-27  Per Arne Vollan  <pvollan@apple.com>
1417
1418         [macOS] Disable permissive call logging in sandbox
1419         https://bugs.webkit.org/show_bug.cgi?id=194061
1420         <rdar://problem/47686253>
1421
1422         Reviewed by Brent Fulgham.
1423
1424         Strict call filtering should be reenabled.
1425
1426         * WebProcess/com.apple.WebProcess.sb.in:
1427
1428 2019-02-27  Chris Dumez  <cdumez@apple.com>
1429
1430         [HTTPSUpgrade] Use open source database until the feature is ready
1431         https://bugs.webkit.org/show_bug.cgi?id=195069
1432         <rdar://problem/47838224>
1433
1434         Reviewed by Geoffrey Garen.
1435
1436         * DerivedSources-input.xcfilelist:
1437         * DerivedSources.make:
1438
1439 2019-02-27  Antoine Quint  <graouts@apple.com>
1440
1441         Support Pointer Events on macOS
1442         https://bugs.webkit.org/show_bug.cgi?id=195008
1443         <rdar://problem/47454419>
1444
1445         Reviewed by Dean Jackson.
1446
1447         * Configurations/FeatureDefines.xcconfig:
1448
1449 2019-02-27  Sihui Liu  <sihui_liu@apple.com>
1450
1451         Network Process is put to suspended when holding locked IndexedDB files
1452         https://bugs.webkit.org/show_bug.cgi?id=195024
1453         <rdar://problem/45194169>
1454
1455         Reviewed by Geoffrey Garen.
1456
1457         * NetworkProcess/NetworkProcess.cpp:
1458         (WebKit::NetworkProcess::idbServer):
1459         (WebKit::NetworkProcess::notifyHoldingLockedFiles):
1460         * NetworkProcess/NetworkProcess.h:
1461         * UIProcess/Network/NetworkProcessProxy.cpp:
1462         (WebKit::NetworkProcessProxy::didClose):
1463         (WebKit::NetworkProcessProxy::setIsIDBDatabaseHoldingLockedFiles):
1464         * UIProcess/Network/NetworkProcessProxy.h:
1465         * UIProcess/Network/NetworkProcessProxy.messages.in:
1466
1467 2019-02-26  Simon Fraser  <simon.fraser@apple.com>
1468
1469         Have a single notion of scroll position in the scrolling tree and derive layoutViewport from it
1470         https://bugs.webkit.org/show_bug.cgi?id=194973
1471
1472         Reviewed by Antti Koivisto.
1473
1474         This patch cleans up how the scrolling tree responds to scrolls.
1475
1476         First, ScrollingTreeScrollingNode::m_currentScrollPosition is "truth" for scrolling thread/
1477         UI process scroll position.
1478
1479         On macOS where handleWheelEvent on the scrolling thread changes scroll position, the
1480         bottleneck is ScrollingTreeScrollingNode::scrollTo() which sets the new scroll position,
1481         update the visual viewport (for frame scrolls) updates the scrolledContentsLayer position,
1482         updates related layers on this node (counter-scrolling layers etc), and then tells the
1483         scrolling tree, which recurses through descendant nodes so they can adjust their layer
1484         positions.
1485
1486         On iOS, the bottleneck is ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling(),
1487         which does the above other than setting scrolledContentsLayer (since we're reacting to
1488         layer state changes, not producing them).
1489
1490         updateLayersAfterAncestorChange() is renamed to relatedNodeScrollPositionDidChange(), and
1491         ScrollingTree does the tree walk so classes don't have to implement
1492         updateLayersAfterAncestorChange() just to talk children. The ScrollingTree tree walk knows
1493         how to get the correct layoutViewport and to stop at frame boundaries (layer updates never
1494         need to cross frame boundaries).
1495
1496         We preserve 'cumulativeDelta'; it's necessary for things like fixed inside overflow:scroll,
1497         since the fixed state was computed with the "layout" scroll position, so we have to account
1498         for the scroll delta since the last committed position. It's possible we could improve this
1499         in future.
1500
1501         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
1502         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
1503         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
1504         (WebKit::RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling):
1505         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
1506         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
1507         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
1508         (WebKit::RemoteScrollingTree::scrollingTreeNodeDidScroll):
1509         * UIProcess/RemoteLayerTree/RemoteScrollingTree.h:
1510         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
1511         (WebKit::RemoteScrollingCoordinatorProxy::currentLayoutViewport const):
1512         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h:
1513         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
1514         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateAfterChildren):
1515         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::repositionScrollingLayers):
1516         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::repositionRelatedLayers):
1517         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::scrollPosition const): Deleted.
1518         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::setScrollPosition): Deleted.
1519         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::setScrollLayerPosition): Deleted.
1520         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateChildNodesAfterScroll): Deleted.
1521         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterDelegatedScroll): Deleted.
1522         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterViewportChange): Deleted.
1523         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterAncestorChange): Deleted.
1524         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
1525         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
1526         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::repositionScrollingLayers):
1527         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterAncestorChange): Deleted.
1528         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollPosition const): Deleted.
1529         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::setScrollLayerPosition): Deleted.
1530         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterDelegatedScroll): Deleted.
1531         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
1532         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
1533         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::ScrollingTreeScrollingNodeDelegateIOS):
1534         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::repositionScrollingLayers):
1535         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollViewDidScroll):
1536         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateLayersAfterAncestorChange): Deleted.
1537         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollPosition const): Deleted.
1538         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::setScrollLayerPosition): Deleted.
1539         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateChildNodesAfterScroll): Deleted.
1540         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollViewDidScroll const): Deleted.
1541         * UIProcess/RemoteLayerTree/mac/ScrollerPairMac.mm:
1542         (WebKit::ScrollerPairMac::updateValues):
1543         (WebKit::ScrollerPairMac::valuesForOrientation):
1544         * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp:
1545         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::repositionRelatedLayers):
1546         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::setScrollLayerPosition): Deleted.
1547         * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.h:
1548         * UIProcess/ios/WKContentView.mm:
1549         (-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
1550
1551 2019-02-27  Alex Christensen  <achristensen@webkit.org>
1552
1553         Silence log after r242122
1554         https://bugs.webkit.org/show_bug.cgi?id=195074
1555
1556         * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
1557         (WebKit::LocalStorageDatabaseTracker::databasePath const):
1558         m_localStorageDirectory can now be null for ephemeral sessions.
1559         This is not a failure to create a directory and needs no log.
1560         This fixes the WKWebView.InitializingWebViewWithEphemeralStorageDoesNotLog API test.
1561
1562 2019-02-27  Timothy Hatcher  <timothy@apple.com>
1563
1564         REGRESSION: WebKit content crash in Base System (because NSAppearance is NULL).
1565         https://bugs.webkit.org/show_bug.cgi?id=195086
1566         rdar://problem/48419124
1567
1568         Reviewed by Tim Horton.
1569
1570         * UIProcess/RemoteLayerTree/mac/ScrollerMac.mm:
1571         (-[WKScrollerImpDelegate effectiveAppearanceForScrollerImp:]): Always return a valid NSAppearance.
1572
1573 2019-02-26  Chris Dumez  <cdumez@apple.com>
1574
1575         [PSON] Add mechanism to clear suspended pages while bypassing the WebProcess cache
1576         https://bugs.webkit.org/show_bug.cgi?id=195089
1577
1578         Reviewed by Geoffrey Garen.
1579
1580         Add a convenient mechanism to clear suspended pages while bypassing the WebProcess
1581         cache since we need to do this on memory pressure and when clearing website data.
1582
1583         * UIProcess/WebPageProxy.cpp:
1584         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
1585         * UIProcess/WebProcessCache.cpp:
1586         (WebKit::WebProcessCache::addProcessIfPossible):
1587         (WebKit::WebProcessCache::addProcess):
1588         (WebKit::WebProcessCache::takeProcess):
1589         (WebKit::WebProcessCache::CachedProcess::~CachedProcess):
1590         * UIProcess/WebProcessCache.h:
1591         (WebKit::WebProcessCache::setIsDisabled): Deleted.
1592         * UIProcess/WebProcessPool.cpp:
1593         (WebKit::WebProcessPool::handleMemoryPressureWarning):
1594         (WebKit::WebProcessPool::hasSuspendedPageFor const):
1595         (WebKit::WebProcessPool::clearSuspendedPages):
1596         * UIProcess/WebProcessPool.h:
1597         * UIProcess/WebProcessProxy.cpp:
1598         (WebKit::WebProcessProxy::maybeShutDown):
1599         (WebKit::WebProcessProxy::canTerminateAuxiliaryProcess):
1600         * UIProcess/WebProcessProxy.h:
1601         (WebKit::WebProcessProxy::suspendedPageCount const):
1602         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1603         (WebKit::WebsiteDataStore::removeData):
1604
1605 2019-02-26  Alex Christensen  <achristensen@webkit.org>
1606
1607         Move ephemeral local storage from WebProcess to UIProcess
1608         https://bugs.webkit.org/show_bug.cgi?id=195074
1609         <rdar://problem/47937975>
1610
1611         Reviewed by Geoff Garen.
1612
1613         Before PSON, a page could navigate to another domain that navigates back and still have its local storage.
1614         Since PSON makes it unreliable to retain the state in the WebProcess, move it to the process with the rest of the local storage.
1615         If it's ephemeral, we obviously can't use the SQLite on-disk storage implementation, so use the same WebCore::StorageMap we used to in the WebProcess.
1616
1617         * UIProcess/WebStorage/StorageManager.cpp:
1618         (WebKit::StorageManager::LocalStorageNamespace::LocalStorageNamespace):
1619         (WebKit::StorageManager::StorageManager):
1620         (WebKit::StorageManager::createLocalStorageMap):
1621         (WebKit::StorageManager::createTransientLocalStorageMap):
1622         (WebKit::StorageManager::createSessionStorageMap):
1623         (WebKit::StorageManager::destroyStorageMap):
1624         (WebKit::StorageManager::getValues):
1625         (WebKit::StorageManager::setItem):
1626         (WebKit::StorageManager::removeItem):
1627         (WebKit::StorageManager::clear):
1628         * UIProcess/WebStorage/StorageManager.h:
1629         * UIProcess/WebStorage/StorageManager.messages.in:
1630         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1631         (WebKit::WebsiteDataStore::WebsiteDataStore):
1632         * WebProcess/WebStorage/StorageAreaMap.cpp:
1633         (WebKit::StorageAreaMap::StorageAreaMap):
1634         (WebKit::StorageAreaMap::setItem):
1635         (WebKit::StorageAreaMap::removeItem):
1636         (WebKit::StorageAreaMap::clear):
1637         (WebKit::StorageAreaMap::loadValuesIfNeeded):
1638         * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
1639         (WebKit::StorageNamespaceImpl::createEphemeralLocalStorageNamespace):
1640         (WebKit::StorageNamespaceImpl::storageArea):
1641         (WebKit::StorageNamespaceImpl::copy):
1642         (): Deleted.
1643         (WebKit::StorageNamespaceImpl::ephemeralLocalStorageArea): Deleted.
1644         * WebProcess/WebStorage/StorageNamespaceImpl.h:
1645
1646 2019-02-20  Jer Noble  <jer.noble@apple.com>
1647
1648         [Cocoa] Media elements will restart network buffering just before suspending
1649         https://bugs.webkit.org/show_bug.cgi?id=193691
1650
1651         Reviewed by Eric Carlson.
1652
1653         When the WebProcess receives a notification that the process is about to become
1654         suspended, it tells the MemoryPressureHandler to release all critical memory. This
1655         has the side effect of causing AVFoundation-backed media elements to dump their
1656         in-memory caches and start downloading media data again. Instead, media elements
1657         should all stop buffering media data during suspension. Add new testing SPI to
1658         simulate suspension and resume messages.
1659
1660         * UIProcess/API/Cocoa/WKWebView.mm:
1661         (-[WKWebView _processWillSuspendImminentlyForTesting]):
1662         (-[WKWebView _processDidResumeForTesting]):
1663         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1664         * UIProcess/WebProcessProxy.h:
1665         * UIProcess/ios/WKInkPickerView.mm:
1666         * WebProcess/WebPage/WebPage.cpp:
1667         (WebKit::WebPage::suspendAllMediaBuffering):
1668         (WebKit::WebPage::resumeAllMediaBuffering):
1669         * WebProcess/WebPage/WebPage.h:
1670         * WebProcess/WebProcess.cpp:
1671         (WebKit::WebProcess::actualPrepareToSuspend):
1672         (WebKit::WebProcess::cancelPrepareToSuspend):
1673         (WebKit::WebProcess::processDidResume):
1674         (WebKit::WebProcess::suspendAllMediaBuffering):
1675         (WebKit::WebProcess::resumeAllMediaBuffering):
1676         * WebProcess/WebProcess.h:
1677
1678 2019-02-26  Youenn Fablet  <youenn@apple.com>
1679
1680         Move service worker response validation from the service worker client to the service worker itself
1681         https://bugs.webkit.org/show_bug.cgi?id=194716
1682
1683         Reviewed by Geoffrey Garen.
1684
1685         Removed response validation as it is now done in service worker side.
1686
1687         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
1688         (WebKit::ServiceWorkerClientFetch::didReceiveRedirectResponse):
1689         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
1690
1691 2019-02-26  Zalan Bujtas  <zalan@apple.com>
1692
1693         [ContentChangeObserver] clearContentChangeObservers should be internal to ContentChangeObserver class
1694         https://bugs.webkit.org/show_bug.cgi?id=195066
1695         <rdar://problem/48411682>
1696
1697         Reviewed by Tim Horton.
1698
1699         * WebProcess/WebCoreSupport/WebChromeClient.h:
1700         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
1701         (WebKit::WebChromeClient::clearContentChangeObservers): Deleted.
1702
1703 2019-02-26  Per Arne Vollan  <pvollan@apple.com>
1704
1705         [iOS] Sandbox should allow mach lookups related to media capturing
1706         https://bugs.webkit.org/show_bug.cgi?id=194951
1707
1708         Reviewed by Eric Carlson.
1709
1710         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1711
1712 2019-02-26  Brent Fulgham  <bfulgham@apple.com>
1713
1714         Update NetworkSession to use Session Cleanup when available
1715         https://bugs.webkit.org/show_bug.cgi?id=195019
1716         <rdar://problem/45149868>
1717
1718         Reviewed by Alex Christensen.
1719
1720         If the build environment supports Session Cleanup, initialize it.
1721
1722         No test changes since this doesn't do anything on the test systems at present.
1723
1724         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1725         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
1726
1727 2019-02-26  Chris Dumez  <cdumez@apple.com>
1728
1729         [iOS] Regression(PSON) Scroll position is no longer restored when navigating back to reddit.com
1730         https://bugs.webkit.org/show_bug.cgi?id=195054
1731         <rdar://problem/48330549>
1732
1733         Reviewed by Geoff Garen.
1734
1735         We attempt to restore the scroll position twice, on first layout and then on load completion.
1736         Before PSON, the scroll position would fail to get restored on first layout but would succeed
1737         on load completion because the view is tall enough by then. With PSON however, we would
1738         fail to restore the scroll position on load completion because the view would not be tall
1739         enough yet by this point. The reason is that the dynamic resources would not be in the memory cache
1740         and would then get reloaded abd finish loading *after* the load event.
1741
1742         To address the issue, we now make sure to not purge the memory cache on process suspension on
1743         iOS if there is currently a SuspendedPageProxy in the UIProcess for this process.
1744
1745         * UIProcess/SuspendedPageProxy.cpp:
1746         (WebKit::SuspendedPageProxy::SuspendedPageProxy):
1747         (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
1748         * UIProcess/WebProcessProxy.cpp:
1749         (WebKit::WebProcessProxy::incrementSuspendedPageCount):
1750         (WebKit::WebProcessProxy::decrementSuspendedPageCount):
1751         * UIProcess/WebProcessProxy.h:
1752         * WebProcess/WebProcess.cpp:
1753         (WebKit::WebProcess::initializeWebProcess):
1754         (WebKit::WebProcess::setHasSuspendedPageProxy):
1755         * WebProcess/WebProcess.h:
1756         * WebProcess/WebProcess.messages.in:
1757
1758 2019-02-26  Ryosuke Niwa  <rniwa@webkit.org>
1759
1760         [iOS] REGRESSION(r238490?): Safari sometimes shows blank page until a cross site navigation or re-opening the tab
1761         https://bugs.webkit.org/show_bug.cgi?id=195037
1762         <rdar://problem/48154508>
1763
1764         Reviewed by Antti Koivisto.
1765
1766         Restore the pre-r238490 behavior of WebPage::didCompletePageTransition clearing LayerTreeFreezeReason::ProcessSuspended
1767         as this has been an issue when I was able to reproduce the issue locally.
1768
1769         Also added release logging to help diagnose the issue in the future.
1770
1771         * WebProcess/WebPage/WebPage.cpp:
1772         (WebKit::WebPage::freezeLayerTree):
1773         (WebKit::WebPage::unfreezeLayerTree):
1774         (WebKit::WebPage::didCompletePageTransition):
1775         * WebProcess/WebProcess.cpp:
1776         (WebKit::WebProcess::freezeAllLayerTrees):
1777         (WebKit::WebProcess::unfreezeAllLayerTrees):
1778
1779 2019-02-26  Youenn Fablet  <youenn@apple.com>
1780
1781         Create WebPageProxy::m_userMediaPermissionRequestManager only when needed
1782         https://bugs.webkit.org/show_bug.cgi?id=195051
1783
1784         Reviewed by Eric Carlson.
1785
1786         Before the patch, WebPageProxy::m_userMediaPermissionRequestManager was created
1787         in some methods to reset its state when main document is changing, view is becoming visible...
1788         This code is unnecessary if the page did not create it already using JS APIs such as getUserMedia/enumerateDevices/ondevicechange.
1789         This patch skips processing in the other cases if WebPageProxy::m_userMediaPermissionRequestManager is null.
1790
1791         * UIProcess/WebPageProxy.cpp:
1792         (WebKit::WebPageProxy::close): No need to nullify it since it will be done in resetState shortly after.
1793         (WebKit::WebPageProxy::didChangeMainDocument):
1794         (WebKit::WebPageProxy::viewIsBecomingVisible):
1795         (WebKit::WebPageProxy::clearUserMediaState):
1796         (WebKit::WebPageProxy::updatePlayingMediaDidChange): m_userMediaPermissionRequestManager should not be null here
1797         since there is or was some capturing done for the page.
1798
1799 2019-02-26  Zalan Bujtas  <zalan@apple.com>
1800
1801         [ContentChangeObserver] Simplify content observation API by removing explicit DOMTimer observation.
1802         https://bugs.webkit.org/show_bug.cgi?id=195023
1803         <rdar://problem/48381885>
1804
1805         Reviewed by Tim Horton.
1806
1807         * WebProcess/WebPage/ios/WebPageIOS.mm:
1808         (WebKit::WebPage::handleSyntheticClick):
1809
1810 2019-02-26  Takashi Komori  <Takashi.Komori@sony.com>
1811
1812         [Curl] Load HTTP body of 401 response when AuthenticationChange is cancelled.
1813         https://bugs.webkit.org/show_bug.cgi?id=191652
1814
1815         Reviewed by Alex Christensen.
1816
1817         Test: http/tests/security/401-logout/401-logout.php
1818
1819         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
1820         (WebKit::NetworkDataTaskCurl::tryHttpAuthentication):
1821         (WebKit::NetworkDataTaskCurl::tryProxyAuthentication):
1822         * NetworkProcess/curl/NetworkDataTaskCurl.h:
1823
1824 2019-02-26  Youenn Fablet  <youenn@apple.com>
1825
1826         WebPageProxy should nullify m_userMediaPermissionRequestManager after resetting the media state
1827         https://bugs.webkit.org/show_bug.cgi?id=195028
1828         <rdar://problem/48243733>
1829
1830         Reviewed by Eric Carlson.
1831
1832         Covered by API test.
1833
1834         * UIProcess/WebPageProxy.cpp:
1835         (WebKit::WebPageProxy::resetState):
1836
1837 2019-02-26  Philippe Normand <pnormand@igalia.com> and Carlos Garcia Campos  <cgarcia@igalia.com>
1838
1839         [WPE] Add API for webview background color configuration
1840         https://bugs.webkit.org/show_bug.cgi?id=192305
1841
1842         Reviewed by Michael Catanzaro.
1843
1844         In the case of WPE we need to send the background color to the web process to be used as the background color of
1845         the page. This patch adapts the GTK+ implementation to do the same, since it's a lot simpler. The patch also
1846         removes the SetDrawsBackground message in favor of the new SetBackgroundColor message that receives an optional
1847         color.
1848
1849         * PlatformWPE.cmake: Add new WPE API for WebKitColor boxed type.
1850         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1851         (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext): Remove background rendering and opacity handling.
1852         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
1853         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1854         (WebKit::ThreadedCompositor::renderLayerTree): Remove drawsBakground and always clear the context with
1855         transparent color.
1856         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
1857         * Shared/WebPageCreationParameters.cpp:
1858         (WebKit::WebPageCreationParameters::encode const): Replace drawsBackground with backgroundColor.
1859         (WebKit::WebPageCreationParameters::decode): Ditto.
1860         * Shared/WebPageCreationParameters.h:
1861         * SourcesWPE.txt:
1862         * UIProcess/API/glib/WebKitWebView.cpp:
1863         * UIProcess/API/gtk/WebKitWebViewGtk.cpp:
1864         (webkit_web_view_set_background_color):
1865         (webkit_web_view_get_background_color):
1866         * UIProcess/API/wpe/WebKitColor.cpp: Added.
1867         (webkit_color_copy):
1868         (webkit_color_free):
1869         (webkitColorToWebCoreColor):
1870         (webkitColorFillFromWebCoreColor):
1871         (webkit_color_parse):
1872         * UIProcess/API/wpe/WebKitColor.h: Added.
1873         * UIProcess/API/wpe/WebKitColorPrivate.h: Added.
1874         * UIProcess/API/wpe/WebKitWebView.h: Implement webkit_web_view_set_background_color API.
1875         * UIProcess/API/wpe/WebKitWebViewWPE.cpp: Ditto.
1876         (webkit_web_view_set_background_color):
1877         (webkit_web_view_get_background_color):
1878         * UIProcess/API/wpe/docs/wpe-0.1-sections.txt: Add new symbols.
1879         * UIProcess/WebPageProxy.cpp:
1880         (WebKit::WebPageProxy::setDrawsBackground): Set a transparent background color when false is passed.
1881         (WebKit::WebPageProxy::setBackgroundColor): Send background color to the WebProcess.
1882         (WebKit::WebPageProxy::creationParameters): Replace drawsBackground with backgroundColor.
1883         * UIProcess/WebPageProxy.h:
1884         (WebKit::WebPageProxy::drawsBackground const):
1885         (WebKit::WebPageProxy::backgroundColor const):
1886         * UIProcess/cairo/BackingStoreCairo.cpp:
1887         (WebKit::BackingStore::incorporateUpdate): Remove GTK+ code to handle background color.
1888         * UIProcess/gtk/AcceleratedBackingStore.cpp:
1889         * UIProcess/gtk/AcceleratedBackingStore.h: Make paint() pure virtual and remove the implementation.
1890         * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
1891         (WebKit::AcceleratedBackingStoreWayland::paint): Dot not call AcceleratedBackingStore::paint() now that is pure virtual.
1892         * UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
1893         (WebKit::AcceleratedBackingStoreX11::paint): Ditto.
1894         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1895         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage): Use background color as provided by the
1896         UIProcess when creating the FrameView.
1897         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
1898         * WebProcess/WebPage/AcceleratedDrawingArea.h:
1899         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
1900         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
1901         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
1902         (WebKit::ThreadedCoordinatedLayerTreeHost::setIsDiscardable):
1903         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
1904         * WebProcess/WebPage/DrawingArea.h:
1905         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1906         (WebKit::DrawingAreaImpl::display): Remove special case for transparent background.
1907         * WebProcess/WebPage/LayerTreeHost.h:
1908         * WebProcess/WebPage/WebPage.cpp:
1909         (WebKit::WebPage::setBackgroundColor): New API for background color configuration. Proxies to FrameView and DrawingArea.
1910         * WebProcess/WebPage/WebPage.h:
1911         (WebKit::WebPage::backgroundColor const): Read-only access to the current background color.
1912         * WebProcess/WebPage/WebPage.messages.in: Replace SetDrawsBackground message with SetBackgroundColor.
1913
1914 2019-02-25  Yongjun Zhang  <yongjun_zhang@apple.com>
1915
1916         scalableNativeWebpageParameters() is not preserved on new page navigation.
1917         https://bugs.webkit.org/show_bug.cgi?id=194892
1918         <rdar://problem/47538280>
1919
1920         If a page's current default viewport configuration is scalableNativeWebpageParameters due to
1921         the fact that m_canIgnoreScalingConstraints is true, loading a new page should preserve this
1922         configuration until we derive the right values from viewport meta-tag.
1923
1924         Reviewed by Wenson Hsieh.
1925
1926         * WebProcess/WebPage/ios/WebPageIOS.mm:
1927         (WebKit::WebPage::resetViewportDefaultConfiguration): Use nativeWebpageParameters() instance method to
1928             get the appropriate default configuration.
1929
1930 2019-02-25  Wenson Hsieh  <wenson_hsieh@apple.com>
1931
1932         [iOS] Adjust initial scale zooming heuristics when changing view scale
1933         https://bugs.webkit.org/show_bug.cgi?id=194995
1934
1935         Reviewed by Tim Horton.
1936
1937         Currently, we only zoom to the new initial scale iff we're exactly at initial scale before changing the view
1938         scale. This was done so that if a user zoomed in really far and then increased the view scale, we wouldn't end
1939         up zooming out as a result. However, this leads to confusing behavior in the case where the user has manually
1940         changed the zoom scale to something close to (but not exactly) initial scale, and then attempts to zoom in
1941         further using view scale. In this case, we'll end up keeping page scale the same, so it looks like nothing is
1942         happening.
1943
1944         To fix this, we tweak our heuristics for determining whether to jump to initial scale; if the view scale is
1945         increasing and the new initial scale is greater than the current scale, zoom to initial scale. Likewise, if the
1946         view scale is decreasing and the new initial scale is less than the current scale, zoom to initial scale.
1947
1948         Test: fast/viewport/ios/initial-scale-after-changing-view-scale.html
1949
1950         * WebProcess/WebPage/ios/WebPageIOS.mm:
1951         (WebKit::WebPage::setViewportConfigurationViewLayoutSize):
1952
1953 2019-02-25  John Wilander  <wilander@apple.com>
1954
1955         Introduce and adopt new class RegistrableDomain for eTLD+1
1956         https://bugs.webkit.org/show_bug.cgi?id=194791
1957         <rdar://problem/48179240>
1958
1959         Reviewed by Alex Christensen, Fujii Hironori, and Brent Fulgham.
1960
1961         A new API test was added. Plenty of existing layout tests under
1962         http/tests/resourceLoadStatistics/ and http/tests/storageAccess/ test the code.
1963
1964         This patch introduces and adopts a new class called WebCore::RegistrableDomain
1965         which represents a domain's eTLD+1 (effective top level domain plus one) and is
1966         the basis for the term "site," as in same-site. Other popular names include
1967         high-level domain, primary domain, and top privately controlled/owned domain.
1968         Effective top level domains are enumerated on the Public Suffix List
1969         (https://publicsuffix.org).
1970
1971         This class just uses the full domain for when the Public Suffix List cannot help
1972         finding the registrable domain and for WebKit ports that haven't enabled
1973         PUBLIC_SUFFIX_LIST. It also uses the string "nullOrigin" as a representation
1974         for the null or unique origin (this matches how these origins were handled
1975         before).
1976
1977         The implementation is a wrapper around a String and the functions and class
1978         members that now make use of this new class used to handle regular String
1979         objects which didn't help much in terms of type safety or guarantees that the
1980         string had already been converted to an eTLD+1.
1981
1982         We've at least two bad bugs in the Storage Access API because of confusion
1983         between a URL's eTLD+1 and its host. The usage of WebCore::RegistrableDomain
1984         will prohibit such bugs in the future.
1985
1986         Partitioning in WebKit also uses eTLD+1 to a large extent. I plan to adopt
1987         WebCore::RegistrableDomain for partitioning in a later patch.
1988
1989         This patch also enhances parameter naming by:
1990         - Removing parts that refer to "primary" as in primaryDomain.
1991         - Replacing references to "TopPrivatelyControlledDomain" with "RegistrableDomain."
1992         - Replacing references to "TopPrivatelyOwnedDomain" with "RegistrableDomain."
1993         - Using the term "domain" consistently instead of e.g. "host."
1994
1995         A follow-up patch will continue backwards in call chains to create
1996         WebCore::RegistrableDomain objects as early as possible instead of using strings.
1997         I did not do that work here in the interest of patch size.
1998
1999         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
2000         (WebKit::domainsToString):
2001         (WebKit::pruneResources):
2002         (WebKit::ResourceLoadStatisticsMemoryStore::removeDataRecords):
2003         (WebKit::ResourceLoadStatisticsMemoryStore::recursivelyGetAllDomainsThatHaveRedirectedToThisDomain const):
2004         (WebKit::ResourceLoadStatisticsMemoryStore::markAsPrevalentIfHasRedirectedToPrevalent):
2005         (WebKit::ResourceLoadStatisticsMemoryStore::isPrevalentDueToDebugMode):
2006         (WebKit::ResourceLoadStatisticsMemoryStore::hasStorageAccess):
2007         (WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccess):
2008         (WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccessUnderOpener):
2009         (WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccess):
2010         (WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccessInternal):
2011         (WebKit::ResourceLoadStatisticsMemoryStore::grandfatherExistingWebsiteData):
2012         (WebKit::ResourceLoadStatisticsMemoryStore::ensurePrevalentResourcesForDebugMode):
2013         (WebKit::ResourceLoadStatisticsMemoryStore::setPrevalentResourceForDebugMode):
2014         (WebKit::ResourceLoadStatisticsMemoryStore::logFrameNavigation):
2015         (WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceLoading):
2016         (WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceRedirect):
2017         (WebKit::ResourceLoadStatisticsMemoryStore::logUserInteraction):
2018         (WebKit::ResourceLoadStatisticsMemoryStore::clearUserInteraction):
2019         (WebKit::ResourceLoadStatisticsMemoryStore::hasHadUserInteraction):
2020         (WebKit::ResourceLoadStatisticsMemoryStore::setPrevalentResource):
2021         (WebKit::ResourceLoadStatisticsMemoryStore::isPrevalentResource const):
2022         (WebKit::ResourceLoadStatisticsMemoryStore::isVeryPrevalentResource const):
2023         (WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsSubresourceUnder const):
2024         (WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsSubFrameUnder const):
2025         (WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsRedirectingTo const):
2026         (WebKit::ResourceLoadStatisticsMemoryStore::clearPrevalentResource):
2027         (WebKit::ResourceLoadStatisticsMemoryStore::setGrandfathered):
2028         (WebKit::ResourceLoadStatisticsMemoryStore::isGrandfathered const):
2029         (WebKit::ResourceLoadStatisticsMemoryStore::setSubframeUnderTopFrameOrigin):
2030         (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUnderTopFrameOrigin):
2031         (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUniqueRedirectTo):
2032         (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUniqueRedirectFrom):
2033         (WebKit::ResourceLoadStatisticsMemoryStore::setTopFrameUniqueRedirectTo):
2034         (WebKit::ResourceLoadStatisticsMemoryStore::setTopFrameUniqueRedirectFrom):
2035         (WebKit::ResourceLoadStatisticsMemoryStore::ensureResourceStatisticsForRegistrableDomain):
2036         (WebKit::ResourceLoadStatisticsMemoryStore::mergeStatistics):
2037         (WebKit::ResourceLoadStatisticsMemoryStore::hasUserGrantedStorageAccessThroughPrompt):
2038         (WebKit::debugLogDomainsInBatches):
2039         (WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlocking):
2040         (WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlockingForDomains):
2041         (WebKit::ResourceLoadStatisticsMemoryStore::clearBlockingStateForDomains):
2042         (WebKit::ResourceLoadStatisticsMemoryStore::registrableDomainsToRemoveWebsiteDataFor):
2043         (WebKit::ResourceLoadStatisticsMemoryStore::pruneStatisticsIfNeeded):
2044         (WebKit::ResourceLoadStatisticsMemoryStore::setLastSeen):
2045         (WebKit::ResourceLoadStatisticsMemoryStore::setVeryPrevalentResource):
2046         (WebKit::ResourceLoadStatisticsMemoryStore::ensureResourceStatisticsForPrimaryDomain): Deleted.
2047         (WebKit::ResourceLoadStatisticsMemoryStore::topPrivatelyControlledDomainsToRemoveWebsiteDataFor): Deleted.
2048         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
2049         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
2050         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResourceForDebugMode):
2051         (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
2052         (WebKit::WebResourceLoadStatisticsStore::hasStorageAccessForFrame):
2053         (WebKit::WebResourceLoadStatisticsStore::callHasStorageAccessForFrameHandler):
2054         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessGranted):
2055         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
2056         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener):
2057         (WebKit::WebResourceLoadStatisticsStore::grantStorageAccess):
2058         (WebKit::WebResourceLoadStatisticsStore::callGrantStorageAccessHandler):
2059         (WebKit::WebResourceLoadStatisticsStore::logFrameNavigation):
2060         (WebKit::WebResourceLoadStatisticsStore::logWebSocketLoading):
2061         (WebKit::WebResourceLoadStatisticsStore::logSubresourceLoading):
2062         (WebKit::WebResourceLoadStatisticsStore::logSubresourceRedirect):
2063         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
2064         (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction):
2065         (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
2066         (WebKit::WebResourceLoadStatisticsStore::setLastSeen):
2067         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
2068         (WebKit::WebResourceLoadStatisticsStore::setVeryPrevalentResource):
2069         (WebKit::WebResourceLoadStatisticsStore::isPrevalentResource):
2070         (WebKit::WebResourceLoadStatisticsStore::isVeryPrevalentResource):
2071         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubresourceUnder):
2072         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubFrameUnder):
2073         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsRedirectingTo):
2074         (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
2075         (WebKit::WebResourceLoadStatisticsStore::setGrandfathered):
2076         (WebKit::WebResourceLoadStatisticsStore::isGrandfathered):
2077         (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin):
2078         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin):
2079         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo):
2080         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectFrom):
2081         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectTo):
2082         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectFrom):
2083         (WebKit::WebResourceLoadStatisticsStore::scheduleCookieBlockingUpdateForDomains):
2084         (WebKit::WebResourceLoadStatisticsStore::scheduleClearBlockingStateForDomains):
2085         (WebKit::WebResourceLoadStatisticsStore::callUpdatePrevalentDomainsToBlockCookiesForHandler):
2086         (WebKit::WebResourceLoadStatisticsStore::removePrevalentDomains):
2087         (WebKit::WebResourceLoadStatisticsStore::callRemoveDomainsHandler):
2088         (WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
2089         (WebKit::WebResourceLoadStatisticsStore::registrableDomainsWithWebsiteData):
2090         (WebKit::isolatedPrimaryDomain): Deleted.
2091         (WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores): Deleted.
2092         (WebKit::WebResourceLoadStatisticsStore::topPrivatelyControlledDomainsWithWebsiteData): Deleted.
2093         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
2094         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2095         (WebKit::NetworkConnectionToWebProcess::logUserInteraction):
2096         (WebKit::NetworkConnectionToWebProcess::logWebSocketLoading):
2097         (WebKit::NetworkConnectionToWebProcess::logSubresourceLoading):
2098         (WebKit::NetworkConnectionToWebProcess::logSubresourceRedirect):
2099         (WebKit::NetworkConnectionToWebProcess::hasStorageAccess):
2100         (WebKit::NetworkConnectionToWebProcess::requestStorageAccess):
2101         * NetworkProcess/NetworkConnectionToWebProcess.h:
2102         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2103         * NetworkProcess/NetworkProcess.cpp:
2104         (WebKit::NetworkProcess::updatePrevalentDomainsToBlockCookiesFor):
2105         (WebKit::NetworkProcess::isGrandfathered):
2106         (WebKit::NetworkProcess::isPrevalentResource):
2107         (WebKit::NetworkProcess::isVeryPrevalentResource):
2108         (WebKit::NetworkProcess::setGrandfathered):
2109         (WebKit::NetworkProcess::setPrevalentResource):
2110         (WebKit::NetworkProcess::setPrevalentResourceForDebugMode):
2111         (WebKit::NetworkProcess::setVeryPrevalentResource):
2112         (WebKit::NetworkProcess::clearPrevalentResource):
2113         (WebKit::NetworkProcess::setSubframeUnderTopFrameOrigin):
2114         (WebKit::NetworkProcess::isRegisteredAsRedirectingTo):
2115         (WebKit::NetworkProcess::isRegisteredAsSubFrameUnder):
2116         (WebKit::NetworkProcess::setSubresourceUnderTopFrameOrigin):
2117         (WebKit::NetworkProcess::setSubresourceUniqueRedirectTo):
2118         (WebKit::NetworkProcess::setSubresourceUniqueRedirectFrom):
2119         (WebKit::NetworkProcess::isRegisteredAsSubresourceUnder):
2120         (WebKit::NetworkProcess::setTopFrameUniqueRedirectTo):
2121         (WebKit::NetworkProcess::setTopFrameUniqueRedirectFrom):
2122         (WebKit::NetworkProcess::setLastSeen):
2123         (WebKit::NetworkProcess::hasStorageAccessForFrame):
2124         (WebKit::NetworkProcess::hasStorageAccess):
2125         (WebKit::NetworkProcess::requestStorageAccess):
2126         (WebKit::NetworkProcess::requestStorageAccessGranted):
2127         (WebKit::NetworkProcess::grantStorageAccess):
2128         (WebKit::NetworkProcess::logFrameNavigation):
2129         (WebKit::NetworkProcess::logUserInteraction):
2130         (WebKit::NetworkProcess::hadUserInteraction):
2131         (WebKit::NetworkProcess::clearUserInteraction):
2132         (WebKit::NetworkProcess::removePrevalentDomains):
2133         (WebKit::filterForRegistrableDomains):
2134         (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
2135         (WebKit::NetworkProcess::registrableDomainsWithWebsiteData):
2136         (WebKit::filterForTopLevelDomains): Deleted.
2137         (WebKit::NetworkProcess::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores): Deleted.
2138         (WebKit::NetworkProcess::topPrivatelyControlledDomainsWithWebsiteData): Deleted.
2139         * NetworkProcess/NetworkProcess.h:
2140         * NetworkProcess/NetworkProcess.messages.in:
2141         * NetworkProcess/NetworkResourceLoader.cpp:
2142         (WebKit::logCookieInformationInternal):
2143         * NetworkProcess/NetworkSession.cpp:
2144         (WebKit::NetworkSession::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
2145         (WebKit::NetworkSession::registrableDomainsWithWebsiteData):
2146         (WebKit::NetworkSession::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores): Deleted.
2147         (WebKit::NetworkSession::topPrivatelyControlledDomainsWithWebsiteData): Deleted.
2148         * NetworkProcess/NetworkSession.h:
2149         * Shared/WebCoreArgumentCoders.cpp:
2150         (IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
2151         (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
2152         * UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm:
2153         (WebKit::ResourceLoadStatisticsMemoryStore::registerUserDefaultsIfNeeded):
2154         * UIProcess/Network/NetworkProcessProxy.cpp:
2155         (WebKit::NetworkProcessProxy::updatePrevalentDomainsToBlockCookiesFor):
2156         (WebKit::NetworkProcessProxy::isPrevalentResource):
2157         (WebKit::NetworkProcessProxy::isVeryPrevalentResource):
2158         (WebKit::NetworkProcessProxy::setPrevalentResource):
2159         (WebKit::NetworkProcessProxy::setPrevalentResourceForDebugMode):
2160         (WebKit::NetworkProcessProxy::setVeryPrevalentResource):
2161         (WebKit::NetworkProcessProxy::setLastSeen):
2162         (WebKit::NetworkProcessProxy::clearPrevalentResource):
2163         (WebKit::NetworkProcessProxy::logUserInteraction):
2164         (WebKit::NetworkProcessProxy::hasHadUserInteraction):
2165         (WebKit::NetworkProcessProxy::clearUserInteraction):
2166         (WebKit::NetworkProcessProxy::setSubframeUnderTopFrameOrigin):
2167         (WebKit::NetworkProcessProxy::isRegisteredAsRedirectingTo):
2168         (WebKit::NetworkProcessProxy::isRegisteredAsSubFrameUnder):
2169         (WebKit::NetworkProcessProxy::setSubresourceUnderTopFrameOrigin):
2170         (WebKit::NetworkProcessProxy::isRegisteredAsSubresourceUnder):
2171         (WebKit::NetworkProcessProxy::setSubresourceUniqueRedirectTo):
2172         (WebKit::NetworkProcessProxy::setSubresourceUniqueRedirectFrom):
2173         (WebKit::NetworkProcessProxy::setTopFrameUniqueRedirectTo):
2174         (WebKit::NetworkProcessProxy::setTopFrameUniqueRedirectFrom):
2175         (WebKit::NetworkProcessProxy::isGrandfathered):
2176         (WebKit::NetworkProcessProxy::setGrandfathered):
2177         (WebKit::NetworkProcessProxy::hasStorageAccessForFrame):
2178         (WebKit::NetworkProcessProxy::hasStorageAccess):
2179         (WebKit::NetworkProcessProxy::requestStorageAccess):
2180         (WebKit::NetworkProcessProxy::grantStorageAccess):
2181         (WebKit::NetworkProcessProxy::notifyWebsiteDataDeletionForRegistrableDomainsFinished):
2182         (WebKit::NetworkProcessProxy::notifyWebsiteDataScanForRegistrableDomainsFinished):
2183         (WebKit::NetworkProcessProxy::notifyWebsiteDataDeletionForTopPrivatelyOwnedDomainsFinished): Deleted.
2184         (WebKit::NetworkProcessProxy::notifyWebsiteDataScanForTopPrivatelyControlledDomainsFinished): Deleted.
2185         * UIProcess/Network/NetworkProcessProxy.h:
2186         * UIProcess/Network/NetworkProcessProxy.messages.in:
2187         * UIProcess/WebPageProxy.cpp:
2188         (WebKit::WebPageProxy::logFrameNavigation):
2189         (WebKit::WebPageProxy::requestStorageAccessConfirm):
2190         * UIProcess/WebProcessProxy.cpp:
2191         (WebKit::WebProcessProxy::notifyPageStatisticsAndDataRecordsProcessed):
2192         (WebKit::WebProcessProxy::notifyWebsiteDataScanForRegistrableDomainsFinished):
2193         (WebKit::WebProcessProxy::notifyWebsiteDataDeletionForRegistrableDomainsFinished):
2194         (WebKit::WebProcessProxy::notifyWebsiteDataScanForTopPrivatelyControlledDomainsFinished): Deleted.
2195         (WebKit::WebProcessProxy::notifyWebsiteDataDeletionForTopPrivatelyOwnedDomainsFinished): Deleted.
2196         * UIProcess/WebProcessProxy.h:
2197         * UIProcess/WebResourceLoadStatisticsStore.messages.in:
2198         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2199         (WebKit::WebsiteDataStore::isPrevalentResource):
2200         (WebKit::WebsiteDataStore::setPrevalentResource):
2201         (WebKit::WebsiteDataStore::setPrevalentResourceForDebugMode):
2202         (WebKit::WebsiteDataStore::isVeryPrevalentResource):
2203         (WebKit::WebsiteDataStore::setVeryPrevalentResource):
2204         (WebKit::WebsiteDataStore::setSubframeUnderTopFrameOrigin):
2205         (WebKit::WebsiteDataStore::isRegisteredAsSubFrameUnder):
2206         (WebKit::WebsiteDataStore::setSubresourceUnderTopFrameOrigin):
2207         (WebKit::WebsiteDataStore::isRegisteredAsSubresourceUnder):
2208         (WebKit::WebsiteDataStore::setSubresourceUniqueRedirectTo):
2209         (WebKit::WebsiteDataStore::setSubresourceUniqueRedirectFrom):
2210         (WebKit::WebsiteDataStore::setTopFrameUniqueRedirectTo):
2211         (WebKit::WebsiteDataStore::setTopFrameUniqueRedirectFrom):
2212         (WebKit::WebsiteDataStore::isRegisteredAsRedirectingTo):
2213         (WebKit::WebsiteDataStore::clearPrevalentResource):
2214         (WebKit::WebsiteDataStore::setLastSeen):
2215         (WebKit::WebsiteDataStore::hasStorageAccess):
2216         (WebKit::WebsiteDataStore::requestStorageAccess):
2217         (WebKit::WebsiteDataStore::grantStorageAccess):
2218         (WebKit::WebsiteDataStore::logUserInteraction):
2219         (WebKit::WebsiteDataStore::hasHadUserInteraction):
2220         (WebKit::WebsiteDataStore::clearUserInteraction):
2221         (WebKit::WebsiteDataStore::setGrandfathered):
2222         (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains): Deleted.
2223         * UIProcess/WebsiteData/WebsiteDataStore.h:
2224         * WebProcess/WebPage/WebPage.cpp:
2225         (WebKit::WebPage::hasStorageAccess):
2226         (WebKit::WebPage::requestStorageAccess):
2227         * WebProcess/WebProcess.cpp:
2228         (WebKit::m_nonVisibleProcessCleanupTimer):
2229         (WebKit::WebProcess::initializeWebProcess):
2230
2231 2019-02-25  Adrian Perez de Castro  <aperez@igalia.com>
2232
2233         [WPE] Bump WPEBackend-fdo requirement to API version 1.0
2234         https://bugs.webkit.org/show_bug.cgi?id=195001
2235
2236         Reviewed by Carlos Garcia Campos.
2237
2238         API version 1.0 always includes the functionality previously guarded with
2239         WPE_BACKEND_CHECK_VERSION(): remove the guards and always use the new functions
2240         unconditionally.
2241
2242         * UIProcess/API/wpe/WPEView.cpp:
2243         (WKWPE::View::View): Remove usage of WPE_BACKEND_CHECK_VERSION().
2244         (WKWPE::m_backend): Ditto.
2245         * UIProcess/API/wpe/qt/WPEQtViewBackend.cpp:
2246         (WPEQtViewBackend::WPEQtViewBackend): Use libWPEBackend-fdo-1.0 as
2247         library name, remove call to wpe_fdo_initialize_for_egl_display().
2248         (WPEQtViewBackend::create): Call wpe_fdo_initialize_for_egl_display()
2249         here, to bail out early in case initialization fails.
2250         * UIProcess/glib/WebProcessPoolGLib.cpp:
2251         (WebKit::WebProcessPool::platformInitializeWebProcess): Remove usage of
2252         WPE_BACKEND_CHECK_VERSION().
2253
2254 2019-02-25  Per Arne Vollan  <pvollan@apple.com>
2255
2256         A prewarmed Web process should have a process assertion.
2257         https://bugs.webkit.org/show_bug.cgi?id=195006
2258
2259         Reviewed by Geoffrey Garen.
2260
2261         To make sure the prewarm message is handled in the Web process before the process is suspended,
2262         the process should have a process assertion. This can be fixed by sending the prewarm message
2263         inside WebProcessPool::initializeNewWebProcess, since all message sent inside this method are
2264         guaranteed to be handled before the WebContent process is suspended.
2265
2266         This patch is based on Chris Dumez' idea and obervation of the issue.
2267
2268         * UIProcess/WebProcessPool.cpp:
2269         (WebKit::WebProcessPool::createNewWebProcess):
2270         (WebKit::WebProcessPool::initializeNewWebProcess):
2271         * UIProcess/WebProcessPool.h:
2272
2273 2019-02-25  Michael Catanzaro  <mcatanzaro@igalia.com>
2274
2275         [GTK] Enable PSON
2276         https://bugs.webkit.org/show_bug.cgi?id=194979
2277
2278         Reviewed by Žan Doberšek.
2279
2280         It is expected that this may introduce unexpected regressions, so it's appropriate to do
2281         this at the start of a new release cycle.
2282
2283         * Shared/WebPreferencesDefaultValues.h:
2284
2285 2019-02-25  Michael Catanzaro  <mcatanzaro@igalia.com>
2286
2287         [WPE][GTK] Clean up handling of WEBKIT_FORCE_COMPLEX_TEXT
2288         https://bugs.webkit.org/show_bug.cgi?id=194614
2289
2290         Reviewed by Carlos Garcia Campos.
2291
2292         This environment variable is now enabled for WPE, not just for GTK.
2293
2294         It is now possible to use this environment variable to enable complex text, not just to
2295         disable it.
2296
2297         WebProcessPool::setAlwaysUsesComplexTextCodePath is fixed to be respected even when this
2298         environment variable is set, although WPE and GTK will never do so.
2299
2300         * UIProcess/glib/WebProcessPoolGLib.cpp:
2301         (WebKit::WebProcessPool::platformInitialize):
2302         (WebKit::WebProcessPool::platformInitializeWebProcess):
2303
2304 2019-02-24  Zalan Bujtas  <zalan@apple.com>
2305
2306         Introduce ContentChangeObserver class
2307         https://bugs.webkit.org/show_bug.cgi?id=194977
2308         <rdar://problem/48338115>
2309
2310         Reviewed by Simon Fraser.
2311
2312         * WebProcess/WebPage/ios/WebPageIOS.mm:
2313         (WebKit::WebPage::handleSyntheticClick):
2314         (WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
2315
2316 2019-02-24  Simon Fraser  <simon.fraser@apple.com>
2317
2318         Migrate from "fixedPositionRect" to "layoutViewport" in the scrolling tree
2319         https://bugs.webkit.org/show_bug.cgi?id=194984
2320
2321         Reviewed by Sam Weinig.
2322
2323         Rename "fixedPositionRect" to "layoutViewport" in scrolling tree code.
2324
2325         Remove ScrollingTree::fixedPositionRect() which was only used on iOS, to fetch the
2326         current layout viewport rect. Instead, set the layout viewport on the root
2327         node in ScrollingTree::mainFrameViewportChangedViaDelegatedScrolling().
2328         
2329         Add a WK2 Scrolling log channel.
2330
2331         * Platform/Logging.h:
2332         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
2333         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
2334         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
2335         (WebKit::RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling):
2336         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
2337         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
2338         (WebKit::RemoteScrollingTree::fixedPositionRect): Deleted.
2339         * UIProcess/RemoteLayerTree/RemoteScrollingTree.h:
2340         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
2341         (WebKit::RemoteScrollingCoordinatorProxy::currentLayoutViewport const):
2342         (WebKit::RemoteScrollingCoordinatorProxy::customFixedPositionRect const): Deleted.
2343         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h:
2344         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
2345         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateChildNodesAfterScroll):
2346         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterViewportChange):
2347         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterAncestorChange):
2348         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
2349         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
2350         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterAncestorChange):
2351         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
2352         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
2353         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateLayersAfterAncestorChange):
2354         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateChildNodesAfterScroll):
2355         * UIProcess/ios/WKContentView.mm:
2356         (-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
2357
2358 2019-02-20  Darin Adler  <darin@apple.com>
2359
2360         Finish removing String::format
2361         https://bugs.webkit.org/show_bug.cgi?id=194893
2362
2363         Reviewed by Daniel Bates.
2364
2365         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
2366         (WebKit::LocalAuthenticator::getAssertion): Use makeString, attempting to fix
2367         a problem where we passed an NSData * to format with a "%s"."
2368
2369 2019-02-24  Michael Catanzaro  <mcatanzaro@igalia.com>
2370
2371         [WPE] Install MemoryPressureHandler in UIProcess
2372         https://bugs.webkit.org/show_bug.cgi?id=194617
2373
2374         Reviewed by Žan Doberšek.
2375
2376         Currently only GTK and Cocoa ports run MemoryPressureHandler in the UI process. WPE should
2377         too.
2378
2379         We need @no-unify to avoid changing the unified source bundles under API/, which are
2380         notoriously fragile. (WebMemoryPressureHandler.cpp sorts just above API/.)
2381
2382         * SourcesWPE.txt:
2383         * UIProcess/WebMemoryPressureHandler.cpp:
2384         (WebKit::installMemoryPressureHandler):
2385         * UIProcess/glib/WebProcessPoolGLib.cpp:
2386         (WebKit::WebProcessPool::platformInitialize):
2387
2388 2019-02-23  Chris Dumez  <cdumez@apple.com>
2389
2390         Give DrawingAreas their own identifiers
2391         https://bugs.webkit.org/show_bug.cgi?id=194969
2392         <rdar://problem/48154508>
2393
2394         Unreviewed, fix API test debug assertion failures after r241988.
2395         We do not support sending an ObjectIdentifier that is 0 via IPC so update WebPageProxy::CreateNewPage
2396         IPC to return an Optional<WebPageCreationParameters> instead of a WebPageCreationParameters. It returns
2397         nullopt when there this no UIClient or the client did not create the page, instead of returning a
2398         default-initialized WebPageCreationParameters.
2399
2400         * UIProcess/WebPageProxy.cpp:
2401         (WebKit::WebPageProxy::createNewPage):
2402         * UIProcess/WebPageProxy.messages.in:
2403         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2404         (WebKit::WebChromeClient::createWindow):
2405
2406 2019-02-23  Simon Fraser  <simon.fraser@apple.com>
2407
2408         Remove remnants of iOS WK1 scrolling tree code
2409         https://bugs.webkit.org/show_bug.cgi?id=194980
2410
2411         Reviewed by Sam Weinig.
2412
2413         Remove ScrollingTreeIOS and ScrollingCoordinatorIOS which were never instantiated.
2414
2415         Merge ScrollingTreeFrameScrollingNodeIOS into ScrollingTreeFrameScrollingNodeRemoteIOS,
2416         removing code which never applies to iOS WK2 (e.g. the synchronous scrolling code path).
2417
2418         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
2419         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h:
2420         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
2421         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::ScrollingTreeFrameScrollingNodeRemoteIOS):
2422         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateBeforeChildren):
2423         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateAfterChildren):
2424         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::minimumScrollPosition const):
2425         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::maximumScrollPosition const):
2426         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::scrollPosition const):
2427         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::setScrollPosition):
2428         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::setScrollLayerPosition):
2429         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateChildNodesAfterScroll):
2430         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterDelegatedScroll):
2431         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterViewportChange):
2432         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterAncestorChange):
2433         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
2434
2435 2019-02-23  Keith Miller  <keith_miller@apple.com>
2436
2437         Add new mac target numbers
2438         https://bugs.webkit.org/show_bug.cgi?id=194955
2439
2440         Reviewed by Tim Horton.
2441
2442         * Configurations/Base.xcconfig:
2443         * Configurations/DebugRelease.xcconfig:
2444
2445 2019-02-22  Chris Dumez  <cdumez@apple.com>
2446
2447         Give DrawingAreas their own identifiers
2448         https://bugs.webkit.org/show_bug.cgi?id=194969
2449         <rdar://problem/48154508>
2450
2451         Reviewed by Geoffrey Garen.
2452
2453         Give DrawingAreas their own identifiers instead of using the pageID. It will make the IPC more robust now that a
2454         WebPageProxy can have several drawing areas with PSON.
2455
2456         * Shared/DrawingAreaInfo.h:
2457         * Shared/WebPageCreationParameters.cpp:
2458         (WebKit::WebPageCreationParameters::encode const):
2459         (WebKit::WebPageCreationParameters::decode):
2460         * Shared/WebPageCreationParameters.h:
2461         * UIProcess/AcceleratedDrawingAreaProxy.cpp:
2462         (WebKit::AcceleratedDrawingAreaProxy::sendUpdateBackingStoreState):
2463         (WebKit::AcceleratedDrawingAreaProxy::waitForAndDispatchDidUpdateBackingStoreState):
2464         (WebKit::AcceleratedDrawingAreaProxy::setNativeSurfaceHandleForCompositing):
2465         (WebKit::AcceleratedDrawingAreaProxy::destroyNativeSurfaceHandleForCompositing):
2466         * UIProcess/DrawingAreaProxy.cpp:
2467         (WebKit::DrawingAreaProxy::DrawingAreaProxy):
2468         (WebKit::DrawingAreaProxy::~DrawingAreaProxy):
2469         (WebKit::DrawingAreaProxy::messageSenderConnection const):
2470         (WebKit::DrawingAreaProxy::sendMessage):
2471         (WebKit::DrawingAreaProxy::viewExposedRectChangedTimerFired):
2472         * UIProcess/DrawingAreaProxy.h:
2473         (WebKit::DrawingAreaProxy::identifier const):
2474         (WebKit::DrawingAreaProxy::process const):
2475         * UIProcess/DrawingAreaProxyImpl.cpp:
2476         (WebKit::DrawingAreaProxyImpl::update):
2477         * UIProcess/ProvisionalPageProxy.cpp:
2478         (WebKit::ProvisionalPageProxy::initializeWebPage):
2479         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
2480         (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
2481         (WebKit::RemoteLayerTreeDrawingAreaProxy::~RemoteLayerTreeDrawingAreaProxy):
2482         (WebKit::RemoteLayerTreeDrawingAreaProxy::deviceScaleFactorDidChange):
2483         (WebKit::RemoteLayerTreeDrawingAreaProxy::sendUpdateGeometry):
2484         (WebKit::RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidStart):
2485         (WebKit::RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidEnd):
2486         (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
2487         (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateActivityState):
2488         (WebKit::RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing):
2489         * UIProcess/WebPageProxy.cpp:
2490         (WebKit::WebPageProxy::initializeWebPage):
2491         (WebKit::WebPageProxy::createNewPage):
2492         (WebKit::WebPageProxy::creationParameters):
2493         * UIProcess/WebPageProxy.h:
2494         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
2495         (WebKit::TiledCoreAnimationDrawingAreaProxy::deviceScaleFactorDidChange):
2496         (WebKit::TiledCoreAnimationDrawingAreaProxy::colorSpaceDidChange):
2497         (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateActivityState):
2498         (WebKit::TiledCoreAnimationDrawingAreaProxy::sendUpdateGeometry):
2499         (WebKit::TiledCoreAnimationDrawingAreaProxy::adjustTransientZoom):
2500         (WebKit::TiledCoreAnimationDrawingAreaProxy::commitTransientZoom):
2501         (WebKit::TiledCoreAnimationDrawingAreaProxy::dispatchAfterEnsuringDrawing):
2502         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
2503         (WebKit::AcceleratedDrawingArea::AcceleratedDrawingArea):
2504         (WebKit::AcceleratedDrawingArea::layerHostDidFlushLayers):
2505         (WebKit::AcceleratedDrawingArea::sendDidUpdateBackingStoreState):
2506         * WebProcess/WebPage/DrawingArea.cpp:
2507         (WebKit::DrawingArea::DrawingArea):
2508         (WebKit::DrawingArea::removeMessageReceiverIfNeeded):
2509         * WebProcess/WebPage/DrawingArea.h:
2510         (WebKit::DrawingArea::identifier const):
2511         (WebKit::DrawingArea::send):
2512         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2513         (WebKit::DrawingAreaImpl::sendDidUpdateBackingStoreState):
2514         (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode):
2515         (WebKit::DrawingAreaImpl::display):
2516         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
2517         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
2518         (WebKit::RemoteLayerTreeDrawingArea::updateGeometry):
2519         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
2520         * WebProcess/WebPage/WebPage.cpp:
2521         (WebKit::WebPage::reinitializeWebPage):
2522         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2523         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
2524         (WebKit::TiledCoreAnimationDrawingArea::sendEnterAcceleratedCompositingModeIfNeeded):
2525         (WebKit::TiledCoreAnimationDrawingArea::updateIntrinsicContentSizeIfNeeded):
2526         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
2527         (WebKit::TiledCoreAnimationDrawingArea::updateGeometry):
2528         (WebKit::TiledCoreAnimationDrawingArea::setLayerHostingMode):
2529
2530 2019-02-22  Andy Estes  <aestes@apple.com>
2531
2532         [Cocoa] Do not suppress deprecation warnings when calling sandbox_extension_issue_file
2533         https://bugs.webkit.org/show_bug.cgi?id=194971
2534         <rdar://problem/35786264>
2535
2536         Reviewed by Tim Horton.
2537
2538         sandbox_extension_issue_file is not actually deprecated.
2539
2540         * Shared/mac/SandboxExtensionMac.mm:
2541         (WebKit::SandboxExtensionImpl::sandboxExtensionForType):
2542
2543 2019-02-22  Wenson Hsieh  <wenson_hsieh@apple.com>
2544
2545         [iOS] Callout menu overlaps in-page controls when editing a comment in github.com's issue tracker
2546         https://bugs.webkit.org/show_bug.cgi?id=194873
2547         <rdar://problem/46701974>
2548
2549         Reviewed by Tim Horton.
2550
2551         On the topic of supporting web-based rich text editors on iOS, one problematic area has always been handling
2552         conflicts between platform UI (i.e., the system callout menu) and in-page text editing controls. This issue
2553         comes up in websites that don't use the "hidden contenteditable" approach to rich text editing, but also show
2554         additional controls in a toolbar or contextual menu above the selection. In these cases, what often happens is
2555         that system controls overlap controls in the page.
2556
2557         Luckily, the iOS callout menu (i.e. the private UICalloutBar) is capable of presenting with a list of "evasion
2558         rects" to avoid; if the callout bar would normally intersect with one of these rects, then a different
2559         orientation that does not intersect with one of these rects is chosen instead. Currently, the only rect added
2560         here by UIKit when presenting the callout menu is the bounding rect of the on-screen keyboard, but after
2561         <rdar://problem/48128337>, we now have a generalized mechanism for offering additional evasion rects before
2562         UIKit presents the callout menu.
2563
2564         This patch adopts the mechanism introduced in <rdar://problem/48128337>, and introduces a heuristic for
2565         determining the approximate location of controls in the page which might overlap the callout menu. This
2566         heuristic works by hit-testing for clickable (but non-editable) nodes above the bounds of the selection, which
2567         are additionally not hit-tested by advancing outwards from any of the other edges of the selection bounds.
2568         Additionally, any hit-tested nodes whose bounding rects are very large (relative to the content view size) are
2569         ignored (this deals with scenarios where the body or a large container element has a click handler). We then add
2570         the bounding rects of each of the nodes that fit this criteria to the list of rects for UIKit to avoid when
2571         presenting the system callout menu.
2572
2573         The result is that WebKit will, by default, avoid overlapping anything that looks like controls in the page when
2574         showing a callout menu in editable content. In practice, this fixes overlapping controls on most websites that
2575         roll their own context menu or toolbar in their rich text editor.
2576
2577         Test: editing/selection/ios/avoid-showing-callout-menu-over-controls.html
2578
2579         * Platform/spi/ios/UIKitSPI.h:
2580         * UIProcess/WebPageProxy.h:
2581         * UIProcess/ios/WKContentViewInteraction.mm:
2582         (-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]):
2583         (-[WKContentView requestRectsToEvadeForSelectionCommandsWithCompletionHandler:]):
2584         (-[WKContentView requestAutocorrectionContextWithCompletionHandler:]):
2585
2586         Drive-by: handle null completion handler arguments more gracefully, by raising an NSException and bailing before
2587         attempting to invoke a nil block.
2588
2589         * UIProcess/ios/WebPageProxyIOS.mm:
2590         (WebKit::WebPageProxy::requestEvasionRectsAboveSelection):
2591
2592         See above for more detail.
2593
2594         * WebProcess/WebPage/WebPage.h:
2595         * WebProcess/WebPage/WebPage.messages.in:
2596         * WebProcess/WebPage/ios/WebPageIOS.mm:
2597         (WebKit::WebPage::requestEvasionRectsAboveSelection):
2598
2599 2019-02-22  Simon Fraser  <simon.fraser@apple.com>
2600
2601         Unreviewed build fix: need a WebCore:: namespace on ScrollingEventResult.
2602
2603         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
2604
2605 2019-02-22  Chris Dumez  <cdumez@apple.com>
2606
2607         Regression(PSON) Unable to preview password-protected documents on iCloud.com
2608         https://bugs.webkit.org/show_bug.cgi?id=194954
2609         <rdar://problem/48127957>
2610
2611         Reviewed by Alex Christensen.
2612
2613         Make sure the ProvisionalPageProxy forwards to the WebPageProxy the QuickLook-related
2614         IPC on iOS.
2615
2616         * UIProcess/ProvisionalPageProxy.cpp:
2617         (WebKit::ProvisionalPageProxy::didRequestPasswordForQuickLookDocumentInMainFrame):
2618         (WebKit::ProvisionalPageProxy::didReceiveMessage):
2619         * UIProcess/ProvisionalPageProxy.h:
2620         * UIProcess/WebPageProxy.h:
2621         * UIProcess/ios/WebPageProxyIOS.mm:
2622         (WebKit::WebPageProxy::didRequestPasswordForQuickLookDocumentInMainFrame):
2623         (WebKit::WebPageProxy::didRequestPasswordForQuickLookDocumentInMainFrameShared):
2624
2625 2019-02-22  Per Arne Vollan  <pvollan@apple.com>
2626
2627         [iOS] Sandbox should allow mach lookups related to media capturing
2628         https://bugs.webkit.org/show_bug.cgi?id=194951
2629         <rdar://problem/48013875>
2630
2631         Reviewed by Brent Fulgham.
2632
2633         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2634
2635 2019-02-22  Alexander Mikhaylenko  <exalm7659@gmail.com>
2636
2637         [GTK] Navigation gesture improvements
2638         https://bugs.webkit.org/show_bug.cgi?id=194943
2639
2640         Reviewed by Michael Catanzaro.
2641
2642         Cancel the gesture if progress is less than 0.5 and velocity is not high enough.
2643
2644         Allow to continue the gesture during animation. Introduce finished state to be used
2645         when showing snapshot after the animation ends.
2646
2647         Fix duration calculation, also slow it down so that the initial velocity matches
2648         what it was during the gesture.
2649
2650         * UIProcess/ViewGestureController.h: Add shouldCancel() and State::Finishing to SwipeProgressTracker.
2651         * UIProcess/gtk/ViewGestureControllerGtk.cpp:
2652         (WebKit::ViewGestureController::SwipeProgressTracker::handleEvent):
2653         Fix velocity calculation, allow scrolling during State::Animating.
2654         (WebKit::ViewGestureController::SwipeProgressTracker::shouldCancel): Added.
2655         (WebKit::ViewGestureController::SwipeProgressTracker::startAnimation): Use shouldCancel() and fix duration calculation.
2656         (WebKit::ViewGestureController::SwipeProgressTracker::endAnimation): Set state to State::Finishing when the animation ends.
2657
2658 2019-02-22  Chris Dumez  <cdumez@apple.com>
2659
2660         REGRESSION(PSON) Scroll position is sometimes not restored on history navigation
2661         https://bugs.webkit.org/show_bug.cgi?id=194924
2662         <rdar://problem/48216125>
2663
2664         Reviewed by Geoffrey Garen.
2665
2666         When process-swapping, we would create a new WebPage in the new process, which would
2667         call restoreSessionInternal() to restore the HistoryItems based on the UIProcess's
2668         backforward list. The issue is that this session restoring would send HistoryItem
2669         updates back to the UIProcess. Without PSON, this would be unnecessary but harmless.
2670         With PSON though, this may end up overwriting values set by the previous process,
2671         such as the scroll position.
2672
2673         Address the issue by temporarily disabling the HistoryItem update notifications to
2674         the UIProcess while restoring a session.
2675
2676         * UIProcess/API/Cocoa/WKBackForwardListItem.mm:
2677         (-[WKBackForwardListItem _scrollPosition]):
2678         * UIProcess/API/Cocoa/WKBackForwardListItemPrivate.h:
2679         * WebProcess/WebPage/WebPage.cpp:
2680         (WebKit::WebPage::restoreSessionInternal):
2681
2682 2019-02-21  Adrian Perez de Castro  <aperez@igalia.com>
2683
2684         [WPE][GTK] No API documentation generated for WebKitUserContentFilterStore
2685         https://bugs.webkit.org/show_bug.cgi?id=194908
2686
2687         Reviewed by Carlos Garcia Campos.
2688
2689         * UIProcess/API/gtk/docs/webkit2gtk-4.0.types: Add entry for webkit_user_content_filter_store_get_type().
2690         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add entry for WebKitUserContentFilterStore.
2691         * UIProcess/API/wpe/docs/wpe-docs.sgml: Ditto.
2692
2693 2019-02-21  Carlos Garcia Campos  <cgarcia@igalia.com>
2694
2695         wpewebkit-2.23.90 Failing to build on Fedora
2696         https://bugs.webkit.org/show_bug.cgi?id=194922
2697
2698         Unreviewed. Fix path to WebKitUserContentFilterStore.h in WPE_API_INSTALLED_HEADERS.
2699
2700         * PlatformWPE.cmake:
2701
2702 2019-02-21  Simon Fraser  <simon.fraser@apple.com>
2703
2704         Hardcode Visual Viewports on everywhere except iOS WK1
2705         https://bugs.webkit.org/show_bug.cgi?id=194928
2706
2707         Reviewed by Zalan Bujtas.
2708
2709         Remove the WK1 and WK2 preferences and MiniBrowser menu item for "visual viewports",
2710         change the default value of the Setting to 'true', and hardcode WebView on iOS to
2711         set it to false. The setting has shipped for several years and there's no need to turn
2712         it off now.
2713
2714         Similarly, disable the "Visual Viewport API" on iOS WK1, since it makes no sense if
2715         Visual Viewports are not enabled.
2716         
2717         Remove the "visualViewportEnabled" flag and unused code paths from scrolling tree code
2718         that only runs in WK2
2719
2720         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
2721         (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
2722         (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
2723         * Shared/WebPreferences.yaml:
2724         * UIProcess/API/Cocoa/WKPreferences.mm:
2725         (-[WKPreferences _visualViewportEnabled]): Deleted.
2726         (-[WKPreferences _setVisualViewportEnabled:]): Deleted.
2727         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2728         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
2729         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
2730         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
2731         (WebKit::RemoteScrollingCoordinatorProxy::visualViewportEnabled const): Deleted.
2732         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
2733         (WebKit::RemoteScrollingCoordinatorProxy::customFixedPositionRect const):
2734         * UIProcess/WebPageProxy.h:
2735         * UIProcess/ios/WKContentView.mm:
2736         (-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
2737         * UIProcess/ios/WebPageProxyIOS.mm:
2738         (WebKit::WebPageProxy::computeCustomFixedPositionRect const):
2739         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
2740         (WebKit::WebAutomationSessionProxy::computeElementLayout):
2741         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2742         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2743         * WebProcess/WebPage/ios/WebPageIOS.mm:
2744         (WebKit::WebPage::getFocusedElementInformation):
2745         (WebKit::WebPage::dynamicViewportSizeUpdate):
2746         (WebKit::WebPage::updateVisibleContentRects):
2747
2748 2019-02-21  Carlos Garcia Campos  <cgarcia@igalia.com>
2749
2750         [GTK] Epiphany searching for plugins even if plugins are disabled
2751         https://bugs.webkit.org/show_bug.cgi?id=194352
2752
2753         Reviewed by Michael Catanzaro.
2754
2755         Check pluginsEnabled setting before trying to get plugins from UI process.
2756
2757         * WebProcess/Plugins/WebPluginInfoProvider.cpp:
2758         (WebKit::WebPluginInfoProvider::populatePluginCache):
2759
2760 2019-02-21  Darin Adler  <darin@apple.com>
2761
2762         Some refinements for Node and Document
2763         https://bugs.webkit.org/show_bug.cgi?id=194764
2764
2765         Reviewed by Ryosuke Niwa.
2766
2767         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp:
2768         (webkit_dom_document_get_override_style): Changed to return nullptr directly instead of
2769         calling a bunch of WebCore code first. No real value in checking arguments or doing any work.
2770
2771         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2772         (WebKit::WebFrameLoaderClient::shouldAlwaysUsePluginDocument const): Deleted.
2773         No need to override the function inherited from the base class, nor to keep track of the
2774         unnecessary task of implementing this some day.
2775         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: Updated for the above.
2776
2777 2019-02-21  Ryosuke Niwa  <rniwa@webkit.org>
2778
2779         Discard cached processes when clearing website data store
2780         https://bugs.webkit.org/show_bug.cgi?id=194894
2781
2782         Reviewed by Chris Dumez.
2783
2784         Clear the process cache when clearing the website data store so that there is no way to infer
2785         which site the user had visited by observing for which sites WebContent processes had been cached.
2786
2787         There is one sublty in WebsiteDataStore::removeData that we have to delay the clearing of
2788         the web process cache until the next run loop because SuspendedPageProxy::~SuspendedPageProxy
2789         invokes WebProcessProxy::maybeShutDown in the next run loop. We also have to disable the process
2790         cache during this time as it would otherwise trigger the responsiveness check of WebContent process
2791         can take arbitrarily long time.
2792
2793         * UIProcess/API/Cocoa/WKProcessPool.mm:
2794         (-[WKProcessPool _processCacheCapacity]): Added for testing.
2795         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2796         * UIProcess/WebProcessCache.cpp:
2797         (WebKit::WebProcessCache::addProcess): Avoid adding web processes to the cache while the suspended
2798         pages are being cleared.
2799         * UIProcess/WebProcessCache.h:
2800         (WebKit::WebProcessCache::disabled const): Added.
2801         (WebKit::WebProcessCache::setDisabled): Added.
2802         * UIProcess/WebProcessPool.cpp:
2803         (WebKit::WebProcessPool::handleMemoryPressureWarning):
2804         (WebKit::WebProcessPool::clearSuspendedPages): Added.
2805         * UIProcess/WebProcessPool.h:
2806         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2807         (WebKit::WebsiteDataStore::removeData):
2808
2809 2019-02-21  Alex Christensen  <achristensen@webkit.org>
2810
2811         Clicking "Go Back" on a safe browsing warning before a WKWebView has loaded any page should request to close the WKWebView
2812         https://bugs.webkit.org/show_bug.cgi?id=194914
2813         <rdar://problem/47586889>
2814
2815         Reviewed by Geoffrey Garen.
2816
2817         * UIProcess/API/APIUIClient.h:
2818         (API::UIClient::didShowSafeBrowsingWarning):
2819         (API::UIClient::didClickGoBackFromSafeBrowsingWarning): Deleted.
2820         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2821         * UIProcess/Cocoa/UIDelegate.h:
2822         * UIProcess/Cocoa/UIDelegate.mm:
2823         (WebKit::UIDelegate::setDelegate):
2824         (WebKit::UIDelegate::UIClient::didClickGoBackFromSafeBrowsingWarning): Deleted.
2825         * UIProcess/WebPageProxy.cpp:
2826         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2827
2828 2019-02-21  Tim Horton  <timothy_horton@apple.com>
2829
2830         Turn a high-value UI-side-compositing assertion into a release assert
2831         https://bugs.webkit.org/show_bug.cgi?id=194887
2832
2833         Reviewed by Simon Fraser.
2834
2835         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
2836         (WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
2837         There is absolutely no situation in which this assert should fire
2838         if WebKit is behaving correctly, and it will basically always result
2839         in a UI process crash (or at least confusion), so make it a release assert.
2840         This would have saved us a lot of stress in bug 194845.
2841
2842 2019-02-21  Don Olmstead  <don.olmstead@sony.com>
2843
2844         [MSVC] Fix compilation errors with lambdas in ResourceLoadStatistics
2845         https://bugs.webkit.org/show_bug.cgi?id=194913
2846
2847         Reviewed by Brent Fulgham.
2848
2849         MSVC has problems with the scoping of `this` within a nested lambda. To work around the
2850         behavior the enclosing lambda's wrapping of `this` is used within the nested lambda.
2851
2852         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
2853         (WebKit::ResourceLoadStatisticsMemoryStore::processStatisticsAndDataRecords):
2854         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
2855         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessGranted):
2856
2857 2019-02-21  Chris Dumez  <cdumez@apple.com>
2858
2859         Fix API test crashes after r241855.
2860
2861         Reviewed by Ryosuke Niwa.
2862
2863         * UIProcess/WebProcessCache.cpp:
2864         (WebKit::WebProcessCache::addProcessIfPossible):
2865
2866 2019-02-21  Alex Christensen  <achristensen@webkit.org>
2867
2868         API::HTTPCookieStore should expose setCookies()
2869         https://bugs.webkit.org/show_bug.cgi?id=194861
2870
2871         Reviewed by Brent Fulgham.
2872
2873         Pass a Vector<Cookie> instead of just one cookie at a time.
2874         This will add the ability to set multiple cookies without an IPC roundtrip per cookie.
2875
2876         * NetworkProcess/Cookies/WebCookieManager.cpp:
2877         (WebKit::WebCookieManager::setCookie):
2878         * NetworkProcess/Cookies/WebCookieManager.h:
2879         * NetworkProcess/Cookies/WebCookieManager.messages.in:
2880         * UIProcess/API/APIHTTPCookieStore.cpp:
2881         (API::HTTPCookieStore::setCookies):
2882         (API::HTTPCookieStore::setCookie): Deleted.
2883         * UIProcess/API/APIHTTPCookieStore.h:
2884         * UIProcess/API/Cocoa/WKHTTPCookieStore.mm:
2885         (-[WKHTTPCookieStore setCookie:completionHandler:]):
2886         * UIProcess/WebCookieManagerProxy.cpp:
2887         (WebKit::WebCookieManagerProxy::setCookies):
2888         (WebKit::WebCookieManagerProxy::setCookie): Deleted.
2889         * UIProcess/WebCookieManagerProxy.h:
2890
2891 2019-02-21  Antoine Quint  <graouts@apple.com>
2892
2893         Move UIWebTouchEventsGestureRecognizer.activeTouchesByIdentifier to SPI
2894         https://bugs.webkit.org/show_bug.cgi?id=194531
2895         <rdar://problem/47714562>
2896
2897         Reviewed by Tim Horton.
2898
2899         Follow-up commit to ensure this SPI is only called on newer versions of iOS.
2900
2901         * UIProcess/ios/WKContentViewInteraction.mm:
2902         (-[WKContentView cancelPointersForGestureRecognizer:]):
2903
2904 2019-02-21  Tim Horton  <timothy_horton@apple.com>
2905
2906         Crash under RemoteLayerTreePropertyApplier::applyProperties when reattaching to old process
2907         https://bugs.webkit.org/show_bug.cgi?id=194845
2908         <rdar://problem/47944579>
2909
2910         Reviewed by Antti Koivisto.
2911
2912         New test: ProcessSwap.PageOverlayLayerPersistence
2913
2914         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
2915         (WebKit::RemoteLayerTreeTransaction::LayerProperties::notePropertiesChanged):
2916         Keep track of all properties that have ever changed on a layer, so we
2917         can re-send them if a layer moves between contexts.
2918
2919         * WebProcess/WebPage/DrawingArea.cpp:
2920         (WebKit::DrawingArea::~DrawingArea):
2921         (WebKit::DrawingArea::removeMessageReceiverIfNeeded):
2922         * WebProcess/WebPage/DrawingArea.h:
2923         (WebKit::DrawingArea::layerHostDidFlushLayers):
2924         Make it possible to tear down DrawingArea's MessageReceiver before it is destroyed,
2925         so that we can keep two DrawingAreas alive in a single process for a short time.
2926
2927         (WebKit::DrawingArea::adoptLayersFromDrawingArea):
2928         Add adoptLayersFromDrawingArea; see below for its only useful implementation.
2929
2930         * WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.cpp:
2931         (WebKit::GraphicsLayerCARemote::GraphicsLayerCARemote):
2932         (WebKit::GraphicsLayerCARemote::~GraphicsLayerCARemote):
2933         (WebKit::GraphicsLayerCARemote::createPlatformCALayer):
2934         (WebKit::GraphicsLayerCARemote::createPlatformCALayerForEmbeddedView):
2935         (WebKit::GraphicsLayerCARemote::moveToContext):
2936         * WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.h:
2937         Make it possible to move a GraphicsLayerCARemote between RemoteLayerTreeContexts.
2938
2939         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
2940         (WebKit::PlatformCALayerRemote::create):
2941         (WebKit::PlatformCALayerRemote::createForEmbeddedView):
2942         (WebKit::PlatformCALayerRemote::~PlatformCALayerRemote):
2943         (WebKit::PlatformCALayerRemote::moveToContext):
2944         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h:
2945         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm:
2946         (WebKit::PlatformCALayerRemoteCustom::create):
2947         (WebKit::PlatformCALayerRemoteCustom::clone const):
2948         Make it possible to move a PlatformCALayerRemote between RemoteLayerTreeContexts.
2949
2950         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h:
2951         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
2952         (WebKit::RemoteLayerTreeContext::~RemoteLayerTreeContext):
2953         (WebKit::RemoteLayerTreeContext::adoptLayersFromContext):
2954         (WebKit::RemoteLayerTreeContext::layerDidEnterContext):
2955         (WebKit::RemoteLayerTreeContext::layerWillLeaveContext):
2956         (WebKit::RemoteLayerTreeContext::graphicsLayerDidEnterContext):
2957         (WebKit::RemoteLayerTreeContext::graphicsLayerWillLeaveContext):
2958         (WebKit::RemoteLayerTreeContext::layerWasCreated): Deleted.
2959         (WebKit::RemoteLayerTreeContext::layerWillBeDestroyed): Deleted.
2960         Keep track of all GraphicsLayerCARemote instances in the context, like we
2961         do for PlatformCALayerRemote, so that we can update their context backpointers if needed.
2962
2963         Also make it possible to move all outstanding layers to a new context.
2964
2965         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
2966         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
2967         (WebKit::RemoteLayerTreeDrawingArea::adoptLayersFromDrawingArea):
2968         * WebProcess/WebPage/WebPage.cpp:
2969         (WebKit::WebPage::reinitializeWebPage):
2970         When doing a DrawingArea swap, transition all layers from the old context
2971         to the new one. In order to do this, we temporarily keep both DrawingAreas
2972         alive, but make use of the new mechanism to remove the old one's MessageReceiver
2973         before installing the new one, so that destroying the old one later doesn't
2974         remove it (avoiding re-introducing bug 189481).
2975
2976 2019-02-21  Chris Dumez  <cdumez@apple.com>
2977
2978         Unreviewed API test fix after r241855.
2979
2980         * UIProcess/WebProcessProxy.cpp:
2981         (WebKit::WebProcessProxy::~WebProcessProxy):
2982
2983 2019-02-21  Antoine Quint  <graouts@apple.com>
2984
2985         Move UIWebTouchEventsGestureRecognizer.activeTouchesByIdentifier to SPI
2986         https://bugs.webkit.org/show_bug.cgi?id=194531
2987         <rdar://problem/47714562>
2988
2989         Reviewed by Dean Jackson.
2990
2991         * Platform/spi/ios/UIKitSPI.h:
2992         * UIProcess/ios/WKContentViewInteraction.mm:
2993         (-[WKContentView cancelPointersForGestureRecognizer:]): We update the referenced Radar since we need to keep the call
2994         to respondsToSelector until the SPI has shipped for OpenSource builds to work.
2995
2996 2019-02-20  Antti Koivisto  <antti@apple.com>
2997
2998         Make programmatic frame scrolling work on iOS
2999         https://bugs.webkit.org/show_bug.cgi?id=194886
3000
3001         Reviewed by Simon Fraser.
3002
3003         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
3004         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren):
3005
3006         Don't move based on the layout scroll position. This just overrides the user scroll position.
3007         Remove ScrolledContentsLayer checks, we only need to deal with the ScrollContainerLayer here.
3008
3009         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::setScrollLayerPosition):
3010
3011         Scroll the UIScrollView correctly. This is called as a result of setting the RequestedScrollPosition property.
3012         Remove scroll origin code, it doesn't look correct (and is untested).
3013
3014 2019-02-20  Chris Dumez  <cdumez@apple.com>
3015
3016         [PSON] Make sure hung processes are not kept alive by suspended pages or process caching
3017         https://bugs.webkit.org/show_bug.cgi?id=194881
3018         <rdar://problem/48249014>
3019
3020         Reviewed by Geoffrey Garen.
3021
3022         After we construct a SuspendedPageProxy and before we send the IPC to the WebProcess to
3023         ask it to suspend, start a 10 seconds timer. If the process does not answer the request
3024         to suspend before the timer fires, we destroy the SuspendedPageProxy so that we do not
3025         keep a hung process around.
3026
3027         For the WebProcessCache, we now call WebProcessProxy::isResponsive() on the process
3028         before adding it to the cache. Internally, this relies on an IPC handshake with the
3029         WebProcess. If the process is not responsive, we do not add it to the cache and we
3030         shut it down. If it is responsive then we proceed normally with adding it to the
3031         cache.
3032
3033         * UIProcess/SuspendedPageProxy.cpp:
3034         (WebKit::SuspendedPageProxy::SuspendedPageProxy):
3035         (WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
3036         (WebKit::SuspendedPageProxy::suspensionTimedOut):
3037         * UIProcess/SuspendedPageProxy.h:
3038         * UIProcess/WebProcessCache.cpp:
3039         (WebKit::WebProcessCache::addProcessIfPossible):
3040         (WebKit::WebProcessCache::addProcess):
3041         * UIProcess/WebProcessCache.h:
3042         * UIProcess/WebProcessProxy.cpp:
3043         (WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):
3044         (WebKit::WebProcessProxy::maybeShutDown):
3045         (WebKit::WebProcessProxy::isResponsive):
3046         * UIProcess/WebProcessProxy.h:
3047
3048 2019-02-20  Chris Dumez  <cdumez@apple.com>
3049
3050         Unreviewed build fix after r241823.
3051
3052         * UIProcess/SuspendedPageProxy.h:
3053
3054 2019-02-20  Alex Christensen  <achristensen@webkit.org>
3055
3056         Unreviewed, rolling out r241838.
3057
3058         Broke API tests
3059
3060         Reverted changeset:
3061
3062         "Resolve WebsiteDataStore/HTTPCookieStore ref cycle"
3063         https://bugs.webkit.org/show_bug.cgi?id=194868
3064         https://trac.webkit.org/changeset/241838
3065
3066 2019-02-20  Wenson Hsieh  <wenson_hsieh@apple.com>
3067
3068         REGRESSION: [ iOS ] Layout Test editing/input/ios/rtl-keyboard-input-on-focus.html is a Timeout
3069         https://bugs.webkit.org/show_bug.cgi?id=194601
3070         <rdar://problem/48080316>
3071
3072         Reviewed by Tim Horton.
3073
3074         Following r241311, if a web view becomes first responder and is then moved offscreen (or obscured, hidden, or in
3075         the case of WebKitTestRunner, its UIWindow loses its status as keyWindow), we end up holding on to the input
3076         view update deferral token indefinitely, waiting for the current focused element to be blurred or refocused.
3077
3078         This also manifests other user-facing bugs, the most common of which is the keyboard occasionally remaining
3079         onscreen after typing a URL in the unified field in MobileSafari and hitting Return, in the case where there is
3080         no autofocused element on the page.
3081
3082         To fix this, when becoming the first responder, additionally install a callback to detect when the page is
3083         finished handling the activity state change, and invalidate the input deferral token then. This retains the
3084         behavior where calling -becomeFirstResponder on the web view while a different view is focused will keep the
3085         keyboard stable, since the focused element message from the web process should be dispatched when handling the
3086         activity state change within the web process.
3087
3088         Of course, the web process may not be responsive at all while the web view is still in the view hierarchy, in
3089         which case we may still end up deferring input view updates indefinitely. In this case, we maintain a separate
3090         watchdog timer with a short delay, after which we unconditionally invalidate the token.
3091
3092         * UIProcess/WebPageProxy.cpp:
3093         (WebKit::WebPageProxy::installActivityStateChangeCompletionHandler):
3094
3095         Move the implementation of installActivityStateChangeCompletionHandler into cross-platform code.
3096
3097         * UIProcess/WebPageProxy.h:
3098         * UIProcess/ios/WKContentView.mm:
3099         * UIProcess/ios/WKContentViewInteraction.mm:
3100         (-[WKContentView cleanupInteraction]):
3101         (-[WKContentView _cancelPreviousResetInputViewDeferralRequest]):
3102         (-[WKContentView _scheduleResetInputViewDeferralAfterBecomingFirstResponder]):
3103         (-[WKContentView _resetInputViewDeferral]):
3104         (-[WKContentView becomeFirstResponderForWebView]):
3105         (-[WKContentView resignFirstResponderForWebView]):
3106         (-[WKContentView _commitPotentialTapFailed]):
3107         (-[WKContentView _didNotHandleTapAsClick:]):
3108         (-[WKContentView _didCompleteSyntheticClick]):
3109
3110         Funnel all existing calls that reset _inputViewDeferralToken to nullptr, such that they go through a helper
3111         method instead that also cancels any scheduled requests to clear the token.
3112
3113         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
3114         (WebKit::RemoteLayerTreeDrawingArea::activityStateDidChange):
3115
3116         Respond to all pending callbacks after handling the activity state change.
3117
3118 2019-02-20  Chris Dumez  <cdumez@apple.com>
3119
3120         Regression(PSON) "Reload without content extensions" does not work when the main resource is blocked
3121         https://bugs.webkit.org/show_bug.cgi?id=194872
3122         <rdar://problem/47924500>
3123
3124         Reviewed by Alex Christensen.
3125
3126         [WKWebView _reloadWithoutContentBlockers] relies on a ReloadOption flag that is passed to WebCore
3127         instead of using WebsitePolicies.contentBlockersEnabled flag. If the reload causes a process swap
3128         due to PSON, then the new process does not know about this ReloadOption and fails to honor it.
3129
3130         Since the modern way to do this is WebsitePolicies, and since WebsitePolicies are properly
3131         propagated cross-process in case of process swap, this patch updates _reloadWithoutContentBlockers
3132         to set a flag on the Navigation which we use to later set the WebsitePolicies.contentBlockersEnabled
3133         flag in WebPageProxy::receivedNavigationPolicyDecision().
3134
3135         * UIProcess/API/APINavigation.h:
3136         (API::Navigation::setUserContentExtensionsEnabled):
3137         (API::Navigation::userContentExtensionsEnabled const):
3138         * UIProcess/WebPageProxy.cpp:
3139         (WebKit::WebPageProxy::reload):
3140         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
3141
3142 2019-02-20  Truitt Savell  <tsavell@apple.com>
3143
3144         Unreviewed, rolling out r241817.
3145
3146         Caused 4 API failures
3147
3148         Reverted changeset:
3149
3150         "[GTK] Epiphany searching for plugins even if plugins are
3151         disabled"
3152         https://bugs.webkit.org/show_bug.cgi?id=194352
3153         https://trac.webkit.org/changeset/241817
3154
3155 2019-02-20  Andy Estes  <aestes@apple.com>
3156
3157         [Xcode] Add SDKVariant.xcconfig to various Xcode projects
3158         https://bugs.webkit.org/show_bug.cgi?id=194869
3159
3160         Rubber-stamped by Jer Noble.
3161
3162         * WebKit.xcodeproj/project.pbxproj:
3163
3164 2019-02-20  Alex Christensen  <achristensen@webkit.org>
3165
3166         Resolve WebsiteDataStore/HTTPCookieStore ref cycle
3167         https://bugs.webkit.org/show_bug.cgi?id=194868
3168
3169         Reviewed by Geoffrey Garen.
3170
3171         * UIProcess/API/APIHTTPCookieStore.cpp:
3172         (API::HTTPCookieStore::HTTPCookieStore):
3173         (API::HTTPCookieStore::cookies):
3174         (API::HTTPCookieStore::setCookie):
3175         (API::HTTPCookieStore::deleteCookie):
3176         (API::HTTPCookieStore::registerObserver):
3177         (API::HTTPCookieStore::unregisterObserver):
3178         (API::HTTPCookieStore::cookieManagerDestroyed):
3179         (API::HTTPCookieStore::registerForNewProcessPoolNotifications):
3180         (API::HTTPCookieStore::ref const):
3181         (API::HTTPCookieStore::deref const):
3182         * UIProcess/API/APIHTTPCookieStore.h:
3183
3184 2019-02-20  Per Arne Vollan  <pvollan@apple.com>
3185
3186         [iOS] Open sandbox for specific call.
3187         https://bugs.webkit.org/show_bug.cgi?id=194860
3188         <rdar://problem/48166729>
3189
3190         Reviewed by Brent Fulgham.
3191
3192         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
3193
3194 2019-02-20  Alex Christensen  <achristensen@webkit.org>
3195
3196         Move API::HTTPCookieStore ownership from API::WebsiteDataStore to WebKit::WebsiteDataStore
3197         https://bugs.webkit.org/show_bug.cgi?id=194842
3198
3199         Reviewed by Geoff Garen.
3200
3201         We need a way to get from WebKit::WebsiteDataStore to API::HTTPCookieStore.  It can't be done before this.
3202         This made an existing reference cycle easier to see, and we should fix it in a followup patch.
3203
3204         * UIProcess/API/APIWebsiteDataStore.cpp:
3205         (API::WebsiteDataStore::httpCookieStore):
3206         * UIProcess/API/APIWebsiteDataStore.h:
3207         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3208         (WebKit::WebsiteDataStore::cookieStore):
3209         * UIProcess/WebsiteData/WebsiteDataStore.h:
3210
3211 2019-02-20  Chris Dumez  <cdumez@apple.com>
3212
3213         Regression(PSON) Crash under WebKit::WebPageProxy::decidePolicyForNavigationActionSync
3214         https://bugs.webkit.org/show_bug.cgi?id=194857
3215         <rdar://problem/47759323>
3216
3217         Reviewed by Alex Christensen.
3218
3219         The ProvisionalPageProxy was blindly forwarding the DecidePolicyForNavigationActionSync
3220         synchronous IPC to the WebPageProxy, without passing it the process the IPC came from.
3221         As a result, WebPageProxy::decidePolicyForNavigationActionSync() would try to look up
3222         a WebFrameProxy using the provided frameID from the wrong process and we would end up
3223         hitting a RELEASE_ASSERT().
3224
3225         * UIProcess/ProvisionalPageProxy.cpp:
3226         (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionSync):
3227         (WebKit::ProvisionalPageProxy::didReceiveSyncMessage):
3228         * UIProcess/ProvisionalPageProxy.h:
3229         * UIProcess/WebPageProxy.cpp:
3230         (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
3231         (WebKit::WebPageProxy::decidePolicyForNavigationActionSyncShared):
3232         * UIProcess/WebPageProxy.h:
3233
3234 2019-02-20  Don Olmstead  <don.olmstead@sony.com>
3235
3236         [MSVC] Fix compilation errors with lambdas in Service Workers
3237         https://bugs.webkit.org/show_bug.cgi?id=194841
3238
3239         Reviewed by Alex Christensen.
3240
3241         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
3242         (WebKit::ServiceWorkerClientFetch::didReceiveRedirectResponse):
3243
3244 2019-02-20  Carlos Garcia Campos  <cgarcia@igalia.com>
3245
3246         [GTK] Epiphany searching for plugins even if plugins are disabled
3247         https://bugs.webkit.org/show_bug.cgi?id=194352
3248
3249         Reviewed by Michael Catanzaro.
3250
3251         Check pluginsEnabled setting before trying to get plugins from UI process.
3252
3253         * WebProcess/Plugins/WebPluginInfoProvider.cpp:
3254         (WebKit::WebPluginInfoProvider::populatePluginCache):
3255
3256 2019-02-20  Carlos Garcia Campos  <cgarcia@igalia.com>
3257
3258         [WPE] Send client host fd and library name as web process creation parameters
3259         https://bugs.webkit.org/show_bug.cgi?id=194494
3260
3261         Reviewed by Žan Doberšek.
3262
3263         Instead of using command line arguments. The code is simpler and we don't need wpe specific code in process
3264         launcher glib implementation.
3265
3266         * Shared/WebProcessCreationParameters.cpp:
3267         (WebKit::WebProcessCreationParameters::encode const):
3268         (WebKit::WebProcessCreationParameters::decode):
3269         * Shared/WebProcessCreationParameters.h:
3270         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
3271         (WebKit::ProcessLauncher::launchProcess):
3272         * UIProcess/glib/WebProcessPoolGLib.cpp:
3273         (WebKit::WebProcessPool::platformInitializeWebProcess):
3274         * WebProcess/glib/WebProcessGLib.cpp:
3275         (WebKit::WebProcess::platformInitializeWebProcess):
3276         * WebProcess/wpe/WebProcessMainWPE.cpp:
3277
3278 2019-02-20  Adrian Perez de Castro  <aperez@igalia.com>
3279
3280         [WPE][GTK] Enable support for CONTENT_EXTENSIONS
3281         https://bugs.webkit.org/show_bug.cgi?id=167941
3282
3283         Reviewed by Carlos Garcia Campos.
3284
3285         Adds new API to manage a collection of content extensions on disk (including compilation
3286         of new ones) using WebKitUserContentFilterStore; the associated WebKitUserContentFilter
3287         type (which represents a compiled content extension); and the functions needed to enable
3288         and disable them for a given WebKitUserContentManager.
3289
3290         The WebKitUserContentFilterStore public API is expressed in abstract terms of "saving"
3291         filters into the store (which involves compiling the JSON source rule set); and "loading"
3292         them back as main operations. This way we do not disclose to users of the API any detail
3293         about compilation, nor how contents are laid out on disk, and the documentation explicitly
3294         tells about only using the provided functions to manipulate the on-disk contents. This
3295         way we allow ourselves some leeway if the implementation needs changing in the future.
3296
3297         * PlatformGTK.cmake: Added WebKitUserContentFilterStore.h to the list of public API headers.
3298         * PlatformWPE.cmake: Ditto.
3299         * SourcesGTK.txt: Added WebKitUserContentFilterStore.cpp
3300         * SourcesWPE.txt: Ditto.
3301         * UIProcess/API/glib/WebKitError.cpp: Add definition of webkit_user_content_filter_error_quark().
3302         * UIProcess/API/glib/WebKitUserContent.cpp: Added WebKitUserContentFilter.
3303         (_WebKitUserContentFilter::_WebKitUserContentFilter):
3304         (webkit_user_content_filter_ref):
3305         (webkit_user_content_filter_unref):
3306         (webkit_user_content_filter_get_identifier):
3307         (webkitUserContentFilterCreate):
3308         (webkitUserContentFilterGetContentRuleList):
3309         * UIProcess/API/glib/WebKitUserContentFilterStore.cpp: Added.
3310         (toGError): Utility function to convert content extension error codes to GError.
3311         (webkit_user_content_filter_store_class_init):
3312         (webkit_user_content_filter_store_new):
3313         (webkit_user_content_filter_store_get_path):
3314         (webkitUserContentFilterStoreSaveBytes): Common function used as final step for all the
3315         functions which save (compile) JSON rule sets into the store, to avoid duplicating code.
3316         (webkit_user_content_filter_store_save):
3317         (webkit_user_content_filter_store_save_finish):
3318         (webkit_user_content_filter_store_save_from_file):
3319         (webkit_user_content_filter_store_save_from_file_finish):
3320         (webkit_user_content_filter_store_remove):
3321         (webkit_user_content_filter_store_remove_finish):
3322         (webkit_user_content_filter_store_load):
3323         (webkit_user_content_filter_store_lookup_finish):
3324         (webkit_user_content_filter_store_fetch_identifiers):
3325         (webkit_user_content_filter_store_fetch_identifiers_finish):
3326         * UIProcess/API/glib/WebKitUserContentManager.cpp: Added definitions for the new API
3327         functions to add and remove filters from an user content manager.
3328         (webkit_user_content_manager_add_filter):
3329         (webkit_user_content_manager_remove_filter):
3330         (webkit_user_content_manager_remove_all_filters):
3331         * UIProcess/API/glib/WebKitUserContentPrivate.h: Added declarations for
3332         webkitUserContentFilterCreate() and webkitUserContentFilterGetContentRuleList().
3333         * UIProcess/API/gtk/WebKitAutocleanups.h: Added autocleanups for WebKitUserContentFilter
3334         and WebKitUserContentFilterStore.
3335         * UIProcess/API/gtk/WebKitError.h: Added declarations for WEBKIT_USER_CONTENT_FILTER_ERROR
3336         plus the associated webkit_user_content_filter_error_quark() function and
3337         WebKitUserContentFilterErrror enum.
3338         * UIProcess/API/gtk/WebKitUserContent.h: Added declarations for WebKitUserContentFilter
3339         and its associated functions.
3340         * UIProcess/API/gtk/WebKitUserContentFilterStore.h: Added.
3341         * UIProcess/API/gtk/WebKitUserContentManager.h: Added declarations for the functions to
3342         add and remove filters from the user content manager.
3343         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Added new API functions and types to
3344         be included in the documentation.
3345         * UIProcess/API/gtk/webkit2.h: Added inclusion of WebKitUserContentFilterStore.h
3346         * UIProcess/API/wpe/WebKitError.h: Same as for the GTK port header.
3347         * UIProcess/API/wpe/WebKitUserContent.h: Same as for the GTK port header.
3348         * UIProcess/API/wpe/WebKitUserContentFilterStore.h: Added.
3349         * UIProcess/API/wpe/WebKitUserContentManager.h: Same as for the GTK port header.
3350         * UIProcess/API/wpe/docs/wpe-0.1-sections.txt: Added new API functions and types to be
3351         included in the documentation.
3352         * UIProcess/API/wpe/webkit.h: Added inclusion of WebKitUserContentFilterStore.h
3353
3354 2019-02-19  Antti Koivisto  <antti@apple.com>
3355
3356         Pass rootContentsLayer to Mac remote layer tree
3357         https://bugs.webkit.org/show_bug.cgi?id=194828
3358
3359         Reviewed by Simon Fraser.
3360
3361         Make this code path work again.
3362
3363         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
3364         (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
3365         (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
3366         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
3367         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
3368
3369 2019-02-19  Alex Christensen  <achristensen@webkit.org>
3370
3371  &nbs