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