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