IndexedDB: leak WebIDBConnectionToServer in layout tests
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2019-02-04  Sihui Liu  <sihui_liu@apple.com>
2
3         IndexedDB: leak WebIDBConnectionToServer in layout tests
4         https://bugs.webkit.org/show_bug.cgi?id=193688
5         <rdar://problem/47353263>
6
7         Reviewed by Geoffrey Garen.
8
9         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
10         (WebKit::NetworkConnectionToWebProcess::didClose):
11         (WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer):
12         (WebKit::NetworkConnectionToWebProcess::removeIDBConnectionToServer): Deleted.
13         * NetworkProcess/NetworkConnectionToWebProcess.h:
14         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
15         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
16         (WebKit::WebIDBConnectionToServer::~WebIDBConnectionToServer):
17
18 2019-02-04  Antoine Quint  <graouts@apple.com>
19
20         <rdar://problem/47788802>
21
22         Unreviewed build fix.
23
24         * Platform/spi/ios/UIKitSPI.h:
25
26 2019-02-04  Youenn Fablet  <youenn@apple.com>
27
28         Capture state should be managed consistently when doing process swapping
29         https://bugs.webkit.org/show_bug.cgi?id=194122
30         <rdar://problem/47609293>
31
32         Reviewed by Eric Carlson.
33
34         When doing PSON, WebPageProxy::resetState is called.
35         It resets the media state, but does not call the client delegates.
36         Instead of directly updating the media state, call the routine used to update it so that client delegates are called.
37
38         Covered by new API test and layout test.
39
40         * UIProcess/API/Cocoa/WKWebView.mm:
41         (-[WKWebView _mediaCaptureState]):
42         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
43         * UIProcess/WebPageProxy.cpp:
44         (WebKit::WebPageProxy::resetState):
45         (WebKit::WebPageProxy::isPlayingMediaDidChange):
46         (WebKit::WebPageProxy::updatePlayingMediaDidChange):
47         * UIProcess/WebPageProxy.h:
48
49 2019-02-04  Antoine Quint  <graouts@apple.com>
50
51         Use a dedicated type instead of int32_t for pointer identifiers
52         https://bugs.webkit.org/show_bug.cgi?id=194217
53
54         Reviewed by Antti Koivisto.
55
56         * Scripts/webkit/messages.py:
57         * UIProcess/WebPageProxy.cpp:
58         (WebKit::WebPageProxy::cancelPointer):
59         * UIProcess/WebPageProxy.h:
60         * WebProcess/WebPage/WebPage.cpp:
61         (WebKit::WebPage::cancelPointer):
62         * WebProcess/WebPage/WebPage.h:
63         * WebProcess/WebPage/WebPage.messages.in:
64
65 2019-02-04  Michael Catanzaro  <mcatanzaro@igalia.com>
66
67         Unreviewed, avoid -Wswitch warnings introduced in r240880
68         https://bugs.webkit.org/show_bug.cgi?id=193740
69         <rdar://problem/47527267>
70
71         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
72         (WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse):
73
74 2019-02-04  Alexander Mikhaylenko  <exalm7659@gmail.com>
75
76         [GTK] Allow pinch zoom on touchpad
77         https://bugs.webkit.org/show_bug.cgi?id=194201
78
79         Reviewed by Michael Catanzaro.
80
81         Enable touchpad events for WebkitWebViewBase, then feed touchpad
82         pinch events to GestureController.
83
84         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
85         (webkitWebViewBaseRealize): Added GDK_TOUCHPAD_GESTURE_MASK to event mask.
86         (webkitWebViewBaseEvent): Added.
87         (webkit_web_view_base_class_init): Override event vfunc.
88
89 2019-02-04  Michael Catanzaro  <mcatanzaro@igalia.com>
90
91         Unreviewed, only force settings.acceleratedCompositingEnabled() to true for Cocoa ports
92         https://bugs.webkit.org/show_bug.cgi?id=194166
93         <rdar://problem/47694328>
94
95         Accelerated compositing is broken for me at least. We're a long way from being able to force
96         it.
97
98         * WebProcess/WebPage/WebPage.cpp:
99         (WebKit::WebPage::updatePreferences):
100
101 2019-02-04  Abderrahim Kitouni  <akitouni@gnome.org>
102
103         [GTK] Remove last python2 dependency from CMake build process
104         https://bugs.webkit.org/show_bug.cgi?id=194218
105
106         Reviewed by Michael Catanzaro.
107
108         * InspectorGResources.cmake:
109
110 2019-02-04  Antti Koivisto  <antti@apple.com>
111
112         Rename GraphicsLayer and PlatformCALayer type enum values to match "scroll container layer" convention
113         https://bugs.webkit.org/show_bug.cgi?id=194215
114
115         Reviewed by Frédéric Wang.
116
117         * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
118         (WebKit::RemoteLayerBackingStore::drawInContext):
119         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
120         (WebKit::RemoteLayerTreeHost::makeNode):
121         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
122         (WebKit::RemoteLayerTreeHost::makeNode):
123
124 2019-02-03  Antti Koivisto  <antti@apple.com>
125
126         [iOS] Tiles not created in large scrollable iframes
127         https://bugs.webkit.org/show_bug.cgi?id=193665
128
129         Reviewed by Simon Fraser.
130
131         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
132         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateBeforeChildren):
133         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
134         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateBeforeChildren):
135
136         We now use scrollContainerLayer consistently so remove the special cases.
137
138 2019-02-03  Fujii Hironori  <Hironori.Fujii@sony.com>
139
140         [curl] [WebKit] Assertion failures of missing networkStorageSession for storage/indexeddb tests
141         https://bugs.webkit.org/show_bug.cgi?id=194141
142
143         Reviewed by Ross Kirsling.
144
145         Implemented WebKit::NetworkProcess::switchToNewTestingSession and
146         WebKit::NetworkProcess::ensureSession for curl port.
147
148         * NetworkProcess/NetworkProcess.cpp:
149         (WebKit::NetworkProcess::switchToNewTestingSession):
150         (WebKit::NetworkProcess::ensureSession):
151
152 2019-02-03  Simon Fraser  <simon.fraser@apple.com>
153
154         Make setNeedsLayout on the root more explicitly about triggering its side-effects
155         https://bugs.webkit.org/show_bug.cgi?id=194198
156
157         Reviewed by Antti Koivisto.
158
159         Call the newly named functions.
160
161         * WebProcess/Plugins/PDF/PDFPlugin.mm:
162         (WebKit::PDFPlugin::updateScrollbars):
163         * WebProcess/Plugins/PluginView.cpp:
164         (WebKit::PluginView::didInitializePlugin):
165         * WebProcess/WebPage/WebPage.cpp:
166         (WebKit::WebPage::setHeaderBannerHeightForTesting):
167         (WebKit::WebPage::setFooterBannerHeightForTesting):
168         * WebProcess/WebPage/mac/PageBannerMac.mm:
169         (WebKit::PageBanner::addToPage):
170         (WebKit::PageBanner::detachFromPage):
171         (WebKit::PageBanner::hide):
172
173 2019-02-03  Ryosuke Niwa  <rniwa@webkit.org>
174
175         Validate navigation policy decisions to avoid crashes in continueLoadAfterNavigationPolicy
176         https://bugs.webkit.org/show_bug.cgi?id=194189
177
178         Reviewed by Geoffrey Garen.
179
180         Pass the policy check identifier around functions and store it in PolicyDecisionSender
181         so that we can send it back to WebCore with the navigation policy decision.
182
183         We also store it in WebFrame in the case the policy decision had to be invalidated
184         before the decision was received (via WebFrame::invalidatePolicyListener).
185
186         * Scripts/webkit/messages.py:
187         * UIProcess/ProvisionalPageProxy.cpp:
188         (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionAsync):
189         (WebKit::ProvisionalPageProxy::decidePolicyForResponse):
190         * UIProcess/ProvisionalPageProxy.h:
191         * UIProcess/WebPageProxy.cpp:
192         (WebKit::WebPageProxy::PolicyDecisionSender): Added PolicyCheckIdentifier as a member.
193         (WebKit::WebPageProxy::PolicyDecisionSender::create):
194         (WebKit::WebPageProxy::PolicyDecisionSender::send):
195         (WebKit::WebPageProxy::PolicyDecisionSender::PolicyDecisionSender):
196         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
197         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
198         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsyncShared):
199         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
200         (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
201         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
202         (WebKit::WebPageProxy::decidePolicyForResponse):
203         (WebKit::WebPageProxy::decidePolicyForResponseShared):
204         * UIProcess/WebPageProxy.h:
205         * UIProcess/WebPageProxy.messages.in:
206         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
207         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
208         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
209         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
210         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
211         * WebProcess/WebPage/WebFrame.cpp:
212         (WebKit::WebFrame::setUpPolicyListener):
213         (WebKit::WebFrame::invalidatePolicyListener):
214         (WebKit::WebFrame::didReceivePolicyDecision):
215         * WebProcess/WebPage/WebFrame.h:
216         * WebProcess/WebPage/WebPage.cpp:
217         (WebKit::WebPage::didReceivePolicyDecision):
218         * WebProcess/WebPage/WebPage.h:
219         * WebProcess/WebPage/WebPage.messages.in:
220
221 2019-02-03  Megan Gardner  <megan_gardner@apple.com>
222
223         Turn on Smart Paste
224         https://bugs.webkit.org/show_bug.cgi?id=193786
225
226         Reviewed by Ryosuke Niwa.
227
228         * Platform/spi/ios/UIKitSPI.h:
229         * UIProcess/ios/TextCheckerIOS.mm:
230         (WebKit::TextChecker::isSmartInsertDeleteEnabled):
231         Use the flag from UIKit to determine if smart copy paste should be
232         turned on.
233
234 2019-02-02  Simon Fraser  <simon.fraser@apple.com>
235
236         Tidy up data memebers of FrameView and related classes to shrink class sizes
237         https://bugs.webkit.org/show_bug.cgi?id=194197
238
239         Reviewed by Zalan Bujtas.
240
241         * UIProcess/PageClient.h: Declare enum size.
242
243 2018-12-16  Darin Adler  <darin@apple.com>
244
245         Convert additional String::format clients to alternative approaches
246         https://bugs.webkit.org/show_bug.cgi?id=192746
247
248         Reviewed by Alexey Proskuryakov.
249
250         * UIProcess/Cocoa/ViewGestureController.cpp:
251         (WebKit::ViewGestureController::SnapshotRemovalTracker::startWatchdog):
252         Use makeString and FormattedNumber.
253
254         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
255         (WebKit::LocalAuthenticator::getAssertion): Added a comment about an
256         incorrect format specifier and left this code as is for now.
257
258 2019-02-01  David Kilzer  <ddkilzer@apple.com>
259
260         Move soft-linking of TelephonyUtilities.framework out of TUCallSPI.h
261         <https://webkit.org/b/193866>
262
263         Reviewed by Alex Christensen.
264
265         * Platform/mac/MenuUtilities.mm:
266         - Update for rename of TUCallSPI.h to TelephonyUtilitiesSPI.h.
267         - Add soft-linking code formerly in TUCallSPI.h.
268
269 2019-02-01  Alex Christensen  <achristensen@webkit.org>
270
271         Move XPCService entry points from mac directory to new Cocoa directory
272         https://bugs.webkit.org/show_bug.cgi?id=194129
273
274         Reviewed by Chris Dumez.
275
276         * Configurations/NetworkService.xcconfig:
277         * Configurations/PluginService.64.xcconfig:
278         * Configurations/WebContentService.xcconfig:
279         * NetworkProcess/EntryPoint/Cocoa: Copied from Source/WebKit/NetworkProcess/EntryPoint/mac.
280         * NetworkProcess/EntryPoint/mac: Removed.
281         * PluginProcess/EntryPoint/Cocoa: Copied from Source/WebKit/PluginProcess/EntryPoint/mac.
282         * PluginProcess/EntryPoint/mac: Removed.
283         * Shared/EntryPointUtilities/Cocoa: Copied from Source/WebKit/Shared/EntryPointUtilities/mac.
284         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h:
285         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm:
286         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
287         * Shared/EntryPointUtilities/mac: Removed.
288         * SourcesCocoa.txt:
289         * WebKit.xcodeproj/project.pbxproj:
290         * WebProcess/EntryPoint/Cocoa: Copied from Source/WebKit/WebProcess/EntryPoint/mac.
291         * WebProcess/EntryPoint/mac: Removed.
292
293 2019-02-01  Wenson Hsieh  <wenson_hsieh@apple.com>
294
295         [iOS] Consistent 1 sec hang when triggering modal alerts while handling synchronous touch events
296         https://bugs.webkit.org/show_bug.cgi?id=194140
297         <rdar://problem/47728098>
298
299         Reviewed by Tim Horton.
300
301         Currently, the UI process hangs when attempting to synchronously present modal UI from the web process while the
302         UI process is waiting for sync IPC in the web process. While we have logic to generally mitigate IPC deadlock in
303         this scenario by dispatching the web process' sync IPC immediately with the intention of allowing the web
304         process to finish processing sync IPC (and consequently unblock the UI process), this fails in the case where
305         the sync IPC message from the web process to the UI process requires main thread execution for an arbitrary
306         amount of time (for instance, modal alert dialogs). In this case, we'll end up in a state where we've handled
307         the web process' sync IPC in the UI process, yet we can't resume execution since the web process is still
308         blocked.
309
310         By far the most egregious scenario in which this manifests is during synchronous gesture recognizer IPC, i.e.
311         grabbing position information from the UI process, and handling touch events synchronously. Luckily, these are
312         also cases where (1) we know sync IPC may safely time out, and (2) the presentation of modal UI from the web
313         process should cause the gesture recognizers to fail anyways. As such, we can mitigate these scenarios in the
314         web process by responding to the these pending sync IPC messages *before* sending our own sync IPC to the UI
315         process.
316
317         Test: fast/events/touch/ios/show-modal-alert-during-touch-start.html
318
319         * Shared/ios/InteractionInformationAtPosition.h:
320         (WebKit::InteractionInformationAtPosition::invalidInformation):
321         * Shared/ios/InteractionInformationAtPosition.mm:
322         (WebKit::InteractionInformationAtPosition::encode const):
323         (WebKit::InteractionInformationAtPosition::decode):
324
325         Add a new flag to indicate whether an interaction information response can be valid. Interaction information
326         cannot be valid in the case where the interaction information request was interrupted by certain sync IPC
327         messages from the web process.
328
329         * UIProcess/API/C/WKContextConfigurationRef.cpp:
330         (WKContextConfigurationIgnoreSynchronousMessagingTimeoutsForTesting):
331         (WKContextConfigurationSetIgnoreSynchronousMessagingTimeoutsForTesting):
332
333         Add some testing SPI to ignore sync IPC timeouts, for the purposes of testing. Rather than use the existing
334         Objective-C SPI in WKWebProcessPoolConfiguration, I decided to add C API plumbing for this flag, so that other
335         non-Cocoa ports may also support the new layout test option to ignore sync IPC timeouts.
336
337         * UIProcess/API/C/WKContextConfigurationRef.h:
338         * UIProcess/ios/WKContentViewInteraction.mm:
339         (-[WKContentView ensurePositionInformationIsUpToDate:]):
340         (-[WKContentView _positionInformationDidChange:]):
341         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
342         (WebKit::WebChromeClient::runBeforeUnloadConfirmPanel):
343         (WebKit::WebChromeClient::runJavaScriptAlert):
344         (WebKit::WebChromeClient::runJavaScriptConfirm):
345         (WebKit::WebChromeClient::runJavaScriptPrompt):
346         (WebKit::WebChromeClient::print):
347         (WebKit::WebChromeClient::exceededDatabaseQuota):
348         (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota):
349
350         Cancel any pending sync IPC replies prior to sending sync IPC messages to the UI process which may result in
351         sync IPC deadlock, by using the new helper method, sendSyncWithDelayedReply, instead of just sendSync.
352
353         * WebProcess/WebPage/WebPage.cpp:
354         (WebKit::WebPage::cancelGesturesBlockedOnSynchronousReplies):
355
356         Add a helper to cancel pending sync messages coming in from the UI process that are being called from within
357         gesture recognizer delegate hooks.
358
359         (WebKit::WebPage::touchEventSync):
360         * WebProcess/WebPage/WebPage.h:
361
362         Add a new helper, sendSyncWithDelayedReply, to be used when sending a sync IPC message to the UI process that
363         cannot be immediately completed upon arrival. Importantly, this cancels pending sync replies, and also passes
364         IPC::SendSyncOption::InformPlatformProcessWillSuspend.
365
366         * WebProcess/WebPage/WebPage.messages.in:
367
368         Change these from LegacySync to Delayed messages.
369
370         * WebProcess/WebPage/ios/WebPageIOS.mm:
371         (WebKit::WebPage::getPositionInformation):
372
373         Make this sync IPC handler (as well as WebPage::touchEventSync) store the IPC reply during the scope of the
374         method, and invoke the stored reply at the end of the method if it wasn't interrupted due to something calling
375         cancelGesturesBlockedOnSynchronousReplies().
376
377         (WebKit::WebPage::positionInformation):
378
379         Refactor getPositionInformation by pulling out the logic for building an InteractionInformationAtPosition into
380         a separate helper.
381
382         (WebKit::WebPage::requestPositionInformation):
383
384 2019-02-01  David Quesada  <david_quesada@apple.com>
385
386         Network Process crash when resuming downloads: '-[__NSDictionaryI setObject:forKey:]: unrecognized selector sent to instance %p'
387         https://bugs.webkit.org/show_bug.cgi?id=194144
388         rdar://problem/47553456
389
390         Reviewed by Geoffrey Garen.
391
392         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
393         (WebKit::Download::resume):
394             Make a mutable copy of the root object decoded from the resume data.
395             It might have been originally encoded as an immutable dictionary.
396
397 2019-02-01  Chris Dumez  <cdumez@apple.com>
398
399         REGRESSION: Flaky ASSERTION FAILED: m_uncommittedState.state == State::Committed on http/tests/cookies/same-site/fetch-after-top-level-navigation-initiated-from-iframe-in-cross-origin-page.html
400         https://bugs.webkit.org/show_bug.cgi?id=193740
401         <rdar://problem/47527267>
402
403         Reviewed by Alex Christensen.
404
405         The issue was happening when the page is triggering a cross-site navigation while in the middle of parsing. This would cause us to
406         start a new provisional load in a new process before the previous process sends the DidFinishLoadForFrame() IPC to the UIProcess.
407         Getting such IPC after a provisional load has started would mess up our state machine and trip assertions.
408
409         This patch restores non-PSON behavior which is that the previous load in the old process now gets stopped so that no DidFinishLoadForFrame()
410         / DidFailLoadForFrame() gets sent. To achieve this behavior, I introduced a new "StopAllLoads" PolicyAction that we now send the old
411         process when the load is continuing in a new process, instead of sending it "Ignore".
412
413         * NetworkProcess/NetworkDataTaskBlob.cpp:
414         (WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse):
415         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
416         (toNSURLSessionResponseDisposition):
417         * UIProcess/WebPageProxy.cpp:
418         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
419
420 2019-02-01  Jer Noble  <jer.noble@apple.com>
421
422         Unreviewed build fix; Respect the 'condition:' field in the WebPreferences.yaml when generating
423         WebPreferencesStoreDefaultsMap.cpp.
424
425         * page/SettingsBase.h:
426
427 2019-02-01  Antoine Quint  <graouts@apple.com>
428
429         Dispatch pointercancel events when content is panned or zoomed on iOS
430         https://bugs.webkit.org/show_bug.cgi?id=193962
431         <rdar://problem/47629134>
432
433         Reviewed by Dean Jackson.
434
435         When a user-agent-provided interaction, such as panning or zooming on iOS, uses a set of touches, we should dispatch a pointercancel
436         event for the pointer ids of the touches involved. To facilitate this, we add a new method on WKContentView to cancel all the pointers
437         matching active touches for a provided UIGestureRecognizer through an async IPC call into the Web process using the new method
438         PointerCaptureController::cancelPointer().
439
440         * Platform/spi/ios/UIKitSPI.h: Add the necessary forward declaration for a necessary UIKit SPI allowing us to get the set of last-seen
441         UITouches by the identifier generated for the matching WebKit touch.
442         * UIProcess/API/Cocoa/WKWebView.mm:
443         (-[WKWebView scrollViewWillBeginZooming:withView:]): Dispatch touchcancel events for all pointers involved in a pinch gesture on the
444         top-level UIScrollView.
445         (-[WKWebView _scrollView:adjustedOffsetForOffset:translation:startPoint:locationInView:horizontalVelocity:verticalVelocity:]): Dispatch
446         touchcancel events for all pointers involved in a pan gesture on the top-level UIScrollView. We can infer this by looking at whether the
447         adjusted content offset, after accounting for the permitted touch actions, is different from the original content offset.
448         * UIProcess/PageClient.h: Expose a new virtual cancelPointersForGestureRecognizer() method which will allow the iOS implementation to
449         forward the call to WKContentViewInteraction.
450         (WebKit::PageClient::cancelPointersForGestureRecognizer):
451         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h: Expose the WebPageProxy such that we may access it to cancel pointers for
452         a given gesture recognizer from within ScrollingTreeScrollingNodeDelegateIOS.
453         (WebKit::RemoteScrollingCoordinatorProxy::webPageProxy const):
454         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
455         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
456         (-[WKScrollingNodeScrollViewDelegate _scrollView:adjustedOffsetForOffset:translation:startPoint:locationInView:horizontalVelocity:verticalVelocity:]):
457         Dispatch touchcancel events for all pointers involved in a pan gesture on a nested UIScrollView. We can infer this by looking at
458         whether the adjusted content offset, after accounting for the permitted touch actions, is different from the original content offset.
459         (-[WKScrollingNodeScrollViewDelegate scrollViewWillBeginZooming:withView:]): Dispatch touchcancel events for all pointers involved in a
460         pinch gesture on a nested UIScrollView.
461         (-[WKScrollingNodeScrollViewDelegate cancelPointersForGestureRecognizer:]):
462         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::cancelPointersForGestureRecognizer):
463         * UIProcess/WebPageProxy.cpp:
464         (WebKit::WebPageProxy::cancelPointer):
465         * UIProcess/WebPageProxy.h:
466         * UIProcess/ios/PageClientImplIOS.h:
467         * UIProcess/ios/PageClientImplIOS.mm:
468         (WebKit::PageClientImpl::cancelPointersForGestureRecognizer):
469         * UIProcess/ios/WKContentViewInteraction.h:
470         * UIProcess/ios/WKContentViewInteraction.mm:
471         (-[WKContentView cancelPointersForGestureRecognizer:]): Obtain all active UITouch objects for the view and dispatch a pointercancel event,
472         through the WebPageProxy, for all touches associated with the provided gesture recognizer.
473         * WebProcess/WebPage/WebPage.cpp:
474         (WebKit::WebPage::cancelPointer):
475         * WebProcess/WebPage/WebPage.h:
476         * WebProcess/WebPage/WebPage.messages.in:
477
478 2019-02-01  Jer Noble  <jer.noble@apple.com>
479
480         Make the WebKit default for media source based on the WebCore default.
481         https://bugs.webkit.org/show_bug.cgi?id=194172
482
483         Reviewed by Eric Carlson.
484
485         * Shared/WebPreferences.yaml:
486         * UIProcess/API/Cocoa/WKPreferences.mm:
487         (-[WKPreferences _setMediaSourceEnabled:]):
488         (-[WKPreferences _mediaSourceEnabled]):
489         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
490
491 2019-02-01  Simon Fraser  <simon.fraser@apple.com>
492
493         Force settings.acceleratedCompositingEnabled() to true for WebKit
494         https://bugs.webkit.org/show_bug.cgi?id=194166
495         rdar://problem/47694328
496
497         Reviewed by Tim Horton.
498
499         WebKit relies on accelerated compositing for its drawing areas to function correctly,
500         and sometimes clients (*cough* Safari *cough*) have bugs where they clobber the settings,
501         so force this setting to be always on (and release log if this happens).
502
503         * WebProcess/WebPage/WebPage.cpp:
504         (WebKit::WebPage::updatePreferences):
505
506 2019-02-01  Antti Koivisto  <antti@apple.com>
507
508         Don't use base layer() as the scroll layer in scrolling tree.
509         https://bugs.webkit.org/show_bug.cgi?id=194160
510
511         Reviewed by Simon Fraser.
512
513         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
514         (ArgumentCoder<ScrollingStateNode>::encode):
515         (ArgumentCoder<ScrollingStateNode>::decode):
516         (ArgumentCoder<ScrollingStateScrollingNode>::encode):
517         (ArgumentCoder<ScrollingStateScrollingNode>::decode):
518         (WebKit::dump):
519         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
520         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
521         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
522         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
523         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
524         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateBeforeChildren):
525         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
526         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateBeforeChildren):
527         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
528         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateBeforeChildren):
529         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren):
530
531 2019-02-01  Michael Catanzaro  <mcatanzaro@igalia.com>
532
533         [SOUP] Improve use of SoupCookiePersistentStorageType
534         https://bugs.webkit.org/show_bug.cgi?id=194103
535
536         Reviewed by Carlos Garcia Campos.
537
538         Turn it into an enum class, and stop casting it to and from uint32_t.
539
540         * NetworkProcess/Cookies/WebCookieManager.h:
541         * NetworkProcess/Cookies/WebCookieManager.messages.in:
542         * NetworkProcess/Cookies/soup/WebCookieManagerSoup.cpp:
543         (WebKit::WebCookieManager::setCookiePersistentStorage):
544         * NetworkProcess/NetworkSessionCreationParameters.cpp:
545         (WebKit::NetworkSessionCreationParameters::privateSessionParameters):
546         (WebKit::NetworkSessionCreationParameters::decode):
547         * NetworkProcess/NetworkSessionCreationParameters.h:
548         * Shared/soup/SoupCookiePersistentStorageType.h:
549         (): Deleted.
550         * UIProcess/API/glib/WebKitCookieManager.cpp:
551         * UIProcess/WebCookieManagerProxy.h:
552         * UIProcess/soup/WebCookieManagerProxySoup.cpp:
553         (WebKit::WebCookieManagerProxy::setCookiePersistentStorage):
554         (WebKit::WebCookieManagerProxy::getCookiePersistentStorage const):
555
556 2019-02-01  Per Arne Vollan  <pvollan@apple.com>
557
558         [macOS] Revert parts of r240811, since it causes kernel panics.
559         https://bugs.webkit.org/show_bug.cgi?id=194061
560
561         Unreviewed crash fix.
562
563         * WebProcess/com.apple.WebProcess.sb.in:
564
565 2019-02-01  Michael Catanzaro  <mcatanzaro@igalia.com>
566
567         [SOUP] Improve use of PAL::SessionID in WebKitCookieManager
568         https://bugs.webkit.org/show_bug.cgi?id=194092
569
570         Reviewed by Carlos Garcia Campos.
571
572         Always get it from the data store instead of assuming the default session ID, and add a
573         helper function for this.
574
575         * UIProcess/API/glib/WebKitCookieManager.cpp:
576         (_WebKitCookieManagerPrivate::sessionID const):
577         (_WebKitCookieManagerPrivate::~_WebKitCookieManagerPrivate):
578         (webkitCookieManagerCreate):
579         (webkit_cookie_manager_set_persistent_storage):
580         (webkit_cookie_manager_set_accept_policy):
581         (webkit_cookie_manager_get_accept_policy):
582         (webkit_cookie_manager_add_cookie):
583         (webkit_cookie_manager_get_cookies):
584         (webkit_cookie_manager_delete_cookie):
585
586 2019-01-31  Takashi Komori  <Takashi.Komori@sony.com>
587
588         [Curl] Remove unnecessary member from NetworkStorageSession.
589         https://bugs.webkit.org/show_bug.cgi?id=194137
590
591         Reviewed by Don Olmstead.
592
593         * NetworkProcess/curl/NetworkProcessCurl.cpp:
594         (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
595
596 2019-01-31  Jiewen Tan  <jiewen_tan@apple.com>
597
598         Unreviewed, build fix after r240805
599
600         This patch reverts the BlockPtr change since it breaks iOS builds.
601
602         * UIProcess/Cocoa/NavigationState.mm:
603         (WebKit::tryInterceptNavigation):
604
605 2019-01-31  Chris Dumez  <cdumez@apple.com>
606
607         Page zoom level is lost after a process swap or a crash
608         https://bugs.webkit.org/show_bug.cgi?id=194105
609         <rdar://problem/47610781>
610
611         Reviewed by Alex Christensen.
612
613         Previously, when the client would call setPageAndTextZoomFactors() on the WebPageProxy,
614         we would update the WebPageProxy's corresponding data members and send an IPC to the
615         WebProcess to apply the zoom factors.
616
617         The issue is that on process crash or process-swap, we never communicate those zoom factors
618         to the new WebProcess. Even if the client were to call setPageAndTextZoomFactors() with
619         the same factors again, it would be a no-op since the WebPageProxy's data members already
620         reflect the expected values.
621
622         To address the issue, pass both the page zoom and the text zoom factors to the WebProcess
623         via WebPageCreationParameters. This way, there is no need to send an extra IPC and we're
624         sure the WebPageProxy's factors are properly applied to the WebPage on WebContent process
625         side upon creation (whether after a crash or a process swap).
626
627         * Shared/WebPageCreationParameters.cpp:
628         (WebKit::WebPageCreationParameters::encode const):
629         (WebKit::WebPageCreationParameters::decode):
630         * Shared/WebPageCreationParameters.h:
631         * UIProcess/WebPageProxy.cpp:
632         (WebKit::WebPageProxy::creationParameters):
633         * WebProcess/WebPage/WebPage.cpp:
634
635 2019-01-31  Per Arne Vollan  <pvollan@apple.com>
636
637         [macOS] Disable permissive call logging in sandbox
638         https://bugs.webkit.org/show_bug.cgi?id=194061
639
640         Reviewed by Alexey Proskuryakov.
641
642         Strict call filtering should be reenabled.
643
644         * WebProcess/com.apple.WebProcess.sb.in:
645
646 2019-01-31  Per Arne Vollan  <pvollan@apple.com>
647
648         [macOS] Crash when control-clicking or copying text rendered with a web font
649         https://bugs.webkit.org/show_bug.cgi?id=193913
650         <rdar://problem/47541039>
651
652         Reviewed by Brent Fulgham.
653
654         On older versions of macOS, allowing mach lookup to com.apple.FontObjectsServer is needed.
655
656         * WebProcess/com.apple.WebProcess.sb.in:
657
658 2019-01-31  Benjamin Poulain  <benjamin@webkit.org>
659
660         Remove WKPageIsWebProcessResponsive
661         https://bugs.webkit.org/show_bug.cgi?id=194096
662
663         Reviewed by Alex Christensen.
664
665         It is not used by any client.
666
667         It is also bad API. It is better to let WebKit track
668         responsiveness and tell the client with processDidBecomeResponsive.
669
670         * UIProcess/API/C/WKPage.cpp:
671         (WKPageIsWebProcessResponsive): Deleted.
672         * UIProcess/API/C/WKPagePrivate.h:
673         * UIProcess/WebPageProxy.cpp:
674         (WebKit::WebPageProxy::isWebProcessResponsive): Deleted.
675         * UIProcess/WebPageProxy.h:
676
677 2019-01-31  Alex Christensen  <achristensen@webkit.org>
678
679         Revert r238819 which is unneeded and caused a performance regression.
680         https://bugs.webkit.org/show_bug.cgi?id=192272
681         <rdar://problem/46664625>
682
683         * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h:
684         (API::InjectedBundle::PageLoaderClient::didStartProvisionalLoadForFrame):
685         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h:
686         * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
687         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
688         (PageLoaderClient::didStartProvisionalLoadForFrame):
689         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
690         (WebKit::InjectedBundlePageLoaderClient::didStartProvisionalLoadForFrame):
691         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
692         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
693         (WebKit::WebFrameLoaderClient::dispatchDidStartProvisionalLoad):
694         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
695
696 2019-01-31  Jiewen Tan  <jiewen_tan@apple.com>
697
698         Formalize WebKitAdditions mechanism of LoadOptimizer
699         https://bugs.webkit.org/show_bug.cgi?id=193886
700         <rdar://problem/47696809>
701
702         Reviewed by Brent Fulgham.
703
704         This patch does the following few things:
705         1) formalizes WebKitAdditions mechanism of LoadOptimizer;
706         2) modernizes AppLinks code in tryInterceptNavigation to use BlockPtr;
707         3) lets AppLinks have higher precedence than LoadOptimizer.
708
709         * SourcesCocoa.txt:
710         * UIProcess/Cocoa/LoadOptimizer.h: Removed.
711         * UIProcess/Cocoa/LoadOptimizer.mm: Removed.
712         * UIProcess/Cocoa/NavigationState.mm:
713         (WebKit::tryOptimizingLoad):
714         (WebKit::tryInterceptNavigation):
715         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
716         (WebKit::WebsiteDataStore::WebsiteDataStore):
717         * UIProcess/WebsiteData/WebsiteDataStore.h:
718         (WebKit::WebsiteDataStore::loadOptimizer): Deleted.
719         * WebKit.xcodeproj/project.pbxproj:
720
721 2019-01-31  Chris Dumez  <cdumez@apple.com>
722
723         Regression(PSON) Crash under WebProcessProxy::canTerminateChildProcess()
724         https://bugs.webkit.org/show_bug.cgi?id=194094
725         <rdar://problem/47580753>
726
727         Reviewed by Ryosuke Niwa.
728
729         If a SuspendedPageProxy gets destroyed while a WebPageProxy is waiting for its to finish to suspend,
730         call the "failure to suspend" completion handler asynchronously instead of synchronouly to make sure
731         the completion handler cannot try and use the suspended page proxy while it is being destroyed.
732
733         * UIProcess/SuspendedPageProxy.cpp:
734         (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
735
736 2019-01-31  Timothy Hatcher  <timothy@apple.com>
737
738         Fix LSAppLink deprecation warnings.
739         https://bugs.webkit.org/show_bug.cgi?id=194097
740
741         Unreviewed build fix.
742
743         * UIProcess/ios/WKActionSheetAssistant.mm:
744         (-[WKActionSheetAssistant _appendOpenActionsForURL:actions:elementInfo:]):
745
746 2019-01-30  Simon Fraser  <simon.fraser@apple.com>
747
748         [Mac] Implement basic hit testing in the scrolling tree
749         https://bugs.webkit.org/show_bug.cgi?id=172917
750         <rdar://problem/34215516>
751
752         Reviewed by Antti Koivisto.
753
754         Changed return types, "using namespace WebCore" in ScrollingTreeFrameScrollingNodeRemoteMac.cpp.
755
756         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
757         (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
758         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
759         * UIProcess/RemoteLayerTree/mac/ScrollerPairMac.h:
760         * UIProcess/RemoteLayerTree/mac/ScrollerPairMac.mm:
761         (WebKit::ScrollerPairMac::handleWheelEvent):
762         (WebKit::ScrollerPairMac::handleMouseEvent):
763         * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp:
764         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::handleWheelEvent):
765         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::handleMouseEvent):
766         * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.h:
767
768 2019-01-31  Michael Catanzaro  <mcatanzaro@igalia.com>
769
770         [SOUP] Move cookiePersistentStoragePath and cookiePersistentStorageType from NetworkProcess to NetworkSession
771         https://bugs.webkit.org/show_bug.cgi?id=194075
772
773         Reviewed by Alex Christensen.
774
775         Move cookiePersistentStoragePath and cookiePersistentStorageType from NetworkProcess to
776         NetworkSession to reduce globals. This removes two of the six soup-specific variables in
777         NetworkProcessCreationParameters
778
779         * NetworkProcess/Cookies/WebCookieManager.h:
780         * NetworkProcess/Cookies/WebCookieManager.messages.in:
781         * NetworkProcess/Cookies/soup/WebCookieManagerSoup.cpp:
782         (WebKit::WebCookieManager::setCookiePersistentStorage):
783         * NetworkProcess/NetworkProcessCreationParameters.cpp:
784         (WebKit::NetworkProcessCreationParameters::encode const):
785         (WebKit::NetworkProcessCreationParameters::decode):
786         * NetworkProcess/NetworkProcessCreationParameters.h:
787         * NetworkProcess/NetworkSessionCreationParameters.cpp:
788         (WebKit::NetworkSessionCreationParameters::privateSessionParameters):
789         (WebKit::NetworkSessionCreationParameters::encode const):
790         (WebKit::NetworkSessionCreationParameters::decode):
791         * NetworkProcess/NetworkSessionCreationParameters.h:
792         * NetworkProcess/soup/NetworkProcessSoup.cpp:
793         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
794         * NetworkProcess/soup/NetworkSessionSoup.cpp:
795         (WebKit::NetworkSessionSoup::NetworkSessionSoup):
796         * SourcesGTK.txt:
797         * SourcesWPE.txt:
798         * UIProcess/API/glib/WebKitCookieManager.cpp:
799         (webkit_cookie_manager_set_persistent_storage):
800         * UIProcess/WebCookieManagerProxy.cpp:
801         (WebKit::WebCookieManagerProxy::WebCookieManagerProxy):
802         * UIProcess/WebCookieManagerProxy.h:
803         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
804         (WebKit::WebsiteDataStore::parameters):
805         * UIProcess/WebsiteData/WebsiteDataStore.h:
806         * UIProcess/WebsiteData/curl/WebsiteDataStoreCurl.cpp:
807         (WebKit::WebsiteDataStore::platformSetNetworkParameters):
808         (WebKit::WebsiteDataStore::platformSetParameters): Deleted.
809         * UIProcess/soup/WebCookieManagerProxySoup.cpp:
810         (WebKit::WebCookieManagerProxy::setCookiePersistentStorage):
811         (WebKit::WebCookieManagerProxy::getCookiePersistentStorage const):
812         * UIProcess/soup/WebProcessPoolSoup.cpp:
813         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
814
815 2019-01-31  Ryosuke Niwa  <rniwa@webkit.org>
816
817         iOS: Crash in InteractiveUpdateHandler set by ViewGestureController::beginSwipeGesture
818         https://bugs.webkit.org/show_bug.cgi?id=194083
819
820         Reviewed by Tim Horton.
821
822         We think this crash is a regression from r236966. Prior to r236966, we could only called
823         removeSwipeSnapshot() only when m_provisionalOrSameDocumentLoadCallback was set but now
824         we can call it either when m_snapshotRemovalTracker::start was called, or it had been reset.
825         This can result in m_webPageProxyForBackForwardListForCurrentSwipe getting cleared before
826         InteractiveUpdateHandler is called by UIGestureRecognizer, resulting in the crash.
827
828         This patch tries to restore the behavior prior to r236966 by only invoking removeSwipeSnapshot()
829         when SnapshotRemovalTracker has a valid removal callback set.
830
831         Unfortunately no new tests since there is no reproducible test case, and neither API tests
832         nor layout tests seem to have the capability to trigger swipe gestures via UIGestureRecognizer,
833         which is required for this crash to occur. Notably, back-forward swipe tests I enabled in
834         r240765 bypass UIKit and emulates the action instead.
835
836         * UIProcess/Cocoa/ViewGestureController.cpp:
837         (WebKit::ViewGestureController::didReachMainFrameLoadTerminalState):
838         * UIProcess/Cocoa/ViewGestureController.h:
839         (WebKit::ViewGestureController::SnapshotRemovalTracker::hasRemovalCallback const):
840
841 2019-01-30  Benjamin Poulain  <benjamin@webkit.org>
842
843         <rdar://problem/47570443> Responsiveness timers are too expensive for frequent events
844         https://bugs.webkit.org/show_bug.cgi?id=194003
845
846         Reviewed by Geoffrey Garen.
847
848         The problem here is specific to wheel events.
849
850         For every wheel event, we start a responsiveness timer and send
851         a ping to the WebProcess. When the WebProcess respond, we stop the timer.
852
853         The cost of setting up the timers adds up since we get many events.
854
855         The first step to improve the situation was to switch ResponsivenessTimer
856         to WebCore::Timer. Since WebCore::Timer reuse the same CFRunLoopTimerRef,
857         we save the allocation/deallocation, insertion in the event loop, etc.
858
859         Using WebCore::Timer saves some instructions but we were still hitting
860         the kernel at 120hz to set up then kill each timer.
861         The second improvement of the patch is to avoid that by not killing the timer
862         when we hear back from the WebProcess.
863
864         Instead of killing the timer, we let it run and ignore the result.
865         When the next event comes, we reschedule the existing timer.
866         This brings down the timers to 60Hz, the same rate as the events.
867
868         The very last event does time out. In that case, we have a bad idle wake up:
869         we wake up a sleeping CPU do do nothing.
870         In the case of wheel events, this is fine since we saved a bunch of CPU already.
871         For all the other cases, I kept the normal operating mode to avoid the idle wake.
872
873         * UIProcess/ResponsivenessTimer.cpp:
874         (WebKit::ResponsivenessTimer::ResponsivenessTimer):
875         (WebKit::ResponsivenessTimer::invalidate):
876         (WebKit::ResponsivenessTimer::timerFired):
877         (WebKit::ResponsivenessTimer::start):
878         (WebKit::ResponsivenessTimer::startWithLazyStop):
879         (WebKit::ResponsivenessTimer::stop):
880         (WebKit::ResponsivenessTimer::processTerminated):
881         (WebKit::ResponsivenessTimer::~ResponsivenessTimer): Deleted.
882         * UIProcess/ResponsivenessTimer.h:
883         * UIProcess/WebPageProxy.cpp:
884         (WebKit::WebPageProxy::sendWheelEvent):
885         * UIProcess/WebProcessProxy.cpp:
886         (WebKit::WebProcessProxy::isResponsiveWithLazyStop):
887         * UIProcess/WebProcessProxy.h:
888
889 2019-01-30  Daniel Bates  <dabates@apple.com>
890
891         [iOS] REGRESSION (r238635): Text area fails to re-focus after dismissal of keyboard on support.apple.com
892         https://bugs.webkit.org/show_bug.cgi?id=193987
893         <rdar://problem/47230785>
894
895         Reviewed by Tim Horton.
896
897         It is unnecessary to relinquish first responder status when a user explicitly dismissing
898         the keyboard. Moreover, doing so prevents key commands from being intercepted when a
899         hardware keyboard is subsequently attached.
900         
901         Following r238635 a page becomes focused (accepting of keyboard input) and defocused
902         when the WKContentView becomes first responder and resigns first responder, respectively.
903         When a user explicitly dismisses the keyboard by tapping Done (iPhone) or the hide keyboard
904         button (iPad) then UIKit tells WKContentView to resign its first responder status only
905         to make its superview, WKWebView, first responder. When a person subsequently taps on the
906         page again, the WKContentView requests to become the first responder. However changes to
907         page focus are not guaranteed to be sent to the WebProcess immediately (WebPageProxy::activityStateDidChange()
908         will schedule an update). In particular, they are not guaranteed to be sent before the
909         WebProcess is told about a tap. Therefore, the WebProcess has out-of-date information on
910         focus state of the page. Instead we should detect when WKWebView is being asked to resign
911         as a result of the keyboard dismissal and refuse the request, taking care to end the current
912         editing session, blur the focused element, and dismiss the on-screen keyboard.
913
914         * Platform/spi/ios/UIKitSPI.h: Expose some SPI.
915         * UIProcess/ios/WKContentViewInteraction.h:
916         * UIProcess/ios/WKContentViewInteraction.mm:
917         (-[WKContentView setupInteraction]): Register to receive notifications whenever a user
918         explicitly dismisses the keyboard.
919         (-[WKContentView resignFirstResponderForWebView]): If we are being asked to resign as a
920         result of a user explicitly dismissing the keyboard then refuse to resign.
921         (-[WKContentView _keyboardDidRequestDismissal:]): Update state, if applicable.
922
923 2019-01-30  Keith Rollin  <krollin@apple.com>
924
925         Add default constructor for NetworkActivityTracker
926         https://bugs.webkit.org/show_bug.cgi?id=194058
927         <rdar://problem/47685457>
928
929         Reviewed by Chris Dumez.
930
931         ResourceNetworkActivityTracker has a default constructor. It also has
932         a NetworkActivityTracker data member, which does not have a default
933         constructor. This will cause some compilers to complain -- they can't
934         default-create a ResourceNetworkActivityTracker because they can't
935         default-create its data members. Address this by adding a default
936         constructor for NetworkActivityTracker.
937
938         * NetworkProcess/NetworkActivityTracker.h:
939
940 2019-01-30  Daniel Steffen  <dsteffen@apple.com>
941
942         <rdar://problem/29471922> Safari should switch from the legacy denap SPI to handling vouchers
943         https://bugs.webkit.org/show_bug.cgi?id=193992
944
945         Reviewed by Geoffrey Garen.
946
947         The denap SPI is deprecated.
948         The new way of staying out of AppNap is through a voucher.
949
950         * Platform/IPC/mac/ConnectionMac.mm:
951         (IPC::readFromMachPort):
952         * Platform/IPC/mac/ImportanceAssertion.h:
953         (IPC::ImportanceAssertion::ImportanceAssertion):
954         (IPC::ImportanceAssertion::~ImportanceAssertion):
955
956 2019-01-30  Chris Dumez  <cdumez@apple.com>
957
958         Fix crashes when trying to ref the CallbackAggregator in NetworkProcess
959         https://bugs.webkit.org/show_bug.cgi?id=194054
960
961         Reviewed by Brent Fulgham.
962
963         The callback aggregators should be ThreadSafeRefCounted since they are passed to other threads.
964
965         * NetworkProcess/NetworkProcess.cpp:
966         (WebKit::NetworkProcess::fetchWebsiteData):
967         (WebKit::NetworkProcess::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
968         (WebKit::NetworkProcess::topPrivatelyControlledDomainsWithWebsiteData):
969
970 2019-01-30  Daniel Bates  <dabates@apple.com>
971
972         [iOS] Keyups for non-modifier keys identified as "Dead" when not focused in a content-editable element
973         https://bugs.webkit.org/show_bug.cgi?id=192824
974         <rdar://problem/47100332>
975
976         Reviewed by Wenson Hsieh.
977
978         Use the same code path for key events to editable elements and non-editable elements.
979
980         Currently we have different code paths for hardware key events depending on whether the active element
981         is editable or non-editable. Historically to support dispatching DOM keyboard events for hardware key
982         presses this differentiation was a necessary workaround for UIKit's event processing precedence of
983         interpreting key events for system text editing commands and app commands before dispatching unhandled
984         key events to WebKit. This workaround intercepted raw key UIEvents and manually reconstructed a
985         WebEvent from it. However there is not enough information in an UIEvent to reconstruct a WebEvent that
986         is identical to the WebEvent that UIKit would have dispatched. In particular, keyup UIEvents always have
987         empty modified and unmodified input strings. The UIKit keyboard machinery maintains additional state
988         that is necessary to manufacture the correct WebEvent corresponding to a UIEvent.
989
990         As a side benefit of this change, with the exception of modifier flag changes, both hardware and software
991         key events use the same code path.
992
993         * UIProcess/ios/WKContentViewInteraction.h:
994         * UIProcess/ios/WKContentViewInteraction.mm:
995         (-[WKContentView shouldShowAutomaticKeyboardUI]): Extracted code from _requiresKeyboardWhenFirstResponder
996         (-[WKContentView _disableAutomaticKeyboardUI]): Implement UIKit SPI to prevent showing the keyboard UI
997         when there is no focused element now that we are no longer intercepting key UIEvents. Formerly the
998         keyboard UI was disabled as a side effect of not becoming first responder when there was no focused
999         element (by returning NO in -_requiresKeyboardWhenFirstResponder).
1000         (-[WKContentView _requiresKeyboardWhenFirstResponder]): Always return YES when building with USE(UIKIT_KEYBOARD_ADDITIONS)
1001         so that we always accept key events. Instead of selectively replying to create a keyboard as a means of
1002         hiding the automatic keyboard UI we now implement _disableAutomaticKeyboardUI to selectively hide the
1003         automatic keyboard UI.
1004         (-[WKContentView textInputTraits]): Do not update traits when the keyboard is going to be dismissed
1005         now that we require a keyboard when first responder even if the focused element is non-editable.
1006         (-[WKContentView _didHandleKeyEvent:eventWasHandled:]): Skip logic for re-sending UIEvents to UIKit
1007         as UIKit now processes the event first. This logic was necessary in order to finally allow UIKit
1008         its chance to interpret the UIEvent, we intercepted, for app key commands.
1009         (-[WKContentView _elementDidBlur]): Call [self _endEditing] so that we dismiss any open form controls
1010         (e.g. a <select> popover menu). Currently this happens either by -_requiresKeyboardWhenFirstResponder
1011         responding NO when switching to another field or pressing Tab or Shift + Tab key command, which we will
1012         no longer use when building with USE(UIKIT_KEYBOARD_ADDITIONS) once I land <https://bugs.webkit.org/show_bug.cgi?id=193048>.
1013         * UIProcess/ios/forms/WKFormSelectPopover.mm:
1014         (-[WKSelectPopover initWithView:hasGroups:]): Do not assign ourself as the keyboard delegate. Otherwise,
1015         type ahead and tab cycling will not work. Currently type ahead and tab cycling work by using the non-
1016         editable code path via -_handleKeyUIEvent. Now that we no longer differentiate between key events for
1017         editable and non-editable elements we need to ensure that the WKContentView is the keyboard delegate
1018         when the popover is presented.
1019
1020 2019-01-30  Per Arne Vollan  <pvollan@apple.com>
1021
1022         [macOS] Sandbox fails to compile on 10.12
1023         https://bugs.webkit.org/show_bug.cgi?id=194035
1024         <rdar://problem/47651260>
1025
1026         Reviewed by Brent Fulgham.
1027
1028         This was caused by the commit <https://trac.webkit.org/changeset/239994>, which is only valid for
1029         10.14 and later.
1030
1031         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
1032         * WebProcess/com.apple.WebProcess.sb.in:
1033
1034 2019-01-29  Conrad Shultz  <conrad_shultz@apple.com>
1035
1036         Ensure image picker sourceType is set before cameraDevice
1037         https://bugs.webkit.org/show_bug.cgi?id=193998
1038
1039         Reviewed by Beth Dakin.
1040
1041         * UIProcess/ios/forms/WKFileUploadPanel.mm:
1042         (-[WKFileUploadPanel _showPhotoPickerWithSourceType:]):
1043
1044 2019-01-30  Chris Dumez  <cdumez@apple.com>
1045
1046         Regression(PSON) Load hang can occur on history navigation
1047         https://bugs.webkit.org/show_bug.cgi?id=194030
1048         <rdar://problem/47656939>
1049
1050         Reviewed by Antti Koivisto.
1051
1052         We do not support having more than one WebPage in a WebProcess with the same page ID. As a result,
1053         if we decide to reuse an existing process on process-swap, we need to make sure that we either use
1054         its suspended page (when possible, meaning that it is for the right HistoryItem / page) or we need
1055         make sure we drop the existing suspended page for this process / pagePID combination, so that the
1056         WebPage on WebProcess side gets closed before we attempt to do the new load.
1057
1058         We were doing this correctly in 2 places in WebProcessPool::processForNavigationInternal() but failed
1059         to do so in a third place, when doing back to a HistoryItem which does not have a SuspendedPage but
1060         whose process is still alive (presumably because it is kept alive by another suspended page). This
1061         patch fixes this third place to remove any suspended page in the process for the current page before
1062         reusing the process. An assertion was also added to the call site in
1063         WebPageProxy::receivedNavigationPolicyDecision() to make sure we catch this more easily in the
1064         future.
1065
1066         * UIProcess/WebPageProxy.cpp:
1067         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
1068         * UIProcess/WebProcessPool.cpp:
1069         (WebKit::WebProcessPool::processForNavigationInternal):
1070         (WebKit::WebProcessPool::removeAllSuspendedPagesForPage):
1071         (WebKit::WebProcessPool::hasSuspendedPageFor const):
1072         * UIProcess/WebProcessPool.h:
1073
1074 2019-01-30  Carlos Garcia Campos  <cgarcia@igalia.com>
1075
1076         [GTK][Wayland] REGRESSION(r240712): Clear the GL context if it's the current one on dispose
1077         https://bugs.webkit.org/show_bug.cgi?id=194024
1078
1079         Reviewed by Michael Catanzaro.
1080
1081         Fixes a crash in gdk_gl_context_dispose().
1082
1083         * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
1084         (WebKit::AcceleratedBackingStoreWayland::~AcceleratedBackingStoreWayland):
1085
1086 2019-01-30  Antti Koivisto  <antti@apple.com>
1087
1088         Crash in WebKit::RemoteLayerTreePropertyApplier::updateChildren
1089         https://bugs.webkit.org/show_bug.cgi?id=193897
1090         <rdar://problem/47427750>
1091
1092         Reviewed by Simon Fraser.
1093
1094         There has been some null pointer crashes where we fail to find a remote layer tree node that matches
1095         the transaction properties.
1096
1097         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
1098         (WebKit::RemoteLayerTreePropertyApplier::updateChildren):
1099
1100         Null check the nodes.
1101
1102 2019-01-30  Simon Fraser  <simon.fraser@apple.com>
1103
1104         Add some basic geometry information to the scrolling tree
1105         https://bugs.webkit.org/show_bug.cgi?id=194002
1106
1107         Reviewed by Antti Koivisto.
1108
1109         Add a comment explaining why we don't need to encode/decode ParentRelativeScrollableRect.
1110
1111         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
1112         (ArgumentCoder<ScrollingStateFrameHostingNode>::encode):
1113
1114 2019-01-30  Carlos Garcia Campos  <cgarcia@igalia.com>
1115
1116         [GTK] gdk_cairo_draw_from_gl() in AcceleratedBackingStoreWayland fails in GtkInspector's magnifier
1117         https://bugs.webkit.org/show_bug.cgi?id=193903
1118
1119         Reviewed by Michael Catanzaro.
1120
1121         The problem is that the GL context used by WaylandCompositor can't share resources with the one used by GTK+
1122         when painting with gdk_cairo_draw_from_gl(). Accelerated compositing in Wayland works only because
1123         WaylandCompositor makes the context current only once on initialization. So, when we render the first frame on
1124         accelerated compositing mode, GTK+ is rendering in non-GL mode, and switches to the GL mode when
1125         gdk_cairo_draw_from_gl() is called. Since GTK+ didn't have a GL context yet, the first frame is always rendered
1126         by GTK+ using the software fallback (glReadPixels). The thing is that the first time gdk_cairo_draw_from_gl() is
1127         called, GTK+ creates a GL context for painting that is made current, and it will remain the current one
1128         forever. The first frame fails to render with "GL_INVALID_OPERATION in glBindTexture(non-gen name)" because the
1129         texture created in WaylandCompositor GL context can't be accessed from GTK+ GL context. The following frames are
1130         handled with the GTK+ GL context. I would say this works by casuality and it could be the cause of other
1131         accelerated compositing issues in Wayland.
1132
1133         We need to create our own GdkGLContext for the WebView, and use that in the WaylandCompositor. When the
1134         GdkGLContext is created, the GTK+ GL context for painting is used as a shared context, ensuring that resources
1135         created in the new context will be accessible from the painting one.
1136
1137         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1138         (webkitWebViewBaseMakeGLContextCurrent): Call AcceleratedBackingStore::makeContextCurrent().
1139         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
1140         * UIProcess/WebPageProxy.h:
1141         * UIProcess/gtk/AcceleratedBackingStore.h:
1142         (WebKit::AcceleratedBackingStore::makeContextCurrent): New virtual method only implemented by Wayland backend.
1143         * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
1144         (WebKit::AcceleratedBackingStoreWayland::tryEnsureGLContext): Try to create a GL context with
1145         gdk_window_create_gl_context(), falling back to a WebCore::GLContext if it fails or GTK+ version is not new enough.
1146         (WebKit::AcceleratedBackingStoreWayland::makeContextCurrent): Make the GL context current.
1147         (WebKit::AcceleratedBackingStoreWayland::paint): Check if we have a GdkGLContext before trying to use gdk_cairo_draw_from_gl().
1148         (WebKit::AcceleratedBackingStoreWayland::canGdkUseGL const): Deleted.
1149         * UIProcess/gtk/AcceleratedBackingStoreWayland.h:
1150         * UIProcess/gtk/WaylandCompositor.cpp:
1151         (WebKit::WaylandCompositor::Surface::Surface): Move the texture creation to setWebPage(), since we need the
1152         WebView GL context.
1153         (WebKit::WaylandCompositor::Surface::~Surface): Move the code to destroy GL resources to setWebPage().
1154         (WebKit::WaylandCompositor::Surface::setWebPage): Create the texture when a new page is set and destroy GL
1155         resources when unset.
1156         (WebKit::WaylandCompositor::Surface::prepareTextureForPainting): Make WebView GL context current.
1157         (WebKit::WaylandCompositor::Surface::commit): Ditto.
1158         (WebKit::WaylandCompositor::initializeEGL): Use a temporary GLContext.
1159         * UIProcess/gtk/WaylandCompositor.h:
1160         * UIProcess/gtk/WebPageProxyGtk.cpp:
1161         (WebKit::WebPageProxy::makeGLContextCurrent): Call webkitWebViewBaseMakeGLContextCurrent().
1162
1163 2019-01-29  Ryosuke Niwa  <rniwa@webkit.org>
1164
1165         iOS: Nullptr crash in WebPage::getPositionInformation dereferencing an input element for data list
1166         https://bugs.webkit.org/show_bug.cgi?id=193996
1167
1168         Reviewed by Wenson Hsieh.
1169
1170         Added a missing nullptr check.
1171
1172         * WebProcess/WebPage/ios/WebPageIOS.mm:
1173         (WebKit::WebPage::getPositionInformation):
1174
1175 2019-01-29  Simon Fraser  <simon.fraser@apple.com>
1176
1177         Add nodes to the scrolling tree in z-index order.
1178         https://bugs.webkit.org/show_bug.cgi?id=192529
1179         <rdar://problem/47402708>
1180
1181         Reviewed by Dean Jackson.
1182
1183         FrameHosting nodes have layers, so need to update them.
1184
1185         * Platform/Logging.cpp:
1186         (WebKit::initializeLogChannelsIfNecessary):
1187         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
1188         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
1189
1190 2019-01-29  Alex Christensen  <achristensen@webkit.org>
1191
1192         Change NetworkConnectionToWebProcess* to NetworkConnectionToWebProcess& where possible
1193         https://bugs.webkit.org/show_bug.cgi?id=193974
1194
1195         Reviewed by Tim Horton.
1196
1197         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
1198         (WebKit::NetworkBlobRegistry::registerFileBlobURL):
1199         (WebKit::NetworkBlobRegistry::registerBlobURL):
1200         (WebKit::NetworkBlobRegistry::registerBlobURLOptionallyFileBacked):
1201         (WebKit::NetworkBlobRegistry::registerBlobURLForSlice):
1202         (WebKit::NetworkBlobRegistry::unregisterBlobURL):
1203         (WebKit::NetworkBlobRegistry::blobSize):
1204         (WebKit::NetworkBlobRegistry::connectionToWebProcessDidClose):
1205         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
1206         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1207         (WebKit::NetworkConnectionToWebProcess::didClose):
1208         (WebKit::NetworkConnectionToWebProcess::registerFileBlobURL):
1209         (WebKit::NetworkConnectionToWebProcess::registerBlobURL):
1210         (WebKit::NetworkConnectionToWebProcess::registerBlobURLFromURL):
1211         (WebKit::NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked):
1212         (WebKit::NetworkConnectionToWebProcess::registerBlobURLForSlice):
1213         (WebKit::NetworkConnectionToWebProcess::unregisterBlobURL):
1214         (WebKit::NetworkConnectionToWebProcess::blobSize):
1215         * NetworkProcess/NetworkProcess.cpp:
1216         (WebKit::NetworkProcess::removeNetworkConnectionToWebProcess):
1217         * NetworkProcess/NetworkProcess.h:
1218
1219 2019-01-29  Youenn Fablet  <youenn@apple.com>
1220
1221         Adopt new SPI to evaluate server certificate trust
1222         https://bugs.webkit.org/show_bug.cgi?id=193355
1223
1224         Reviewed by Alex Christensen.
1225
1226         Use new SPI provided in NSURLSession to evaluate server certificates.
1227         If successful, let loading proceed as usual.
1228         Otherwise, go to the UIProcess to ask for a decision on continuing the load or not.
1229
1230         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
1231         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1232         (canNSURLSessionTrustEvaluate):
1233         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
1234         (WebKit::NetworkSessionCocoa::continueDidReceiveChallenge):
1235
1236 2019-01-29  Tim Horton  <timothy_horton@apple.com>
1237
1238         Fix the build
1239
1240         * UIProcess/ios/WKDrawingCoordinator.h:
1241         * UIProcess/ios/WKDrawingCoordinator.mm:
1242         * UIProcess/ios/WKDrawingView.mm:
1243
1244 2019-01-29  Alex Christensen  <achristensen@webkit.org>
1245
1246         Remove unused NetworkProcessProxy::writeBlobToFilePath
1247         https://bugs.webkit.org/show_bug.cgi?id=193990
1248
1249         Reviewed by Wenson Hsieh.
1250
1251         This code was only used in code that was introduced in r235202
1252         but that has since been refactored to not use blobs.  Its tests still pass.
1253         This removes the only UIProcess-controlled code that uses NetworkBlobRegistry::singleton.
1254
1255         * NetworkProcess/NetworkProcess.cpp:
1256         (WebKit::NetworkProcess::writeBlobToFilePath): Deleted.
1257         * NetworkProcess/NetworkProcess.h:
1258         * NetworkProcess/NetworkProcess.messages.in:
1259         * UIProcess/Cocoa/WebViewImpl.mm:
1260         (WebKit::WebViewImpl::writeToURLForFilePromiseProvider):
1261         * UIProcess/Network/NetworkProcessProxy.cpp:
1262         (WebKit::NetworkProcessProxy::writeBlobToFilePath): Deleted.
1263         * UIProcess/Network/NetworkProcessProxy.h:
1264         * UIProcess/WebPageProxy.cpp:
1265         (WebKit::WebPageProxy::writeBlobToFilePath): Deleted.
1266         * UIProcess/WebPageProxy.h:
1267
1268 2019-01-29  Devin Rousso  <drousso@apple.com>
1269
1270         Web Inspector: expose a way of determining if a detached frontend is for a remote target
1271         https://bugs.webkit.org/show_bug.cgi?id=193951
1272         <rdar://problem/47621366>
1273
1274         Reviewed by Joseph Pecoraro.
1275
1276         * UIProcess/WebInspectorProxy.h:
1277         (WebKit::WebInspectorProxy::InspectionTargetType): Added.
1278         (WebKit::WebInspectorProxy::createFrontendWindow):
1279         * UIProcess/mac/WebInspectorProxyMac.mm:
1280         (WebKit::WebInspectorProxy::createFrontendWindow):
1281         (WebKit::WebInspectorProxy::platformCreateFrontendWindow):
1282         * UIProcess/mac/RemoteWebInspectorProxyMac.mm:
1283         (WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow):
1284
1285         * UIProcess/API/Cocoa/_WKInspectorWindow.h: Moved from UIProcess/mac/WKInspectorWindow.h.
1286         * UIProcess/API/Cocoa/_WKInspectorWindow.mm: Moved from UIProcess/mac/WKInspectorWindow.mm.
1287         (-[WKInspectorWindow isRemote]): Added.
1288
1289         * Shared/API/Cocoa/_WKNSWindowExtras.mm:
1290         (-[NSWindow _web_isWebInspectorWindow]):
1291
1292         * PlatformMac.cmake:
1293         * SourcesCocoa.txt:
1294         * UnifiedSources-input.xcfilelist:
1295         * WebKit.xcodeproj/project.pbxproj:
1296
1297 2019-01-29  Alex Christensen  <achristensen@webkit.org>
1298
1299         Rename ChildProcess to AuxiliaryProcess
1300         https://bugs.webkit.org/show_bug.cgi?id=193943
1301
1302         Reviewed by Andy Estes.
1303
1304         "Child" implies that there is a parent, but I'm about to introduce a type of NetworkProcess that
1305         doesn't always have a parent, and may have many UIProcesses that it is the auxiliary for.
1306
1307         * CMakeLists.txt:
1308         * DerivedSources-input.xcfilelist:
1309         * DerivedSources-output.xcfilelist:
1310         * DerivedSources.make:
1311         * NetworkProcess/Cookies/WebCookieManager.cpp:
1312         * NetworkProcess/Cookies/soup/WebCookieManagerSoup.cpp:
1313         * NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm:
1314         (WebKit::initializeAuxiliaryProcess<NetworkProcess>):
1315         (WebKit::initializeChildProcess<NetworkProcess>): Deleted.
1316         * NetworkProcess/NetworkProcess.cpp:
1317         (WebKit::callExitSoon):
1318         (WebKit::NetworkProcess::NetworkProcess):
1319         (WebKit::NetworkProcess::didReceiveMessage):
1320         (WebKit::NetworkProcess::initializeConnection):
1321         (WebKit::NetworkProcess::terminate):
1322         (WebKit::NetworkProcess::initializeProcess):
1323         (WebKit::NetworkProcess::initializeProcessName):
1324         (WebKit::NetworkProcess::initializeSandbox):
1325         * NetworkProcess/NetworkProcess.h:
1326         * NetworkProcess/NetworkProcessSupplement.h:
1327         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1328         (WebKit::NetworkCache::Storage::deleteOldVersions):
1329         * NetworkProcess/ios/NetworkProcessIOS.mm:
1330         (WebKit::NetworkProcess::initializeProcess):
1331         (WebKit::NetworkProcess::initializeProcessName):
1332         (WebKit::NetworkProcess::initializeSandbox):
1333         * NetworkProcess/mac/NetworkProcessMac.mm:
1334         (WebKit::NetworkProcess::initializeProcess):
1335         (WebKit::NetworkProcess::initializeProcessName):
1336         (WebKit::NetworkProcess::initializeSandbox):
1337         * NetworkProcess/soup/NetworkProcessMainSoup.cpp:
1338         (WebKit::initializeAuxiliaryProcess<NetworkProcess>):
1339         (WebKit::NetworkProcessMainUnix):
1340         (WebKit::initializeChildProcess<NetworkProcess>): Deleted.
1341         * NetworkProcess/watchos/NetworkProximityManager.h:
1342         * NetworkProcess/watchos/NetworkProximityManager.mm:
1343         (WebKit::NetworkProximityManager::NetworkProximityManager):
1344         * NetworkProcess/win/NetworkProcessMainWin.cpp:
1345         (WebKit::initializeAuxiliaryProcess<NetworkProcess>):
1346         (WebKit::NetworkProcessMainWin):
1347         (WebKit::initializeChildProcess<NetworkProcess>): Deleted.
1348         * PlatformGTK.cmake:
1349         * PlatformMac.cmake:
1350         * PlatformWin.cmake:
1351         * PluginProcess/PluginProcess.cpp:
1352         (WebKit::PluginProcess::initializeProcess):
1353         (WebKit::PluginProcess::initializeConnection):
1354         (WebKit::PluginProcess::didReceiveMessage):
1355         (WebKit::PluginProcess::initializeProcessName):
1356         (WebKit::PluginProcess::initializeSandbox):
1357         * PluginProcess/PluginProcess.h:
1358         * PluginProcess/mac/PluginProcessMac.mm:
1359         (WebKit::PluginProcess::platformInitializeProcess):
1360         (WebKit::PluginProcess::initializeProcessName):
1361         (WebKit::PluginProcess::initializeSandbox):
1362         (WebKit::PluginProcess::stopRunLoop):
1363         * PluginProcess/unix/PluginProcessMainUnix.cpp:
1364         (WebKit::PluginProcessMainUnix):
1365         * PluginProcess/unix/PluginProcessUnix.cpp:
1366         (WebKit::PluginProcess::platformInitializeProcess):
1367         * Shared/Authentication/AuthenticationManager.cpp:
1368         (WebKit::AuthenticationManager::AuthenticationManager):
1369         * Shared/Authentication/AuthenticationManager.h:
1370         * Shared/AuxiliaryProcess.cpp: Copied from Source/WebKit/Shared/ChildProcess.cpp.
1371         (WebKit::AuxiliaryProcess::AuxiliaryProcess):
1372         (WebKit::AuxiliaryProcess::~AuxiliaryProcess):
1373         (WebKit::AuxiliaryProcess::didClose):
1374         (WebKit::AuxiliaryProcess::initialize):
1375         (WebKit::AuxiliaryProcess::setProcessSuppressionEnabled):
1376         (WebKit::AuxiliaryProcess::initializeProcess):
1377         (WebKit::AuxiliaryProcess::initializeProcessName):
1378         (WebKit::AuxiliaryProcess::initializeConnection):
1379         (WebKit::AuxiliaryProcess::addMessageReceiver):
1380         (WebKit::AuxiliaryProcess::removeMessageReceiver):
1381         (WebKit::AuxiliaryProcess::disableTermination):
1382         (WebKit::AuxiliaryProcess::enableTermination):
1383         (WebKit::AuxiliaryProcess::messageSenderConnection):
1384         (WebKit::AuxiliaryProcess::messageSenderDestinationID):
1385         (WebKit::AuxiliaryProcess::terminationTimerFired):
1386         (WebKit::AuxiliaryProcess::stopRunLoop):
1387         (WebKit::AuxiliaryProcess::platformStopRunLoop):
1388         (WebKit::AuxiliaryProcess::terminate):
1389         (WebKit::AuxiliaryProcess::shutDown):
1390         (WebKit::AuxiliaryProcess::registerURLSchemeServiceWorkersCanHandle const):
1391         (WebKit::AuxiliaryProcess::platformInitialize):
1392         (WebKit::AuxiliaryProcess::initializeSandbox):
1393         (WebKit::AuxiliaryProcess::didReceiveInvalidMessage):
1394         (WebKit::AuxiliaryProcess::didReceiveMemoryPressureEvent):
1395         (WebKit::ChildProcess::ChildProcess): Deleted.
1396         (WebKit::ChildProcess::~ChildProcess): Deleted.
1397         (WebKit::ChildProcess::didClose): Deleted.
1398         (WebKit::ChildProcess::initialize): Deleted.
1399         (WebKit::ChildProcess::setProcessSuppressionEnabled): Deleted.
1400         (WebKit::ChildProcess::initializeProcess): Deleted.
1401         (WebKit::ChildProcess::initializeProcessName): Deleted.
1402         (WebKit::ChildProcess::initializeConnection): Deleted.
1403         (WebKit::ChildProcess::addMessageReceiver): Deleted.
1404         (WebKit::ChildProcess::removeMessageReceiver): Deleted.
1405         (WebKit::ChildProcess::disableTermination): Deleted.
1406         (WebKit::ChildProcess::enableTermination): Deleted.
1407         (WebKit::ChildProcess::messageSenderConnection): Deleted.
1408         (WebKit::ChildProcess::messageSenderDestinationID): Deleted.
1409         (WebKit::ChildProcess::terminationTimerFired): Deleted.
1410         (WebKit::ChildProcess::stopRunLoop): Deleted.
1411         (WebKit::ChildProcess::platformStopRunLoop): Deleted.
1412         (WebKit::ChildProcess::terminate): Deleted.
1413         (WebKit::ChildProcess::shutDown): Deleted.
1414         (WebKit::ChildProcess::registerURLSchemeServiceWorkersCanHandle const): Deleted.
1415         (WebKit::ChildProcess::platformInitialize): Deleted.
1416         (WebKit::ChildProcess::initializeSandbox): Deleted.
1417         (WebKit::ChildProcess::didReceiveInvalidMessage): Deleted.
1418         (WebKit::ChildProcess::didReceiveMemoryPressureEvent): Deleted.
1419         * Shared/AuxiliaryProcess.h: Copied from Source/WebKit/Shared/ChildProcess.h.
1420         (WebKit::ChildProcess::parentProcessConnection const): Deleted.
1421         (WebKit::ChildProcess::messageReceiverMap): Deleted.
1422         (WebKit::ChildProcess::setTerminationTimeout): Deleted.
1423         (WebKit::ChildProcess::shouldOverrideQuarantine): Deleted.
1424         * Shared/AuxiliaryProcess.messages.in: Copied from Source/WebKit/Shared/ChildProcess.messages.in.
1425         * Shared/AuxiliaryProcessSupplement.h: Copied from Source/WebKit/Shared/ChildProcessSupplement.h.
1426         (WebKit::AuxiliaryProcessSupplement::~AuxiliaryProcessSupplement):
1427         (WebKit::ChildProcessSupplement::~ChildProcessSupplement): Deleted.
1428         (WebKit::ChildProcessSupplement::initializeConnection): Deleted.
1429         * Shared/ChildProcess.cpp: Removed.
1430         * Shared/ChildProcess.h: Removed.
1431         * Shared/ChildProcess.messages.in: Removed.
1432         * Shared/ChildProcessSupplement.h: Removed.
1433         * Shared/Cocoa/AuxiliaryProcessCocoa.mm: Copied from Source/WebKit/Shared/Cocoa/ChildProcessCocoa.mm.
1434         (WebKit::AuxiliaryProcess::didReceiveInvalidMessage):
1435         (WebKit::ChildProcess::didReceiveInvalidMessage): Deleted.
1436         * Shared/Cocoa/ChildProcessCocoa.mm: Removed.
1437         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
1438         (WebKit::initializeAuxiliaryProcess):
1439         (WebKit::XPCServiceInitializer):
1440         (WebKit::initializeChildProcess): Deleted.
1441         * Shared/WebSQLiteDatabaseTracker.cpp:
1442         (WebKit::WebSQLiteDatabaseTracker::WebSQLiteDatabaseTracker):
1443         (WebKit::WebSQLiteDatabaseTracker::hysteresisUpdated):
1444         (WebKit::m_childProcessType): Deleted.
1445         * Shared/WebSQLiteDatabaseTracker.h:
1446         * Shared/ios/AuxiliaryProcessIOS.mm: Copied from Source/WebKit/Shared/ios/ChildProcessIOS.mm.
1447         (WebKit::AuxiliaryProcess::platformInitialize):
1448         (WebKit::AuxiliaryProcess::initializeSandbox):
1449         (WebKit::AuxiliaryProcess::setQOS):
1450         (WebKit::AuxiliaryProcess::platformStopRunLoop):
1451         (WebKit::ChildProcess::platformInitialize): Deleted.
1452         (WebKit::ChildProcess::initializeSandbox): Deleted.
1453         (WebKit::ChildProcess::setQOS): Deleted.
1454         (WebKit::ChildProcess::platformStopRunLoop): Deleted.
1455         * Shared/ios/ChildProcessIOS.mm: Removed.
1456         * Shared/mac/AuxiliaryProcessMac.mm: Copied from Source/WebKit/Shared/mac/ChildProcessMac.mm.
1457         (WebKit::SandboxInfo::SandboxInfo):
1458         (WebKit::AuxiliaryProcess::launchServicesCheckIn):
1459         (WebKit::AuxiliaryProcess::platformInitialize):
1460         (WebKit::processStorageClass):
1461         (WebKit::sandboxDirectory):
1462         (WebKit::applySandbox):
1463         (WebKit::initializeSandboxParameters):
1464         (WebKit::AuxiliaryProcess::initializeSandbox):
1465         (WebKit::AuxiliaryProcess::stopNSAppRunLoop):
1466         (WebKit::AuxiliaryProcess::stopNSRunLoop):
1467         (WebKit::AuxiliaryProcess::platformStopRunLoop):
1468         (WebKit::AuxiliaryProcess::setQOS):
1469         (WebKit::AuxiliaryProcess::isSystemWebKit):
1470         (WebKit::ChildProcess::launchServicesCheckIn): Deleted.
1471         (WebKit::ChildProcess::platformInitialize): Deleted.
1472         (WebKit::ChildProcess::initializeSandbox): Deleted.
1473         (WebKit::ChildProcess::stopNSAppRunLoop): Deleted.
1474         (WebKit::ChildProcess::stopNSRunLoop): Deleted.
1475         (WebKit::ChildProcess::platformStopRunLoop): Deleted.
1476         (WebKit::ChildProcess::setQOS): Deleted.
1477         (WebKit::ChildProcess::isSystemWebKit): Deleted.
1478         * Shared/mac/ChildProcessMac.mm: Removed.
1479         * Shared/mac/SecItemShim.cpp:
1480         (WebKit::globalNetworkProcess):
1481         (WebKit::sendSecItemRequest):
1482         (WebKit::initializeSecItemShim):
1483         * Shared/mac/SecItemShim.h:
1484         * Shared/unix/AuxiliaryProcessMain.cpp: Copied from Source/WebKit/Shared/unix/ChildProcessMain.cpp.
1485         (WebKit::AuxiliaryProcessMainBase::parseCommandLine):
1486         (WebKit::ChildProcessMainBase::parseCommandLine): Deleted.
1487         * Shared/unix/AuxiliaryProcessMain.h: Copied from Source/WebKit/Shared/unix/ChildProcessMain.h.
1488         (WebKit::AuxiliaryProcessMainBase::takeInitializationParameters):
1489         (WebKit::initializeAuxiliaryProcess):
1490         (WebKit::AuxiliaryProcessMain):
1491         (WebKit::ChildProcessMainBase::platformInitialize): Deleted.
1492         (WebKit::ChildProcessMainBase::platformFinalize): Deleted.
1493         (WebKit::ChildProcessMainBase::takeInitializationParameters): Deleted.
1494         (WebKit::initializeChildProcess): Deleted.
1495         (WebKit::ChildProcessMain): Deleted.
1496         * Shared/unix/ChildProcessMain.cpp: Removed.
1497         * Shared/unix/ChildProcessMain.h: Removed.
1498         * Shared/win/AuxiliaryProcessMainWin.cpp: Copied from Source/WebKit/Shared/win/ChildProcessMainWin.cpp.
1499         (WebKit::AuxiliaryProcessMainBase::parseCommandLine):
1500         (WebKit::ChildProcessMainBase::parseCommandLine): Deleted.
1501         * Shared/win/ChildProcessMainWin.cpp: Removed.
1502         * Sources.txt:
1503         * SourcesCocoa.txt:
1504         * SourcesGTK.txt:
1505         * SourcesWPE.txt:
1506         * UIProcess/Authentication/AuthenticationChallengeProxy.cpp:
1507         * UIProcess/Authentication/AuthenticationChallengeProxy.h:
1508         * UIProcess/AuxiliaryProcessProxy.cpp: Copied from Source/WebKit/UIProcess/ChildProcessProxy.cpp.
1509         (WebKit::AuxiliaryProcessProxy::AuxiliaryProcessProxy):
1510         (WebKit::AuxiliaryProcessProxy::~AuxiliaryProcessProxy):
1511         (WebKit::AuxiliaryProcessProxy::getLaunchOptions):
1512         (WebKit::AuxiliaryProcessProxy::connect):
1513         (WebKit::AuxiliaryProcessProxy::terminate):
1514         (WebKit::AuxiliaryProcessProxy::state const):
1515         (WebKit::AuxiliaryProcessProxy::sendMessage):
1516         (WebKit::AuxiliaryProcessProxy::addMessageReceiver):
1517         (WebKit::AuxiliaryProcessProxy::removeMessageReceiver):
1518         (WebKit::AuxiliaryProcessProxy::dispatchMessage):
1519         (WebKit::AuxiliaryProcessProxy::dispatchSyncMessage):
1520         (WebKit::AuxiliaryProcessProxy::didFinishLaunching):
1521         (WebKit::AuxiliaryProcessProxy::shutDownProcess):
1522         (WebKit::AuxiliaryProcessProxy::setProcessSuppressionEnabled):
1523         (WebKit::AuxiliaryProcessProxy::connectionWillOpen):
1524         (WebKit::ChildProcessProxy::ChildProcessProxy): Deleted.
1525         (WebKit::ChildProcessProxy::~ChildProcessProxy): Deleted.
1526         (WebKit::ChildProcessProxy::getLaunchOptions): Deleted.
1527         (WebKit::ChildProcessProxy::connect): Deleted.
1528         (WebKit::ChildProcessProxy::terminate): Deleted.
1529         (WebKit::ChildProcessProxy::state const): Deleted.
1530         (WebKit::ChildProcessProxy::sendMessage): Deleted.
1531         (WebKit::ChildProcessProxy::addMessageReceiver): Deleted.
1532         (WebKit::ChildProcessProxy::removeMessageReceiver): Deleted.
1533         (WebKit::ChildProcessProxy::dispatchMessage): Deleted.
1534         (WebKit::ChildProcessProxy::dispatchSyncMessage): Deleted.
1535         (WebKit::ChildProcessProxy::didFinishLaunching): Deleted.
1536         (WebKit::ChildProcessProxy::shutDownProcess): Deleted.
1537         (WebKit::ChildProcessProxy::setProcessSuppressionEnabled): Deleted.
1538         (WebKit::ChildProcessProxy::connectionWillOpen): Deleted.
1539         * UIProcess/AuxiliaryProcessProxy.h: Copied from Source/WebKit/UIProcess/ChildProcessProxy.h.
1540         (WebKit::AuxiliaryProcessProxy::send):
1541         (WebKit::AuxiliaryProcessProxy::sendSync):
1542         (WebKit::AuxiliaryProcessProxy::sendWithAsyncReply):
1543         (WebKit::ChildProcessProxy::send): Deleted.
1544         (WebKit::ChildProcessProxy::sendSync): Deleted.
1545         (WebKit::ChildProcessProxy::connection const): Deleted.
1546         (WebKit::ChildProcessProxy::hasConnection const): Deleted.
1547         (WebKit::ChildProcessProxy::processIdentifier const): Deleted.
1548         (WebKit::ChildProcessProxy::canSendMessage const): Deleted.
1549         (WebKit::ChildProcessProxy::coreProcessIdentifier const): Deleted.
1550         (WebKit::ChildProcessProxy::platformGetLaunchOptions): Deleted.
1551         (WebKit::ChildProcessProxy::sendWithAsyncReply): Deleted.
1552         * UIProcess/ChildProcessProxy.cpp: Removed.
1553         * UIProcess/ChildProcessProxy.h: Removed.
1554         * UIProcess/Downloads/DownloadProxyMap.cpp:
1555         (WebKit::DownloadProxyMap::DownloadProxyMap):
1556         * UIProcess/Downloads/DownloadProxyMap.h:
1557         * UIProcess/Network/NetworkProcessProxy.cpp:
1558         (WebKit::NetworkProcessProxy::NetworkProcessProxy):
1559         (WebKit::NetworkProcessProxy::getLaunchOptions):
1560         (WebKit::NetworkProcessProxy::createDownloadProxy):
1561         (WebKit::NetworkProcessProxy::didFinishLaunching):
1562         * UIProcess/Network/NetworkProcessProxy.h:
1563         * UIProcess/Plugins/PluginProcessProxy.cpp:
1564         (WebKit::PluginProcessProxy::getLaunchOptions):
1565         (WebKit::PluginProcessProxy::sendMemoryPressureEvent):
1566         * UIProcess/Plugins/PluginProcessProxy.h:
1567         * UIProcess/ServiceWorkerProcessProxy.h:
1568         * UIProcess/WebPageProxy.cpp:
1569         (WebKit::WebPageProxy::finishAttachingToWebProcess):
1570         * UIProcess/WebProcessPool.cpp:
1571         (WebKit::WebProcessPool::sendMemoryPressureEvent):
1572         (WebKit::WebProcessPool::registerURLSchemeServiceWorkersCanHandle):
1573         * UIProcess/WebProcessProxy.cpp:
1574         (WebKit::WebProcessProxy::WebProcessProxy):
1575         (WebKit::WebProcessProxy::getLaunchOptions):
1576         (WebKit::WebProcessProxy::didFinishLaunching):
1577         (WebKit::WebProcessProxy::maybeShutDown):
1578         (WebKit::WebProcessProxy::canTerminateAuxiliaryProcess):
1579         (WebKit::WebProcessProxy::shouldTerminate):
1580         (WebKit::WebProcessProxy::requestTermination):
1581         (WebKit::WebProcessProxy::canTerminateChildProcess): Deleted.
1582         * UIProcess/WebProcessProxy.h:
1583         * UnifiedSources-input.xcfilelist:
1584         * WebKit.xcodeproj/project.pbxproj:
1585         * WebProcess/WebProcess.cpp:
1586         (WebKit::WebProcess::initializeProcess):
1587         (WebKit::WebProcess::initializeConnection):
1588         (WebKit::WebProcess::terminate):
1589         (WebKit::WebProcess::didReceiveMessage):
1590         (WebKit::WebProcess::initializeProcessName):
1591         (WebKit::WebProcess::initializeSandbox):
1592         (WebKit::WebProcess::platformInitializeProcess):
1593         * WebProcess/WebProcess.h:
1594         * WebProcess/WebProcessSupplement.h:
1595         * WebProcess/cocoa/WebProcessCocoa.mm:
1596         (WebKit::WebProcess::initializeProcessName):
1597         (WebKit::WebProcess::platformInitializeProcess):
1598         (WebKit::WebProcess::stopRunLoop):
1599         (WebKit::WebProcess::initializeSandbox):
1600         * WebProcess/gtk/WebProcessMainGtk.cpp:
1601         (WebKit::WebProcessMainUnix):
1602         * WebProcess/win/WebProcessMainWin.cpp:
1603         (WebKit::WebProcessMainWin):
1604         * WebProcess/wpe/WebProcessMainWPE.cpp:
1605         (WebKit::WebProcessMainUnix):
1606
1607 2019-01-29  Simon Fraser  <simon.fraser@apple.com>
1608
1609         REGRESSION(r240553): [iOS] Crash in ScrollingTree::updateTreeFromStateNode when attempting to log in to icloud.com
1610         https://bugs.webkit.org/show_bug.cgi?id=193907
1611
1612         Reviewed by Frédéric Wang.
1613
1614         Remove encode/decode of removedNodes.
1615
1616         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
1617         (WebKit::RemoteScrollingCoordinatorTransaction::encode const):
1618         (WebKit::RemoteScrollingCoordinatorTransaction::decode):
1619         (WebKit::dump):
1620
1621 2019-01-29  Brent Fulgham  <bfulgham@apple.com>
1622
1623         StorageAccess API calls should be direct to the Network Process
1624         https://bugs.webkit.org/show_bug.cgi?id=193924
1625         <rdar://problem/47611249>
1626
1627         Reviewed by Alex Christensen.
1628
1629         Now that the ResourceLoadStatistics data lives in the Network Process, calls to Storage Access
1630         API should happen directly between the WebContent and Network processes.
1631
1632         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
1633         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessGranted):
1634         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
1635         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1636         (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForFrame):
1637         (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForAllFramesOnPage):
1638         (WebKit::NetworkConnectionToWebProcess::logUserInteraction):
1639         (WebKit::NetworkConnectionToWebProcess::logWebSocketLoading):
1640         (WebKit::NetworkConnectionToWebProcess::logSubresourceLoading):
1641         (WebKit::NetworkConnectionToWebProcess::logSubresourceRedirect):
1642         (WebKit::NetworkConnectionToWebProcess::requestResourceLoadStatisticsUpdate):
1643         (WebKit::NetworkConnectionToWebProcess::hasStorageAccess):
1644         (WebKit::NetworkConnectionToWebProcess::requestStorageAccess):
1645         * NetworkProcess/NetworkConnectionToWebProcess.h:
1646         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1647         * NetworkProcess/NetworkProcess.cpp:
1648         (WebKit::NetworkProcess::requestStorageAccess):
1649         (WebKit::NetworkProcess::requestStorageAccessGranted):
1650         * NetworkProcess/NetworkProcess.h:
1651         * UIProcess/Network/NetworkProcessProxy.cpp:
1652         (WebKit::NetworkProcessProxy::requestStorageAccessConfirm):
1653         * UIProcess/Network/NetworkProcessProxy.h:
1654         * UIProcess/Network/NetworkProcessProxy.messages.in:
1655         * UIProcess/WebPageProxy.cpp:
1656         (WebKit::WebPageProxy::requestStorageAccessConfirm):
1657         (WebKit::WebPageProxy::hasStorageAccess): Deleted.
1658         (WebKit::WebPageProxy::requestStorageAccess): Deleted.
1659         * UIProcess/WebPageProxy.h:
1660         * UIProcess/WebPageProxy.messages.in:
1661         * WebProcess/WebPage/WebPage.cpp:
1662         (WebKit::WebPage::hasStorageAccess):
1663         (WebKit::WebPage::requestStorageAccess):
1664         (WebKit::nextRequestStorageAccessContextId): Deleted.
1665         (WebKit::WebPage::storageAccessResponse): Deleted.
1666         * WebProcess/WebPage/WebPage.h:
1667         * WebProcess/WebPage/WebPage.messages.in:
1668
1669 2019-01-29  Chris Dumez  <cdumez@apple.com>
1670
1671         Regression (r240046): [PSON] Spurious changes to [WKWebView url] and [WKWebView loading] after [WKWebView loadRequest]
1672         https://bugs.webkit.org/show_bug.cgi?id=193967
1673         <rdar://problem/47635348>
1674
1675         Reviewed by Alex Christensen.
1676
1677         Update WebPageProxy::receivedPolicyDecision() to no longer clear the pending URL when we send PolicyAction::Ignore to
1678         the old process when the load is continuing in a new process due to PSON.
1679
1680         * UIProcess/WebPageProxy.cpp:
1681         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
1682         (WebKit::WebPageProxy::receivedPolicyDecision):
1683         * UIProcess/WebPageProxy.h:
1684
1685 2019-01-29  Keith Rollin  <krollin@apple.com>
1686
1687         Add .xcfilelists to Run Script build phases
1688         https://bugs.webkit.org/show_bug.cgi?id=193792
1689         <rdar://problem/47201785>
1690
1691         Reviewed by Alex Christensen.
1692
1693         As part of supporting XCBuild, update the necessary Run Script build
1694         phases in their Xcode projects to refer to their associated
1695         .xcfilelist files.
1696
1697         Note that the addition of these files bumps the Xcode project version
1698         number to something that's Xcode 10 compatible. This change means that
1699         older versions of the Xcode IDE can't read these projects. Nor can it
1700         fully load workspaces that refer to these projects (the updated
1701         projects are shown as non-expandable placeholders). `xcodebuild` can
1702         still build these projects; it's just that the IDE can't open them.
1703
1704         Make special accommodations for incorporating .xcfilelists from
1705         WebKitAdditions.
1706
1707         * Configurations/Base.xcconfig:
1708         * Configurations/DebugRelease.xcconfig:
1709         * WebKit.xcodeproj/project.pbxproj:
1710
1711 2019-01-29  Antti Koivisto  <antti@apple.com>
1712
1713         REGRESSION (PSON): Flash on link navigation on Mac
1714         https://bugs.webkit.org/show_bug.cgi?id=193961
1715         <rdar://problem/47482507>
1716
1717         Reviewed by Chris Dumez.
1718
1719         The target page sends EnterAcceleratedCompositingMode message too early, before we have a valid layer tree.
1720
1721         * WebProcess/WebPage/DrawingArea.h:
1722         (WebKit::DrawingArea::attach): Deleted.
1723
1724         Not needed anymore.
1725
1726         * WebProcess/WebPage/WebPage.cpp:
1727         (WebKit::WebPage::reinitializeWebPage):
1728         (WebKit::WebPage::didCompletePageTransition):
1729         (WebKit::m_shouldAttachDrawingAreaOnPageTransition): Deleted.
1730
1731         Move message sending logic fully to TiledCoreAnimationDrawingArea.
1732         Unfreezing the layer tree is sufficient to trigger the message.
1733
1734         * WebProcess/WebPage/WebPage.h:
1735         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
1736         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1737         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
1738
1739         There is no need to treat process swap case differently.
1740
1741         (WebKit::TiledCoreAnimationDrawingArea::sendEnterAcceleratedCompositingModeIfNeeded):
1742
1743         Send this after the first successful layer flush with the root layer set.
1744
1745         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
1746         (WebKit::TiledCoreAnimationDrawingArea::attach): Deleted.
1747
1748 2019-01-29  Timothy Hatcher  <timothy@apple.com>
1749
1750         Add back some includes that got removed at some point.
1751         https://bugs.webkit.org/show_bug.cgi?id=193942
1752
1753         Reviewed by Tim Horton.
1754
1755         * UIProcess/API/Cocoa/WKWebView.mm:
1756         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1757         * UIProcess/ios/PageClientImplIOS.h:
1758         * UIProcess/ios/PageClientImplIOS.mm:
1759
1760 2019-01-29  Chris Dumez  <cdumez@apple.com>
1761
1762         Make sure WTF::generateObjectIdentifier() internal counter does not get duplicated
1763         https://bugs.webkit.org/show_bug.cgi?id=193848
1764
1765         Reviewed by Youenn Fablet.
1766
1767         * Platform/IPC/Connection.cpp:
1768         (IPC::Connection::Connection):
1769         * UIProcess/ChildProcessProxy.h:
1770         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
1771         (WebKit::WebUserContentControllerProxy::WebUserContentControllerProxy):
1772         * UIProcess/WebBackForwardList.cpp:
1773         (WebKit::WebBackForwardList::restoreFromState):
1774         * UIProcess/WebProcessPool.cpp:
1775         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
1776         (WebKit::UserMediaPermissionRequestManager::addDeviceChangeObserver):
1777
1778 2019-01-29  Chris Dumez  <cdumez@apple.com>
1779
1780         REGRESSION (PSON): Twitter link gets stuck at t.co after navigating back in tab
1781         https://bugs.webkit.org/show_bug.cgi?id=193932
1782         <rdar://problem/47598947>
1783
1784         Reviewed by Brady Eidson.
1785
1786         When doing a client side redirect from origin A to origin B, we would swap process and
1787         create a SuspendedPageProxy and save it on the source BackForwardListItem. The issue is
1788         that the BackForwardList is locked for such redirect so we end up updating the current
1789         BackForwardListItem with origin B's URL while origin A's suspended page remained on
1790         the item. When going to another URL in the same origin A, we would not create a suspended
1791         page since no process-swap would occur. When pressing the back button, we would go back
1792         to the previous BackForwardListItem and use its SuspendedPageProxy, which is for the
1793         wrong URL (The pre-client redirect one).
1794
1795         To address the issue, we no longer create a SuspendedPageProxy for cross-site client side
1796         redirects. There will be no way no go back to this suspended page anyway since the
1797         back/forward list item will be updated with the redirection URL.
1798
1799         * UIProcess/WebPageProxy.cpp:
1800         (WebKit::WebPageProxy::suspendCurrentPageIfPossible):
1801
1802 2019-01-29  Chris Dumez  <cdumez@apple.com>
1803
1804         Regression(r240046) VoiceOver is no longer working after a process swap
1805         https://bugs.webkit.org/show_bug.cgi?id=193953
1806         <rdar://problem/47612398>
1807
1808         Reviewed by Alex Christensen.
1809
1810         ProvisionalPageProxy used to forward the RegisterWebProcessAccessibilityToken IPC from
1811         the provisional WebProcess to the WebPageProxy right away. This in turn would notify
1812         the PageClient whose logic would rely on WebPageProxy::process(), which returns the
1813         committed process instead of the provisional one.
1814
1815         To address the issue, the ProvisionalPageProxy now stores the token sent by the
1816         provisional WebProcess and we only call registerWebProcessAccessibilityToken()
1817         on the WebPageProxy *after* we've swapped to the provisional process.
1818
1819         * UIProcess/ProvisionalPageProxy.cpp:
1820         (WebKit::ProvisionalPageProxy::registerWebProcessAccessibilityToken):
1821         (WebKit::ProvisionalPageProxy::didReceiveMessage):
1822         * UIProcess/ProvisionalPageProxy.h:
1823         (WebKit::ProvisionalPageProxy::takeAccessibilityToken):
1824         * UIProcess/WebPageProxy.cpp:
1825         (WebKit::WebPageProxy::commitProvisionalPage):
1826
1827 2019-01-28  Ryosuke Niwa  <rniwa@webkit.org>
1828
1829         User agent string override for navigator.userAgent should be site specific quirks
1830         https://bugs.webkit.org/show_bug.cgi?id=193950
1831
1832         Reviewed by Brent Fulgham.
1833
1834         Renamed the various member variables, functions, properties and selectors.
1835
1836         * Shared/WebsitePoliciesData.cpp:
1837         (WebKit::WebsitePoliciesData::encode const):
1838         (WebKit::WebsitePoliciesData::decode):
1839         (WebKit::WebsitePoliciesData::applyToDocumentLoader):
1840         * Shared/WebsitePoliciesData.h:
1841         * UIProcess/API/APIWebsitePolicies.cpp:
1842         (API::WebsitePolicies::data):
1843         * UIProcess/API/APIWebsitePolicies.h:
1844         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
1845         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
1846         (-[_WKWebsitePolicies setCustomJavaScriptUserAgentAsSiteSpecificQuirks:]): Renamed from setCustomJavaScriptUserAgent.
1847         (-[_WKWebsitePolicies customJavaScriptUserAgentAsSiteSpecificQuirks]): Renamed from customJavaScriptUserAgent.
1848
1849 2019-01-28  Commit Queue  <commit-queue@webkit.org>
1850
1851         Unreviewed, rolling out r240630.
1852         https://bugs.webkit.org/show_bug.cgi?id=193958
1853
1854         Broke Apple internal builds (Requested by rniwa on #webkit).
1855
1856         Reverted changeset:
1857
1858         "Add back some includes that got removed at some point."
1859         https://bugs.webkit.org/show_bug.cgi?id=193942
1860         https://trac.webkit.org/changeset/240630
1861
1862 2019-01-28  Devin Rousso  <drousso@apple.com>
1863
1864         Web Inspector: provide a way to edit page WebRTC settings on a remote target
1865         https://bugs.webkit.org/show_bug.cgi?id=193863
1866         <rdar://problem/47572764>
1867
1868         Reviewed by Joseph Pecoraro.
1869
1870         * Shared/WebPreferences.yaml:
1871         Add page-level settings for WebRTC preferences.
1872
1873 2019-01-28  Ross Kirsling  <ross.kirsling@sony.com>
1874
1875         Remove unnecessary `using namespace WTF`s (or at least restrict their scope).
1876         https://bugs.webkit.org/show_bug.cgi?id=193941
1877
1878         Reviewed by Alex Christensen.
1879
1880         * Shared/linux/WebMemorySamplerLinux.cpp:
1881
1882 2019-01-28  Fujii Hironori  <Hironori.Fujii@sony.com>
1883
1884         [Win] WebCore/platform/Process.h is conflicting with process.h
1885         https://bugs.webkit.org/show_bug.cgi?id=193944
1886
1887         Reviewed by Ross Kirsling.
1888
1889         * Shared/ChildProcess.h:
1890         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
1891         * Shared/unix/ChildProcessMain.cpp:
1892         * UIProcess/API/APINavigation.h:
1893         * UIProcess/ChildProcessProxy.h:
1894         * UIProcess/Launcher/ProcessLauncher.h:
1895         * UIProcess/WebProcessPool.cpp:
1896         * UIProcess/WebProcessProxy.h:
1897
1898 2019-01-28  Jon Lee  <jonlee@apple.com>
1899
1900         Update Screen Capture preference
1901         https://bugs.webkit.org/show_bug.cgi?id=193947
1902         rdar://problem/47620199
1903
1904         Reviewed by Youenn Fablet.
1905
1906         * Shared/WebPreferences.yaml:
1907
1908 2019-01-28  Andy Estes  <aestes@apple.com>
1909
1910         [watchOS] Enable Parental Controls content filtering
1911         https://bugs.webkit.org/show_bug.cgi?id=193939
1912         <rdar://problem/46641912>
1913
1914         Reviewed by Ryosuke Niwa.
1915
1916         * Configurations/FeatureDefines.xcconfig:
1917
1918 2019-01-28  David Kilzer  <ddkilzer@apple.com>
1919
1920         REGRESSION (r236481): Move soft-linking of LocalAuthentication.framework out of LocalAuthenticationSoftLink.h
1921         <https://webkit.org/b/193884>
1922
1923         Reviewed by Jiewen Tan.
1924
1925         * SourcesCocoa.txt:
1926         * UnifiedSources-input.xcfilelist:
1927         * WebKit.xcodeproj/project.pbxproj:
1928         - Add LocalAuthenticationSoftLink.mm to the project.
1929
1930         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticationSoftLink.h:
1931         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticationSoftLink.mm: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalAuthenticationSoftLink.h.
1932         - Move soft-linking implementation to
1933           LocalAuthenticationSoftLink.mm.
1934
1935 2019-01-28  Timothy Hatcher  <timothy@apple.com>
1936
1937         Add back some includes that got removed at some point.
1938         https://bugs.webkit.org/show_bug.cgi?id=193942
1939
1940         Reviewed by Tim Horton.
1941
1942         * UIProcess/API/Cocoa/WKWebView.mm:
1943         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1944         * UIProcess/ios/PageClientImplIOS.h:
1945         * UIProcess/ios/PageClientImplIOS.mm:
1946
1947 2019-01-28  Timothy Hatcher  <timothy@apple.com>
1948
1949         Make it easier for non-Apple ports to enable dark mode CSS support.
1950         https://bugs.webkit.org/show_bug.cgi?id=193882
1951
1952         Reviewed by Megan Gardner.
1953
1954         Make modern WebKit code for dark mode usable by other ports, to match
1955         the WebCore parts that have been cross-platform all along.
1956
1957         * Shared/WebPageCreationParameters.cpp:
1958         (WebKit::WebPageCreationParameters::encode const):
1959         (WebKit::WebPageCreationParameters::decode):
1960         * Shared/WebPageCreationParameters.h:
1961         * UIProcess/PageClient.h:
1962         (WebKit::PageClient::effectiveAppearanceIsDark const):
1963         * UIProcess/WebPageProxy.cpp:
1964         (WebKit::WebPageProxy::creationParameters):
1965         (WebKit::WebPageProxy::useDarkAppearance const):
1966         (WebKit::WebPageProxy::effectiveAppearanceDidChange):
1967         * UIProcess/WebPageProxy.h:
1968         * WebProcess/WebPage/WebPage.cpp:
1969         (WebKit::m_shouldAttachDrawingAreaOnPageTransition):
1970         (WebKit::WebPage::setUseDarkAppearance):
1971         * WebProcess/WebPage/WebPage.h:
1972         * WebProcess/WebPage/WebPage.messages.in:
1973
1974 2019-01-28  Andy Estes  <aestes@apple.com>
1975
1976         [Cocoa] Add SPI to _WKUserContentExtensionStore to retrieve its underlying WKContentRuleListStore
1977         https://bugs.webkit.org/show_bug.cgi?id=193927
1978
1979         Reviewed by Tim Horton.
1980
1981         This is useful for clients migrating from _WKUserContentExtensionStore to the modern
1982         WKContentRuleList* APIs.
1983
1984         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.mm:
1985         (-[_WKUserContentExtensionStore _contentRuleListStore]):
1986         * UIProcess/API/Cocoa/_WKUserContentExtensionStorePrivate.h:
1987
1988 2019-01-28  David Kilzer  <ddkilzer@apple.com>
1989
1990         Move soft-linking of ManagedConfiguration.framework out of ManagedConfigurationSPI.h
1991         <https://webkit.org/b/193868>
1992
1993         Reviewed by Daniel Bates.
1994
1995         * Platform/spi/ios/ManagedConfigurationSPI.h:
1996         - Remove soft-linking code from header.
1997         - Add PLATFORM(IOS_FAMILY) && !PLATFORM(IOSMAC) guard.
1998
1999         * UIProcess/ios/WKContentViewInteraction.mm:
2000         (-[WKContentView canPerformActionForWebView:withSender:]):
2001         (-[WKContentView _defineForWebView:]):
2002         - Add soft-linking code formerly in ManagedConfigurationSPI.h.
2003         - Change MCFeatureDefinitionLookupAllowed to use soft-link
2004           function getMCFeatureDefinitionLookupAllowed() to remove the
2005           #define.
2006
2007 2019-01-28  Per Arne Vollan  <pvollan@apple.com>
2008
2009         REGRESSION (r240348): Loading netflix home page panics device
2010         https://bugs.webkit.org/show_bug.cgi?id=193936
2011
2012         Reviewed by Alexey Proskuryakov.
2013
2014         Temporarily enable permissive call filtering.
2015
2016         * WebProcess/com.apple.WebProcess.sb.in:
2017
2018 2019-01-28  Joseph Pecoraro  <pecoraro@apple.com>
2019
2020         [iOS] Attempting to open a Keynote document to iCloud.com from iCloud Files causes crash
2021         https://bugs.webkit.org/show_bug.cgi?id=193456
2022         <rdar://problem/47275642>
2023
2024         Reviewed by Brent Fulgham.
2025
2026         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2027         Allow access to iconservices.
2028
2029 2019-01-28  Daniel Bates  <dabates@apple.com>
2030
2031         [iOS] Make Window virtual key code computation match Mac
2032         https://bugs.webkit.org/show_bug.cgi?id=193452
2033
2034         Reviewed by Ryosuke Niwa.
2035
2036         Compute the Windows virtual key code from the WebEvent.
2037
2038         * Shared/ios/WebIOSEventFactory.mm:
2039         (WebIOSEventFactory::createWebKeyboardEvent):
2040
2041 2019-01-28  Brent Fulgham  <bfulgham@apple.com>
2042
2043         REGRESSION (r240498): Storage Access API prompts result is not remembered
2044         https://bugs.webkit.org/show_bug.cgi?id=193922
2045         <rdar://problem/47608767>
2046
2047         Reviewed by Chris Dumez.
2048
2049         The refactoring in r240498 bypassed bookkeeping in ResourceLoadStatisticsMemoryStore
2050         that kept track of whether a successful user prompt had been encountered. This
2051         patch corrects this codepath so the user is not prompted repeatedly after approving
2052         use of the Storage Access API.
2053
2054         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
2055         (WebKit::WebResourceLoadStatisticsStore::grantStorageAccess): Switch from Move operator to
2056         const reference to allow the method to be called by the NetworkProcess.
2057         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
2058         * NetworkProcess/NetworkProcess.cpp:
2059         (WebKit::NetworkProcess::grantStorageAccess): Request access through the WebResourceLoadStatistics
2060         object, rather than jumping directly to the NetworkStorageSession.
2061
2062 2019-01-28  Chris Dumez  <cdumez@apple.com>
2063
2064         Regression(PSON) Crash under WebPageProxy::didStartProgress()
2065         https://bugs.webkit.org/show_bug.cgi?id=193915
2066         <rdar://problem/47560907>
2067
2068         Reviewed by Alex Christensen.
2069
2070         * UIProcess/WebPageProxy.cpp:
2071         (WebKit::WebPageProxy::close):
2072         Make sure we destroy the ProvisionalPageProxy if the page gets closed as we do not want to keep receiving
2073         IPC after this or even worse, commit the provisional page.
2074
2075         (WebKit::WebPageProxy::didStartProgress):
2076         Add an assertion in didStartProgress() to make sure we do not receive this IPC after the page has been
2077         closed.
2078
2079 2019-01-28  Antoine Quint  <graouts@apple.com>
2080
2081         Limit user-agent interactions based on the touch-action property on iOS
2082         https://bugs.webkit.org/show_bug.cgi?id=193447
2083
2084         Unreviewed build fix.
2085
2086         * UIProcess/API/Cocoa/WKWebView.mm:
2087
2088 2019-01-28  Antoine Quint  <graouts@apple.com>
2089
2090         Limit user-agent interactions based on the touch-action property on iOS
2091         https://bugs.webkit.org/show_bug.cgi?id=193447
2092
2093         Unreviewed build fix.
2094
2095         * UIProcess/ios/WKContentViewInteraction.mm:
2096
2097 2019-01-28  Brent Fulgham  <bfulgham@apple.com>
2098
2099         Remove the UIProcess components of the ResourceLoadStatistics code
2100         https://bugs.webkit.org/show_bug.cgi?id=193303
2101         <rdar://problem/47160073>
2102
2103         Reviewed by Chris Dumez.
2104
2105         Now that the ResourceLoadStatistics code is running in the NetworkProcess, we can get rid
2106         of the UIProcess copies of these routines.
2107
2108         Tested by existing ResourceLoadStatistics and StorageAccess tests.
2109
2110         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
2111         (WebKit::ResourceLoadStatisticsMemoryStore::updateClientSideCookiesAgeCap):
2112         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
2113         (WebKit::WebResourceLoadStatisticsStore::callHasStorageAccessForFrameHandler):
2114         (WebKit::WebResourceLoadStatisticsStore::callGrantStorageAccessHandler):
2115         (WebKit::WebResourceLoadStatisticsStore::removeAllStorageAccess):
2116         (WebKit::WebResourceLoadStatisticsStore::setCacheMaxAgeCap):
2117         (WebKit::WebResourceLoadStatisticsStore::callUpdatePrevalentDomainsToBlockCookiesForHandler):
2118         (WebKit::WebResourceLoadStatisticsStore::callRemoveDomainsHandler):
2119         (WebKit::WebResourceLoadStatisticsStore::logTestingEvent):
2120         (WebKit::WebResourceLoadStatisticsStore::notifyResourceLoadStatisticsProcessed):
2121         (WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
2122         (WebKit::WebResourceLoadStatisticsStore::topPrivatelyControlledDomainsWithWebsiteData):
2123         (WebKit::WebResourceLoadStatisticsStore::sendDiagnosticMessageWithValue const):
2124         (WebKit::WebResourceLoadStatisticsStore::notifyPageStatisticsTelemetryFinished const):
2125         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
2126         * UIProcess/WebProcessProxy.cpp:
2127         (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores): Deleted.
2128         (WebKit::WebProcessProxy::topPrivatelyControlledDomainsWithWebsiteData): Deleted.
2129         * UIProcess/WebProcessProxy.h:
2130         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2131         (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains):
2132         (WebKit::WebsiteDataStore::removeData):
2133         (WebKit::WebsiteDataStore::setMaxStatisticsEntries):
2134         (WebKit::WebsiteDataStore::setPruneEntriesDownTo):
2135         (WebKit::WebsiteDataStore::setGrandfatheringTime):
2136         (WebKit::WebsiteDataStore::setMinimumTimeBetweenDataRecordsRemoval):
2137         (WebKit::WebsiteDataStore::dumpResourceLoadStatistics):
2138         (WebKit::WebsiteDataStore::isPrevalentResource):
2139         (WebKit::WebsiteDataStore::setPrevalentResource):
2140         (WebKit::WebsiteDataStore::setPrevalentResourceForDebugMode):
2141         (WebKit::WebsiteDataStore::isVeryPrevalentResource):
2142         (WebKit::WebsiteDataStore::setVeryPrevalentResource):
2143         (WebKit::WebsiteDataStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
2144         (WebKit::WebsiteDataStore::setSubframeUnderTopFrameOrigin):
2145         (WebKit::WebsiteDataStore::isRegisteredAsSubFrameUnder):
2146         (WebKit::WebsiteDataStore::setSubresourceUnderTopFrameOrigin):
2147         (WebKit::WebsiteDataStore::isRegisteredAsSubresourceUnder):
2148         (WebKit::WebsiteDataStore::setSubresourceUniqueRedirectTo):
2149         (WebKit::WebsiteDataStore::setSubresourceUniqueRedirectFrom):
2150         (WebKit::WebsiteDataStore::setTopFrameUniqueRedirectTo):
2151         (WebKit::WebsiteDataStore::setTopFrameUniqueRedirectFrom):
2152         (WebKit::WebsiteDataStore::isRegisteredAsRedirectingTo):
2153         (WebKit::WebsiteDataStore::clearPrevalentResource):
2154         (WebKit::WebsiteDataStore::resetParametersToDefaultValues):
2155         (WebKit::WebsiteDataStore::submitTelemetry):
2156         (WebKit::WebsiteDataStore::scheduleClearInMemoryAndPersistent):
2157         (WebKit::WebsiteDataStore::scheduleCookieBlockingUpdate):
2158         (WebKit::WebsiteDataStore::scheduleStatisticsAndDataRecordsProcessing):
2159         (WebKit::WebsiteDataStore::setLastSeen):
2160         (WebKit::WebsiteDataStore::setNotifyPagesWhenDataRecordsWereScanned):
2161         (WebKit::WebsiteDataStore::setNotifyPagesWhenTelemetryWasCaptured):
2162         (WebKit::WebsiteDataStore::hasStorageAccess):
2163         (WebKit::WebsiteDataStore::requestStorageAccess):
2164         (WebKit::WebsiteDataStore::grantStorageAccess):
2165         (WebKit::WebsiteDataStore::setTimeToLiveUserInteraction):
2166         (WebKit::WebsiteDataStore::logUserInteraction):
2167         (WebKit::WebsiteDataStore::hasHadUserInteraction):
2168         (WebKit::WebsiteDataStore::clearUserInteraction):
2169         (WebKit::WebsiteDataStore::setGrandfathered):
2170         (WebKit::WebsiteDataStore::webProcessWillOpenConnection):
2171         (WebKit::WebsiteDataStore::webProcessDidCloseConnection):
2172         (WebKit::WebsiteDataStore::setResourceLoadStatisticsDebugMode):
2173         (WebKit::WebsiteDataStore::didCreateNetworkProcess):
2174         (WebKit::WebsiteDataStore::topPrivatelyControlledDomainsWithWebsiteData): Deleted.
2175         (WebKit::WebsiteDataStore::removeDataForTopPrivatelyControlledDomains): Deleted.
2176         (WebKit::WebsiteDataStore::setCacheMaxAgeCap): Deleted.
2177         (WebKit::WebsiteDataStore::updatePrevalentDomainsToBlockCookiesFor): Deleted.
2178         (WebKit::WebsiteDataStore::setAgeCapForClientSideCookies): Deleted.
2179         (WebKit::WebsiteDataStore::hasStorageAccessForFrameHandler): Deleted.
2180         (WebKit::WebsiteDataStore::grantStorageAccessHandler): Deleted.
2181         (WebKit::WebsiteDataStore::removeAllStorageAccessHandler): Deleted.
2182         (WebKit::WebsiteDataStore::removePrevalentDomains): Deleted.
2183         (WebKit::WebsiteDataStore::isGrandfathered): Deleted.
2184         * UIProcess/WebsiteData/WebsiteDataStore.h:
2185
2186 2019-01-28  Antoine Quint  <graouts@apple.com>
2187
2188         Limit user-agent interactions based on the touch-action property on iOS
2189         https://bugs.webkit.org/show_bug.cgi?id=193447
2190         <rdar://problem/47283874>
2191
2192         Reviewed by Antti Koivisto and Simon Fraser.
2193
2194         Handle the "none", "pan-x", "pan-y" and "pinch-zoom" values for the touch-action property by querying the scrolling tree whenever a touch begins
2195         to identify whether its point is contained within the region of an element with a non-auto touch-action property. If it is, we use the list of
2196         permitted touch actions such to then customize the behavior of the nearest scroll view to pan or zoom only as instructed.
2197
2198         * Shared/WebCoreArgumentCoders.cpp:
2199         (IPC::ArgumentCoder<TouchActionData>::encode):
2200         (IPC::ArgumentCoder<TouchActionData>::decode):
2201         (IPC::ArgumentCoder<EventTrackingRegions>::encode):
2202         (IPC::ArgumentCoder<EventTrackingRegions>::decode):
2203         (IPC::ArgumentCoder<Region>::decode):
2204         * Shared/WebCoreArgumentCoders.h:
2205         * UIProcess/API/Cocoa/WKWebView.mm:
2206         (-[WKWebView scrollViewWillEndDragging:withVelocity:targetContentOffset:]): Account for panning constraints set on the content view to prevent deceleration
2207         to pan the view if it ought not.
2208         (-[WKWebView _scrollView:adjustedOffsetForOffset:translation:startPoint:locationInView:horizontalVelocity:verticalVelocity:]): Implement an additional
2209         UIScrollView delegation method to apply the panning constraints set on the content view while panning.
2210         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
2211         (WebKit::RemoteScrollingCoordinatorProxy::touchActionDataAtPoint const):
2212         (WebKit::RemoteScrollingCoordinatorProxy::touchActionDataForScrollNodeID const):
2213         (WebKit::RemoteScrollingCoordinatorProxy::setTouchDataForTouchIdentifier):
2214         (WebKit::RemoteScrollingCoordinatorProxy::clearTouchDataForTouchIdentifier):
2215         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
2216         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
2217         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
2218         (-[WKScrollingNodeScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]): Apply the same logic as in WKWebView.
2219         (-[WKScrollingNodeScrollViewDelegate _scrollView:adjustedOffsetForOffset:translation:startPoint:locationInView:horizontalVelocity:verticalVelocity:]): Apply
2220         the same logic as in WKWebView.
2221         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::touchActionData const):
2222         * UIProcess/WebPageProxy.h:
2223         (WebKit::WebPageProxy::isScrollingOrZooming const):
2224         * UIProcess/ios/WKContentViewInteraction.h:
2225         * UIProcess/ios/WKContentViewInteraction.mm:
2226         (-[WKContentView preventsPanningInXAxis]):
2227         (-[WKContentView preventsPanningInYAxis]):
2228         (-[WKContentView cleanupInteraction]):
2229         (-[WKContentView _webTouchEventsRecognized:]):
2230         (-[WKContentView _handleTouchActionsForTouchEvent:]): As we process touches, check whether there are touch actions set for this touch's points' locations. Based
2231         on those touch actions, either setDefaultPrevented on the _touchEventGestureRecognizer if the touch action is "none" or selectively disable panning and zooming.
2232         (-[WKContentView _resetPanningPreventionFlags]):
2233         (-[WKContentView _didEndScrollingOrZooming]):
2234
2235 2019-01-28  Antti Koivisto  <antti@apple.com>
2236
2237         WebUserContentController::removeUserScriptMessageHandlerInternal may deref and delete itself
2238         https://bugs.webkit.org/show_bug.cgi?id=193901
2239         <rdar://problem/47338669>
2240
2241         Reviewed by David Kilzer.
2242
2243         Don't know how to repro.
2244
2245         * WebProcess/UserContent/WebUserContentController.cpp:
2246         (WebKit::WebUserContentController::removeUserScriptMessageHandlerInternal):
2247
2248         Calling userMessageHandlers.removeFirstMatching() may remove the last ref to this
2249         (because WebUserMessageHandlerDescriptorProxy refs WebUserContentController).
2250         Fix by protecting this over the function.
2251
2252 2018-12-15  Darin Adler  <darin@apple.com>
2253
2254         Replace many uses of String::format with more type-safe alternatives
2255         https://bugs.webkit.org/show_bug.cgi?id=192742
2256
2257         Reviewed by Mark Lam.
2258
2259         * Shared/WebMemorySampler.cpp:
2260         (WebKit::WebMemorySampler::writeHeaders): Use makeString.
2261
2262         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
2263         (WebKit::LocalAuthenticator::makeCredential): Use string concatentation.
2264
2265         * UIProcess/WebInspectorUtilities.cpp:
2266         (WebKit::inspectorPageGroupIdentifierForPage): Use makeString.
2267         * UIProcess/WebProcessPool.cpp:
2268         (WebKit::WebProcessPool::processDidFinishLaunching): Ditto.
2269         (WebKit::WebProcessPool::startMemorySampler): Ditto.
2270
2271 2019-01-27  Jiewen Tan  <jiewen_tan@apple.com>
2272
2273         Use a load optimizer for some sites
2274         https://bugs.webkit.org/show_bug.cgi?id=193881
2275         <rdar://problem/46325455>
2276
2277         Reviewed by Brent Fulgham.
2278
2279         We will try to speed up some sites with a dedicated load optimizer. The load optimizer lives
2280         within the WebsiteDataStore as one client instance should have only one and it should live
2281         as long as the client lives. How does the load optimizer work? It intercepts every load in
2282         the navigation state. If a request meets some requirements, it will then fetch the request
2283         from its own cache. Once the fetch succeeds, the original load will be ignored and the
2284         optimizer will display the cached content.
2285
2286         Covered by API tests.
2287
2288         * SourcesCocoa.txt:
2289         * UIProcess/Cocoa/LoadOptimizer.h: Added.
2290         * UIProcess/Cocoa/LoadOptimizer.mm: Added.
2291         * UIProcess/Cocoa/MediaCaptureUtilities.h:
2292         * UIProcess/Cocoa/NavigationState.mm:
2293         (WebKit::tryInterceptNavigation):
2294         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
2295         (WebKit::tryAppLink): Deleted.
2296         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2297         (WebKit::WebsiteDataStore::WebsiteDataStore):
2298         * UIProcess/WebsiteData/WebsiteDataStore.h:
2299         (WebKit::WebsiteDataStore::loadOptimizer):
2300         * WebKit.xcodeproj/project.pbxproj:
2301
2302 2019-01-25  Brian Burg  <bburg@apple.com>
2303
2304         Web Automation: add support for simulating single touches to Automation.performInteractionSequence
2305         https://bugs.webkit.org/show_bug.cgi?id=193852
2306         <rdar://problem/28360781>
2307
2308         Reviewed by Joseph Pecoraro and Simon Fraser.
2309
2310         This patch makes it possible to simulate touches via the Actions API. The approach is to
2311         use a stripped down version of HIDEventGenerator to send HID events to the UIWindow.
2312         The initial version supports a single touch point; this may be expanded if needed, but
2313         so far it hasn't been an impediment when running desktop-oriented WebDriver test suites.
2314
2315         As part of implementing this support, I went through and added [somewhat obnoxious] ENABLE()
2316         guards so that we don't mistakenly compile mouse support on iOS and touch on Mac,
2317         and vice versa. Each of the interaction methods---touch, mouse, keyboard---can be independently
2318         compiled out. If none is supported (i.e., Windows), then we don't even try to compile
2319         platformSimulate*Interaction methods or SimulatedInputDispatcher. This allows WebAutomationSession
2320         to not include members and code that are never going to be used on a particular platform.
2321
2322         This functionality is covered by existing WebDriver test suites that use Element Click command.
2323         Additional tests that explicitly include 'touch' pointerType will be submitted to WPT later.
2324
2325         * UIProcess/Automation/Automation.json: Update comment.
2326
2327         * UIProcess/Automation/SimulatedInputDispatcher.h:
2328         * UIProcess/Automation/SimulatedInputDispatcher.cpp:
2329         (WebKit::SimulatedInputDispatcher::transitionInputSourceToState):
2330         - Add appropriate guards for code specific to each interaction type.
2331         - Handle SimulatedInputSourceType::Touch and call out to dispatch events.
2332
2333         * UIProcess/Automation/WebAutomationSession.h:
2334         * UIProcess/Automation/WebAutomationSession.cpp:
2335         (WebKit::WebAutomationSession::WebAutomationSession):
2336         (WebKit::WebAutomationSession::terminate):
2337         (WebKit::WebAutomationSession::willShowJavaScriptDialog):
2338         (WebKit::WebAutomationSession::mouseEventsFlushedForPage):
2339         (WebKit::WebAutomationSession::keyboardEventsFlushedForPage):
2340         (WebKit::WebAutomationSession::willClosePage):
2341         Add appropriate guards for code specific to each interaction type.
2342
2343         (WebKit::WebAutomationSession::isSimulatingUserInteraction const):
2344         Add new hook so that we can detect when a touch simulation is in progress.
2345         We don't rely on checking WebKit's event queue, so use a flag.
2346
2347         (WebKit::WebAutomationSession::simulateTouchInteraction):
2348         (WebKit::WebAutomationSession::performMouseInteraction):
2349         (WebKit::WebAutomationSession::performKeyboardInteractions):
2350         (WebKit::WebAutomationSession::cancelInteractionSequence):
2351         (WebKit::WebAutomationSession::performInteractionSequence):
2352         - Add appropriate guards for code specific to each interaction type.
2353         - Bail out immediately if a requested interaction type is not supported.
2354         - Shim Touch input type to Mouse if mouse is not supported but touches are.
2355         Nearly all WebDriver tests in the wild will be requesting a 'mouse' pointerType,
2356         so this is necessary for compatibility. It's easier to shim at this level than try
2357         to implement platformSimulateMouseInteraction for iOS because
2358         platformSimulateMouseinteraction does not use a completion handler but the iOS
2359         implementation would require that.
2360
2361         (WebKit::WebAutomationSession::platformSimulateMouseInteraction): Deleted.
2362         (WebKit::WebAutomationSession::platformSimulateKeyboardInteraction): Deleted.
2363         - Remove these stubs. Platform methods of this class are no longer being filled
2364         with stubs on unsupported platforms because we expect the command to fail earlier.
2365
2366         * UIProcess/Automation/ios/WebAutomationSessionIOS.mm:
2367         (WebKit::WebAutomationSession::platformSimulateTouchInteraction):
2368         - Add appropriate guards for code specific to each interaction type.
2369         - Implement new platform method to simulate touches. This uses _WKTouchEventGenerator.
2370
2371         * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
2372         Add appropriate guards for code specific to each interaction type.
2373
2374         * UIProcess/_WKTouchEventGenerator.h: Added.
2375         * UIProcess/_WKTouchEventGenerator.mm: Added.
2376         (simpleCurveInterpolation):
2377         (calculateNextCurveLocation):
2378         (delayBetweenMove):
2379         (+[_WKTouchEventGenerator sharedTouchEventGenerator]):
2380         (+[_WKTouchEventGenerator nextEventCallbackID]):
2381         (-[_WKTouchEventGenerator init]):
2382         (-[_WKTouchEventGenerator dealloc]):
2383         (-[_WKTouchEventGenerator _createIOHIDEventType:]):
2384         (-[_WKTouchEventGenerator _sendHIDEvent:]):
2385         (-[_WKTouchEventGenerator _sendMarkerHIDEventWithCompletionBlock:]):
2386         (-[_WKTouchEventGenerator _updateTouchPoints:count:]):
2387         (-[_WKTouchEventGenerator touchDownAtPoints:touchCount:]):
2388         (-[_WKTouchEventGenerator touchDown:touchCount:]):
2389         (-[_WKTouchEventGenerator touchDown:]):
2390         (-[_WKTouchEventGenerator liftUpAtPoints:touchCount:]):
2391         (-[_WKTouchEventGenerator liftUp:touchCount:]):
2392         (-[_WKTouchEventGenerator liftUp:]):
2393         (-[_WKTouchEventGenerator moveToPoints:touchCount:duration:]):
2394         (-[_WKTouchEventGenerator touchDown:completionBlock:]):
2395         (-[_WKTouchEventGenerator liftUp:completionBlock:]):
2396         (-[_WKTouchEventGenerator moveToPoint:duration:completionBlock:]):
2397         (-[_WKTouchEventGenerator receivedHIDEvent:]):
2398         Copied and simplified from HIDEventGenerator in WebKitTestRunner.
2399
2400         * WebKit.xcodeproj/project.pbxproj:
2401         Add _WKTouchEventGenerator.{h,mm} and make it a private header. The client needs to
2402         route received HID events to -receivedHIDEvent: in order to detect when the marker
2403         HID event has been processed (and thus the interaction is completed).
2404
2405         * config.h: Add ENABLE(WEBDRIVER_*_INTERACTIONS) macros here.
2406
2407 2019-01-26  Simon Fraser  <simon.fraser@apple.com>
2408
2409         Have composited RenderIFrame layers make FrameHosting scrolling tree nodes to parent the iframe's scrolling node
2410         https://bugs.webkit.org/show_bug.cgi?id=193879
2411
2412         Reviewed by Antti Koivisto.
2413
2414         Need a specialization of dump() for ScrollingStateFrameHostingNode to avoid infinite recursion.
2415
2416         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
2417         (WebKit::dump):
2418
2419 2019-01-27  Chris Fleizach  <cfleizach@apple.com>
2420
2421         AX: Introduce a static accessibility tree
2422         https://bugs.webkit.org/show_bug.cgi?id=193348
2423         <rdar://problem/47203295>
2424
2425         Reviewed by Ryosuke Niwa.
2426
2427         * Configurations/FeatureDefines.xcconfig:
2428         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
2429         (-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper]):
2430
2431 2019-01-26  Simon Fraser  <simon.fraser@apple.com>
2432
2433         Allow scrolling tree nodes to exist in a detached state
2434         https://bugs.webkit.org/show_bug.cgi?id=193754
2435
2436         Reviewed by Zalan Bujtas.
2437
2438         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
2439         (WebKit::RemoteScrollingCoordinatorTransaction::decode):
2440
2441 2019-01-25  Tim Horton  <timothy_horton@apple.com>
2442
2443         REGRESSION (r238818): Snapshot is removed too late after swiping back on Twitter
2444         https://bugs.webkit.org/show_bug.cgi?id=193860
2445         <rdar://problem/47535022>
2446
2447         Reviewed by Antti Koivisto.
2448
2449         * UIProcess/Cocoa/ViewGestureController.cpp:
2450         (WebKit::ViewGestureController::didStartProvisionalOrSameDocumentLoadForMainFrame):
2451         (WebKit::ViewGestureController::didStartProvisionalLoadForMainFrame):
2452         (WebKit::ViewGestureController::didSameDocumentNavigationForMainFrame):
2453         * UIProcess/Cocoa/ViewGestureController.h:
2454         Treat provisional load and same document load the same: they already both
2455         unpause the snapshot removal tracker, request render tree size notifications,
2456         but same-document navigation was missing the call to dispatchAfterEnsuringDrawing
2457         and thus would get stuck waiting for RepaintAfterNavigation.
2458
2459 2019-01-25  Ryosuke Niwa  <rniwa@webkit.org>
2460
2461         Need a mechanism to override navigator.userAgent
2462         https://bugs.webkit.org/show_bug.cgi?id=193762
2463         <rdar://problem/47504939>
2464
2465         Reviewed by Brent Fulgham.
2466
2467         This patch adds a new _WKWebsitePolicies SPI to specify the user agent string returned by
2468         navigator.userAgent without affecting the user agent string used to send network requests.
2469
2470         Tests: WebKit.WebsitePoliciesCustomJavaScriptUserAgent
2471                WebKit.WebsitePoliciesCustomUserAgents
2472
2473         * Shared/WebsitePoliciesData.cpp:
2474         (WebKit::WebsitePoliciesData::encode const):
2475         (WebKit::WebsitePoliciesData::decode):
2476         (WebKit::WebsitePoliciesData::applyToDocumentLoader):
2477         * Shared/WebsitePoliciesData.h:
2478         * UIProcess/API/APIWebsitePolicies.cpp:
2479         (API::WebsitePolicies::data):
2480         * UIProcess/API/APIWebsitePolicies.h:
2481         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
2482         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
2483         (-[_WKWebsitePolicies setCustomJavaScriptUserAgent:]):
2484         (-[_WKWebsitePolicies customJavaScriptUserAgent]):
2485
2486 2019-01-25  Devin Rousso  <drousso@apple.com>
2487
2488         Web Inspector: provide a way to edit page settings on a remote target
2489         https://bugs.webkit.org/show_bug.cgi?id=193813
2490         <rdar://problem/47359510>
2491
2492         Reviewed by Joseph Pecoraro.
2493
2494         * WebProcess/WebPage/WebInspectorUI.h:
2495         (WebKit::WebInspectorUI::isRemote() const): Added.
2496         * WebProcess/WebPage/RemoteWebInspectorUI.h:
2497         (WebKit::RemoteWebInspectorUI::isRemote() const): Added.
2498
2499 2019-01-25  Dean Jackson  <dino@apple.com>
2500
2501         REGRESSION: Some USDz from 3rd party websites don't go directly to AR QL
2502         https://bugs.webkit.org/show_bug.cgi?id=193831
2503         <rdar://problem/47399263>
2504
2505         Reviewed by Chris Dumez.
2506
2507         A System Preview (<a rel="ar">) displays in a modal and doesn't trigger
2508         a navigation. If the link was cross origin, it was causing a process swap,
2509         which meant that the response defaulted back to a navigation.
2510
2511         The fix is to not cause a PSON when the navigation is a system preview.
2512
2513         * UIProcess/API/APINavigation.h:
2514         (API::Navigation::shouldForceDownload const): This is now just tracking
2515         the "download" attribute, and not including System Preview.
2516         (API::Navigation::isSystemPreview const): New method to check for a
2517         navigation triggered as a System Preview.
2518         * UIProcess/WebPageProxy.cpp: Move the code from receivedPolicyDecision to
2519         receivedNavigationPolicyDecision, so that downloads and System Previews are
2520         detected before we decide to change process.
2521         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
2522         (WebKit::WebPageProxy::receivedPolicyDecision):
2523
2524 2019-01-25  Tim Horton  <timothy_horton@apple.com>
2525
2526         Find-in-page on nyt.com scrolls around without touching the screen when find holes are visible
2527         https://bugs.webkit.org/show_bug.cgi?id=193853
2528
2529         Reviewed by Simon Fraser.
2530
2531         * WebProcess/WebPage/ios/FindControllerIOS.mm:
2532         (WebKit::FindController::updateFindIndicator):
2533         There is no reason to scroll/zoom to the find indicator just because the
2534         holes are up, we should only do it on initial indicator presentation.
2535         This was a mistake in r178755 that was previously never exercised because
2536         isShowingOverlay was always false.
2537
2538 2019-01-25  Keith Rollin  <krollin@apple.com>
2539
2540         Update Xcode projects with "Check .xcfilelists" build phase
2541         https://bugs.webkit.org/show_bug.cgi?id=193790
2542         <rdar://problem/47201374>
2543
2544         Reviewed by Alex Christensen.
2545
2546         Support for XCBuild includes specifying inputs and outputs to various
2547         Run Script build phases. These inputs and outputs are specified as
2548         .xcfilelist files. Once created, these .xcfilelist files need to be
2549         kept up-to-date. In order to check that they are up-to-date or not,
2550         add an Xcode build step that invokes an external script that performs
2551         the checking. If the .xcfilelists are found to be out-of-date, update
2552         them, halt the build, and instruct the developer to restart the build
2553         with up-to-date files.
2554
2555         At this time, the checking and regenerating is performed only if the
2556         WK_ENABLE_CHECK_XCFILELISTS environment variable is set to 1. People
2557         who want to use this facility can set this variable and test out the
2558         checking/regenerating. Once it seems like there are no egregious
2559         issues that upset a developer's workflow, we'll unconditionally enable
2560         this facility.
2561
2562         * Scripts/check-xcfilelists.sh: Added.
2563         * WebKit.xcodeproj/project.pbxproj:
2564
2565 2019-01-25  Alex Christensen  <achristensen@webkit.org>
2566
2567         Move logic from ChildProcess::setApplicationIsDaemon to NetworkProcess::initializeProcess
2568         https://bugs.webkit.org/show_bug.cgi?id=193844
2569
2570         Reviewed by Andy Estes.
2571
2572         This simplifies ChildProcess and removes NetworkProcess-specific code from this generic abstraction.
2573
2574         * NetworkProcess/mac/NetworkProcessMac.mm:
2575         (WebKit::NetworkProcess::initializeProcess):
2576         * Shared/ios/ChildProcessIOS.mm:
2577         (WebKit::ChildProcess::setApplicationIsDaemon): Deleted.
2578         * Shared/mac/ChildProcessMac.mm:
2579         (WebKit::ChildProcess::setApplicationIsDaemon): Deleted.
2580
2581 2019-01-25  Keith Rollin  <krollin@apple.com>
2582
2583         Update Xcode projects with "Apply Configuration to XCFileLists" build target
2584         https://bugs.webkit.org/show_bug.cgi?id=193781
2585         <rdar://problem/47201153>
2586
2587         Reviewed by Alex Christensen.
2588
2589         Part of generating the .xcfilelists used as part of adopting XCBuild
2590         includes running `make DerivedSources.make` from a standalone script.
2591         It’s important for this invocation to have the same environment as
2592         when the actual build invokes `make DerivedSources.make`. If the
2593         environments are different, then the two invocations will provide
2594         different results. In order to get the same environment in the
2595         standalone script, have the script launch xcodebuild targeting the
2596         "Apply Configuration to XCFileLists" build target, which will then
2597         re-invoke our standalone script. The script is now running again, this
2598         time in an environment with all workspace, project, target, xcconfig
2599         and other environment variables established.
2600
2601         The "Apply Configuration to XCFileLists" build target accomplishes
2602         this task via a small embedded shell script that consists only of:
2603
2604             eval "${WK_SUBLAUNCH_SCRIPT_PARAMETERS[@]}"
2605
2606         The process that invokes "Apply Configuration to XCFileLists" first
2607         sets WK_SUBLAUNCH_SCRIPT_PARAMETERS to an array of commands to be
2608         evaluated and exports it into the shell environment. When xcodebuild
2609         is invoked, it inherits the value of this variable and can `eval` the
2610         contents of that variable. Our external standalone script can then set
2611         WK_SUBLAUNCH_SCRIPT_PARAMETERS to the path to itself, along with a set
2612         of command-line parameters needed to restart itself in the appropriate
2613         state.
2614
2615         * WebKit.xcodeproj/project.pbxproj:
2616
2617 2019-01-25  Alex Christensen  <achristensen@webkit.org>
2618
2619         Add SPI to inform an application that "Go Back" has been clicked from a safe browsing warning
2620         https://bugs.webkit.org/show_bug.cgi?id=193802
2621         <rdar://problem/46010580>
2622
2623         Reviewed by Andy Estes.
2624
2625         * UIProcess/API/APIUIClient.h:
2626         (API::UIClient::didClickGoBackFromSafeBrowsingWarning):
2627         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2628         * UIProcess/Cocoa/UIDelegate.h:
2629         * UIProcess/Cocoa/UIDelegate.mm:
2630         (WebKit::UIDelegate::setDelegate):
2631         (WebKit::UIDelegate::UIClient::didClickGoBackFromSafeBrowsingWarning):
2632         * UIProcess/WebPageProxy.cpp:
2633         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2634
2635 2019-01-25  Daniel Bates  <dabates@apple.com>
2636
2637         [iOS] Pressing Tab key doesn't move to next cell with Google Sheets
2638         https://bugs.webkit.org/show_bug.cgi?id=193048
2639         <rdar://problem/46433836>
2640
2641         Reviewed by Brent Fulgham.
2642
2643         WebCore knows how interpret the Tab and Shift + Tab keys. When building with UIKit keyboard additions
2644         we do not need to register key commands for handling them from the UIProcess code. Instead UIKit will
2645         sends key events for these commands to us. This will make the behavior of these key commands when executed
2646         in an editable field match the behavior of these command when executed in a non-editable field since
2647         both code paths will now go through WebCore.
2648
2649         * UIProcess/ios/WKContentViewInteraction.mm:
2650         (-[WKContentView keyCommands]): Only compile when building with !USE(UIKIT_KEYBOARD_ADDITIONS).
2651
2652 2019-01-25  Alex Christensen  <achristensen@webkit.org>
2653
2654         Fix Linux build.
2655
2656         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2657         (WebKit::NetworkConnectionToWebProcess::requestResourceLoadStatisticsUpdate):
2658
2659 2019-01-25  Keith Rollin  <krollin@apple.com>
2660
2661         Update WebKitAdditions.xcconfig with correct order of variable definitions
2662         https://bugs.webkit.org/show_bug.cgi?id=193793
2663         <rdar://problem/47532439>
2664
2665         Reviewed by Alex Christensen.
2666
2667         XCBuild changes the way xcconfig variables are evaluated. In short,
2668         all config file assignments are now considered in part of the
2669         evaluation. When using the new build system and an .xcconfig file
2670         contains multiple assignments of the same build setting:
2671
2672         - Later assignments using $(inherited) will inherit from earlier
2673           assignments in the xcconfig file.
2674         - Later assignments not using $(inherited) will take precedence over
2675           earlier assignments. An assignment to a more general setting will
2676           mask an earlier assignment to a less general setting. For example,
2677           an assignment without a condition ('FOO = bar') will completely mask
2678           an earlier assignment with a condition ('FOO[sdk=macos*] = quux').
2679
2680         This affects some of our .xcconfig files, in that sometimes platform-
2681         or sdk-specific definitions appear before the general definitions.
2682         Under the new evaluations rules, the general definitions alway take
2683         effect because they always overwrite the more-specific definitions. The
2684         solution is to swap the order, so that the general definitions are
2685         established first, and then conditionally overwritten by the
2686         more-specific definitions.
2687
2688         * Configurations/BaseTarget.xcconfig:
2689         * Configurations/Version.xcconfig:
2690         * Configurations/WebKit.xcconfig:
2691
2692 2019-01-25  Keith Rollin  <krollin@apple.com>
2693
2694         Update existing .xcfilelists
2695         https://bugs.webkit.org/show_bug.cgi?id=193791
2696         <rdar://problem/47201706>
2697
2698         Reviewed by Alex Christensen.
2699
2700         Many .xcfilelist files were added in r238824 in order to support
2701         XCBuild. Update these with recent changes to the set of build files
2702         and with the current generate-xcfilelist script.
2703
2704         * DerivedSources-input.xcfilelist:
2705         * DerivedSources-output.xcfilelist:
2706         * UnifiedSources-input.xcfilelist:
2707         * UnifiedSources-output.xcfilelist:
2708
2709 2019-01-25  Per Arne Vollan  <pvollan@apple.com>
2710
2711         [iOS] Deny mach lookups to services not used.
2712         https://bugs.webkit.org/show_bug.cgi?id=193828
2713
2714         Reviewed by Brent Fulgham.
2715
2716         Start denying mach lookups to iOS services, which were previously allowed with reporting.
2717         Living-on has indicated that these services are not used.
2718
2719         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2720
2721 2019-01-25  Brent Fulgham  <bfulgham@apple.com>
2722
2723         Activate the WebResourceLoadStatisticsStore in the NetworkProcess and deactivate it in the UIProcess.
2724         https://bugs.webkit.org/show_bug.cgi?id=193297
2725         <rdar://problem/47158841>
2726
2727         Reviewed by Alex Christensen.
2728
2729         This patch activates the ResourceLoadStatistics code in the NetworkProcess, and turns
2730         it off in the UIProcess. It also updates test infrastructure to work with this change
2731         in architecture.
2732
2733         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
2734         (WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceLoading): Added.
2735         (WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceRedirect): Added.
2736         (WebKit::ResourceLoadStatisticsMemoryStore::logWebSocketLoading): Added.
2737         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
2738         (WebKit::WebResourceLoadStatisticsStore::logSubresourceLoading): Added.
2739         (WebKit::WebResourceLoadStatisticsStore::logSubresourceRedirect): Added.
2740         (WebKit::WebResourceLoadStatisticsStore::logWebSocketLoading): Added.
2741         (WebKit::WebResourceLoadStatisticsStore::removeAllStorageAccess):
2742         (WebKit::WebResourceLoadStatisticsStore::setCacheMaxAgeCap):
2743         (WebKit::WebResourceLoadStatisticsStore::setCacheMaxAgeCapForPrevalentResources): Deleted.
2744         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
2745         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2746         (WebKit::NetworkConnectionToWebProcess::logSubresourceLoading): Added.
2747         (WebKit::NetworkConnectionToWebProcess::logSubresourceRedirect): Added.
2748         (WebKit::NetworkConnectionToWebProcess::logWebSocketLoading): Added.
2749         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2750         * NetworkProcess/NetworkSession.cpp:
2751         (WebKit::NetworkSession::setResourceLoadStatisticsEnabled):
2752         * UIProcess/WebProcessPool.cpp:
2753         (WebKit::WebProcessPool::ensureNetworkProcess):
2754         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
2755         (WebKit::WebsiteDataStore::parameters):
2756         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2757         (WebKit::WebsiteDataStore::removeData):
2758         (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
2759         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
2760         * Webprocess/WebProcess.cpp:
2761         (WebKit::WebProcess::initializeWebProcess): Register new ResourceLoadObserver callbacks.
2762
2763 2019-01-25  Ryosuke Niwa  <rniwa@webkit.org>
2764
2765         iOS: inputmode="none" disables hardware keyboard's globe key
2766         https://bugs.webkit.org/show_bug.cgi?id=193811
2767         <rdar://problem/47406553>
2768
2769         Reviewed by Wenson Hsieh.
2770
2771         Removed the support for inputmode="none" for now since we need a new SPI from UIKit
2772         to properly implement this feature some time in the future.
2773
2774         * UIProcess/ios/WKContentViewInteraction.mm:
2775         (-[WKContentView _zoomToRevealFocusedElement]):
2776         (-[WKContentView inputView]):
2777         (-[WKContentView requiresAccessoryView]):
2778         (-[WKContentView textInputTraits]):
2779
2780 2019-01-25  David Kilzer  <ddkilzer@apple.com>
2781
2782         Move soft-linking of Lookup.framework out of LookupSPI.h
2783         <https://webkit.org/b/193815>
2784
2785         Reviewed by Tim Horton.
2786
2787         * UIProcess/Cocoa/WebViewImpl.mm:
2788         (-[WKWindowVisibilityObserver dealloc]):
2789         (-[WKWindowVisibilityObserver startObservingLookupDismissalIfNeeded]):
2790         - Move soft-linking to LookupSoftLink.{h,mm}.
2791
2792 2019-01-25  Antti Koivisto  <antti@apple.com>
2793
2794         REGRESSION (PSON): After swipe back, first few attempts to swipe forward not recognized as swipe gestures
2795         https://bugs.webkit.org/show_bug.cgi?id=193818
2796         <rdar://problem/47456584>
2797
2798         Reviewed by Tim Horton.
2799
2800         We don't hit the RenderTreeSizeThreshold milestone to remove the snapshot and allow interaction because we request it
2801         from a wrong process (the one we are leaving behind).
2802
2803         * UIProcess/Cocoa/ViewGestureController.cpp:
2804         (WebKit::ViewGestureController::didStartProvisionalLoadForMainFrame):
2805
2806         Request the RenderTreeSizeThreshold notification when the load has started and we know the process to use.
2807
2808         (WebKit::ViewGestureController::SnapshotRemovalTracker::hasOutstandingEvent):
2809         * UIProcess/Cocoa/ViewGestureController.h:
2810         (WebKit::ViewGestureController::SnapshotRemovalTracker::renderTreeSizeThreshold const):
2811         (WebKit::ViewGestureController::SnapshotRemovalTracker::setRenderTreeSizeThreshold):
2812         * UIProcess/mac/ViewGestureControllerMac.mm:
2813         (WebKit::ViewGestureController::endSwipeGesture):
2814
2815         Don't request immediately, save the threshold to SnapshotRemovalTracker.
2816
2817         (WebKit::ViewGestureController::requestRenderTreeSizeNotificationIfNeeded):
2818
2819         Do the request to the right process.
2820
2821         * WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
2822         (WebKit::ViewGestureGeometryCollector::setRenderTreeSizeNotificationThreshold):
2823
2824         Ensure we send the notification even if we reached the threshold before it was requested.
2825
2826         (WebKit::ViewGestureGeometryCollector::sendDidHitRenderTreeSizeThresholdIfNeeded):
2827         (WebKit::ViewGestureGeometryCollector::mainFrameDidLayout):
2828         * WebProcess/WebPage/ViewGestureGeometryCollector.h:
2829         (WebKit::ViewGestureGeometryCollector::setRenderTreeSizeNotificationThreshold): Deleted.
2830
2831 2019-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
2832
2833         [iOS] Rename some WebKit-internal functions and variables that reference "data interaction"
2834         https://bugs.webkit.org/show_bug.cgi?id=193829
2835
2836         Reviewed by Tim Horton.
2837
2838         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
2839         (WebKit::WebPageProxy::setDragCaretRect):
2840         * UIProcess/PageClient.h:
2841         * UIProcess/WebPageProxy.h:
2842         * UIProcess/WebPageProxy.messages.in:
2843         * UIProcess/ios/PageClientImplIOS.h:
2844         * UIProcess/ios/PageClientImplIOS.mm:
2845         (WebKit::PageClientImpl::didHandleDragStartRequest):
2846         (WebKit::PageClientImpl::didConcludeEditDrag):
2847         (WebKit::PageClientImpl::didChangeDragCaretRect):
2848         (WebKit::PageClientImpl::didHandleStartDataInteractionRequest): Deleted.
2849         (WebKit::PageClientImpl::didConcludeEditDataInteraction): Deleted.
2850         (WebKit::PageClientImpl::didChangeDataInteractionCaretRect): Deleted.
2851         * UIProcess/ios/WKContentViewInteraction.h:
2852         * UIProcess/ios/WKContentViewInteraction.mm:
2853         (-[WKContentView setupInteraction]):
2854         (-[WKContentView cleanupInteraction]):
2855         (-[WKContentView setupDragAndDropInteractions]):
2856         (-[WKContentView teardownDragAndDropInteractions]):
2857         (-[WKContentView _didHandleDragStartRequest:]):
2858         (-[WKContentView _didConcludeEditDrag:]):
2859         (-[WKContentView _didChangeDragCaretRect:currentRect:]):
2860         (-[WKContentView _dragInteraction:prepareForSession:completion:]):
2861         (-[WKContentView setupDataInteractionDelegates]): Deleted.
2862         (-[WKContentView teardownDataInteractionDelegates]): Deleted.
2863         (-[WKContentView _didHandleStartDataInteractionRequest:]): Deleted.
2864         (-[WKContentView _didConcludeEditDataInteraction:]): Deleted.
2865         (-[WKContentView _didChangeDataInteractionCaretRect:currentRect:]): Deleted.
2866         * UIProcess/ios/WebPageProxyIOS.mm:
2867         (WebKit::WebPageProxy::didHandleDragStartRequest):
2868         (WebKit::WebPageProxy::requestDragStart):
2869         (WebKit::WebPageProxy::didConcludeEditDrag):
2870         (WebKit::WebPageProxy::didHandleStartDataInteractionRequest): Deleted.
2871         (WebKit::WebPageProxy::requestStartDataInteraction): Deleted.
2872         (WebKit::WebPageProxy::didConcludeEditDataInteraction): Deleted.
2873         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
2874         (WebKit::WebDragClient::didConcludeEditDrag):
2875         * WebProcess/WebPage/WebPage.h:
2876         * WebProcess/WebPage/WebPage.messages.in:
2877         * WebProcess/WebPage/ios/WebPageIOS.mm:
2878         (WebKit::WebPage::requestDragStart):
2879         (WebKit::WebPage::requestAdditionalItemsForDragSession):
2880         (WebKit::WebPage::didConcludeEditDrag):
2881         (WebKit::WebPage::requestStartDataInteraction): Deleted.
2882         (WebKit::WebPage::didConcludeEditDataInteraction): Deleted.
2883
2884 2019-01-25  Alex Christensen  <achristensen@webkit.org>
2885
2886         WKWebView.goBack should reload if there is a safe browsing warning
2887         https://bugs.webkit.org/show_bug.cgi?id=193805
2888         <rdar://problem/46908216>
2889
2890         Reviewed by Geoff Garen.
2891
2892         If a WKWebView is showing a safe browsing warning and the user clicks a back button
2893         in the app which calls WKWebView.goBack, the WKWebView is in a state where it has not navigated yet,
2894         so actually going back will appear to the user to go back twice.  We can't just do nothing because the
2895         app is in a state where it is expecting a navigation to happen.  Reloading achieves what the user expects
2896         and makes the app work like the app expects.
2897
2898         * UIProcess/API/C/WKPage.cpp:
2899         (WKPageGoBack):
2900         * UIProcess/API/Cocoa/WKWebView.mm:
2901         (-[WKWebView goBack]):
2902         * UIProcess/PageClient.h:
2903         (WebKit::PageClient::hasSafeBrowsingWarning const):
2904         * UIProcess/mac/PageClientImplMac.h:
2905         * UIProcess/mac/PageClientImplMac.mm:
2906         (WebKit::PageClientImpl::hasSafeBrowsingWarning const):
2907
2908 2019-01-25  Chris Dumez  <cdumez@apple.com>
2909
2910         Regression(PSON) cross-site provisional page is not canceled if a new same-site one is started
2911         https://bugs.webkit.org/show_bug.cgi?id=193788
2912         <rdar://problem/47531231>
2913
2914         Reviewed by Alex Christensen.
2915
2916         When the page starts a new provisional load, make sure we cancel any pending one in the provisional
2917         process, as it would have happened in the first provisional load happened in the same process.
2918         Without this, we could have 2 parallel loads happening, one in the committed process and another
2919         in the provisional one, leading to assertion failures in debug.
2920
2921         * UIProcess/WebPageProxy.cpp:
2922         (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
2923
2924 2019-01-25  Chris Dumez  <cdumez@apple.com>
2925
2926         Drop WebKit::WebKitPolicyAction type as it is no longer needed
2927         https://bugs.webkit.org/show_bug.cgi?id=193827
2928
2929         Reviewed by Antti Koivisto.
2930
2931         Drop WebKit::WebKitPolicyAction type as it is no longer needed. It is now identical to
2932         WebCore::PolicyAction.
2933
2934         * Shared/WebPolicyAction.h: Removed.
2935         * UIProcess/WebFramePolicyListenerProxy.cpp:
2936         (WebKit::WebFramePolicyListenerProxy::didReceiveSafeBrowsingResults):
2937         (WebKit::WebFramePolicyListenerProxy::use):
2938         (WebKit::WebFramePolicyListenerProxy::download):
2939         (WebKit::WebFramePolicyListenerProxy::ignore):
2940         * UIProcess/WebFramePolicyListenerProxy.h:
2941         * UIProcess/WebFrameProxy.cpp:
2942         (WebKit::WebFrameProxy::setUpPolicyListenerProxy):
2943         * UIProcess/WebFrameProxy.h:
2944         * UIProcess/WebPageProxy.cpp:
2945         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
2946         (WebKit::WebPageProxy::receivedPolicyDecision):
2947         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2948         (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
2949         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
2950         (WebKit::WebPageProxy::decidePolicyForResponseShared):
2951         * UIProcess/WebPageProxy.h:
2952         * WebKit.xcodeproj/project.pbxproj:
2953         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2954         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
2955         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2956         * WebProcess/WebPage/WebFrame.cpp:
2957         (WebKit::WebFrame::didReceivePolicyDecision):
2958         (WebKit::toPolicyAction): Deleted.
2959         * WebProcess/WebPage/WebFrame.h:
2960         * WebProcess/WebPage/WebPage.cpp:
2961         (WebKit::WebPage::didReceivePolicyDecision):
2962         * WebProcess/WebPage/WebPage.h:
2963
2964 2019-01-25  Per Arne Vollan  <pvollan@apple.com>
2965
2966         [iOS] Add logging of calls
2967         https://bugs.webkit.org/show_bug.cgi?id=193784
2968
2969         Reviewed by Brent Fulgham.
2970
2971         Add permissive logging of calls on iOS.
2972
2973         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2974
2975 2019-01-25  Chris Dumez  <cdumez@apple.com>
2976
2977         Regression(PSON?) Crash under NavigationState::NavigationClient::decidePolicyForNavigationAction()
2978         https://bugs.webkit.org/show_bug.cgi?id=193779
2979         <rdar://problem/46170903>
2980
2981         Reviewed by Antti Koivisto.
2982
2983         * UIProcess/Cocoa/NavigationState.mm:
2984         (WebKit::tryAppLink):
2985         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
2986         We were crashing when trying to get the URL of the main frame, which was sad because we never
2987         ended up using the main frame URL. Therefore, this patch drops the code in question.
2988
2989         * UIProcess/ProvisionalPageProxy.cpp:
2990         (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionAsync):
2991         Add assertion to make sure that the DecidePolicyForNavigationActionAsync IPC it is getting
2992         from the process is related to its main frame.
2993
2994 2019-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
2995
2996         Need a way for JavaScript (or bundle) code to participate in undo
2997         https://bugs.webkit.org/show_bug.cgi?id=190009
2998         <rdar://problem/44807048>
2999
3000         Reviewed by Ryosuke Niwa.
3001
3002         Invalidate undo steps when removing them from WebPage. Invalidation is a no-op for editing actions that come
3003         from the UA, but for custom undo steps backed by an UndoItem, we clear out the custom undo step's pointer to its
3004         UndoItem and additionally disconnect the UndoItem from its UndoManager.
3005
3006         * WebProcess/WebPage/WebPage.cpp:
3007         (WebKit::WebPage::addWebUndoStep):
3008         (WebKit::WebPage::removeWebEditCommand):
3009         * WebProcess/WebPage/WebUndoStep.h:
3010         (WebKit::WebUndoStep::invalidate):
3011
3012 2019-01-25  Patrick Griffis  <pgriffis@igalia.com>
3013
3014         [GTK][WPE] Add API to add paths to sandbox
3015         https://bugs.webkit.org/show_bug.cgi?id=193571
3016
3017         This allows applications to add paths to the web process
3018         if required by web extensions.
3019
3020         Reviewed by Michael Catanzaro.
3021
3022         * UIProcess/API/glib/WebKitWebContext.cpp:
3023         (webkit_web_context_add_path_to_sandbox):
3024         * UIProcess/API/gtk/WebKitWebContext.h:
3025         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
3026         * UIProcess/API/wpe/docs/wpe-0.1-sections.txt:
3027         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
3028         (WebKit::bubblewrapSpawn):
3029         * UIProcess/WebProcessPool.h:
3030         * UIProcess/glib/WebProcessProxyGLib.cpp:
3031         (WebKit::WebProcessProxy::platformGetLaunchOptions):
3032
3033 2019-01-24  Ryosuke Niwa  <rniwa@webkit.org>
3034
3035         iOS: Split keyboard should not shrink visualViewport.height
3036         https://bugs.webkit.org/show_bug.cgi?id=193798
3037
3038         Reviewed by Tim Horton.
3039
3040         Treat a split keyboard like a floating keyboard and don't consider its input view bounds in computing the visible content rects.
3041
3042         No new tests since while it's possible to transition between split and merged keyboard using some SPI,
3043         there isn't a reliable mechanism to reset the keyboard state. e.g. we need to wait for a hard-coded amount of time.
3044
3045         * Platform/spi/ios/UIKitSPI.h:
3046         * UIProcess/API/Cocoa/WKWebView.mm:
3047         (-[WKWebView _keyboardChangedWithInfo:adjustScrollView:]):
3048
3049 2019-01-24  Eric Carlson  <eric.carlson@apple.com>
3050
3051         [iOS] Silence MediaPlayer compile warnings
3052         https://bugs.webkit.org/show_bug.cgi?id=193780
3053         <rdar://problem/47518428>
3054
3055         Reviewed by Jer Noble.
3056
3057         * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
3058
3059 2019-01-24  Truitt Savell  <tsavell@apple.com>
3060
3061         Unreviewed, rolling out r240446.
3062
3063         Casued 5 API failures
3064
3065         Reverted changeset:
3066
3067         "Activate the WebResourceLoadStatisticsStore in the
3068         NetworkProcess and deactivate it in the UIProcess."
3069         https://bugs.webkit.org/show_bug.cgi?id=193297
3070         https://trac.webkit.org/changeset/240446
3071
3072 2019-01-24  Brent Fulgham  <bfulgham@apple.com>
3073
3074         Activate the WebResourceLoadStatisticsStore in the NetworkProcess and deactivate it in the UIProcess.
3075         https://bugs.webkit.org/show_bug.cgi?id=193297
3076         <rdar://problem/47158841>
3077
3078         Reviewed by Alex Christensen.
3079
3080         This patch activates the ResourceLoadStatistics code in the NetworkProcess, and turns
3081         it off in the UIProcess. It also updates test infrastructure to work with this change
3082         in architecture.
3083
3084         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
3085         (WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceLoading): Added.
3086         (WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceRedirect): Added.
3087         (WebKit::ResourceLoadStatisticsMemoryStore::logWebSocketLoading): Added.
3088         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
3089         (WebKit::WebResourceLoadStatisticsStore::logSubresourceLoading): Added.
3090         (WebKit::WebResourceLoadStatisticsStore::logSubresourceRedirect): Added.
3091         (WebKit::WebResourceLoadStatisticsStore::logWebSocketLoading): Added.
3092         (WebKit::WebResourceLoadStatisticsStore::removeAllStorageAccess):
3093         (WebKit::WebResourceLoadStatisticsStore::setCacheMaxAgeCap):
3094         (WebKit::WebResourceLoadStatisticsStore::setCacheMaxAgeCapForPrevalentResources): Deleted.
3095         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
3096         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3097         (WebKit::NetworkConnectionToWebProcess::logSubresourceLoading): Added.
3098         (WebKit::NetworkConnectionToWebProcess::logSubresourceRedirect): Added.
3099         (WebKit::NetworkConnectionToWebProcess::logWebSocketLoading): Added.
3100         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
3101         * NetworkProcess/NetworkSession.cpp:
3102         (WebKit::NetworkSession::setResourceLoadStatisticsEnabled):
3103         * UIProcess/WebProcessPool.cpp:
3104         (WebKit::WebProcessPool::ensureNetworkProcess):
3105         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
3106         (WebKit::WebsiteDataStore::parameters):
3107         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3108         (WebKit::WebsiteDataStore::removeData):
3109         (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
3110         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
3111         * Webprocess/WebProcess.cpp:
3112         (WebKit::WebProcess::initializeWebProcess): Register new ResourceLoadObserver callbacks.
3113
3114 2019-01-24  John Wilander  <wilander@apple.com>
3115
3116         Add Ad Click Attribution as an internal/experimental feature
3117         https://bugs.webkit.org/show_bug.cgi?id=193685
3118         <rdar://problem/47450399>
3119
3120         Reviewed by Brent Fulgham.
3121
3122         * Shared/WebPreferences.yaml:
3123             Added AdClickAttributionEnabled as a runtime enabled feature, off by default.
3124
3125 2019-01-24  Antti Koivisto  <antti@apple.com>
3126
3127         [PSON] Flash on back navigation on Mac
3128         https://bugs.webkit.org/show_bug.cgi?id=193716
3129         <rdar://problem/47148458>
3130
3131         Reviewed by Chris Dumez.
3132
3133         We close the page immediately if we fail to suspend. Layers disappear and we get a flash.
3134
3135         * UIProcess/SuspendedPageProxy.cpp:
3136         (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
3137         (WebKit::SuspendedPageProxy::close):
3138
3139         Track closed state so we don't send the message twice, causing unhandled message errors in web process.
3140
3141         (WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
3142
3143         Close the suspended page if the suspension fails.
3144         Skip this if we are using web process side compositing on Mac.
3145
3146         * UIProcess/SuspendedPageProxy.h:
3147         * UIProcess/WebPageProxy.cpp:
3148         (WebKit::WebPageProxy::enterAcceleratedCompositingMode):
3149
3150         On Mac, close the failed SuspendedPageProxy when entering compositing mode. At this point we don't need it to keep layers alive.
3151
3152         * UIProcess/WebProcessPool.cpp:
3153         (WebKit::WebProcessPool::closeFailedSuspendedPagesForPage):
3154         * UIProcess/WebProcessPool.h:
3155         * WebProcess/WebPage/WebPage.cpp:
3156         (WebKit::WebPage::suspendForProcessSwap):
3157
3158         Don't close the page on suspension failure. This is now managed by the UI process.
3159
3160 2019-01-24  Chris Dumez  <cdumez@apple.com>
3161
3162         Regression(PSON) Back/Forward list items' URL sometimes gets replaced with the URL of a subframe
3163         https://bugs.webkit.org/show_bug.cgi?id=193761
3164         <rdar://problem/47456405>
3165
3166         Reviewed by Alex Christensen.
3167
3168         When doing a history navigation cross-process, the UIProcess would first send the back/forward list items
3169         to the destination WebProcess via WebPage::updateBackForwardListForReattach(), then ask the process to
3170         navigate to the expected back/forward list item.
3171
3172         WebPage::updateBackForwardListForReattach() would call restoreSessionInternal(), which would call
3173         toHistoryItem() on each BackForwardListItem. This may end up creating more than one HistoryItem for each
3174         BackForwardListItem because HistoryItems are part of a tree (each frame has its own list of history items).
3175
3176         Note that BackForwardListItems and HistoryItem share a BackForwardItemIdentifier which is a
3177         (processIdentifier, itemIdentifier) pair. We normally generate the HistoryItem's identifier from inside
3178         its constructor like so:
3179         `{ Process::identifier(), generateObjectIdentifier<BackForwardItemIdentifier::ItemIdentifierType>() }`
3180
3181         However, when calling updateBackForwardListForReattach() and constructing children HistoryItem,
3182         applyFrameState() would generate the identifier by itself and passing it to the HistoryItem constructor.
3183         Its genegates the ID the exact same way so this would in theory not be a problem. Unfortunately, both
3184         calls to generateObjectIdentifier() get inlined and both call sites end up with their own static counter
3185         to generate ids. As a result, we may end up with conflicts as HistoryItems for child frames (restored
3186         by restoreSessionInternal()) can end up with the same identifier as HistoryItems for top frames.
3187
3188         This confusion would lead to the WebContent process sending the UIProcess bad information and the URL
3189         of subframes could end up as the WebBackForwardListItem's mainframe URL.
3190
3191         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
3192         (WebKit::applyFrameState):
3193         Stop calling generateObjectIdentifier() explicitly and let the HistoryItem constructor take care of it.
3194         Calling generateObjectIdentifier() for the same type from different places is not safe due to inlining.
3195
3196 2019-01-24  Ross Kirsling  <ross.kirsling@sony.com>
3197
3198         Move FileSystem to WTF
3199         https://bugs.webkit.org/show_bug.cgi?id=193602
3200
3201         Reviewed by Yusuke Suzuki.
3202
3203         * NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.cpp:
3204         * NetworkProcess/NetworkDataTaskBlob.h:
3205         * NetworkProcess/NetworkProcess.cpp:
3206         * NetworkProcess/cache/CacheStorageEngine.cpp:
3207         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
3208         * NetworkProcess/cache/NetworkCache.cpp:
3209         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
3210         * NetworkProcess/cache/NetworkCacheData.cpp:
3211         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
3212         * NetworkProcess/cache/NetworkCacheFileSystem.h:
3213         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
3214         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
3215         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
3216         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3217         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
3218         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3219         * NetworkProcess/mac/NetworkProcessMac.mm:
3220         * NetworkProcess/soup/NetworkProcessSoup.cpp:
3221         * PluginProcess/unix/PluginProcessMainUnix.cpp:
3222         * Shared/PersistencyUtils.cpp:
3223         * Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp:
3224         * Shared/Plugins/unix/PluginSearchPath.cpp:
3225         * Shared/WebMemorySampler.h:
3226         * Shared/glib/ProcessExecutablePathGLib.cpp:
3227         * Shared/ios/ChildProcessIOS.mm:
3228         * Shared/mac/ChildProcessMac.mm:
3229         * Shared/mac/SandboxExtensionMac.mm:
3230         * UIProcess/API/APIContentRuleListStore.cpp:
3231         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
3232         * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
3233         * UIProcess/API/glib/IconDatabase.cpp:
3234         * UIProcess/API/glib/WebKitFaviconDatabase.cpp:
3235         * UIProcess/API/glib/WebKitFileChooserRequest.cpp:
3236         * UIProcess/API/glib/WebKitWebContext.cpp:
3237         * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
3238         * UIProcess/API/win/APIWebsiteDataStoreWin.cpp:
3239         * UIProcess/Automation/WebAutomationSession.cpp:
3240         * UIProcess/Cocoa/DownloadClient.mm:
3241         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3242         * UIProcess/Cocoa/WebViewImpl.mm:
3243         * UIProcess/DeviceIdHashSaltStorage.cpp:
3244         * UIProcess/Downloads/DownloadProxy.cpp:
3245         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
3246         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
3247         * UIProcess/Plugins/gtk/PluginInfoCache.cpp:
3248         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
3249         * UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
3250         * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
3251         * UIProcess/ServiceWorkerProcessProxy.cpp:
3252         * UIProcess/WebStorage/LocalStorageDatabase.cpp:
3253         * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
3254         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
3255         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3256         * UIProcess/glib/WebProcessProxyGLib.cpp:
3257         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
3258         * UIProcess/gtk/WebProcessPoolGtk.cpp:
3259         * UIProcess/ios/WKContentViewInteraction.mm:
3260         * UIProcess/ios/forms/WKFileUploadPanel.mm:
3261         * UIProcess/mac/WebPageProxyMac.mm:
3262         * UIProcess/win/WebProcessPoolWin.cpp:
3263         * UIProcess/win/WebView.cpp:
3264         * UIProcess/wpe/WebProcessPoolWPE.cpp:
3265         * WebProcess/InjectedBundle/API/glib/WebKitExtensionManager.cpp:
3266         * WebProcess/InjectedBundle/glib/InjectedBundleGlib.cpp:
3267         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
3268         * WebProcess/Plugins/Netscape/NetscapePluginStream.h:
3269         * WebProcess/Plugins/PluginProcessConnection.cpp:
3270         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
3271         * WebProcess/WebPage/gtk/WebInspectorUIGtk.cpp:
3272         * WebProcess/WebPage/win/WebInspectorUIWin.cpp:
3273         * WebProcess/cocoa/WebProcessCocoa.mm:
3274
3275 2019-01-23  Simon Fraser  <simon.fraser@apple.com>
3276
3277         Create "frame hosting" nodes for the scrolling tree
3278         https://bugs.webkit.org/show_bug.cgi?id=193753
3279
3280         Reviewed by Antti Koivisto.
3281
3282         When the scrolling tree crosses frame boundaries, mutations in the parent frame currently
3283         require the iframe's scrolling node to get reparented in a new ancestor, which requires
3284         a layer tree walk of the parent frame. This is error-prone, and not very future-proof.
3285
3286         Fix this by introducing "frame hosting" scrolling tree nodes. These are mostly inert
3287         nodes that are owned by the RenderIFrame's layer backing in the parent frame, and exist
3288         to provide a consistent parent node for the subframe's scrolling node.
3289
3290         This patch adds the node types, but does not instantiate them yet.
3291
3292         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
3293         (ArgumentCoder<ScrollingStateFrameHostingNode>::encode):
3294         (ArgumentCoder<ScrollingStateFrameHostingNode>::decode):
3295         (WebKit::encodeNodeAndDescendants):
3296         (WebKit::RemoteScrollingCoordinatorTransaction::decode):
3297         (WebKit::dump):
3298         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
3299         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
3300         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
3301         (WebKit::RemoteScrollingTree::createScrollingTreeNode):
3302         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
3303         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
3304
3305 2019-01-23  Ross Kirsling  <ross.kirsling@sony.com>
3306
3307         [Curl] Unreviewed build fix for r240292 and friends.
3308
3309         WinCairo test stability must be restored in subsequent patch.
3310
3311         * NetworkProcess/curl/NetworkProcessCurl.cpp:
3312         (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
3313         (WebKit::NetworkProcess::setNetworkProxySettings):
3314
3315 2019-01-23  Commit Queue  <commit-queue@webkit.org>
3316
3317         Unreviewed, rolling out r240403.
3318         https://bugs.webkit.org/show_bug.cgi?id=193757
3319
3320         "Causes multiple crashes on macOS port (probably used wrong
3321         ENABLE macro)" (Requested by ddkilzer on #webkit).
3322
3323         Reverted changeset:
3324
3325         "[Curl] Unreviewed build fix for r240292 and friends."
3326         https://trac.webkit.org/changeset/240403
3327
3328 2019-01-23  Ross Kirsling  <ross.kirsling@sony.com>
3329
3330         [Curl] Unreviewed build fix for r240292 and friends.
3331
3332         WinCairo test stability must be restored in subsequent patch.
3333
3334         * NetworkProcess/curl/NetworkProcessCurl.cpp:
3335         (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
3336         (WebKit::NetworkProcess::setNetworkProxySettings):
3337
3338 2019-01-23  Alex Christensen  <achristensen@webkit.org>
3339
3340         Stop using NetworkProcess::singleton
3341         https://bugs.webkit.org/show_bug.cgi?id=193700
3342
3343         Reviewed by Don Olmstead.
3344
3345         This replaces it with a NeverDestroyed<NetworkProcess> and paves the way for more interesting things.
3346
3347         * NetworkProcess/CustomProtocols/soup/LegacyCustomProtocolManagerSoup.cpp:
3348         * NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm:
3349         (WebKit::initializeChildProcess<WebKit::NetworkProcess>):
3350         * NetworkProcess/NetworkProcess.cpp:
3351         (WebKit::NetworkProcess::NetworkProcess):
3352         (WebKit::NetworkProcess::singleton): Deleted.
3353         * NetworkProcess/NetworkProcess.h:
3354         * NetworkProcess/soup/NetworkProcessMainSoup.cpp:
3355         (WebKit::initializeChildProcess<WebKit::NetworkProcess>):
3356         * NetworkProcess/win/NetworkProcessMainWin.cpp:
3357         (WebKit::initializeChildProcess<WebKit::NetworkProcess>):
3358         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
3359         (WebKit::initializeChildProcess):
3360         (WebKit::XPCServiceInitializer):
3361
3362 2019-01-23  Ryan Haddad  <ryanhaddad@apple.com>
3363
3364         Unreviewed, rolling out r240343.
3365
3366         Caused 4 PSON API test failures.
3367
3368         Reverted changeset:
3369
3370         "[PSON] Flash on back navigation on Mac"
3371         https://bugs.webkit.org/show_bug.cgi?id=193716
3372         https://trac.webkit.org/changeset/240343
3373
3374 2019-01-23  Chris Dumez  <cdumez@apple.com>
3375
3376         Deprecate API to limit the maximum number of WebProcesses
3377         https://bugs.webkit.org/show_bug.cgi?id=193725
3378         <rdar://problem/47464879>
3379
3380         Reviewed by Geoff Garen.
3381
3382         Deprecate API to limit the maximum number of WebProcesses and make it a no-op. It adds
3383         complexity and is not safe (conflicts with PSON).
3384
3385         Add a new usesSingleWebProcess SPI to _WKProcessPoolConfiguration to be used by
3386         Minibrowser / Safari in order to disable process per tab (can be useful for debugging).
3387         Note that enabling the single WebProcess mode will disable PSON and process prewarming.
3388
3389         * UIProcess/API/APIProcessPoolConfiguration.cpp:
3390         (API::ProcessPoolConfiguration::createWithLegacyOptions):
3391         (API::ProcessPoolConfiguration::copy):
3392         * UIProcess/API/APIProcessPoolConfiguration.h:
3393         * UIProcess/API/C/WKContext.cpp:
3394         (WKContextSetMaximumNumberOfProcesses):
3395         (WKContextGetMaximumNumberOfProcesses):
3396         * UIProcess/API/C/WKContext.h:
3397         * UIProcess/API/Cocoa/WKProcessPool.mm:
3398         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
3399         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
3400         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
3401         (-[_WKProcessPoolConfiguration maximumProcessCount]):
3402         (-[_WKProcessPoolConfiguration setMaximumProcessCount:]):
3403         (-[_WKProcessPoolConfiguration usesSingleWebProcess]):
3404         (-[_WKProcessPoolConfiguration setUsesSingleWebProcess:]):
3405         (-[_WKProcessPoolConfiguration description]):
3406         * UIProcess/API/glib/WebKitWebContext.cpp:
3407         (webkitWebContextConstructed):
3408         (webkit_web_context_set_process_model):
3409         (webkit_web_context_set_web_process_count_limit):
3410         * UIProcess/WebProcessPool.cpp:
3411         (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit):
3412         (WebKit::WebProcessPool::didReachGoodTimeToPrewarm):
3413         (WebKit::WebProcessPool::processForNavigationInternal):
3414         * UIProcess/WebProcessPool.h:
3415
3416 2019-01-23  Brent Fulgham  <bfulgham@apple.com>
3417
3418         Switch NetworkStorageSession portions of ResourceLoadStatistics to Async message passing style
3419         https://bugs.webkit.org/show_bug.cgi?id=193659
3420         <rdar://problem/47433290>
3421
3422         Reviewed by Alex Christensen.
3423
3424         Change the implementations of ResourceLoadStatistics code in NetworkStorageSession to use the
3425         'sendWithAsyncReply' so that more of the code is autogenerated. This should make test runs more
3426         consistent, and should reduce the possibility of bookkeeping errors in the message handling
3427         implementations.
3428
3429         Fix the implementation of NetworkProcessProxy::clearCallbackStates to remove the manually constructed
3430         (and incomplete) message callbacks. These errors are a big reason to move to the auto-generated
3431         'sendWithAsyncReply' implementatoin. Ditto for NetworkProcessProxy::didClose.
3432
3433         This patch also moves an initializaton call (WebsiteDataStore::didCreateNetworkProcess) from
3434         'ensureNetworkProcess' to 'processDidFinishLaunching'. In current code, the call happens before
3435         a connection is established to the network process, causing initialization messages to get dropped
3436         leading to test system flakiness.
3437
3438         Finally: The WK API test code was updated to ensure that completion handlers are always called, even
3439         when built without ENABLE_RESOURCE_LOAD_STATISTICS defined.
3440
3441         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
3442         * NetworkProcess/Classifier/ShouldGrandfatherStatistics.h: Added.
3443         * NetworkProcess/Classifier/StorageAccessStatus.h: Added.
3444         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
3445         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
3446         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
3447         * NetworkProcess/NetworkProcess.cpp:
3448         (WebKit::NetworkProcess::updatePrevalentDomainsToBlockCookiesFor):
3449         (WebKit::NetworkProcess::setAgeCapForClientSideCookies):
3450         (WebKit::NetworkProcess::scheduleClearInMemoryAndPersistent):
3451         (WebKit::NetworkProcess::hasStorageAccessForFrame):
3452         (WebKit::NetworkProcess::requestStorageAccess):
3453         (WebKit::NetworkProcess::grantStorageAccess):
3454         (WebKit::NetworkProcess::removeAllStorageAccess):
3455         (WebKit::NetworkProcess::setCacheMaxAgeCapForPrevalentResources):
3456         (WebKit::NetworkProcess::resetCacheMaxAgeCapForPrevalentResources):
3457         (WebKit::NetworkProcess::deleteWebsiteData):
3458         * NetworkProcess/NetworkProcess.h:
3459         * NetworkProcess/NetworkProcess.messages.in:
3460         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
3461         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore):
3462         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
3463         (WKWebsiteDataStoreStatisticsResetToConsistentState):
3464         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
3465         * UIProcess/Network/NetworkProcessProxy.cpp:
3466         (WebKit::NetworkProcessProxy::clearCallbackStates): Remove incomplete clean-up code that
3467         is now autogenerated.
3468         (WebKit::NetworkProcessProxy::didClose): Ditto.
3469         (WebKit::NetworkProcessProxy::updatePrevalentDomainsToBlockCookiesFor):
3470         (WebKit::NetworkProcessProxy::scheduleClearInMemoryAndPersistent):
3471         (WebKit::NetworkProcessProxy::setAgeCapForClientSideCookies):
3472         (WebKit::NetworkProcessProxy::hasStorageAccessForFrame):
3473         (WebKit::NetworkProcessProxy::requestStorageAccess):
3474         (WebKit::NetworkProcessProxy::grantStorageAccess):
3475         (WebKit::NetworkProcessProxy::removeAllStorageAccess):
3476         (WebKit::NetworkProcessProxy::setCacheMaxAgeCapForPrevalentResources):
3477         (WebKit::NetworkProcessProxy::setCacheMaxAgeCap):
3478         (WebKit::NetworkProcessProxy::resetCacheMaxAgeCapForPrevalentResources):
3479         (WebKit::NetworkProcessProxy::didUpdateBlockCookies): Deleted.
3480         (WebKit::NetworkProcessProxy::didSetAgeCapForClientSideCookies): Deleted.
3481         (WebKit::NetworkProcessProxy::didUpdateRuntimeSettings): Deleted.
3482         (WebKit::NetworkProcessProxy::storageAccessRequestResult): Deleted.
3483         (WebKit::NetworkProcessProxy::storageAccessOperationResult): Deleted.
3484         (WebKit::NetworkProcessProxy::didRemoveAllStorageAccess): Deleted.
3485         (WebKit::NetworkProcessProxy::didSetCacheMaxAgeCapForPrevalentResources): Deleted.
3486         * UIProcess/Network/NetworkProcessProxy.h:
3487         * UIProcess/Network/NetworkProcessProxy.messages.in:
3488         * UIProcess/WebPageProxy.cpp:
3489         * UIProcess/WebProcessPool.cpp:
3490         (WebKit::WebProcessPool::ensureNetworkProcess): Move WebsiteDataStore 'didCreateNetworkProcess'
3491         to 'processDidFinishLaunching'. Currently the call happens before a connection is established,
3492         causing initialization messages to get dropped.
3493         (WebKit::WebProcessPool::processDidFinishLaunching): Ditto.
3494         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3495         (WebKit::WebsiteDataStore::removeData):
3496         (WebKit::WebsiteDataStore::setMaxStatisticsEntries):
3497         (WebKit::WebsiteDataStore::setPruneEntriesDownTo):
3498         (WebKit::WebsiteDataStore::setGrandfatheringTime):
3499         (WebKit::WebsiteDataStore::setCacheMaxAgeCap):
3500         (WebKit::WebsiteDataStore::setMinimumTimeBetweenDataRecordsRemoval):
3501         (WebKit::WebsiteDataStore::setPrevalentResource):
3502         (WebKit::WebsiteDataStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
3503         (WebKit::WebsiteDataStore::scheduleClearInMemoryAndPersistent):
3504         (WebKit::WebsiteDataStore::setAgeCapForClientSideCookies):
3505         (WebKit::WebsiteDataStore::setNotifyPagesWhenDataRecordsWereScanned):
3506         (WebKit::WebsiteDataStore::setNotifyPagesWhenTelemetryWasCaptured):
3507         (WebKit::WebsiteDataStore::setTimeToLiveUserInteraction):
3508         (WebKit::WebsiteDataStore::setCacheMaxAgeCapForPrevalentResources):
3509         (WebKit::WebsiteDataStore::setResourceLoadStatisticsDebugMode):
3510         * UIProcess/WebsiteData/WebsiteDataStore.h:
3511         * WebKit.xcodeproj/project.pbxproj:
3512
3513 2019-01-23  Sihui Liu  <sihui_liu@apple.com>
3514
3515         Clean up IndexedDB files between tests
3516         https://bugs.webkit.org/show_bug.cgi?id=192796
3517         <rdar://problem/46824999>
3518
3519         Reviewed by Geoffrey Garen.
3520
3521         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
3522         (WKWebsiteDataStoreRemoveAllIndexedDatabases):
3523         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
3524
3525 2019-01-23  Wenson Hsieh  <wenson_hsieh@apple.com>
3526
3527         [iOS] fast/events/touch/ios/hover-when-style-change-is-async.html times out
3528         https://bugs.webkit.org/show_bug.cgi?id=193182
3529         <rdar://problem/47452154>
3530
3531         Reviewed by Tim Horton.
3532
3533         Fix an existing bug where blurring an element doesn't always un-suppress text interactions.
3534
3535         * UIProcess/ios/WKContentViewInteraction.mm:
3536         (-[WKContentView _elementDidBlur]):
3537
3538 2019-01-23  Michael Catanzaro  <mcatanzaro@igalia.com>
3539
3540         Minor improvements to NetworkProcess
3541         https://bugs.webkit.org/show_bug.cgi?id=193708
3542
3543         Reviewed by Alex Christensen.
3544
3545         * NetworkProcess/NetworkProcess.cpp:
3546         (WebKit::NetworkProcess::switchToNewTestingSession): Fix a spelling error.
3547         (WebKit::NetworkProcess::ensureSession): Add useful assertion.
3548         (WebKit::NetworkProcess::defaultStorageSession const): Split into platform functions.
3549         (WebKit::NetworkProcess::destroySession): Add useful assertion.
3550         * NetworkProcess/NetworkProcess.h:
3551         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3552         (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
3553         * NetworkProcess/curl/NetworkProcessCurl.cpp:
3554         (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
3555         * NetworkProcess/soup/NetworkProcessSoup.cpp:
3556         (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
3557
3558 2019-01-23  Daniel Bates  <dabates@apple.com>
3559
3560         Fix the Apple Internal build. See <rdar://problem/47486758>.
3561
3562         * UIProcess/ios/WKContentViewInteraction.mm:
3563         (-[WKContentView dropInteraction:previewForDroppingItem:withDefault:]):
3564
3565 2019-01-23  Per Arne Vollan  <pvollan@apple.com>
3566
3567         [macOS] Sandbox fails to compile
3568         https://bugs.webkit.org/show_bug.cgi?id=193727
3569         <rdar://problem/47476903>
3570
3571         Reviewed by Brent Fulgham.
3572
3573         Use '(with send-signal SIGKILL)' instead of '(with termination)'.
3574
3575         * WebProcess/com.apple.WebProcess.sb.in:
3576
3577 2019-01-23  Brent Fulgham  <bfulgham@apple.com>
3578
3579         REGRESSION (r240243): CrashTracer: WebKitTestRunnerApp at com.apple.WebKit: WebKit::WebResourceLoadStatisticsStore::sendDiagnosticMessageWithValue const + 32
3580         https://bugs.webkit.org/show_bug.cgi?id=193723
3581         <rdar://problem/47476802>
3582
3583         Reviewed by David Kilzer.
3584
3585         The new code added in r240243 could attempt to submit telemetry after the relevant
3586         WebResourceLoadStatisticsStore was destroyed. We should guard against this possibility.
3587
3588         * NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.cpp:
3589         (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit):
3590
3591 2019-01-23  Antti Koivisto  <antti@apple.com>
3592
3593         [PSON] Flash on back navigation on Mac
3594         https://bugs.webkit.org/show_bug.cgi?id=193716
3595         <rdar://problem/47148458>
3596
3597         Reviewed by Chris Dumez.
3598
3599         We close the page immediately if we fail to suspend. Layers disappear and we get a flash.
3600
3601         * UIProcess/SuspendedPageProxy.cpp:
3602         (WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
3603
3604         Remove the suspended page (so closing it on web process side) if the suspension fails.
3605         Skip this if we are using web process side compositing on Mac.
3606
3607         * UIProcess/WebPageProxy.cpp:
3608         (WebKit::WebPageProxy::enterAcceleratedCompositingMode):
3609
3610         On Mac, remove failed SuspendedPageProxy when entering compositing mode. At this point we don't need it to keep layers alive.
3611
3612         * UIProcess/WebProcessPool.cpp:
3613         (WebKit::WebProcessPool::removeFailedSuspendedPagesForPage):
3614         * UIProcess/WebProcessPool.h:
3615         * WebProcess/WebPage/WebPage.cpp:
3616         (WebKit::WebPage::suspendForProcessSwap):
3617
3618         Don't close the page on suspension failure.
3619
3620 2019-01-23  Wenson Hsieh  <wenson_hsieh@apple.com>
3621
3622         Introduce UndoStep::label() and adopt it in WebKitLegacy and WebKit
3623         https://bugs.webkit.org/show_bug.cgi?id=193706
3624         <rdar://problem/44807048>
3625
3626         Reviewed by Ryosuke Niwa.
3627
3628         * UIProcess/Cocoa/WebViewImpl.mm:
3629         (WebKit::WebViewImpl::registerEditCommand):
3630         * UIProcess/WebEditCommandProxy.cpp:
3631         (WebKit::WebEditCommandProxy::WebEditCommandProxy):
3632         * UIProcess/WebEditCommandProxy.h:
3633
3634         Drive-by tweak: make WebEditCommandProxy's backpointer to its WebPageProxy a WeakPtr instead of a raw pointer.
3635         Additionally, call clear() instead of setting m_page to 0 upon invalidation. Also, turn the WebPageProxy*
3636         argument into a WebPageProxy&, since the WebPageProxy must exist when it creates a new WebEditCommandProxy.
3637
3638         (WebKit::WebEditCommandProxy::create):
3639         (WebKit::WebEditCommandProxy::label const):
3640         (WebKit::WebEditCommandProxy::invalidate):
3641         (WebKit::WebEditCommandProxy::editAction const): Deleted.
3642
3643         Adjust UI-side logic to just handle the undo/redo label, rather than map the edit action to a localized string.
3644
3645         * UIProcess/WebPageProxy.cpp:
3646         (WebKit::WebPageProxy::registerEditCommandForUndo):
3647         (WebKit::WebPageProxy::resetState):
3648
3649         Tweak this to use std::exchange instead of copying all the WebEditCommandProxy RefPtrs into a separate Vector
3650         and then iterating over the Vector.
3651
3652         * UIProcess/WebPageProxy.h:
3653         * UIProcess/WebPageProxy.messages.in:
3654
3655         Adjust this so that we only send the undo/redo label over IPC, rather than the edit action type.
3656
3657         * UIProcess/ios/PageClientImplIOS.mm:
3658         (WebKit::PageClientImpl::registerEditCommand):
3659         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
3660         (WebKit::WebEditorClient::registerUndoStep):
3661
3662 2019-01-23  Michael Catanzaro  <mcatanzaro@igalia.com>
3663
3664         [SOUP] Remove libsoup cruft from WebProcess
3665         https://bugs.webkit.org/show_bug.cgi?id=193710
3666
3667         Reviewed by Carlos Garcia Campos.
3668
3669         SoupNetworkSession is no longer accessible from the web process because it's owned
3670         (indirectly) by NetworkProcess after r240292. It doesn't make sense to have any libsoup
3671         code under WebProcess anymore. The current libsoup code consists of (a) unused stuff to be
3672         removed, (b) stuff unrelated to libsoup, which should move to a WebProcessGLib.cpp, and (c)
3673         WebKitSoupRequestInputStream, which is only used by NetworkProcess and should move there
3674
3675         * NetworkProcess/soup/WebKitSoupRequestInputStream.cpp: Renamed from Source/WebKit/WebProcess/soup/WebKitSoupRequestInputStream.cpp.
3676         (AsyncReadData::AsyncReadData):
3677         (webkitSoupRequestInputStreamReadAsyncResultComplete):
3678         (webkitSoupRequestInputStreamPendingReadAsyncComplete):
3679         (webkitSoupRequestInputStreamHasDataToRead):
3680         (webkitSoupRequestInputStreamIsWaitingForData):
3681         (webkitSoupRequestInputStreamReadAsync):
3682         (webkitSoupRequestInputStreamReadFinish):
3683         (webkitSoupRequestInputStreamFinalize):
3684         (webkit_soup_request_input_stream_init):
3685         (webkit_soup_request_input_stream_class_init):
3686         (webkitSoupRequestInputStreamNew):
3687         (webkitSoupRequestInputStreamAddData):
3688         (webkitSoupRequestInputStreamDidFailWithError):
3689         (webkitSoupRequestInputStreamFinished):
3690         * NetworkProcess/soup/WebKitSoupRequestInputStream.h: Renamed from Source/WebKit/WebProcess/soup/WebKitSoupRequestInputStream.h.
3691         * SourcesGTK.txt:
3692         * SourcesWPE.txt:
3693         * UIProcess/soup/WebProcessPoolSoup.cpp:
3694         (WebKit::WebProcessPool::setNetworkProxySettings): Don't send message to web processes.
3695         * WebProcess/WebProcess.h:
3696         * WebProcess/WebProcess.messages.in:
3697         * WebProcess/glib/WebProcessGLib.cpp: Renamed from Source/WebKit/WebProcess/soup/WebProcessSoup.cpp.
3698         (WebKit::WebProcess::platformSetCacheModel):
3699         (WebKit::WebProcess::platformInitializeWebProcess):
3700         (WebKit::WebProcess::platformTerminate):
3701
3702 2019-01-23  Michael Catanzaro  <mcatanzaro@igalia.com>
3703
3704         [SOUP] Clean up NetworkStorageSession
3705         https://bugs.webkit.org/show_bug.cgi?id=193707
3706
3707         Reviewed by Carlos Garcia Campos.
3708
3709         Restore an important call to clearSoupNetworkSession that was removed in r240292. Also,
3710         adapt to NetworkStorageSessions API changes.
3711
3712         * NetworkProcess/CustomProtocols/soup/LegacyCustomProtocolManagerSoup.cpp:
3713         (WebKit::LegacyCustomProtocolManager::registerScheme):
3714         * NetworkProcess/soup/NetworkProcessMainSoup.cpp:
3715         * NetworkProcess/soup/NetworkProcessSoup.cpp:
3716         (WebKit::NetworkProcess::userPreferredLanguagesChanged):
3717         (WebKit::NetworkProcess::setNetworkProxySettings):
3718         * NetworkProcess/soup/NetworkSessionSoup.cpp:
3719         (WebKit::NetworkSessionSoup::soupSession const):
3720
3721 2019-01-23  Philippe Normand  <pnormand@igalia.com>
3722
3723         [GTK] Crash when browsing inspector:// uri without port set
3724         https://bugs.webkit.org/show_bug.cgi?id=193721
3725
3726         Reviewed by Michael Catanzaro.
3727
3728         * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
3729         (WebKit::RemoteInspectorProtocolHandler::handleRequest): Return
3730         back to caller after setting the error, if no port was provided
3731         along with the inspector URL.
3732
3733 2019-01-23  David Kilzer  <ddkilzer@apple.com>
3734
3735         Switch remaining CoreMedia soft-linking in WebKit over to CoreMediaSoftLink.{cpp,h}
3736         <https://webkit.org/b/193694>
3737         <rdar://problem/47464025>
3738
3739         Reviewed by Tim Horton.
3740
3741         * Shared/ios/WebIconUtilities.mm:
3742         - Switch to using CoreMediaSoftLink.{h,mm} in PAL.
3743
3744 2019-01-22  Chris Dumez  <cdumez@apple.com>
3745
3746         Regression(r240178) Some API tests are crashing
3747         https://bugs.webkit.org/show_bug.cgi?id=193680
3748
3749         Reviewed by Alex Christensen.
3750
3751         r240178 made sure that userScripts / scriptMessageHandlers / contentExtensions are always
3752         properly populated in the WebPageCreationParameters. This was needed in case we need to
3753         reconstruct the WebUserContentController on the WebProcess side. However, this caused a
3754         regression in the case we reuse a process where the WebUserContentController still exists
3755         (because it was kept alive, e.g. by the WebPageGroup). In that case, we would add duplicate
3756         entries to the existing WebUserContentController instance because its "add" methods did not
3757         have duplicate checks. To address the issue, this patch adds duplicate checks to the
3758         WebUserContentController "add" methods.
3759
3760         * WebProcess/UserContent/WebUserContentController.cpp:
3761         (WebKit::WebUserContentController::addUserScriptMessageHandlerInternal):
3762         (WebKit::WebUserContentController::removeUserScriptMessageHandlerInternal):
3763         (WebKit::WebUserContentController::addUserScriptInternal):
3764         (WebKit::WebUserContentController::removeUserScriptInternal):
3765         (WebKit::WebUserContentController::addUserStyleSheetInternal):
3766         (WebKit::WebUserContentController::removeUserStyleSheetInternal):
3767         (WebKit::WebUserContentController::forEachUserMessageHandler const):
3768         * WebProcess/UserContent/WebUserContentController.h:
3769
3770 2019-01-22  Michael Catanzaro  <mcatanzaro@igalia.com>
3771
3772         Unreviewed attempt to fix GTK/WPE bots
3773         https://bugs.webkit.org/show_bug.cgi?id=193580
3774         <rdar://problem/47457742>
3775
3776         Doesn't make sense to clear the storage session right after creating it. This should fix
3777         network process crash on startup under G_DEBUG=fatal-criticals due to the storage session
3778         not having a cookie jar.
3779
3780         * NetworkProcess/NetworkProcess.cpp:
3781         (WebKit::NetworkProcess::NetworkProcess):
3782
3783 2019-01-22  Megan Gardner  <megan_gardner@apple.com>
3784
3785         Cancel Web Touches Properly so that long presses on YouTube links do not incorrectly trigger a load
3786         https://bugs.webkit.org/show_bug.cgi?id=193687
3787         <rdar://problem/47056717>
3788
3789         Reviewed by Tim Horton.
3790
3791         Cancel web gestures when a long press is recognized.
3792
3793         * Platform/spi/ios/UIKitSPI.h:
3794         * UIProcess/ios/WKContentViewInteraction.mm:
3795         (-[WKContentView _cancelWebGestureRecognizer]):
3796         (-[WKContentView _longPressRecognized:]):
3797
3798 2019-01-22  Alex Christensen  <achristensen@webkit.org>
3799
3800         Fix an internal build failure after r240292
3801         https://bugs.webkit.org/show_bug.cgi?id=193580
3802
3803         Rubber-stamped by Wenson Hsieh.
3804
3805         * SourcesCocoa.txt:
3806         * UIProcess/mac/WebContextMenuProxyMac.mm:
3807         (-[WKMenuTarget forwardContextMenuAction:]):
3808         * WebKit.xcodeproj/project.pbxproj:
3809         It was apparently unclear to the compiler sometimes which "state" selector to use, and this apparently mattered.
3810         Tell the compiler to use the NSMenuItem selector, but at runtime it doesn't matter.
3811
3812 2019-01-22  Michael Catanzaro  <mcatanzaro@igalia.com>
3813
3814         Unreviewed, fix -Wunused-but-set-variable warning
3815         https://bugs.webkit.org/show_bug.cgi?id=193660
3816         <rdar://problem/47433602>
3817
3818         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3819         (WebKit::WebsiteDataStore::removeData):
3820
3821 2019-01-22  Michael Catanzaro  <mcatanzaro@igalia.com>
3822
3823         Unreviewed, further build fixes after r240292
3824         https://bugs.webkit.org/show_bug.cgi?id=193580
3825         <rdar://problem/47457742>
3826
3827         Oops.
3828
3829         * NetworkProcess/NetworkProcess.cpp:
3830         (WebKit::NetworkProcess::defaultStorageSession const):
3831
3832 2019-01-22  Michael Catanzaro  <mcatanzaro@igalia.com>
3833
3834         Unreviewed, further build fixes after r240292
3835         https://bugs.webkit.org/show_bug.cgi?id=193580
3836         <rdar://problem/47457742>
3837
3838         This builds for libsoup. Doesn't work, but at least builds.
3839
3840         Also, speculative fixes for curl.
3841
3842         * NetworkProcess/NetworkProcess.cpp:
3843         (WebKit::NetworkProcess::defaultStorageSession const):
3844
3845 2019-01-22  Michael Catanzaro  <mcatanzaro@igalia.com>
3846
3847         Unreviewed, further build fixes after r240292
3848         https://bugs.webkit.org/show_bug.cgi?id=193580
3849         <rdar://problem/47457742>
3850
3851         Still not working yet.
3852
3853         * NetworkProcess/NetworkProcess.cpp:
3854         (WebKit::NetworkProcess::NetworkProcess):
3855         * UIProcess/API/APIHTTPCookieStore.h:
3856
3857 2019-01-22  Antti Koivisto  <antti@apple.com>
3858
3859         [iOS] Flash when swiping back to Google search result page
3860         https://bugs.webkit.org/show_bug.cgi?id=193668
3861         <rdar://problem/47071684>
3862
3863         Reviewed by Simon Fraser.
3864
3865         If the google page is scrolled, there is sometimes a short flash.
3866
3867         When restoring the page state we also restore exposedContentRect which is used to determine
3868         which part of the page to create layers for. Scroll position is restored by the UI process
3869         later so we rely on this to get the right layers for the initial view update.
3870
3871         A viewport configuration update may sometimes trample over the restored exposedContentRect,
3872         moving it to top left. In this case the initial layer tree unfreeze commit may not have
3873         layers to cover the actual visible view position.
3874
3875         * WebProcess/WebPage/WebPage.cpp:
3876         (WebKit::WebPage::didCommitLoad):
3877         * WebProcess/WebPage/WebPage.h:
3878         * WebProcess/WebPage/ios/WebPageIOS.mm:
3879         (WebKit::WebPage::restorePageState):
3880
3881         Set a bit to indicate we have already restored the exposedContentRect.
3882
3883         (WebKit::WebPage::viewportConfigurationChanged):
3884
3885         Only reset exposedContentRect if wasn't already set by restorePageState.
3886
3887 2019-01-22  Alex Christensen  <achristensen@webkit.org>
3888
3889         Fix more builds.
3890
3891         * SourcesCocoa.txt:
3892         * WebKit.xcodeproj/project.pbxproj:
3893
3894 2019-01-22  Michael Catanzaro  <mcatanzaro@igalia.com>
3895
3896         Another build fix after r240292
3897         https://bugs.webkit.org/show_bug.cgi?id=193580
3898         <rdar://problem/47457742>
3899
3900         Unreviewed, still not enough to fix soup builds, but closer.
3901
3902         * UIProcess/API/APIHTTPCookieStore.h:
3903
3904 2019-01-22  Alex Christensen  <achristensen@webkit.org>
3905
3906         Fix some builds after r240292
3907         https://bugs.webkit.org/show_bug.cgi?id=193580
3908
3909         * NetworkProcess/NetworkProcess.cpp:
3910         (WebKit::NetworkProcess::switchToNewTestingSession):
3911         * NetworkProcess/cache/NetworkCache.cpp:
3912         (WebKit::NetworkCache::Cache::retrieve):
3913
3914 2019-01-22  Brian Burg  <bburg@apple.com>
3915
3916         Automation.computeElementLayout should return visual viewport-aware coordinates
3917         https://bugs.webkit.org/show_bug.cgi?id=193598
3918         <rdar://problem/35325644>
3919
3920         Unreviewed, restore a mistakenly-deleted line whose absence causes hangs.
3921
3922         * Shared/CoordinateSystem.h:
3923
3924 2019-01-22  Alex Christensen  <achristensen@webkit.org>
3925
3926         Move NetworkStorageSession ownership to NetworkProcess
3927         https://bugs.webkit.org/show_bug.cgi?id=193580
3928
3929         Reviewed by Geoff Garen.
3930
3931         * NetworkProcess/Cookies/WebCookieManager.cpp:
3932         (WebKit::WebCookieManager::WebCookieManager):
3933         (WebKit::WebCookieManager::getHostnamesWithCookies):
3934         (WebKit::WebCookieManager::deleteCookiesForHostname):
3935         (WebKit::WebCookieManager::deleteAllCookies):
3936         (WebKit::WebCookieManager::deleteCookie):
3937         (WebKit::WebCookieManager::deleteAllCookiesModifiedSince):
3938         (WebKit::WebCookieManager::getAllCookies):
3939         (WebKit::WebCookieManager::getCookies):
3940         (WebKit::WebCookieManager::setCookie):
3941         (WebKit::WebCookieManager::setCookies):
3942         (WebKit::WebCookieManager::startObservingCookieChanges):
3943         (WebKit::WebCookieManager::stopObservingCookieChanges):
3944         * NetworkProcess/Cookies/WebCookieManager.h:
3945         * NetworkProcess/Cookies/mac/WebCookieManagerMac.mm:
3946         (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
3947         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3948         (WebKit::storageSession):
3949         (WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
3950         (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
3951         (WebKit::NetworkConnectionToWebProcess::cookiesEnabled):
3952         (WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue):
3953         (WebKit::NetworkConnectionToWebProcess::getRawCookies):
3954         (WebKit::NetworkConnectionToWebProcess::deleteCookie):
3955         (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForFrame):
3956         (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForAllFramesOnPage):
3957         * NetworkProcess/NetworkProcess.cpp:
3958         (WebKit::NetworkProcess::initializeNetworkProcess):
3959         (WebKit::NetworkProcess::clearCachedCredentials):
3960         (WebKit::NetworkProcess::switchToNewTestingSession):
3961         (WebKit::NetworkProcess::ensureSession):
3962         (WebKit::NetworkProcess::storageSession const):
3963         (WebKit::NetworkProcess::defaultStorageSession const):
3964    &nb