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