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