Source/JavaScriptCore:
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2019-01-27  Chris Fleizach  <cfleizach@apple.com>
2
3         AX: Introduce a static accessibility tree
4         https://bugs.webkit.org/show_bug.cgi?id=193348
5         <rdar://problem/47203295>
6
7         Reviewed by Ryosuke Niwa.
8
9         * Configurations/FeatureDefines.xcconfig:
10         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
11         (-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper]):
12
13 2019-01-26  Simon Fraser  <simon.fraser@apple.com>
14
15         Allow scrolling tree nodes to exist in a detached state
16         https://bugs.webkit.org/show_bug.cgi?id=193754
17
18         Reviewed by Zalan Bujtas.
19
20         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
21         (WebKit::RemoteScrollingCoordinatorTransaction::decode):
22
23 2019-01-25  Tim Horton  <timothy_horton@apple.com>
24
25         REGRESSION (r238818): Snapshot is removed too late after swiping back on Twitter
26         https://bugs.webkit.org/show_bug.cgi?id=193860
27         <rdar://problem/47535022>
28
29         Reviewed by Antti Koivisto.
30
31         * UIProcess/Cocoa/ViewGestureController.cpp:
32         (WebKit::ViewGestureController::didStartProvisionalOrSameDocumentLoadForMainFrame):
33         (WebKit::ViewGestureController::didStartProvisionalLoadForMainFrame):
34         (WebKit::ViewGestureController::didSameDocumentNavigationForMainFrame):
35         * UIProcess/Cocoa/ViewGestureController.h:
36         Treat provisional load and same document load the same: they already both
37         unpause the snapshot removal tracker, request render tree size notifications,
38         but same-document navigation was missing the call to dispatchAfterEnsuringDrawing
39         and thus would get stuck waiting for RepaintAfterNavigation.
40
41 2019-01-25  Ryosuke Niwa  <rniwa@webkit.org>
42
43         Need a mechanism to override navigator.userAgent
44         https://bugs.webkit.org/show_bug.cgi?id=193762
45         <rdar://problem/47504939>
46
47         Reviewed by Brent Fulgham.
48
49         This patch adds a new _WKWebsitePolicies SPI to specify the user agent string returned by
50         navigator.userAgent without affecting the user agent string used to send network requests.
51
52         Tests: WebKit.WebsitePoliciesCustomJavaScriptUserAgent
53                WebKit.WebsitePoliciesCustomUserAgents
54
55         * Shared/WebsitePoliciesData.cpp:
56         (WebKit::WebsitePoliciesData::encode const):
57         (WebKit::WebsitePoliciesData::decode):
58         (WebKit::WebsitePoliciesData::applyToDocumentLoader):
59         * Shared/WebsitePoliciesData.h:
60         * UIProcess/API/APIWebsitePolicies.cpp:
61         (API::WebsitePolicies::data):
62         * UIProcess/API/APIWebsitePolicies.h:
63         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
64         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
65         (-[_WKWebsitePolicies setCustomJavaScriptUserAgent:]):
66         (-[_WKWebsitePolicies customJavaScriptUserAgent]):
67
68 2019-01-25  Devin Rousso  <drousso@apple.com>
69
70         Web Inspector: provide a way to edit page settings on a remote target
71         https://bugs.webkit.org/show_bug.cgi?id=193813
72         <rdar://problem/47359510>
73
74         Reviewed by Joseph Pecoraro.
75
76         * WebProcess/WebPage/WebInspectorUI.h:
77         (WebKit::WebInspectorUI::isRemote() const): Added.
78         * WebProcess/WebPage/RemoteWebInspectorUI.h:
79         (WebKit::RemoteWebInspectorUI::isRemote() const): Added.
80
81 2019-01-25  Dean Jackson  <dino@apple.com>
82
83         REGRESSION: Some USDz from 3rd party websites don't go directly to AR QL
84         https://bugs.webkit.org/show_bug.cgi?id=193831
85         <rdar://problem/47399263>
86
87         Reviewed by Chris Dumez.
88
89         A System Preview (<a rel="ar">) displays in a modal and doesn't trigger
90         a navigation. If the link was cross origin, it was causing a process swap,
91         which meant that the response defaulted back to a navigation.
92
93         The fix is to not cause a PSON when the navigation is a system preview.
94
95         * UIProcess/API/APINavigation.h:
96         (API::Navigation::shouldForceDownload const): This is now just tracking
97         the "download" attribute, and not including System Preview.
98         (API::Navigation::isSystemPreview const): New method to check for a
99         navigation triggered as a System Preview.
100         * UIProcess/WebPageProxy.cpp: Move the code from receivedPolicyDecision to
101         receivedNavigationPolicyDecision, so that downloads and System Previews are
102         detected before we decide to change process.
103         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
104         (WebKit::WebPageProxy::receivedPolicyDecision):
105
106 2019-01-25  Tim Horton  <timothy_horton@apple.com>
107
108         Find-in-page on nyt.com scrolls around without touching the screen when find holes are visible
109         https://bugs.webkit.org/show_bug.cgi?id=193853
110
111         Reviewed by Simon Fraser.
112
113         * WebProcess/WebPage/ios/FindControllerIOS.mm:
114         (WebKit::FindController::updateFindIndicator):
115         There is no reason to scroll/zoom to the find indicator just because the
116         holes are up, we should only do it on initial indicator presentation.
117         This was a mistake in r178755 that was previously never exercised because
118         isShowingOverlay was always false.
119
120 2019-01-25  Keith Rollin  <krollin@apple.com>
121
122         Update Xcode projects with "Check .xcfilelists" build phase
123         https://bugs.webkit.org/show_bug.cgi?id=193790
124         <rdar://problem/47201374>
125
126         Reviewed by Alex Christensen.
127
128         Support for XCBuild includes specifying inputs and outputs to various
129         Run Script build phases. These inputs and outputs are specified as
130         .xcfilelist files. Once created, these .xcfilelist files need to be
131         kept up-to-date. In order to check that they are up-to-date or not,
132         add an Xcode build step that invokes an external script that performs
133         the checking. If the .xcfilelists are found to be out-of-date, update
134         them, halt the build, and instruct the developer to restart the build
135         with up-to-date files.
136
137         At this time, the checking and regenerating is performed only if the
138         WK_ENABLE_CHECK_XCFILELISTS environment variable is set to 1. People
139         who want to use this facility can set this variable and test out the
140         checking/regenerating. Once it seems like there are no egregious
141         issues that upset a developer's workflow, we'll unconditionally enable
142         this facility.
143
144         * Scripts/check-xcfilelists.sh: Added.
145         * WebKit.xcodeproj/project.pbxproj:
146
147 2019-01-25  Alex Christensen  <achristensen@webkit.org>
148
149         Move logic from ChildProcess::setApplicationIsDaemon to NetworkProcess::initializeProcess
150         https://bugs.webkit.org/show_bug.cgi?id=193844
151
152         Reviewed by Andy Estes.
153
154         This simplifies ChildProcess and removes NetworkProcess-specific code from this generic abstraction.
155
156         * NetworkProcess/mac/NetworkProcessMac.mm:
157         (WebKit::NetworkProcess::initializeProcess):
158         * Shared/ios/ChildProcessIOS.mm:
159         (WebKit::ChildProcess::setApplicationIsDaemon): Deleted.
160         * Shared/mac/ChildProcessMac.mm:
161         (WebKit::ChildProcess::setApplicationIsDaemon): Deleted.
162
163 2019-01-25  Keith Rollin  <krollin@apple.com>
164
165         Update Xcode projects with "Apply Configuration to XCFileLists" build target
166         https://bugs.webkit.org/show_bug.cgi?id=193781
167         <rdar://problem/47201153>
168
169         Reviewed by Alex Christensen.
170
171         Part of generating the .xcfilelists used as part of adopting XCBuild
172         includes running `make DerivedSources.make` from a standalone script.
173         It’s important for this invocation to have the same environment as
174         when the actual build invokes `make DerivedSources.make`. If the
175         environments are different, then the two invocations will provide
176         different results. In order to get the same environment in the
177         standalone script, have the script launch xcodebuild targeting the
178         "Apply Configuration to XCFileLists" build target, which will then
179         re-invoke our standalone script. The script is now running again, this
180         time in an environment with all workspace, project, target, xcconfig
181         and other environment variables established.
182
183         The "Apply Configuration to XCFileLists" build target accomplishes
184         this task via a small embedded shell script that consists only of:
185
186             eval "${WK_SUBLAUNCH_SCRIPT_PARAMETERS[@]}"
187
188         The process that invokes "Apply Configuration to XCFileLists" first
189         sets WK_SUBLAUNCH_SCRIPT_PARAMETERS to an array of commands to be
190         evaluated and exports it into the shell environment. When xcodebuild
191         is invoked, it inherits the value of this variable and can `eval` the
192         contents of that variable. Our external standalone script can then set
193         WK_SUBLAUNCH_SCRIPT_PARAMETERS to the path to itself, along with a set
194         of command-line parameters needed to restart itself in the appropriate
195         state.
196
197         * WebKit.xcodeproj/project.pbxproj:
198
199 2019-01-25  Alex Christensen  <achristensen@webkit.org>
200
201         Add SPI to inform an application that "Go Back" has been clicked from a safe browsing warning
202         https://bugs.webkit.org/show_bug.cgi?id=193802
203         <rdar://problem/46010580>
204
205         Reviewed by Andy Estes.
206
207         * UIProcess/API/APIUIClient.h:
208         (API::UIClient::didClickGoBackFromSafeBrowsingWarning):
209         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
210         * UIProcess/Cocoa/UIDelegate.h:
211         * UIProcess/Cocoa/UIDelegate.mm:
212         (WebKit::UIDelegate::setDelegate):
213         (WebKit::UIDelegate::UIClient::didClickGoBackFromSafeBrowsingWarning):
214         * UIProcess/WebPageProxy.cpp:
215         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
216
217 2019-01-25  Daniel Bates  <dabates@apple.com>
218
219         [iOS] Pressing Tab key doesn't move to next cell with Google Sheets
220         https://bugs.webkit.org/show_bug.cgi?id=193048
221         <rdar://problem/46433836>
222
223         Reviewed by Brent Fulgham.
224
225         WebCore knows how interpret the Tab and Shift + Tab keys. When building with UIKit keyboard additions
226         we do not need to register key commands for handling them from the UIProcess code. Instead UIKit will
227         sends key events for these commands to us. This will make the behavior of these key commands when executed
228         in an editable field match the behavior of these command when executed in a non-editable field since
229         both code paths will now go through WebCore.
230
231         * UIProcess/ios/WKContentViewInteraction.mm:
232         (-[WKContentView keyCommands]): Only compile when building with !USE(UIKIT_KEYBOARD_ADDITIONS).
233
234 2019-01-25  Alex Christensen  <achristensen@webkit.org>
235
236         Fix Linux build.
237
238         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
239         (WebKit::NetworkConnectionToWebProcess::requestResourceLoadStatisticsUpdate):
240
241 2019-01-25  Keith Rollin  <krollin@apple.com>
242
243         Update WebKitAdditions.xcconfig with correct order of variable definitions
244         https://bugs.webkit.org/show_bug.cgi?id=193793
245         <rdar://problem/47532439>
246
247         Reviewed by Alex Christensen.
248
249         XCBuild changes the way xcconfig variables are evaluated. In short,
250         all config file assignments are now considered in part of the
251         evaluation. When using the new build system and an .xcconfig file
252         contains multiple assignments of the same build setting:
253
254         - Later assignments using $(inherited) will inherit from earlier
255           assignments in the xcconfig file.
256         - Later assignments not using $(inherited) will take precedence over
257           earlier assignments. An assignment to a more general setting will
258           mask an earlier assignment to a less general setting. For example,
259           an assignment without a condition ('FOO = bar') will completely mask
260           an earlier assignment with a condition ('FOO[sdk=macos*] = quux').
261
262         This affects some of our .xcconfig files, in that sometimes platform-
263         or sdk-specific definitions appear before the general definitions.
264         Under the new evaluations rules, the general definitions alway take
265         effect because they always overwrite the more-specific definitions. The
266         solution is to swap the order, so that the general definitions are
267         established first, and then conditionally overwritten by the
268         more-specific definitions.
269
270         * Configurations/BaseTarget.xcconfig:
271         * Configurations/Version.xcconfig:
272         * Configurations/WebKit.xcconfig:
273
274 2019-01-25  Keith Rollin  <krollin@apple.com>
275
276         Update existing .xcfilelists
277         https://bugs.webkit.org/show_bug.cgi?id=193791
278         <rdar://problem/47201706>
279
280         Reviewed by Alex Christensen.
281
282         Many .xcfilelist files were added in r238824 in order to support
283         XCBuild. Update these with recent changes to the set of build files
284         and with the current generate-xcfilelist script.
285
286         * DerivedSources-input.xcfilelist:
287         * DerivedSources-output.xcfilelist:
288         * UnifiedSources-input.xcfilelist:
289         * UnifiedSources-output.xcfilelist:
290
291 2019-01-25  Per Arne Vollan  <pvollan@apple.com>
292
293         [iOS] Deny mach lookups to services not used.
294         https://bugs.webkit.org/show_bug.cgi?id=193828
295
296         Reviewed by Brent Fulgham.
297
298         Start denying mach lookups to iOS services, which were previously allowed with reporting.
299         Living-on has indicated that these services are not used.
300
301         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
302
303 2019-01-25  Brent Fulgham  <bfulgham@apple.com>
304
305         Activate the WebResourceLoadStatisticsStore in the NetworkProcess and deactivate it in the UIProcess.
306         https://bugs.webkit.org/show_bug.cgi?id=193297
307         <rdar://problem/47158841>
308
309         Reviewed by Alex Christensen.
310
311         This patch activates the ResourceLoadStatistics code in the NetworkProcess, and turns
312         it off in the UIProcess. It also updates test infrastructure to work with this change
313         in architecture.
314
315         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
316         (WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceLoading): Added.
317         (WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceRedirect): Added.
318         (WebKit::ResourceLoadStatisticsMemoryStore::logWebSocketLoading): Added.
319         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
320         (WebKit::WebResourceLoadStatisticsStore::logSubresourceLoading): Added.
321         (WebKit::WebResourceLoadStatisticsStore::logSubresourceRedirect): Added.
322         (WebKit::WebResourceLoadStatisticsStore::logWebSocketLoading): Added.
323         (WebKit::WebResourceLoadStatisticsStore::removeAllStorageAccess):
324         (WebKit::WebResourceLoadStatisticsStore::setCacheMaxAgeCap):
325         (WebKit::WebResourceLoadStatisticsStore::setCacheMaxAgeCapForPrevalentResources): Deleted.
326         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
327         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
328         (WebKit::NetworkConnectionToWebProcess::logSubresourceLoading): Added.
329         (WebKit::NetworkConnectionToWebProcess::logSubresourceRedirect): Added.
330         (WebKit::NetworkConnectionToWebProcess::logWebSocketLoading): Added.
331         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
332         * NetworkProcess/NetworkSession.cpp:
333         (WebKit::NetworkSession::setResourceLoadStatisticsEnabled):
334         * UIProcess/WebProcessPool.cpp:
335         (WebKit::WebProcessPool::ensureNetworkProcess):
336         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
337         (WebKit::WebsiteDataStore::parameters):
338         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
339         (WebKit::WebsiteDataStore::removeData):
340         (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
341         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
342         * Webprocess/WebProcess.cpp:
343         (WebKit::WebProcess::initializeWebProcess): Register new ResourceLoadObserver callbacks.
344
345 2019-01-25  Ryosuke Niwa  <rniwa@webkit.org>
346
347         iOS: inputmode="none" disables hardware keyboard's globe key
348         https://bugs.webkit.org/show_bug.cgi?id=193811
349         <rdar://problem/47406553>
350
351         Reviewed by Wenson Hsieh.
352
353         Removed the support for inputmode="none" for now since we need a new SPI from UIKit
354         to properly implement this feature some time in the future.
355
356         * UIProcess/ios/WKContentViewInteraction.mm:
357         (-[WKContentView _zoomToRevealFocusedElement]):
358         (-[WKContentView inputView]):
359         (-[WKContentView requiresAccessoryView]):
360         (-[WKContentView textInputTraits]):
361
362 2019-01-25  David Kilzer  <ddkilzer@apple.com>
363
364         Move soft-linking of Lookup.framework out of LookupSPI.h
365         <https://webkit.org/b/193815>
366
367         Reviewed by Tim Horton.
368
369         * UIProcess/Cocoa/WebViewImpl.mm:
370         (-[WKWindowVisibilityObserver dealloc]):
371         (-[WKWindowVisibilityObserver startObservingLookupDismissalIfNeeded]):
372         - Move soft-linking to LookupSoftLink.{h,mm}.
373
374 2019-01-25  Antti Koivisto  <antti@apple.com>
375
376         REGRESSION (PSON): After swipe back, first few attempts to swipe forward not recognized as swipe gestures
377         https://bugs.webkit.org/show_bug.cgi?id=193818
378         <rdar://problem/47456584>
379
380         Reviewed by Tim Horton.
381
382         We don't hit the RenderTreeSizeThreshold milestone to remove the snapshot and allow interaction because we request it
383         from a wrong process (the one we are leaving behind).
384
385         * UIProcess/Cocoa/ViewGestureController.cpp:
386         (WebKit::ViewGestureController::didStartProvisionalLoadForMainFrame):
387
388         Request the RenderTreeSizeThreshold notification when the load has started and we know the process to use.
389
390         (WebKit::ViewGestureController::SnapshotRemovalTracker::hasOutstandingEvent):
391         * UIProcess/Cocoa/ViewGestureController.h:
392         (WebKit::ViewGestureController::SnapshotRemovalTracker::renderTreeSizeThreshold const):
393         (WebKit::ViewGestureController::SnapshotRemovalTracker::setRenderTreeSizeThreshold):
394         * UIProcess/mac/ViewGestureControllerMac.mm:
395         (WebKit::ViewGestureController::endSwipeGesture):
396
397         Don't request immediately, save the threshold to SnapshotRemovalTracker.
398
399         (WebKit::ViewGestureController::requestRenderTreeSizeNotificationIfNeeded):
400
401         Do the request to the right process.
402
403         * WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
404         (WebKit::ViewGestureGeometryCollector::setRenderTreeSizeNotificationThreshold):
405
406         Ensure we send the notification even if we reached the threshold before it was requested.
407
408         (WebKit::ViewGestureGeometryCollector::sendDidHitRenderTreeSizeThresholdIfNeeded):
409         (WebKit::ViewGestureGeometryCollector::mainFrameDidLayout):
410         * WebProcess/WebPage/ViewGestureGeometryCollector.h:
411         (WebKit::ViewGestureGeometryCollector::setRenderTreeSizeNotificationThreshold): Deleted.
412
413 2019-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
414
415         [iOS] Rename some WebKit-internal functions and variables that reference "data interaction"
416         https://bugs.webkit.org/show_bug.cgi?id=193829
417
418         Reviewed by Tim Horton.
419
420         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
421         (WebKit::WebPageProxy::setDragCaretRect):
422         * UIProcess/PageClient.h:
423         * UIProcess/WebPageProxy.h:
424         * UIProcess/WebPageProxy.messages.in:
425         * UIProcess/ios/PageClientImplIOS.h:
426         * UIProcess/ios/PageClientImplIOS.mm:
427         (WebKit::PageClientImpl::didHandleDragStartRequest):
428         (WebKit::PageClientImpl::didConcludeEditDrag):
429         (WebKit::PageClientImpl::didChangeDragCaretRect):
430         (WebKit::PageClientImpl::didHandleStartDataInteractionRequest): Deleted.
431         (WebKit::PageClientImpl::didConcludeEditDataInteraction): Deleted.
432         (WebKit::PageClientImpl::didChangeDataInteractionCaretRect): Deleted.
433         * UIProcess/ios/WKContentViewInteraction.h:
434         * UIProcess/ios/WKContentViewInteraction.mm:
435         (-[WKContentView setupInteraction]):
436         (-[WKContentView cleanupInteraction]):
437         (-[WKContentView setupDragAndDropInteractions]):
438         (-[WKContentView teardownDragAndDropInteractions]):
439         (-[WKContentView _didHandleDragStartRequest:]):
440         (-[WKContentView _didConcludeEditDrag:]):
441         (-[WKContentView _didChangeDragCaretRect:currentRect:]):
442         (-[WKContentView _dragInteraction:prepareForSession:completion:]):
443         (-[WKContentView setupDataInteractionDelegates]): Deleted.
444         (-[WKContentView teardownDataInteractionDelegates]): Deleted.
445         (-[WKContentView _didHandleStartDataInteractionRequest:]): Deleted.
446         (-[WKContentView _didConcludeEditDataInteraction:]): Deleted.
447         (-[WKContentView _didChangeDataInteractionCaretRect:currentRect:]): Deleted.
448         * UIProcess/ios/WebPageProxyIOS.mm:
449         (WebKit::WebPageProxy::didHandleDragStartRequest):
450         (WebKit::WebPageProxy::requestDragStart):
451         (WebKit::WebPageProxy::didConcludeEditDrag):
452         (WebKit::WebPageProxy::didHandleStartDataInteractionRequest): Deleted.
453         (WebKit::WebPageProxy::requestStartDataInteraction): Deleted.
454         (WebKit::WebPageProxy::didConcludeEditDataInteraction): Deleted.
455         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
456         (WebKit::WebDragClient::didConcludeEditDrag):
457         * WebProcess/WebPage/WebPage.h:
458         * WebProcess/WebPage/WebPage.messages.in:
459         * WebProcess/WebPage/ios/WebPageIOS.mm:
460         (WebKit::WebPage::requestDragStart):
461         (WebKit::WebPage::requestAdditionalItemsForDragSession):
462         (WebKit::WebPage::didConcludeEditDrag):
463         (WebKit::WebPage::requestStartDataInteraction): Deleted.
464         (WebKit::WebPage::didConcludeEditDataInteraction): Deleted.
465
466 2019-01-25  Alex Christensen  <achristensen@webkit.org>
467
468         WKWebView.goBack should reload if there is a safe browsing warning
469         https://bugs.webkit.org/show_bug.cgi?id=193805
470         <rdar://problem/46908216>
471
472         Reviewed by Geoff Garen.
473
474         If a WKWebView is showing a safe browsing warning and the user clicks a back button
475         in the app which calls WKWebView.goBack, the WKWebView is in a state where it has not navigated yet,
476         so actually going back will appear to the user to go back twice.  We can't just do nothing because the
477         app is in a state where it is expecting a navigation to happen.  Reloading achieves what the user expects
478         and makes the app work like the app expects.
479
480         * UIProcess/API/C/WKPage.cpp:
481         (WKPageGoBack):
482         * UIProcess/API/Cocoa/WKWebView.mm:
483         (-[WKWebView goBack]):
484         * UIProcess/PageClient.h:
485         (WebKit::PageClient::hasSafeBrowsingWarning const):
486         * UIProcess/mac/PageClientImplMac.h:
487         * UIProcess/mac/PageClientImplMac.mm:
488         (WebKit::PageClientImpl::hasSafeBrowsingWarning const):
489
490 2019-01-25  Chris Dumez  <cdumez@apple.com>
491
492         Regression(PSON) cross-site provisional page is not canceled if a new same-site one is started
493         https://bugs.webkit.org/show_bug.cgi?id=193788
494         <rdar://problem/47531231>
495
496         Reviewed by Alex Christensen.
497
498         When the page starts a new provisional load, make sure we cancel any pending one in the provisional
499         process, as it would have happened in the first provisional load happened in the same process.
500         Without this, we could have 2 parallel loads happening, one in the committed process and another
501         in the provisional one, leading to assertion failures in debug.
502
503         * UIProcess/WebPageProxy.cpp:
504         (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
505
506 2019-01-25  Chris Dumez  <cdumez@apple.com>
507
508         Drop WebKit::WebKitPolicyAction type as it is no longer needed
509         https://bugs.webkit.org/show_bug.cgi?id=193827
510
511         Reviewed by Antti Koivisto.
512
513         Drop WebKit::WebKitPolicyAction type as it is no longer needed. It is now identical to
514         WebCore::PolicyAction.
515
516         * Shared/WebPolicyAction.h: Removed.
517         * UIProcess/WebFramePolicyListenerProxy.cpp:
518         (WebKit::WebFramePolicyListenerProxy::didReceiveSafeBrowsingResults):
519         (WebKit::WebFramePolicyListenerProxy::use):
520         (WebKit::WebFramePolicyListenerProxy::download):
521         (WebKit::WebFramePolicyListenerProxy::ignore):
522         * UIProcess/WebFramePolicyListenerProxy.h:
523         * UIProcess/WebFrameProxy.cpp:
524         (WebKit::WebFrameProxy::setUpPolicyListenerProxy):
525         * UIProcess/WebFrameProxy.h:
526         * UIProcess/WebPageProxy.cpp:
527         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
528         (WebKit::WebPageProxy::receivedPolicyDecision):
529         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
530         (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
531         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
532         (WebKit::WebPageProxy::decidePolicyForResponseShared):
533         * UIProcess/WebPageProxy.h:
534         * WebKit.xcodeproj/project.pbxproj:
535         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
536         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
537         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
538         * WebProcess/WebPage/WebFrame.cpp:
539         (WebKit::WebFrame::didReceivePolicyDecision):
540         (WebKit::toPolicyAction): Deleted.
541         * WebProcess/WebPage/WebFrame.h:
542         * WebProcess/WebPage/WebPage.cpp:
543         (WebKit::WebPage::didReceivePolicyDecision):
544         * WebProcess/WebPage/WebPage.h:
545
546 2019-01-25  Per Arne Vollan  <pvollan@apple.com>
547
548         [iOS] Add logging of calls
549         https://bugs.webkit.org/show_bug.cgi?id=193784
550
551         Reviewed by Brent Fulgham.
552
553         Add permissive logging of calls on iOS.
554
555         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
556
557 2019-01-25  Chris Dumez  <cdumez@apple.com>
558
559         Regression(PSON?) Crash under NavigationState::NavigationClient::decidePolicyForNavigationAction()
560         https://bugs.webkit.org/show_bug.cgi?id=193779
561         <rdar://problem/46170903>
562
563         Reviewed by Antti Koivisto.
564
565         * UIProcess/Cocoa/NavigationState.mm:
566         (WebKit::tryAppLink):
567         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
568         We were crashing when trying to get the URL of the main frame, which was sad because we never
569         ended up using the main frame URL. Therefore, this patch drops the code in question.
570
571         * UIProcess/ProvisionalPageProxy.cpp:
572         (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionAsync):
573         Add assertion to make sure that the DecidePolicyForNavigationActionAsync IPC it is getting
574         from the process is related to its main frame.
575
576 2019-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
577
578         Need a way for JavaScript (or bundle) code to participate in undo
579         https://bugs.webkit.org/show_bug.cgi?id=190009
580         <rdar://problem/44807048>
581
582         Reviewed by Ryosuke Niwa.
583
584         Invalidate undo steps when removing them from WebPage. Invalidation is a no-op for editing actions that come
585         from the UA, but for custom undo steps backed by an UndoItem, we clear out the custom undo step's pointer to its
586         UndoItem and additionally disconnect the UndoItem from its UndoManager.
587
588         * WebProcess/WebPage/WebPage.cpp:
589         (WebKit::WebPage::addWebUndoStep):
590         (WebKit::WebPage::removeWebEditCommand):
591         * WebProcess/WebPage/WebUndoStep.h:
592         (WebKit::WebUndoStep::invalidate):
593
594 2019-01-25  Patrick Griffis  <pgriffis@igalia.com>
595
596         [GTK][WPE] Add API to add paths to sandbox
597         https://bugs.webkit.org/show_bug.cgi?id=193571
598
599         This allows applications to add paths to the web process
600         if required by web extensions.
601
602         Reviewed by Michael Catanzaro.
603
604         * UIProcess/API/glib/WebKitWebContext.cpp:
605         (webkit_web_context_add_path_to_sandbox):
606         * UIProcess/API/gtk/WebKitWebContext.h:
607         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
608         * UIProcess/API/wpe/docs/wpe-0.1-sections.txt:
609         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
610         (WebKit::bubblewrapSpawn):
611         * UIProcess/WebProcessPool.h:
612         * UIProcess/glib/WebProcessProxyGLib.cpp:
613         (WebKit::WebProcessProxy::platformGetLaunchOptions):
614
615 2019-01-24  Ryosuke Niwa  <rniwa@webkit.org>
616
617         iOS: Split keyboard should not shrink visualViewport.height
618         https://bugs.webkit.org/show_bug.cgi?id=193798
619
620         Reviewed by Tim Horton.
621
622         Treat a split keyboard like a floating keyboard and don't consider its input view bounds in computing the visible content rects.
623
624         No new tests since while it's possible to transition between split and merged keyboard using some SPI,
625         there isn't a reliable mechanism to reset the keyboard state. e.g. we need to wait for a hard-coded amount of time.
626
627         * Platform/spi/ios/UIKitSPI.h:
628         * UIProcess/API/Cocoa/WKWebView.mm:
629         (-[WKWebView _keyboardChangedWithInfo:adjustScrollView:]):
630
631 2019-01-24  Eric Carlson  <eric.carlson@apple.com>
632
633         [iOS] Silence MediaPlayer compile warnings
634         https://bugs.webkit.org/show_bug.cgi?id=193780
635         <rdar://problem/47518428>
636
637         Reviewed by Jer Noble.
638
639         * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
640
641 2019-01-24  Truitt Savell  <tsavell@apple.com>
642
643         Unreviewed, rolling out r240446.
644
645         Casued 5 API failures
646
647         Reverted changeset:
648
649         "Activate the WebResourceLoadStatisticsStore in the
650         NetworkProcess and deactivate it in the UIProcess."
651         https://bugs.webkit.org/show_bug.cgi?id=193297
652         https://trac.webkit.org/changeset/240446
653
654 2019-01-24  Brent Fulgham  <bfulgham@apple.com>
655
656         Activate the WebResourceLoadStatisticsStore in the NetworkProcess and deactivate it in the UIProcess.
657         https://bugs.webkit.org/show_bug.cgi?id=193297
658         <rdar://problem/47158841>
659
660         Reviewed by Alex Christensen.
661
662         This patch activates the ResourceLoadStatistics code in the NetworkProcess, and turns
663         it off in the UIProcess. It also updates test infrastructure to work with this change
664         in architecture.
665
666         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
667         (WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceLoading): Added.
668         (WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceRedirect): Added.
669         (WebKit::ResourceLoadStatisticsMemoryStore::logWebSocketLoading): Added.
670         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
671         (WebKit::WebResourceLoadStatisticsStore::logSubresourceLoading): Added.
672         (WebKit::WebResourceLoadStatisticsStore::logSubresourceRedirect): Added.
673         (WebKit::WebResourceLoadStatisticsStore::logWebSocketLoading): Added.
674         (WebKit::WebResourceLoadStatisticsStore::removeAllStorageAccess):
675         (WebKit::WebResourceLoadStatisticsStore::setCacheMaxAgeCap):
676         (WebKit::WebResourceLoadStatisticsStore::setCacheMaxAgeCapForPrevalentResources): Deleted.
677         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
678         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
679         (WebKit::NetworkConnectionToWebProcess::logSubresourceLoading): Added.
680         (WebKit::NetworkConnectionToWebProcess::logSubresourceRedirect): Added.
681         (WebKit::NetworkConnectionToWebProcess::logWebSocketLoading): Added.
682         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
683         * NetworkProcess/NetworkSession.cpp:
684         (WebKit::NetworkSession::setResourceLoadStatisticsEnabled):
685         * UIProcess/WebProcessPool.cpp:
686         (WebKit::WebProcessPool::ensureNetworkProcess):
687         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
688         (WebKit::WebsiteDataStore::parameters):
689         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
690         (WebKit::WebsiteDataStore::removeData):
691         (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
692         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
693         * Webprocess/WebProcess.cpp:
694         (WebKit::WebProcess::initializeWebProcess): Register new ResourceLoadObserver callbacks.
695
696 2019-01-24  John Wilander  <wilander@apple.com>
697
698         Add Ad Click Attribution as an internal/experimental feature
699         https://bugs.webkit.org/show_bug.cgi?id=193685
700         <rdar://problem/47450399>
701
702         Reviewed by Brent Fulgham.
703
704         * Shared/WebPreferences.yaml:
705             Added AdClickAttributionEnabled as a runtime enabled feature, off by default.
706
707 2019-01-24  Antti Koivisto  <antti@apple.com>
708
709         [PSON] Flash on back navigation on Mac
710         https://bugs.webkit.org/show_bug.cgi?id=193716
711         <rdar://problem/47148458>
712
713         Reviewed by Chris Dumez.
714
715         We close the page immediately if we fail to suspend. Layers disappear and we get a flash.
716
717         * UIProcess/SuspendedPageProxy.cpp:
718         (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
719         (WebKit::SuspendedPageProxy::close):
720
721         Track closed state so we don't send the message twice, causing unhandled message errors in web process.
722
723         (WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
724
725         Close the suspended page if the suspension fails.
726         Skip this if we are using web process side compositing on Mac.
727
728         * UIProcess/SuspendedPageProxy.h:
729         * UIProcess/WebPageProxy.cpp:
730         (WebKit::WebPageProxy::enterAcceleratedCompositingMode):
731
732         On Mac, close the failed SuspendedPageProxy when entering compositing mode. At this point we don't need it to keep layers alive.
733
734         * UIProcess/WebProcessPool.cpp:
735         (WebKit::WebProcessPool::closeFailedSuspendedPagesForPage):
736         * UIProcess/WebProcessPool.h:
737         * WebProcess/WebPage/WebPage.cpp:
738         (WebKit::WebPage::suspendForProcessSwap):
739
740         Don't close the page on suspension failure. This is now managed by the UI process.
741
742 2019-01-24  Chris Dumez  <cdumez@apple.com>
743
744         Regression(PSON) Back/Forward list items' URL sometimes gets replaced with the URL of a subframe
745         https://bugs.webkit.org/show_bug.cgi?id=193761
746         <rdar://problem/47456405>
747
748         Reviewed by Alex Christensen.
749
750         When doing a history navigation cross-process, the UIProcess would first send the back/forward list items
751         to the destination WebProcess via WebPage::updateBackForwardListForReattach(), then ask the process to
752         navigate to the expected back/forward list item.
753
754         WebPage::updateBackForwardListForReattach() would call restoreSessionInternal(), which would call
755         toHistoryItem() on each BackForwardListItem. This may end up creating more than one HistoryItem for each
756         BackForwardListItem because HistoryItems are part of a tree (each frame has its own list of history items).
757
758         Note that BackForwardListItems and HistoryItem share a BackForwardItemIdentifier which is a
759         (processIdentifier, itemIdentifier) pair. We normally generate the HistoryItem's identifier from inside
760         its constructor like so:
761         `{ Process::identifier(), generateObjectIdentifier<BackForwardItemIdentifier::ItemIdentifierType>() }`
762
763         However, when calling updateBackForwardListForReattach() and constructing children HistoryItem,
764         applyFrameState() would generate the identifier by itself and passing it to the HistoryItem constructor.
765         Its genegates the ID the exact same way so this would in theory not be a problem. Unfortunately, both
766         calls to generateObjectIdentifier() get inlined and both call sites end up with their own static counter
767         to generate ids. As a result, we may end up with conflicts as HistoryItems for child frames (restored
768         by restoreSessionInternal()) can end up with the same identifier as HistoryItems for top frames.
769
770         This confusion would lead to the WebContent process sending the UIProcess bad information and the URL
771         of subframes could end up as the WebBackForwardListItem's mainframe URL.
772
773         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
774         (WebKit::applyFrameState):
775         Stop calling generateObjectIdentifier() explicitly and let the HistoryItem constructor take care of it.
776         Calling generateObjectIdentifier() for the same type from different places is not safe due to inlining.
777
778 2019-01-24  Ross Kirsling  <ross.kirsling@sony.com>
779
780         Move FileSystem to WTF
781         https://bugs.webkit.org/show_bug.cgi?id=193602
782
783         Reviewed by Yusuke Suzuki.
784
785         * NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.cpp:
786         * NetworkProcess/NetworkDataTaskBlob.h:
787         * NetworkProcess/NetworkProcess.cpp:
788         * NetworkProcess/cache/CacheStorageEngine.cpp:
789         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
790         * NetworkProcess/cache/NetworkCache.cpp:
791         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
792         * NetworkProcess/cache/NetworkCacheData.cpp:
793         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
794         * NetworkProcess/cache/NetworkCacheFileSystem.h:
795         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
796         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
797         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
798         * NetworkProcess/cache/NetworkCacheStorage.cpp:
799         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
800         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
801         * NetworkProcess/mac/NetworkProcessMac.mm:
802         * NetworkProcess/soup/NetworkProcessSoup.cpp:
803         * PluginProcess/unix/PluginProcessMainUnix.cpp:
804         * Shared/PersistencyUtils.cpp:
805         * Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp:
806         * Shared/Plugins/unix/PluginSearchPath.cpp:
807         * Shared/WebMemorySampler.h:
808         * Shared/glib/ProcessExecutablePathGLib.cpp:
809         * Shared/ios/ChildProcessIOS.mm:
810         * Shared/mac/ChildProcessMac.mm:
811         * Shared/mac/SandboxExtensionMac.mm:
812         * UIProcess/API/APIContentRuleListStore.cpp:
813         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
814         * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
815         * UIProcess/API/glib/IconDatabase.cpp:
816         * UIProcess/API/glib/WebKitFaviconDatabase.cpp:
817         * UIProcess/API/glib/WebKitFileChooserRequest.cpp:
818         * UIProcess/API/glib/WebKitWebContext.cpp:
819         * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
820         * UIProcess/API/win/APIWebsiteDataStoreWin.cpp:
821         * UIProcess/Automation/WebAutomationSession.cpp:
822         * UIProcess/Cocoa/DownloadClient.mm:
823         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
824         * UIProcess/Cocoa/WebViewImpl.mm:
825         * UIProcess/DeviceIdHashSaltStorage.cpp:
826         * UIProcess/Downloads/DownloadProxy.cpp:
827         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
828         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
829         * UIProcess/Plugins/gtk/PluginInfoCache.cpp:
830         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
831         * UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
832         * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
833         * UIProcess/ServiceWorkerProcessProxy.cpp:
834         * UIProcess/WebStorage/LocalStorageDatabase.cpp:
835         * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
836         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
837         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
838         * UIProcess/glib/WebProcessProxyGLib.cpp:
839         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
840         * UIProcess/gtk/WebProcessPoolGtk.cpp:
841         * UIProcess/ios/WKContentViewInteraction.mm:
842         * UIProcess/ios/forms/WKFileUploadPanel.mm:
843         * UIProcess/mac/WebPageProxyMac.mm:
844         * UIProcess/win/WebProcessPoolWin.cpp:
845         * UIProcess/win/WebView.cpp:
846         * UIProcess/wpe/WebProcessPoolWPE.cpp:
847         * WebProcess/InjectedBundle/API/glib/WebKitExtensionManager.cpp:
848         * WebProcess/InjectedBundle/glib/InjectedBundleGlib.cpp:
849         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
850         * WebProcess/Plugins/Netscape/NetscapePluginStream.h:
851         * WebProcess/Plugins/PluginProcessConnection.cpp:
852         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
853         * WebProcess/WebPage/gtk/WebInspectorUIGtk.cpp:
854         * WebProcess/WebPage/win/WebInspectorUIWin.cpp:
855         * WebProcess/cocoa/WebProcessCocoa.mm:
856
857 2019-01-23  Simon Fraser  <simon.fraser@apple.com>
858
859         Create "frame hosting" nodes for the scrolling tree
860         https://bugs.webkit.org/show_bug.cgi?id=193753
861
862         Reviewed by Antti Koivisto.
863
864         When the scrolling tree crosses frame boundaries, mutations in the parent frame currently
865         require the iframe's scrolling node to get reparented in a new ancestor, which requires
866         a layer tree walk of the parent frame. This is error-prone, and not very future-proof.
867
868         Fix this by introducing "frame hosting" scrolling tree nodes. These are mostly inert
869         nodes that are owned by the RenderIFrame's layer backing in the parent frame, and exist
870         to provide a consistent parent node for the subframe's scrolling node.
871
872         This patch adds the node types, but does not instantiate them yet.
873
874         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
875         (ArgumentCoder<ScrollingStateFrameHostingNode>::encode):
876         (ArgumentCoder<ScrollingStateFrameHostingNode>::decode):
877         (WebKit::encodeNodeAndDescendants):
878         (WebKit::RemoteScrollingCoordinatorTransaction::decode):
879         (WebKit::dump):
880         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
881         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
882         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
883         (WebKit::RemoteScrollingTree::createScrollingTreeNode):
884         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
885         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
886
887 2019-01-23  Ross Kirsling  <ross.kirsling@sony.com>
888
889         [Curl] Unreviewed build fix for r240292 and friends.
890
891         WinCairo test stability must be restored in subsequent patch.
892
893         * NetworkProcess/curl/NetworkProcessCurl.cpp:
894         (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
895         (WebKit::NetworkProcess::setNetworkProxySettings):
896
897 2019-01-23  Commit Queue  <commit-queue@webkit.org>
898
899         Unreviewed, rolling out r240403.
900         https://bugs.webkit.org/show_bug.cgi?id=193757
901
902         "Causes multiple crashes on macOS port (probably used wrong
903         ENABLE macro)" (Requested by ddkilzer on #webkit).
904
905         Reverted changeset:
906
907         "[Curl] Unreviewed build fix for r240292 and friends."
908         https://trac.webkit.org/changeset/240403
909
910 2019-01-23  Ross Kirsling  <ross.kirsling@sony.com>
911
912         [Curl] Unreviewed build fix for r240292 and friends.
913
914         WinCairo test stability must be restored in subsequent patch.
915
916         * NetworkProcess/curl/NetworkProcessCurl.cpp:
917         (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
918         (WebKit::NetworkProcess::setNetworkProxySettings):
919
920 2019-01-23  Alex Christensen  <achristensen@webkit.org>
921
922         Stop using NetworkProcess::singleton
923         https://bugs.webkit.org/show_bug.cgi?id=193700
924
925         Reviewed by Don Olmstead.
926
927         This replaces it with a NeverDestroyed<NetworkProcess> and paves the way for more interesting things.
928
929         * NetworkProcess/CustomProtocols/soup/LegacyCustomProtocolManagerSoup.cpp:
930         * NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm:
931         (WebKit::initializeChildProcess<WebKit::NetworkProcess>):
932         * NetworkProcess/NetworkProcess.cpp:
933         (WebKit::NetworkProcess::NetworkProcess):
934         (WebKit::NetworkProcess::singleton): Deleted.
935         * NetworkProcess/NetworkProcess.h:
936         * NetworkProcess/soup/NetworkProcessMainSoup.cpp:
937         (WebKit::initializeChildProcess<WebKit::NetworkProcess>):
938         * NetworkProcess/win/NetworkProcessMainWin.cpp:
939         (WebKit::initializeChildProcess<WebKit::NetworkProcess>):
940         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
941         (WebKit::initializeChildProcess):
942         (WebKit::XPCServiceInitializer):
943
944 2019-01-23  Ryan Haddad  <ryanhaddad@apple.com>
945
946         Unreviewed, rolling out r240343.
947
948         Caused 4 PSON API test failures.
949
950         Reverted changeset:
951
952         "[PSON] Flash on back navigation on Mac"
953         https://bugs.webkit.org/show_bug.cgi?id=193716
954         https://trac.webkit.org/changeset/240343
955
956 2019-01-23  Chris Dumez  <cdumez@apple.com>
957
958         Deprecate API to limit the maximum number of WebProcesses
959         https://bugs.webkit.org/show_bug.cgi?id=193725
960         <rdar://problem/47464879>
961
962         Reviewed by Geoff Garen.
963
964         Deprecate API to limit the maximum number of WebProcesses and make it a no-op. It adds
965         complexity and is not safe (conflicts with PSON).
966
967         Add a new usesSingleWebProcess SPI to _WKProcessPoolConfiguration to be used by
968         Minibrowser / Safari in order to disable process per tab (can be useful for debugging).
969         Note that enabling the single WebProcess mode will disable PSON and process prewarming.
970
971         * UIProcess/API/APIProcessPoolConfiguration.cpp:
972         (API::ProcessPoolConfiguration::createWithLegacyOptions):
973         (API::ProcessPoolConfiguration::copy):
974         * UIProcess/API/APIProcessPoolConfiguration.h:
975         * UIProcess/API/C/WKContext.cpp:
976         (WKContextSetMaximumNumberOfProcesses):
977         (WKContextGetMaximumNumberOfProcesses):
978         * UIProcess/API/C/WKContext.h:
979         * UIProcess/API/Cocoa/WKProcessPool.mm:
980         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
981         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
982         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
983         (-[_WKProcessPoolConfiguration maximumProcessCount]):
984         (-[_WKProcessPoolConfiguration setMaximumProcessCount:]):
985         (-[_WKProcessPoolConfiguration usesSingleWebProcess]):
986         (-[_WKProcessPoolConfiguration setUsesSingleWebProcess:]):
987         (-[_WKProcessPoolConfiguration description]):
988         * UIProcess/API/glib/WebKitWebContext.cpp:
989         (webkitWebContextConstructed):
990         (webkit_web_context_set_process_model):
991         (webkit_web_context_set_web_process_count_limit):
992         * UIProcess/WebProcessPool.cpp:
993         (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit):
994         (WebKit::WebProcessPool::didReachGoodTimeToPrewarm):
995         (WebKit::WebProcessPool::processForNavigationInternal):
996         * UIProcess/WebProcessPool.h:
997
998 2019-01-23  Brent Fulgham  <bfulgham@apple.com>
999
1000         Switch NetworkStorageSession portions of ResourceLoadStatistics to Async message passing style
1001         https://bugs.webkit.org/show_bug.cgi?id=193659
1002         <rdar://problem/47433290>
1003
1004         Reviewed by Alex Christensen.
1005
1006         Change the implementations of ResourceLoadStatistics code in NetworkStorageSession to use the
1007         'sendWithAsyncReply' so that more of the code is autogenerated. This should make test runs more
1008         consistent, and should reduce the possibility of bookkeeping errors in the message handling
1009         implementations.
1010
1011         Fix the implementation of NetworkProcessProxy::clearCallbackStates to remove the manually constructed
1012         (and incomplete) message callbacks. These errors are a big reason to move to the auto-generated
1013         'sendWithAsyncReply' implementatoin. Ditto for NetworkProcessProxy::didClose.
1014
1015         This patch also moves an initializaton call (WebsiteDataStore::didCreateNetworkProcess) from
1016         'ensureNetworkProcess' to 'processDidFinishLaunching'. In current code, the call happens before
1017         a connection is established to the network process, causing initialization messages to get dropped
1018         leading to test system flakiness.
1019
1020         Finally: The WK API test code was updated to ensure that completion handlers are always called, even
1021         when built without ENABLE_RESOURCE_LOAD_STATISTICS defined.
1022
1023         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
1024         * NetworkProcess/Classifier/ShouldGrandfatherStatistics.h: Added.
1025         * NetworkProcess/Classifier/StorageAccessStatus.h: Added.
1026         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
1027         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
1028         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
1029         * NetworkProcess/NetworkProcess.cpp:
1030         (WebKit::NetworkProcess::updatePrevalentDomainsToBlockCookiesFor):
1031         (WebKit::NetworkProcess::setAgeCapForClientSideCookies):
1032         (WebKit::NetworkProcess::scheduleClearInMemoryAndPersistent):
1033         (WebKit::NetworkProcess::hasStorageAccessForFrame):
1034         (WebKit::NetworkProcess::requestStorageAccess):
1035         (WebKit::NetworkProcess::grantStorageAccess):
1036         (WebKit::NetworkProcess::removeAllStorageAccess):
1037         (WebKit::NetworkProcess::setCacheMaxAgeCapForPrevalentResources):
1038         (WebKit::NetworkProcess::resetCacheMaxAgeCapForPrevalentResources):
1039         (WebKit::NetworkProcess::deleteWebsiteData):
1040         * NetworkProcess/NetworkProcess.h:
1041         * NetworkProcess/NetworkProcess.messages.in:
1042         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1043         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore):
1044         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
1045         (WKWebsiteDataStoreStatisticsResetToConsistentState):
1046         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1047         * UIProcess/Network/NetworkProcessProxy.cpp:
1048         (WebKit::NetworkProcessProxy::clearCallbackStates): Remove incomplete clean-up code that
1049         is now autogenerated.
1050         (WebKit::NetworkProcessProxy::didClose): Ditto.
1051         (WebKit::NetworkProcessProxy::updatePrevalentDomainsToBlockCookiesFor):
1052         (WebKit::NetworkProcessProxy::scheduleClearInMemoryAndPersistent):
1053         (WebKit::NetworkProcessProxy::setAgeCapForClientSideCookies):
1054         (WebKit::NetworkProcessProxy::hasStorageAccessForFrame):
1055         (WebKit::NetworkProcessProxy::requestStorageAccess):
1056         (WebKit::NetworkProcessProxy::grantStorageAccess):
1057         (WebKit::NetworkProcessProxy::removeAllStorageAccess):
1058         (WebKit::NetworkProcessProxy::setCacheMaxAgeCapForPrevalentResources):
1059         (WebKit::NetworkProcessProxy::setCacheMaxAgeCap):
1060         (WebKit::NetworkProcessProxy::resetCacheMaxAgeCapForPrevalentResources):
1061         (WebKit::NetworkProcessProxy::didUpdateBlockCookies): Deleted.
1062         (WebKit::NetworkProcessProxy::didSetAgeCapForClientSideCookies): Deleted.
1063         (WebKit::NetworkProcessProxy::didUpdateRuntimeSettings): Deleted.
1064         (WebKit::NetworkProcessProxy::storageAccessRequestResult): Deleted.
1065         (WebKit::NetworkProcessProxy::storageAccessOperationResult): Deleted.
1066         (WebKit::NetworkProcessProxy::didRemoveAllStorageAccess): Deleted.
1067         (WebKit::NetworkProcessProxy::didSetCacheMaxAgeCapForPrevalentResources): Deleted.
1068         * UIProcess/Network/NetworkProcessProxy.h:
1069         * UIProcess/Network/NetworkProcessProxy.messages.in:
1070         * UIProcess/WebPageProxy.cpp:
1071         * UIProcess/WebProcessPool.cpp:
1072         (WebKit::WebProcessPool::ensureNetworkProcess): Move WebsiteDataStore 'didCreateNetworkProcess'
1073         to 'processDidFinishLaunching'. Currently the call happens before a connection is established,
1074         causing initialization messages to get dropped.
1075         (WebKit::WebProcessPool::processDidFinishLaunching): Ditto.
1076         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1077         (WebKit::WebsiteDataStore::removeData):
1078         (WebKit::WebsiteDataStore::setMaxStatisticsEntries):
1079         (WebKit::WebsiteDataStore::setPruneEntriesDownTo):
1080         (WebKit::WebsiteDataStore::setGrandfatheringTime):
1081         (WebKit::WebsiteDataStore::setCacheMaxAgeCap):
1082         (WebKit::WebsiteDataStore::setMinimumTimeBetweenDataRecordsRemoval):
1083         (WebKit::WebsiteDataStore::setPrevalentResource):
1084         (WebKit::WebsiteDataStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
1085         (WebKit::WebsiteDataStore::scheduleClearInMemoryAndPersistent):
1086         (WebKit::WebsiteDataStore::setAgeCapForClientSideCookies):
1087         (WebKit::WebsiteDataStore::setNotifyPagesWhenDataRecordsWereScanned):
1088         (WebKit::WebsiteDataStore::setNotifyPagesWhenTelemetryWasCaptured):
1089         (WebKit::WebsiteDataStore::setTimeToLiveUserInteraction):
1090         (WebKit::WebsiteDataStore::setCacheMaxAgeCapForPrevalentResources):
1091         (WebKit::WebsiteDataStore::setResourceLoadStatisticsDebugMode):
1092         * UIProcess/WebsiteData/WebsiteDataStore.h:
1093         * WebKit.xcodeproj/project.pbxproj:
1094
1095 2019-01-23  Sihui Liu  <sihui_liu@apple.com>
1096
1097         Clean up IndexedDB files between tests
1098         https://bugs.webkit.org/show_bug.cgi?id=192796
1099         <rdar://problem/46824999>
1100
1101         Reviewed by Geoffrey Garen.
1102
1103         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1104         (WKWebsiteDataStoreRemoveAllIndexedDatabases):
1105         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
1106
1107 2019-01-23  Wenson Hsieh  <wenson_hsieh@apple.com>
1108
1109         [iOS] fast/events/touch/ios/hover-when-style-change-is-async.html times out
1110         https://bugs.webkit.org/show_bug.cgi?id=193182
1111         <rdar://problem/47452154>
1112
1113         Reviewed by Tim Horton.
1114
1115         Fix an existing bug where blurring an element doesn't always un-suppress text interactions.
1116
1117         * UIProcess/ios/WKContentViewInteraction.mm:
1118         (-[WKContentView _elementDidBlur]):
1119
1120 2019-01-23  Michael Catanzaro  <mcatanzaro@igalia.com>
1121
1122         Minor improvements to NetworkProcess
1123         https://bugs.webkit.org/show_bug.cgi?id=193708
1124
1125         Reviewed by Alex Christensen.
1126
1127         * NetworkProcess/NetworkProcess.cpp:
1128         (WebKit::NetworkProcess::switchToNewTestingSession): Fix a spelling error.
1129         (WebKit::NetworkProcess::ensureSession): Add useful assertion.
1130         (WebKit::NetworkProcess::defaultStorageSession const): Split into platform functions.
1131         (WebKit::NetworkProcess::destroySession): Add useful assertion.
1132         * NetworkProcess/NetworkProcess.h:
1133         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1134         (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
1135         * NetworkProcess/curl/NetworkProcessCurl.cpp:
1136         (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
1137         * NetworkProcess/soup/NetworkProcessSoup.cpp:
1138         (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
1139
1140 2019-01-23  Daniel Bates  <dabates@apple.com>
1141
1142         Fix the Apple Internal build. See <rdar://problem/47486758>.
1143
1144         * UIProcess/ios/WKContentViewInteraction.mm:
1145         (-[WKContentView dropInteraction:previewForDroppingItem:withDefault:]):
1146
1147 2019-01-23  Per Arne Vollan  <pvollan@apple.com>
1148
1149         [macOS] Sandbox fails to compile
1150         https://bugs.webkit.org/show_bug.cgi?id=193727
1151         <rdar://problem/47476903>
1152
1153         Reviewed by Brent Fulgham.
1154
1155         Use '(with send-signal SIGKILL)' instead of '(with termination)'.
1156
1157         * WebProcess/com.apple.WebProcess.sb.in:
1158
1159 2019-01-23  Brent Fulgham  <bfulgham@apple.com>
1160
1161         REGRESSION (r240243): CrashTracer: WebKitTestRunnerApp at com.apple.WebKit: WebKit::WebResourceLoadStatisticsStore::sendDiagnosticMessageWithValue const + 32
1162         https://bugs.webkit.org/show_bug.cgi?id=193723
1163         <rdar://problem/47476802>
1164
1165         Reviewed by David Kilzer.
1166
1167         The new code added in r240243 could attempt to submit telemetry after the relevant
1168         WebResourceLoadStatisticsStore was destroyed. We should guard against this possibility.
1169
1170         * NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.cpp:
1171         (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit):
1172
1173 2019-01-23  Antti Koivisto  <antti@apple.com>
1174
1175         [PSON] Flash on back navigation on Mac
1176         https://bugs.webkit.org/show_bug.cgi?id=193716
1177         <rdar://problem/47148458>
1178
1179         Reviewed by Chris Dumez.
1180
1181         We close the page immediately if we fail to suspend. Layers disappear and we get a flash.
1182
1183         * UIProcess/SuspendedPageProxy.cpp:
1184         (WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
1185
1186         Remove the suspended page (so closing it on web process side) if the suspension fails.
1187         Skip this if we are using web process side compositing on Mac.
1188
1189         * UIProcess/WebPageProxy.cpp:
1190         (WebKit::WebPageProxy::enterAcceleratedCompositingMode):
1191
1192         On Mac, remove failed SuspendedPageProxy when entering compositing mode. At this point we don't need it to keep layers alive.
1193
1194         * UIProcess/WebProcessPool.cpp:
1195         (WebKit::WebProcessPool::removeFailedSuspendedPagesForPage):
1196         * UIProcess/WebProcessPool.h:
1197         * WebProcess/WebPage/WebPage.cpp:
1198         (WebKit::WebPage::suspendForProcessSwap):
1199
1200         Don't close the page on suspension failure.
1201
1202 2019-01-23  Wenson Hsieh  <wenson_hsieh@apple.com>
1203
1204         Introduce UndoStep::label() and adopt it in WebKitLegacy and WebKit
1205         https://bugs.webkit.org/show_bug.cgi?id=193706
1206         <rdar://problem/44807048>
1207
1208         Reviewed by Ryosuke Niwa.
1209
1210         * UIProcess/Cocoa/WebViewImpl.mm:
1211         (WebKit::WebViewImpl::registerEditCommand):
1212         * UIProcess/WebEditCommandProxy.cpp:
1213         (WebKit::WebEditCommandProxy::WebEditCommandProxy):
1214         * UIProcess/WebEditCommandProxy.h:
1215
1216         Drive-by tweak: make WebEditCommandProxy's backpointer to its WebPageProxy a WeakPtr instead of a raw pointer.
1217         Additionally, call clear() instead of setting m_page to 0 upon invalidation. Also, turn the WebPageProxy*
1218         argument into a WebPageProxy&, since the WebPageProxy must exist when it creates a new WebEditCommandProxy.
1219
1220         (WebKit::WebEditCommandProxy::create):
1221         (WebKit::WebEditCommandProxy::label const):
1222         (WebKit::WebEditCommandProxy::invalidate):
1223         (WebKit::WebEditCommandProxy::editAction const): Deleted.
1224
1225         Adjust UI-side logic to just handle the undo/redo label, rather than map the edit action to a localized string.
1226
1227         * UIProcess/WebPageProxy.cpp:
1228         (WebKit::WebPageProxy::registerEditCommandForUndo):
1229         (WebKit::WebPageProxy::resetState):
1230
1231         Tweak this to use std::exchange instead of copying all the WebEditCommandProxy RefPtrs into a separate Vector
1232         and then iterating over the Vector.
1233
1234         * UIProcess/WebPageProxy.h:
1235         * UIProcess/WebPageProxy.messages.in:
1236
1237         Adjust this so that we only send the undo/redo label over IPC, rather than the edit action type.
1238
1239         * UIProcess/ios/PageClientImplIOS.mm:
1240         (WebKit::PageClientImpl::registerEditCommand):
1241         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
1242         (WebKit::WebEditorClient::registerUndoStep):
1243
1244 2019-01-23  Michael Catanzaro  <mcatanzaro@igalia.com>
1245
1246         [SOUP] Remove libsoup cruft from WebProcess
1247         https://bugs.webkit.org/show_bug.cgi?id=193710
1248
1249         Reviewed by Carlos Garcia Campos.
1250
1251         SoupNetworkSession is no longer accessible from the web process because it's owned
1252         (indirectly) by NetworkProcess after r240292. It doesn't make sense to have any libsoup
1253         code under WebProcess anymore. The current libsoup code consists of (a) unused stuff to be
1254         removed, (b) stuff unrelated to libsoup, which should move to a WebProcessGLib.cpp, and (c)
1255         WebKitSoupRequestInputStream, which is only used by NetworkProcess and should move there
1256
1257         * NetworkProcess/soup/WebKitSoupRequestInputStream.cpp: Renamed from Source/WebKit/WebProcess/soup/WebKitSoupRequestInputStream.cpp.
1258         (AsyncReadData::AsyncReadData):
1259         (webkitSoupRequestInputStreamReadAsyncResultComplete):
1260         (webkitSoupRequestInputStreamPendingReadAsyncComplete):
1261         (webkitSoupRequestInputStreamHasDataToRead):
1262         (webkitSoupRequestInputStreamIsWaitingForData):
1263         (webkitSoupRequestInputStreamReadAsync):
1264         (webkitSoupRequestInputStreamReadFinish):
1265         (webkitSoupRequestInputStreamFinalize):
1266         (webkit_soup_request_input_stream_init):
1267         (webkit_soup_request_input_stream_class_init):
1268         (webkitSoupRequestInputStreamNew):
1269         (webkitSoupRequestInputStreamAddData):
1270         (webkitSoupRequestInputStreamDidFailWithError):
1271         (webkitSoupRequestInputStreamFinished):
1272         * NetworkProcess/soup/WebKitSoupRequestInputStream.h: Renamed from Source/WebKit/WebProcess/soup/WebKitSoupRequestInputStream.h.
1273         * SourcesGTK.txt:
1274         * SourcesWPE.txt:
1275         * UIProcess/soup/WebProcessPoolSoup.cpp:
1276         (WebKit::WebProcessPool::setNetworkProxySettings): Don't send message to web processes.
1277         * WebProcess/WebProcess.h:
1278         * WebProcess/WebProcess.messages.in:
1279         * WebProcess/glib/WebProcessGLib.cpp: Renamed from Source/WebKit/WebProcess/soup/WebProcessSoup.cpp.
1280         (WebKit::WebProcess::platformSetCacheModel):
1281         (WebKit::WebProcess::platformInitializeWebProcess):
1282         (WebKit::WebProcess::platformTerminate):
1283
1284 2019-01-23  Michael Catanzaro  <mcatanzaro@igalia.com>
1285
1286         [SOUP] Clean up NetworkStorageSession
1287         https://bugs.webkit.org/show_bug.cgi?id=193707
1288
1289         Reviewed by Carlos Garcia Campos.
1290
1291         Restore an important call to clearSoupNetworkSession that was removed in r240292. Also,
1292         adapt to NetworkStorageSessions API changes.
1293
1294         * NetworkProcess/CustomProtocols/soup/LegacyCustomProtocolManagerSoup.cpp:
1295         (WebKit::LegacyCustomProtocolManager::registerScheme):
1296         * NetworkProcess/soup/NetworkProcessMainSoup.cpp:
1297         * NetworkProcess/soup/NetworkProcessSoup.cpp:
1298         (WebKit::NetworkProcess::userPreferredLanguagesChanged):
1299         (WebKit::NetworkProcess::setNetworkProxySettings):
1300         * NetworkProcess/soup/NetworkSessionSoup.cpp:
1301         (WebKit::NetworkSessionSoup::soupSession const):
1302
1303 2019-01-23  Philippe Normand  <pnormand@igalia.com>
1304
1305         [GTK] Crash when browsing inspector:// uri without port set
1306         https://bugs.webkit.org/show_bug.cgi?id=193721
1307
1308         Reviewed by Michael Catanzaro.
1309
1310         * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
1311         (WebKit::RemoteInspectorProtocolHandler::handleRequest): Return
1312         back to caller after setting the error, if no port was provided
1313         along with the inspector URL.
1314
1315 2019-01-23  David Kilzer  <ddkilzer@apple.com>
1316
1317         Switch remaining CoreMedia soft-linking in WebKit over to CoreMediaSoftLink.{cpp,h}
1318         <https://webkit.org/b/193694>
1319         <rdar://problem/47464025>
1320
1321         Reviewed by Tim Horton.
1322
1323         * Shared/ios/WebIconUtilities.mm:
1324         - Switch to using CoreMediaSoftLink.{h,mm} in PAL.
1325
1326 2019-01-22  Chris Dumez  <cdumez@apple.com>
1327
1328         Regression(r240178) Some API tests are crashing
1329         https://bugs.webkit.org/show_bug.cgi?id=193680
1330
1331         Reviewed by Alex Christensen.
1332
1333         r240178 made sure that userScripts / scriptMessageHandlers / contentExtensions are always
1334         properly populated in the WebPageCreationParameters. This was needed in case we need to
1335         reconstruct the WebUserContentController on the WebProcess side. However, this caused a
1336         regression in the case we reuse a process where the WebUserContentController still exists
1337         (because it was kept alive, e.g. by the WebPageGroup). In that case, we would add duplicate
1338         entries to the existing WebUserContentController instance because its "add" methods did not
1339         have duplicate checks. To address the issue, this patch adds duplicate checks to the
1340         WebUserContentController "add" methods.
1341
1342         * WebProcess/UserContent/WebUserContentController.cpp:
1343         (WebKit::WebUserContentController::addUserScriptMessageHandlerInternal):
1344         (WebKit::WebUserContentController::removeUserScriptMessageHandlerInternal):
1345         (WebKit::WebUserContentController::addUserScriptInternal):
1346         (WebKit::WebUserContentController::removeUserScriptInternal):
1347         (WebKit::WebUserContentController::addUserStyleSheetInternal):
1348         (WebKit::WebUserContentController::removeUserStyleSheetInternal):
1349         (WebKit::WebUserContentController::forEachUserMessageHandler const):
1350         * WebProcess/UserContent/WebUserContentController.h:
1351
1352 2019-01-22  Michael Catanzaro  <mcatanzaro@igalia.com>
1353
1354         Unreviewed attempt to fix GTK/WPE bots
1355         https://bugs.webkit.org/show_bug.cgi?id=193580
1356         <rdar://problem/47457742>
1357
1358         Doesn't make sense to clear the storage session right after creating it. This should fix
1359         network process crash on startup under G_DEBUG=fatal-criticals due to the storage session
1360         not having a cookie jar.
1361
1362         * NetworkProcess/NetworkProcess.cpp:
1363         (WebKit::NetworkProcess::NetworkProcess):
1364
1365 2019-01-22  Megan Gardner  <megan_gardner@apple.com>
1366
1367         Cancel Web Touches Properly so that long presses on YouTube links do not incorrectly trigger a load
1368         https://bugs.webkit.org/show_bug.cgi?id=193687
1369         <rdar://problem/47056717>
1370
1371         Reviewed by Tim Horton.
1372
1373         Cancel web gestures when a long press is recognized.
1374
1375         * Platform/spi/ios/UIKitSPI.h:
1376         * UIProcess/ios/WKContentViewInteraction.mm:
1377         (-[WKContentView _cancelWebGestureRecognizer]):
1378         (-[WKContentView _longPressRecognized:]):
1379
1380 2019-01-22  Alex Christensen  <achristensen@webkit.org>
1381
1382         Fix an internal build failure after r240292
1383         https://bugs.webkit.org/show_bug.cgi?id=193580
1384
1385         Rubber-stamped by Wenson Hsieh.
1386
1387         * SourcesCocoa.txt:
1388         * UIProcess/mac/WebContextMenuProxyMac.mm:
1389         (-[WKMenuTarget forwardContextMenuAction:]):
1390         * WebKit.xcodeproj/project.pbxproj:
1391         It was apparently unclear to the compiler sometimes which "state" selector to use, and this apparently mattered.
1392         Tell the compiler to use the NSMenuItem selector, but at runtime it doesn't matter.
1393
1394 2019-01-22  Michael Catanzaro  <mcatanzaro@igalia.com>
1395
1396         Unreviewed, fix -Wunused-but-set-variable warning
1397         https://bugs.webkit.org/show_bug.cgi?id=193660
1398         <rdar://problem/47433602>
1399
1400         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1401         (WebKit::WebsiteDataStore::removeData):
1402
1403 2019-01-22  Michael Catanzaro  <mcatanzaro@igalia.com>
1404
1405         Unreviewed, further build fixes after r240292
1406         https://bugs.webkit.org/show_bug.cgi?id=193580
1407         <rdar://problem/47457742>
1408
1409         Oops.
1410
1411         * NetworkProcess/NetworkProcess.cpp:
1412         (WebKit::NetworkProcess::defaultStorageSession const):
1413
1414 2019-01-22  Michael Catanzaro  <mcatanzaro@igalia.com>
1415
1416         Unreviewed, further build fixes after r240292
1417         https://bugs.webkit.org/show_bug.cgi?id=193580
1418         <rdar://problem/47457742>
1419
1420         This builds for libsoup. Doesn't work, but at least builds.
1421
1422         Also, speculative fixes for curl.
1423
1424         * NetworkProcess/NetworkProcess.cpp:
1425         (WebKit::NetworkProcess::defaultStorageSession const):
1426
1427 2019-01-22  Michael Catanzaro  <mcatanzaro@igalia.com>
1428
1429         Unreviewed, further build fixes after r240292
1430         https://bugs.webkit.org/show_bug.cgi?id=193580
1431         <rdar://problem/47457742>
1432
1433         Still not working yet.
1434
1435         * NetworkProcess/NetworkProcess.cpp:
1436         (WebKit::NetworkProcess::NetworkProcess):
1437         * UIProcess/API/APIHTTPCookieStore.h:
1438
1439 2019-01-22  Antti Koivisto  <antti@apple.com>
1440
1441         [iOS] Flash when swiping back to Google search result page
1442         https://bugs.webkit.org/show_bug.cgi?id=193668
1443         <rdar://problem/47071684>
1444
1445         Reviewed by Simon Fraser.
1446
1447         If the google page is scrolled, there is sometimes a short flash.
1448
1449         When restoring the page state we also restore exposedContentRect which is used to determine
1450         which part of the page to create layers for. Scroll position is restored by the UI process
1451         later so we rely on this to get the right layers for the initial view update.
1452
1453         A viewport configuration update may sometimes trample over the restored exposedContentRect,
1454         moving it to top left. In this case the initial layer tree unfreeze commit may not have
1455         layers to cover the actual visible view position.
1456
1457         * WebProcess/WebPage/WebPage.cpp:
1458         (WebKit::WebPage::didCommitLoad):
1459         * WebProcess/WebPage/WebPage.h:
1460         * WebProcess/WebPage/ios/WebPageIOS.mm:
1461         (WebKit::WebPage::restorePageState):
1462
1463         Set a bit to indicate we have already restored the exposedContentRect.
1464
1465         (WebKit::WebPage::viewportConfigurationChanged):
1466
1467         Only reset exposedContentRect if wasn't already set by restorePageState.
1468
1469 2019-01-22  Alex Christensen  <achristensen@webkit.org>
1470
1471         Fix more builds.
1472
1473         * SourcesCocoa.txt:
1474         * WebKit.xcodeproj/project.pbxproj:
1475
1476 2019-01-22  Michael Catanzaro  <mcatanzaro@igalia.com>
1477
1478         Another build fix after r240292
1479         https://bugs.webkit.org/show_bug.cgi?id=193580
1480         <rdar://problem/47457742>
1481
1482         Unreviewed, still not enough to fix soup builds, but closer.
1483
1484         * UIProcess/API/APIHTTPCookieStore.h:
1485
1486 2019-01-22  Alex Christensen  <achristensen@webkit.org>
1487
1488         Fix some builds after r240292
1489         https://bugs.webkit.org/show_bug.cgi?id=193580
1490
1491         * NetworkProcess/NetworkProcess.cpp:
1492         (WebKit::NetworkProcess::switchToNewTestingSession):
1493         * NetworkProcess/cache/NetworkCache.cpp:
1494         (WebKit::NetworkCache::Cache::retrieve):
1495
1496 2019-01-22  Brian Burg  <bburg@apple.com>
1497
1498         Automation.computeElementLayout should return visual viewport-aware coordinates
1499         https://bugs.webkit.org/show_bug.cgi?id=193598
1500         <rdar://problem/35325644>
1501
1502         Unreviewed, restore a mistakenly-deleted line whose absence causes hangs.
1503
1504         * Shared/CoordinateSystem.h:
1505
1506 2019-01-22  Alex Christensen  <achristensen@webkit.org>
1507
1508         Move NetworkStorageSession ownership to NetworkProcess
1509         https://bugs.webkit.org/show_bug.cgi?id=193580
1510
1511         Reviewed by Geoff Garen.
1512
1513         * NetworkProcess/Cookies/WebCookieManager.cpp:
1514         (WebKit::WebCookieManager::WebCookieManager):
1515         (WebKit::WebCookieManager::getHostnamesWithCookies):
1516         (WebKit::WebCookieManager::deleteCookiesForHostname):
1517         (WebKit::WebCookieManager::deleteAllCookies):
1518         (WebKit::WebCookieManager::deleteCookie):
1519         (WebKit::WebCookieManager::deleteAllCookiesModifiedSince):
1520         (WebKit::WebCookieManager::getAllCookies):
1521         (WebKit::WebCookieManager::getCookies):
1522         (WebKit::WebCookieManager::setCookie):
1523         (WebKit::WebCookieManager::setCookies):
1524         (WebKit::WebCookieManager::startObservingCookieChanges):
1525         (WebKit::WebCookieManager::stopObservingCookieChanges):
1526         * NetworkProcess/Cookies/WebCookieManager.h:
1527         * NetworkProcess/Cookies/mac/WebCookieManagerMac.mm:
1528         (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
1529         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1530         (WebKit::storageSession):
1531         (WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
1532         (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
1533         (WebKit::NetworkConnectionToWebProcess::cookiesEnabled):
1534         (WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue):
1535         (WebKit::NetworkConnectionToWebProcess::getRawCookies):
1536         (WebKit::NetworkConnectionToWebProcess::deleteCookie):
1537         (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForFrame):
1538         (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForAllFramesOnPage):
1539         * NetworkProcess/NetworkProcess.cpp:
1540         (WebKit::NetworkProcess::initializeNetworkProcess):
1541         (WebKit::NetworkProcess::clearCachedCredentials):
1542         (WebKit::NetworkProcess::switchToNewTestingSession):
1543         (WebKit::NetworkProcess::ensureSession):
1544         (WebKit::NetworkProcess::storageSession const):
1545         (WebKit::NetworkProcess::defaultStorageSession const):
1546         (WebKit::NetworkProcess::forEachNetworkStorageSession):
1547         (WebKit::NetworkProcess::destroySession):
1548         (WebKit::NetworkProcess::updatePrevalentDomainsToBlockCookiesFor):
1549         (WebKit::NetworkProcess::setAgeCapForClientSideCookies):
1550         (WebKit::NetworkProcess::hasStorageAccessForFrame):
1551         (WebKit::NetworkProcess::getAllStorageAccessEntries):
1552         (WebKit::NetworkProcess::grantStorageAccess):
1553         (WebKit::NetworkProcess::removeAllStorageAccess):
1554         (WebKit::NetworkProcess::removePrevalentDomains):
1555         (WebKit::NetworkProcess::setCacheMaxAgeCapForPrevalentResources):
1556         (WebKit::NetworkProcess::resetCacheMaxAgeCapForPrevalentResources):
1557         (WebKit::NetworkProcess::fetchWebsiteData):
1558         (WebKit::NetworkProcess::deleteWebsiteData):
1559         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
1560         * NetworkProcess/NetworkProcess.h:
1561         * NetworkProcess/NetworkResourceLoader.cpp:
1562         (WebKit::NetworkResourceLoader::validateCacheEntryForMaxAgeCapValidation):
1563         (WebKit::NetworkResourceLoader::logCookieInformation const):
1564         * NetworkProcess/NetworkSession.cpp:
1565         (WebKit::NetworkSession::networkStorageSession const):
1566         * NetworkProcess/NetworkStorageSessionProvider.h:
1567         * NetworkProcess/cache/NetworkCache.cpp:
1568         (WebKit::NetworkCache::makeUseDecision):
1569         (WebKit::NetworkCache::Cache::retrieve):
1570         (WebKit::NetworkCache::Cache::makeEntry):
1571         (WebKit::NetworkCache::Cache::makeRedirectEntry):
1572         (WebKit::NetworkCache::Cache::update):
1573         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
1574         (WebKit::NetworkCache::SpeculativeLoad::willSendRedirectedRequest):
1575         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1576         (WebKit::NetworkProcess::platformSyncAllCookies):
1577         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1578         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
1579         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
1580         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
1581         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
1582         * NetworkProcess/mac/RemoteNetworkingContext.mm:
1583         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
1584         * SourcesCocoa.txt:
1585         * UIProcess/API/APIHTTPCookieStore.cpp:
1586         (API::HTTPCookieStore::~HTTPCookieStore):
1587         (API::HTTPCookieStore::cookies):
1588         (API::HTTPCookieStore::setCookie):
1589         (API::HTTPCookieStore::deleteCookie):
1590         (API::HTTPCookieStore::registerObserver):
1591         (API::HTTPCookieStore::unregisterObserver):
1592         (API::HTTPCookieStore::registerForNewProcessPoolNotifications):
1593         (API::HTTPCookieStore::flushDefaultUIProcessCookieStore):
1594         (API::HTTPCookieStore::getAllDefaultUIProcessCookieStoreCookies):
1595         (API::HTTPCookieStore::setCookieInDefaultUIProcessCookieStore):
1596         (API::HTTPCookieStore::deleteCookieFromDefaultUIProcessCookieStore):
1597         (API::HTTPCookieStore::startObservingChangesToDefaultUIProcessCookieStore):
1598         (API::HTTPCookieStore::stopObservingChangesToDefaultUIProcessCookieStore):
1599         * UIProcess/API/APIHTTPCookieStore.h:
1600         * UIProcess/API/Cocoa/APIHTTPCookieStoreCocoa.mm: Added.
1601         (API::HTTPCookieStore::flushDefaultUIProcessCookieStore):
1602         (API::HTTPCookieStore::getAllDefaultUIProcessCookieStoreCookies):
1603         (API::HTTPCookieStore::setCookieInDefaultUIProcessCookieStore):
1604         (API::HTTPCookieStore::deleteCookieFromDefaultUIProcessCookieStore):
1605         (API::HTTPCookieStore::startObservingChangesToDefaultUIProcessCookieStore):
1606         (API::HTTPCookieStore::stopObservingChangesToDefaultUIProcessCookieStore):
1607         * UIProcess/WebProcessPool.cpp:
1608         (WebKit::WebProcessPool::clearCachedCredentials):
1609         * WebKit.xcodeproj/project.pbxproj:
1610         * WebProcess/Plugins/PluginView.cpp:
1611         (WebKit::PluginView::getAuthenticationInfo):
1612         * WebProcess/WebProcess.cpp:
1613         (WebKit::WebProcess::deleteWebsiteData):
1614         (WebKit::WebProcess::clearCachedCredentials): Deleted.
1615         * WebProcess/WebProcess.h:
1616         * WebProcess/WebProcess.messages.in:
1617
1618 2019-01-22  Per Arne Vollan  <pvollan@apple.com>
1619
1620         [macOS] Adjust logging policy in WebKit's sandbox
1621         https://bugs.webkit.org/show_bug.cgi?id=193454
1622
1623         Reviewed by Brent Fulgham.
1624
1625         Add a rule to initially deny all calls, since the default is to allow every call.
1626         Later rules allow syscalls that we determined are needed for proper WebKit function.
1627         This reduces the API surface available to attackers.
1628
1629         * WebProcess/com.apple.WebProcess.sb.in:
1630
1631 2019-01-22  Daniel Bates  <dabates@apple.com>
1632
1633         [iOS] WebKit should handle shift state changes when using the software keyboard
1634         https://bugs.webkit.org/show_bug.cgi?id=191475
1635         <rdar://problem/45949246>
1636
1637         Reviewed by Brent Fulgham.
1638
1639         Implement UIKit SPI to be notified of shift state changes to the software keyboard
1640         and dispatch a synthetic keydown or keyup event for either the Shift key or Caps Lock
1641         key.
1642
1643         A side benefit of this change is that we now show and hide the caps lock indicator
1644         in a focused password field when caps lock is enabled or disabled using the software
1645         keyboard, respectively.
1646
1647         * Platform/spi/ios/UIKitSPI.h: Expose more SPI.
1648         * SourcesCocoa.txt:
1649         * UIProcess/ios/WKContentViewInteraction.mm:
1650         (-[WKContentView modifierFlagsDidChangeFrom:to:]): Create a synthetic flags changed
1651         web event based on the state change and dispatch it.
1652         (-[WKContentView _didHandleKeyEvent:eventWasHandled:]): Early return if the event
1653         was a synethic flags change event so that we do not notify UIKit about this event
1654         as it does not know anything about such synthetic events.
1655         * UIProcess/ios/WKSyntheticFlagsChangedWebEvent.h: Added.
1656         * UIProcess/ios/WKSyntheticFlagsChangedWebEvent.mm: Added.
1657         (-[WKSyntheticFlagsChangedWebEvent initWithKeyCode:modifiers:keyDown:]):
1658         (-[WKSyntheticFlagsChangedWebEvent initWithCapsLockState:]):
1659         (-[WKSyntheticFlagsChangedWebEvent initWithShiftState:]):
1660         * WebKit.xcodeproj/project.pbxproj:
1661
1662 2019-01-22  Daniel Bates  <dabates@apple.com>
1663
1664         [iOS] Interpret text key commands on keydown and app key commands on keypress
1665         https://bugs.webkit.org/show_bug.cgi?id=192897
1666         <rdar://problem/46857378>
1667
1668         Reviewed by Brent Fulgham.
1669
1670         Adopt SPI to interpret text key commands and app key commands independently on keydown (isCharEvent
1671         is false) and keypress (isCharEvent is true), respectively.
1672
1673         * Platform/spi/ios/UIKitSPI.h: Add more SPI.
1674         * UIProcess/ios/WKContentViewInteraction.mm:
1675         (-[WKContentView _interpretKeyEvent:isCharEvent:]):
1676
1677 2019-01-22  David Kilzer  <ddkilzer@apple.com>
1678
1679         C strings in ClientCertificateAuthenticationXPCConstants.h are duplicated
1680         <https://webkit.org/b/193607>
1681         <rdar://problem/47334613>
1682
1683         Reviewed by Alex Christensen.
1684
1685         * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:
1686         (WebKit::AuthenticationManager::initializeConnection):
1687         * UIProcess/Authentication/cocoa/AuthenticationChallengeProxyCocoa.mm:
1688         (WebKit::AuthenticationChallengeProxy::sendClientCertificateCredentialOverXpc):
1689         - Update name of constants.
1690
1691         * Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.cpp: Copied from Source/WebKit/Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.h.
1692         * Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.h:
1693         - Put constant values in a namespace, and move values to
1694           ClientCertificateAuthenticationXPCConstants.cpp.
1695
1696         * SourcesCocoa.txt:
1697         * UnifiedSources-input.xcfilelist:
1698         * WebKit.xcodeproj/project.pbxproj:
1699         - Add ClientCertificateAuthenticationXPCConstants.cpp.
1700
1701 2019-01-22  David Kilzer  <ddkilzer@apple.com>
1702
1703         Switch remaining QuickLook soft-linking in WebCore, WebKit over to QuickLookSoftLink.{cpp,h}
1704         <https://webkit.org/b/193654>
1705         <rdar://problem/47430290>
1706
1707         Reviewed by Alex Christensen.
1708
1709         - Moves QuickLookSoftLink.{h,mm} to PAL.
1710         - Adds soft-link to 3 classes to consolidate QuickLook.framework
1711           soft-linking.
1712         - Updates existing source to work with above changes.
1713
1714         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
1715         (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
1716         (WebKit::SystemPreviewController::start):
1717         * UIProcess/ios/WKSystemPreviewView.mm:
1718         (-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]):
1719         - Switch to using QuickLookSoftLink.{h,mm} in PAL.
1720
1721 2019-01-22  Oriol Brufau  <obrufau@igalia.com>
1722
1723         [css-logical] Implement flow-relative margin, padding and border shorthands
1724         https://bugs.webkit.org/show_bug.cgi?id=188697
1725
1726         Reviewed by Simon Fraser and Antti Koivisto.
1727
1728         Add a CSSLogicalEnabled runtime flag.
1729
1730         * Shared/WebPreferences.yaml:
1731
1732 2019-01-22  Frederic Wang  <fwang@igalia.com>
1733
1734         Enable CSSOMViewScrollingAPI
1735         https://bugs.webkit.org/show_bug.cgi?id=189472
1736
1737         Reviewed by Simon Fraser.
1738
1739         This patch enables the CSSOMViewScrollingAPI option by default. This feature has already been
1740         enabled in tests since r235855. Basically, this change fixes an old compatibility issue
1741         regarding which scrolling element correspond to the viewport in standard mode (WebKit uses
1742         document.body while Gecko/Edge/Chromium use document.documentElement as described in the
1743         CSSOM View specification). WebKit developers writing tests can use document.scrollingElement
1744         for that purpose, so that they work independently of whether the option is enabled.
1745
1746         [1] https://lists.webkit.org/pipermail/webkit-dev/2018-January/029857.html
1747
1748         * Shared/WebPreferences.yaml: Enable by default and remove "experimental" category in
1749         accordance with the new policy. Instead, keep an internal flag only for developers.
1750
1751 2019-01-21  Antti Koivisto  <antti@apple.com>
1752
1753         [iOS] Handle hit testing for subframes
1754         https://bugs.webkit.org/show_bug.cgi?id=192303
1755
1756         Reviewed by Frédéric Wang.
1757
1758         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1759         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
1760
1761         Only set delegatesScrolling for the main frame.
1762
1763 2019-01-21  Brent Fulgham  <bfulgham@apple.com>
1764
1765         Unreviewed test fix after r240243
1766         Nhttps://bugs.webkit.org/show_bug.cgi?id=193660
1767         <rdar://problem/47433602>
1768
1769         The new ResourceLoadStatistics section of 'removeData' was incrementing the
1770         pending callback count before deciding whether to send a message to delete
1771         data. This left the count out-of-balance leading to the operation never
1772         completing.
1773
1774         This patch also prevents sending a second message to the NetworkProcess
1775         requesting data be deleted if the message was already sent in an earlier
1776         section of the method (e.g., as typically happens when all website data
1777         is being deleted).
1778
1779         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1780         (WebKit::WebsiteDataStore::removeData):
1781
1782 2019-01-21  Brent Fulgham  <bfulgham@apple.com>
1783
1784         Implement message handlers for NetworkProcess-based ResourceLoadStatistics
1785         https://bugs.webkit.org/show_bug.cgi?id=193556
1786         <rdar://problem/47368501>
1787
1788         Reviewed by Alex Christensen.
1789
1790         This patch adds a number of sibling methods for tracking ResourceLoadStatistics when the
1791         observations are being handled in the NetworkProcess, rather than the UIProcess. The
1792         original versions of these methods will be removed as part of Bug 193303.
1793
1794         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
1795         (WebKit::ResourceLoadStatisticsMemoryStore::removeDataRecords):
1796         (WebKit::ResourceLoadStatisticsMemoryStore::processStatisticsAndDataRecords):
1797         (WebKit::ResourceLoadStatisticsMemoryStore::grandfatherExistingWebsiteData):
1798         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
1799         (WebKit::ResourceLoadStatisticsMemoryStore::store const):
1800         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
1801         (WebKit::WebResourceLoadStatisticsStore::setNotifyPagesWhenDataRecordsWereScanned):
1802         (WebKit::WebResourceLoadStatisticsStore::setNotifyPagesWhenTelemetryWasCaptured):
1803         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
1804         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResourceForDebugMode):
1805         (WebKit::WebResourceLoadStatisticsStore::scheduleStatisticsAndDataRecordsProcessing):
1806         (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
1807         (WebKit::WebResourceLoadStatisticsStore::callHasStorageAccessForFrameHandler):
1808         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
1809         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
1810         (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction):
1811         (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
1812         (WebKit::WebResourceLoadStatisticsStore::setLastSeen):
1813         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
1814         (WebKit::WebResourceLoadStatisticsStore::setVeryPrevalentResource):
1815         (WebKit::WebResourceLoadStatisticsStore::isPrevalentResource):
1816         (WebKit::WebResourceLoadStatisticsStore::isVeryPrevalentResource):
1817         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubresourceUnder):
1818         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubFrameUnder):
1819         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsRedirectingTo):
1820         (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
1821         (WebKit::WebResourceLoadStatisticsStore::setGrandfathered):
1822         (WebKit::WebResourceLoadStatisticsStore::isGrandfathered):
1823         (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin):
1824         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin):
1825         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo):
1826         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectFrom):
1827         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectTo):
1828         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectFrom):
1829         (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
1830         (WebKit::WebResourceLoadStatisticsStore::logTestingEvent):
1831         (WebKit::WebResourceLoadStatisticsStore::notifyResourceLoadStatisticsProcessed):
1832         (WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
1833         (WebKit::WebResourceLoadStatisticsStore::topPrivatelyControlledDomainsWithWebsiteData):
1834         (WebKit::WebResourceLoadStatisticsStore::sendDiagnosticMessageWithValue const):
1835         (WebKit::WebResourceLoadStatisticsStore::notifyPageStatisticsTelemetryFinished const):
1836         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
1837         * NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.cpp:
1838         (WebKit::submitTopList):
1839         (WebKit::submitTopLists):
1840         (WebKit::notifyPages):
1841         (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit):
1842         (WebKit::nonEphemeralWebPageProxy): Deleted.
1843         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1844         (WebKit::NetworkConnectionToWebProcess::logUserInteraction):
1845         * NetworkProcess/NetworkConnectionToWebProcess.h:
1846         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1847         * NetworkProcess/NetworkProcess.cpp:
1848         (WebKit::NetworkProcess::dumpResourceLoadStatistics):
1849         (WebKit::NetworkProcess::isGrandfathered):
1850         (WebKit::NetworkProcess::isPrevalentResource):
1851         (WebKit::NetworkProcess::isVeryPrevalentResource):
1852         (WebKit::NetworkProcess::setGrandfathered):
1853         (WebKit::NetworkProcess::setPrevalentResource):
1854         (WebKit::NetworkProcess::setPrevalentResourceForDebugMode):
1855         (WebKit::NetworkProcess::setVeryPrevalentResource):
1856         (WebKit::NetworkProcess::clearPrevalentResource):
1857         (WebKit::NetworkProcess::submitTelemetry):
1858         (WebKit::NetworkProcess::scheduleCookieBlockingUpdate):
1859         (WebKit::NetworkProcess::scheduleClearInMemoryAndPersistent):
1860         (WebKit::NetworkProcess::resetParametersToDefaultValues):
1861         (WebKit::NetworkProcess::scheduleStatisticsAndDataRecordsProcessing):
1862         (WebKit::NetworkProcess::setNotifyPagesWhenDataRecordsWereScanned):
1863         (WebKit::NetworkProcess::setNotifyPagesWhenTelemetryWasCaptured):
1864         (WebKit::NetworkProcess::setSubframeUnderTopFrameOrigin):
1865         (WebKit::NetworkProcess::isRegisteredAsRedirectingTo):
1866         (WebKit::NetworkProcess::isRegisteredAsSubFrameUnder):
1867         (WebKit::NetworkProcess::setSubresourceUnderTopFrameOrigin):
1868         (WebKit::NetworkProcess::setSubresourceUniqueRedirectTo):
1869         (WebKit::NetworkProcess::setSubresourceUniqueRedirectFrom):
1870         (WebKit::NetworkProcess::isRegisteredAsSubresourceUnder):
1871         (WebKit::NetworkProcess::setTopFrameUniqueRedirectTo):
1872         (WebKit::NetworkProcess::setTopFrameUniqueRedirectFrom):
1873         (WebKit::NetworkProcess::setLastSeen):
1874         (WebKit::NetworkProcess::hasStorageAccess):
1875         (WebKit::NetworkProcess::requestStorageAccess):
1876         (WebKit::NetworkProcess::grantStorageAccess):
1877         (WebKit::NetworkProcess::logUserInteraction):
1878         (WebKit::NetworkProcess::hadUserInteraction):
1879         (WebKit::NetworkProcess::clearUserInteraction):
1880         (WebKit::NetworkProcess::setGrandfatheringTime):
1881         (WebKit::NetworkProcess::setMaxStatisticsEntries):
1882         (WebKit::NetworkProcess::setMinimumTimeBetweenDataRecordsRemoval):
1883         (WebKit::NetworkProcess::setPruneEntriesDownTo):
1884         (WebKit::NetworkProcess::setTimeToLiveUserInteraction):
1885         (WebKit::NetworkProcess::setShouldClassifyResourcesBeforeDataRecordsRemoval):
1886         (WebKit::NetworkProcess::setResourceLoadStatisticsEnabled):
1887         (WebKit::NetworkProcess::setResourceLoadStatisticsDebugMode):
1888         (WebKit::NetworkProcess::resetCacheMaxAgeCapForPrevalentResources):
1889         (WebKit::NetworkProcess::deleteWebsiteData):
1890         (WebKit::filterForTopLevelDomains):
1891         (WebKit::NetworkProcess::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
1892         (WebKit::NetworkProcess::topPrivatelyControlledDomainsWithWebsiteData):
1893         * NetworkProcess/NetworkProcess.h:
1894         * NetworkProcess/NetworkProcess.messages.in:
1895         * NetworkProcess/NetworkSession.cpp:
1896         (WebKit::NetworkSession::setResourceLoadStatisticsEnabled):
1897         (WebKit::NetworkSession::notifyResourceLoadStatisticsProcessed):
1898         (WebKit::NetworkSession::logDiagnosticMessageWithValue):
1899         (WebKit::NetworkSession::notifyPageStatisticsTelemetryFinished):
1900         (WebKit::NetworkSession::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
1901         (WebKit::NetworkSession::topPrivatelyControlledDomainsWithWebsiteData):
1902         (WebKit::NetworkSession::enableResourceLoadStatistics): Deleted.
1903         * NetworkProcess/NetworkSession.h:
1904         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1905         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
1906         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1907         (WKWebsiteDataStoreSetResourceLoadStatisticsDebugModeWithCompletionHandler):
1908         (WKWebsiteDataStoreSetResourceLoadStatisticsPrevalentResourceForDebugMode):
1909         (WKWebsiteDataStoreSetStatisticsLastSeen):
1910         (WKWebsiteDataStoreSetStatisticsPrevalentResource):
1911         (WKWebsiteDataStoreSetStatisticsVeryPrevalentResource):
1912         (WKWebsiteDataStoreDumpResourceLoadStatistics):
1913         (WKWebsiteDataStoreIsStatisticsPrevalentResource):
1914         (WKWebsiteDataStoreIsStatisticsVeryPrevalentResource):
1915         (WKWebsiteDataStoreIsStatisticsRegisteredAsSubresourceUnder):
1916         (WKWebsiteDataStoreIsStatisticsRegisteredAsSubFrameUnder):
1917         (WKWebsiteDataStoreIsStatisticsRegisteredAsRedirectingTo):
1918         (WKWebsiteDataStoreSetStatisticsHasHadUserInteraction):
1919         (WKWebsiteDataStoreIsStatisticsHasHadUserInteraction):
1920         (WKWebsiteDataStoreSetStatisticsGrandfathered):
1921         (WKWebsiteDataStoreIsStatisticsGrandfathered):
1922         (WKWebsiteDataStoreSetStatisticsSubframeUnderTopFrameOrigin):
1923         (WKWebsiteDataStoreSetStatisticsSubresourceUnderTopFrameOrigin):
1924         (WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectTo):
1925         (WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectFrom):
1926         (WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectTo):
1927         (WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectFrom):
1928         (WKWebsiteDataStoreSetStatisticsTimeToLiveUserInteraction):
1929         (WKWebsiteDataStoreStatisticsProcessStatisticsAndDataRecords):
1930         (WKWebsiteDataStoreStatisticsUpdateCookieBlocking):
1931         (WKWebsiteDataStoreStatisticsSubmitTelemetry):
1932         (WKWebsiteDataStoreSetStatisticsNotifyPagesWhenDataRecordsWereScanned):
1933         (WKWebsiteDataStoreSetStatisticsShouldClassifyResourcesBeforeDataRecordsRemoval):
1934         (WKWebsiteDataStoreSetStatisticsNotifyPagesWhenTelemetryWasCaptured):
1935         (WKWebsiteDataStoreSetStatisticsMinimumTimeBetweenDataRecordsRemoval):
1936         (WKWebsiteDataStoreSetStatisticsGrandfatheringTime):
1937         (WKWebsiteDataStoreSetStatisticsMaxStatisticsEntries):
1938         (WKWebsiteDataStoreSetStatisticsPruneEntriesDownTo):
1939         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore):
1940         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
1941         (WKWebsiteDataStoreStatisticsResetToConsistentState):
1942         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1943         (-[WKWebsiteDataStore _setResourceLoadStatisticsTestingCallback:]):
1944         * UIProcess/Network/NetworkProcessProxy.cpp:
1945         (WebKit::NetworkProcessProxy::clearCallbackStates):
1946         (WebKit::NetworkProcessProxy::didClose):
1947         (WebKit::nonEphemeralWebPageProxy):
1948         (WebKit::NetworkProcessProxy::logGlobalDiagnosticMessageWithValue):
1949         (WebKit::NetworkProcessProxy::dumpResourceLoadStatistics):
1950         (WebKit::NetworkProcessProxy::didDumpResourceLoadStatistics):
1951         (WebKit::NetworkProcessProxy::updatePrevalentDomainsToBlockCookiesFor):
1952         (WebKit::NetworkProcessProxy::didUpdateBlockCookies):
1953         (WebKit::NetworkProcessProxy::isPrevalentResource):
1954         (WebKit::NetworkProcessProxy::isPrevalentResourceResult):
1955         (WebKit::NetworkProcessProxy::isVeryPrevalentResource):
1956         (WebKit::NetworkProcessProxy::setPrevalentResource):
1957         (WebKit::NetworkProcessProxy::setPrevalentResourceForDebugMode):
1958         (WebKit::NetworkProcessProxy::setVeryPrevalentResource):
1959         (WebKit::NetworkProcessProxy::didSetResourceLoadStatisticData):
1960         (WebKit::NetworkProcessProxy::setLastSeen):
1961         (WebKit::NetworkProcessProxy::clearPrevalentResource):
1962         (WebKit::NetworkProcessProxy::scheduleCookieBlockingUpdate):
1963         (WebKit::NetworkProcessProxy::didScheduleCookieBlockingUpdate):
1964         (WebKit::NetworkProcessProxy::scheduleClearInMemoryAndPersistent):
1965         (WebKit::NetworkProcessProxy::didScheduleStatisticsProcessing):
1966         (WebKit::NetworkProcessProxy::scheduleStatisticsAndDataRecordsProcessing):
1967         (WebKit::NetworkProcessProxy::logUserInteraction):
1968         (WebKit::NetworkProcessProxy::hasHadUserInteraction):
1969         (WebKit::NetworkProcessProxy::didHaveUserInteraction):
1970         (WebKit::NetworkProcessProxy::clearUserInteraction):
1971         (WebKit::NetworkProcessProxy::setAgeCapForClientSideCookies):
1972         (WebKit::NetworkProcessProxy::didSetAgeCapForClientSideCookies):
1973         (WebKit::NetworkProcessProxy::setTimeToLiveUserInteraction):
1974         (WebKit::NetworkProcessProxy::didUpdateRuntimeSettings):
1975         (WebKit::NetworkProcessProxy::setNotifyPagesWhenTelemetryWasCaptured):
1976         (WebKit::NetworkProcessProxy::setNotifyPagesWhenDataRecordsWereScanned):
1977         (WebKit::NetworkProcessProxy::setSubframeUnderTopFrameOrigin):
1978         (WebKit::NetworkProcessProxy::isRegisteredAsRedirectingTo):
1979         (WebKit::NetworkProcessProxy::didIsRegisteredAsRedirectingTo):
1980         (WebKit::NetworkProcessProxy::isRegisteredAsSubFrameUnder):
1981         (WebKit::NetworkProcessProxy::didIsRegisteredAsSubFrameUnder):
1982         (WebKit::NetworkProcessProxy::setSubresourceUnderTopFrameOrigin):
1983         (WebKit::NetworkProcessProxy::isRegisteredAsSubresourceUnder):
1984         (WebKit::NetworkProcessProxy::didIsRegisteredAsSubresourceUnder):
1985         (WebKit::NetworkProcessProxy::setSubresourceUniqueRedirectTo):
1986         (WebKit::NetworkProcessProxy::setSubresourceUniqueRedirectFrom):
1987         (WebKit::NetworkProcessProxy::setTopFrameUniqueRedirectTo):
1988         (WebKit::NetworkProcessProxy::setTopFrameUniqueRedirectFrom):
1989         (WebKit::NetworkProcessProxy::isGrandfathered):
1990         (WebKit::NetworkProcessProxy::didIsGrandfathered):
1991         (WebKit::NetworkProcessProxy::setGrandfathered):
1992         (WebKit::NetworkProcessProxy::hasStorageAccess):
1993         (WebKit::NetworkProcessProxy::requestStorageAccess):
1994         (WebKit::NetworkProcessProxy::grantStorageAccess):
1995         (WebKit::NetworkProcessProxy::storageAccessRequestResult):
1996         (WebKit::NetworkProcessProxy::storageAccessOperationResult):
1997         (WebKit::NetworkProcessProxy::didRemoveAllStorageAccess):
1998         (WebKit::NetworkProcessProxy::didSetCacheMaxAgeCapForPrevalentResources):
1999         (WebKit::NetworkProcessProxy::setCacheMaxAgeCap):
2000         (WebKit::NetworkProcessProxy::setGrandfatheringTime):
2001         (WebKit::NetworkProcessProxy::setMaxStatisticsEntries):
2002         (WebKit::NetworkProcessProxy::setMinimumTimeBetweenDataRecordsRemoval):
2003         (WebKit::NetworkProcessProxy::setPruneEntriesDownTo):
2004         (WebKit::NetworkProcessProxy::setShouldClassifyResourcesBeforeDataRecordsRemoval):
2005         (WebKit::NetworkProcessProxy::setResourceLoadStatisticsDebugMode):
2006         (WebKit::NetworkProcessProxy::resetParametersToDefaultValues):
2007         (WebKit::NetworkProcessProxy::submitTelemetry):
2008         (WebKit::NetworkProcessProxy::notifyResourceLoadStatisticsProcessed):
2009         (WebKit::NetworkProcessProxy::notifyWebsiteDataDeletionForTopPrivatelyOwnedDomainsFinished):
2010         (WebKit::NetworkProcessProxy::notifyWebsiteDataScanForTopPrivatelyControlledDomainsFinished):
2011         (WebKit::NetworkProcessProxy::notifyResourceLoadStatisticsTelemetryFinished):
2012         (WebKit::NetworkProcessProxy::didLogUserInteraction): Deleted.
2013         (WebKit::NetworkProcessProxy::didResetCacheMaxAgeCapForPrevalentResources): Deleted.
2014         * UIProcess/Network/NetworkProcessProxy.h:
2015         * UIProcess/Network/NetworkProcessProxy.messages.in:
2016         * UIProcess/WebPageProxy.cpp:
2017         (WebKit::WebPageProxy::nonEphemeralWebPageProxy):
2018         * UIProcess/WebPageProxy.h:
2019         * UIProcess/WebProcessPool.cpp:
2020         (WebKit::WebProcessPool::ensureNetworkProcess):
2021         * UIProcess/WebProcessProxy.cpp:
2022         (WebKit::WebProcessProxy::notifyWebsiteDataScanForTopPrivatelyControlledDomainsFinished):
2023         (WebKit::WebProcessProxy::notifyWebsiteDataDeletionForTopPrivatelyOwnedDomainsFinished):
2024         * UIProcess/WebProcessProxy.h:
2025         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
2026         (WebKit::WebsiteDataStore::parameters):
2027         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2028         (WebKit::WebsiteDataStore::removeData):
2029         (WebKit::WebsiteDataStore::setMaxStatisticsEntries):
2030         (WebKit::WebsiteDataStore::setPruneEntriesDownTo):
2031         (WebKit::WebsiteDataStore::setGrandfatheringTime):
2032         (WebKit::WebsiteDataStore::setCacheMaxAgeCap):
2033         (WebKit::WebsiteDataStore::setMinimumTimeBetweenDataRecordsRemoval):
2034         (WebKit::WebsiteDataStore::dumpResourceLoadStatistics):
2035         (WebKit::WebsiteDataStore::isPrevalentResource):
2036         (WebKit::WebsiteDataStore::setPrevalentResource):
2037         (WebKit::WebsiteDataStore::setPrevalentResourceForDebugMode):
2038         (WebKit::WebsiteDataStore::isVeryPrevalentResource):
2039         (WebKit::WebsiteDataStore::setVeryPrevalentResource):
2040         (WebKit::WebsiteDataStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
2041         (WebKit::WebsiteDataStore::setSubframeUnderTopFrameOrigin):
2042         (WebKit::WebsiteDataStore::isRegisteredAsSubFrameUnder):
2043         (WebKit::WebsiteDataStore::setSubresourceUnderTopFrameOrigin):
2044         (WebKit::WebsiteDataStore::isRegisteredAsSubresourceUnder):
2045         (WebKit::WebsiteDataStore::setSubresourceUniqueRedirectTo):
2046         (WebKit::WebsiteDataStore::setSubresourceUniqueRedirectFrom):
2047         (WebKit::WebsiteDataStore::setTopFrameUniqueRedirectTo):
2048         (WebKit::WebsiteDataStore::setTopFrameUniqueRedirectFrom):
2049         (WebKit::WebsiteDataStore::isRegisteredAsRedirectingTo):
2050         (WebKit::WebsiteDataStore::clearPrevalentResource):
2051         (WebKit::WebsiteDataStore::resetParametersToDefaultValues):
2052         (WebKit::WebsiteDataStore::submitTelemetry):
2053         (WebKit::WebsiteDataStore::scheduleClearInMemoryAndPersistent):
2054         (WebKit::WebsiteDataStore::scheduleCookieBlockingUpdate):
2055         (WebKit::WebsiteDataStore::scheduleStatisticsAndDataRecordsProcessing):
2056         (WebKit::WebsiteDataStore::updatePrevalentDomainsToBlockCookiesFor):
2057         (WebKit::WebsiteDataStore::setAgeCapForClientSideCookies):
2058         (WebKit::WebsiteDataStore::setLastSeen):
2059         (WebKit::WebsiteDataStore::setNotifyPagesWhenDataRecordsWereScanned):
2060         (WebKit::WebsiteDataStore::setNotifyPagesWhenTelemetryWasCaptured):
2061         (WebKit::WebsiteDataStore::hasStorageAccessForFrameHandler):
2062         (WebKit::WebsiteDataStore::getAllStorageAccessEntries):
2063         (WebKit::WebsiteDataStore::grantStorageAccessHandler):
2064         (WebKit::WebsiteDataStore::removeAllStorageAccessHandler):
2065         (WebKit::WebsiteDataStore::removePrevalentDomains):
2066         (WebKit::WebsiteDataStore::hasStorageAccess):
2067         (WebKit::WebsiteDataStore::requestStorageAccess):
2068         (WebKit::WebsiteDataStore::grantStorageAccess):
2069         (WebKit::WebsiteDataStore::setTimeToLiveUserInteraction):
2070         (WebKit::WebsiteDataStore::logUserInteraction):
2071         (WebKit::WebsiteDataStore::hasHadUserInteraction):
2072         (WebKit::WebsiteDataStore::clearUserInteraction):
2073         (WebKit::WebsiteDataStore::isGrandfathered):
2074         (WebKit::WebsiteDataStore::setGrandfathered):
2075         (WebKit::WebsiteDataStore::setCacheMaxAgeCapForPrevalentResources):
2076         (WebKit::WebsiteDataStore::resetCacheMaxAgeCapForPrevalentResources):
2077         (WebKit::WebsiteDataStore::webPageWasAdded):
2078         (WebKit::WebsiteDataStore::webPageWasInvalidated):
2079         (WebKit::WebsiteDataStore::webProcessWillOpenConnection):
2080         (WebKit::WebsiteDataStore::webPageWillOpenConnection):
2081         (WebKit::WebsiteDataStore::webPageDidCloseConnection):
2082         (WebKit::WebsiteDataStore::webProcessDidCloseConnection):
2083         (WebKit::WebsiteDataStore::isAssociatedProcessPool const):
2084         (WebKit::WebsiteDataStore::processPools const):
2085         (WebKit::WebsiteDataStore::resourceLoadStatisticsEnabled const):
2086         (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
2087         (WebKit::WebsiteDataStore::setResourceLoadStatisticsDebugMode):
2088         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
2089         (WebKit::WebsiteDataStore::logTestingEvent):
2090         * UIProcess/WebsiteData/WebsiteDataStore.h:
2091         (WebKit::WebsiteDataStore::setStatisticsTestingCallback):
2092         * WebProcess/WebProcess.cpp:
2093         (WebKit::WebProcess::initializeWebProcess):
2094
2095 2019-01-15  Darin Adler  <darin@apple.com>
2096
2097         Use references rather than pointers for register/unregister functions, and more
2098         https://bugs.webkit.org/show_bug.cgi?id=175028
2099
2100         Reviewed by Daniel Bates.
2101
2102         * WebProcess/FullScreen/WebFullScreenManager.cpp:
2103         (WebKit::WebFullScreenManager::willEnterFullScreen): Update for change to the
2104         functions in Document; pass a reference.
2105         (WebKit::WebFullScreenManager::didEnterFullScreen): Ditto, don't pass the element.
2106         (WebKit::WebFullScreenManager::willExitFullScreen): Ditto.
2107         (WebKit::WebFullScreenManager::didExitFullScreen): Ditto.
2108
2109         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
2110         (WebKit::UserMediaPermissionRequestManager::startUserMediaRequest): Pass a reference.
2111         (WebKit::UserMediaPermissionRequestManager::mediaCanStart): Ditto.
2112         (WebKit::UserMediaPermissionRequestManager::removeMediaRequestFromMaps): Ditto.
2113         * WebProcess/Plugins/PluginView.cpp:
2114         (WebKit::PluginView::~PluginView): Ditto.
2115         (WebKit::PluginView::initializePlugin): Ditto.
2116
2117 2019-01-20  Michael Catanzaro  <mcatanzaro@igalia.com>
2118
2119         Unreviewed, fix -Wreturn-type warning
2120         https://bugs.webkit.org/show_bug.cgi?id=193333
2121         <rdar://problem/45649489>
2122
2123         * UIProcess/Automation/WebAutomationSession.cpp:
2124         (WebKit::toProtocol):
2125
2126 2019-01-20  chris fleizach  <cfleizach@apple.com>
2127
2128         AX: Support returning relative frames for accessibility
2129         https://bugs.webkit.org/show_bug.cgi?id=193414
2130         <rdar://problem/47268501>
2131
2132         Reviewed by Zalan Bujtas.
2133
2134         * UIProcess/API/Cocoa/WKWebView.mm:
2135         (-[WKWebView accessibilityAttributeValue:forParameter:]):
2136         (-[WKWebView IGNORE_WARNINGS_END]):
2137         * UIProcess/API/mac/WKView.mm:
2138         (-[WKView accessibilityAttributeValue:forParameter:]):
2139         (-[WKView IGNORE_WARNINGS_END]):
2140         * UIProcess/Cocoa/WebViewImpl.h:
2141         * UIProcess/Cocoa/WebViewImpl.mm:
2142         (WebKit::WebViewImpl::accessibilityAttributeValue):
2143         * UIProcess/ios/WKContentView.mm:
2144         (-[WKContentView accessibilityConvertRelativeFrameFromPage:]):
2145
2146 2019-01-20  Michael Catanzaro  <mcatanzaro@igalia.com>
2147
2148         Unreviewed, rolling out r240209.
2149
2150         Broke GTK/WPE injected bundle
2151
2152         Reverted changeset:
2153
2154         "AX: Support returning relative frames for accessibility"
2155         https://bugs.webkit.org/show_bug.cgi?id=193414
2156         https://trac.webkit.org/changeset/240209
2157
2158 2019-01-12  Dan Bernstein  <mitz@apple.com>
2159
2160         [Cocoa] Avoid importing directly from subumbrella frameworks
2161         https://bugs.webkit.org/show_bug.cgi?id=186016
2162         <rdar://problem/40591038>
2163
2164         Reviewed by Sam Weinig.
2165
2166         * Configurations/BaseTarget.xcconfig: Removed -iframework options from OTHER_CFLAGS and
2167           OTHER_CPLUSPLUSFLAGS.
2168         * UIProcess/Automation/mac/WebAutomationSessionMac.mm: Import Carbon.h instead of an
2169           HIToolbox header.
2170         * UIProcess/Cocoa/WebViewImpl.mm: Ditto.
2171         * UIProcess/mac/WKPrintingView.mm: Import Quartz.h instead of a PDFKit header.
2172         * UIProcess/mac/WKTextInputWindowController.mm: Import Carbon.h instead of an HIToolbox
2173           header.
2174         * WebProcess/Plugins/PDF/PDFAnnotationTextWidgetDetails.h: Import Quartz.h instead of a
2175           PDFKit header.
2176         * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h: Ditto.
2177         * WebProcess/Plugins/PDF/PDFPlugin.mm: Ditto.
2178         * WebProcess/Plugins/PDF/PDFPluginAnnotation.mm: Ditto.
2179         * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm: Ditto.
2180         * WebProcess/Plugins/PDF/PDFPluginPasswordField.mm: Ditto.
2181         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm: Ditto.
2182         * WebProcess/WebPage/mac/WebPageMac.mm: Ditto.
2183
2184 2019-01-20  chris fleizach  <cfleizach@apple.com>
2185
2186         AX: Support returning relative frames for accessibility
2187         https://bugs.webkit.org/show_bug.cgi?id=193414
2188         <rdar://problem/47268501>
2189
2190         Reviewed by Zalan Bujtas.
2191
2192         * UIProcess/API/Cocoa/WKWebView.mm:
2193         (-[WKWebView accessibilityAttributeValue:forParameter:]):
2194         (-[WKWebView IGNORE_WARNINGS_END]):
2195         * UIProcess/API/mac/WKView.mm:
2196         (-[WKView accessibilityAttributeValue:forParameter:]):
2197         (-[WKView IGNORE_WARNINGS_END]):
2198         * UIProcess/Cocoa/WebViewImpl.h:
2199         * UIProcess/Cocoa/WebViewImpl.mm:
2200         (WebKit::WebViewImpl::accessibilityAttributeValue):
2201         * UIProcess/ios/WKContentView.mm:
2202         (-[WKContentView accessibilityConvertRelativeFrameFromPage:]):
2203
2204 2019-01-20  Antoine Quint  <graouts@apple.com>
2205
2206         Add a POINTER_EVENTS feature flag
2207         https://bugs.webkit.org/show_bug.cgi?id=193577
2208         <rdar://problem/47408511>
2209
2210         Unreviewed. Also enable Pointer Events for iosmac.
2211
2212         * Configurations/FeatureDefines.xcconfig:
2213
2214 2019-01-19  David Kilzer  <ddkilzer@apple.com>
2215
2216         Follow-up: iOS: Updating input mode should update the software keyboard
2217         <https://bugs.webkit.org/show_bug.cgi?id=193565>
2218         <rdar://problem/47376334>
2219
2220         * WebProcess/WebPage/WebPage.cpp:
2221         (WebKit::WebPage::focusedElementDidChangeInputMode): Fix iOS
2222         Debug builds after r240199 by downcasting `element` to
2223         `HTMLElement` before calling canonicalInputMode().
2224
2225 2019-01-19  David Kilzer  <ddkilzer@apple.com>
2226
2227         Sort WebKit Xcode project file
2228
2229         * WebKit.xcodeproj/project.pbxproj:
2230
2231 2019-01-19  Antoine Quint  <graouts@apple.com>
2232
2233         Add a POINTER_EVENTS feature flag
2234         https://bugs.webkit.org/show_bug.cgi?id=193577
2235
2236         Reviewed by Dean Jackson.
2237
2238         * Configurations/FeatureDefines.xcconfig:
2239
2240 2019-01-18  Ryosuke Niwa  <rniwa@webkit.org>
2241
2242         iOS: Updating input mode should update the software keyboard
2243         https://bugs.webkit.org/show_bug.cgi?id=193565
2244         <rdar://problem/47376334>
2245
2246         Reviewed by Wenson Hsieh.
2247
2248         Update the software keyboard when the inputmode content attribute on the focused element had been mutated.
2249
2250         * Scripts/webkit/messages.py:
2251         * Shared/WebCoreArgumentCoders.h:
2252         * UIProcess/PageClient.h:
2253         * UIProcess/WebPageProxy.h:
2254         * UIProcess/WebPageProxy.messages.in:
2255         * UIProcess/ios/PageClientImplIOS.h:
2256         * UIProcess/ios/PageClientImplIOS.mm:
2257         (WebKit::PageClientImpl::focusedElementDidChangeInputMode):
2258         * UIProcess/ios/WKContentViewInteraction.h:
2259         * UIProcess/ios/WKContentViewInteraction.mm:
2260         (-[WKContentView _didUpdateInputMode:]):
2261         * UIProcess/ios/WebPageProxyIOS.mm:
2262         (WebKit::WebPageProxy::focusedElementDidChangeInputMode):
2263         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2264         (WebKit::WebChromeClient::focusedElementDidChangeInputMode):
2265         * WebProcess/WebCoreSupport/WebChromeClient.h:
2266         * WebProcess/WebPage/WebPage.cpp:
2267         (WebKit::WebPage::focusedElementDidChangeInputMode):
2268         * WebProcess/WebPage/WebPage.h:
2269
2270 2019-01-18  Tim Horton  <timothy_horton@apple.com>
2271
2272         Adjust WKDrawingView protocol method name
2273         https://bugs.webkit.org/show_bug.cgi?id=193604
2274
2275         Reviewed by Wenson Hsieh.
2276
2277         * UIProcess/ios/WKDrawingView.mm:
2278         (-[WKDrawingView canvasViewDrawingDidChange:]):
2279         (-[WKDrawingView drawingDidChange:]): Deleted.
2280
2281 2019-01-18  David Kilzer  <ddkilzer@apple.com>
2282
2283         [WebKit] Change Xcode folders to map to folders on disk
2284
2285         * WebKit.xcodeproj/project.pbxproj: Update these folders:
2286         - Shared/Authentication
2287         - Shared/Authentication/cocoa
2288
2289 2019-01-18  Brian Burg  <bburg@apple.com>
2290
2291         Automation.computeElementLayout should return visual viewport-aware coordinates
2292         https://bugs.webkit.org/show_bug.cgi?id=193598
2293         <rdar://problem/35325644>
2294
2295         Reviewed by Simon Fraser.
2296
2297         Previously I added CoordinateSystem::VisualViewport to stub out this for iOS.
2298         But I think that it's a mistake for safaridriver to care about VisualViewport
2299         being enabled or not, because it is a runtime-switchable setting.
2300
2301         This patch removes CoordinateSystem::VisualViewport. Make the existing
2302         CoordinateSystem::LayoutViewport use visual viewport semantics if needed.
2303
2304         This is tested by WebDriver element clicking tests. There should not be any
2305         difference in behavior until it is possible to zoom with gestures via WebDriver.
2306
2307         * Shared/CoordinateSystem.h:
2308         * UIProcess/Automation/Automation.json:
2309         * UIProcess/Automation/WebAutomationSession.cpp:
2310         (WebKit::protocolStringToCoordinateSystem):
2311         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
2312         (WebKit::WebAutomationSessionProxy::computeElementLayout):
2313
2314 2019-01-18  Daniel Bates  <dabates@apple.com>
2315
2316         Fix some build issues.
2317
2318         Include missing header WKDrawingCoordinator.
2319
2320         * UIProcess/ios/WKInkPickerView.mm:
2321
2322 2019-01-18  Tim Horton  <timothy_horton@apple.com>
2323
2324         Get rid of ADVANCED_SPELL_CHECKING
2325         https://bugs.webkit.org/show_bug.cgi?id=193592
2326
2327         Reviewed by Wenson Hsieh.
2328
2329         * UIProcess/Cocoa/WebViewImpl.mm:
2330         (WebKit::WebViewImpl::requestCandidatesForSelectionIfNeeded):
2331         (WebKit::WebViewImpl::insertText):
2332         * UIProcess/mac/TextCheckerMac.mm:
2333         (WebKit::TextChecker::checkTextOfParagraph):
2334         (WebKit::TextChecker::getGuessesForWord):
2335
2336 2019-01-18  Chris Dumez  <cdumez@apple.com>
2337
2338         Regression(PSON) Content blockers are sometimes lost on back navigation cross-site
2339         https://bugs.webkit.org/show_bug.cgi?id=193588
2340         <rdar://problem/47131566>
2341
2342         Reviewed by Alex Christensen.
2343
2344         When the WebPageProxy needs to create initialization parameters for its WebPage in the
2345         WebContent process, it calls WebProcessProxy::addWebUserContentControllerProxy()
2346         which calls WebUserContentControllerProxy::addProcess(). This last call is supposed to
2347         register the WebProcessProxy with the WebUserContentControllerProxy and adding the
2348         contentRuleLists to the WebPageCreationParameters. The issue is that if the
2349         WebUserContentControllerProxy already knows about this WebProcessProxy, it would return
2350         early and not populate the WebPageCreationParameters.
2351
2352         In PSON world, when navigating back to a page that failed to enter page cache, we reuse
2353         the process where we previously loaded the page but re-create a new WebPage on the
2354         WebContent process site. When this happens, WebUserContentControllerProxy would not
2355         add the contentRuleLists to the WebPageCreationParameters and the new WebPage in the
2356         previously-suspended process would be missing them.
2357
2358         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
2359         (WebKit::WebUserContentControllerProxy::addProcess):
2360
2361 2019-01-18  Jer Noble  <jer.noble@apple.com>
2362
2363         SDK_VARIANT build destinations should be separate from non-SDK_VARIANT builds
2364         https://bugs.webkit.org/show_bug.cgi?id=189553
2365
2366         Reviewed by Tim Horton.
2367
2368         * Configurations/Base.xcconfig:
2369         * Configurations/BaseTarget.xcconfig:
2370         * Configurations/SDKVariant.xcconfig: Added.
2371
2372 2019-01-18  Antti Koivisto  <antti@apple.com>
2373
2374         Implement asynchronous frame scrolling for iOS
2375         https://bugs.webkit.org/show_bug.cgi?id=193539
2376         <rdar://problem/47379873>
2377
2378         Reviewed by Simon Fraser.
2379
2380         Add a scrolling node type that can handle UIScrollView backed frames.
2381         It basically just instantiates and forwards to the existing ScrollingTreeScrollingNodeDelegateIOS.
2382
2383         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
2384         (WebKit::RemoteScrollingTree::createScrollingTreeNode):
2385         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
2386         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
2387         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h: Added.
2388         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm: Added.
2389         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::create):
2390         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::ScrollingTreeFrameScrollingNodeRemoteIOS):
2391         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::~ScrollingTreeFrameScrollingNodeRemoteIOS):
2392         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateBeforeChildren):
2393         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateAfterChildren):
2394         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterAncestorChange):
2395         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::scrollPosition const):
2396         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::setScrollLayerPosition):
2397         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterDelegatedScroll):
2398         * WebKit.xcodeproj/project.pbxproj:
2399
2400 2019-01-18  Chris Dumez  <cdumez@apple.com>
2401
2402         Regression(PSON) Scroll position is not always restored properly when navigating back
2403         https://bugs.webkit.org/show_bug.cgi?id=193578
2404         <rdar://problem/47386331>
2405
2406         Reviewed by Tim Horton.
2407
2408         Fix issues causing the scroll position to not be restored at all (or incorrectly) when
2409         navigating back cross-site with PSON enabled. Also make sure that the swipe gesture
2410         snapshot really stays up until we've restored the scroll position.
2411
2412         Note that even after those changes, I can still sometimes reproduce a white flash when
2413         swiping back to Google search results (scroll position being correct now). This is
2414         tracked by <rdar://problem/47071684> and happens even if I disable PSON entirely.
2415
2416         * Shared/SessionState.cpp:
2417         (WebKit::FrameState::encode const):
2418         (WebKit::FrameState::decode):
2419         * Shared/SessionState.h:
2420         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
2421         (WebKit::toFrameState):
2422         (WebKit::applyFrameState):
2423         obscuredInsets is present on the HistoryItem in the WebProcess but was never passed to
2424         or stored by the UIProcess on the WebBackForwardListItem. obscuredInsets is needed to
2425         properly restore the scrollPosition (position was 70px off on my iPad without this).
2426         With PSON enabled, if you swipe back cross-process and the previous page was not put
2427         into PageCache, then the HistoryItem is gone on the WebProcess side. What happens is
2428         that the UIProcess sends its WebBackForwardListItem to the WebProcess, which restores
2429         the HistoryItem there, and then asks it to load it. The obscuredInsets was getting lost
2430         in the process since the UIProcess never knew about it.
2431
2432         * UIProcess/Cocoa/ViewGestureController.cpp:
2433         (WebKit::ViewGestureController::didReachMainFrameLoadTerminalState):
2434         Drop logic that was causing the ViewGestureController to not wait for the scroll position
2435         to be restored before taking down the snapshot, when UI-side compositing is enabled.
2436         If you look at the comment above the code, you'll see that the code in question was meant
2437         to impact only the non-UI side compositing code path. As a matter of fact, when the code
2438         was reviewed at https://bugs.webkit.org/show_bug.cgi?id=151224, it was protected by a
2439         #if PLATFORM(MAC), before getting modified the wrong way before landing. In practice, we
2440         would have often restored the scroll position by the time the load is finished so it would
2441         not cause a flash in most cases. However, with PSON enabled and the layer tree freezing we
2442         do on process-swap, the first post-scroll restoration layer tree commit may now occur a
2443         little bit later and we would lose the race more often.
2444
2445         * UIProcess/WebProcessProxy.cpp:
2446         (WebKit::WebProcessProxy::updateBackForwardItem):
2447         * UIProcess/WebProcessProxy.h:
2448         When adding PageCache support to PSON, we used to navigate the "suspended" page to
2449         about:blank. This would lead to unwanted WebProcessProxy::updateBackForwardItem()
2450         calls from the WebProcess which we wanted to ignore. We thus added logic to ignore
2451         updateBackForwardItem() IPC from the old WebProcess after a swap. The issue with this
2452         is that we sometimes miss/ignore legit updates to the HistoryItem from the old process,
2453         in particular with regards to the scroll position and the pageScaleFactor. So if you
2454         swiped and then quickly enough did a cross-site navigation, the UIProcess'
2455         WebBackForwardList would not get updated with the latest scroll position and we would
2456         thus fail to restore it later on. To address the issue, we now stop ignoring updates
2457         from the old WebProcess after a swap. This logic is no longer needed since we no longer
2458         navigate the old page to about:blank after a swap, we merely suspend it "in place".
2459
2460 2019-01-18  Wenson Hsieh  <wenson_hsieh@apple.com>
2461
2462         Remove some last vestiges of assisted node terminology in WebKit
2463         https://bugs.webkit.org/show_bug.cgi?id=193572
2464
2465         Reviewed by Tim Horton.
2466
2467         * UIProcess/API/Cocoa/_WKFocusedElementInfo.h:
2468         * UIProcess/ios/WKContentViewInteraction.mm:
2469         (-[WKContentView gestureRecognizerShouldBegin:]):
2470         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
2471         (-[WKContentView _showKeyboard]):
2472         (-[WKContentView _hideKeyboard]):
2473
2474         Add a FIXME about invoking `-reloadInputViews` on watchOS when the focused element is blurred.
2475
2476         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
2477         (-[WKContentView _elementDidBlur]):
2478         (-[WKContentView updateCurrentFocusedElementInformation:]):
2479         (-[WKContentView _startAssistingKeyboard]): Deleted.
2480         (-[WKContentView _stopAssistingKeyboard]): Deleted.
2481         * WebProcess/WebPage/ios/WebPageIOS.mm:
2482         (WebKit::WebPage::getFocusedElementInformation):
2483
2484 2019-01-18  Youenn Fablet  <youenn@apple.com>
2485
2486         Add a new SPI to request for cache storage quota increase
2487         https://bugs.webkit.org/show_bug.cgi?id=193323
2488
2489         Reviewed by Alex Christensen.
2490
2491         Add a delegate on the WebSiteDataStore for WebKit to ask for quota update.
2492         The current SPI is currently CacheStorage specific but future work should
2493         make it so that other storage like IDB use the same mechanism.
2494         By default, quota remains unchanged if delegate is not implemented.
2495
2496         * NetworkProcess/NetworkProcess.cpp:
2497         * UIProcess/API/Cocoa/WKStorageQuotaDelegatePrivate.h: Added.
2498         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2499         (WebsiteDataStoreQuotaManager::WebsiteDataStoreQuotaManager):
2500         (-[WKWebsiteDataStore _quotaDelegate]):
2501         (-[WKWebsiteDataStore set_quotaDelegate:]):
2502         * UIProcess/API/Cocoa/WKWebsiteDataStoreInternal.h:
2503         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
2504         * UIProcess/Network/NetworkProcessProxy.cpp:
2505         (WebKit::NetworkProcessProxy::requestCacheStorageSpace):
2506         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2507         (WebKit::WebsiteDataStore::WebsiteDataStore):
2508         * UIProcess/WebsiteData/WebsiteDataStore.h:
2509         (WebKit::WebsiteDataStore::quotaManager):
2510         (WebKit::WebsiteDataStore::setQuotaManager):
2511         * UIProcess/WebsiteData/WebsiteDataStoreQuotaManager.h: Added.
2512         (WebKit::WebsiteDataStoreQuotaManager::~WebsiteDataStoreQuotaManager):
2513         (WebKit::WebsiteDataStoreQuotaManager::requestCacheStorageSpace):
2514         * WebKit.xcodeproj/project.pbxproj:
2515
2516 2019-01-18  Philippe Normand  <pnormand@igalia.com>
2517
2518         [WPE] Add Qt extension
2519         https://bugs.webkit.org/show_bug.cgi?id=191464
2520
2521         Reviewed by Carlos Garcia Campos.
2522
2523         This new extension is a QML plugin embedding a WPE ViewBackend
2524         implementation. It provides a public API very similar to Qt's
2525         WebView module. It comes with a simple mini-browser implemented in
2526         QML.
2527
2528         QtWPE is known to work with the Wayland-EGL (in GNOME and Weston
2529         compositors) and EGLFS QPAs.
2530
2531         * PlatformWPE.cmake:
2532         * UIProcess/API/wpe/qt/WPEQmlExtensionPlugin.cpp: Added.
2533         (WPEQmlExtensionPlugin::registerTypes):
2534         * UIProcess/API/wpe/qt/WPEQmlExtensionPlugin.h: Added.
2535         * UIProcess/API/wpe/qt/WPEQtView.cpp: Added.
2536         (WPEQtView::WPEQtView):
2537         (WPEQtView::~WPEQtView):
2538         (WPEQtView::geometryChanged):
2539         (WPEQtView::configureWindow):
2540         (WPEQtView::createOffscreen):
2541         (WPEQtView::backendCreated):
2542         (WPEQtView::notifyUrlChangedCallback):
2543         (WPEQtView::notifyTitleChangedCallback):
2544         (WPEQtView::notifyLoadProgressCallback):
2545         (WPEQtView::notifyLoadChangedCallback):
2546         (WPEQtView::notifyLoadFailedCallback):
2547         (WPEQtView::updatePaintNode):
2548         (WPEQtView::url const):
2549         (WPEQtView::setUrl):
2550         (WPEQtView::loadProgress const):
2551         (WPEQtView::title const):
2552         (WPEQtView::canGoBack const):
2553         (WPEQtView::isLoading const):
2554         (WPEQtView::canGoForward const):
2555         (WPEQtView::goBack):
2556         (WPEQtView::goForward):
2557         (WPEQtView::reload):
2558         (WPEQtView::stop):
2559         (WPEQtView::loadHtml):
2560         (WPEQtView::jsAsyncReadyCallback):
2561         (WPEQtView::handleJsResult):
2562         (WPEQtView::runJavaScript):
2563         (WPEQtView::mousePressEvent):
2564         (WPEQtView::mouseReleaseEvent):
2565         (WPEQtView::hoverEnterEvent):
2566         (WPEQtView::hoverLeaveEvent):
2567         (WPEQtView::hoverMoveEvent):
2568         (WPEQtView::wheelEvent):
2569         (WPEQtView::keyPressEvent):
2570         (WPEQtView::keyReleaseEvent):
2571         (WPEQtView::touchEvent):
2572         * UIProcess/API/wpe/qt/WPEQtView.h: Added.
2573         * UIProcess/API/wpe/qt/WPEQtViewBackend.cpp: Added.
2574         (configureCallback):
2575         (WPEQtViewBackend::WPEQtViewBackend):
2576         (WPEQtViewBackend::~WPEQtViewBackend):
2577         (WPEQtViewBackend::configureGlibEglDisplay):
2578         (WPEQtViewBackend::configureEglDisplay):
2579         (WPEQtViewBackend::initialize):
2580         (WPEQtViewBackend::backend const):
2581         (WPEQtViewBackend::resize):
2582         (WPEQtViewBackend::getTexture):
2583         (WPEQtViewBackend::initSurface):
2584         (WPEQtViewBackend::displayImage):
2585         (WPEQtViewBackend::modifiers const):
2586         (WPEQtViewBackend::dispatchHoverEnterEvent):
2587         (WPEQtViewBackend::dispatchHoverLeaveEvent):
2588         (WPEQtViewBackend::dispatchHoverMoveEvent):
2589         (WPEQtViewBackend::dispatchMousePressEvent):
2590         (WPEQtViewBackend::dispatchMouseReleaseEvent):
2591         (WPEQtViewBackend::dispatchWheelEvent):
2592         (WPEQtViewBackend::dispatchKeyEvent):
2593         (WPEQtViewBackend::dispatchTouchEvent):
2594         * UIProcess/API/wpe/qt/WPEQtViewBackend.h: Added.
2595         * UIProcess/API/wpe/qt/WPEQtViewLoadRequest.cpp: Added.
2596         (WPEQtViewLoadRequest::WPEQtViewLoadRequest):
2597         (WPEQtViewLoadRequest::~WPEQtViewLoadRequest):
2598         (WPEQtViewLoadRequest::url const):
2599         (WPEQtViewLoadRequest::status const):
2600         (WPEQtViewLoadRequest::errorString const):
2601         * UIProcess/API/wpe/qt/WPEQtViewLoadRequest.h: Added.
2602         * UIProcess/API/wpe/qt/WPEQtViewLoadRequestPrivate.h: Added.
2603         (WPEQtViewLoadRequestPrivate::WPEQtViewLoadRequestPrivate):
2604         (WPEQtViewLoadRequestPrivate::~WPEQtViewLoadRequestPrivate):
2605         * UIProcess/API/wpe/qt/qmldir: Added.
2606
2607 2019-01-17  Wenson Hsieh  <wenson_hsieh@apple.com>
2608
2609         [iOS] Content offset jumps erratically when autoscrolling near scroll view content inset areas
2610         https://bugs.webkit.org/show_bug.cgi?id=193494
2611         <rdar://problem/46859627>
2612
2613         Reviewed by Simon Fraser and Tim Horton.
2614
2615         Adds `contentInsets` to `VisibleContentRectUpdateInfo`. This keeps track of the visible content insets
2616         surrounding the unobscured content rect. See WebCore ChangeLog for more details.
2617
2618         * Shared/VisibleContentRectUpdateInfo.cpp:
2619         (WebKit::VisibleContentRectUpdateInfo::encode const):
2620         (WebKit::VisibleContentRectUpdateInfo::decode):
2621         (WebKit::operator<<):
2622         * Shared/VisibleContentRectUpdateInfo.h:
2623         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
2624         (WebKit::VisibleContentRectUpdateInfo::contentInsets const):
2625         (WebKit::operator==):
2626         * UIProcess/API/Cocoa/WKWebView.mm:
2627         (-[WKWebView _computedObscuredInset]):
2628         (-[WKWebView _computedContentInset]):
2629         (-[WKWebView _computedUnobscuredSafeAreaInset]):
2630
2631         We don't care about source compatibility with iOS 10 and below anymore, so we should change these >= iOS 11
2632         target checks to simply `PLATFORM(IOS)`.
2633
2634         (-[WKWebView _updateVisibleContentRects]):
2635
2636         Compute the visible content insets on all sides of the unobscured content rect. These insets are scaled to
2637         content coordinates.
2638
2639         * UIProcess/ios/WKContentView.h:
2640         * UIProcess/ios/WKContentView.mm:
2641         (floatBoxExtent):
2642
2643         Add a helper to convert `UIEdgeInsets` to `WebCore::FloatBoxExtent`, and use it in a few places below.
2644
2645         (-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
2646         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]): Deleted.
2647         * WebProcess/WebPage/ios/WebPageIOS.mm:
2648         (WebKit::WebPage::updateVisibleContentRects):
2649
2650         Update the Page's content insets.
2651
2652 2019-01-17  Truitt Savell  <tsavell@apple.com>
2653
2654         Unreviewed, rolling out r240124.
2655
2656         This commit broke an internal build.
2657
2658         Reverted changeset:
2659
2660         "SDK_VARIANT build destinations should be separate from non-
2661         SDK_VARIANT builds"
2662         https://bugs.webkit.org/show_bug.cgi?id=189553
2663         https://trac.webkit.org/changeset/240124
2664
2665 2019-01-17  John Wilander  <wilander@apple.com>
2666
2667         Add infrastructure to enable/disable ITP Debug Mode through Preferences
2668         https://bugs.webkit.org/show_bug.cgi?id=193510
2669         <rdar://problem/47330969>
2670
2671         Reviewed by Dean Jackson.
2672
2673         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
2674         (WebKit::ResourceLoadStatisticsMemoryStore::ensurePrevalentResourcesForDebugMode):
2675         (WebKit::ResourceLoadStatisticsMemoryStore::setResourceLoadStatisticsDebugMode):
2676         (WebKit::ResourceLoadStatisticsMemoryStore::setPrevalentResourceForDebugMode):
2677             These functions are now suited for runtime switching of ITP Debug Mode.
2678         * Shared/WebPreferences.yaml:
2679             Changed name from ResourceLoadStatisticsDebugMode to ItpDebugModeEnabled.
2680         * UIProcess/API/Cocoa/WKPreferences.mm:
2681         (-[WKPreferences _setItpDebugModeEnabled:]):
2682         (-[WKPreferences _itpDebugModeEnabled]):
2683             New private preferences functions.
2684         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2685         * UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm:
2686         (WebKit::ResourceLoadStatisticsMemoryStore::registerUserDefaultsIfNeeded):
2687             Removed support for old experimental user default. Added a new one that's
2688             not connected to any UI, i.e. merely for command line debugging where
2689             ITP Debug Mode needs to be on all the time.
2690
2691 2019-01-17  Tim Horton  <timothy_horton@apple.com>
2692
2693         Adopt NSTextCheckingSuppressInitialCapitalizationKey
2694         https://bugs.webkit.org/show_bug.cgi?id=193545
2695
2696         Reviewed by Dean Jackson.
2697
2698         * UIProcess/mac/TextCheckerMac.mm:
2699         (WebKit::TextChecker::checkTextOfParagraph):
2700         (WebKit::TextChecker::getGuessesForWord):
2701
2702 2019-01-17  Jer Noble  <jer.noble@apple.com>
2703
2704         SDK_VARIANT build destinations should be separate from non-SDK_VARIANT builds
2705         https://bugs.webkit.org/show_bug.cgi?id=189553
2706
2707         Reviewed by Tim Horton.
2708
2709         * Configurations/Base.xcconfig:
2710         * Configurations/BaseTarget.xcconfig:
2711         * Configurations/SDKVariant.xcconfig: Added.
2712
2713 2019-01-16  Dean Jackson  <dino@apple.com>
2714
2715         (iPad) Link tapping is sluggish on many sites
2716         https://bugs.webkit.org/show_bug.cgi?id=193522
2717         <rdar://problem/47102987>
2718
2719         Reviewed by Wenson Hsieh.
2720
2721         Some WKWebView clients might set the initial zoom scale of the page to
2722         something other than 1, which disables the "fast tap" behaviour.
2723         The fix is very simple -- just check against the initial scale rather
2724         than 1.
2725
2726         The most likely regression from this would be pages designed for desktop,
2727         but provide a viewport tag saying width=device-width and initial-scale.
2728         They might stop allowing double-tap-to-zoom.
2729
2730         * UIProcess/API/Cocoa/WKWebView.mm:
2731         (-[WKWebView _allowsDoubleTapGestures]): Check against initial page scale.
2732
2733 2019-01-17  Alex Christensen  <achristensen@webkit.org>
2734
2735         Stop using NetworkStorageSession::storageSession in WebCore
2736         https://bugs.webkit.org/show_bug.cgi?id=193529
2737
2738         Reviewed by Tim Horton.
2739
2740         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2741         (WebKit::NetworkConnectionToWebProcess::createSocketStream):
2742         * NetworkProcess/NetworkProcess.h:
2743         * NetworkProcess/NetworkSocketStream.cpp:
2744         (WebKit::NetworkSocketStream::create):
2745         (WebKit::NetworkSocketStream::NetworkSocketStream):
2746         * NetworkProcess/NetworkSocketStream.h:
2747         * NetworkProcess/NetworkStorageSessionProvider.h: Added.
2748         * WebKit.xcodeproj/project.pbxproj:
2749         * WebProcess/Network/WebSocketProvider.cpp:
2750         (WebKit::WebSocketProvider::createSocketStreamHandle):
2751         * WebProcess/Network/WebSocketProvider.h:
2752         * WebProcess/WebPage/WebCookieJar.cpp:
2753         (WebKit::WebCookieJar::WebCookieJar):
2754         * WebProcess/WebPage/WebCookieJar.h:
2755
2756 2019-01-16  Youenn Fablet  <youenn@apple.com>
2757
2758         Add a new SPI for controlling getUserMedia
2759         https://bugs.webkit.org/show_bug.cgi?id=192793
2760
2761         Reviewed by Eric Carlson.
2762
2763         Some weaknesses of the current getUserMedia/enumerateDevices SPI were found.
2764         In particular:
2765         - The hash salt should be handled by WebKit not by apps using WebKit.
2766         - No need to expose the frame URL, only the top level origin is needed.
2767         - The names of the callback are changed to improve the intent of these callbacks.
2768         Addressed these by creating a new SPI which will replace the current one.
2769         The current SPI will be removed later on.
2770
2771         Did some refactoring by making the callbacks not return false.
2772         Instead, implement the default behavior inside the request objects as deny methods.
2773         Some further refactoring will be done as a follow-up to better align the C API with the Cocoa API.
2774
2775         * UIProcess/API/APIUIClient.h:
2776         (API::UIClient::decidePolicyForUserMediaPermissionRequest):
2777         (API::UIClient::checkUserMediaPermissionForOrigin):
2778         * UIProcess/API/C/WKPage.cpp:
2779         (WKPageSetPageUIClient):
2780         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2781         * UIProcess/API/Cocoa/WKWebView.mm:
2782         (-[WKWebView _mediaCaptureState]):
2783         (-[WKWebView _setMediaCaptureMuted:]):
2784         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2785         * UIProcess/API/glib/WebKitUIClient.cpp:
2786         * UIProcess/Cocoa/MediaCaptureUtilities.h: Added.
2787         * UIProcess/Cocoa/MediaCaptureUtilities.mm: Added.
2788         * UIProcess/Cocoa/UIDelegate.h:
2789         * UIProcess/Cocoa/UIDelegate.mm:
2790         (WebKit::UIDelegate::setDelegate):
2791         (WebKit::requestUserMediaAuthorizationForFrame):
2792         (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest):
2793         (WebKit::UIDelegate::UIClient::checkUserMediaPermissionForOrigin):
2794         (WebKit::UIDelegate::UIClient::mediaCaptureStateDidChange):
2795         * UIProcess/UserMediaPermissionCheckProxy.h:
2796         (WebKit::UserMediaPermissionCheckProxy::deny):
2797         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2798         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
2799         (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo):
2800         * UIProcess/UserMediaPermissionRequestProxy.h:
2801
2802 2019-01-16  Youenn Fablet  <youenn@apple.com>
2803
2804         Pipe cache quota request from Network Process to UIProcess
2805         https://bugs.webkit.org/show_bug.cgi?id=193296
2806
2807         Reviewed by Alex Christensen.
2808
2809         When cache storage hits quota for a given origin, pipe the request back to NetworkProcess.
2810         No record will be put until the quota request is answered.
2811         The request is sent from CacheStorage::Caches to CacheStorage::Engine and to NetworkProcess.
2812         NetworkProcess then sends it to NetworkProcessProxy.
2813         Currently NetworkProcessProxy just answers by keeping the quota as it is.
2814         In the future, NetworkProcessProxy should make a delegate call to let the app using WebKit
2815         make a decision on the quota. This will allow prompting user to bump it as done for other data.
2816
2817         * NetworkProcess/NetworkProcess.cpp:
2818         (WebKit::NetworkProcess::requestCacheStorageSpace):
2819         * NetworkProcess/NetworkProcess.h:
2820         * NetworkProcess/cache/CacheStorageEngine.cpp:
2821         (WebKit::CacheStorage::Engine::~Engine):
2822         (WebKit::CacheStorage::Engine::from):
2823         (WebKit::CacheStorage::Engine::Engine):
2824         (WebKit::CacheStorage::Engine::requestSpace):
2825         (WebKit::CacheStorage::Engine::requestSpaceCompleted):
2826         * NetworkProcess/cache/CacheStorageEngine.h:
2827         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
2828         (WebKit::CacheStorage::Cache::put):
2829         (WebKit::CacheStorage::Cache::retryPuttingPendingRecords):
2830         * NetworkProcess/cache/CacheStorageEngineCache.h:
2831         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
2832         (WebKit::CacheStorage::Caches::requestSpace):
2833         (WebKit::CacheStorage::Caches::notifyCachesOfRequestSpaceEnd):
2834         * NetworkProcess/cache/CacheStorageEngineCaches.h:
2835         (WebKit::CacheStorage::Caches::isRequestingSpace const):
2836         * UIProcess/Network/NetworkProcessProxy.cpp:
2837         (WebKit::NetworkProcessProxy::requestCacheStorageSpace):
2838         * UIProcess/Network/NetworkProcessProxy.h:
2839         * UIProcess/Network/NetworkProcessProxy.messages.in:
2840
2841 2019-01-16  Alex Christensen  <achristensen@webkit.org>
2842
2843         sendBeacon to previously-unvisited https domain always fails
2844         https://bugs.webkit.org/show_bug.cgi?id=193508
2845
2846         Reviewed by Geoffrey Garen.
2847
2848         * NetworkProcess/PingLoad.cpp:
2849         (WebKit::PingLoad::didReceiveChallenge):
2850         If a ping load is doing a TLS handshake, continue if the server has good certificates.
2851
2852 2019-01-16  Youenn Fablet  <youenn@apple.com>
2853
2854         ASSERTION FAILED: m_networkLoadInformationByID.contains(identifier) in WebKit::NetworkConnectionToWebProcess::addNetworkLoadInformationMetrics
2855         https://bugs.webkit.org/show_bug.cgi?id=189097
2856         <rdar://problem/43856423>
2857
2858         Reviewed by Alex Christensen.
2859
2860         In case where the inspector is launched, it will instruct the NetworkConnectionToWebProcess to start capturing network metrics.
2861         If this happens in the middle of a load, addNetworkLoadInformationMetrics might fail since addNetworkLoadInformation will not be called.
2862         To fix this issue, store whether to capture metrics at NetworkResourceLoader level.
2863
2864         To ensure that the case of switching back and forth capture of metrics, disable loader capture of metrics whenver NetworkConnectionToWebProcess is asked to.
2865
2866         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2867         (WebKit::NetworkConnectionToWebProcess::setCaptureExtraNetworkLoadMetricsEnabled):
2868         * NetworkProcess/NetworkConnectionToWebProcess.h:
2869         (WebKit::NetworkConnectionToWebProcess::addNetworkLoadInformationMetrics):
2870         * NetworkProcess/NetworkResourceLoader.cpp:
2871         (WebKit::m_shouldCaptureExtraNetworkLoadMetrics):
2872         (WebKit::NetworkResourceLoader::shouldCaptureExtraNetworkLoadMetrics const):
2873         * NetworkProcess/NetworkResourceLoader.h:
2874
2875 2019-01-16  Alex Christensen  <achristensen@webkit.org>
2876
2877         Revert r239938
2878         https://bugs.webkit.org/show_bug.cgi?id=193267
2879         <rdar://problem/47297304>
2880
2881         * Configurations/WebContent-iOS.entitlements:
2882
2883 2019-01-16  Chris Dumez  <cdumez@apple.com>
2884
2885         Regression(r240046) Several API tests are crashing
2886         https://bugs.webkit.org/show_bug.cgi?id=193509
2887
2888         Reviewed by Geoffrey Garen.
2889
2890         The crashes would happen because loadRequestShared() would take a WebProcessProxy& in parameter but
2891         then call reattachToWebProcess() if the page is not valid, which would replace m_process and invalidate
2892         our process reference.
2893
2894         To address the issue, move the reattachToWebProcess() call to loadRequest(), before calling
2895         loadRequestShared(). Also, update *Shared() methods to take a Ref<WebProcessProxy>&& instead
2896         of a WebProcessProxy& in parameter. Since we call client delegates, we need to make sure
2897         our process stays alive.
2898
2899         * UIProcess/ProvisionalPageProxy.cpp:
2900         (WebKit::ProvisionalPageProxy::loadData):
2901         (WebKit::ProvisionalPageProxy::loadRequest):
2902         (WebKit::ProvisionalPageProxy::didCreateMainFrame):
2903         (WebKit::ProvisionalPageProxy::didPerformClientRedirect):
2904         (WebKit::ProvisionalPageProxy::didStartProvisionalLoadForFrame):
2905         (WebKit::ProvisionalPageProxy::didFailProvisionalLoadForFrame):
2906         (WebKit::ProvisionalPageProxy::didNavigateWithNavigationData):
2907         (WebKit::ProvisionalPageProxy::didChangeProvisionalURLForFrame):
2908         (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionAsync):
2909         (WebKit::ProvisionalPageProxy::decidePolicyForResponse):
2910         (WebKit::ProvisionalPageProxy::startURLSchemeTask):
2911         (WebKit::ProvisionalPageProxy::backForwardGoToItem):
2912         * UIProcess/WebPageProxy.cpp:
2913         (WebKit::WebPageProxy::loadRequest):
2914         (WebKit::WebPageProxy::loadRequestWithNavigationShared):
2915         (WebKit::WebPageProxy::loadData):
2916         (WebKit::WebPageProxy::loadDataWithNavigationShared):
2917         (WebKit::WebPageProxy::didPerformDragControllerAction):
2918         (WebKit::WebPageProxy::findPlugin):
2919         (WebKit::WebPageProxy::didCreateMainFrame):
2920         (WebKit::WebPageProxy::didCreateSubframe):
2921         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
2922         (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
2923         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
2924         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrameShared):
2925         (WebKit::WebPageProxy::willPerformClientRedirectForFrame):
2926         (WebKit::WebPageProxy::didCancelClientRedirectForFrame):
2927         (WebKit::WebPageProxy::didChangeProvisionalURLForFrame):
2928         (WebKit::WebPageProxy::didChangeProvisionalURLForFrameShared):
2929         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
2930         (WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared):
2931         (WebKit::WebPageProxy::didCommitLoadForFrame):
2932         (WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
2933         (WebKit::WebPageProxy::didFinishLoadForFrame):
2934         (WebKit::WebPageProxy::didFailLoadForFrame):
2935         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
2936         (WebKit::WebPageProxy::didReceiveTitleForFrame):
2937         (WebKit::WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame):
2938         (WebKit::WebPageProxy::didDisplayInsecureContentForFrame):
2939         (WebKit::WebPageProxy::didRunInsecureContentForFrame):
2940         (WebKit::WebPageProxy::frameDidBecomeFrameSet):
2941         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
2942         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsyncShared):
2943         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2944         (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
2945         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
2946         (WebKit::WebPageProxy::decidePolicyForResponse):
2947         (WebKit::WebPageProxy::decidePolicyForResponseShared):
2948         (WebKit::WebPageProxy::unableToImplementPolicy):
2949         (WebKit::WebPageProxy::willSubmitForm):
2950         (WebKit::WebPageProxy::didNavigateWithNavigationData):
2951         (WebKit::WebPageProxy::didNavigateWithNavigationDataShared):
2952         (WebKit::WebPageProxy::didPerformClientRedirect):
2953         (WebKit::WebPageProxy::didPerformClientRedirectShared):
2954         (WebKit::WebPageProxy::didPerformServerRedirect):
2955         (WebKit::WebPageProxy::didUpdateHistoryTitle):
2956         (WebKit::WebPageProxy::createNewPage):
2957         (WebKit::WebPageProxy::runJavaScriptAlert):
2958         (WebKit::WebPageProxy::runJavaScriptConfirm):
2959         (WebKit::WebPageProxy::runJavaScriptPrompt):
2960         (WebKit::WebPageProxy::unavailablePluginButtonClicked):
2961         (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel):
2962         (WebKit::WebPageProxy::runOpenPanel):
2963         (WebKit::WebPageProxy::printFrame):
2964         (WebKit::WebPageProxy::backForwardGoToItem):
2965         (WebKit::WebPageProxy::backForwardGoToItemShared):
2966         (WebKit::WebPageProxy::learnWord):
2967         (WebKit::WebPageProxy::ignoreWord):
2968         (WebKit::WebPageProxy::didReceiveEvent):
2969         (WebKit::WebPageProxy::editingRangeCallback):
2970         (WebKit::WebPageProxy::rectForCharacterRangeCallback):
2971         (WebKit::WebPageProxy::focusedFrameChanged):
2972         (WebKit::WebPageProxy::frameSetLargestFrameChanged):
2973         (WebKit::WebPageProxy::exceededDatabaseQuota):
2974         (WebKit::WebPageProxy::requestGeolocationPermissionForFrame):
2975         (WebKit::WebPageProxy::requestUserMediaPermissionForFrame):
2976         (WebKit::WebPageProxy::enumerateMediaDevicesForFrame):
2977         (WebKit::WebPageProxy::startURLSchemeTask):
2978         (WebKit::WebPageProxy::startURLSchemeTaskShared):
2979         (WebKit::WebPageProxy::stopURLSchemeTask):
2980         (WebKit::WebPageProxy::loadSynchronousURLSchemeTask):
2981         * UIProcess/WebPageProxy.h:
2982
2983 2019-01-16  Chris Dumez  <cdumez@apple.com>
2984
2985         Regression(PSON) View becomes blank after click a cross-site download link
2986         https://bugs.webkit.org/show_bug.cgi?id=193361
2987         <rdar://problem/47099573>
2988
2989         Reviewed by Geoffrey Garen.
2990
2991         The issue tracked by rdar://problem/47099573 is that a provisional load may get
2992         canceled (or converted into a download) *after* we've decided to process-swap.
2993         In such cases, the view should keep displaying the current site and it should
2994         still be interactive. However, with the previous PSON model, the view (pageProxy)
2995         would have already swapped to the new process and would end up displaying the
2996         initially empty document.
2997
2998         To address the issue, this patch introduces the concept of a provisional load
2999         in the UIProcess, handled by a ProvisionalPageProxy which has its own privisional
3000         process. The WebPageProxy owns the ProvisionalPageProxy but we do not commit the
3001         provisional page until after the load was committed in the new process. This means
3002         that the view / WebPageProxy keeps using the old process and displays the current
3003         content until a load has committed in the provisional page. If no load commits
3004         in the provisional process (e.g. because the load is cancelled or converted into
3005         a download), then we merely destroy the ProvisionalPageProxy and terminate its
3006         process, without impacting the WebPageProxy.
3007
3008         * Shared/WebPageCreationParameters.cpp:
3009         (WebKit::WebPageCreationParameters::encode const):
3010         (WebKit::WebPageCreationParameters::decode):
3011         * Shared/WebPageCreationParameters.h:
3012         Rename isSwapFromSuspended to isProcessSwap for clarity as we always want to
3013         delay attaching the drawing area in case of a process-swap, no matter what
3014         now that the previous process is kept alive until the provisional load is
3015         committed in the new process.
3016
3017         * Shared/WebPolicyAction.h:
3018         Drop Suspend policy action. At decidePolicyForNavigationAction time, in case of
3019         process-swap, we now tell the previous process to simply ignore the load, while
3020         we create a ProvisionalPageProxy to do the new load in a new process.
3021         Suspension of the previous page in the old process, happens later, when a load
3022         is actually committed in the new process.
3023
3024         * Sources.txt:
3025         Add new ProvisionalPageProxy file.
3026
3027         * UIProcess/API/Cocoa/WKWebView.mm:
3028         (-[WKWebView _killWebContentProcessAndResetState]):
3029         When calling _killWebContentProcessAndResetState on a WKWebView, kill both the current
3030         process and the provisional one, to maintain previous behavior in our API tests.
3031
3032         * UIProcess/API/gtk/PageClientImpl.cpp:
3033         (WebKit::PageClientImpl::createDrawingAreaProxy):
3034         * UIProcess/API/gtk/PageClientImpl.h:
3035         * UIProcess/API/wpe/PageClientImpl.cpp:
3036         (WebKit::PageClientImpl::createDrawingAreaProxy):
3037         * UIProcess/API/wpe/PageClientImpl.h:
3038         * UIProcess/AcceleratedDrawingAreaProxy.cpp:
3039         (WebKit::AcceleratedDrawingAreaProxy::AcceleratedDrawingAreaProxy):
3040         (WebKit::AcceleratedDrawingAreaProxy::didUpdateBackingStoreState):
3041         (WebKit::AcceleratedDrawingAreaProxy::sendUpdateBackingStoreState):
3042         (WebKit::AcceleratedDrawingAreaProxy::waitForAndDispatchDidUpdateBackingStoreState):
3043         (WebKit::AcceleratedDrawingAreaProxy::setNativeSurfaceHandleForCompositing):
3044         (WebKit::AcceleratedDrawingAreaProxy::destroyNativeSurfaceHandleForCompositing):
3045         * UIProcess/AcceleratedDrawingAreaProxy.h:
3046         * UIProcess/Cocoa/WebViewImpl.h:
3047         * UIProcess/Cocoa/WebViewImpl.mm:
3048         (WebKit::WebViewImpl::createDrawingAreaProxy):
3049         * UIProcess/DrawingAreaProxy.cpp:
3050         (WebKit::DrawingAreaProxy::DrawingAreaProxy):
3051         (WebKit::DrawingAreaProxy::~DrawingAreaProxy):
3052         (WebKit::DrawingAreaProxy::viewExposedRectChangedTimerFired):
3053         * UIProcess/DrawingAreaProxy.h:
3054         (WebKit::DrawingAreaProxy::process):
3055         * UIProcess/DrawingAreaProxyImpl.cpp:
3056         (WebKit::DrawingAreaProxyImpl::DrawingAreaProxyImpl):
3057         (WebKit::DrawingAreaProxyImpl::update):
3058         * UIProcess/DrawingAreaProxyImpl.h:
3059         * UIProcess/PageClient.h:
3060         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h:
3061         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
3062         (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
3063         (WebKit::RemoteLayerTreeDrawingAreaProxy::~RemoteLayerTreeDrawingAreaProxy):
3064         (WebKit::RemoteLayerTreeDrawingAreaProxy::deviceScaleFactorDidChange):
3065         (WebKit::RemoteLayerTreeDrawingAreaProxy::sendUpdateGeometry):
3066         (WebKit::RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidStart):
3067         (WebKit::RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidEnd):
3068         (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
3069         (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateActivityState):
3070         (WebKit::RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing):
3071         * UIProcess/ios/PageClientImplIOS.h:
3072         * UIProcess/ios/PageClientImplIOS.mm:
3073         (WebKit::PageClientImpl::createDrawingAreaProxy):
3074         * UIProcess/ios/WKContentView.h:
3075         * UIProcess/ios/WKContentView.mm:
3076         (-[WKContentView _createDrawingAreaProxy:]):
3077         * UIProcess/mac/PageClientImplMac.h:
3078         * UIProcess/mac/PageClientImplMac.mm:
3079         (WebKit::PageClientImpl::createDrawingAreaProxy):
3080         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
3081         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
3082         (WebKit::TiledCoreAnimationDrawingAreaProxy::TiledCoreAnimationDrawingAreaProxy):
3083         (WebKit::TiledCoreAnimationDrawingAreaProxy::deviceScaleFactorDidChange):
3084         (WebKit::TiledCoreAnimationDrawingAreaProxy::colorSpaceDidChange):
3085         (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateActivityState):
3086         (WebKit::TiledCoreAnimationDrawingAreaProxy::createFence):
3087         (WebKit::TiledCoreAnimationDrawingAreaProxy::sendUpdateGeometry):
3088         (WebKit::TiledCoreAnimationDrawingAreaProxy::adjustTransientZoom):
3089         (WebKit::TiledCoreAnimationDrawingAreaProxy::commitTransientZoom):
3090         (WebKit::TiledCoreAnimationDrawingAreaProxy::dispatchAfterEnsuringDrawing):
3091         * UIProcess/mac/WebPageProxyMac.mm:
3092         * UIProcess/win/PageClientImpl.cpp:
3093         (WebKit::PageClientImpl::createDrawingAreaProxy):
3094         * UIProcess/win/PageClientImpl.h:
3095         * UIProcess/win/PageClientImpl.cpp:
3096         (WebKit::PageClientImpl::createDrawingAreaProxy):
3097         * UIProcess/win/PageClientImpl.h:
3098         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3099         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
3100         Pass the drawing area's associated process when constructing it and store it as a member
3101         in addition to the page. This is necessary now that a page can be associated with 2
3102         WebProcesses at a time, each having its own drawing area.
3103
3104         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
3105         (WebKit::WebPageProxy::createSandboxExtensionsIfNeeded):
3106         Pass the process.
3107
3108         * UIProcess/ProvisionalPageProxy.cpp: Added.
3109         (WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
3110         (WebKit::ProvisionalPageProxy::~ProvisionalPageProxy):
3111         (WebKit::ProvisionalPageProxy::processDidTerminate):
3112         (WebKit::ProvisionalPageProxy::takeDrawingArea):
3113         (WebKit::ProvisionalPageProxy::cancel):
3114         (WebKit::ProvisionalPageProxy::processDidFinishLaunching):
3115         (WebKit::ProvisionalPageProxy::finishInitializingWebPageAfterProcessLaunch):
3116         (WebKit::ProvisionalPageProxy::initializeWebPage):
3117         (WebKit::ProvisionalPageProxy::loadData):
3118         (WebKit::ProvisionalPageProxy::loadRequest):
3119         (WebKit::ProvisionalPageProxy::goToBackForwardItem):
3120         (WebKit::ProvisionalPageProxy::didCreateMainFrame):
3121         (WebKit::ProvisionalPageProxy::didPerformClientRedirect):
3122         (WebKit::ProvisionalPageProxy::didStartProvisionalLoadForFrame):
3123         (WebKit::ProvisionalPageProxy::didFailProvisionalLoadForFrame):
3124         (WebKit::ProvisionalPageProxy::didCommitLoadForFrame):
3125         (WebKit::ProvisionalPageProxy::didNavigateWithNavigationData):
3126         (WebKit::ProvisionalPageProxy::didChangeProvisionalURLForFrame):
3127         (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionAsync):
3128         (WebKit::ProvisionalPageProxy::decidePolicyForResponse):
3129         (WebKit::ProvisionalPageProxy::startURLSchemeTask):
3130         (WebKit::ProvisionalPageProxy::backForwardGoToItem):
3131         (WebKit::ProvisionalPageProxy::didReceiveMessage):
3132         (WebKit::ProvisionalPageProxy::didReceiveSyncMessage):
3133         * UIProcess/ProvisionalPageProxy.h: Added.
3134         (WebKit::ProvisionalPageProxy::page):
3135         (WebKit::ProvisionalPageProxy::mainFrame const):
3136         (WebKit::ProvisionalPageProxy::process):
3137         (WebKit::ProvisionalPageProxy::processSwapRequestedByClient const):
3138         (WebKit::ProvisionalPageProxy::navigationID const):
3139         (WebKit::ProvisionalPageProxy::drawingArea const):
3140         New WebPageProxy-like class which is owned by the WebPageProxy and proxies IPC from
3141         the provisional process.
3142
3143         * UIProcess/SuspendedPageProxy.cpp:
3144         (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
3145         (WebKit::SuspendedPageProxy::unsuspend):
3146         (WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
3147         Unregister the SuspendedPageProxy as an IPC message receiver a little bit earlier
3148         when we're going to unsuspend it. This avoids conflicting with the ProvisionalPageProxy
3149         which tries to register itself as an IPC message receiver for the same pageID when
3150         a process-swap occurs and we're switching to a suspended page.
3151
3152         * UIProcess/WebFrameProxy.cpp:
3153         (WebKit::WebFrameProxy::isMainFrame const):
3154         WebFrameProxy::isMainFrame() relies on checking that the frame is the WebPageProxy's m_mainFrame.
3155         Now that the WebPageProxy can have a ProvisionalPageProxy, also check if it is the ProvisionalPageProxy's
3156         m_mainFrame to maintain previous behavior.
3157
3158         * UIProcess/WebPageProxy.cpp:
3159         (WebKit::WebPageProxy::provisionalDrawingArea const):
3160         Add getter for the provisional drawing area. We normally only deal with the page's current drawing area, but
3161         the ViewGestureController needs access to the provisional once to display the swipe gesture snapshot.
3162
3163         (WebKit::WebPageProxy::swapToWebProcess):
3164         swapToWebProcess() no longer takes care of unsuspending the SuspendedPage because we now call swapToWebProcess()
3165         later, when a load is actually committed in the provisional page / process. swapToWebProcess() now also needs
3166         to initialize some data members such as the drawing area and the main frame as it is transferring them over from
3167         the ProvisionalPageProxy which started the provisional load.
3168
3169         (WebKit::WebPageProxy::finishAttachingToWebProcess):
3170         We no longer need IsSwapFromSuspended parameter as this is called later now, after a load has actually been
3171         committed in the provisional process.
3172
3173         (WebKit::WebPageProxy::setDrawingArea):
3174         (WebKit::WebPageProxy::initializeWebPage):
3175         - We no longer need IsSwapFromSuspended parameter as this is called later now, after a load has actually been
3176           committed in the provisional process.
3177         - Factor some code out to WebPageProxy::setDrawingArea() so that it can be shared with swapToWebProcess().
3178
3179         (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
3180         (WebKit::WebPageProxy::loadRequest):
3181         (WebKit::WebPageProxy::loadRequestWithNavigationShared):
3182         Only call setPendingAPIRequestURL() in loadRequestWithNavigation() only if ShouldTreatAsContinuingLoad is not
3183         Yes. This avoids hitting some assertions as this was already called during the first API call if needed.
3184
3185         (WebKit::WebPageProxy::loadData):
3186         (WebKit::WebPageProxy::loadDataWithNavigationShared):
3187         (WebKit::WebPageProxy::stopLoading):
3188         (WebKit::WebPageProxy::reload):
3189         (WebKit::WebPageProxy::didPerformDragControllerAction):
3190         (WebKit::WebPageProxy::findPlugin):
3191         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
3192         In case of process swap, tell the previous process to ignore the load instead of suspending it right away.
3193         Suspension now happens later, only if we end up committing the provisional load in the new process.
3194         Also discard the SuspendedPage if it failed to suspend (we only reuse its process in this case). This used
3195         to happen a bit later but it is clearer if we do this as early as possible I think.
3196
3197         (WebKit::WebPageProxy::commitProvisionalPage):
3198         When the load is committed in the new process, we call WebPageProxy::commitProvisionalPage(). It takes care of:
3199         - Actually swapping the WebPageProxy to the new process by calling processDidTerminate() / swapToWebProcess().
3200         - Suspending the current page.
3201         - Letting the client know the load is comitted
3202         - Destroy the ProvisionalPageProxy.
3203         This work used to happen earlier in continueNavigationInNewProcess().
3204
3205         (WebKit::WebPageProxy::continueNavigationInNewProcess):
3206         Moved some of the logic to commitProvisionalPage(). We now merely start the load in a new ProvisionalPageProxy,
3207         without actually having the WebPageProxy switch to the new process yet.
3208
3209         (WebKit::WebPageProxy::didCreateMainFrame):
3210         (WebKit::WebPageProxy::didCreateSubframe):
3211         (WebKit::WebPageProxy::didCreateWindow):
3212         Drop some code that is no longer needed, now that the ProvisionalPageProxy takes care of this.
3213
3214         (WebKit::WebPageProxy::didDestroyNavigation):
3215         On process-swap, when telling the previous process to ignore the load and starting the new load in a new
3216         ProvisionalPageProxy, the previous WebPage attempts to destroy the navigation. In this case, we ignore
3217         the call since the navigation is merely taken over by the ProvisionalPageProxy.
3218
3219         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
3220         (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
3221         Moved some PSON logic to the ProvisionalPageProxy instead.
3222
3223         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
3224         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrameShared):
3225         (WebKit::WebPageProxy::willPerformClientRedirectForFrame):
3226         (WebKit::WebPageProxy::didCancelClientRedirectForFrame):
3227         (WebKit::WebPageProxy::didChangeProvisionalURLForFrame):
3228         (WebKit::WebPageProxy::didChangeProvisionalURLForFrameShared):
3229
3230         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
3231         (WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared):
3232         When didFailProvisionalLoadForFrame() is called for a ProvisionalPageProxy, destroy it.
3233
3234         (WebKit::WebPageProxy::didCommitLoadForFrame):
3235         (WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
3236         (WebKit::WebPageProxy::didFinishLoadForFrame):
3237         (WebKit::WebPageProxy::didFailLoadForFrame):
3238         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
3239         (WebKit::WebPageProxy::didReceiveTitleForFrame):
3240         (WebKit::WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame):
3241         (WebKit::WebPageProxy::didDisplayInsecureContentForFrame):
3242         (WebKit::WebPageProxy::didRunInsecureContentForFrame):
3243         (WebKit::WebPageProxy::frameDidBecomeFrameSet):
3244         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
3245         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsyncShared):
3246         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
3247         (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
3248         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
3249         (WebKit::WebPageProxy::decidePolicyForResponse):
3250         (WebKit::WebPageProxy::decidePolicyForResponseShared):
3251         (WebKit::WebPageProxy::unableToImplementPolicy):
3252         (WebKit::WebPageProxy::willSubmitForm):
3253         (WebKit::WebPageProxy::didNavigateWithNavigationData):
3254         (WebKit::WebPageProxy::didNavigateWithNavigationDataShared):
3255         (WebKit::WebPageProxy::didPerformClientRedirect):
3256         (WebKit::WebPageProxy::didPerformClientRedirectShared):
3257         (WebKit::WebPageProxy::didPerformServerRedirect):
3258         (WebKit::WebPageProxy::didUpdateHistoryTitle):
3259         (WebKit::WebPageProxy::createNewPage):
3260         (WebKit::WebPageProxy::runJavaScriptAlert):
3261         (WebKit::WebPageProxy::runJavaScriptConfirm):
3262         (WebKit::WebPageProxy::runJavaScriptPrompt):
3263         (WebKit::WebPageProxy::unavailablePluginButtonClicked):
3264         (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel):
3265         (WebKit::WebPageProxy::runOpenPanel):
3266         (WebKit::WebPageProxy::printFrame):
3267         (WebKit::WebPageProxy::backForwardGoToItem):
3268         (WebKit::WebPageProxy::backForwardGoToItemShared):
3269         (WebKit::WebPageProxy::learnWord):
3270         (WebKit::WebPageProxy::ignoreWord):
3271         (WebKit::WebPageProxy::didReceiveEvent):
3272         (WebKit::WebPageProxy::editingRangeCallback):
3273         (WebKit::WebPageProxy::rectForCharacterRangeCallback):
3274         (WebKit::WebPageProxy::focusedFrameChanged):
3275         (WebKit::WebPageProxy::frameSetLargestFrameChanged):
3276
3277         (WebKit::WebPageProxy::provisionalProcessDidTerminate):
3278         Cancel the provisiona load and destroy the ProvisionalPageProxy if
3279         the provisional process crashes.
3280
3281         (WebKit::WebPageProxy::resetState):
3282         Drop some code that is no longer needed.
3283
3284         (WebKit::WebPageProxy::creationParameters):
3285         - Move the hasRegisteredServiceWorkers flag initialization from the call site to here now that we have
3286         more than one call site. This was just some bad factoring.
3287         - Take the process in parameter now that we page can be associated with several processes at a time.
3288
3289         (WebKit::WebPageProxy::exceededDatabaseQuota):
3290         (WebKit::WebPageProxy::requestGeolocationPermissionForFrame):
3291         (WebKit::WebPageProxy::requestUserMediaPermissionForFrame):
3292         (WebKit::WebPageProxy::enumerateMediaDevicesForFrame):
3293         (WebKit::WebPageProxy::startURLSchemeTask):
3294         (WebKit::WebPageProxy::startURLSchemeTaskShared):
3295         (WebKit::WebPageProxy::stopURLSchemeTask):
3296         (WebKit::WebPageProxy::loadSynchronousURLSchemeTask):
3297         (WebKit::WebPageProxy::checkURLReceivedFromCurrentOrPreviousWebProcess):
3298         (WebKit::WebPageProxy::willAcquireUniversalFileReadSandboxExtension):
3299         * UIProcess/WebPageProxy.h:
3300         (WebKit::WebPageProxy::visitedLinkStore):
3301         (WebKit::WebPageProxy::provisionalPageProxy const):
3302
3303         * UIProcess/WebProcessProxy.cpp:
3304         (WebKit::WebProcessProxy::hasProvisionalPageWithID const):
3305         (WebKit::WebProcessProxy::updateBackForwardItem):
3306         (WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):
3307         (WebKit::WebProcessProxy::didFinishLaunching):
3308         (WebKit::WebProcessProxy::canTerminateChildProcess):
3309         * UIProcess/WebProcessProxy.h:
3310         (WebKit::WebProcessProxy::addProvisionalPageProxy):
3311         (WebKit::WebProcessProxy::removeProvisionalPageProxy):
3312         Before updating a BackForwardListItem, we normally make sure the process has a WebPageProxy with the
3313         item's pageID. We have to tweak the logic because there may now be no WebPageProxy with this pageID
3314         associated with this process yet, because it is still a ProvisionalPageProxy.        
3315
3316         * UIProcess/WebURLSchemeHandler.cpp:
3317         (WebKit::WebURLSchemeHandler::startTask):
3318         * UIProcess/WebURLSchemeHandler.h:
3319         * UIProcess/WebURLSchemeTask.cpp:
3320         (WebKit::WebURLSchemeTask::create):
3321         (WebKit::WebURLSchemeTask::WebURLSchemeTask):
3322         (WebKit::WebURLSchemeTask::didPerformRedirection):
3323         (WebKit::WebURLSchemeTask::didReceiveResponse):
3324         (WebKit::WebURLSchemeTask::didReceiveData):
3325         (WebKit::WebURLSchemeTask::didComplete):
3326         (WebKit::WebURLSchemeTask::pageDestroyed):
3327         * UIProcess/WebURLSchemeTask.h:
3328         Pass the process when constructing a WebURLSchemeTask and store it as a data member in addition to
3329         the page. This is necessary now that a WebPageProxy can be associated with several WebProcesses.
3330
3331         * UIProcess/ios/ViewGestureControllerIOS.mm:
3332         (WebKit::ViewGestureController::endSwipeGesture):
3333         Use the provisional drawing area to display the swipe snapshot as it may differ from the one currently
3334         associated with the page in case of process swap.
3335
3336         * WebKit.xcodeproj/project.pbxproj:
3337         Add ProvisionalPageProxy class.
3338
3339         * WebProcess/WebPage/WebFrame.cpp:
3340         (WebKit::toPolicyAction):
3341         (WebKit::WebFrame::didReceivePolicyDecision):
3342         * WebProcess/WebPage/WebPage.cpp:
3343         (WebKit::m_shouldAttachDrawingAreaOnPageTransition):
3344         (WebKit::WebPage::reinitializeWebPage):
3345         (WebKit::WebPage::didReceivePolicyDecision):
3346         Stop dealing with WebPolicyAction::Suspend as it no longer exists.
3347
3348         (WebKit::WebPage::didCompletePageTransition):
3349
3350         (WebKit::WebPage::setIsSuspended):
3351         Suspend the Page when setIsSuspended(true) is called, now that there is no longer a WebPolicyAction::Suspend.
3352         setIsSuspended(true) IPC is sent when we actually commit the provisional page.
3353
3354         * WebProcess/WebPage/WebPage.h:
3355
3356 2019-01-16  Tim Horton  <timothy_horton@apple.com>
3357
3358         Frequent null-deref under TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded()
3359         https://bugs.webkit.org/show_bug.cgi?id=193468
3360         <rdar://problem/38645869>
3361
3362         Reviewed by Zalan Bujtas.
3363
3364         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3365         (WebKit::TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded):
3366         Adjust the null-check a bit; Zalan pointed out that the layout could
3367         be responsible for the Frame/RenderView going away, so we should bail
3368         *after* layout, not before.
3369
3370 2019-01-15  Fujii Hironori  <Hironori.Fujii@sony.com>
3371
3372         Unreviewed WinCairo build fix.
3373
3374         * WebProcess/WebPage/WebPageInspectorTargetController.cpp:
3375         (WebKit::WebPageInspectorTargetController::connectInspector): Use 'auto' instead of unprefixed InspectorTarget.
3376         (WebKit::WebPageInspectorTargetController::disconnectInspector): Ditto.
3377         (WebKit::WebPageInspectorTargetController::sendMessageToTargetBackend): Ditto.
3378
3379 2019-01-15  Alex Christensen  <achristensen@webkit.org>
3380
3381         Reduce use of NetworkStorageSession::defaultStorageSession in WebCore
3382         https://bugs.webkit.org/show_bug.cgi?id=193368
3383
3384         Reviewed by Geoff Garen.
3385
3386         * WebProcess/Plugins/PluginView.cpp:
3387         (WebKit::PluginView::getAuthenticationInfo):
3388
3389 2019-01-15  Alex Christensen  <achristensen@webkit.org>
3390
3391         Remove more NetworkProcess::singleton use
3392         https://bugs.webkit.org/show_bug.cgi?id=193484
3393
3394        &n