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