[iOS] Deny mach lookup access to content filter service in the WebContent sandbox
[WebKit.git] / Source / WebKit / ChangeLog
1 2019-12-12  Per Arne Vollan  <pvollan@apple.com>
2
3         [iOS] Deny mach lookup access to content filter service in the WebContent sandbox
4         https://bugs.webkit.org/show_bug.cgi?id=205077
5
6         Reviewed by Brent Fulgham.
7
8         Mach lookup access to the content filter service in the WebContent process is only needed if
9         [WebFilterEvaluator isManagedSession] evaluates to true. If this is the case, issue the needed
10         mach lookup sandbox extension to the WebContent process, where it will be consumed.
11
12         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
13         * Shared/WebProcessCreationParameters.cpp:
14         (WebKit::WebProcessCreationParameters::encode const):
15         (WebKit::WebProcessCreationParameters::decode):
16         * Shared/WebProcessCreationParameters.h:
17         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
18         (WebKit::WebProcessPool::platformInitializeWebProcess):
19         * WebProcess/cocoa/WebProcessCocoa.mm:
20         (WebKit::WebProcess::platformInitializeWebProcess):
21
22 2019-12-12  Carlos Garcia Campos  <cgarcia@igalia.com>
23
24         WebDriver: tests is_element_enabled/enabled.py::test_fieldset_disabled_descendant are failing
25         https://bugs.webkit.org/show_bug.cgi?id=204700
26
27         Reviewed by Carlos Alberto Lopez Perez.
28
29         Add ElementEnabled atom to easily implement is element enabled command.
30
31         * UIProcess/Automation/atoms/ElementEnabled.js: Added.
32         (isEnabled.isDisabledAttributeSupported):
33         (isEnabled.findParent):
34         (isEnabled):
35
36 2019-12-11  Jiewen Tan  <jiewen_tan@apple.com>
37
38         Unreviewed, a nit after r253366
39
40         * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.h:
41         Change the parameter type of the completion handler from NSData to NSString.
42
43 2019-12-11  Daniel Bates  <dabates@apple.com>
44
45         Remove unused Frame parameter from moveByGranularityRespectingWordBoundary() and take const VisiblePosition&
46         https://bugs.webkit.org/show_bug.cgi?id=205137
47
48         Reviewed by Wenson Hsieh.
49
50         moveByGranularityRespectingWordBoundary() never makes use of the passed Frame and does not mutate the
51         passed VisiblePosition. So, do not accept the former and take the latter as a const lvalue reference.
52
53         * WebProcess/WebPage/ios/WebPageIOS.mm:
54         (WebKit::moveByGranularityRespectingWordBoundary):
55         (WebKit::WebPage::requestDocumentEditingContext):
56
57 2019-12-11  Daniel Bates  <dabates@apple.com>
58
59         UIWKDocumentContext returns 0 character rects when caret is at beginning or end of text
60         https://bugs.webkit.org/show_bug.cgi?id=205135
61         <rdar://problem/56887914>
62
63         Reviewed by Wenson Hsieh.
64
65         When the specified position to move from is at the beginning or end of the text then return
66         the position of the beginning or end of the nearest word based on the specified direction.
67
68         Currently we always return the null position. As a result we do not compute a valid
69         character range to convert to rectangles.
70
71         * WebProcess/WebPage/ios/WebPageIOS.mm:
72         (WebKit::moveByGranularityRespectingWordBoundary):
73
74 2019-12-11  Jiewen Tan  <jiewen_tan@apple.com>
75
76         [WebAuthn] Combine AuthenticatorResponse and PublicKeyCredentialData
77         https://bugs.webkit.org/show_bug.cgi?id=190783
78         <rdar://problem/57781183>
79
80         Reviewed by Brent Fulgham.
81
82         Code in WebKit are changed to use AuthenticatorResponse and its subtypes.
83
84         * UIProcess/WebAuthentication/Authenticator.h:
85         * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
86         (WebKit::AuthenticatorManager::respondReceived):
87         (WebKit::AuthenticatorManager::invokePendingCompletionHandler):
88         * UIProcess/WebAuthentication/AuthenticatorManager.h:
89         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
90         (WebKit::LocalAuthenticator::continueMakeCredentialAfterAttested):
91         (WebKit::LocalAuthenticator::continueGetAssertionAfterUserConsented):
92         * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp:
93         (WebKit::WebAuthenticatorCoordinatorProxy::handleRequest):
94         * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.h:
95         * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.messages.in:
96         * UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp:
97         (WebKit::CtapAuthenticator::continueMakeCredentialAfterResponseReceived const):
98         (WebKit::CtapAuthenticator::continueGetAssertionAfterResponseReceived):
99         * UIProcess/WebAuthentication/fido/U2fAuthenticator.cpp:
100         (WebKit::U2fAuthenticator::continueRegisterCommandAfterResponseReceived):
101         (WebKit::U2fAuthenticator::continueSignCommandAfterResponseReceived):
102         * WebProcess/WebAuthentication/WebAuthenticatorCoordinator.cpp:
103
104 2019-12-11  Truitt Savell  <tsavell@apple.com>
105
106         Unreviewed, rolling out r253376.
107
108         Broke internal builds
109
110         Reverted changeset:
111
112         "Move WKWebView code related to testing to new files, with
113         their own headers, and stop exposing test-only functions as
114         SPI."
115         https://bugs.webkit.org/show_bug.cgi?id=205021
116         https://trac.webkit.org/changeset/253376
117
118 2019-12-11  Chris Dumez  <cdumez@apple.com>
119
120         There should be no user-noticeable delay when closing a tab
121         https://bugs.webkit.org/show_bug.cgi?id=205069
122         <rdar://problem/57797494>
123
124         Reviewed by Ryosuke Niwa.
125
126         There should be no user-noticeable delay when closing a tab. To achieve this, use a timeout of 50ms for doing the
127         IPC handshake with the WebContent process, instead of 500ms.
128
129         * UIProcess/WebPageProxy.cpp:
130
131 2019-12-11  Chris Dumez  <cdumez@apple.com>
132
133         [iOS] Issue load sooner on swipe back/forward navigation
134         https://bugs.webkit.org/show_bug.cgi?id=205127
135         <rdar://problem/57843862>
136
137         Reviewed by Tim Horton.
138
139         Issue load sooner on swipe back/forward navigation on iOS. We were waiting until the end of
140         the swipe animation to issue the load. We now issue the load as soon as the user lifts the finger
141         off the screen and thus commits to navigating. This results in improved perceived performance
142         when swiping back/forward to navigate.
143
144         * UIProcess/ViewGestureController.cpp:
145         (WebKit::ViewGestureController::didStartProvisionalOrSameDocumentLoadForMainFrame):
146         (WebKit::ViewGestureController::willEndSwipeGesture):
147         * UIProcess/ViewGestureController.h:
148         * UIProcess/ios/ViewGestureControllerIOS.mm:
149         (WebKit::ViewGestureController::beginSwipeGesture):
150         (WebKit::ViewGestureController::willEndSwipeGesture):
151         (WebKit::ViewGestureController::endSwipeGesture):
152
153 2019-12-11  Sihui Liu  <sihui_liu@apple.com>
154
155         IndexedDB: Introduce WebIDBServer class
156         https://bugs.webkit.org/show_bug.cgi?id=205095
157
158         Reviewed by Alex Christensen.
159
160         Work towards <rdar://problem/56908496>. WebIDBServer currently is just a wrapper of WebCore::IDBServer.
161
162         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
163         (WebKit::WebIDBConnectionToClient::idbServer):
164         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
165         * NetworkProcess/IndexedDB/WebIDBServer.cpp: Added.
166         (WebKit::WebIDBServer::create):
167         (WebKit::WebIDBServer::WebIDBServer):
168         (WebKit::WebIDBServer::registerConnection):
169         (WebKit::WebIDBServer::unregisterConnection):
170         (WebKit::WebIDBServer::closeAndDeleteDatabasesModifiedSince):
171         (WebKit::WebIDBServer::closeAndDeleteDatabasesForOrigins):
172         (WebKit::WebIDBServer::suspend):
173         (WebKit::WebIDBServer::resume):
174         (WebKit::WebIDBServer::openDatabase):
175         (WebKit::WebIDBServer::deleteDatabase):
176         (WebKit::WebIDBServer::abortTransaction):
177         (WebKit::WebIDBServer::commitTransaction):
178         (WebKit::WebIDBServer::didFinishHandlingVersionChangeTransaction):
179         (WebKit::WebIDBServer::createObjectStore):
180         (WebKit::WebIDBServer::deleteObjectStore):
181         (WebKit::WebIDBServer::renameObjectStore):
182         (WebKit::WebIDBServer::clearObjectStore):
183         (WebKit::WebIDBServer::createIndex):
184         (WebKit::WebIDBServer::deleteIndex):
185         (WebKit::WebIDBServer::renameIndex):
186         (WebKit::WebIDBServer::putOrAdd):
187         (WebKit::WebIDBServer::getRecord):
188         (WebKit::WebIDBServer::getAllRecords):
189         (WebKit::WebIDBServer::getCount):
190         (WebKit::WebIDBServer::deleteRecord):
191         (WebKit::WebIDBServer::openCursor):
192         (WebKit::WebIDBServer::iterateCursor):
193         (WebKit::WebIDBServer::establishTransaction):
194         (WebKit::WebIDBServer::databaseConnectionPendingClose):
195         (WebKit::WebIDBServer::databaseConnectionClosed):
196         (WebKit::WebIDBServer::abortOpenAndUpgradeNeeded):
197         (WebKit::WebIDBServer::didFireVersionChangeEvent):
198         (WebKit::WebIDBServer::openDBRequestCancelled):
199         (WebKit::WebIDBServer::getAllDatabaseNames):
200         (WebKit::WebIDBServer::confirmDidCloseFromServer):
201         * NetworkProcess/IndexedDB/WebIDBServer.h: Added.
202         * NetworkProcess/NetworkProcess.cpp: replace WebCore::IDBServer with WebIDBServer.
203         (WebKit::NetworkProcess::deleteWebsiteData):
204         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
205         (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
206         (WebKit::NetworkProcess::prepareToSuspend):
207         (WebKit::NetworkProcess::resume):
208         (WebKit::NetworkProcess::createWebIDBServer):
209         (WebKit::NetworkProcess::webIDBServer):
210         (WebKit::NetworkProcess::createIDBServer): Deleted.
211         (WebKit::NetworkProcess::idbServer): Deleted.
212         * NetworkProcess/NetworkProcess.h:
213         * NetworkProcess/cache/CacheStorageEngine.cpp:
214         (WebKit::CacheStorage::Engine::requestSpace):
215         * Sources.txt:
216         * WebKit.xcodeproj/project.pbxproj:
217
218 2019-12-11  Don Olmstead  <don.olmstead@sony.com>
219
220         [CMake] Add HarfBuzz targets
221         https://bugs.webkit.org/show_bug.cgi?id=205042
222
223         Reviewed by Konstantin Tokarev.
224
225         Use the HarfBuzz targets directly instead of HARFBUZZ_LIBRARIES and
226         HARFBUZZ_INCLUDE_DIRS.
227
228         * PlatformGTK.cmake:
229         * PlatformWPE.cmake:
230
231 2019-12-11  Jiewen Tan  <jiewen_tan@apple.com>
232
233         Unreviewed, a nit after r253366
234
235         * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.h:
236         Improve the naming of the new SPI a bit.
237
238 2019-12-11  Wenson Hsieh  <wenson_hsieh@apple.com>
239
240         Make incremental builds faster after modifying DisplayListItems.h
241         https://bugs.webkit.org/show_bug.cgi?id=205032
242
243         Reviewed by Tim Horton.
244
245         Include DisplayListItems.h directly, since these need to know about the actual display list items (and how to
246         encode or decode them).
247
248         * GPUProcess/GPUConnectionToWebProcess.h:
249
250 2019-12-10  Simon Fraser  <simon.fraser@apple.com>
251
252         Move WKWebView code related to testing to new files, with their own headers, and stop exposing test-only functions as SPI.
253         https://bugs.webkit.org/show_bug.cgi?id=205021
254
255         Reviewed by Tim Horton.
256         
257         Stop exposing WKWebView (WKTesting) as SPI, because everyone added SPI here by mistake, and
258         internal clients kept using testing SPI.
259         
260         Instead, move testing-only functions to internal headers that are not present in the built framework,
261         and move to WKWebView (WKPrivate) properties and functions that webkit clients rely on.
262         
263         Add WKWebViewTesting/WKWebViewTestingMac/WKWebViewTestingIOS for test-only code.
264         
265         WKWebViewTesting* headers are copied to a "WebKitTestSupport" directory in the Products directory, and WTR/DRT and TestWebKitAPI
266         get header search paths to find the headers there.
267
268         * SourcesCocoa.txt:
269         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
270         * UIProcess/API/Cocoa/WKWebView.mm:
271         (-[WKWebView _internalDoAfterNextPresentationUpdate:withoutWaitingForPainting:withoutWaitingForAnimatedResize:]):
272         (-[WKWebView _prepareForImmediateActionAnimation]):
273         (-[WKWebView _cancelImmediateActionAnimation]):
274         (-[WKWebView _completeImmediateActionAnimation]):
275         (-[WKWebView _useSystemAppearance]):
276         (-[WKWebView _setUseSystemAppearance:]):
277         (-[WKWebView _pageRefForTransitionToWKWebView]):
278         (-[WKWebView _canChangeFrameLayout:]):
279         (-[WKWebView _tryToSwipeWithEvent:ignoringPinnedState:]):
280         (-[WKWebView _ignoresNonWheelEvents]):
281         (-[WKWebView _setIgnoresNonWheelEvents:]):
282         (-[WKWebView _hasActiveVideoForControlsManager]):
283         (-[WKWebView _dismissContentRelativeChildWindows]):
284         (-[WKWebView _gestureEventWasNotHandledByWebCore:]):
285         (-[WKWebView _disableFrameSizeUpdates]):
286         (-[WKWebView _enableFrameSizeUpdates]):
287         (-[WKWebView _beginDeferringViewInWindowChanges]):
288         (-[WKWebView _endDeferringViewInWindowChanges]):
289         (-[WKWebView _endDeferringViewInWindowChangesSync]):
290         (-[WKWebView _fullScreenPlaceholderView]):
291         (-[WKWebView _fullScreenWindow]):
292         (-[WKWebView _underlayColor]):
293         (-[WKWebView _setUnderlayColor:]):
294         (-[WKWebView _setCustomSwipeViews:]):
295         (-[WKWebView _setCustomSwipeViewsTopContentInset:]):
296         (-[WKWebView _setDidMoveSwipeSnapshotCallback:]):
297         (-[WKWebView _setFrame:andScrollBy:]):
298         (-[WKWebView _setTotalHeightOfBanners:]):
299         (-[WKWebView _totalHeightOfBanners]):
300         (-[WKWebView _setFont:sender:]):
301         (-[WKWebView _setFontSize:sender:]):
302         (-[WKWebView _setTextColor:sender:]):
303         (-[WKWebView inputAccessoryView]):
304         (-[WKWebView inputView]):
305         (-[WKWebView _requestActivatedElementAtPosition:completionBlock:]):
306         (-[WKWebView _contentVisibleRect]):
307         (-[WKWebView _convertPointFromContentsToView:]):
308         (-[WKWebView _convertPointFromViewToContents:]):
309         (-[WKWebView didStartFormControlInteraction]):
310         (-[WKWebView didEndFormControlInteraction]):
311         (-[WKWebView _uiTextCaretRect]):
312         (-[WKWebView _accessibilityRetrieveRectsAtSelectionOffset:withText:completionHandler:]):
313         (-[WKWebView _accessibilityStoreSelection]):
314         (-[WKWebView _accessibilityClearSelection]):
315         (-[WKWebView _contentViewIsFirstResponder]):
316         (-[WKWebView _inspector]):
317         (-[WKWebView _mainFrame]):
318         (-[WKWebView _isEditable]):
319         (-[WKWebView _setEditable:]):
320         (-[WKWebView _executeEditCommand:argument:completion:]):
321         (-[WKWebView _textManipulationDelegate]):
322         (-[WKWebView _setTextManipulationDelegate:]):
323         (-[WKWebView _startTextManipulationsWithConfiguration:completion:]):
324         (-[WKWebView _completeTextManipulation:completion:]):
325         (-[WKWebView _takeFindStringFromSelection:]):
326         (+[WKWebView _stringForFind]):
327         (+[WKWebView _setStringForFind:]):
328         (-[WKWebView _remoteObjectRegistry]):
329         (-[WKWebView _handle]):
330         (-[WKWebView _observedRenderingProgressEvents]):
331         (-[WKWebView _historyDelegate]):
332         (-[WKWebView _setHistoryDelegate:]):
333         (-[WKWebView _updateMediaPlaybackControlsManager]):
334         (-[WKWebView _canTogglePictureInPicture]):
335         (-[WKWebView _isPictureInPictureActive]):
336         (-[WKWebView _togglePictureInPicture]):
337         (-[WKWebView _closeAllMediaPresentations]):
338         (-[WKWebView _stopMediaCapture]):
339         (-[WKWebView _stopAllMediaPlayback]):
340         (-[WKWebView _suspendAllMediaPlayback]):
341         (-[WKWebView _resumeAllMediaPlayback]):
342         (-[WKWebView _unreachableURL]):
343         (-[WKWebView _mainFrameURL]):
344         (-[WKWebView _loadAlternateHTMLString:baseURL:forUnreachableURL:]):
345         (-[WKWebView _loadData:MIMEType:characterEncodingName:baseURL:userData:]):
346         (-[WKWebView _loadRequest:shouldOpenExternalURLs:]):
347         (-[WKWebView _certificateChain]):
348         (-[WKWebView _committedURL]):
349         (-[WKWebView _MIMEType]):
350         (-[WKWebView _userAgent]):
351         (-[WKWebView _applicationNameForUserAgent]):
352         (-[WKWebView _setApplicationNameForUserAgent:]):
353         (-[WKWebView _customUserAgent]):
354         (-[WKWebView _setCustomUserAgent:]):
355         (-[WKWebView _setUserContentExtensionsEnabled:]):
356         (-[WKWebView _userContentExtensionsEnabled]):
357         (-[WKWebView _webProcessIdentifier]):
358         (-[WKWebView _provisionalWebProcessIdentifier]):
359         (-[WKWebView _killWebContentProcess]):
360         (-[WKWebView _safeBrowsingWarning]):
361         (-[WKWebView _reloadWithoutContentBlockers]):
362         (-[WKWebView _reloadExpiredOnly]):
363         (-[WKWebView _killWebContentProcessAndResetState]):
364         (-[WKWebView _convertRectFromRootViewCoordinates:]):
365         (-[WKWebView _convertRectToRootViewCoordinates:]):
366         (-[WKWebView _requestTextInputContextsInRect:completionHandler:]):
367         (-[WKWebView _focusTextInputContext:completionHandler:]):
368         (-[WKWebView _takePDFSnapshotWithConfiguration:completionHandler:]):
369         (-[WKWebView _setShouldSuppressFirstResponderChanges:]):
370         (-[WKWebView _retainActiveFocusedState]):
371         (-[WKWebView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]):
372         (-[WKWebView _snapshotLayerContentsForBackForwardListItem:]):
373         (-[WKWebView _dataDetectionResults]):
374         (-[WKWebView _accessibilityRetrieveSpeakSelectionContent]):
375         (-[WKWebView _accessibilityDidGetSpeakSelectionContent:]):
376         (-[WKWebView inputAssistantItem]):
377         (-[WKWebView _sessionStateData]):
378         (-[WKWebView _sessionState]):
379         (-[WKWebView _sessionStateWithFilter:]):
380         (-[WKWebView _restoreFromSessionStateData:]):
381         (-[WKWebView _restoreSessionState:andNavigate:]):
382         (-[WKWebView _close]):
383         (-[WKWebView _insertAttachmentWithFilename:contentType:data:options:completion:]):
384         (-[WKWebView _insertAttachmentWithFileWrapper:contentType:options:completion:]):
385         (-[WKWebView _insertAttachmentWithFileWrapper:contentType:completion:]):
386         (-[WKWebView _attachmentForIdentifier:]):
387         (-[WKWebView _simulateDeviceOrientationChangeWithAlpha:beta:gamma:]):
388         (+[WKWebView _handlesSafeBrowsing]):
389         (-[WKWebView _showSafeBrowsingWarningWithTitle:warning:details:completionHandler:]):
390         (-[WKWebView _showSafeBrowsingWarningWithURL:title:warning:details:completionHandler:]):
391         (+[WKWebView _confirmMalwareSentinel]):
392         (+[WKWebView _visitUnsafeWebsiteSentinel]):
393         (-[WKWebView _isJITEnabled:]):
394         (-[WKWebView _evaluateJavaScriptWithoutUserGesture:completionHandler:]):
395         (-[WKWebView _updateWebsitePolicies:]):
396         (-[WKWebView _allowsRemoteInspection]):
397         (-[WKWebView _setAllowsRemoteInspection:]):
398         (-[WKWebView _remoteInspectionNameOverride]):
399         (-[WKWebView _setRemoteInspectionNameOverride:]):
400         (-[WKWebView _addsVisitedLinks]):
401         (-[WKWebView _setAddsVisitedLinks:]):
402         (-[WKWebView _networkRequestsInProgress]):
403         (layoutMilestones):
404         (-[WKWebView _setObservedRenderingProgressEvents:]):
405         (-[WKWebView _getMainResourceDataWithCompletionHandler:]):
406         (-[WKWebView _getWebArchiveDataWithCompletionHandler:]):
407         (-[WKWebView _getContentsAsStringWithCompletionHandler:]):
408         (-[WKWebView _getContentsAsAttributedStringWithCompletionHandler:]):
409         (-[WKWebView _getApplicationManifestWithCompletionHandler:]):
410         (-[WKWebView _paginationMode]):
411         (-[WKWebView _setPaginationMode:]):
412         (-[WKWebView _paginationBehavesLikeColumns]):
413         (-[WKWebView _setPaginationBehavesLikeColumns:]):
414         (-[WKWebView _pageLength]):
415         (-[WKWebView _setPageLength:]):
416         (-[WKWebView _gapBetweenPages]):
417         (-[WKWebView _setGapBetweenPages:]):
418         (-[WKWebView _paginationLineGridEnabled]):
419         (-[WKWebView _setPaginationLineGridEnabled:]):
420         (-[WKWebView _pageCount]):
421         (-[WKWebView _supportsTextZoom]):
422         (-[WKWebView _textZoomFactor]):
423         (-[WKWebView _setTextZoomFactor:]):
424         (-[WKWebView setPageZoom:]):
425         (-[WKWebView pageZoom]):
426         (-[WKWebView _pageZoomFactor]):
427         (-[WKWebView _setPageZoomFactor:]):
428         (-[WKWebView _diagnosticLoggingDelegate]):
429         (-[WKWebView _setDiagnosticLoggingDelegate:]):
430         (-[WKWebView _findDelegate]):
431         (-[WKWebView _setFindDelegate:]):
432         (toFindOptions):
433         (-[WKWebView _countStringMatches:options:maxCount:]):
434         (-[WKWebView _findString:options:maxCount:]):
435         (-[WKWebView _hideFindUI]):
436         (-[WKWebView _saveBackForwardSnapshotForItem:]):
437         (-[WKWebView _inputDelegate]):
438         (-[WKWebView _setInputDelegate:]):
439         (-[WKWebView _isDisplayingStandaloneImageDocument]):
440         (-[WKWebView _isDisplayingStandaloneMediaDocument]):
441         (-[WKWebView _isPlayingAudio]):
442         (-[WKWebView _isShowingNavigationGestureSnapshot]):
443         (-[WKWebView _layoutMode]):
444         (-[WKWebView _setLayoutMode:]):
445         (-[WKWebView _fixedLayoutSize]):
446         (-[WKWebView _setFixedLayoutSize:]):
447         (-[WKWebView _setBackgroundExtendsBeyondPage:]):
448         (-[WKWebView _backgroundExtendsBeyondPage]):
449         (-[WKWebView _viewScale]):
450         (-[WKWebView _setViewScale:]):
451         (-[WKWebView _setMinimumEffectiveDeviceWidth:]):
452         (-[WKWebView _minimumEffectiveDeviceWidth]):
453         (-[WKWebView _setScrollPerformanceDataCollectionEnabled:]):
454         (-[WKWebView _scrollPerformanceDataCollectionEnabled]):
455         (-[WKWebView _scrollPerformanceData]):
456         (-[WKWebView _allowsMediaDocumentInlinePlayback]):
457         (-[WKWebView _setAllowsMediaDocumentInlinePlayback:]):
458         (-[WKWebView _webProcessIsResponsive]):
459         (-[WKWebView _setFullscreenDelegate:]):
460         (-[WKWebView _fullscreenDelegate]):
461         (-[WKWebView _isInFullscreen]):
462         (-[WKWebView _mediaCaptureState]):
463         (-[WKWebView _setMediaCaptureEnabled:]):
464         (-[WKWebView _mediaCaptureEnabled]):
465         (-[WKWebView _setPageMuted:]):
466         (-[WKWebView _removeDataDetectedLinks:]):
467         (-[WKWebView _doAfterNextPresentationUpdate:]):
468         (-[WKWebView _doAfterNextPresentationUpdateWithoutWaitingForPainting:]):
469         (-[WKWebView _doAfterNextStablePresentationUpdate:]):
470         (-[WKWebView _detectDataWithTypes:completionHandler:]):
471         (-[WKWebView removeFromSuperview]):
472         (-[WKWebView _minimumLayoutSizeOverride]):
473         (-[WKWebView _setViewLayoutSizeOverride:]):
474         (-[WKWebView _obscuredInsets]):
475         (-[WKWebView _setObscuredInsets:]):
476         (-[WKWebView _obscuredInsetEdgesAffectedBySafeArea]):
477         (-[WKWebView _setObscuredInsetEdgesAffectedBySafeArea:]):
478         (-[WKWebView _unobscuredSafeAreaInsets]):
479         (-[WKWebView _setUnobscuredSafeAreaInsets:]):
480         (-[WKWebView _safeAreaShouldAffectObscuredInsets]):
481         (-[WKWebView _setInterfaceOrientationOverride:]):
482         (-[WKWebView _interfaceOrientationOverride]):
483         (-[WKWebView _clearInterfaceOrientationOverride]):
484         (-[WKWebView _maximumUnobscuredSizeOverride]):
485         (-[WKWebView _setMaximumUnobscuredSizeOverride:]):
486         (-[WKWebView _setAllowsViewportShrinkToFit:]):
487         (-[WKWebView _allowsViewportShrinkToFit]):
488         (-[WKWebView _beginInteractiveObscuredInsetsChange]):
489         (-[WKWebView _endInteractiveObscuredInsetsChange]):
490         (-[WKWebView _hideContentUntilNextUpdate]):
491         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
492         (-[WKWebView _endAnimatedResize]):
493         (-[WKWebView _resizeWhileHidingContentWithUpdates:]):
494         (-[WKWebView _setOverlaidAccessoryViewsInset:]):
495         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
496         (-[WKWebView _overrideLayoutParametersWithMinimumLayoutSize:maximumUnobscuredSizeOverride:]):
497         (-[WKWebView _clearOverrideLayoutParameters]):
498         (viewportArgumentsFromDictionary):
499         (-[WKWebView _overrideViewportWithArguments:]):
500         (-[WKWebView _viewForFindUI]):
501         (-[WKWebView _isDisplayingPDF]):
502         (-[WKWebView _dataForDisplayedPDF]):
503         (-[WKWebView _suggestedFilenameForDisplayedPDF]):
504         (-[WKWebView _webViewPrintFormatter]):
505         (toUserInterfaceLayoutDirection):
506         (-[WKWebView setSemanticContentAttribute:]):
507         (-[WKWebView _drawsBackground]):
508         (-[WKWebView _setDrawsBackground:]):
509         (-[WKWebView _backgroundColor]):
510         (-[WKWebView _setBackgroundColor:]):
511         (-[WKWebView _setDrawsTransparentBackground:]):
512         (-[WKWebView _inspectorAttachmentView]):
513         (-[WKWebView _setInspectorAttachmentView:]):
514         (-[WKWebView _setOverlayScrollbarStyle:]):
515         (-[WKWebView _overlayScrollbarStyle]):
516         (-[WKWebView _windowOcclusionDetectionEnabled]):
517         (-[WKWebView _setWindowOcclusionDetectionEnabled:]):
518         (-[WKWebView shareSheetDidDismiss:]):
519         (-[WKWebView _setOverrideDeviceScaleFactor:]):
520         (-[WKWebView _overrideDeviceScaleFactor]):
521         (-[WKWebView _setTopContentInset:]):
522         (-[WKWebView _topContentInset]):
523         (-[WKWebView _pageExtendedBackgroundColor]):
524         (-[WKWebView _pinnedState]):
525         (-[WKWebView _rubberBandingEnabled]):
526         (-[WKWebView _setRubberBandingEnabled:]):
527         (-[WKWebView _immediateActionAnimationControllerForHitTestResult:withType:userData:]):
528         (-[WKWebView _setAutomaticallyAdjustsContentInsets:]):
529         (-[WKWebView _automaticallyAdjustsContentInsets]):
530         (-[WKWebView _minimumLayoutWidth]):
531         (-[WKWebView _setMinimumLayoutWidth:]):
532         (-[WKWebView _shouldExpandContentToViewHeightForAutoLayout]):
533         (-[WKWebView _setShouldExpandContentToViewHeightForAutoLayout:]):
534         (-[WKWebView _alwaysShowsHorizontalScroller]):
535         (-[WKWebView _setAlwaysShowsHorizontalScroller:]):
536         (-[WKWebView _alwaysShowsVerticalScroller]):
537         (-[WKWebView _setAlwaysShowsVerticalScroller:]):
538         (-[WKWebView _printOperationWithPrintInfo:]):
539         (-[WKWebView _printOperationWithPrintInfo:forFrame:]):
540         (-[WKWebView setUserInterfaceLayoutDirection:]):
541         (-[WKWebView _wantsMediaPlaybackControlsView]):
542         (-[WKWebView _setWantsMediaPlaybackControlsView:]):
543         (-[WKWebView _mediaPlaybackControlsView]):
544         (-[WKWebView _addMediaPlaybackControlsView:]):
545         (-[WKWebView _removeMediaPlaybackControlsView]):
546         (-[WKWebView _prepareForMoveToWindow:completionHandler:]):
547         (-[WKWebView _setThumbnailView:]):
548         (-[WKWebView _thumbnailView]):
549         (-[WKWebView _setIgnoresAllEvents:]):
550         (-[WKWebView _ignoresAllEvents]):
551         (-[WKWebView _spellCheckerDocumentTag]):
552         (-[WKWebView _setContinuousSpellCheckingEnabledForTesting:]): Deleted.
553         (-[WKWebView _contentsOfUserInterfaceItem:]): Deleted.
554         (-[WKWebView keyboardAccessoryBarNext]): Deleted.
555         (-[WKWebView keyboardAccessoryBarPrevious]): Deleted.
556         (-[WKWebView applyAutocorrection:toString:withCompletionHandler:]): Deleted.
557         (-[WKWebView dismissFormAccessoryView]): Deleted.
558         (-[WKWebView _dismissFilePicker]): Deleted.
559         (-[WKWebView setTimePickerValueToHour:minute:]): Deleted.
560         (-[WKWebView selectFormAccessoryPickerRow:]): Deleted.
561         (-[WKWebView selectFormPopoverTitle]): Deleted.
562         (-[WKWebView textContentTypeForTesting]): Deleted.
563         (-[WKWebView formInputLabel]): Deleted.
564         (-[WKWebView _didShowContextMenu]): Deleted.
565         (-[WKWebView _didDismissContextMenu]): Deleted.
566         (-[WKWebView _inputViewBounds]): Deleted.
567         (-[WKWebView _uiTextSelectionRects]): Deleted.
568         (-[WKWebView _scrollingTreeAsText]): Deleted.
569         (-[WKWebView _stableStateOverride]): Deleted.
570         (-[WKWebView _propertiesOfLayerWithID:]): Deleted.
571         (-[WKWebView _doAfterResettingSingleTapGesture:]): Deleted.
572         (-[WKWebView _doAfterReceivingEditDragSnapshotForTesting:]): Deleted.
573         (-[WKWebView _requestControlledElementID]): Deleted.
574         (-[WKWebView _handleControlledElementIDResponse:]): Deleted.
575         (-[WKWebView _handleAcceptedCandidate:]): Deleted.
576         (-[WKWebView _didHandleAcceptedCandidate]): Deleted.
577         (-[WKWebView _didUpdateCandidateListVisibility:]): Deleted.
578         (-[WKWebView _forceRequestCandidates]): Deleted.
579         (-[WKWebView _shouldRequestCandidates]): Deleted.
580         (-[WKWebView _insertText:replacementRange:]): Deleted.
581         (-[WKWebView _candidateRect]): Deleted.
582         (-[WKWebView viewDidChangeEffectiveAppearance]): Deleted.
583         (-[WKWebView _setHeaderBannerHeight:]): Deleted.
584         (-[WKWebView _setFooterBannerHeight:]): Deleted.
585         (-[WKWebView _doAfterProcessingAllPendingMouseEvents:]): Deleted.
586         (-[WKWebView _activeMenu]): Deleted.
587         (-[WKWebView _requestActiveNowPlayingSessionInfo:]): Deleted.
588         (-[WKWebView _setPageScale:withOrigin:]): Deleted.
589         (-[WKWebView _pageScale]): Deleted.
590         (-[WKWebView _scrollingUpdatesDisabledForTesting]): Deleted.
591         (-[WKWebView _setScrollingUpdatesDisabledForTesting:]): Deleted.
592         (-[WKWebView _doAfterNextPresentationUpdateWithoutWaitingForAnimatedResizeForTesting:]): Deleted.
593         (-[WKWebView _doAfterNextVisibleContentRectUpdate:]): Deleted.
594         (-[WKWebView _disableBackForwardSnapshotVolatilityForTesting]): Deleted.
595         (-[WKWebView _dragCaretRect]): Deleted.
596         (-[WKWebView _simulateLongPressActionAtLocation:]): Deleted.
597         (-[WKWebView _simulateTextEntered:]): Deleted.
598         (-[WKWebView _dynamicUserInterfaceTraitDidChange]): Deleted.
599         (-[WKWebView _beginBackSwipeForTesting]): Deleted.
600         (-[WKWebView _completeBackSwipeForTesting]): Deleted.
601         (-[WKWebView _setDefersLoadingForTesting:]): Deleted.
602         (-[WKWebView _setShareSheetCompletesImmediatelyWithResolutionForTesting:]): Deleted.
603         (-[WKWebView _hasInspectorFrontend]): Deleted.
604         (-[WKWebView _processWillSuspendImminentlyForTesting]): Deleted.
605         (-[WKWebView _processDidResumeForTesting]): Deleted.
606         (-[WKWebView _setAssertionStateForTesting:]): Deleted.
607         (-[WKWebView _hasServiceWorkerBackgroundActivityForTesting]): Deleted.
608         (-[WKWebView _hasServiceWorkerForegroundActivityForTesting]): Deleted.
609         (-[WKWebView _denyNextUserMediaRequest]): Deleted.
610         (-[WKWebView _triggerSystemPreviewActionOnElement:document:page:]): Deleted.
611         * UIProcess/API/Cocoa/WKWebViewInternal.h:
612         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
613         * UIProcess/API/Cocoa/WKWebViewTesting.h: Added.
614         * UIProcess/API/Cocoa/WKWebViewTesting.mm: Added.
615         (-[WKWebView _setPageScale:withOrigin:]):
616         (-[WKWebView _pageScale]):
617         (-[WKWebView _setContinuousSpellCheckingEnabledForTesting:]):
618         (-[WKWebView _contentsOfUserInterfaceItem:]):
619         (-[WKWebView _requestActiveNowPlayingSessionInfo:]):
620         (-[WKWebView _scrollingUpdatesDisabledForTesting]):
621         (-[WKWebView _setScrollingUpdatesDisabledForTesting:]):
622         (-[WKWebView _doAfterNextPresentationUpdateWithoutWaitingForAnimatedResizeForTesting:]):
623         (-[WKWebView _doAfterNextVisibleContentRectUpdate:]):
624         (-[WKWebView _disableBackForwardSnapshotVolatilityForTesting]):
625         (-[WKWebView _beginBackSwipeForTesting]):
626         (-[WKWebView _completeBackSwipeForTesting]):
627         (-[WKWebView _setDefersLoadingForTesting:]):
628         (-[WKWebView _setShareSheetCompletesImmediatelyWithResolutionForTesting:]):
629         (-[WKWebView _hasInspectorFrontend]):
630         (-[WKWebView _processWillSuspendImminentlyForTesting]):
631         (-[WKWebView _processDidResumeForTesting]):
632         (-[WKWebView _setAssertionStateForTesting:]):
633         (-[WKWebView _hasServiceWorkerBackgroundActivityForTesting]):
634         (-[WKWebView _hasServiceWorkerForegroundActivityForTesting]):
635         (-[WKWebView _denyNextUserMediaRequest]):
636         * UIProcess/API/ios/WKWebViewTestingIOS.h: Added.
637         * UIProcess/API/ios/WKWebViewTestingIOS.mm: Added.
638         (-[WKWebView keyboardAccessoryBarNext]):
639         (-[WKWebView keyboardAccessoryBarPrevious]):
640         (-[WKWebView applyAutocorrection:toString:withCompletionHandler:]):
641         (-[WKWebView dismissFormAccessoryView]):
642         (-[WKWebView _dismissFilePicker]):
643         (-[WKWebView setTimePickerValueToHour:minute:]):
644         (-[WKWebView selectFormAccessoryPickerRow:]):
645         (-[WKWebView selectFormPopoverTitle]):
646         (-[WKWebView textContentTypeForTesting]):
647         (-[WKWebView formInputLabel]):
648         (-[WKWebView _didShowContextMenu]):
649         (-[WKWebView _didDismissContextMenu]):
650         (-[WKWebView _inputViewBounds]):
651         (-[WKWebView _uiTextSelectionRects]):
652         (-[WKWebView _scrollingTreeAsText]):
653         (-[WKWebView _stableStateOverride]):
654         (-[WKWebView _propertiesOfLayerWithID:]):
655         (-[WKWebView _doAfterResettingSingleTapGesture:]):
656         (-[WKWebView _doAfterReceivingEditDragSnapshotForTesting:]):
657         (-[WKWebView _dragCaretRect]):
658         (-[WKWebView _simulateLongPressActionAtLocation:]):
659         (-[WKWebView _simulateTextEntered:]):
660         (-[WKWebView _dynamicUserInterfaceTraitDidChange]):
661         (-[WKWebView _triggerSystemPreviewActionOnElement:document:page:]):
662         * UIProcess/API/mac/WKWebViewTestingMac.h: Copied from Tools/TestWebKitAPI/Tests/WebKitCocoa/InteractionDeadlockAfterCrash.mm.
663         * UIProcess/API/mac/WKWebViewTestingMac.mm: Added.
664         (-[WKWebView _requestControlledElementID]):
665         (-[WKWebView _handleControlledElementIDResponse:]):
666         (-[WKWebView _handleAcceptedCandidate:]):
667         (-[WKWebView _didHandleAcceptedCandidate]):
668         (-[WKWebView _didUpdateCandidateListVisibility:]):
669         (-[WKWebView _forceRequestCandidates]):
670         (-[WKWebView _shouldRequestCandidates]):
671         (-[WKWebView _insertText:replacementRange:]):
672         (-[WKWebView _candidateRect]):
673         (-[WKWebView viewDidChangeEffectiveAppearance]):
674         (-[WKWebView _setHeaderBannerHeight:]):
675         (-[WKWebView _setFooterBannerHeight:]):
676         (-[WKWebView _doAfterProcessingAllPendingMouseEvents:]):
677         (-[WKWebView _activeMenu]):
678         * UIProcess/Cocoa/PageClientImplCocoa.mm:
679         * UIProcess/ios/PageClientImplIOS.mm:
680         * UIProcess/ios/WKContentViewInteraction.mm:
681         * UIProcess/ios/WKMouseGestureRecognizer.h:
682         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
683         * UIProcess/mac/PageClientImplMac.mm:
684         * UIProcess/mac/WKFullScreenWindowController.h:
685         * WebKit.xcodeproj/project.pbxproj:
686
687 2019-12-11  Chris Dumez  <cdumez@apple.com>
688
689         Unreviewed iOS build fix after r253343.
690
691         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
692
693 2019-12-11  Jiewen Tan  <jiewen_tan@apple.com>
694
695         [WebAuthn] Implement dummy _WKWebAuthenticationPanel SPIs for CTAP PIN support
696         https://bugs.webkit.org/show_bug.cgi?id=205100
697         <rdar://problem/57822953>
698
699         Reviewed by Brent Fulgham.
700
701         This patch implements dummy _WKWebAuthenticationPanel SPIs for CTAP PIN support.
702         CTAP PIN is a way for authenticators to be able to do user verification by asking
703         clients/users for a pre-set PIN. Here is the spec:
704         https://fidoalliance.org/specs/fido-v2.0-ps-20190130/fido-client-to-authenticator-protocol-v2.0-ps-20190130.html#authenticatorClientPIN
705         In order to support this, WebKit needs to interacts with UIClients to ask users
706         to enter the PINs. Therefore, a new set of SPI is needed.
707
708         Here is the proposed SPI for WebKit to ask Safari for the PIN:
709         @protocol _WKWebAuthenticationPanelDelegate <NSObject>
710         @optional
711         ...
712         - (void)panel:(_WKWebAuthenticationPanel *)panel requestPINWithRetries:(NSUInteger)retries completionHandler:(void (^)(NSData *))completionHandler WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
713         ...
714         @end
715
716         Retries is the number of retires before the authenticator getting blocked, which
717         is a state that only factory reset can save the authenticator. UIClients can have
718         a threshold and WARN users loudly when the threshold is reached.
719         A byte array that is less than or equal to 63 bytes is expected to return to the
720         passed completion handler. Otherwise, the completion handler will bail out.
721
722         For error handling:
723         typedef NS_ENUM(NSInteger, _WKWebAuthenticationPanelUpdate) {
724             ...
725             _WKWebAuthenticationPanelUpdatePINBlocked,
726             _WKWebAuthenticationPanelUpdatePINAuthBlocked,
727             _WKWebAuthenticationPanelUpdatePINInvalid,
728         } WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
729
730         The above three error will be passed to UIClients via updateWebAuthenticationPanel SPI.
731         _WKWebAuthenticationPanelUpdatePINBlocked means the authenticator is dead. A factory
732         reset is needed.
733         _WKWebAuthenticationPanelUpdatePINAuthBlocked means 3 consecutive mismatches. The
734         authenticator will need to be reconnected.
735         _WKWebAuthenticationPanelUpdatePINInvalid means a wrong PIN is provided. This will
736         often be followed with another requestPINWithRetries delegate call.
737         Here is the spec for the error:
738         https://fidoalliance.org/specs/fido-v2.0-ps-20190130/fido-client-to-authenticator-protocol-v2.0-ps-20190130.html#using-pinToken-in-authenticatorMakeCredential.
739
740         * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.h:
741
742 2019-12-10  Chris Dumez  <cdumez@apple.com>
743
744         [macOS] Issue load sooner on swipe back/forward navigation
745         https://bugs.webkit.org/show_bug.cgi?id=205087
746
747         Reviewed by Tim Horton.
748
749         Issue load sooner on swipe back/forward navigation on macOS. We were waiting until the end of
750         the swipe animation to issue the load. We now issue the load as soon as the user lifts the finger
751         off the screen and thus commits to navigating. This results in improved perceived performance
752         when swiping back/forward to navigate.
753
754         This patch does not take care of iOS because the ViewGestureController logic is different on that
755         platform. There is no reason we shouldn't be able to do the same optimization on iOS too though.
756
757         To achieve the behavior change on macOS, the following was done:
758         - Issue the load in ViewGestureController::willEndSwipeGesture() instead of
759           ViewGestureController::endSwipeGesture().
760         - Add a new SnapshotRemovalTracker::Event::SwipeAnimationEnd event and wait for this event before
761           taking away the snapshot. This makes sure we do not take away the swipe snapshot until the swipe
762           animation is actually over (now that we start the navigation during the animation, instead of
763           after).
764         - To make sure that layer being swiped away stays the same until the end of the animation, I added
765           a new SwipeAnimation reason for freezing the layer tree. At the beginning of the animation, the
766           UIProcess sends a FreezeLayerTreeDueToSwipeAnimation IPC to the WebProcess to add this layer tree
767           freeze reason. At the end of the animation, the UIProcess sends the UnfreezeLayerTreeDueToSwipeAnimation
768           IPC to remove this freeze reason. Without this change, the layer being swiped away would sometimes
769           start showing the destination site being loaded before the end of the animation. On cross-process
770           navigation, not freezing the layer tree would cause the swipe animation to get interrupted when
771           we have something to paint in the new process before the end of the swipe animation.
772
773         * UIProcess/ProvisionalPageProxy.cpp:
774         (WebKit::ProvisionalPageProxy::initializeWebPage):
775         * UIProcess/ViewGestureController.cpp:
776         (WebKit::ViewGestureController::SnapshotRemovalTracker::eventsDescription):
777         (WebKit::ViewGestureController::willEndSwipeGesture):
778         (WebKit::ViewGestureController::endSwipeGesture):
779         * UIProcess/ViewGestureController.h:
780         * UIProcess/WebPageProxy.cpp:
781         (WebKit::WebPageProxy::commitProvisionalPage):
782         * UIProcess/WebPageProxy.h:
783         (WebKit::WebPageProxy::isLayerTreeFrozenDueToSwipeAnimation const):
784         * WebProcess/WebPage/WebPage.cpp:
785         (WebKit::WebPage::freezeLayerTreeDueToSwipeAnimation):
786         (WebKit::WebPage::unfreezeLayerTreeDueToSwipeAnimation):
787         * WebProcess/WebPage/WebPage.h:
788         * WebProcess/WebPage/WebPage.messages.in:
789
790 2019-12-10  Fujii Hironori  <Hironori.Fujii@sony.com>
791
792         [Win] Fix MSVC warning C4701: potentially uninitialized local variable 'x' used
793         https://bugs.webkit.org/show_bug.cgi?id=205052
794
795         Reviewed by Don Olmstead.
796
797         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
798         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
799         (WebKit::ResourceLoadStatisticsMemoryStore::shouldRemoveAllButCookiesFor const):
800         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
801         (WebKit::ResourceLoadStatisticsStore::hasStatisticsExpired const):
802         Zero-initialized local variables.
803
804 2019-12-10  Per Arne Vollan  <pvollan@apple.com>
805
806         [iOS] Calls to the device motion API should be done in the UI process
807         https://bugs.webkit.org/show_bug.cgi?id=204770
808
809         Reviewed by Brent Fulgham.
810
811         The class WebDeviceOrientationUpdateProviderProxy will handle messages to start and stop updating device motion
812         in the UI process. Also, add a message to update the device motion in the WebContent process. In the UI process,
813         the device motion API is called through the already existing WebCoreMotionManager class.
814
815         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
816         * UIProcess/ios/WebDeviceOrientationUpdateProviderProxy.h:
817         * UIProcess/ios/WebDeviceOrientationUpdateProviderProxy.messages.in:
818         * UIProcess/ios/WebDeviceOrientationUpdateProviderProxy.mm:
819         (WebKit::WebDeviceOrientationUpdateProviderProxy::startUpdatingDeviceMotion):
820         (WebKit::WebDeviceOrientationUpdateProviderProxy::stopUpdatingDeviceMotion):
821         (WebKit::WebDeviceOrientationUpdateProviderProxy::motionChanged):
822         * WebProcess/WebCoreSupport/WebDeviceOrientationUpdateProvider.cpp:
823         (WebKit::WebDeviceOrientationUpdateProvider::startUpdatingDeviceOrientation):
824         (WebKit::WebDeviceOrientationUpdateProvider::stopUpdatingDeviceOrientation):
825         (WebKit::WebDeviceOrientationUpdateProvider::startUpdatingDeviceMotion):
826         (WebKit::WebDeviceOrientationUpdateProvider::stopUpdatingDeviceMotion):
827         (WebKit::WebDeviceOrientationUpdateProvider::deviceOrientationChanged):
828         (WebKit::WebDeviceOrientationUpdateProvider::deviceMotionChanged):
829         (WebKit::WebDeviceOrientationUpdateProvider::startUpdating): Deleted.
830         (WebKit::WebDeviceOrientationUpdateProvider::stopUpdating): Deleted.
831         * WebProcess/WebCoreSupport/WebDeviceOrientationUpdateProvider.h:
832         * WebProcess/WebCoreSupport/WebDeviceOrientationUpdateProvider.messages.in:
833
834 2019-12-10  Chris Dumez  <cdumez@apple.com>
835
836         Unreviewed, drop debug assertion in InspectorTargetProxy::didCommitProvisionalTarget() that is hitting after r253337
837
838         r253337 causes the ProvisionalPageProxy to get destroyed a little bit early, before didCommitProvisionalTarget()
839         is called. didCommitProvisionalTarget() had an assertion that isProvisional() returns true, which merely checked
840         that the ProvisionalPageProxy is still alive before nulling out its WeakPtr.
841
842         * UIProcess/InspectorTargetProxy.cpp:
843         (WebKit::InspectorTargetProxy::didCommitProvisionalTarget):
844
845 2019-12-10  Per Arne Vollan  <pvollan@apple.com>
846
847         [iOS] Deny mach lookup access to network extension services in the WebContent sandbox
848         https://bugs.webkit.org/show_bug.cgi?id=203929
849
850         Reviewed by Brent Fulgham.
851
852         Mach lookup access to network extension services in the WebContent process is only needed if
853         NEFilterSource.filterRequired is true. If this is the case, issue the needed mach lookup
854         sandbox extensions to the WebContent process, where they will be consumed. Eventually, all
855         the content filtering code should be moved to the Networking process, but since this is a
856         bigger undertaking, we can issue extensions in the meantime to strengthen the sandbox.
857
858         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
859         * Shared/WebProcessCreationParameters.cpp:
860         (WebKit::WebProcessCreationParameters::encode const):
861         (WebKit::WebProcessCreationParameters::decode):
862         * Shared/WebProcessCreationParameters.h:
863         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
864         (WebKit::WebProcessPool::platformInitializeWebProcess):
865         * WebProcess/cocoa/WebProcessCocoa.mm:
866         (WebKit::WebProcess::platformInitializeWebProcess):
867         * WebProcess/com.apple.WebProcess.sb.in:
868
869 2019-12-10  Chris Dumez  <cdumez@apple.com>
870
871         Leverage the fact that WebPageProxy subclasses IPC::MessageSender to simplify IPC sending code
872         https://bugs.webkit.org/show_bug.cgi?id=205065
873
874         Reviewed by Alex Christensen.
875
876         * UIProcess/API/C/WKPage.cpp:
877         (WKPageSetPageLoaderClient):
878         * UIProcess/Automation/WebAutomationSession.cpp:
879         (WebKit::WebAutomationSession::switchToBrowsingContext):
880         (WebKit::WebAutomationSession::evaluateJavaScriptFunction):
881         (WebKit::WebAutomationSession::resolveChildFrameHandle):
882         (WebKit::WebAutomationSession::resolveParentFrameHandle):
883         (WebKit::WebAutomationSession::computeElementLayout):
884         (WebKit::WebAutomationSession::selectOptionElement):
885         (WebKit::WebAutomationSession::setFilesForInputFileUpload):
886         (WebKit::WebAutomationSession::getAllCookies):
887         (WebKit::WebAutomationSession::deleteSingleCookie):
888         (WebKit::WebAutomationSession::takeScreenshot):
889         * UIProcess/RemoteWebInspectorProxy.cpp:
890         (WebKit::RemoteWebInspectorProxy::load):
891         (WebKit::RemoteWebInspectorProxy::sendMessageToFrontend):
892         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
893         (WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy):
894         * UIProcess/WebEditCommandProxy.cpp:
895         (WebKit::WebEditCommandProxy::unapply):
896         (WebKit::WebEditCommandProxy::reapply):
897         * UIProcess/WebFrameProxy.cpp:
898         (WebKit::WebFrameProxy::loadURL):
899         (WebKit::WebFrameProxy::loadData):
900         (WebKit::WebFrameProxy::stopLoading const):
901         * UIProcess/WebInspectorProxy.cpp:
902         (WebKit::WebInspectorProxy::sendMessageToFrontend):
903         (WebKit::WebInspectorProxy::connect):
904         (WebKit::WebInspectorProxy::close):
905         (WebKit::WebInspectorProxy::updateForNewPageProcess):
906         (WebKit::WebInspectorProxy::setFrontendConnection):
907         (WebKit::WebInspectorProxy::showConsole):
908         (WebKit::WebInspectorProxy::showResources):
909         (WebKit::WebInspectorProxy::showMainResourceForFrame):
910         (WebKit::WebInspectorProxy::attach):
911         (WebKit::WebInspectorProxy::detach):
912         (WebKit::WebInspectorProxy::togglePageProfiling):
913         (WebKit::WebInspectorProxy::toggleElementSelection):
914         (WebKit::WebInspectorProxy::openLocalInspectorFrontend):
915         (WebKit::WebInspectorProxy::open):
916         (WebKit::WebInspectorProxy::closeFrontendPageAndWindow):
917         (WebKit::WebInspectorProxy::attachAvailabilityChanged):
918         * UIProcess/WebPageProxy.cpp:
919         (WebKit::WebPageProxy::setUIClient):
920         (WebKit::WebPageProxy::setIconLoadingClient):
921         (WebKit::WebPageProxy::launchProcessForReload):
922         (WebKit::WebPageProxy::launchProcessWithItem):
923         (WebKit::WebPageProxy::initializeWebPage):
924         (WebKit::WebPageProxy::close):
925         (WebKit::WebPageProxy::loadRequestWithNavigationShared):
926         (WebKit::WebPageProxy::loadFile):
927         (WebKit::WebPageProxy::loadAlternateHTML):
928         (WebKit::WebPageProxy::loadWebArchiveData):
929         (WebKit::WebPageProxy::navigateToPDFLinkWithSimulatedClick):
930         (WebKit::WebPageProxy::stopLoading):
931         (WebKit::WebPageProxy::reload):
932         (WebKit::WebPageProxy::goToBackForwardItem):
933         (WebKit::WebPageProxy::tryRestoreScrollPosition):
934         (WebKit::WebPageProxy::setControlledByAutomation):
935         (WebKit::WebPageProxy::setIndicating):
936         (WebKit::WebPageProxy::setBackgroundColor):
937         (WebKit::WebPageProxy::setTopContentInset):
938         (WebKit::WebPageProxy::setUnderlayColor):
939         (WebKit::WebPageProxy::viewWillStartLiveResize):
940         (WebKit::WebPageProxy::viewWillEndLiveResize):
941         (WebKit::WebPageProxy::viewDidEnterWindow):
942         (WebKit::WebPageProxy::dispatchActivityStateChange):
943         (WebKit::WebPageProxy::layerHostingModeDidChange):
944         (WebKit::WebPageProxy::setInitialFocus):
945         (WebKit::WebPageProxy::clearSelection):
946         (WebKit::WebPageProxy::restoreSelectionInFocusedEditableElement):
947         (WebKit::WebPageProxy::validateCommand):
948         (WebKit::WebPageProxy::increaseListLevel):
949         (WebKit::WebPageProxy::decreaseListLevel):
950         (WebKit::WebPageProxy::changeListType):
951         (WebKit::WebPageProxy::setBaseWritingDirection):
952         (WebKit::WebPageProxy::setNeedsFontAttributes):
953         (WebKit::WebPageProxy::scheduleFullEditorStateUpdate):
954         (WebKit::WebPageProxy::selectAll):
955         (WebKit::WebPageProxy::executeEditCommand):
956         (WebKit::WebPageProxy::requestFontAttributesAtSelectionStart):
957         (WebKit::WebPageProxy::setEditable):
958         (WebKit::WebPageProxy::performDragControllerAction):
959         (WebKit::WebPageProxy::dragEnded):
960         (WebKit::WebPageProxy::didStartDrag):
961         (WebKit::WebPageProxy::dragCancelled):
962         (WebKit::WebPageProxy::processNextQueuedMouseEvent):
963         (WebKit::WebPageProxy::sendWheelEvent):
964         (WebKit::WebPageProxy::handleKeyboardEvent):
965         (WebKit::WebPageProxy::handleGestureEvent):
966         (WebKit::WebPageProxy::handlePreventableTouchEvent):
967         (WebKit::WebPageProxy::resetPotentialTapSecurityOrigin):
968         (WebKit::WebPageProxy::handleUnpreventableTouchEvent):
969         (WebKit::WebPageProxy::handleTouchEvent):
970         (WebKit::WebPageProxy::cancelPointer):
971         (WebKit::WebPageProxy::touchWithIdentifierWasRemoved):
972         (WebKit::WebPageProxy::scrollBy):
973         (WebKit::WebPageProxy::centerSelectionInVisibleArea):
974         (WebKit::WebPageProxy::commitProvisionalPage):
975         (WebKit::WebPageProxy::setUserAgent):
976         (WebKit::WebPageProxy::resumeActiveDOMObjectsAndAnimations):
977         (WebKit::WebPageProxy::suspendActiveDOMObjectsAndAnimations):
978         (WebKit::WebPageProxy::setCustomTextEncodingName):
979         (WebKit::WebPageProxy::restoreFromSessionState):
980         (WebKit::WebPageProxy::setTextZoomFactor):
981         (WebKit::WebPageProxy::setPageZoomFactor):
982         (WebKit::WebPageProxy::setPageAndTextZoomFactors):
983         (WebKit::WebPageProxy::scalePage):
984         (WebKit::WebPageProxy::scalePageInViewCoordinates):
985         (WebKit::WebPageProxy::scaleView):
986         (WebKit::WebPageProxy::windowScreenDidChange):
987         (WebKit::WebPageProxy::accessibilitySettingsDidChange):
988         (WebKit::WebPageProxy::setUseFixedLayout):
989         (WebKit::WebPageProxy::setFixedLayoutSize):
990         (WebKit::WebPageProxy::setAlwaysShowsHorizontalScroller):
991         (WebKit::WebPageProxy::setAlwaysShowsVerticalScroller):
992         (WebKit::WebPageProxy::listenForLayoutMilestones):
993         (WebKit::WebPageProxy::setSuppressScrollbarAnimations):
994         (WebKit::WebPageProxy::setEnableVerticalRubberBanding):
995         (WebKit::WebPageProxy::setEnableHorizontalRubberBanding):
996         (WebKit::WebPageProxy::setBackgroundExtendsBeyondPage):
997         (WebKit::WebPageProxy::setPaginationMode):
998         (WebKit::WebPageProxy::setPaginationBehavesLikeColumns):
999         (WebKit::WebPageProxy::setPageLength):
1000         (WebKit::WebPageProxy::setGapBetweenPages):
1001         (WebKit::WebPageProxy::setPaginationLineGridEnabled):
1002         (WebKit::WebPageProxy::findStringMatches):
1003         (WebKit::WebPageProxy::findString):
1004         (WebKit::WebPageProxy::getImageForFindMatch):
1005         (WebKit::WebPageProxy::selectFindMatch):
1006         (WebKit::WebPageProxy::indicateFindMatch):
1007         (WebKit::WebPageProxy::hideFindUI):
1008         (WebKit::WebPageProxy::countStringMatches):
1009         (WebKit::WebPageProxy::replaceMatches):
1010         (WebKit::WebPageProxy::runJavaScriptInMainFrameScriptWorld):
1011         (WebKit::WebPageProxy::runJavaScriptInFrame):
1012         (WebKit::WebPageProxy::getRenderTreeExternalRepresentation):
1013         (WebKit::WebPageProxy::getSourceForFrame):
1014         (WebKit::WebPageProxy::getContentsAsString):
1015         (WebKit::WebPageProxy::getBytecodeProfile):
1016         (WebKit::WebPageProxy::getSamplingProfilerOutput):
1017         (WebKit::WebPageProxy::getContentsAsMHTMLData):
1018         (WebKit::WebPageProxy::getSelectionOrContentsAsString):
1019         (WebKit::WebPageProxy::getSelectionAsWebArchiveData):
1020         (WebKit::WebPageProxy::getMainResourceDataOfFrame):
1021         (WebKit::WebPageProxy::getResourceDataFromFrame):
1022         (WebKit::WebPageProxy::getWebArchiveOfFrame):
1023         (WebKit::WebPageProxy::forceRepaint):
1024         (WebKit::WebPageProxy::preferencesDidChange):
1025         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
1026         (WebKit::WebPageProxy::willSubmitForm):
1027         (WebKit::WebPageProxy::showShareSheet):
1028         (WebKit::WebPageProxy::setMediaVolume):
1029         (WebKit::WebPageProxy::setMuted):
1030         (WebKit::WebPageProxy::stopMediaCapture):
1031         (WebKit::WebPageProxy::stopAllMediaPlayback):
1032         (WebKit::WebPageProxy::suspendAllMediaPlayback):
1033         (WebKit::WebPageProxy::resumeAllMediaPlayback):
1034         (WebKit::WebPageProxy::handleMediaEvent):
1035         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
1036         (WebKit::WebInspectorProxy::platformSave):
1037
1038 2019-12-10  Chris Dumez  <cdumez@apple.com>
1039
1040         Gyroscope (DeviceMotion related) permission cannot be requested in WKWebView unless the client app sets a WKUIDelegate
1041         https://bugs.webkit.org/show_bug.cgi?id=203287
1042
1043         Reviewed by Alex Christensen.
1044
1045         Device orientation / motion events permission dialog would not be shown unless the client app
1046         set a WKUIDelegate on the WKWebView, even though we do not need this WKUIDelegate to show the
1047         prompt.
1048
1049         * UIProcess/API/Cocoa/WKWebView.mm:
1050         (-[WKWebView _deviceOrientationUserPermissionHandler]):
1051         (-[WKWebView _setDeviceOrientationUserPermissionHandler:]):
1052         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1053         * UIProcess/Cocoa/UIDelegate.mm:
1054         (WebKit::UIDelegate::UIClient::shouldAllowDeviceOrientationAndMotionAccess):
1055         * UIProcess/Cocoa/WKOrientationAccessAlert.mm:
1056         (WebKit::presentOrientationAccessAlert):
1057
1058 2019-12-10  Chris Dumez  <cdumez@apple.com>
1059
1060         Unreviewed, drop bad assertion in PreconnectTask::willSendRedirectedRequest()
1061
1062         PreconnectTask::willSendRedirectedRequest() may get called in case of HSTS redirect,
1063         so the ASSERT_NOT_REACHED() is wrong.
1064
1065         * NetworkProcess/PreconnectTask.cpp:
1066         (WebKit::PreconnectTask::willSendRedirectedRequest):
1067
1068 2019-12-10  Commit Queue  <commit-queue@webkit.org>
1069
1070         Unreviewed, rolling out r253212.
1071         https://bugs.webkit.org/show_bug.cgi?id=205074
1072
1073         '<rdar://problem/57771300> REGRESSION (253212): Safari does
1074         not load local html file, base system Safari does not load
1075         RecoveryInformation.html' (Requested by nham on #webkit).
1076
1077         Reverted changeset:
1078
1079         "Drop support for NSURLCache callbacks in NetworkProcess"
1080         https://bugs.webkit.org/show_bug.cgi?id=203344
1081         https://trac.webkit.org/changeset/253212
1082
1083 2019-12-10  Chris Dumez  <cdumez@apple.com>
1084
1085         [WK2][iOS] Visibility propagation view is not properly updated when navigating cross-process
1086         https://bugs.webkit.org/show_bug.cgi?id=205028
1087
1088         Reviewed by Tim Horton.
1089
1090         Make sure we keep the contextIDForVisibilityPropagation on the ProvisionalPageProxy / SuspendedPageProxy
1091         objects and update WebPageProxy::m_contextIDForVisibilityPropagation whenever we commit a provisional
1092         page. Also update ProvisionalPageProxy to listen for the WebPageProxy::DidCreateContextForVisibilityPropagation
1093         IPC so that it can update m_contextIDForVisibilityPropagation once the WebPage is created in the
1094         provisional WebProcess (which creates the visibility propagation view).
1095
1096         * UIProcess/ProvisionalPageProxy.cpp:
1097         (WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
1098         (WebKit::ProvisionalPageProxy::didCreateContextForVisibilityPropagation):
1099         (WebKit::ProvisionalPageProxy::didReceiveMessage):
1100         * UIProcess/ProvisionalPageProxy.h:
1101         (WebKit::ProvisionalPageProxy::contextIDForVisibilityPropagation const):
1102         * UIProcess/SuspendedPageProxy.cpp:
1103         (WebKit::SuspendedPageProxy::SuspendedPageProxy):
1104         * UIProcess/SuspendedPageProxy.h:
1105         * UIProcess/WebPageProxy.cpp:
1106         (WebKit::WebPageProxy::swapToProvisionalPage):
1107         (WebKit::WebPageProxy::commitProvisionalPage):
1108         (WebKit::WebPageProxy::resetState):
1109         (WebKit::WebPageProxy::swapToWebProcess): Deleted.
1110         * UIProcess/WebPageProxy.h:
1111         * UIProcess/ios/WKContentView.mm:
1112         (-[WKContentView _setupVisibilityPropagationView]):
1113         (-[WKContentView _removeVisibilityPropagationView]):
1114
1115 2019-12-10  Chris Dumez  <cdumez@apple.com>
1116
1117         Regression(r253277) ASSERTION FAILED: !parameters.request.httpBody() in NetworkConnectionToWebProcess::preconnectTo()
1118         https://bugs.webkit.org/show_bug.cgi?id=205030
1119
1120         Reviewed by Antti Koivisto.
1121
1122         Instead of using the full request as preconnect request, create a simple one that contains only the destination URL.
1123         This avoids sending a request body unnecessarily over IPC, which was the cause of the assertion.
1124
1125         * WebProcess/WebPage/WebPage.cpp:
1126         (WebKit::WebPage::loadRequest):
1127
1128 2019-12-10  Chris Dumez  <cdumez@apple.com>
1129
1130         Make preconnectTo()'s completionHandler optional
1131         https://bugs.webkit.org/show_bug.cgi?id=205011
1132
1133         Reviewed by Antti Koivisto.
1134
1135         Make preconnectTo()'s completionHandler optional, so that the network process does not unnecessarily
1136         send an IPC back if the client is not interested.
1137
1138         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1139         (WebKit::NetworkConnectionToWebProcess::preconnectTo):
1140         * NetworkProcess/NetworkConnectionToWebProcess.h:
1141         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1142         * WebProcess/Network/WebLoaderStrategy.cpp:
1143         (WebKit::WebLoaderStrategy::preconnectTo):
1144         * WebProcess/Network/WebLoaderStrategy.h:
1145         * WebProcess/WebPage/WebPage.cpp:
1146         (WebKit::WebPage::loadRequest):
1147
1148 2019-12-09  Eric Carlson  <eric.carlson@apple.com>
1149
1150         Rename media in the GPU process preference
1151         https://bugs.webkit.org/show_bug.cgi?id=205013
1152         <rdar://problem/57755319>
1153
1154         Reviewed by Tim Horton.
1155
1156         * Shared/WebPreferences.yaml:
1157         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1158         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1159
1160 2019-12-09  Truitt Savell  <tsavell@apple.com>
1161
1162         Unreviewed, rolling out r253299.
1163
1164         Casued 30+ imported/ test failures on Mac wk2
1165
1166         Reverted changeset:
1167
1168         "Throttling requestAnimationFrame should be controlled by
1169         RenderingUpdateScheduler"
1170         https://bugs.webkit.org/show_bug.cgi?id=204713
1171         https://trac.webkit.org/changeset/253299
1172
1173 2019-12-09  Chris Dumez  <cdumez@apple.com>
1174
1175         Regression(r249329) ViewGestureController::requestRenderTreeSizeNotificationIfNeeded() sometimes uses wrong webPageID for IPC
1176         https://bugs.webkit.org/show_bug.cgi?id=205012
1177
1178         Reviewed by Tim Horton.
1179
1180         * UIProcess/InspectorTargetProxy.cpp:
1181         (WebKit::InspectorTargetProxy::connect):
1182         (WebKit::InspectorTargetProxy::disconnect):
1183         (WebKit::InspectorTargetProxy::sendMessageToTargetBackend):
1184         * UIProcess/ProvisionalPageProxy.cpp:
1185         (WebKit::ProvisionalPageProxy::~ProvisionalPageProxy):
1186         (WebKit::ProvisionalPageProxy::initializeWebPage):
1187         (WebKit::ProvisionalPageProxy::goToBackForwardItem):
1188         (WebKit::ProvisionalPageProxy::messageSenderConnection const):
1189         (WebKit::ProvisionalPageProxy::messageSenderDestinationID const):
1190         * UIProcess/ProvisionalPageProxy.h:
1191         * UIProcess/SuspendedPageProxy.cpp:
1192         (WebKit::SuspendedPageProxy::SuspendedPageProxy):
1193         (WebKit::SuspendedPageProxy::unsuspend):
1194         (WebKit::SuspendedPageProxy::close):
1195         (WebKit::SuspendedPageProxy::messageSenderConnection const):
1196         (WebKit::SuspendedPageProxy::messageSenderDestinationID const):
1197         * UIProcess/SuspendedPageProxy.h:
1198         * UIProcess/WebPageProxy.cpp:
1199         (WebKit::WebPageProxy::continueNavigationInNewProcess):
1200         Have SuspendedPageProxy & ProvisionalPageProxy subclass IPC::MessageSender so that we can call send()
1201         on them without having to pass in a PageIdentifier. Passing a PageIdentifier was error-prone.
1202
1203         * UIProcess/ViewGestureController.cpp:
1204         (WebKit::ViewGestureController::requestRenderTreeSizeNotificationIfNeeded):
1205         When there was a provisonal page proxy, we would properly send the IPC to the provisional page's process
1206         but would use the wrong PageIdentifier for the IPC. We would use the identifier of the committed WebPage
1207         instead of the one of the provisional WebPage.
1208
1209 2019-12-09  Wenson Hsieh  <wenson_hsieh@apple.com>
1210
1211         Finish encoding/decoding support for DisplayList::SetState
1212         https://bugs.webkit.org/show_bug.cgi?id=205018
1213
1214         Reviewed by Tim Horton.
1215
1216         Replaces WebCore::DisplayList::ImageHandle with just WebCore::ImageHandle. See WebCore ChangeLog for more
1217         details.
1218
1219         * Shared/WebCoreArgumentCoders.cpp:
1220         (IPC::ArgumentCoder<ImageHandle>::encode):
1221         (IPC::ArgumentCoder<ImageHandle>::decode):
1222         (IPC::ArgumentCoder<DisplayList::ImageHandle>::encode): Deleted.
1223         (IPC::ArgumentCoder<DisplayList::ImageHandle>::decode): Deleted.
1224         * Shared/WebCoreArgumentCoders.h:
1225
1226 2019-12-09  Said Abou-Hallawa  <sabouhallawa@apple.com>
1227
1228         Throttling requestAnimationFrame should be controlled by RenderingUpdateScheduler
1229         https://bugs.webkit.org/show_bug.cgi?id=204713
1230
1231         Reviewed by Simon Fraser.
1232
1233         Create an IPC message on the DrawingArea to send a message from the
1234         WebProcess to the UIProcess to setPreferredFramesPerSecond of the
1235         DisplayRefreshMonitor.
1236
1237         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h:
1238         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.messages.in:
1239
1240         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
1241         (-[WKOneShotDisplayLinkHandler setPreferredFramesPerSecond:]):
1242         (WebKit::RemoteLayerTreeDrawingAreaProxy::setPreferredFramesPerSecond):
1243         Set the preferredFramesPerSecond of the CADisplayLink.
1244
1245         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.h:
1246         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm:
1247         (WebKit::RemoteLayerTreeDisplayRefreshMonitor::setPreferredFramesPerSecond):
1248         Delegate the call to RemoteLayerTreeDrawingArea.
1249
1250         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
1251         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
1252         (WebKit::RemoteLayerTreeDrawingArea::setPreferredFramesPerSecond):
1253         Send the IPC message from the WebProcess to the UIProcess.
1254
1255 2019-12-09  youenn fablet  <youenn@apple.com>
1256
1257         NetworkResourceLoader should consume its sandbox extensions when starting a fetch through service worker
1258         https://bugs.webkit.org/show_bug.cgi?id=204883
1259         <rdar://problem/57568535>
1260
1261         Reviewed by Alex Christensen.
1262
1263         Consume sandbox extensions in network process before sending fetch task to service worker.
1264         This makes sure network process can send proper sandbox extensions to the service worker and it also ensures
1265         it will have the necessary rights to access the file if the fetch task is not handled by service worker.
1266         Test: http/wpt/service-workers/file-upload.html
1267
1268         * NetworkProcess/NetworkResourceLoader.cpp:
1269         (WebKit::NetworkResourceLoader::consumeSandboxExtensionsIfNeeded):
1270         * NetworkProcess/NetworkResourceLoader.h:
1271         * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp:
1272         (WebKit::ServiceWorkerFetchTask::startFetch):
1273
1274 2019-12-09  Wenson Hsieh  <wenson_hsieh@apple.com>
1275
1276         Unreviewed, fix the macCatalyst build after r253267
1277
1278         * UIProcess/ios/WKContentViewInteraction.mm:
1279         (-[WKContentView deferringGestureRecognizer:shouldDeferOtherGestureRecognizer:]):
1280
1281 2019-12-09  Alex Christensen  <achristensen@webkit.org>
1282
1283         Re-disable TLS1.0 and TLS1.1 by default
1284         https://bugs.webkit.org/show_bug.cgi?id=204922
1285         <rdar://problem/57677752>
1286
1287         Reviewed by Youenn Fablet.
1288
1289         Covered by updated API tests.
1290
1291         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1292         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
1293         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
1294         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1295         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
1296         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
1297         (WebKit::WebsiteDataStore::parameters):
1298
1299 2019-12-09  Chris Dumez  <cdumez@apple.com>
1300
1301         Unreviewed, fix debug assertion for ApplePay API tests on iOS after r253277.
1302
1303         Disable server preconnect if the load will be handled by the LegacyCustomProtocolManager.
1304
1305         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1306         (WebKit::NetworkConnectionToWebProcess::preconnectTo):
1307
1308 2019-12-09  youenn fablet  <youenn@apple.com>
1309
1310         Add an option to capture audio in GPU process
1311         https://bugs.webkit.org/show_bug.cgi?id=205007
1312
1313         Reviewed by Eric Carlson.
1314
1315         Add a flag to make audio capture in GPU process.
1316         In WebProcess, if trying to capture through GPUProcess, send back an error since this is not implemented.
1317
1318         * Shared/WebPreferences.yaml:
1319         * Shared/WebProcessCreationParameters.cpp:
1320         (WebKit::WebProcessCreationParameters::encode const):
1321         (WebKit::WebProcessCreationParameters::decode):
1322         * Shared/WebProcessCreationParameters.h:
1323         * UIProcess/API/APIProcessPoolConfiguration.h:
1324         * UIProcess/API/C/WKPreferences.cpp:
1325         (WKPreferencesSetCaptureAudioInGPUProcessEnabled):
1326         (WKPreferencesGetCaptureAudioInGPUProcessEnabled):
1327         * UIProcess/API/C/WKPreferencesRef.h:
1328         * UIProcess/WebPreferences.cpp:
1329         (WebKit::WebPreferences::updateBoolValueForInternalDebugFeatureKey):
1330         * UIProcess/WebProcessPool.cpp:
1331         (WebKit::WebProcessPool::initializeNewWebProcess):
1332         (WebKit::WebProcessPool::createWebPage):
1333         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1334         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1335         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
1336         (WebKit::UserMediaCaptureManager::initialize):
1337         (WebKit::UserMediaCaptureManager::AudioFactory::createAudioCaptureSource):
1338         * WebProcess/cocoa/UserMediaCaptureManager.h:
1339         (WebKit::UserMediaCaptureManager::AudioFactory::setShouldCaptureInGPUProcess):
1340
1341 2019-12-08  Wenson Hsieh  <wenson_hsieh@apple.com>
1342
1343         Move WebCore::Path encoders and decoders into WebCore from WebCoreArgumentCoders
1344         https://bugs.webkit.org/show_bug.cgi?id=204993
1345
1346         Reviewed by Tim Horton.
1347
1348         Remove Encoder/Decoder support for WebCore::Path.
1349
1350         * Shared/WebCoreArgumentCoders.cpp:
1351         (IPC::pathEncodeApplierFunction): Deleted.
1352         (IPC::ArgumentCoder<Path>::encode): Deleted.
1353         (IPC::ArgumentCoder<Path>::decode): Deleted.
1354         * Shared/WebCoreArgumentCoders.h:
1355
1356 2019-12-08  Chris Dumez  <cdumez@apple.com>
1357
1358         Preconnect to server as early as possible in WebPage::LoadRequest
1359         https://bugs.webkit.org/show_bug.cgi?id=204992
1360
1361         Reviewed by Antti Koivisto.
1362
1363         Preconnect to server as early as possible in WebPage::LoadRequest. This avoids delaying the
1364         connection to the server until after the policy check and is a ~1.3% progression on PLT5 on
1365         both macOS and iOS.
1366
1367         * WebProcess/Network/WebLoaderStrategy.cpp:
1368         (WebKit::WebLoaderStrategy::preconnectTo):
1369         * WebProcess/Network/WebLoaderStrategy.h:
1370         * WebProcess/WebPage/WebPage.cpp:
1371         (WebKit::WebPage::loadRequest):
1372
1373 2019-12-08  youenn fablet  <youenn@apple.com>
1374
1375         Support different resolutions for video tracks captured from UIProcess
1376         https://bugs.webkit.org/show_bug.cgi?id=204945
1377
1378         Reviewed by Eric Carlson.
1379
1380         Change video capture in uiprocess to an experimental flag.
1381         Add support for remote video source cloning by sending some IPC to UIProcess and cloning the source there.
1382         This triggers IPC for both cloning and cloned sources but this allows to do resizing in UIProcess instead of WebProcess.
1383         We thus disable video capture resizing in WebProcess.
1384
1385         * Shared/WebPreferences.yaml:
1386         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
1387         (WebKit::UserMediaCaptureManagerProxy::SourceProxy::start):
1388         (WebKit::UserMediaCaptureManagerProxy::SourceProxy::stop):
1389         (WebKit::UserMediaCaptureManagerProxy::SourceProxy::requestToEnd):
1390         (WebKit::UserMediaCaptureManagerProxy::SourceProxy::preventSourceFromStopping):
1391         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
1392         (WebKit::UserMediaCaptureManagerProxy::startProducingData):
1393         (WebKit::UserMediaCaptureManagerProxy::stopProducingData):
1394         (WebKit::UserMediaCaptureManagerProxy::clone):
1395         (WebKit::UserMediaCaptureManagerProxy::requestToEnd):
1396         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
1397         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
1398         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
1399         (WebKit::UserMediaCaptureManager::Source::sourceID const):
1400         (WebKit::UserMediaCaptureManager::Source::settings const):
1401         (WebKit::UserMediaCaptureManager::Source::remoteVideoSampleAvailable):
1402         (WebKit::UserMediaCaptureManager::Source::requestToEnd):
1403         (WebKit::UserMediaCaptureManager::Source::stopBeingObserved):
1404         (WebKit::UserMediaCaptureManager::cloneSource):
1405         (WebKit::UserMediaCaptureManager::cloneVideoSource):
1406         (WebKit::UserMediaCaptureManager::requestToEnd):
1407         (WebKit::UserMediaCaptureManager::VideoFactory::setVideoCapturePageState):
1408         * WebProcess/cocoa/UserMediaCaptureManager.h:
1409
1410 2019-12-08  youenn fablet  <youenn@apple.com>
1411
1412         Tighten Mac sandbox by removing microphone access
1413         https://bugs.webkit.org/show_bug.cgi?id=204939
1414
1415         Reviewed by Brent Fulgham.
1416
1417         No change of behavior, we do audio capture in UIProcess.
1418
1419         * WebProcess/com.apple.WebProcess.sb.in:
1420
1421 2019-12-08  youenn fablet  <youenn@apple.com>
1422
1423         Add logging to NetworkRTCMonitor
1424         https://bugs.webkit.org/show_bug.cgi?id=204850
1425         <rdar://problem/57618773>
1426
1427         Reviewed by Eric Carlson.
1428
1429         Add logging and send IPC message back to WebProcess even if monitoring is stopped.
1430         No observable change of behavior.
1431
1432         * NetworkProcess/webrtc/NetworkRTCMonitor.cpp:
1433         (WebKit::NetworkRTCMonitor::startUpdatingIfNeeded):
1434         (WebKit::NetworkRTCMonitor::stopUpdating):
1435         (WebKit::NetworkRTCMonitor::onNetworksChanged):
1436
1437 2019-12-07  Said Abou-Hallawa  <sabouhallawa@apple.com>
1438
1439         Make ColorSpace an enum class
1440         https://bugs.webkit.org/show_bug.cgi?id=204970
1441
1442         Reviewed by Sam Weinig.
1443
1444         * Shared/WebCoreArgumentCoders.h:
1445
1446 2019-12-07  Wenson Hsieh  <wenson_hsieh@apple.com>
1447
1448         [iOS] WKWebView touch event gesture recognition should not block the application process main thread when possible
1449         https://bugs.webkit.org/show_bug.cgi?id=204664
1450         <rdar://problem/38670692>
1451
1452         Reviewed by Tim Horton.
1453
1454         Adds a mechanism that allows some sync touch events on iOS to be sent asynchronously. To do this, we use the
1455         deferring gesture mechanism introduced in trac.webkit.org/r253005 to defer all gestures under WKContentView (and
1456         WebKit-owned scroll views) when a touch starts, such that they will not recognize until we know that the page
1457         has either prevented default or not (assuming that the touch was over an active listener). See below for more
1458         details.
1459
1460         Tests: fast/events/touch/ios/prevent-default-on-touch-start-with-slow-event-listener.html
1461                fast/events/touch/ios/scroll-on-touch-start-with-slow-event-listener.html
1462
1463         * UIProcess/GenericCallback.h:
1464         * UIProcess/PageClient.h:
1465         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
1466         (-[WKChildScrollView gestureRecognizer:shouldRequireFailureOfGestureRecognizer:]):
1467         (-[WKChildScrollView gestureRecognizer:shouldBeRequiredToFailByGestureRecognizer:]):
1468
1469         Implement gesture recognizer delegate hooks to add dynamic failure requirements between a child scroll view's
1470         gestures and the new deferring gesture recognizers on WKContentView. This allows pan gestures over a scrollable
1471         container to hold off on recognizing while the deferring gesture recognizer has not failed yet.
1472
1473         * UIProcess/WebPageProxy.cpp:
1474         (WebKit::WebPageProxy::handlePreventableTouchEvent):
1475         (WebKit::WebPageProxy::handleUnpreventableTouchEvent):
1476
1477         Rename handleTouchEventSynchronously and handleTouchEventAsynchronously to handlePreventableTouchEvent and
1478         handleUnpreventableTouchEvent, respectively. Instead of always sending touchstart events that may prevent native
1479         gestures synchronously, we may now go through the same `EventDispatcher::TouchEvent` codepath used when
1480         dispatching touch events in passive tracking regions. However, in the case of preventable touchstarts, we
1481         additionally store a completion callback that is invoked after the touch event has been handled by the page; we
1482         then either un-defer or prevent native gestures here (depending on whether the page prevented default) by
1483         calling PageClient::doneDeferringNativeGestures.
1484
1485         Non-touchstart events are still dispatched synchronously, to ensure that calling preventDefault() on touchmove
1486         and touchend continue to prevent default gestures from recognizing.
1487
1488         (WebKit::WebPageProxy::boolCallback):
1489         (WebKit::WebPageProxy::handleTouchEventSynchronously): Deleted.
1490         (WebKit::WebPageProxy::handleTouchEventAsynchronously): Deleted.
1491
1492         See above.
1493
1494         * UIProcess/WebPageProxy.h:
1495         (WebKit::WebPageProxy::isHandlingPreventableTouchStart const):
1496
1497         This is used in WKContentView to determine whether deferring gestures need to remain active after the touch
1498         ends. See below for more detail.
1499
1500         * UIProcess/WebPageProxy.messages.in:
1501         * UIProcess/ios/PageClientImplIOS.h:
1502         * UIProcess/ios/PageClientImplIOS.mm:
1503         (WebKit::PageClientImpl::doneDeferringNativeGestures):
1504         * UIProcess/ios/WKContentViewInteraction.h:
1505         * UIProcess/ios/WKContentViewInteraction.mm:
1506         (-[UIGestureRecognizer _wk_cancel]):
1507         (-[WKContentView setupInteraction]):
1508         (-[WKContentView cleanupInteraction]):
1509         (-[WKContentView _removeDefaultGestureRecognizers]):
1510         (-[WKContentView _addDefaultGestureRecognizers]):
1511
1512         Add and remove the new deferring gesture recognizers here.
1513
1514         (-[WKContentView _webTouchEventsRecognized:]):
1515         (-[WKContentView _webTouchEvent:preventsNativeGestures:]):
1516         (-[WKContentView _doneDeferringNativeGestures:]):
1517         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
1518         (-[WKContentView ensurePositionInformationIsUpToDate:]):
1519
1520         Drive-by fix: add a missing hasRunningProcess check that causes a flaky assertion under
1521         `AuxiliaryProcessProxy::connection()` in layout tests.
1522
1523         (-[WKContentView gestureRecognizer:shouldRequireFailureOfGestureRecognizer:]):
1524         (-[WKContentView gestureRecognizer:shouldBeRequiredToFailByGestureRecognizer:]):
1525
1526         Add dynamic failure requirements between WKContentView's gestures (including all text interaction, context menu,
1527         and drag and drop gestures) and the new deferring gesture recognizers.
1528
1529         (-[WKContentView _didStartProvisionalLoadForMainFrame]):
1530
1531         Force the two-finger double tap gesture recognizer to reset when loading a new page. Without this, the layout
1532         test fast/events/ios/click-event-while-editing-node.html will rarely fail when run after a test that dispatches
1533         a two-finger tap, such as fast/events/ios/click-event-two-finger-single-tap-meta-key.html. This is because the
1534         new deferring gestures will temporarily unite multi-finger tap gestures with one-finger double tap gestures in
1535         the same subgraph when performing a tap gesture with more than one finger. This means that there's a 300 ms
1536         delay before a normal single tap can be recognized again, which (without forcing the two-finger double tap to
1537         reset) would cause a subsequent test that loads in under 300 ms and attempts to send a tap to fail.
1538
1539         (-[WKContentView deferringGestureRecognizer:shouldDeferGesturesAfterBeginningTouchesWithEvent:]):
1540
1541         Avoid deferring native gestures if the scroll view is decelerating; this matches behavior of the web touch event
1542         gesture recognizer.
1543
1544         (-[WKContentView deferringGestureRecognizer:shouldDeferGesturesAfterEndingTouchesWithEvent:]):
1545
1546         Normally, after -touchesEnded:withEvent:, we stop deferring native gesture recognizers by failing the deferring
1547         gestures. However, if we're still waiting for a response from the web process, then let
1548         -_doneDeferringNativeGestures: handle this instead.
1549
1550         (-[WKContentView deferringGestureRecognizer:shouldDeferOtherGestureRecognizer:]):
1551         (-[WKContentView deferringGestureRecognizer:shouldDeferGesturesWithEvent:]): Deleted.
1552
1553         Renamed to -shouldDeferGesturesAfterBeginningTouchesWithEvent:.
1554
1555         * UIProcess/ios/WKDeferringGestureRecognizer.h:
1556         * UIProcess/ios/WKDeferringGestureRecognizer.mm:
1557         (-[WKDeferringGestureRecognizer touchesBegan:withEvent:]):
1558         (-[WKDeferringGestureRecognizer touchesEnded:withEvent:]):
1559
1560         Override this and add a new delegate hook to determine whether we want the deferring gesture recognizer to
1561         immediately fail when touches end. It's important to override this and transition to failure state in this case,
1562         since not doing so could mean that the deferring gestures stay in Possible state forever; this may lead to the
1563         gesture subgraph containing these deferring gestures being unable to reset, since it's waiting for the deferring
1564         gesture to either fail or end.
1565
1566         * UIProcess/ios/WKScrollView.mm:
1567         (-[WKScrollView gestureRecognizer:shouldRequireFailureOfGestureRecognizer:]):
1568         (-[WKScrollView gestureRecognizer:shouldBeRequiredToFailByGestureRecognizer:]):
1569
1570         Defer more scroll view gestures.
1571
1572         * WebProcess/WebPage/EventDispatcher.cpp:
1573         (WebKit::EventDispatcher::touchEvent):
1574
1575         Add an optional CallbackID parameter to this IPC message. If a callback ID is given, then we avoid coalescing
1576         the touch event. To implement this, we additionally refactor the queued touch events map to contain lists of
1577         <WebTouchEvent, Optional<CallbackID>> pairs; if a queued touch event has a corresponding CallbackID, then we
1578         fire the callback corresponding to the ID, indicating whether the touch event was handled by the page.
1579
1580         * WebProcess/WebPage/EventDispatcher.h:
1581         * WebProcess/WebPage/EventDispatcher.messages.in:
1582         * WebProcess/WebPage/WebPage.h:
1583         * WebProcess/WebPage/ios/WebPageIOS.mm:
1584         (WebKit::WebPage::dispatchAsynchronousTouchEvents):
1585
1586 2019-12-07  David Quesada  <david_quesada@apple.com>
1587
1588         REGRESSION(r253231): Debug assertion failures under ~WebDeviceOrientationUpdateProvider(Proxy)
1589         https://bugs.webkit.org/show_bug.cgi?id=204977
1590         rdar://problem/57724251
1591
1592         Reviewed by Per Arne Vollan.
1593
1594         In the UI process, have the WebPageProxy swap out its WebDeviceOrientationUpdateProviderProxy whenever
1595         it connects to a new process, instead of creating one on construction and holding onto it for the rest
1596         of the WebPageProxy lifetime. The …UpdateProviderProxy assumes that its page will have the same ID
1597         at the time of registering as a message receiver and later unregistering, but the page ID could change
1598         if the WebPageProxy swaps web processes. Using a new instance per web page ID ensures that the
1599         updater is always able to successfully remove itself as a message receiver when deallocating.
1600
1601         In the Web process, ~WebDeviceOrientationUpdateProvider() should remove itself as a message receiver
1602         specifically for its page ID, rather than as a global message receiver.
1603
1604         No new tests -- existing tests (at least the ProcessSwap API tests) revealed the regression.
1605
1606         * UIProcess/WebPageProxy.cpp:
1607         (WebKit::m_tryCloseTimeoutTimer):
1608         (WebKit::WebPageProxy::didAttachToRunningProcess):
1609         (WebKit::WebPageProxy::resetState):
1610         (WebKit::m_webDeviceOrientationUpdateProviderProxy): Deleted.
1611         * UIProcess/WebPageProxy.h:
1612         * UIProcess/ios/WebDeviceOrientationUpdateProviderProxy.h:
1613         * WebProcess/WebCoreSupport/WebDeviceOrientationUpdateProvider.cpp:
1614         (WebKit::WebDeviceOrientationUpdateProvider::WebDeviceOrientationUpdateProvider):
1615         (WebKit::WebDeviceOrientationUpdateProvider::~WebDeviceOrientationUpdateProvider):
1616         * WebProcess/WebCoreSupport/WebDeviceOrientationUpdateProvider.h:
1617
1618 2019-12-07  Tim Horton  <timothy_horton@apple.com>
1619
1620         Implement encoding for DrawImage and DrawRoundedRect display list items
1621         https://bugs.webkit.org/show_bug.cgi?id=204881
1622
1623         Reviewed by Simon Fraser.
1624
1625         * Shared/WebCoreArgumentCoders.cpp:
1626         (IPC::ArgumentCoder<DisplayList::ImageHandle>::encode):
1627         (IPC::ArgumentCoder<DisplayList::ImageHandle>::decode):
1628         * Shared/WebCoreArgumentCoders.h:
1629
1630 2019-12-06  Commit Queue  <commit-queue@webkit.org>
1631
1632         Unreviewed, rolling out r253218.
1633         https://bugs.webkit.org/show_bug.cgi?id=204968
1634
1635         Broke the build (Requested by ap on #webkit).
1636
1637         Reverted changeset:
1638
1639         "Remove various .order files."
1640         https://bugs.webkit.org/show_bug.cgi?id=204959
1641         https://trac.webkit.org/changeset/253218
1642
1643 2019-12-06  Chris Dumez  <cdumez@apple.com>
1644
1645         [IPC] MESSAGE_CHECK() parameters for AddPlugInAutoStartOriginHash / PlugInDidReceiveUserInteraction IPCs
1646         https://bugs.webkit.org/show_bug.cgi?id=204962
1647
1648         Reviewed by Ryosuke Niwa.
1649
1650         MESSAGE_CHECK() parameters for AddPlugInAutoStartOriginHash / PlugInDidReceiveUserInteraction IPCs. Those parameters
1651         are used as keys in HashMaps.
1652
1653         * UIProcess/Plugins/PlugInAutoStartProvider.cpp:
1654         (WebKit::PlugInAutoStartProvider::PlugInAutoStartProvider):
1655         (WebKit::PlugInAutoStartProvider::addAutoStartOriginHash):
1656         (WebKit::PlugInAutoStartProvider::setAutoStartOriginsTableWithItemsPassingTest):
1657         (WebKit::PlugInAutoStartProvider::didReceiveUserInteraction):
1658         * UIProcess/Plugins/PlugInAutoStartProvider.h:
1659         * UIProcess/WebProcessProxy.cpp:
1660         (WebKit::WebProcessProxy::addPlugInAutoStartOriginHash):
1661         (WebKit::WebProcessProxy::plugInDidReceiveUserInteraction):
1662
1663 2019-12-06  Per Arne Vollan  <pvollan@apple.com>
1664
1665         [iOS] Calls to device orientation API should be done in the UI process
1666         https://bugs.webkit.org/show_bug.cgi?id=204720
1667
1668         Reviewed by Alex Christensen.
1669
1670         Add a new class, WebDeviceOrientationUpdateProviderProxy, to handle messages to start and stop updating device orientation
1671         in the UI process. Also, add a message to update the device orientation in the WebContent process. In the UI process, the
1672         device orientation API is called through the already existing WebCoreMotionManager class.
1673
1674         * DerivedSources-input.xcfilelist:
1675         * DerivedSources-output.xcfilelist:
1676         * DerivedSources.make:
1677         * UIProcess/WebPageProxy.cpp:
1678         (WebKit::m_webDeviceOrientationUpdateProviderProxy):
1679         (WebKit::m_resetRecentCrashCountTimer): Deleted.
1680         * UIProcess/WebPageProxy.h:
1681         * WebKit.xcodeproj/project.pbxproj:
1682         * WebProcess/WebPage/WebPage.cpp:
1683         (WebKit::m_overriddenMediaType):
1684
1685 2019-12-06  Chris Dumez  <cdumez@apple.com>
1686
1687         Reduce timeout for page to handle beforeunload events when trying to close a page
1688         https://bugs.webkit.org/show_bug.cgi?id=204950
1689         <rdar://problem/57700419>
1690
1691         Reviewed by Ryosuke Niwa.
1692
1693         Reduce timeout for page to handle beforeunload events when trying to close a page. It would previously
1694         take up to 3 seconds to actually close a tab after the user would click on the "X" to close it. This
1695         is because we would wait for the page to fire and handle the beforeunload events and only give up after
1696         3 seconds. This patch reduces this timeout to something more reasonable from a user standpoint (500ms).
1697
1698         * UIProcess/WebPageProxy.cpp:
1699         (WebKit::m_tryCloseTimeoutTimer):
1700         (WebKit::WebPageProxy::tryClose):
1701         (WebKit::WebPageProxy::tryCloseTimedOut):
1702         (WebKit::WebPageProxy::closePage):
1703         (WebKit::m_resetRecentCrashCountTimer): Deleted.
1704         * UIProcess/WebPageProxy.h:
1705
1706 2019-12-06  Jonathan Bedard  <jbedard@apple.com>
1707
1708         Python 3: Add support in webkitpy.test
1709         https://bugs.webkit.org/show_bug.cgi?id=204952
1710
1711         Reviewed by Stephanie Lewis.
1712
1713         Tested by test-webkitpy.
1714
1715         * Scripts/webkit/messages_unittest.py: Use Python 2/3 compatible StringIO.
1716
1717 2019-12-06  Keith Miller  <keith_miller@apple.com>
1718
1719         Remove various .order files.
1720         https://bugs.webkit.org/show_bug.cgi?id=204959
1721
1722         Reviewed by Yusuke Suzuki.
1723
1724         These files are all super out of date and likely don't do anything anymore.
1725         The signatures of the functions have changed thus the mangled name has changed.
1726
1727         * mac/WebKit2.order: Removed.
1728
1729 2019-12-06  Dan Bernstein  <mitz@apple.com>
1730
1731         Address <https://bugs.webkit.org/show_bug.cgi?id=189222#c3>
1732
1733         * UIProcess/API/Cocoa/WKWebView.mm:
1734         (-[WKWebView valueForUndefinedKey:]): Added a newline.
1735
1736 2019-12-06  Benjamin Nham  <nham@apple.com>
1737
1738         Drop support for NSURLCache callbacks in NetworkProcess
1739         https://bugs.webkit.org/show_bug.cgi?id=203344
1740
1741         Reviewed by Alex Christensen.
1742
1743         Remove the NSURLSession caching policy callback in NetworkProcess. It's no longer necessary since
1744         we don't use NSURLCache in NetworkProcess (https://bugs.webkit.org/show_bug.cgi?id=185990).
1745
1746         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1747         (-[WKNetworkSessionDelegate URLSession:dataTask:willCacheResponse:completionHandler:]): Deleted.
1748
1749 2019-12-05  Chris Dumez  <cdumez@apple.com>
1750
1751         Stop using reserveCapacity() / reserveInitialCapacity() in IPC decoders
1752         https://bugs.webkit.org/show_bug.cgi?id=204930
1753         <rdar://problem/57682737>
1754
1755         Reviewed by Ryosuke Niwa.
1756
1757         This is IPC hardening since the size we use to reserve the capacity is encoded over IPC
1758         and cannot be trusted in some cases.
1759
1760         * Platform/IPC/ArgumentCoders.h:
1761         * Shared/WebCoreArgumentCoders.cpp:
1762         (IPC::ArgumentCoder<Vector<RefPtr<SecurityOrigin>>>::decode):
1763
1764 2019-12-06  youenn fablet  <youenn@apple.com>
1765
1766         Protect WebRTC network monitoring to wait forever in edge cases
1767         https://bugs.webkit.org/show_bug.cgi?id=204846
1768
1769         Reviewed by Eric Carlson.
1770
1771         We were limiting the number of IPC message sent to network process by only sending the start monitoring event for the first client.
1772         The issue is that, if network process crashes for instance while having not yet given the list of networks, all clients will be hanging
1773         waiting for the completion of network list.
1774         We are now sending an IPC message for every client and the network process will ignore the ones that are not useful.
1775         In addition, in case of network process crash, we send a signal that network list has changed to make sure clients will never hang.
1776         They might still fail connecting, which is ok since network process crashed.
1777
1778         Test: webrtc/datachannel/gather-candidates-networkprocess-crash.html
1779
1780         * NetworkProcess/webrtc/NetworkRTCMonitor.cpp:
1781         (WebKit::NetworkRTCMonitor::startUpdatingIfNeeded):
1782         * NetworkProcess/webrtc/NetworkRTCMonitor.h:
1783         * NetworkProcess/webrtc/NetworkRTCMonitor.messages.in:
1784         * WebProcess/Network/webrtc/LibWebRTCNetwork.h:
1785         (WebKit::LibWebRTCNetwork::networkProcessCrashed):
1786         * WebProcess/Network/webrtc/WebRTCMonitor.cpp:
1787         (WebKit::WebRTCMonitor::StartUpdating):
1788         (WebKit::WebRTCMonitor::StopUpdating):
1789         (WebKit::WebRTCMonitor::networksChanged):
1790         (WebKit::WebRTCMonitor::networkProcessCrashed):
1791         * WebProcess/Network/webrtc/WebRTCMonitor.h:
1792         * WebProcess/WebProcess.cpp:
1793         (WebKit::WebProcess::networkProcessConnectionClosed):
1794
1795 2019-12-06  youenn fablet  <youenn@apple.com>
1796
1797         Output libwebrtc logging from Network Process as release logging
1798         https://bugs.webkit.org/show_bug.cgi?id=204853
1799
1800         Reviewed by Eric Carlson.
1801
1802         This will help debugging WebRTC networking issues.
1803         No observable change of behavior.
1804
1805         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
1806         (WebKit::doReleaseLogging):
1807         (WebKit::NetworkRTCProvider::NetworkRTCProvider):
1808
1809 2019-12-05  Yousuke Kimoto  <yousuke.kimoto@sony.com>
1810
1811         [WinCairo] Improve Inspectable Target Page to adapt a long title and URL
1812         https://bugs.webkit.org/show_bug.cgi?id=204874
1813
1814         Reviewed by Fujii Hironori.
1815
1816         Add some CSS atributes to make such long titles and URLs fit the width
1817         of a window size. Then "Inspector" button is shown at the visible area.
1818         No new tests, since there is no change in behavior.
1819
1820         * UIProcess/socket/RemoteInspectorProtocolHandler.cpp:
1821         (WebKit::RemoteInspectorProtocolHandler::platformStartTask):
1822
1823 2019-12-05  Fujii Hironori  <Hironori.Fujii@sony.com>
1824
1825         [WebKit] Fix compilation warnings for MSVC
1826         https://bugs.webkit.org/show_bug.cgi?id=204661
1827
1828         Reviewed by Don Olmstead.
1829
1830         No behavior changes.
1831
1832         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
1833         * NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.cpp:
1834         (WebKit::makeDescription):
1835         * NetworkProcess/NetworkResourceLoader.cpp:
1836         (WebKit::NetworkResourceLoader::cleanup):
1837         * NetworkProcess/cache/NetworkCacheIOChannelCurl.cpp:
1838         (WebKit::NetworkCache::IOChannel::IOChannel):
1839         * Shared/API/c/WKSharedAPICast.h:
1840         (WebKit::toAPI):
1841         (WebKit::toDiagnosticLoggingResultType):
1842         * UIProcess/WebURLSchemeTask.cpp:
1843         (WebKit::WebURLSchemeTask::didReceiveData):
1844         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
1845         (WebKit::WebServiceWorkerFetchTaskClient::didReceiveData):
1846         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
1847         (WebKit::WebEditorClient::registerAttachmentIdentifier):
1848
1849 2019-12-05  Brian Burg  <bburg@apple.com>
1850
1851         [Cocoa] _WKInspector uses wrong WKWebView in -setDiagnosticLoggingDelegate:
1852         https://bugs.webkit.org/show_bug.cgi?id=204928
1853
1854         Reviewed by Timothy Hatcher.
1855
1856         I feel like I've made this mistake before. To make the right thing more obvious,
1857         add a property named inspectorWebView that returns the Inspector WKWebView.
1858
1859         * UIProcess/API/Cocoa/_WKInspector.mm:
1860         (-[_WKInspector inspectorWebView]):
1861         (-[_WKInspector _setDiagnosticLoggingDelegate:]):
1862         * UIProcess/WebInspectorProxy.h:
1863         (WebKit::WebInspectorProxy::inspectorPage const):
1864
1865 2019-12-05  Chris Dumez  <cdumez@apple.com>
1866
1867         Use sendWithAsyncReply() for WebPage::TryClose IPC
1868         https://bugs.webkit.org/show_bug.cgi?id=204926
1869
1870         Reviewed by Alex Christensen.
1871
1872         Use sendWithAsyncReply() for WebPage::TryClose IPC, instead of 2 separate IPCs.
1873
1874         * UIProcess/Automation/WebAutomationSession.cpp:
1875         (WebKit::WebAutomationSession::closeBrowsingContext):
1876         * UIProcess/WebPageProxy.cpp:
1877         (WebKit::WebPageProxy::tryClose):
1878         (WebKit::WebPageProxy::closePage):
1879         * UIProcess/WebPageProxy.h:
1880         * UIProcess/WebPageProxy.messages.in:
1881         * WebProcess/WebPage/WebPage.cpp:
1882         (WebKit::WebPage::tryClose):
1883         (WebKit::WebPage::sendClose):
1884         * WebProcess/WebPage/WebPage.h:
1885         * WebProcess/WebPage/WebPage.messages.in:
1886
1887 2019-12-05  John Wilander  <wilander@apple.com>
1888
1889         Resource Load Statistics (experimental): Add fast mode for non-cookie website data deletion
1890         https://bugs.webkit.org/show_bug.cgi?id=204858
1891         <rdar://problem/57639851>
1892
1893         Reviewed by Alex Christensen.
1894
1895         The purpose of this change is to allow for dedicated testing of the change in
1896         https://trac.webkit.org/changeset/253082/webkit. Waiting seven days just isn't a good
1897         starting point.
1898
1899         This change adds two internal flags:
1900         - "Live-On Testing" with a one hour timeout instead of seven days.
1901         - "Repro Testing" with an instant timeout (bar ITP's regular delays) instead of seven days.
1902
1903         The change also makes sure that hasHadUnexpiredRecentUserInteraction() in
1904         ResourceLoadStatisticsDatabaseStore and ResourceLoadStatisticsMemoryStore only
1905         age out the user interaction timestamp if the OperatingDatesWindow is Long so
1906         that we don't age out timestamps early with the shorter OperatingDatesWindows.
1907
1908         This change changes the default value of IsFirstPartyWebsiteDataRemovalEnabled to true.
1909
1910         These internal flags should be removed once testing is complete: <rdar://problem/57673418>
1911
1912         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
1913         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
1914         (WebKit::ResourceLoadStatisticsMemoryStore::hasHadUnexpiredRecentUserInteraction const):
1915         (WebKit::ResourceLoadStatisticsMemoryStore::shouldRemoveAllButCookiesFor const):
1916         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
1917         (WebKit::ResourceLoadStatisticsStore::hasStatisticsExpired const):
1918         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
1919         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
1920         (WebKit::WebResourceLoadStatisticsStore::setFirstPartyWebsiteDataRemovalMode):
1921         * NetworkProcess/NetworkProcess.messages.in:
1922         * Shared/WebPreferences.yaml:
1923         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
1924         (WebKit::WebsiteDataStore::parameters):
1925
1926 2019-12-05  Chris Dumez  <cdumez@apple.com>
1927
1928         Optimize IPC::Connection::SyncMessageState methods
1929         https://bugs.webkit.org/show_bug.cgi?id=204890
1930
1931         Reviewed by Alex Christensen.
1932
1933         Optimize IPC::Connection::SyncMessageState methods. We are seeing lock contention on some (app launch)
1934         benchmarks, resulting in the main thread yielding for 10ms.
1935
1936         * Platform/IPC/Connection.cpp:
1937         (IPC::Connection::SyncMessageState): Make constructor private since this is a singleton class.
1938         (IPC::Connection::ConnectionAndIncomingMessage): Add convenience dispatch() method.
1939
1940         (IPC::Connection::SyncMessageState::processIncomingMessage):
1941         Drop the lock as early as possible, *before* calling RunLoop::main().dispatch().
1942
1943         (IPC::Connection::SyncMessageState::dispatchMessages):
1944         Drop allowedConnection parameter and simplify the code a lot as a result. Only dispatchMessagesAndResetDidScheduleDispatchMessagesForConnection()
1945         needed the pass an allowedConnection but having dispatchMessagesAndResetDidScheduleDispatchMessagesForConnection() call dispatchMessages() was
1946         inefficient since it would cause us to grab the lock in dispatchMessagesAndResetDidScheduleDispatchMessagesForConnection() to update
1947         m_didScheduleDispatchMessagesWorkSet, then release it, then grab the lock again in dispatchMessages() for m_messagesToDispatchWhileWaitingForSyncReply.
1948
1949         (IPC::Connection::SyncMessageState::dispatchMessagesAndResetDidScheduleDispatchMessagesForConnection):
1950         Grab the lock only once to update m_didScheduleDispatchMessagesWorkSet and m_messagesToDispatchWhileWaitingForSyncReply, instead of doing it in 2
1951         separate steps, each one taking the lock.
1952
1953         (IPC::Connection::waitForMessage):
1954         (IPC::Connection::waitForSyncReply):
1955         (IPC::Connection::dispatchSyncMessage):
1956         stop passing a null allowedConnection when calling dispatchMessages().
1957
1958 2019-12-05  Chris Dumez  <cdumez@apple.com>
1959
1960         PageConfiguration::dragClient should use a smart pointer
1961         https://bugs.webkit.org/show_bug.cgi?id=204816
1962
1963         Reviewed by Alex Christensen.
1964
1965         * WebProcess/WebPage/WebPage.cpp:
1966         (WebKit::m_overriddenMediaType):
1967
1968 2019-12-05  Chris Dumez  <cdumez@apple.com>
1969
1970         [IPC] Fail BackForwardItemIdentifier decoding if the decoded integer is not a valid ID
1971         https://bugs.webkit.org/show_bug.cgi?id=204920
1972         <rdar://problem/57677453>
1973
1974         Reviewed by Ryosuke Niwa.
1975
1976         * UIProcess/WebPageProxy.cpp:
1977         (WebKit::WebPageProxy::willGoToBackForwardListItem):
1978         (WebKit::WebPageProxy::backForwardGoToItemShared):
1979         * UIProcess/WebProcessProxy.cpp:
1980         (WebKit::WebProcessProxy::updateBackForwardItem):
1981
1982 2019-12-05  Sihui Liu  <sihui_liu@apple.com>
1983
1984         Move InProcessIDBServer to WebKitLegacy
1985         https://bugs.webkit.org/show_bug.cgi?id=204896
1986
1987         Reviewed by Brady Eidson.
1988
1989         * WebProcess/Databases/WebDatabaseProvider.h:
1990
1991 2019-12-05  Sihui Liu  <sihui_liu@apple.com>
1992
1993         Add ThreadMessageReceiver to IPC::Connection
1994         https://bugs.webkit.org/show_bug.cgi?id=204908
1995
1996         Reviewed by Brady Eidson.
1997
1998         ThreadMesageReceiver is similar to WorkQueueMessageReceiver, but it should handle messages (dispatched from IPC 
1999         thread) on a specific thread, while WorkQueueMessageReceiver may handle messages on different threads.
2000
2001         * Platform/IPC/Connection.cpp:
2002         (IPC::Connection::addThreadMessageReceiver):
2003         (IPC::Connection::removeThreadMessageReceiver):
2004         (IPC::Connection::dispatchThreadMessageReceiverMessage):
2005         (IPC::Connection::processIncomingMessage):
2006         (IPC::Connection::dispatchMessageToThreadReceiver):
2007         * Platform/IPC/Connection.h:
2008         (IPC::Connection::ThreadMessageReceiver::dispatchToThread):
2009
2010 2019-12-05  Chris Dumez  <cdumez@apple.com>
2011
2012         MESSAGE_CHECK BackForwardItemIdentifier on incoming IPC from the WebProcess
2013         https://bugs.webkit.org/show_bug.cgi?id=204899
2014
2015         Reviewed by Ryosuke Niwa.
2016
2017         MESSAGE_CHECK BackForwardItemIdentifier on incoming IPC from the WebProcess. This is important since we use this identifier
2018         to look up the WebBackForwardListItem in a HashMap, and looking up a bad ID could corrupt said HashMap.
2019
2020         * Shared/WebBackForwardListItem.cpp:
2021         Make sure the WebBackForwardListItem is always constructed and destroyed on the main thread, to avoid corrupting
2022         the allItems() HashMap.
2023
2024         * UIProcess/WebPageProxy.cpp:
2025         (WebKit::WebPageProxy::willGoToBackForwardListItem):
2026         (WebKit::WebPageProxy::backForwardGoToItemShared):
2027         * UIProcess/WebProcessProxy.cpp:
2028         (WebKit::WebProcessProxy::updateBackForwardItem):
2029
2030 2019-12-05  Kate Cheney  <katherine_cheney@apple.com>
2031
2032         [MSVC] WebResourceLoadStatisticsStore.h is reporting warning C4804: '/': unsafe use of type 'bool' in operation
2033         https://bugs.webkit.org/show_bug.cgi?id=204870
2034
2035         Reviewed by Darin Adler.
2036
2037         This patch converts storageAccessGranted to a char since makeString()
2038         does not explicitly accept bool types.
2039
2040         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
2041         (WebKit::ThirdPartyDataForSpecificFirstParty::toString const):
2042
2043 2019-12-05  Philippe Normand  <pnormand@igalia.com>
2044
2045         [GLib] Display GStreamer version in about:gpu page
2046
2047         Rubber-stamped by Carlos Garcia Campos.
2048
2049         * UIProcess/API/glib/WebKitProtocolHandler.cpp:
2050         (WebKit::WebKitProtocolHandler::handleGPU):
2051
2052 2019-12-05  youenn fablet  <youenn@apple.com>
2053
2054         inspector/page/overrideSetting-MockCaptureDevicesEnabled.html is failing after removal of internals.setMockMediaCaptureDevicesEnabled API
2055         https://bugs.webkit.org/show_bug.cgi?id=204849
2056
2057         Reviewed by Eric Carlson.
2058
2059         Synchronize the center with the preferences when the value might be updated.
2060         Add API to check which center is used in UIProcess.
2061
2062         * UIProcess/API/C/WKPage.cpp:
2063         (WKPageIsMockRealtimeMediaSourceCenterEnabled):
2064         * UIProcess/API/C/WKPagePrivate.h:
2065         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2066         (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy):
2067         (WebKit::UserMediaPermissionRequestManagerProxy::setMockCaptureDevicesEnabledOverride):
2068         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
2069         (WebKit::UserMediaPermissionRequestManagerProxy::setMockCaptureDevicesEnabledOverride): Deleted.
2070
2071 2019-12-04  Joonghun Park  <jh718.park@samsung.com>
2072
2073         Unreviewed. Remove build warnings below since r253025.
2074         warning: unused variable ‘iter’ [-Wunused-variable]
2075         warning: unused variable ‘isNewEntry’ [-Wunused-variable]
2076
2077         No new tests, no new behavioral changes.
2078
2079         * NetworkProcess/NetworkProcess.cpp:
2080         (WebKit::NetworkProcess::addSessionStorageQuotaManager):
2081         * NetworkProcess/NetworkProcess.h:
2082         (WebKit::NetworkProcess::SessionStorageQuotaManager::ensureOriginStorageQuotaManager):
2083
2084 2019-12-04  Chris Dumez  <cdumez@apple.com>
2085
2086         IPC messages may get processed out of order in some cases
2087         https://bugs.webkit.org/show_bug.cgi?id=204864
2088
2089         Reviewed by Ryosuke Niwa.
2090
2091         IPC messages may get processed out of order in some cases. Connection::SyncMessageState::dispatchMessages()
2092         puts messages it did not process back at the end of the queue, instead of the beginning. This means that
2093         messages added to the queue while Connection::SyncMessageState::dispatchMessages() was running will
2094         incorrectly run *before* the ones dispatchMessages() did not process.
2095
2096         * Platform/IPC/Connection.cpp:
2097         (IPC::Connection::SyncMessageState::dispatchMessages):
2098
2099 2019-12-04  Chris Dumez  <cdumez@apple.com>
2100
2101         PageConfiguration::progressTrackerClient should use a smart pointer
2102         https://bugs.webkit.org/show_bug.cgi?id=204854
2103
2104         Reviewed by Alex Christensen.
2105
2106         * WebProcess/WebCoreSupport/WebProgressTrackerClient.cpp:
2107         (WebKit::WebProgressTrackerClient::progressTrackerDestroyed): Deleted.
2108         * WebProcess/WebCoreSupport/WebProgressTrackerClient.h:
2109         * WebProcess/WebPage/WebPage.cpp:
2110         (WebKit::m_overriddenMediaType):
2111
2112 2019-12-04  Tim Horton  <timothy_horton@apple.com>
2113
2114         Fix the iOS build
2115
2116         * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb: Added.
2117         * WebKit.xcodeproj/project.pbxproj:
2118
2119 2019-12-04  Per Arne Vollan  <pvollan@apple.com>
2120
2121         Unreviewed fix for failure to create sandbox extension on macOS after r253011. This should be iOS only.
2122
2123         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2124         (WebKit::UserMediaPermissionRequestManagerProxy::finishGrantingRequest):
2125         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
2126
2127 2019-12-04  Per Arne Vollan  <pvollan@apple.com>
2128
2129         [iOS] The UI process should issue mach sandbox extension to "com.apple.AGXCompilerService"
2130         https://bugs.webkit.org/show_bug.cgi?id=203915
2131
2132         Reviewed by Brent Fulgham.
2133
2134         Only a few iPad models need access to "com.apple.AGXCompilerService” in the WebContent process.
2135         The UI process should issue this mach extension for these iPad models.
2136  
2137         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2138         * Shared/WebProcessCreationParameters.cpp:
2139         (WebKit::WebProcessCreationParameters::encode const):
2140         (WebKit::WebProcessCreationParameters::decode):
2141         * Shared/WebProcessCreationParameters.h:
2142         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2143         (WebKit::deviceHasAGXCompilerService):
2144         (WebKit::WebProcessPool::platformInitializeWebProcess):
2145         * WebProcess/cocoa/WebProcessCocoa.mm:
2146         (WebKit::WebProcess::platformInitializeWebProcess):
2147
2148 2019-12-04  Kate Cheney  <katherine_cheney@apple.com>
2149
2150         Expose basic ITP data from the database for future API/SPI use
2151         https://bugs.webkit.org/show_bug.cgi?id=203432
2152         <rdar://problem/56085040>
2153
2154         Reviewed John Wilander.
2155
2156         Tests: http/tests/resourceLoadStatistics/user-interface-data-no-storage-access-database.html
2157                http/tests/resourceLoadStatistics/user-interface-data-no-storage-access.html
2158                http/tests/storageAccess/user-interface-data-with-storage-access-database.html
2159                http/tests/storageAccess/user-interface-data-with-storage-access.html
2160
2161         Adds the ability to collect sorted ITP data for displaying in a
2162         user interface. 
2163
2164         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
2165         (WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore):
2166         (WebKit::ResourceLoadStatisticsDatabaseStore::prepareStatements):
2167         Added new queries to the database store to check for storage access in
2168         the database and aggregate topFrames with the same
2169         subframe/subresource so easily create the struct for collecting data
2170         for the UI.
2171
2172         (WebKit::ResourceLoadStatisticsDatabaseStore::relationshipExists const):
2173         Fixed an incorrect function name in the error message.
2174
2175         (WebKit::ResourceLoadStatisticsDatabaseStore::joinSubStatisticsForSorting):
2176         Renamed unclear SQL variable names and added a bind parameter to
2177         specify whether resource is prevalent or not, which allows
2178         this function to be used to collect sorted ITP data
2179         for the UI.
2180
2181         (WebKit::ResourceLoadStatisticsDatabaseStore::getFirstPartyDataForDomain const):
2182         (WebKit::ResourceLoadStatisticsDatabaseStore::gatherDataForUserInterface const):
2183
2184         (WebKit::buildQueryStartAndEnd):
2185         (WebKit::getMedianOfPrevalentResourcesWithUserInteraction):
2186         (WebKit::ResourceLoadStatisticsDatabaseStore::getTopPrevelentResourceDaysSinceUI const):
2187         (WebKit::getMedianOfPrevalentResourceWithoutUserInteraction):
2188         (WebKit::getNumberOfPrevalentResourcesInTopResources):
2189         Changed sql query variable names to make them more clear and added a
2190         new bind parameter to allow for more general use of substatistic
2191         sorting query.
2192
2193         (WebKit::ResourceLoadStatisticsDatabaseStore::hasStorageAccess const):
2194         (WebKit::ResourceLoadStatisticsDatabaseStore::dumpResourceLoadStatistics const):
2195         Combined UI data with dumpResourceLoadStatistics() data to keep the testing aspect
2196         of this patch simpler.
2197
2198         (WebKit::ResourceLoadStatisticsDatabaseStore::resourceToString const):
2199         Since mostRecentUserInteractionTime changes with each test run, I
2200         updated the dumping to report only if it was in the last 24 hours as
2201         opposed to reporting an actual time.
2202
2203         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
2204         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
2205         (WebKit::ensureFirstPartyStatistic):
2206         (WebKit::getFirstPartyDataForDomain):
2207         (WebKit::hasBeenThirdParty):
2208         (WebKit::ResourceLoadStatisticsMemoryStore::gatherDataForUserInterface const):
2209         (WebKit::ResourceLoadStatisticsMemoryStore::dumpResourceLoadStatistics):
2210         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
2211         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
2212         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
2213         (WebKit::WebResourceLoadStatisticsStore::gatherDataForUserInterface):
2214         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
2215         (WebKit::FirstPartyData::toString const):
2216         (WebKit::FirstPartyData::operator== const):
2217         (WebKit::ThirdPartyData::toString const):
2218         (WebKit::ThirdPartyData::operator< const):
2219         The toString methods allow the structs to be printed for testing
2220         purposes. The equals methods allow the return vectors to use
2221         appendIfNotContains.
2222
2223 2019-12-04  Simon Fraser  <simon.fraser@apple.com>
2224
2225         Minor RemoteLayerTree logging cleanup
2226         https://bugs.webkit.org/show_bug.cgi?id=204865
2227
2228         Reviewed by Tim Horton.
2229
2230         Have the ::description() methods return Strings like everything else does.
2231         Use LOG_WITH_STREAM() so we don't call description() unless the log channel is on.
2232
2233         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
2234         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
2235         (WebKit::RemoteLayerTreeTransaction::dump const):
2236         (WebKit::RemoteLayerTreeTransaction::description const):
2237         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
2238         (WebKit::RemoteScrollingCoordinatorTransaction::description const):
2239         (WebKit::RemoteScrollingCoordinatorTransaction::dump const):
2240         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.h:
2241         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
2242         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
2243
2244 2019-12-04  Louie Livon-Bemel  <llivonbemel@apple.com>
2245
2246         Add exclusion rule for text manipulation SPI to exclude based on element class
2247         https://bugs.webkit.org/show_bug.cgi?id=204754
2248         <rdar://problem/57398802>
2249
2250         Reviewed by Ryosuke Niwa.
2251
2252         Give clients another option for adding an exclusion for text manipulation; allow them to exclude based on an
2253         element having a certain class.
2254
2255         * UIProcess/API/Cocoa/WKWebView.mm:
2256         (-[WKWebView _startTextManipulationsWithConfiguration:completion:]):
2257             If the rule doesn't have an attribute but does have a class name, treat it as a ClassRule exclusion.
2258         * UIProcess/API/Cocoa/_WKTextManipulationExclusionRule.h:
2259             Add an initializer for excluding based on a class name. Also add a getter for the className.
2260         * UIProcess/API/Cocoa/_WKTextManipulationExclusionRule.mm:
2261         (-[_WKTextManipulationExclusionRule initExclusion:forClass:]):
2262         (-[_WKTextManipulationExclusionRule className]):
2263
2264 2019-12-04  Kenneth Russell  <kbr@chromium.org>
2265
2266         Enable WebGL's ASTC extension all the time
2267         https://bugs.webkit.org/show_bug.cgi?id=202836
2268         <rdar://problem/57627592>
2269
2270         Reviewed by Dean Jackson.
2271
2272         Remove the run-time flag - no longer necessary.
2273
2274         * Shared/WebPreferences.yaml:
2275
2276 2019-12-04  youenn fablet  <youenn@apple.com>
2277
2278         WebProcessPool::terminateServiceWorkerProcess should be renamed terminateServiceWorkers
2279         https://bugs.webkit.org/show_bug.cgi?id=204792
2280
2281         Reviewed by Chris Dumez.
2282
2283         Make use of disableServiceWorkers in terminateServiceWorkers as we might need to handle the case of a service worker in a process containing a page.
2284         Renaming API accordingly.
2285         Covered by existing tests.
2286
2287         * UIProcess/API/C/WKContext.cpp:
2288         (WKContextTerminateServiceWorkers):
2289         * UIProcess/API/C/WKContextPrivate.h:
2290         * UIProcess/API/Cocoa/WKProcessPool.mm:
2291         (-[WKProcessPool _terminateServiceWorkers]):
2292         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2293         * UIProcess/WebProcessPool.cpp:
2294         (WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess):
2295         (WebKit::WebProcessPool::createWebPage):
2296         (WebKit::WebProcessPool::updateServiceWorkerUserAgent):
2297         (WebKit::WebProcessPool::terminateNetworkProcess):
2298         (WebKit::WebProcessPool::terminateServiceWorkers):
2299         (WebKit::WebProcessPool::updateProcessAssertions):
2300         (WebKit::WebProcessPool::isServiceWorkerPageID const):
2301         * UIProcess/WebProcessPool.h:
2302
2303 2019-12-04  youenn fablet  <youenn@apple.com>
2304
2305         Move soft update handling to network process
2306         https://bugs.webkit.org/show_bug.cgi?id=204678
2307
2308         Reviewed by Chris Dumez.
2309
2310         * NetworkProcess/NetworkProcess.cpp:
2311         (WebKit::NetworkProcess::swServerForSession):
2312         * NetworkProcess/NetworkSession.h:
2313         (WebKit::NetworkSession::addSoftUpdateLoader):
2314         (WebKit::NetworkSession::removeSoftUpdateLoader):
2315         * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp:
2316         (WebKit::ServiceWorkerFetchTask::ServiceWorkerFetchTask):
2317         (WebKit::ServiceWorkerFetchTask::didReceiveRedirectResponse):
2318         (WebKit::ServiceWorkerFetchTask::didReceiveResponse):
2319         (WebKit::ServiceWorkerFetchTask::didFail):
2320         (WebKit::ServiceWorkerFetchTask::didNotHandle):
2321         (WebKit::ServiceWorkerFetchTask::continueFetchTaskWith):
2322         (WebKit::ServiceWorkerFetchTask::timeoutTimerFired):
2323         (WebKit::ServiceWorkerFetchTask::softUpdateIfNeeded):
2324         * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h:
2325         * NetworkProcess/ServiceWorker/ServiceWorkerSoftUpdateLoader.cpp: Added.
2326         (WebKit::ServiceWorkerSoftUpdateLoader::start):
2327         (WebKit::ServiceWorkerSoftUpdateLoader::ServiceWorkerSoftUpdateLoader):
2328         (WebKit::ServiceWorkerSoftUpdateLoader::~ServiceWorkerSoftUpdateLoader):
2329         (WebKit::ServiceWorkerSoftUpdateLoader::fail):
2330         (WebKit::ServiceWorkerSoftUpdateLoader::loadWithCacheEntry):
2331         (WebKit::ServiceWorkerSoftUpdateLoader::loadFromNetwork):
2332         (WebKit::ServiceWorkerSoftUpdateLoader::willSendRedirectedRequest):
2333         (WebKit::ServiceWorkerSoftUpdateLoader::didReceiveResponse):
2334         (WebKit::ServiceWorkerSoftUpdateLoader::didReceiveBuffer):
2335         (WebKit::ServiceWorkerSoftUpdateLoader::didFinishLoading):
2336         (WebKit::ServiceWorkerSoftUpdateLoader::didFailLoading):
2337         (WebKit::ServiceWorkerSoftUpdateLoader::didComplete):
2338         * NetworkProcess/ServiceWorker/ServiceWorkerSoftUpdateLoader.h: Added.
2339         * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
2340         (WebKit::WebSWServerConnection::createFetchTask):
2341         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
2342         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
2343         * Shared/Authentication/AuthenticationManager.cpp:
2344         (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
2345         * Sources.txt:
2346         * WebKit.xcodeproj/project.pbxproj:
2347         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2348         * WebProcess/Storage/WebSWContextManagerConnection.h:
2349         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
2350
2351 2019-12-04  Tim Horton  <timothy_horton@apple.com>
2352
2353         Introduce a GPU process
2354         https://bugs.webkit.org/show_bug.cgi?id=204343
2355
2356         Reviewed by Simon Fraser.
2357
2358         Add a GPU process. This process is destined to be used as a proxy between
2359         WebKit and the underlying graphics mechanisms; in the case of the Cocoa
2360         ports, it will specifically gate access to IOKit and a few media-related
2361         daemons.
2362
2363         In this patch, the process is a UI-process singleton; the WebKit client
2364         application gets a single GPU process for all rendering, regardless of
2365         the number of Web Content processes, process pools, or web views.
2366
2367         For now, it is just a shell of a process; functionality will be added
2368         in future patches!
2369
2370         * Configurations/FeatureDefines.xcconfig:
2371         Add ENABLE(GPU_PROCESS).
2372
2373         * Configurations/GPUService.xcconfig: Added.
2374         * GPUProcess/EntryPoint/Cocoa/XPCService/GPUService/Info-OSX.plist: Added.
2375         * GPUProcess/EntryPoint/Cocoa/XPCService/GPUService/Info-iOS.plist: Added.
2376         * GPUProcess/EntryPoint/Cocoa/XPCService/GPUServiceEntryPoint.mm: Added.
2377         * Shared/AuxiliaryProcess.h:
2378         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h:
2379         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
2380         * Platform/ExtraPrivateSymbolsForTAPI.h:
2381         * Shared/mac/AuxiliaryProcessMac.mm:
2382         * Sources.txt:
2383         * SourcesCocoa.txt:
2384         * WebKit.xcodeproj/project.pbxproj:
2385         * Configurations/WebKit.xcconfig:
2386         * DerivedSources-input.xcfilelist:
2387         * DerivedSources-output.xcfilelist:
2388         * DerivedSources.make:
2389         * UIProcess/AuxiliaryProcessProxy.cpp:
2390         (WebKit::AuxiliaryProcessProxy::getLaunchOptions):
2391         * UIProcess/Launcher/ProcessLauncher.h:
2392         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2393         (WebKit::serviceName):
2394         (WebKit::shouldLeakBoost):
2395         Add a new target for the XPC service, and do the paperwork to launch it.
2396
2397         * GPUProcess/GPUConnectionToWebProcess.cpp: Added.
2398         * GPUProcess/GPUConnectionToWebProcess.h: Added.
2399         * GPUProcess/GPUConnectionToWebProcess.messages.in: Added.
2400         On the GPU process side, the incoming connection from the Web Content process.
2401
2402         * GPUProcess/GPUProcess.cpp: Added.
2403         * GPUProcess/GPUProcess.h: Added.
2404         * GPUProcess/GPUProcess.messages.in: Added.
2405         * GPUProcess/GPUProcessCreationParameters.cpp: Added.
2406         * GPUProcess/GPUProcessCreationParameters.h: Added.
2407         * GPUProcess/cocoa/GPUProcessCocoa.mm: Added.
2408         * GPUProcess/ios/GPUProcessIOS.mm: Added.
2409         * GPUProcess/mac/GPUProcessMac.mm: Added.
2410         Add the shell of the GPU process. Mostly stolen from the Networking process.
2411
2412         * UIProcess/GPU/GPUProcessProxy.cpp: Added.
2413         (WebKit::GPUProcessProxy::singleton):
2414         (WebKit::GPUProcessProxy::GPUProcessProxy):
2415         (WebKit::GPUProcessProxy::~GPUProcessProxy):
2416         (WebKit::GPUProcessProxy::getLaunchOptions):
2417         (WebKit::GPUProcessProxy::connectionWillOpen):
2418         (WebKit::GPUProcessProxy::processWillShutDown):
2419         (WebKit::GPUProcessProxy::getGPUProcessConnection):
2420         (WebKit::GPUProcessProxy::openGPUProcessConnection):
2421         (WebKit::GPUProcessProxy::gpuProcessCrashed):
2422         (WebKit::GPUProcessProxy::didReceiveMessage):
2423         (WebKit::GPUProcessProxy::didReceiveSyncMessage):
2424         (WebKit::GPUProcessProxy::didClose):
2425         (WebKit::GPUProcessProxy::didReceiveInvalidMessage):
2426         (WebKit::GPUProcessProxy::didFinishLaunching):
2427         (WebKit::GPUProcessProxy::updateProcessAssertion):
2428         * UIProcess/GPU/GPUProcessProxy.h: Added.
2429         * UIProcess/GPU/GPUProcessProxy.messages.in: Added.
2430         On the UI process side, the GPUProcessProxy is the singleton that
2431         owns the GPU process for the process.
2432
2433         * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in: Added.
2434         This sandbox profile is copied from the Web Content process.
2435         We will cut it down in the future, but this is a sensible starting point,
2436         since the code that is moving to the GPU process is code that currently
2437         lives in the Web Content process.
2438         
2439         * UIProcess/Network/NetworkProcessProxy.cpp:
2440         (WebKit::NetworkProcessProxy::updateProcessAssertion):
2441         Fix a logging typo I stumbled upon.
2442
2443         * UIProcess/WebProcessPool.cpp:
2444         (WebKit::WebProcessPool::getGPUProcessConnection):
2445         * UIProcess/WebProcessPool.h:
2446         * UIProcess/WebProcessProxy.cpp:
2447         (WebKit::WebProcessProxy::getGPUProcessConnection):
2448         * UIProcess/WebProcessProxy.h:
2449         * UIProcess/WebProcessProxy.messages.in:
2450         Add a message from Web->UI to retrieve the GPU process connection.
2451         In the future, we should send this along with the Web Content process
2452         initialization message, but this mechanism doesn't exist yet.
2453
2454         * WebProcess/GPU/GPUProcessConnection.cpp: Added.
2455         (WebKit::GPUProcessConnection::GPUProcessConnection):
2456         (WebKit::GPUProcessConnection::~GPUProcessConnection):
2457         (WebKit::GPUProcessConnection::didReceiveMessage):
2458         (WebKit::GPUProcessConnection::didReceiveSyncMessage):
2459         (WebKit::GPUProcessConnection::didClose):
2460         (WebKit::GPUProcessConnection::didReceiveInvalidMessage):
2461         * WebProcess/GPU/GPUProcessConnection.h: Added.
2462         (WebKit::GPUProcessConnection::create):
2463         (WebKit::GPUProcessConnection::connection):
2464         * WebProcess/GPU/GPUProcessConnection.messages.in: Added.
2465         * WebProcess/GPU/GPUProcessConnectionInfo.h: Added.
2466         (WebKit::GPUProcessConnectionInfo::identifier):
2467         (WebKit::GPUProcessConnectionInfo::releaseIdentifier):
2468         (WebKit::GPUProcessConnectionInfo::encode const):
2469         (WebKit::GPUProcessConnectionInfo::decode):
2470         In the Web Content process, GPUProcessConnection is the process-wide
2471         connection to the GPU process. All pages in a given Web Content process
2472         use the same connection to talk to the singleton GPU process.
2473
2474         * WebProcess/WebProcess.cpp:
2475         (WebKit::getGPUProcessConnection):
2476         (WebKit::WebProcess::ensureGPUProcessConnection):
2477         (WebKit::WebProcess::gpuProcessConnectionClosed):
2478         * WebProcess/WebProcess.h:
2479         (WebKit::WebProcess::existingGPUProcessConnection):
2480         In the Web Content process, make it possible for clients to retrieve
2481         the GPU process connection.
2482
2483 2019-12-04  Yury Semikhatsky  <yurys@chromium.org>
2484
2485         Web Inspector: allow inspector to pause provisional page load and restore its state
2486         https://bugs.webkit.org/show_bug.cgi?id=204170
2487
2488         Reviewed by Devin Rousso.
2489
2490         Provisional page loading can be deffered if inspector front-end is connected. This
2491         allows to configure inspector backend in the provisional page before load request
2492         is sent. If inspector front-end is not connected provisional loading will conitinue
2493         exactly as before.
2494
2495         Tests: http/tests/inspector/target/pause-on-inline-debugger-statement.html
2496                http/tests/inspector/target/provisional-load-cancels-previous-load.html
2497
2498         * UIProcess/InspectorTargetProxy.cpp:
2499         (WebKit::InspectorTargetProxy::disconnect):
2500         * UIProcess/WebPageInspectorController.cpp:
2501         (WebKit::WebPageInspectorController::shouldPauseLoading const):
2502         (WebKit::WebPageInspectorController::setContinueLoadingCallback):
2503         * UIProcess/WebPageInspectorController.h:
2504         * UIProcess/WebPageProxy.cpp:
2505         (WebKit::WebPageProxy::continueNavigationInNewProcess):
2506
2507 2019-12-03  Megan Gardner  <megan_gardner@apple.com>
2508
2509         Add disabled highlight API skeleton
2510         https://bugs.webkit.org/show_bug.cgi?id=204809
2511
2512         Reviewed by Ryosuke Niwa.
2513
2514         * Shared/WebPreferences.yaml:
2515         * UIProcess/API/C/WKPreferences.cpp:
2516         (WKPreferencesSetHighlightAPIEnabled):
2517         (WKPreferencesGetHighlightAPIEnabled):
2518         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2519
2520 2019-12-03  Ryosuke Niwa  <rniwa@webkit.org>
2521
2522         Replace customJavaScriptUserAgentAsSiteSpecificQuirks with customUserAgentAsSiteSpecificQuirks
2523         https://bugs.webkit.org/show_bug.cgi?id=204824
2524
2525         Reviewed by Brent Fulgham.
2526
2527         This patch replaces _WKWebsitePolicies's customJavaScriptUserAgentAsSiteSpecificQuirks with
2528         customUserAgentAsSiteSpecificQuirks and makes it apply to network requests as well as JS API.
2529
2530         * Shared/WebsitePoliciesData.cpp:
2531         (WebKit::WebsitePoliciesData::encode const):
2532         (WebKit::WebsitePoliciesData::decode):
2533         (WebKit::WebsitePoliciesData::applyToDocumentLoader):
2534         * Shared/WebsitePoliciesData.h:
2535         * UIProcess/API/APIWebsitePolicies.cpp:
2536         (API::WebsitePolicies::copy const):
2537         (API::WebsitePolicies::data):
2538         * UIProcess/API/APIWebsitePolicies.h:
2539         * UIProcess/API/Cocoa/WKWebpagePreferences.mm:
2540         (-[WKWebpagePreferences _setCustomUserAgentAsSiteSpecificQuirks:]): Renamed from _setCustomJavaScriptUserAgentAsSiteSpecificQuirks.
2541         (-[WKWebpagePreferences _customUserAgentAsSiteSpecificQuirks]): Renamed from _customJavaScriptUserAgentAsSiteSpecificQuirks.
2542         * UIProcess/API/Cocoa/WKWebpagePreferencesPrivate.h:
2543         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
2544         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
2545         (-[_WKWebsitePolicies setCustomUserAgentAsSiteSpecificQuirks:]): Renamed from setCustomJavaScriptUserAgentAsSiteSpecificQuirks.
2546         (-[_WKWebsitePolicies customUserAgentAsSiteSpecificQuirks]): Renamed from customJavaScriptUserAgentAsSiteSpecificQuirks.
2547
2548 2019-12-03  Andres Gonzalez  <andresg_22@apple.com>
2549
2550         Focus tracking support in the accessibility isolatedtree.
2551         https://bugs.webkit.org/show_bug.cgi?id=204535
2552
2553         Reviewed by Chris Fleizach.
2554
2555         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2556         (WKAccessibilityFocusedObject):
2557
2558 2019-12-03  John Wilander  <wilander@apple.com>
2559
2560         Resource Load Statistics (experimental): Delete non-cookie website data after 7 days of no user interaction
2561         https://bugs.webkit.org/show_bug.cgi?id=204779
2562         <rdar://problem/57578989>
2563
2564         Reviewed by Alex Christensen.
2565
2566         Trackers are continuing to move cross-site tracking IDs into first-party storage.
2567         This change ages out script-writable non-cookie website data in alignment with the
2568         7-day cap on client-side cookies.
2569
2570         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
2571         (WebKit::ResourceLoadStatisticsDatabaseStore::shouldRemoveAllButCookiesFor const):
2572             Now makes use of the set WebCore::FirstPartyWebsiteDataRemovalMode.
2573         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
2574         (WebKit::ResourceLoadStatisticsMemoryStore::shouldRemoveAllButCookiesFor const):
2575             Now makes use of the set WebCore::FirstPartyWebsiteDataRemovalMode.
2576         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
2577         (WebKit::ResourceLoadStatisticsStore::setFirstPartyWebsiteDataRemovalMode):
2578         (WebKit::ResourceLoadStatisticsStore::firstPartyWebsiteDataRemovalMode const):
2579         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
2580         (WebKit::WebResourceLoadStatisticsStore::setFirstPartyWebsiteDataRemovalMode):
2581         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
2582         * NetworkProcess/NetworkProcess.cpp:
2583         (WebKit::NetworkProcess::setFirstPartyWebsiteDataRemovalModeForTesting):
2584         * NetworkProcess/NetworkProcess.h:
2585         * NetworkProcess/NetworkProcess.messages.in:
2586         * NetworkProcess/NetworkSession.cpp:
2587         (WebKit::NetworkSession::setResourceLoadStatisticsEnabled):
2588         (WebKit::NetworkSession::recreateResourceLoadStatisticStore):
2589         (WebKit::NetworkSession::forwardResourceLoadStatisticsSettings):
2590             New convenience function to avoid code duplication in
2591             NetworkSession::setResourceLoadStatisticsEnabled() and 
2592             NetworkSession::forwardResourceLoadStatisticsSettings().
2593         * NetworkProcess/NetworkSession.h:
2594         * NetworkProcess/NetworkSessionCreationParameters.cpp:
2595         (WebKit::NetworkSessionCreationParameters::encode const):
2596         (WebKit::NetworkSessionCreationParameters::decode):
2597         * NetworkProcess/NetworkSessionCreationParameters.h:
2598         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2599         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
2600         * Scripts/webkit/messages.py:
2601             Makes sure the WebCore::FirstPartyWebsiteDataRemovalMode is found in WebCore/NetworkStorageSession.h.
2602         * Shared/WebPreferences.yaml:
2603             New experimental feature, off by default.
2604         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2605         (WKWebsiteDataStoreSetResourceLoadStatisticsFirstPartyWebsiteDataRemovalModeForTesting):
2606         (WKWebsiteDataStoreStatisticsResetToConsistentState):
2607         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
2608         * UIProcess/Network/NetworkProcessProxy.cpp:
2609         (WebKit::NetworkProcessProxy::setFirstPartyWebsiteDataRemovalModeForTesting):
2610         * UIProcess/Network/NetworkProcessProxy.h:
2611         * UIProcess/WebProcessPool.cpp:
2612         (WebKit::WebProcessPool::ensureNetworkProcess):
2613         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
2614         (WebKit::WebsiteDataStore::parameters):
2615         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2616         (WebKit::WebsiteDataStore::setResourceLoadStatisticsFirstPartyWebsiteDataRemovalModeForTesting):
2617         * UIProcess/WebsiteData/WebsiteDataStore.h:
2618
2619 2019-12-03  Chris Dumez  <cdumez@apple.com>
2620
2621         [iOS] Unable to interact with the view after a back swipe until lifting the finger off the screen
2622         https://bugs.webkit.org/show_bug.cgi?id=204821
2623
2624         Reviewed by Tim Horton.
2625
2626         If you swipe back on iOS and then put your finger on the screen before the view gesture snapshot is taken down,
2627         your gestures will not be recognized, even after the snapshot is taken down, until after you lift your finger
2628         off the screen and back on. This makes MobileSafari look more unresponsive than it needs to be.
2629
2630         To address the issue, disable user interactions for the snapshot view, so that interactions go through to the
2631         actual view underneath.
2632
2633         * UIProcess/ios/ViewGestureControllerIOS.mm:
2634         (WebKit::ViewGestureController::beginSwipeGesture):
2635
2636 2019-12-03  Chris Dumez  <cdumez@apple.com>
2637
2638         Use a 3 second timeout for the view gesture snapshot on macOS
2639         https://bugs.webkit.org/show_bug.cgi?id=204818
2640
2641         Reviewed by Tim Horton.
2642
2643         Use a 3 second timeout for the view gesture snapshot on macOS, for consistency with iOS.
2644         It used to be 5 seconds on macOS.
2645
2646         * UIProcess/ViewGestureController.cpp:
2647
2648 2019-12-03  Chris Dumez  <cdumez@apple.com>
2649
2650         REGRESSION (r252778): ASSERT(!m_networkLoad); in ~SpeculativeLoad()
2651         https://bugs.webkit.org/show_bug.cgi?id=204813
2652         <rdar://problem/57581082>
2653
2654         Reviewed by Antti Koivisto.
2655
2656         After r252778, SpeculativeLoadManager::revalidateSubresource() may delay the revalidation until we receive
2657         the response for the main resource. We can hit the assertion in the SpeculativeLoad destructor if a speculative
2658         revalidation for the SAME resource gets scheduled while we're waiting for the main resource response. When we
2659         eventually receive the main resource response, we would call revalidateSubresource() again, which would create
2660         a SpeculativeLoad and try to add it to m_pendingPreloads. Because m_pendingPreloads would already contain a
2661         preload for this same resource, the SpeculativeLoad would not get added to the map and it would get destroyed
2662         right away, before completing (thus hitting the assert). This unnecessary creation of the SpeculativeLoad is
2663         inefficient and it is thus best to avoid it.
2664
2665         To address the issue, when we receive the response, we now make sure that m_pendingPreloads does not already
2666         contain a preload for this resource before calling revalidateSubresource() again, similarly to what was
2667         already done at the beginning of SpeculativeLoadManager::preloadEntry().
2668
2669         No new tests, unknown how to reproduce.
2670
2671         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
2672         (WebKit::NetworkCache::SpeculativeLoadManager::revalidateSubresource):
2673
2674 2019-12-03  Eric Carlson  <eric.carlson@apple.com>
2675
2676         Add a runtime setting for media in the GPU process
2677         https://bugs.webkit.org/show_bug.cgi?id=204801
2678         <rdar://problem/57596199>
2679
2680         Reviewed by Jer Noble.
2681
2682         * Shared/WebPreferences.yaml:
2683         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2684         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2685
2686 2019-12-03  Per Arne Vollan  <pvollan@apple.com>
2687
2688         Unreviewed assertion fix for older macOS versions after r253011.
2689
2690         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2691         (WebKit::UserMediaPermissionRequestManagerProxy::finishGrantingRequest):
2692         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
2693
2694 2019-12-03  Antoine Quint  <graouts@apple.com>
2695
2696         [Web Animations] Add a runtime flag for Web Animations composite operations
2697         https://bugs.webkit.org/show_bug.cgi?id=204718
2698
2699         Reviewed by Dean Jackson.
2700
2701         * Shared/WebPreferences.yaml:
2702
2703 2019-12-03  Youenn Fablet  <youenn@apple.com>
2704
2705         UserMediaCaptureManager should have independent capture factories
2706         https://bugs.webkit.org/show_bug.cgi?id=204786
2707
2708         Reviewed by Eric Carlson.
2709
2710         Refactor the code to make UserMediaCaptureManager have 3 different factories.
2711         This allows having 3 potential active sources which are used on iOS.
2712         We cannot test right now on iOS as audio capture in UIProcess is not yet ready.
2713
2714         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
2715         (WebKit::UserMediaCaptureManager::Source::Source):
2716         (WebKit::UserMediaCaptureManager::Source::~Source):
2717         (WebKit::UserMediaCaptureManager::UserMediaCaptureManager):
2718         (WebKit::UserMediaCaptureManager::~UserMediaCaptureManager):
2719         (WebKit::UserMediaCaptureManager::initialize):
2720         (WebKit::UserMediaCaptureManager::createCaptureSource):
2721         (WebKit::UserMediaCaptureManager::AudioFactory::setAudioCapturePageState):
2722         (WebKit::UserMediaCaptureManager::VideoFactory::setVideoCapturePageState):
2723         (WebKit::UserMediaCaptureManager::setAudioCapturePageState): Deleted.
2724         (WebKit::UserMediaCaptureManager::setVideoCapturePageState): Deleted.
2725         * WebProcess/cocoa/UserMediaCaptureManager.h:
2726         (WebKit::UserMediaCaptureManager::AudioFactory::AudioFactory):
2727         (WebKit::UserMediaCaptureManager::VideoFactory::VideoFactory):
2728         (WebKit::UserMediaCaptureManager::DisplayFactory::DisplayFactory):
2729
2730 2019-12-03  Chris Dumez  <cdumez@apple.com>
2731
2732         PageConfiguration::pluginClient should use a smart pointer
2733         https://bugs.webkit.org/show_bug.cgi?id=204780
2734
2735         Reviewed by Anders Carlsson.
2736
2737         * WebProcess/WebCoreSupport/WebPlugInClient.cpp:
2738         * WebProcess/WebCoreSupport/WebPlugInClient.h:
2739         * WebProcess/WebPage/WebPage.cpp:
2740         (WebKit::m_overriddenMediaType):
2741
2742 2019-12-03  Chris Dumez  <cdumez@apple.com>
2743
2744         PageConfiguration::alternativeTextClient should use a smart pointer
2745         https://bugs.webkit.org/show_bug.cgi?id=204777
2746
2747         Reviewed by Anders Carlsson.
2748
2749         * WebProcess/WebCoreSupport/WebAlternativeTextClient.h:
2750         * WebProcess/WebCoreSupport/mac/WebAlternativeTextClient.cpp:
2751         (WebKit::WebAlternativeTextClient::pageDestroyed): Deleted.
2752         * WebProcess/WebPage/WebPage.cpp:
2753         (WebKit::m_overriddenMediaType):
2754
2755 2019-12-03  Kate Cheney  <katherine_cheney@apple.com>
2756
2757         Activate the SQLite database as an on-by-default feature
2758         https://bugs.webkit.org/show_bug.cgi?id=204774
2759         <rdar://problem/56117706>
2760
2761         Reviewed by Brent Fulgham.
2762
2763         The flag to use the ITP Database backend should be set to true by default.
2764         * Shared/WebPreferences.yaml:
2765
2766 2019-12-03  youenn fablet  <youenn@apple.com>
2767
2768         Add support for camera rotation when capturing in UIProcess
2769         https://bugs.webkit.org/show_bug.cgi?id=204750
2770
2771         Reviewed by Eric Carlson.
2772
2773         Make UserMediaCaptureManagerProxy have an OrientationNotifier.
2774         It is updated by each web page of the web process being notified of a device orientation change.
2775         Whenever a rotation happens, UIProcess sources are now notified to correctly compute the frame rotations.
2776
2777         Covered by existing tests.
2778
2779         * UIProcess/API/C/WKPage.cpp:
2780         (WKPageSetMockCameraOrientation):
2781         * UIProcess/API/C/WKPagePrivate.h:
2782         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
2783         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
2784         (WebKit::UserMediaCaptureManagerProxy::setOrientation):
2785         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
2786         * UIProcess/WebPageProxy.cpp:
2787         (WebKit::WebPageProxy::setOrientationForMediaCapture):
2788         * UIProcess/WebPageProxy.h:
2789         * UIProcess/WebProcessProxy.h:
2790         (WebKit::WebProcessProxy::userMediaCaptureManagerProxy):
2791         * UIProcess/ios/WebPageProxyIOS.mm:
2792         (WebKit::WebPageProxy::setDeviceOrientation):
2793
2794 2019-12-03  Antti Koivisto  <antti@apple.com>
2795
2796         [LFC][Integration] Shorten feature flag name
2797         https://bugs.webkit.org/show_bug.cgi?id=204788
2798
2799         Reviewed by Sam Weinig.
2800
2801         * Shared/WebPreferences.yaml:
2802         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2803         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2804
2805 2019-12-03  youenn fablet  <youenn@apple.com>
2806
2807         Expose WKWebView API to stop ongoing capture
2808         https://bugs.webkit.org/show_bug.cgi?id=204787
2809
2810         Reviewed by Eric Carlson.
2811
2812         Covered by API test.
2813
2814         * UIProcess/API/Cocoa/WKWebView.mm:
2815         (-[WKWebView _stopMediaCapture]):
2816         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2817
2818 2019-12-03  youenn fablet  <youenn@apple.com>
2819
2820         [Cocoa] Run camera capture in UIProcess by default in layout tests
2821         https://bugs.webkit.org/show_bug.cgi?id=204512
2822
2823         Reviewed by Eric Carlson.
2824
2825         * UIProcess/UserMediaProcessManager.cpp:
2826         (WebKit::UserMediaProcessManager::willCreateMediaStream):
2827         Do not send sandbox extensions in case capture happens in UIProcess.
2828         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
2829         (WebKit::UserMediaCaptureManager::Source::~Source):
2830         (WebKit::UserMediaCaptureManager::createCaptureSource):
2831         Register/unregister sources as active/unactive sources to the factory.
2832
2833 2019-12-03  Carlos Garcia Campos  <cgarcia@igalia.com>
2834
2835         WebDriver: handle elements of type file in send keys command
2836         https://bugs.webkit.org/show_bug.cgi?id=188514
2837
2838         Reviewed by Brian Burg.
2839
2840         Add setFilesForInputFileUpload method to Automation. It's like setFilesToSelectForFileUpload, but it works
2841         differently, so I'm keeping both to not break safaridriver. The new one simply sends the file list to the web
2842         process to be set on the input element, instead of saving the file list, wait for the driver to trigger the open
2843         panel, intercept and complete the open panel request and send a dismiss open panel event to the driver.
2844
2845         * UIProcess/Automation/Automation.json: Add setFilesForInputFileUpload.
2846         * UIProcess/Automation/WebAutomationSession.cpp:
2847         (WebKit::WebAutomationSession::setFilesForInputFileUpload): Send SetFilesForInputFileUpload message to the web process.
2848         * UIProcess/Automation/WebAutomationSession.h:
2849         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
2850         (WebKit::WebAutomationSessionProxy::setFilesForInputFileUpload): Create a FileList with the received paths and
2851         call HTMLInputElement::setFiles() on the given element.
2852         * WebProcess/Automation/WebAutomationSessionProxy.h:
2853         * WebProcess/Automation/WebAutomationSessionProxy.messages.in: Add SetFilesForInputFileUpload message.
2854
2855 2019-12-03  Carlos Garcia Campos  <cgarcia@igalia.com>
2856
2857         WebDriver: most of the clear tests are failing
2858         https://bugs.webkit.org/show_bug.cgi?id=180404
2859
2860         Reviewed by Brian Burg.
2861
2862         Update the FormElementClear atom to follow the spec.
2863
2864         * UIProcess/Automation/atoms/FormElementClear.js:
2865         (isEditable):
2866         (isResettableElementEmpty):
2867
2868 2019-12-03  Carlos Garcia Campos  <cgarcia@igalia.com>
2869
2870         [PSON] Tooltips from previous page shown on new page
2871         https://bugs.webkit.org/show_bug.cgi?id=204735
2872
2873         Reviewed by Chris Dumez.
2874
2875         The problem is that WebPage (in the web process) is caching the tooltip text to avoid sending IPC messages when
2876         the tooltip didn't change. When a new web process is used for the same web view, the tooltip text doesn't really
2877         change (it's always null) until a new one is set. The setToolTip message is always sent right after the
2878         MouseDidMoveOverElement, and they both depend on the same hit test result, so we can include the tooltip text as
2879         part of the WebHitTestResultData struct passed to MouseDidMoveOverElement and remove the SetToolTip
2880         message. Since the UI process is already caching the tooltip, we can simply notify the page client when it changes.
2881
2882         * Shared/WebHitTestResultData.cpp:
2883         (WebKit::WebHitTestResultData::WebHitTestResultData): Initialize toolTipText.
2884         (WebKit::WebHitTestResultData::encode const): Encode toolTipText.
2885         (WebKit::WebHitTestResultData::decode): Decode toolTipText.
2886         * Shared/WebHitTestResultData.h:
2887         * UIProcess/WebPageProxy.cpp:
2888         (WebKit::WebPageProxy::mouseDidMoveOverElement): Call setToolTip() after notifying the UI client about the mouse move.
2889         (WebKit::WebPageProxy::setToolTip): Return early if tooltip didn't change.
2890         (WebKit::WebPageProxy::resetState): Use setToolTip() to ensure the page client is notified about the change.
2891         * UIProcess/WebPageProxy.messages.in: Remove SetToolTip message.
2892         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2893         (WebKit::WebChromeClient::mouseDidMoveOverElement): Pass tooltip text to WebHitTestResultData constructor.
2894         * WebProcess/WebCoreSupport/WebChromeClient.h:
2895
2896 2019-12-02  Sihui Liu  <sihui_liu@apple.com>
2897
2898         Cross-thread version StorageQuotaManager
2899         https://bugs.webkit.org/show_bug.cgi?id=203971
2900         <rdar://problem/57290349>
2901
2902         Reviewed by Chris Dumez.
2903
2904         * NetworkProcess/NetworkProcess.cpp: Introduce class SessionStorageQuotaManager to manage all 
2905         StorageQuotaManagers of the same session. 
2906         (WebKit::NetworkProcess::initializeNetworkProcess):
2907         (WebKit::NetworkProcess::addWebsiteDataStore):
2908         (WebKit::NetworkProcess::addSessionStorageQuotaManager):
2909         (WebKit::NetworkProcess::removeSessionStorageQuotaManager):
2910         (WebKit::NetworkProcess::destroySession):
2911         (WebKit::NetworkProcess::deleteWebsiteData):
2912         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
2913         (WebKit::NetworkProcess::createIDBServer):
2914         (WebKit::NetworkProcess::addIndexedDatabaseSession):
2915         (WebKit::NetworkProcess::setSessionStorageQuotaManagerIDBRootPath):
2916         (WebKit::NetworkProcess::updateQuotaBasedOnSpaceUsageForTesting):
2917         (WebKit::NetworkProcess::resetQuota):
2918         (WebKit::NetworkProcess::storageQuotaManager):
2919         (WebKit::NetworkProcess::initializeStorageQuota): Deleted.
2920         (WebKit::NetworkProcess::clearStorageQuota): Deleted.
2921         (): Deleted.
2922         (WebKit::NetworkProcess::initializeQuotaUsers): Deleted.
2923         * NetworkProcess/NetworkProcess.h:
2924         (WebKit::NetworkProcess::SessionStorageQuotaManager::SessionStorageQuotaManager):
2925         (WebKit::NetworkProcess::SessionStorageQuotaManager::defaultQuota const):
2926         (WebKit::NetworkProcess::SessionStorageQuotaManager::ensureOriginStorageQuotaManager):
2927         (WebKit::NetworkProcess::SessionStorageQuotaManager::existingStorageQuotaManagers):
2928         (WebKit::NetworkProcess::SessionStorageQuotaManager::cacheRootPath const):
2929         (WebKit::NetworkProcess::SessionStorageQuotaManager::setIDBRootPath):
2930         (WebKit::NetworkProcess::SessionStorageQuotaManager::idbRootPath const):
2931         (WebKit::NetworkProcess::StorageQuotaManagers::defaultQuota const): Deleted.
2932         (WebKit::NetworkProcess::StorageQuotaManagers::setDefaultQuotas): Deleted.
2933         (WebKit::NetworkProcess::StorageQuotaManagers::managersPerOrigin): Deleted.
2934         * NetworkProcess/NetworkProcess.messages.in:
2935         * NetworkProcess/cache/CacheStorageEngine.cpp:
2936         (WebKit::CacheStorage::getDirectorySize):
2937         (WebKit::CacheStorage::Engine::diskUsage): static function to get the disk usage of CacheStorage given 
2938         CacheStorage root directory.
2939         (WebKit::CacheStorage::Engine::requestSpace):
2940         (WebKit::CacheStorage::Engine::readCachesFromDisk):
2941         (WebKit::CacheStorage::Engine::writeSizeFile):
2942         (WebKit::CacheStorage::Engine::readSizeFile):
2943         (WebKit::CacheStorage::Engine::initializeQuotaUser): Deleted.
2944         * NetworkProcess/cache/CacheStorageEngine.h:
2945         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
2946         (WebKit::CacheStorage::Cache::put):
2947         (WebKit::CacheStorage::Cache::remove):
2948         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
2949         (WebKit::CacheStorage::Caches::create):
2950         (WebKit::CacheStorage::Caches::Caches):
2951         (WebKit::CacheStorage::Caches::~Caches):
2952         (WebKit::CacheStorage::Caches::updateSizeFile):
2953         (WebKit::CacheStorage::Caches::initializeSize):
2954         (WebKit::CacheStorage::Caches::clear):
2955         (WebKit::CacheStorage::Caches::requestSpace):
2956         (WebKit::CacheStorage::Caches::writeRecord):
2957         (WebKit::CacheStorage::Caches::removeRecord):
2958         (WebKit::CacheStorage::Caches::whenInitialized): Deleted.
2959         (WebKit::CacheStorage::Caches::resetSpaceUsed): Deleted.
2960         * NetworkProcess/cache/CacheStorageEngineCaches.h:
2961         * Shared/WebsiteDataStoreParameters.cpp:
2962         (WebKit::WebsiteDataStoreParameters::encode const):
2963         (WebKit::WebsiteDataStoreParameters::decode):
2964         * Shared/WebsiteDataStoreParameters.h: Add a cacheStorageDirectory parameter so we know the direcotry of 
2965         CacheStorage when we start using WebsiteDataStore.
2966         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2967         (WKWebsiteDataStoreResetQuota):
2968         * UIProcess/API/C/WKWebsiteDataStoreRef.h: Add a C API for reseting quota in TestRunner.
2969         * UIProcess/Network/NetworkProcessProxy.cpp:
2970         (WebKit::NetworkProcessProxy::resetQuota):
2971         * UIProcess/Network/NetworkProcessProxy.h:
2972         * UIProcess/WebProcessPool.cpp:
2973         (WebKit::WebProcessPool::ensureNetworkProcess):
2974         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
2975         (WebKit::WebsiteDataStore::parameters):
2976         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2977         (WebKit::WebsiteDataStore::parameters):
2978         (WebKit::WebsiteDataStore::resetQuota):
2979         * UIProcess/WebsiteData/WebsiteDataStore.h:
2980
2981 2019-12-02  Per Arne Vollan  <pvollan@apple.com>
2982
2983         [iOS] Create sandbox extension for "com.apple.tccd"
2984         https://bugs.webkit.org/show_bug.cgi?id=204367
2985         <rdar://problem/57330176>
2986
2987         Reviewed by Eric Carlson.
2988
2989         When camera or microphone access has been granted by the user, have the UI process create a sandbox extension
2990         for "com.apple.tccd", and send it to the WebContent process. Also make sure the extension is created only once
2991         for each WebContent process. Add telemetry to the tccd rule in the sandbox.
2992
2993         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2994         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2995         (WebKit::UserMediaPermissionRequestManagerProxy::finishGrantingRequest):
2996         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
2997         * WebProcess/WebPage/WebPage.cpp:
2998         (WebKit::WebPage::userMediaAccessWasGranted):
2999         * WebProcess/WebPage/WebPage.h:
3000         * WebProcess/WebPage/WebPage.messages.in:
3001
3002 2019-12-02  Louie Livon-Bemel  <llivonbemel@apple.com>
3003
3004         Add helper methods for description and equality to text manipulation SPI
3005         https://bugs.webkit.org/show_bug.cgi?id=204758
3006         <rdar://problem/57438200>
3007
3008         Reviewed by Wenson Hsieh.
3009
3010         I originally added some category methods to _WKTextManipulationItem and _WKTextManipulationToken within Safari
3011         to make working with these classes easier. However it makes more sense to just move these methods into
3012         the main class. One method is for checking if two instances are equal (including identifiers) and optionally
3013         checking if the content itself is equal. The other methods are for debug descriptions for lldb, and a
3014         method to get a description that preserves privacy; when logging the instance, the content of the webpage
3015         should be redacted.
3016
3017         Tests: Tests are added as API tests.
3018
3019         * UIProcess/API/Cocoa/_WKTextManipulationItem.h:
3020             - Assume everything is non-null unless otherwise specified.
3021             - Allow the identifier to be nil, but not the array of tokens.
3022             - Add a method to check the equality to another item, optionally including a check for the content of each
3023               token being equal.
3024             - Add a -debugDescription method that includes the content of tokens for use in lldb. This NSObject
3025               declaration is marked optional, so redeclare it here.
3026             - No need to add a -description declaration since it exists on NSObject already.
3027         * UIProcess/API/Cocoa/_WKTextManipulationItem.mm:
3028         (-[_WKTextManipulationItem isEqual:]):
3029             The standard NSObject equality check should call our method with equal content.
3030         (-[_WKTextManipulationItem isEqualToTextManipulationItem:includingContentEquality:]):
3031             - If the other item is nil, the identifiers aren't equal or the number of tokens are mismatched, these
3032               items aren't equal.
3033             - Just to be safe, only iterate the smaller of the token arrays so we don't crash.
3034             - Check if each token is equal, passing along the `includingContentEquality` parameter.
3035         (-[_WKTextManipulationItem description]):
3036             The general description should not include the webpage content.
3037         (-[_WKTextManipulationItem debugDescription]):
3038             Include the webpage content, since this is for lldb.
3039         (-[_WKTextManipulationItem _descriptionPreservingPrivacy:]):
3040             Include the standard description format, and each token on its own line. If we're including the content
3041             then use `token.debugDescription`.
3042         * UIProcess/API/Cocoa/_WKTextManipulationToken.h:
3043             - Also assume everything is non-null.
3044             - Identifier and Content can be nil.
3045             - Declare a -debugDescription method.
3046             - Declare a method to check equality, with or without the content.
3047         * UIProcess/API/Cocoa/_WKTextManipulationToken.mm:
3048         (isEqualOrBothNil):
3049             Helper that checks equality but considers two nil values to be equal as well.
3050         (-[_WKTextManipulationToken isEqual:]):
3051             The standard NSObject equality check should call our method with equal content.
3052         (-[_WKTextManipulationToken isEqualToTextManipulationToken:includingContentEquality:]):
3053             Check that the exclusions are equal, the identifiers are equal (considering two nils to be equal), and the
3054             content if necessary.
3055         (-[_WKTextManipulationToken description]):
3056         (-[_WKTextManipulationToken debugDescription]):
3057         (-[_WKTextManipulationToken _descriptionPreservingPrivacy:]):
3058             If we're preserving privacy, log the content length rather than the content string itself.
3059
3060 2019-12-02  Wenson Hsieh  <wenson_hsieh@apple.com>
3061
3062         [iOS] Introduce a gesture recognizer that can be used to defer recognition of other gestures
3063         https://bugs.webkit.org/show_bug.cgi?id=204748
3064         <rdar://problem/38670692>
3065
3066         Reviewed by Tim Horton.
3067
3068         Introduces WKDeferringGestureRecognizer, which is similar to UIKit's _UIRelationshipGestureRecognizer. In a
3069         future patch, this will be added to WKContentView to prevent platform gestures (pinching, panning, single/double
3070         taps, etc.) from recognizing when dispatching a preventable touch event to the page.
3071
3072         Additionally renames a member variable on WKContentView, in preparation for making touch gesture recognition
3073         asynchronous. No new tests, since there is no change in behavior yet.
3074
3075         * SourcesCocoa.txt:
3076
3077         Add the new file.
3078
3079         * UIProcess/ios/WKContentViewInteraction.h:
3080
3081         Add a couple of (currently unused) deferring gesture recognizers. These will be added to WKContentView in a
3082         future patch. There are two deferring gestures here (one for "immediately resettable" gestures and another for
3083         gestures for which the reset is "deferred" -- i.e., multi-tap gestures); this prevents a single deferring
3084         gesture from connecting the entire gesture subgraph under WKWebView through failure dependencies. This would
3085         result in various usability issues, such as being unable to perform a pan gesture to scroll WKScrollView if a
3086         tap was recognized within the last 300 ms, since all gestures would need to wait until every double and triple-
3087         tap gesture under WKWebView has failed.
3088
3089         * UIProcess/ios/WKContentViewInteraction.mm:
3090         (-[WKContentView setupInteraction]):
3091         (-[WKContentView _webTouchEventsRecognized:]):
3092
3093         Rename _canSendTouchEventsAsynchronously to _touchEventsCanPreventNativeGestures in preparation for adding a
3094         codepath for fully asynchronous touch event dispatch; we also flip the conditional in any places where
3095         _canSendTouchEventsAsynchronously was previously set or read.
3096
3097         (-[WKContentView _webTouchEvent:preventsNativeGestures:]):
3098         (-[WKContentView scrollViewWillStartPanOrPinchGesture]):
3099         (-[WKContentView gestureRecognizer:shouldIgnoreWebTouchWithEvent:]):
3100         (-[WKContentView gestureRecognizer:isInterruptingMomentumScrollingWithEvent:]):
3101         (-[WKContentView deferringGestureRecognizer:shouldDeferGesturesWithEvent:]):
3102         (-[WKContentView deferringGestureRecognizer:shouldDeferOtherGestureRecognizer:]):
3103
3104         Implement WKDeferringGestureRecognizerDelegate.
3105
3106         (-[WKContentView shouldIgnoreWebTouch]): Deleted.
3107
3108         Drive-by fix: remove this unnecessary method implementation, and the related FIXME.
3109
3110         * UIProcess/ios/WKDeferringGestureRecognizer.h: Added.
3111         * UIProcess/ios/WKDeferringGestureRecognizer.mm: Added.
3112         (-[WKDeferringGestureRecognizer initWithDeferringGestureDelegate:]):
3113         (-[WKDeferringGestureRecognizer deferringGestureDelegate]):
3114         (-[WKDeferringGestureRecognizer touchesBegan:withEvent:]):
3115
3116         Unless the touch is interrupts momentum scrolling, WKDeferringGestureRecognizer should transition to Possible
3117         state when starting a touch. Later, -setDefaultPrevented: is invoked, which will either transition the deferring
3118         gesture recognizer to Failed state (thereby allowing native gestures to begin), or Ended state (preventing other
3119         native gestures).
3120
3121         (-[WKDeferringGestureRecognizer touchesCancelled:withEvent:]):
3122         (-[WKDeferringGestureRecognizer setDefaultPrevented:]):
3123         (-[WKDeferringGestureRecognizer canBePreventedByGestureRecognizer:]):
3124
3125         Return NO here to prevent certain platform gestures (e.g. scroll view panning) from causing the deferring
3126         gesture to Failed state, when these gestures attempt to transition from Possible to Began state.
3127
3128         (-[WKDeferringGestureRecognizer shouldDeferGestureRecognizer:]):
3129         * WebKit.xcodeproj/project.pbxproj:
3130
3131 2019-12-02  Yoshiaki Jitsukawa  <yoshiaki.jitsukawa@sony.com>
3132
3133         ResponsivenessTimer mistakenly restarts immediately
3134         https://bugs.webkit.org/show_bug.cgi?id=204659
3135
3136         Reviewed by Chris Dumez.
3137
3138         * UIProcess/ResponsivenessTimer.cpp:
3139         (WebKit::ResponsivenessTimer::timerFired):
3140         Give startOneShot() a positive number timeout.
3141
3142 2019-12-02  Carlos Garcia Campos  <cgarcia@igalia.com>
3143
3144         [GTK][PSON] Crash in NetworkProcessProxy::openNetworkProcessConnection
3145         https://bugs.webkit.org/show_bug.cgi?id=204703
3146
3147         Reviewed by Michael Catanzaro.
3148
3149         Stop sending a message to all web process to prefetch DNS for a hostname. All web processes then send a messaage
3150         to their network process to prefetch the DNS. Instead, send a message directly to the network process.
3151
3152         * NetworkProcess/NetworkProcess.messages.in:
3153         * UIProcess/API/glib/WebKitWebContext.cpp:
3154         (webkit_web_context_prefetch_dns):
3155         * WebProcess/InjectedBundle/API/glib/WebKitWebExtension.cpp:
3156
3157 2019-12-01  Fujii Hironori  <Hironori.Fujii@sony.com>
3158
3159         [Win] Retrieve all following WM_CHAR events at the beginning of processing WM_KEYDOWN event
3160         https://bugs.webkit.org/show_bug.cgi?id=204694
3161
3162         Reviewed by Ross Kirsling.
3163
3164         In Windows ports, WM_KEYDOWN dispatches keydown event, and
3165         WM_CHAR dispatches keypress event. If a keydown event is canceled
3166         by calling preventDefault, the following corresponding keypress
3167         events shouldn't be dispatched.
3168
3169         WebKit1 implemented it by removing WM_CHAR events if the keydown
3170         event is consumed. However, WebKit2 can't do so because WebKit2
3171         processes key events asynchronously. Thus, retrieve all following
3172         WM_CHAR events, and dispatch them after processing the keydown
3173         and if it is not consumed.
3174
3175         In addition to that, retrieving following WM_CHAR events is needed
3176         to fix Bug 204672 because the events are needed for 'key' property
3177         of keydown KeyboardEvent for dead key combination.
3178
3179         Gecko and Chromium also implements 'key' property in the same approach.
3180
3181         Test: Covered by existing fast/events/inputText-never-fired-on-keydown-cancel.html and fast/events/keydown-keypress-preventDefault.html
3182
3183         * Shared/NativeWebKeyboardEvent.h: Added m_pendingCharEvents as Vector<MSG>.
3184         (WebKit::NativeWebKeyboardEvent::pendingCharEvents const):
3185         * Shared/win/NativeWebKeyboardEventWin.cpp:
3186         (WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent):
3187         * UIProcess/WebPageProxy.cpp:
3188         (WebKit::WebPageProxy::didReceiveEvent):
3189         * UIProcess/WebPageProxy.h:
3190         * UIProcess/win/WebPageProxyWin.cpp:
3191         (WebKit::WebPageProxy::dispatchPendingCharEvents):
3192         * UIProcess/win/WebView.cpp:
3193         (WebKit::WebView::onKeyEvent):
3194
3195 2019-11-30  Tim Horton  <timothy_horton@apple.com>
3196
3197         Make CompositeOperator and BlendMode encodable
3198         https://bugs.webkit.org/show_bug.cgi?id=204722
3199
3200         Reviewed by Eric Carlson.
3201
3202         * UIProcess/cairo/BackingStoreCairo.cpp:
3203         (WebKit::BackingStore::incorporateUpdate):
3204         * WebProcess/Plugins/PluginProxy.cpp:
3205         (WebKit::PluginProxy::paint):
3206         (WebKit::PluginProxy::update):
3207         * WebProcess/WebPage/FindController.cpp:
3208         (WebKit::FindController::drawRect):
3209
3210 2019-11-30  Tim Horton  <timothy_horton@apple.com>
3211
3212         Reimplement some PlatformCALayer methods using GraphicsContext instead of CGContextRef
3213         https://bugs.webkit.org/show_bug.cgi?id=204698
3214
3215         Reviewed by Sam Weinig.
3216
3217         * Shared/RemoteLayerTree/RemoteLayerBackingStore.h:
3218         * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
3219         (WebKit::RemoteLayerBackingStore::drawInContext):
3220         (WebKit::RemoteLayerBackingStore::enumerateRectsBeingDrawn):
3221         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
3222         (WebKit::PlatformCALayerRemote::enumerateRectsBeingDrawn):
3223         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h:
3224
3225 2019-11-27  Antoine Quint  <graouts@apple.com>
3226
3227         [Web Animations] Enable WebAnimationsCSSIntegrationEnabled by default
3228         https://bugs.webkit.org/show_bug.cgi?id=204650
3229         <rdar://problem/45562752>
3230
3231         Reviewed by Dean Jackson.
3232
3233         * Shared/WebPreferences.yaml:
3234
3235 2019-11-28  Fujii Hironori  <Hironori.Fujii@sony.com>
3236
3237         Remove ENABLE_KEYBOARD_CODE_ATTRIBUTE and ENABLE_KEYBOARD_KEY_ATTRIBUTE macros
3238         https://bugs.webkit.org/show_bug.cgi?id=204666
3239
3240         No behavior change.
3241
3242         * Configurations/FeatureDefines.xcconfig:
3243         * Shared/WebEvent.h:
3244         (WebKit::WebKeyboardEvent::unmodifiedText const):
3245         (WebKit::WebKeyboardEvent::key const):
3246         (WebKit::WebKeyboardEvent::code const):
3247         * Shared/WebEventConversion.cpp:
3248         (WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent):
3249         * Shared/WebKeyboardEvent.cpp:
3250         (WebKit::WebKeyboardEvent::WebKeyboardEvent):
3251         (WebKit::WebKeyboardEvent::encode const):
3252         (WebKit::WebKeyboardEvent::decode):
3253         * WebProcess/WebPage/ios/WebPageIOS.mm:
3254         (WebKit::WebPage::generateSyntheticEditingCommand):
3255
3256 2019-11-27  Philippe Normand  <pnormand@igalia.com>
3257
3258         [GTK][WebInspector] Use CString to store exported data
3259         https://bugs.webkit.org/show_bug.cgi?id=204623
3260
3261         Reviewed by Carlos Garcia Campos.
3262
3263         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
3264         (WebKit::WebInspectorProxy::platformSave): Use a CString for copy-on-write assignment.
3265
3266 2019-11-27  Alejandro G. Castro  <alex@igalia.com>
3267
3268         Unreviewed. Update OptionsWPE.cmake and NEWS for the 2.27.3 release
3269
3270         * wpe/NEWS: Add release notes for 2.27.3.
3271
3272 2019-11-27  Carlos Garcia Campos  <cgarcia@igalia.com>
3273
3274         [GTK] WebDriver: moving toplevel windows is not supported under wayland
3275         https://bugs.webkit.org/show_bug.cgi?id=204614
3276
3277         Reviewed by Alejandro G. Castro.
3278
3279         So we can stop trying and simply ignore the requests to move the window.
3280
3281         * UIProcess/API/glib/WebKitUIClient.cpp:
3282         (UIClient::windowConfigureEventCallback): Ensure we only move or resize when actually required and reduce the
3283         time we wait for configure events to 200ms (1 second was too long).
3284
3285 2019-11-26  Antti Koivisto  <antti@apple.com>
3286
3287         [LFC][Render tree] Add LFC line layout path to RenderBlockFlow
3288         https://bugs.webkit.org/show_bug.cgi?id=204613
3289
3290         Reviewed by Zalan Bujtas.
3291
3292         * Shared/WebPreferences.yaml:
3293         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3294         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
3295
3296 2019-11-26  Carlos Garcia Campos  <cgarcia@igalia.com>
3297
3298         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.27.3 release
3299
3300         * gtk/NEWS: Add release notes for 2.27.3.
3301
3302 2019-11-26  Carlos Garcia Campos  <cgarcia@igalia.com>
3303
3304         REGRESSION(2.27.2): [GTK] Incognito mode is broken under flatpak
3305         https://bugs.webkit.org/show_bug.cgi?id=203460
3306
3307         Reviewed by Youenn Fablet.
3308
3309         The problem is that in ephemeral sessions the base disk cache directory is null, and Storage::open() ends up
3310         building a cache path with only the version part (/Version n). For some reason g_mkdir_with_parents() doesn't
3311         return -1 in flatpak when it fails to create the directory due to write permission, like in this case. But the
3312         network process ends up crashing later trying to open a directory that doesn't exist.
3313
3314         * NetworkProcess/NetworkSession.cpp:
3315         (WebKit::NetworkSession::NetworkSession): Do not create the cache if networkCacheDirectory is null.
3316         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3317         (WebKit::NetworkCache::Storage::open): Add an ASSERT to ensure we don't receive a null baseCachePath.
3318
3319 2019-11-25  Yusuke Suzuki  <ysuzuki@apple.com>
3320
3321         [JSC] InternalFunction should be non-destructible
3322         https://bugs.webkit.org/show_bug.cgi?id=204556
3323
3324         Reviewed by Mark Lam.
3325
3326         * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
3327         (WebKit::JSNPMethod::subspaceForImpl):
3328
3329 2019-11-25  Wenson Hsieh  <wenson_hsieh@apple.com>
3330
3331         [macOS] Dragged images are only available as .tiff when dropping onto macCatalyst apps
3332         https://bugs.webkit.org/show_bug.cgi?id=204598
3333         <rdar://problem/57093920>
3334
3335         Reviewed by Tim Horton.
3336
3337         On macOS, writing dragged images to the pasteboard only as file promises is mostly sufficient for the purposes
3338         of dropping into Finder, Photos, and other apps. However, when dropping into a macCatalyst app, the contents of
3339         NSPasteboard will only contain a file URL, which most Catalyst apps aren't able to handle. The only other valid
3340         image representation that is written to the pasteboard in this case is "public.tiff", which loses fidelity in
3341         the case of animated GIFs.
3342
3343         Instead, if the dragged image has a corresponding UTI and corresponding decoded image data, declare the UTI when
3344         writing promised data to the pasteboard, and later provide data for the UTI, if the drop destination asks, by
3345         using the promised image's data.
3346
3347         Test: DragAndDropTests.ProvideImageDataAsTypeIdentifiers
3348
3349         * UIProcess/Cocoa/WebViewImpl.mm:
3350         (WebKit::WebViewImpl::setPromisedDataForImage):
3351         (WebKit::WebViewImpl::provideDataForPasteboard):
3352
3353 2019-11-25  Fujii Hironori  <Hironori.Fujii@sony.com>
3354
3355         [Win] Update KeyboardEvent as per the latest specification
3356         https://bugs.webkit.org/show_bug.cgi?id=202183
3357
3358         Reviewed by Ross Kirsling.
3359
3360         * Shared/WebEvent.h:
3361         * Shared/WebKeyboardEvent.cpp:
3362         (WebKit::WebKeyboardEvent::WebKeyboardEvent):
3363         * Shared/win/WebEventFactory.cpp:
3364         (WebKit::windowsKeyNames):
3365         (WebKit::WebEventFactory::createWebKeyboardEvent):
3366
3367 2019-11-25  ChangSeok Oh  <changseok@webkit.org>
3368
3369         [GTK] Check EGL image extension by using native gl API in AcceleratedBackingStoreWayland
3370         https://bugs.webkit.org/show_bug.cgi?id=204446
3371
3372         Reviewed by Carlos Garcia Campos.
3373
3374         This change is part of efforts bringing ANGLE backend for WebGL to the gtk port.
3375         When ANGLE WebGL is enabled, we face a dilemma of choosing either Extensions3DANGLE
3376         or Extensions3DOpenGL in AcceleratedBackingStoreWayland.cpp. Since they cannot
3377         coexist, we chose Extensions3DANGLE even if what we really want is Extensions3DOepnGL.
3378         We address this problem by directly checking egl image extension availability
3379         via native GL API rather than relying on Extensions3D* classes in the file.
3380
3381         * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
3382         (WebKit::isEGLImageAvailable):
3383         (WebKit::AcceleratedBackingStoreWayland::checkRequirements):
3384
3385 2019-11-25  Youenn Fablet  <youenn@apple.com>
3386
3387         Crash in WebCore::ServiceWorkerRegistrationKey::hash() const
3388         https://bugs.webkit.org/show_bug.cgi?id=204497
3389         <rdar://problem/57348603>
3390
3391         Reviewed by Alex Christensen.
3392
3393         * WebProcess/Storage/WebSWClientConnection.cpp:
3394         (WebKit::WebSWClientConnection::scheduleJobInServer):
3395         Add a release assert to be able to further debug the crash.
3396
3397 2019-11-23  John Wilander  <wilander@apple.com>
3398
3399         Resource Load Statistics: Allow multiple third-party cookie blocking settings
3400         https://bugs.webkit.org/show_bug.cgi?id=204389
3401         <rdar://problem/57344054>
3402
3403         Reviewed by Brent Fulgham.
3404
3405         This change make the third-party cookie blocking setting go from a boolean to
3406         the new enum WebCore::ThirdPartyCookieBlockingMode with three different settings.
3407         Functions and member variables are renamed accordingly.
3408
3409         The reason for supporting three different modes is that what is now named
3410         OnlyAccordingToPerDomainPolicy is shipping, AllOnSitesWithoutUserInteraction is
3411         in beta, and All is behind an experimental flag.
3412
3413         The change also updates the test API to map the TestRunner call to the enum.
3414
3415         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
3416         (WebKit::ResourceLoadStatisticsDatabaseStore::hasStorageAccess):
3417         (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccess):
3418         (WebKit::ResourceLoadStatisticsDatabaseStore::clearUserInteraction):
3419             Now makes use of a completion handler and updates the cookie blocking state.
3420         (WebKit::ResourceLoadStatisticsDatabaseStore::hasHadUserInteraction):
3421         (WebKit::ResourceLoadStatisticsDatabaseStore::areAllThirdPartyCookiesBlockedUnder):
3422             New convenience function to check the cookie blocking status per first-party domain.
3423         (WebKit::ResourceLoadStatisticsDatabaseStore::cookieAccess):
3424             Restructured the code to make it very clear that the logic is the same as the
3425             corresponding function in ResourceLoadStatisticsMemoryStore.
3426             Can no longer be const since it calls areAllThirdPartyCookiesBlockedUnder() which
3427             in turn calls hasHadUserInteraction() and that function may clear user interaction data.
3428         (WebKit::ResourceLoadStatisticsDatabaseStore::hasHadUnexpiredRecentUserInteraction):
3429         (WebKit::ResourceLoadStatisticsDatabaseStore::cookieAccess const): Deleted.
3430             See comment above on the non-const version of this function.
3431         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
3432         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
3433         (WebKit::ResourceLoadStatisticsMemoryStore::areAllThirdPartyCookiesBlockedUnder):
3434             New convenience function to check the cookie blocking status per first-party domain.
3435         (WebKit::ResourceLoadStatisticsMemoryStore::cookieAccess):
3436             Restructured the code to make it very clear that the logic is the same as the
3437             corresponding function in ResourceLoadStatisticsDatabaseStore.
3438             Can no longer be const since it calls areAllThirdPartyCookiesBlockedUnder() which
3439             in turn calls hasHadUserInteraction() and that function may clear user interaction data.
3440         (WebKit::ResourceLoadStatisticsMemoryStore::hasStorageAccess):
3441         (WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccess):
3442         (WebKit::ResourceLoadStatisticsMemoryStore::clearUserInteraction):
3443             Now makes use of a completion handler and updates the cookie blocking state.
3444         (WebKit::ResourceLoadStatisticsMemoryStore::cookieAccess const): Deleted.
3445             See comment above on the non-const version of this function.
3446         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
3447         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
3448         (WebKit::ResourceLoadStatisticsStore::setThirdPartyCookieBlockingMode):
3449         (WebKit::ResourceLoadStatisticsStore::thirdPartyCookieBlockingMode const):
3450         (WebKit::ResourceLoadStatisticsStore::setIsThirdPartyCookieBlockingEnabled): Deleted.
3451         (WebKit::ResourceLoadStatisticsStore::isThirdPartyCookieBlockingEnabled const): Deleted.
3452         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
3453         (WebKit::WebResourceLoadStatisticsStore::setThirdPartyCookieBlockingMode):
3454         (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction):
3455             Now forwards the completion handler.