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