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