88c77f616840befba4dbf1a74868be5add732fe1
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2018-12-10  Alex Christensen  <achristensen@webkit.org>
2
3         Fix WatchOS build.
4
5         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
6         * UIProcess/ios/WKContentViewInteraction.mm:
7         (-[WKContentView actionNameForFocusedFormControlView:]):
8
9 2018-12-10  Matt Lewis  <jlewis3@apple.com>
10
11         Unreviewed, rolling out r239029.
12
13         This patch caused internal build failures.
14
15         Reverted changeset:
16
17         "[meta][WebKit] Remove using namespace WebCore and WebKit in
18         the global scope for unified source builds"
19         https://bugs.webkit.org/show_bug.cgi?id=192449
20         https://trac.webkit.org/changeset/239029
21
22 2018-12-10  Chris Dumez  <cdumez@apple.com>
23
24         Add SPI to allow the client to set the user-agent at main frame level, from the UIProcess
25         https://bugs.webkit.org/show_bug.cgi?id=192509
26         <rdar://problem/46500832>
27
28         Reviewed by Alex Christensen.
29
30         Add SPI to allow the client to set the user-agent at main frame level, from the UIProcess instead of doing
31         it at resource-level from the injected bundle.
32
33         The custom user-agent string can now be set on _WKWebsitePolicies during the
34         decidePolicyForNavigationAction for the main feame, and will impact this main resource load as well as its
35         future subresource loads.
36
37         * Shared/WebsitePoliciesData.cpp:
38         (WebKit::WebsitePoliciesData::encode const):
39         (WebKit::WebsitePoliciesData::decode):
40         (WebKit::WebsitePoliciesData::applyToDocumentLoader):
41         * Shared/WebsitePoliciesData.h:
42         * UIProcess/API/APIWebsitePolicies.cpp:
43         (API::WebsitePolicies::data):
44         * UIProcess/API/APIWebsitePolicies.h:
45         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
46         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
47         (-[_WKWebsitePolicies setCustomUserAgent:]):
48         (-[_WKWebsitePolicies customUserAgent]):
49         * UIProcess/Cocoa/NavigationState.mm:
50         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
51
52 2018-12-10  Alex Christensen  <achristensen@webkit.org>
53
54         Safe browsing warning should layout buttons vertically in narrow WKWebViews
55         https://bugs.webkit.org/show_bug.cgi?id=192535
56         <rdar://problem/46308364>
57
58         Reviewed by Tim Horton.
59
60         They're usually next to each other, but in narrow WKWebViews they currently get clipped.
61         In order to make it more likely that both buttons are completely visible, put one above
62         the other if the WKWebView is too narrow to completely show both.  This also helps with
63         languages where the translations of "Go Back" or "Show Details" are rendered wider than English.
64
65         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
66         (buttonWidth):
67         (-[WKSafeBrowsingWarning addContent]):
68
69 2018-12-10  Simon Fraser  <simon.fraser@apple.com>
70
71         Allow control over child order when adding nodes to the scrolling tree
72         https://bugs.webkit.org/show_bug.cgi?id=176914
73         <rdar://problem/46542237>
74         
75         Re-land r239010 after over-zealous rollout.
76
77         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
78         (WebKit::RemoteScrollingCoordinatorTransaction::decode):
79
80 2018-12-10  Wenson Hsieh  <wenson_hsieh@apple.com>
81
82         [iOS] Caret is obscured by finger when dragging over an editable element
83         https://bugs.webkit.org/show_bug.cgi?id=192499
84         <rdar://problem/46570101>
85
86         Reviewed by Tim Horton.
87
88         Add support for setting the `precise` property of `UIDropProposal` to YES when dragging over an editable area.
89         When enabled, this property shifts the drop location up by a small amount, allowing the user to see the drop
90         caret (currently, this is not the case, and it's difficult to drop text at a precise location on iOS). Changes
91         are covered by adding to existing API tests.
92
93         * Scripts/webkit/messages.py:
94         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
95
96         Add a new version of `-_webView:willUpdateDataInteractionOperationToOperation:forSession:` that receives and
97         returns a UIDropProposal, so that Mail can more easily port over existing logic in its legacy-WebKit-based
98         compose implementation. iOS Safari is currently the only client of this private delegate, so the old version can
99         be easily removed once Safari adopts this new version.
100
101         * UIProcess/WebPageProxy.cpp:
102         (WebKit::WebPageProxy::didPerformDragControllerAction):
103
104         Add plumbing to send the latest drag handling method from WebPage to WebPageProxy.
105
106         (WebKit::WebPageProxy::resetCurrentDragInformation):
107         * UIProcess/WebPageProxy.h:
108         (WebKit::WebPageProxy::currentDragHandlingMethod const):
109         * UIProcess/WebPageProxy.messages.in:
110         * UIProcess/ios/WKContentViewInteraction.mm:
111         (-[WKContentView dropInteraction:sessionDidUpdate:]):
112
113         Call the new UI delegate hook when determining the drop proposal to return to UIKit. Additionally set the
114         `precise` bit on the drop proposal in the case where the drop handling method is either "editing rich text" or
115         "editing plain text".
116
117         * WebProcess/WebPage/WebPage.cpp:
118         (WebKit::WebPage::performDragControllerAction):
119         * WebProcess/WebPage/WebPage.h:
120
121 2018-12-10  Youenn Fablet  <youenn@apple.com>
122
123         Make mock capture happen in the process used for real capture
124         https://bugs.webkit.org/show_bug.cgi?id=192544
125
126         Reviewed by Eric Carlson.
127
128         Make mock capture happen in the right process by only overriding
129         factories by mock factories for source types that UserMediaCaptureManager will not override.
130         That way, UserMediaCaptureManager will be used to go to UIProcess, where mock will be used as if it was the real capture.
131
132         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
133         (WebKit::UserMediaCaptureManager::initialize):
134
135 2018-12-10  Alexey Proskuryakov  <ap@apple.com>
136
137         Move ENABLE_SEC_ITEM_SHIM out of WebKit's config.h
138         https://bugs.webkit.org/show_bug.cgi?id=192428
139
140         Reviewed by Tim Horton.
141
142         * config.h:
143
144 2018-12-10  Alexey Proskuryakov  <ap@apple.com>
145
146         Move more macros out of WebKit's config.h
147         https://bugs.webkit.org/show_bug.cgi?id=192430
148
149         Reviewed by Tim Horton.
150
151         * config.h:
152
153 2018-12-10  Chris Fleizach  <cfleizach@apple.com>
154
155         [meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds
156         https://bugs.webkit.org/show_bug.cgi?id=192449
157
158         Reviewed by Darin Adler.
159
160         * NetworkProcess/Cookies/mac/WebCookieManagerMac.mm:
161         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
162         * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
163         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
164         * NetworkProcess/ios/NetworkProcessIOS.mm:
165         * NetworkProcess/mac/NetworkProcessMac.mm:
166         * NetworkProcess/mac/RemoteNetworkingContext.mm:
167         * Platform/spi/ios/AccessibilitySupportSPI.h:
168         * PlatformMac.cmake:
169         * PluginProcess/PluginControllerProxy.cpp:
170         * PluginProcess/PluginProcess.cpp:
171         * PluginProcess/WebProcessConnection.cpp:
172         * Scripts/PreferencesTemplates/WebPreferencesStoreDefaultsMap.cpp.erb:
173         * Shared/API/c/cf/WKErrorCF.cpp:
174         (WKErrorCreateWithCFError):
175         (WKErrorCopyCFError):
176         * Shared/API/c/cg/WKImageCG.cpp:
177         (WKImageCreateCGImage):
178         (WKImageCreateFromCGImage):
179         * Shared/ChildProcess.cpp:
180         * Shared/ContextMenuContextData.cpp:
181         * Shared/EditorState.cpp:
182         * Shared/Plugins/NPIdentifierData.cpp:
183         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
184         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
185         * Shared/SessionState.cpp:
186         * Shared/SessionTracker.cpp:
187         * Shared/ShareableBitmap.cpp:
188         * Shared/ShareableResource.cpp:
189         * Shared/VisibleContentRectUpdateInfo.cpp:
190         * Shared/WebBackForwardListItem.cpp:
191         * Shared/WebContextMenuItemData.cpp:
192         * Shared/WebCoreArgumentCoders.cpp:
193         * Shared/WebHitTestResultData.cpp:
194         * Shared/WebImage.cpp:
195         * Shared/WebMediaSessionMetadata.cpp:
196         * Shared/WebMemorySampler.cpp:
197         * Shared/WebMouseEvent.cpp:
198         * Shared/WebRenderObject.cpp:
199         * Shared/WebSQLiteDatabaseTracker.cpp:
200         * Shared/WebWheelEvent.cpp:
201         * Shared/cf/ArgumentCodersCF.cpp:
202         * Shared/ios/WebPlatformTouchPointIOS.cpp:
203         * SourcesCocoa.txt:
204         * UIProcess/API/APIContentRuleListStore.cpp:
205         * UIProcess/API/APIHitTestResult.cpp:
206         * UIProcess/API/APINavigation.cpp:
207         * UIProcess/API/APIOpenPanelParameters.cpp:
208         * UIProcess/API/APIPageConfiguration.cpp:
209         * UIProcess/API/C/WKPage.cpp:
210         (WKPageLoadURLWithShouldOpenExternalURLsPolicy):
211         (WKPageLoadURLWithUserData):
212         (WKPageLoadURLRequestWithUserData):
213         (WKPageSetPaginationMode):
214         (WKPageGetPaginationMode):
215         (WKPageSetPageLoaderClient):
216         (WKPageSetPagePolicyClient):
217         * UIProcess/API/C/cg/WKIconDatabaseCG.cpp:
218         * UIProcess/Cocoa/WebViewImpl.h:
219         * UIProcess/Cocoa/WebViewImpl.mm:
220         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
221         * UIProcess/WebStorage/LocalStorageDatabase.cpp:
222         * UIProcess/ios/WKContentView.mm:
223         (-[WKContentView _commonInitializationWithProcessPool:configuration:]):
224         (-[WKContentView initWithFrame:processPool:configuration:webView:]):
225         (-[WKContentView dealloc]):
226         (-[WKContentView page]):
227         (-[WKContentView updateFixedClippingView:]):
228         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
229         (-[WKContentView _updateForScreen:]):
230         (-[WKContentView _accessibilityRegisterUIProcessTokens]):
231         (-[WKContentView _createDrawingAreaProxy]):
232         (-[WKContentView _didCommitLayerTree:]):
233         (-[WKContentView _wk_pageCountForPrintFormatter:]):
234         * UIProcess/ios/WKContentViewInteraction.mm:
235         (-[WKFocusedElementInfo initWithAssistedNodeInformation:isUserInitiated:userObject:]):
236         (hasAssistedNode):
237         (-[WKContentView setupInteraction]):
238         (-[WKContentView positionInformation]):
239         (-[WKContentView _webTouchEventsRecognized:]):
240         (inflateQuad):
241         (-[WKContentView _updateTapHighlight]):
242         (-[WKContentView _showTapHighlight]):
243         (-[WKContentView _requiresKeyboardWhenFirstResponder]):
244         (-[WKContentView _displayFormNodeInputView]):
245         (-[WKContentView inputView]):
246         (-[WKContentView _actionForLongPressFromPositionInformation:]):
247         (-[WKContentView currentPositionInformation]):
248         (-[WKContentView doAfterPositionInformationUpdate:forRequest:]):
249         (-[WKContentView _currentPositionInformationIsValidForRequest:]):
250         (-[WKContentView _hasValidOutstandingPositionInformationRequest:]):
251         (-[WKContentView _currentPositionInformationIsApproximatelyValidForRequest:]):
252         (-[WKContentView gestureRecognizerShouldBegin:]):
253         (-[WKContentView hasSelectablePositionAtPoint:]):
254         (-[WKContentView pointIsNearMarkedText:]):
255         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
256         (-[WKContentView webSelectionRectsForSelectionRects:]):
257         (-[WKContentView _twoFingerSingleTapGestureRecognized:]):
258         (-[WKContentView _stylusSingleTapRecognized:]):
259         (-[WKContentView _singleTapCommited:]):
260         (-[WKContentView _attemptClickAtLocation:]):
261         (-[WKContentView _positionInformationDidChange:]):
262         (-[WKContentView requiresAccessoryView]):
263         (-[WKContentView supportedPasteboardTypesForCurrentSelection]):
264         (-[WKContentView _lookupForWebView:]):
265         (-[WKContentView _shareForWebView:]):
266         (-[WKContentView textStylingAtPosition:inDirection:]):
267         (-[WKContentView canPerformActionForWebView:withSender:]):
268         (-[WKContentView selectForWebView:]):
269         (-[WKContentView _accessibilityRetrieveRectsEnclosingSelectionOffset:withGranularity:]):
270         (-[WKContentView _accessibilityRetrieveRectsAtSelectionOffset:withText:completionHandler:]):
271         (toGestureType):
272         (toUIWKGestureType):
273         (toSelectionTouch):
274         (toUIWKSelectionTouch):
275         (toGestureRecognizerState):
276         (toUIGestureRecognizerState):
277         (toUIWKSelectionFlags):
278         (toWKTextGranularity):
279         (toWKSelectionDirection):
280         (selectionChangedWithGesture):
281         (selectionChangedWithTouch):
282         (-[WKContentView changeSelectionWithGestureAt:withGesture:withState:withFlags:]):
283         (-[WKContentView autocorrectionData]):
284         (-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]):
285         (-[WKContentView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]):
286         (-[WKContentView _updateAccessory]):
287         (-[WKContentView selectedTextRange]):
288         (-[WKContentView setMarkedText:selectedRange:]):
289         (coreWritingDirection):
290         (-[WKContentView closestPositionToPoint:]):
291         (-[WKContentView insertText:]):
292         (-[WKContentView textInputTraits]):
293         (-[WKContentView handleKeyWebEvent:]):
294         (-[WKContentView handleKeyWebEvent:withCompletionHandler:]):
295         (-[WKContentView isScrollableForKeyboardScrollViewAnimator:]):
296         (-[WKContentView keyboardScrollViewAnimator:distanceForIncrement:]):
297         (-[WKContentView assistedNodeInformation]):
298         (-[WKContentView assistedNodeSelectOptions]):
299         (isAssistableInputType):
300         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
301         (-[WKContentView _stopAssistingNode]):
302         (-[WKContentView updateCurrentAssistedNodeInformation:]):
303         (-[WKContentView presentViewControllerForCurrentAssistedNode]):
304         (-[WKContentView actionNameForFocusedFormControlView:]):
305         (-[WKContentView selectWordForReplacement]):
306         (-[WKContentView _updateChangedSelection:]):
307         (-[WKContentView _beginSuppressingSelectionAssistantForReason:]):
308         (-[WKContentView _stopSuppressingSelectionAssistantForReason:]):
309         (-[WKContentView _showPlaybackTargetPicker:fromRect:routeSharingPolicy:routingContextUID:]):
310         (-[WKContentView _showRunOpenPanel:resultListener:]):
311         (-[WKContentView _showShareSheet:completionHandler:]):
312         (-[WKContentView positionInformationForActionSheetAssistant:]):
313         (-[WKContentView updatePositionInformationForActionSheetAssistant:]):
314         (-[WKContentView _startDrag:item:]):
315         (-[WKContentView _didHandleAdditionalDragItemsRequest:]):
316         (-[WKContentView _didHandleStartDataInteractionRequest:]):
317         (dropOperationForWebCoreDragOperation):
318         (-[WKContentView dragDataForDropSession:dragDestinationAction:]):
319         (-[WKContentView _didConcludeEditDataInteraction:]):
320         (-[WKContentView _didPerformDragOperation:]):
321         (-[WKContentView _prepareToDragPromisedAttachment:]):
322         (-[WKContentView _itemsForBeginningOrAddingToSessionWithRegistrationList:stagedDragSource:]):
323         (-[WKContentView _autofillContext]):
324         (-[WKContentView _dragInteraction:itemsForAddingToSession:withTouchAtPoint:completion:]):
325         (-[WKContentView _dragInteraction:prepareForSession:completion:]):
326         (-[WKContentView dragInteraction:itemsForBeginningSession:]):
327         (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]):
328         (-[WKContentView dragInteraction:session:didEndWithOperation:]):
329         (-[WKContentView dragInteraction:item:willAnimateCancelWithAnimator:]):
330         (-[WKContentView dropInteraction:performDrop:]):
331         (-[WKContentView dropInteraction:sessionDidEnd:]):
332         (-[WKContentView allowsLanguageSelectionMenuForListViewController:]):
333         (-[WKContentView shouldDisplayInputContextViewForListViewController:]):
334         (-[WKContentView numericInputModeForListViewController:]):
335         (-[WKContentView textContentTypeForListViewController:]):
336         (-[WKContentView allowsDictationInputForListViewController:]):
337         (-[WKContentView _simulateLongPressActionAtLocation:]):
338         (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
339         (-[WKContentView _presentationRectsForPreviewItemController:]):
340         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
341         (WKFullScreenViewControllerPlaybackSessionModelClient::setInterface):
342         (WKFullScreenViewControllerVideoFullscreenModelClient::setInterface):
343         (WKFullScreenViewControllerVideoFullscreenModelClient::interface const):
344         (-[WKFullScreenViewController videoControlsManagerDidChange]):
345         (-[WKFullScreenViewController _manager]):
346         (-[WKFullScreenViewController _togglePiPAction:]):
347         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
348         (-[WKFullscreenAnimationController configureInitialAndFinalStatesForTransition:]):
349         (-[WKFullScreenWindowController isFullScreen]):
350         (-[WKFullScreenWindowController enterFullScreen]):
351         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
352         (-[WKFullScreenWindowController exitFullScreen]):
353         (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
354         (-[WKFullScreenWindowController _completedExitFullScreen]):
355         (-[WKFullScreenWindowController webViewDidRemoveFromSuperviewWhileInFullscreen]):
356         (-[WKFullScreenWindowController _exitFullscreenImmediately]):
357         (-[WKFullScreenWindowController _manager]):
358         * UIProcess/mac/WebPageProxyMac.mm:
359         * WebKit.xcodeproj/project.pbxproj:
360         * WebProcess/Cache/WebCacheStorageConnection.cpp:
361         * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
362         (mediaTimeToCurrentTime):
363         (-[WKAnimationDelegate initWithLayerID:layerTreeHost:]):
364         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
365         (-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper]):
366
367 2018-12-10  Tim Horton  <timothy_horton@apple.com>
368
369         WKWebView should support custom tintColor
370         https://bugs.webkit.org/show_bug.cgi?id=192518
371         <rdar://problem/37243261>
372
373         Reviewed by Wenson Hsieh.
374
375         * Platform/spi/ios/UIKitSPI.h:
376         * UIProcess/ios/WKContentViewInteraction.mm:
377         (-[WKContentView insertionPointColor]):
378         (-[WKContentView selectionBarColor]):
379         (-[WKContentView selectionHighlightColor]):
380         Grab insertion point and selection colors from UITextInputTraits.
381
382         (-[WKContentView _updateInteractionTintColor]):
383         Determine our effective tint color:
384             - transparent if interaction is disabled
385             - a CSS-derived color if caret-color style is applied
386             - the _inheritedInteractionTintColor, which climbs up to the tintColor API
387         Apply it to our UITextInputTraits.
388
389         (-[WKContentView tintColorDidChange]):
390         (-[WKContentView textInputTraits]):
391         Call _updateInteractionTintColor whenever we create a new UITextInputTraits
392         or when the tint color changes.
393
394 2018-12-09  Youenn Fablet  <youenn@apple.com>
395
396         Move capture manager from RealtimeMediaSourceCenter to capture factory
397         https://bugs.webkit.org/show_bug.cgi?id=192542
398
399         Reviewed by Eric Carlson.
400
401         Make sure to unregister for video capture as done for other capture types.
402         Implement manager which should be doing nothing as the manager is used for enumeration of devices
403         which should only happen in UIProcess.
404
405         Given that mock capture is interfering with UserMediaCaptureManager,
406         switching on/off mock capture will require creating a new process.
407         This shortcoming should be fixed once mock capture will be fully happening in
408         the same process as regular capture.
409
410         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
411         (WebKit::UserMediaCaptureManager::~UserMediaCaptureManager):
412         * WebProcess/cocoa/UserMediaCaptureManager.h:
413
414 2018-12-09  Saam barati  <sbarati@apple.com>
415
416         Enable HTTP and HTTPS proxies on iOS and make it a property of the NSURLSession
417         https://bugs.webkit.org/show_bug.cgi?id=192374
418         <rdar://problem/46506286>
419
420         Reviewed by Alex Christensen.
421
422         This patch makes it so that we can use HTTP/HTTPS proxies on iOS as well.
423         To enable on iOS, you can do something like:
424         $ defaults write -g WebKit2HTTPProxy -string "http://localhost:8080"
425         $ defaults write -g WebKit2HTTPSProxy -string "http://localhost:8080"
426         
427         This patch also changes the Proxy to be enabled on a per NSURLSession
428         basis instead of a per process basis.
429
430         * NetworkProcess/NetworkProcess.cpp:
431         (WebKit::NetworkProcess::initializeNetworkProcess):
432         * NetworkProcess/NetworkSessionCreationParameters.cpp:
433         (WebKit::NetworkSessionCreationParameters::privateSessionParameters):
434         (WebKit::NetworkSessionCreationParameters::encode const):
435         (WebKit::NetworkSessionCreationParameters::decode):
436         * NetworkProcess/NetworkSessionCreationParameters.h:
437         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
438         (WebKit::proxyDictionary):
439         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
440         * NetworkProcess/mac/NetworkProcessMac.mm:
441         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
442         (WebKit::overrideSystemProxies): Deleted.
443         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
444         (-[WKWebsiteDataStore _initWithConfiguration:]):
445         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
446         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
447         (-[_WKWebsiteDataStoreConfiguration httpProxy]):
448         (-[_WKWebsiteDataStoreConfiguration setHTTPProxy:]):
449         (-[_WKWebsiteDataStoreConfiguration httpsProxy]):
450         (-[_WKWebsiteDataStoreConfiguration setHTTPSProxy:]):
451         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
452         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
453         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
454         (WebKit::WebsiteDataStore::parameters):
455         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
456         (WebKit::WebsiteDataStoreConfiguration::copy):
457         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
458         (WebKit::WebsiteDataStoreConfiguration::httpProxy const):
459         (WebKit::WebsiteDataStoreConfiguration::setHTTPProxy):
460         (WebKit::WebsiteDataStoreConfiguration::httpsProxy const):
461         (WebKit::WebsiteDataStoreConfiguration::setHTTPSProxy):
462
463 2018-12-09  Adrian Perez de Castro  <aperez@igalia.com>
464
465         Build failure due to missing include of APIWebsiteDataStore.h
466         https://bugs.webkit.org/show_bug.cgi?id=192541
467
468         Reviewed by Youenn Fablet.
469
470         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp: Add missing
471         include of APIWebsiteDataStore.h
472
473 2018-12-09  Wenson Hsieh  <wenson_hsieh@apple.com>
474
475         [iOS device] Crash when attempting to call -[_WKAttachment info] for an editable image
476         https://bugs.webkit.org/show_bug.cgi?id=192538
477
478         Reviewed by Tim Horton.
479
480         Fix the crash by ensuring that the result of `-renderedDrawing` survives long enough to be wrapped by a
481         `RetainPtr` in `-PNGRepresentation`. This isn't currently testable, since this codepath isn't supported on the
482         iOS simulator; instead, I manually verified using MobileAttachments.app.
483
484         * UIProcess/ios/WKDrawingView.mm:
485         (-[WKDrawingView renderedDrawing]):
486
487 2018-12-09  Commit Queue  <commit-queue@webkit.org>
488
489         Unreviewed, rolling out r239010.
490         https://bugs.webkit.org/show_bug.cgi?id=192537
491
492         Breaks fast/visual-viewport/tiled-drawing/zoomed-fixed-
493         scrolling-layers-state.html again (Requested by ap on
494         #webkit).
495
496         Reverted changeset:
497
498         "Allow control over child order when adding nodes to the
499         scrolling tree"
500         https://bugs.webkit.org/show_bug.cgi?id=176914
501         https://trac.webkit.org/changeset/239010
502
503 2018-12-08  Alex Christensen  <achristensen@webkit.org>
504
505         Don't programmatically capitalize safe browsing warning buttons
506         https://bugs.webkit.org/show_bug.cgi?id=192531
507         <rdar://problem/46417791>
508
509         Reviewed by Darin Adler.
510
511         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
512         (makeButton):
513
514 2018-12-08  Alex Christensen  <achristensen@webkit.org>
515
516         Safe browsing warning should respect text size from settings
517         https://bugs.webkit.org/show_bug.cgi?id=192205
518
519         Reviewed by Tim Horton.
520
521         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
522         (fontWithSize):
523         (makeButton):
524         (-[WKSafeBrowsingWarning addContent]):
525         (-[WKSafeBrowsingWarning showDetailsClicked]):
526
527 2018-12-08  Frederic Wang  <fwang@igalia.com>
528
529         Allow control over child order when adding nodes to the scrolling tree
530         https://bugs.webkit.org/show_bug.cgi?id=176914
531         <rdar://problem/46542237>
532
533         Reviewed by Simon Fraser.
534
535         Based on an earlier patch by Simon Fraser.
536
537         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
538         (WebKit::RemoteScrollingCoordinatorTransaction::decode):
539
540 2018-12-07  Rob Buis  <rbuis@igalia.com>
541
542         Remove unused API in NetworkProcess
543         https://bugs.webkit.org/show_bug.cgi?id=192415
544
545         Reviewed by Alex Christensen.
546
547         This patch removed some unused API and headers in NetworkProcess.
548
549         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
550         (WebKit::NetworkCORSPreflightChecker::startPreflight):
551         * NetworkProcess/NetworkCORSPreflightChecker.h:
552         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
553         * NetworkProcess/NetworkConnectionToWebProcess.h:
554         * NetworkProcess/NetworkContentRuleListManager.h:
555         * NetworkProcess/NetworkDataTask.cpp:
556         * NetworkProcess/NetworkDataTask.h:
557         * NetworkProcess/NetworkDataTaskBlob.cpp:
558         * NetworkProcess/NetworkLoad.cpp:
559         * NetworkProcess/NetworkLoad.h:
560         * NetworkProcess/NetworkLoadChecker.cpp:
561         * NetworkProcess/NetworkLoadChecker.h:
562         * NetworkProcess/NetworkLoadClient.h:
563         * NetworkProcess/NetworkLoadParameters.h:
564         * NetworkProcess/NetworkProcess.cpp:
565         * NetworkProcess/NetworkProcess.h:
566         * NetworkProcess/NetworkProcessCreationParameters.h:
567         * NetworkProcess/NetworkResourceLoadParameters.cpp:
568         (WebKit::NetworkResourceLoadParameters::encode const):
569         (WebKit::NetworkResourceLoadParameters::decode):
570         * NetworkProcess/NetworkResourceLoadParameters.h:
571         * NetworkProcess/NetworkResourceLoader.cpp:
572         (WebKit::NetworkResourceLoader::didReceiveBuffer):
573         * NetworkProcess/NetworkResourceLoader.h:
574         * NetworkProcess/NetworkSession.cpp:
575         * NetworkProcess/NetworkSession.h:
576         * NetworkProcess/NetworkSocketStream.cpp:
577         * NetworkProcess/NetworkSocketStream.h:
578         * NetworkProcess/PingLoad.cpp:
579         (WebKit::PingLoad::PingLoad):
580         * NetworkProcess/PingLoad.h:
581         * NetworkProcess/PreconnectTask.cpp:
582         (WebKit::PreconnectTask::PreconnectTask):
583         (WebKit::PreconnectTask::frameID const): Deleted.
584         (WebKit::PreconnectTask::pageID const): Deleted.
585         * NetworkProcess/PreconnectTask.h:
586
587 2018-12-07  Eric Carlson  <eric.carlson@apple.com>
588
589         [MediaStream] 'devicechange' event should not fire in frames that can't access capture devices
590         https://bugs.webkit.org/show_bug.cgi?id=192511
591         <rdar://problem/46562063>
592
593         Reviewed by Youenn Fablet.
594
595         * UIProcess/UserMediaPermissionCheckProxy.cpp:
596         (WebKit::UserMediaPermissionCheckProxy::UserMediaPermissionCheckProxy): Remove userMediaID parameter.
597         (WebKit::UserMediaPermissionCheckProxy::setUserMediaAccessInfo): ID not passed to callback.
598         * UIProcess/UserMediaPermissionCheckProxy.h:
599         (WebKit::UserMediaPermissionCheckProxy::create):
600         (WebKit::UserMediaPermissionCheckProxy::completionHandler): Deleted.
601
602         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
603         (WebKit::generateRequestID): New.
604         (WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged): Don't notify if
605         the page does not have a granted request and does not have persistent access.
606         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Use generateRequestID.
607         (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo): Change variable name.
608         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Use generateRequestID.
609         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
610
611 2018-12-07  Saam Barati  <sbarati@apple.com>
612
613         WKWebProcessPlugInLoadDelegate should have API for saying which rendering events it wants to listen for
614         https://bugs.webkit.org/show_bug.cgi?id=192473
615
616         Reviewed by Andy Estes.
617
618         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h:
619         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
620         (PageLoaderClient::layoutMilestones const):
621
622 2018-12-07  Youenn Fablet  <youenn@apple.com>
623
624         Update libwebrtc up to 0d007d7c4f
625         https://bugs.webkit.org/show_bug.cgi?id=192316
626
627         Reviewed by Eric Carlson.
628
629         Update code base according new libwebrtc backend
630         In particular, use directly int64_t for packet time.
631
632         * Configurations/WebKit.xcconfig:
633         * NetworkProcess/webrtc/LibWebRTCSocketClient.cpp:
634         (WebKit::LibWebRTCSocketClient::signalReadPacket):
635         * NetworkProcess/webrtc/LibWebRTCSocketClient.h:
636         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
637         * NetworkProcess/webrtc/NetworkRTCSocket.h:
638         * WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
639         (WebKit::LibWebRTCSocket::signalReadPacket):
640
641 2018-12-07  Truitt Savell  <tsavell@apple.com>
642
643         Unreviewed, rolling out r238947.
644
645         Revision caused fast/visual-viewport/tiled-drawing/zoomed-
646         fixed-scrolling-layers-state.html to constantly fail
647
648         Reverted changeset:
649
650         "Allow control over child order when adding nodes to the
651         scrolling tree"
652         https://bugs.webkit.org/show_bug.cgi?id=176914
653         https://trac.webkit.org/changeset/238947
654
655 2018-12-06  David Kilzer  <ddkilzer@apple.com>
656
657         Injected bundle for WebKitTestRunner leaks WKTypeRef objects
658         <https://webkit.org/b/192481>
659         <rdar://problem/46539059>
660
661         Reviewed by Simon Fraser.
662
663         Change function parameter name from `returnData[Ref]` to
664         `returnRetainedData[Ref]` to document that the value returned is
665         a +1 retained WKTypeRef object.
666
667         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
668         (WKBundlePostSynchronousMessage):
669         * WebProcess/InjectedBundle/API/c/WKBundle.h:
670         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
671         (WKBundlePagePostSynchronousMessageForTesting):
672         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
673
674 2018-12-06  Frederic Wang  <fwang@igalia.com>
675
676         Allow control over child order when adding nodes to the scrolling tree
677         https://bugs.webkit.org/show_bug.cgi?id=176914
678
679         Reviewed by Simon Fraser.
680
681         Based on an earlier patch by Simon Fraser.
682
683         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
684         (WebKit::RemoteScrollingCoordinatorTransaction::decode): Make explicit that we want to append
685         the new node at the end of child list.
686
687 2018-12-06  Yongjun Zhang  <yongjun_zhang@apple.com>
688
689         We should ignore minimumEffectiveDeviceWidth if the page specifies device-width in viewport meta-tag.
690         https://bugs.webkit.org/show_bug.cgi?id=192377
691         <rdar://problem/46364206>
692
693         Reviewed by Tim Horton.
694
695         Since we are using page's viewport arguments to decide the default viewport parameters and
696         whether we can use mininum effective device width, we should always call setViewportArguments()
697         regardless of shouldIgnoreMetaViewport settings.
698
699         * WebProcess/WebPage/WebPage.cpp:
700         (WebKit::WebPage::viewportPropertiesDidChange): Always call setViewportArguments().
701         (WebKit::WebPage::didCommitLoad): Ditto.
702
703 2018-12-06  Tim Horton  <timothy_horton@apple.com>
704
705         Web Share API: share overlay does not stick to the Safari window
706         https://bugs.webkit.org/show_bug.cgi?id=192469
707         <rdar://problem/46074833>
708
709         Reviewed by Wenson Hsieh.
710
711         * UIProcess/Cocoa/WKShareSheet.mm:
712         (-[WKShareSheet sharingServicePicker:didChooseSharingService:]):
713         (-[WKShareSheet sharingServicePicker:delegateForSharingService:]):
714         (-[WKShareSheet sharingService:sourceWindowForShareItems:sharingContentScope:]):
715         (-[WKShareSheet sharingService:didFailToShareItems:error:]):
716         (-[WKShareSheet sharingService:didShareItems:]):
717         Implement another NSSharingServicePickerDelegate method to return
718         an *NSSharingService* delegate when needed.
719
720         Implement an NSSharingServiceDelegate method to return the window that
721         the service's UI should attach to.
722
723         Also, instead of notifying the Web Content process when a service is picked
724         (or not) in the NSSharingServicePicker, wait until the share has completed
725         (or failed) to send didComplete. This both makes the return completion
726         value more accurate (matching iOS, if you cancel the share during the
727         recipient choice step, it will now fail), and avoids explicitly tearing
728         down the NSSharingServicePicker too early, which breaks the UI attaching mechanism.
729
730 2018-12-06  Wenson Hsieh  <wenson_hsieh@apple.com>
731
732         [iOS] WKWebView should match UITextView behavior when editing text with an RTL keyboard
733         https://bugs.webkit.org/show_bug.cgi?id=187554
734         <rdar://problem/42075638>
735
736         Reviewed by Tim Horton.
737
738         Add support for automatically switching the base writing direction to the default writing direction with respect
739         to the current keyboard in an editable WKWebView by implementing `-setBaseWritingDirection:forRange:`. On iOS 12
740         and earlier, UIKit invokes this protocol method whenever the keyboard is changed to one with a different writing
741         direction, although in some other versions of iOS, this only happens when first focusing an editable area.
742
743         Test: editing/input/ios/rtl-keyboard-input-on-focus.html
744
745         * Platform/spi/ios/UIKitSPI.h:
746
747         Declare UIKeyboardImpl IPI methods mostly for use in WebKitTestRunner (with the exception of
748         `-setInitialDirection`, which we may invoke when we receive the first post-layout EditorState update after
749         focusing an editable element).
750
751         * UIProcess/PageClient.h:
752         * UIProcess/WebPageProxy.cpp:
753         (WebKit::WebPageProxy::increaseListLevel):
754         (WebKit::WebPageProxy::decreaseListLevel):
755         (WebKit::WebPageProxy::changeListType):
756         (WebKit::WebPageProxy::setBaseWritingDirection):
757
758         Drive-by style fixes: make these bail and return early if `!isValid()`.
759
760         (WebKit::WebPageProxy::resetStateAfterProcessExited):
761
762         Reset assisted node state in the UI process upon web process termination.
763
764         * UIProcess/WebPageProxy.h:
765
766         Add plumbing for `setBaseWritingDirection`, from `WebPageProxy` to `WebPage` to `Editor`.
767
768         * UIProcess/ios/PageClientImplIOS.h:
769         * UIProcess/ios/PageClientImplIOS.mm:
770         (WebKit::PageClientImpl::didReceiveEditorStateUpdateAfterFocus):
771         * UIProcess/ios/WKContentViewInteraction.h:
772         * UIProcess/ios/WKContentViewInteraction.mm:
773         (-[WKContentView baseWritingDirectionForPosition:inDirection:]):
774         (coreWritingDirection):
775         (-[WKContentView setBaseWritingDirection:forRange:]):
776
777         Support `-setBaseWritingDirectionForPosition:forRange:`, but only in the case where the given range is the
778         selected range. This is all that's currently needed to fulfill the requirements in <rdar://problem/42075638>,
779         though we could potentially add full support for this in the future by mapping the given text range to a DOM
780         range and moving the selection prior to setting the base writing direction.
781
782         (-[WKContentView _didReceiveEditorStateUpdateAfterFocus]):
783
784         Add a hook to notify WKContentView when the first post-layout EditorState has been received in the UI process.
785         When this is invoked, if the web view is editable and the selection is not a range, we call into `UIKeyboardImpl`
786         to change the initial writing direction if necessary.
787
788         * UIProcess/ios/WebPageProxyIOS.mm:
789         (WebKit::WebPageProxy::startAssistingNode):
790         (WebKit::WebPageProxy::stopAssistingNode):
791         (WebKit::WebPageProxy::editorStateChanged):
792         * WebProcess/WebPage/WebPage.cpp:
793         (WebKit::WebPage::setBaseWritingDirection):
794         * WebProcess/WebPage/WebPage.h:
795         * WebProcess/WebPage/WebPage.messages.in:
796
797 2018-12-06  David Quesada  <david_quesada@apple.com>
798
799         -[WKProcessPool _resumeDownloadFromData:path:] should allow specifying the originating web view
800         https://bugs.webkit.org/show_bug.cgi?id=192411
801         rdar://problem/46492487
802
803         Reviewed by Alex Christensen.
804
805         * UIProcess/API/C/WKContext.cpp:
806         (WKContextResumeDownload):
807         * UIProcess/API/Cocoa/WKProcessPool.mm:
808         (-[WKProcessPool _resumeDownloadFromData:path:originatingWebView:]):
809         (-[WKProcessPool _resumeDownloadFromData:path:]): Deleted.
810         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
811         * UIProcess/WebProcessPool.cpp:
812         (WebKit::WebProcessPool::resumeDownload):
813          - Set the originating page of the DownloadProxy.
814          - If the originating page is non-null, use its session ID for the download.
815          - Remove a FIXME. It's possible to do this now by providing the web view whose session
816            should be used for the download.
817         * UIProcess/WebProcessPool.h:
818
819 2018-12-06  Jiewen Tan  <jiewen_tan@apple.com>
820
821         Unreviewed, a quick fix after r238919
822
823         Add an early return such that the error message is actually meaningful.
824
825         * UIProcess/WebAuthentication/Mock/MockHidService.cpp:
826         (WebKit::MockHidService::platformStartDiscovery):
827
828 2018-12-06  Alex Christensen  <achristensen@webkit.org>
829
830         Remove unused LoaderStrategy::storeDerivedDataToCache and associated dead code
831         https://bugs.webkit.org/show_bug.cgi?id=192452
832
833         Reviewed by Anders Carlsson.
834
835         This was introduced in r210835 but never used.
836         It's preventing me from making the disk cache associated with a SessionID/NetworkSession.
837
838         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
839         (WebKit::NetworkConnectionToWebProcess::storeDerivedDataToCache): Deleted.
840         * NetworkProcess/NetworkConnectionToWebProcess.h:
841         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
842         * NetworkProcess/NetworkResourceLoadParameters.cpp:
843         (WebKit::NetworkResourceLoadParameters::encode const):
844         (WebKit::NetworkResourceLoadParameters::decode):
845         * NetworkProcess/NetworkResourceLoadParameters.h:
846         * NetworkProcess/NetworkResourceLoader.cpp:
847         (WebKit::NetworkResourceLoader::continueDidReceiveResponse):
848         (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
849         (WebKit::NetworkResourceLoader::continueProcessingCachedEntryAfterDidReceiveResponse): Deleted.
850         * NetworkProcess/NetworkResourceLoader.h:
851         * WebProcess/Network/WebLoaderStrategy.cpp:
852         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
853         (WebKit::WebLoaderStrategy::storeDerivedDataToCache): Deleted.
854         * WebProcess/Network/WebLoaderStrategy.h:
855         * WebProcess/Network/WebResourceLoader.cpp:
856         (WebKit::WebResourceLoader::didRetrieveDerivedData): Deleted.
857         * WebProcess/Network/WebResourceLoader.messages.in:
858
859 2018-12-06  Carlos Eduardo Ramalho  <cadubentzen@gmail.com>
860
861         REGRESSION(r231043): [GTK] Undefined references to WebCore::LayerRepresentation::* with -DENABLE_OPENGL=OFF builds
862         https://bugs.webkit.org/show_bug.cgi?id=191997
863
864         Reviewed by Philippe Normand.
865
866         Fix build with -DENABLE_OPENGL=OFF and -DENABLE_VIDEO=OFF.
867
868         * Shared/WebEventConversion.cpp:
869         (WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent): add required #if ENABLE(ASYNC_SCROLLING)
870
871 2018-12-05  Ryosuke Niwa  <rniwa@webkit.org>
872
873         REGRESSION(PSON): Process swapping code doesn't set DisplayID in WebContent process
874         https://bugs.webkit.org/show_bug.cgi?id=192290
875
876         Reviewed by Simon Fraser.
877
878         Fixed the bug by updating the DisplayID upon attaching to a WebContent process
879         after a process swap as well as after the previous WebContent process had crashed.
880
881         Unfortunately no new tests since WebKitTestRunner / DumpRenderTree should use 0 as DisplayID
882         as they have an off-screen NSWindow. The issue that this results in no fallback for
883         the animation timer is tracked by webkit.org/b/192448.
884
885         * UIProcess/Cocoa/WebViewImpl.mm:
886         (WebKit::WebViewImpl::didRelaunchProcess):
887
888 2018-12-05  Youenn Fablet  <youenn@apple.com>
889
890         Remove a document entry from NetworkMDNSRegister::m_services when document goes away
891         https://bugs.webkit.org/show_bug.cgi?id=192429
892
893         Reviewed by Eric Carlson.
894
895         * NetworkProcess/webrtc/NetworkMDNSRegister.cpp:
896         (WebKit::NetworkMDNSRegister::unregisterMDNSNames):
897         We should remove the entry to limit the size of the map.
898
899 2018-12-05  Jiewen Tan  <jiewen_tan@apple.com>
900
901         [Mac] Layout Test http/wpt/webauthn/public-key-credential-create-success-hid.https.html and http/wpt/webauthn/public-key-credential-get-success-hid.https.html are flaky
902         https://bugs.webkit.org/show_bug.cgi?id=192061
903
904         Reviewed by Dewei Zhu.
905
906         Part 1.
907
908         Add some loggings to determine possible causes for the flakiness.
909
910         * UIProcess/WebAuthentication/Cocoa/HidService.mm:
911         (WebKit::HidService::continueAddDeviceAfterGetInfo):
912         * UIProcess/WebAuthentication/Mock/MockHidService.cpp:
913         (WebKit::MockHidService::platformStartDiscovery):
914
915 2018-12-05  Chris Dumez  <cdumez@apple.com>
916
917         Simplify logic inside WebPageProxy::continueNavigationInNewProcess()
918         https://bugs.webkit.org/show_bug.cgi?id=192404
919
920         Reviewed by Alex Christensen.
921
922         Simplify get the item state from the current back/forward list item, instead of
923         relying on WebBackForwardList::filteredItemStates().
924
925         * UIProcess/WebPageProxy.cpp:
926         (WebKit::WebPageProxy::continueNavigationInNewProcess):
927
928 2018-12-05  Youenn Fablet  <youenn@apple.com>
929
930         Enable the possibility to do video capture in UIProcess
931         https://bugs.webkit.org/show_bug.cgi?id=192394
932
933         Reviewed by Eric Carlson.
934
935         Add two web preferences to toggle audio/video capture in UIProcess or WebProcess.
936         Add mechanism for video capture that was not implemented yet.
937
938         * Shared/WebPreferences.yaml:
939         * Shared/WebPreferencesDefaultValues.h:
940         * Shared/WebProcessCreationParameters.cpp:
941         (WebKit::WebProcessCreationParameters::encode const):
942         (WebKit::WebProcessCreationParameters::decode):
943         * Shared/WebProcessCreationParameters.h:
944         * UIProcess/API/APIProcessPoolConfiguration.h:
945         * UIProcess/API/C/WKPreferences.cpp:
946         (WKPreferencesSetCaptureAudioInUIProcessEnabled):
947         (WKPreferencesGetCaptureAudioInUIProcessEnabled):
948         (WKPreferencesSetCaptureVideoInUIProcessEnabled):
949         (WKPreferencesGetCaptureVideoInUIProcessEnabled):
950         * UIProcess/API/C/WKPreferencesRef.h:
951         * UIProcess/WebPreferences.cpp:
952         (WebKit::WebPreferences::updateBoolValueForInternalDebugFeatureKey):
953         * UIProcess/WebProcessPool.cpp:
954         (WebKit::WebProcessPool::initializeNewWebProcess):
955         (WebKit::WebProcessPool::createWebPage):
956         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
957         (WebKit::UserMediaCaptureManager::initialize):
958
959 2018-12-05  Alex Christensen  <achristensen@webkit.org>
960
961         Make WebsiteDataStoreConfiguration a proper API object
962         https://bugs.webkit.org/show_bug.cgi?id=192380
963
964         Reviewed by Youenn Fablet.
965
966         In the immediate future I'll need to add things to _WKWebsiteDataStoreConfiguration.
967         Instead of making ivars, setting them, copying them to a local object, make this a wrapper of an API::Object
968         like all our other ObjC API objects are.
969
970         * Shared/API/APIObject.h:
971         (API::Object::wrapper const):
972         (API::Object::wrapper): Deleted.
973         * Shared/Cocoa/APIObject.mm:
974         (API::Object::ref const):
975         (API::Object::deref const):
976         (API::Object::newObject):
977         (API::Object::ref): Deleted.
978         (API::Object::deref): Deleted.
979         * Sources.txt:
980         * UIProcess/API/APIProcessPoolConfiguration.cpp:
981         (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
982         * UIProcess/API/APIProcessPoolConfiguration.h:
983         * UIProcess/API/APIWebsiteDataStore.cpp:
984         (API::WebsiteDataStore::createLegacy):
985         (API::WebsiteDataStore::WebsiteDataStore):
986         (API::WebsiteDataStore::legacyDefaultDataStoreConfiguration):
987         * UIProcess/API/APIWebsiteDataStore.h:
988         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
989         (API::WebsiteDataStore::defaultDataStoreConfiguration):
990         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
991         (-[WKWebsiteDataStore _initWithConfiguration:]):
992         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
993         (-[_WKWebsiteDataStoreConfiguration _webStorageDirectory]):
994         (-[_WKWebsiteDataStoreConfiguration _setWebStorageDirectory:]):
995         (-[_WKWebsiteDataStoreConfiguration _indexedDBDatabaseDirectory]):
996         (-[_WKWebsiteDataStoreConfiguration _setIndexedDBDatabaseDirectory:]):
997         (-[_WKWebsiteDataStoreConfiguration _webSQLDatabaseDirectory]):
998         (-[_WKWebsiteDataStoreConfiguration _setWebSQLDatabaseDirectory:]):
999         (-[_WKWebsiteDataStoreConfiguration _cookieStorageFile]):
1000         (-[_WKWebsiteDataStoreConfiguration _setCookieStorageFile:]):
1001         (-[_WKWebsiteDataStoreConfiguration _resourceLoadStatisticsDirectory]):
1002         (-[_WKWebsiteDataStoreConfiguration _setResourceLoadStatisticsDirectory:]):
1003         (-[_WKWebsiteDataStoreConfiguration _cacheStorageDirectory]):
1004         (-[_WKWebsiteDataStoreConfiguration _setCacheStorageDirectory:]):
1005         (-[_WKWebsiteDataStoreConfiguration _serviceWorkerRegistrationDirectory]):
1006         (-[_WKWebsiteDataStoreConfiguration _setServiceWorkerRegistrationDirectory:]):
1007         (-[_WKWebsiteDataStoreConfiguration setSourceApplicationBundleIdentifier:]):
1008         (-[_WKWebsiteDataStoreConfiguration sourceApplicationBundleIdentifier]):
1009         (-[_WKWebsiteDataStoreConfiguration sourceApplicationSecondaryIdentifier]):
1010         (-[_WKWebsiteDataStoreConfiguration setSourceApplicationSecondaryIdentifier:]):
1011         (-[_WKWebsiteDataStoreConfiguration _apiObject]):
1012         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfigurationInternal.h: Added.
1013         * UIProcess/Network/NetworkProcessProxy.cpp:
1014         (WebKit::NetworkProcessProxy::retrieveCacheStorageParameters):
1015         * UIProcess/WebProcessPool.cpp:
1016         (WebKit::legacyWebsiteDataStoreConfiguration):
1017         (WebKit::WebProcessPool::mayHaveRegisteredServiceWorkers):
1018         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
1019         (WebKit::WebsiteDataStore::parameters):
1020         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1021         (WebKit::WebsiteDataStore::create):
1022         (WebKit::WebsiteDataStore::WebsiteDataStore):
1023         (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
1024         (WebKit::WebsiteDataStore::fetchDataAndApply):
1025         (WebKit::WebsiteDataStore::removeData):
1026         (WebKit::WebsiteDataStore::parameters):
1027         (WebKit::WebsiteDataStore::Configuration::Configuration): Deleted.
1028         * UIProcess/WebsiteData/WebsiteDataStore.h:
1029         (WebKit::WebsiteDataStore::cacheStoragePerOriginQuota const):
1030         (WebKit::WebsiteDataStore::setCacheStoragePerOriginQuota):
1031         (WebKit::WebsiteDataStore::cacheStorageDirectory const):
1032         (WebKit::WebsiteDataStore::setCacheStorageDirectory):
1033         (WebKit::WebsiteDataStore::serviceWorkerRegistrationDirectory const):
1034         (WebKit::WebsiteDataStore::setServiceWorkerRegistrationDirectory):
1035         (WebKit::WebsiteDataStore::resolvedApplicationCacheDirectory const):
1036         (WebKit::WebsiteDataStore::resolvedMediaCacheDirectory const):
1037         (WebKit::WebsiteDataStore::resolvedMediaKeysDirectory const):
1038         (WebKit::WebsiteDataStore::resolvedDatabaseDirectory const):
1039         (WebKit::WebsiteDataStore::resolvedJavaScriptConfigurationDirectory const):
1040         (WebKit::WebsiteDataStore::resolvedCookieStorageFile const):
1041         (WebKit::WebsiteDataStore::resolvedIndexedDatabaseDirectory const):
1042         (WebKit::WebsiteDataStore::resolvedServiceWorkerRegistrationDirectory const):
1043         (WebKit::WebsiteDataStore::resolvedResourceLoadStatisticsDirectory const):
1044         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp: Added.
1045         (WebKit::WebsiteDataStoreConfiguration::WebsiteDataStoreConfiguration):
1046         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h: Added.
1047         (WebKit::WebsiteDataStoreConfiguration::create):
1048         (WebKit::WebsiteDataStoreConfiguration::cacheStoragePerOriginQuota):
1049         (WebKit::WebsiteDataStoreConfiguration::setCacheStoragePerOriginQuota):
1050         (WebKit::WebsiteDataStoreConfiguration::applicationCacheDirectory const):
1051         (WebKit::WebsiteDataStoreConfiguration::setApplicationCacheDirectory):
1052         (WebKit::WebsiteDataStoreConfiguration::mediaCacheDirectory const):
1053         (WebKit::WebsiteDataStoreConfiguration::setMediaCacheDirectory):
1054         (WebKit::WebsiteDataStoreConfiguration::mediaKeysStorageDirectory const):
1055         (WebKit::WebsiteDataStoreConfiguration::setMediaKeysStorageDirectory):
1056         (WebKit::WebsiteDataStoreConfiguration::javaScriptConfigurationDirectory const):
1057         (WebKit::WebsiteDataStoreConfiguration::setJavaScriptConfigurationDirectory):
1058         (WebKit::WebsiteDataStoreConfiguration::webStorageDirectory const):
1059         (WebKit::WebsiteDataStoreConfiguration::setWebStorageDirectory):
1060         (WebKit::WebsiteDataStoreConfiguration::indexedDBDatabaseDirectory const):
1061         (WebKit::WebsiteDataStoreConfiguration::setIndexedDBDatabaseDirectory):
1062         (WebKit::WebsiteDataStoreConfiguration::webSQLDatabaseDirectory const):
1063         (WebKit::WebsiteDataStoreConfiguration::setWebSQLDatabaseDirectory):
1064         (WebKit::WebsiteDataStoreConfiguration::localStorageDirectory const):
1065         (WebKit::WebsiteDataStoreConfiguration::setLocalStorageDirectory):
1066         (WebKit::WebsiteDataStoreConfiguration::cookieStorageFile const):
1067         (WebKit::WebsiteDataStoreConfiguration::setCookieStorageFile):
1068         (WebKit::WebsiteDataStoreConfiguration::resourceLoadStatisticsDirectory const):
1069         (WebKit::WebsiteDataStoreConfiguration::setResourceLoadStatisticsDirectory):
1070         (WebKit::WebsiteDataStoreConfiguration::networkCacheDirectory const):
1071         (WebKit::WebsiteDataStoreConfiguration::setNetworkCacheDirectory):
1072         (WebKit::WebsiteDataStoreConfiguration::cacheStorageDirectory const):
1073         (WebKit::WebsiteDataStoreConfiguration::setCacheStorageDirectory):
1074         (WebKit::WebsiteDataStoreConfiguration::applicationCacheFlatFileSubdirectoryName const):
1075         (WebKit::WebsiteDataStoreConfiguration::setApplicationCacheFlatFileSubdirectoryName):
1076         (WebKit::WebsiteDataStoreConfiguration::serviceWorkerRegistrationDirectory const):
1077         (WebKit::WebsiteDataStoreConfiguration::setServiceWorkerRegistrationDirectory):
1078         (WebKit::WebsiteDataStoreConfiguration::sourceApplicationBundleIdentifier const):
1079         (WebKit::WebsiteDataStoreConfiguration::setSourceApplicationBundleIdentifier):
1080         (WebKit::WebsiteDataStoreConfiguration::sourceApplicationSecondaryIdentifier const):
1081         (WebKit::WebsiteDataStoreConfiguration::setSourceApplicationSecondaryIdentifier):
1082         * WebKit.xcodeproj/project.pbxproj:
1083
1084 2018-12-05  Wenson Hsieh  <wenson_hsieh@apple.com>
1085
1086         Turn WritingDirection into an enum class
1087         https://bugs.webkit.org/show_bug.cgi?id=192401
1088         Work towards <rdar://problem/42075638>
1089
1090         Reviewed by Dan Bernstein.
1091
1092         Change WritingDirection from an enum to an enum class. No change in behavior.
1093
1094         * WebProcess/WebPage/WebFrame.cpp:
1095         (WebKit::WebFrame::setTextDirection):
1096
1097 2018-12-05  Rob Buis  <rbuis@igalia.com>
1098
1099         [Mac] HEAD requests changed to GET after 301, 302, and 303 redirections (http/tests/xmlhttprequest/head-redirection.html)
1100         https://bugs.webkit.org/show_bug.cgi?id=114965
1101
1102         Reviewed by Frédéric Wang.
1103
1104         HEAD requests should not be changed to GET after 303 redirects, see [1].
1105         This was fixed earlier for GTK [2].
1106
1107         Behavior matches Firefox and Chrome.
1108
1109         [1] http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-21#section-7.4
1110         [2] https://bugs.webkit.org/show_bug.cgi?id=110127
1111
1112         Tests: web-platform-tests/fetch/api/redirect/redirect-method.html
1113                web-platform-tests/fetch/api/redirect/redirect-method-worker.html
1114                http/tests/xmlhttprequest/head-redirection.html
1115
1116         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1117         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
1118
1119 2018-12-04  Fujii Hironori  <Hironori.Fujii@sony.com>
1120
1121         Remove using namespace WebCore and WebKit under WebKit/Shared/API
1122         https://bugs.webkit.org/show_bug.cgi?id=192352
1123
1124         Reviewed by Alex Christensen.
1125
1126         Removed using namespace statements, and use namespace prefix
1127         instead.
1128
1129         * Shared/API/APIURLRequest.cpp:
1130         * Shared/API/APIURLResponse.cpp:
1131         * Shared/API/c/WKArray.cpp:
1132         * Shared/API/c/WKCertificateInfo.cpp:
1133         * Shared/API/c/WKConnectionRef.cpp:
1134         * Shared/API/c/WKContextMenuItem.cpp:
1135         * Shared/API/c/WKData.cpp:
1136         * Shared/API/c/WKDictionary.cpp:
1137         * Shared/API/c/WKErrorRef.cpp:
1138         * Shared/API/c/WKGeometry.cpp:
1139         * Shared/API/c/WKImage.cpp:
1140         * Shared/API/c/WKMutableArray.cpp:
1141         * Shared/API/c/WKMutableDictionary.cpp:
1142         * Shared/API/c/WKNumber.cpp:
1143         * Shared/API/c/WKPluginInformation.cpp:
1144         * Shared/API/c/WKRenderLayer.cpp:
1145         * Shared/API/c/WKRenderObject.cpp:
1146         * Shared/API/c/WKSecurityOriginRef.cpp:
1147         * Shared/API/c/WKSerializedScriptValue.cpp:
1148         * Shared/API/c/WKString.cpp:
1149         * Shared/API/c/WKType.cpp:
1150         * Shared/API/c/WKURL.cpp:
1151         * Shared/API/c/WKURLRequest.cpp:
1152         * Shared/API/c/WKURLResponse.cpp:
1153         * Shared/API/c/WKUserContentURLPattern.cpp:
1154         * Shared/API/c/cairo/WKImageCairo.cpp:
1155         * Shared/API/c/curl/WKCertificateInfoCurl.cpp:
1156
1157 2018-12-04  Alex Christensen  <achristensen@webkit.org>
1158
1159         Remove source application identifiers from NetworkProcessCreationParameters
1160         https://bugs.webkit.org/show_bug.cgi?id=192372
1161
1162         Reviewed by Brady Eidson.
1163
1164         The _WKWebProcessPoolConfiguration way of setting these was deprecated in http://trac.webkit.org/r235127
1165         The replacement was adopted in <rdar://problem/46359330>
1166         The transition process is done!  Time to remove the old code.
1167
1168         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1169         (WebKit::NetworkProcessCreationParameters::encode const):
1170         (WebKit::NetworkProcessCreationParameters::decode):
1171         * NetworkProcess/NetworkProcessCreationParameters.h:
1172         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1173         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
1174         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
1175         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1176         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
1177         (WebKit::globalSourceApplicationAuditTokenData): Deleted.
1178         (WebKit::globalSourceApplicationBundleIdentifier): Deleted.
1179         (WebKit::globalSourceApplicationSecondaryIdentifier): Deleted.
1180         (WebKit::NetworkSessionCocoa::setSourceApplicationAuditTokenData): Deleted.
1181         (WebKit::NetworkSessionCocoa::setSourceApplicationBundleIdentifier): Deleted.
1182         (WebKit::NetworkSessionCocoa::setSourceApplicationSecondaryIdentifier): Deleted.
1183         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1184         (API::ProcessPoolConfiguration::copy):
1185         * UIProcess/API/APIProcessPoolConfiguration.h:
1186         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
1187         (-[_WKProcessPoolConfiguration sourceApplicationBundleIdentifier]):
1188         (-[_WKProcessPoolConfiguration setSourceApplicationBundleIdentifier:]):
1189         (-[_WKProcessPoolConfiguration sourceApplicationSecondaryIdentifier]):
1190         (-[_WKProcessPoolConfiguration setSourceApplicationSecondaryIdentifier:]):
1191         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1192         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard):
1193         (WebKit::toPKPaymentRequest):
1194         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1195         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
1196         * UIProcess/WebsiteData/WebsiteDataStore.h:
1197         (WebKit::WebsiteDataStore::configuration):
1198
1199 2018-12-04  Youenn Fablet  <youenn@apple.com>
1200
1201         Calling getUserMedia in a link that was opened with target="_blank" does not work the second time
1202         https://bugs.webkit.org/show_bug.cgi?id=188088
1203         <rdar://problem/42681448>
1204
1205         Reviewed by Eric Carlson.
1206
1207         On closing a page, we need to make sure to consider that the capture is ended,
1208         as otherwise WebPageProxy will not get noticed from WebPage, since WebPageProxy is no longer an IPC receiver.
1209
1210         * UIProcess/UserMediaProcessManager.cpp:
1211         (WebKit::UserMediaProcessManager::endedCaptureSession):
1212         * UIProcess/WebPageProxy.cpp:
1213         (WebKit::WebPageProxy::close):
1214
1215 2018-12-04  Chris Dumez  <cdumez@apple.com>
1216
1217         Regression(r238817) PSON Page Cache API tests are failing
1218         https://bugs.webkit.org/show_bug.cgi?id=192348
1219
1220         Reviewed by Alex Christensen.
1221
1222         Before suspending a WebProcess on iOS, we normally fake a memory pressure signal
1223         so that the suspended process uses as little memory as possible while suspended.
1224         Among other things, this will clear the page cache. This is an issue in the case
1225         of process-swap on navigation because we keep suspended web processes around to
1226         keep Page Cache functional.
1227
1228         To address the issue, when a WebProcess is about to get suspended, we check if
1229         the process has any suspended WebPage (WebPage used for PSON PageCache support)
1230         and we bypass the PageCache clearing if it does.
1231
1232         Our API tests did not catch this before r238817 because the NavigationState's
1233         assertion was preventing the old WebProcesses from suspending for 3 seconds,
1234         which was enough for those tests to complete.
1235
1236         * UIProcess/SuspendedPageProxy.cpp:
1237         (WebKit::SuspendedPageProxy::SuspendedPageProxy):
1238         (WebKit::SuspendedPageProxy::didFinishLoad):
1239         * UIProcess/SuspendedPageProxy.h:
1240         Take a background assertion until the suspension load is complete, to make sure
1241         the suspension load has a chance to complete before the process gets suspended.
1242
1243         * WebProcess/WebProcess.cpp:
1244         (WebKit::WebProcess::initializeWebProcess):
1245         (WebKit::WebProcess::hasPageRequiringPageCacheWhileSuspended const):
1246         (WebKit::WebProcess::actualPrepareToSuspend):
1247         * WebProcess/WebProcess.h:
1248
1249 2018-12-04  Youenn Fablet  <youenn@apple.com>
1250
1251         Device orientation may be wrong on page reload after crash
1252         https://bugs.webkit.org/show_bug.cgi?id=192349
1253         <rdar://problem/46359466>
1254
1255         Reviewed by Eric Carlson.
1256
1257         On page crash, the process is relaunched and the page is reloaded.
1258         At that point, the orientation information of the page is not reset until the next device orientation change.
1259         To fix that, add the device orientation to the page creation parameters so that we pass it everytime we create a page.
1260         Covered by manual testing.
1261
1262         * Shared/WebPageCreationParameters.cpp:
1263         (WebKit::WebPageCreationParameters::encode const):
1264         (WebKit::WebPageCreationParameters::decode):
1265         * Shared/WebPageCreationParameters.h:
1266         * UIProcess/WebPageProxy.cpp:
1267         (WebKit::WebPageProxy::creationParameters):
1268         * WebProcess/WebPage/WebPage.cpp:
1269
1270 2018-12-04  Carlos Eduardo Ramalho  <cadubentzen@gmail.com>
1271
1272         [WPE] Add gtk-doc
1273         https://bugs.webkit.org/show_bug.cgi?id=178900
1274
1275         Reviewed by Michael Catanzaro.
1276
1277         Add gtk-doc to WPE port. This patch tries to reuse as much code from
1278         WebKitGTK+ as possible.
1279
1280         * PlatformWPE.cmake: Write variables to gtkdoc-wpe.cfg and gtkdoc-webextensions that is used by python script later.
1281         * UIProcess/API/wpe/WebKitWebContext.h: Placed sandbox functions in the same location as in the WebKitGTK+ for consistency.
1282         * UIProcess/API/wpe/docs/wpe-0.1-sections.txt: Added.
1283         * UIProcess/API/wpe/docs/wpe-docs.sgml: Added.
1284         * WebProcess/InjectedBundle/API/wpe/WebKitWebPage.h: Placed webkit_web_page_get_dom_document
1285         in the same position as in the WebKitGTK+ for consistency.
1286         * WebProcess/InjectedBundle/API/wpe/docs/wpe-webextensions-0.1-sections.txt: Added.
1287         * WebProcess/InjectedBundle/API/wpe/docs/wpe-webextensions-docs.sgml: Added.
1288
1289 2018-12-04  Carlos Garcia Campos  <cgarcia@igalia.com>
1290
1291         [SOUP] Move URLSoup back to WebCore after r238771
1292         https://bugs.webkit.org/show_bug.cgi?id=192306
1293
1294         Reviewed by Michael Catanzaro.
1295
1296         Include GUniquePtrSoup from WebCore again and fix several build failures that showed up after removing the soup
1297         includes from URL header.
1298
1299         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1300         (WebKit::NetworkDataTaskSoup::tlsConnectionAcceptCertificate):
1301         * PluginProcess/PluginProcess.cpp:
1302         * Shared/API/glib/WebKitURIRequest.cpp:
1303         * Shared/API/glib/WebKitURIResponse.cpp:
1304         * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
1305         * UIProcess/API/glib/WebKitURISchemeRequest.cpp:
1306         (webkit_uri_scheme_request_finish_error): Use soupURIToURL().
1307         * UIProcess/API/glib/WebKitWebView.cpp:
1308         (webkit_web_view_load_uri): Use soupURIToURL().
1309         * UIProcess/API/gtk/WebKitAuthenticationDialog.cpp:
1310         * UIProcess/Launcher/glib/BubblewrapLauncher.h:
1311         * UIProcess/Launcher/glib/FlatpakLauncher.cpp:
1312         * UIProcess/Launcher/glib/FlatpakLauncher.h:
1313
1314 2018-12-04  Tim Horton  <timothy_horton@apple.com>
1315
1316         Fix the watchOS build; stop unnecessarily linking CorePDF
1317         https://bugs.webkit.org/show_bug.cgi?id=192356
1318         <rdar://problem/46427844>
1319
1320         Reviewed by Wenson Hsieh.
1321
1322         * Configurations/WebKit.xcconfig:
1323         * Platform/spi/ios/CorePDFSPI.h:
1324
1325 2018-12-03  Tim Horton  <timothy_horton@apple.com>
1326
1327         Make it possible to disable animated keyboard scrolling behavior
1328         https://bugs.webkit.org/show_bug.cgi?id=192331
1329         <rdar://problem/45586859>
1330
1331         Reviewed by Simon Fraser.
1332
1333         * UIProcess/API/Cocoa/WKWebView.mm:
1334         * UIProcess/ios/WKKeyboardScrollingAnimator.mm:
1335         (-[WKKeyboardScrollingAnimator invalidate]):
1336         (-[WKKeyboardScrollingAnimator beginWithEvent:]):
1337         (-[WKKeyboardScrollingAnimator stopAnimatedScroll]):
1338         (-[WKKeyboardScrollingAnimator willStartInteractiveScroll]):
1339         (-[WKKeyboardScrollingAnimator startRepeatTimerIfNeeded]):
1340         (-[WKKeyboardScrollingAnimator stopRepeatTimer]):
1341         (-[WKKeyboardScrollingAnimator performDiscreteScroll]):
1342         (-[WKKeyboardScrollViewAnimator scrollToContentOffset:animated:]):
1343         (-[WKKeyboardScrollViewAnimator scrollWithScrollToExtentAnimationTo:]):
1344         * WebKit.xcodeproj/project.pbxproj:
1345
1346 2018-12-03  Fujii Hironori  <Hironori.Fujii@sony.com>
1347
1348         Remove "using namespace WebKit" under Source/WebKit/WebProcess/InjectedBundle/API
1349         https://bugs.webkit.org/show_bug.cgi?id=192301
1350
1351         Reviewed by Alex Christensen.
1352
1353         Removed "using namespace WebKit" statement, and use "WebKit::"
1354         namespace prefix instead.
1355
1356         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
1357         * WebProcess/InjectedBundle/API/c/WKBundleBackForwardList.cpp:
1358         * WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.cpp:
1359         * WebProcess/InjectedBundle/API/c/WKBundleDOMWindowExtension.cpp:
1360         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
1361         * WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp:
1362         * WebProcess/InjectedBundle/API/c/WKBundleInspector.cpp:
1363         * WebProcess/InjectedBundle/API/c/WKBundleNavigationAction.cpp:
1364         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
1365         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1366         * WebProcess/InjectedBundle/API/c/WKBundlePageBanner.cpp:
1367         * WebProcess/InjectedBundle/API/c/WKBundlePageGroup.cpp:
1368         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
1369         * WebProcess/InjectedBundle/API/c/WKBundleRangeHandle.cpp:
1370         * WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.cpp:
1371
1372 2018-12-03  Chris Dumez  <cdumez@apple.com>
1373
1374         Regression(PSON) Google OAuth is broken in private sessions
1375         https://bugs.webkit.org/show_bug.cgi?id=192337
1376         <rdar://problem/46353558>
1377
1378         Reviewed by Alex Christensen.
1379
1380         In WebPageProxy::swapToWebProcess(), we would call removeWebPage() on the old WebProcessProxy and then
1381         addExistingWebPage() on the new WebProcessProxy, as you would expect in case of process swap.
1382
1383         The issue is that WebProcessProxy::removeWebPage() calls WebProcessPool::pageEndUsingWebsiteDataStore()
1384         which would cause the session to get destroyed assuming this was the last page using it. We would
1385         therefore lose session cookies after a process-swap in private session.
1386
1387         To address the issue, a parameter to WebProcessPool::pageEndUsingWebsiteDataStore() and
1388         WebProcessPool::pageBeginUsingWebsiteDataStore() to control if we want to tell the WebProcessPool
1389         about the page beginning / ending its use of the session. In the case of a process-swap, we make
1390         sure the process pool is not notified.
1391
1392         * UIProcess/WebPageProxy.cpp:
1393         (WebKit::WebPageProxy::reattachToWebProcess):
1394         (WebKit::WebPageProxy::swapToWebProcess):
1395         (WebKit::WebPageProxy::finishAttachingToWebProcess):
1396         (WebKit::WebPageProxy::close):
1397         * UIProcess/WebProcessProxy.cpp:
1398         (WebKit::WebProcessProxy::createWebPage):
1399         (WebKit::WebProcessProxy::addExistingWebPage):
1400         (WebKit::WebProcessProxy::removeWebPage):
1401         * UIProcess/WebProcessProxy.h:
1402
1403 2018-12-03  Chris Dumez  <cdumez@apple.com>
1404
1405         [PSON] Request by the client to process-swap is ignored if the window has an opener
1406         https://bugs.webkit.org/show_bug.cgi?id=192267
1407         <rdar://problem/46386886>
1408
1409         Reviewed by Brady Eidson.
1410
1411         If the client forces a process-swap, we should process-swap, even if the browsing
1412         context has an opener (or openees). Previously, we would only bypass the cross-site
1413         check, not the openee / openees checks.
1414
1415         The issue when doing so is that the openee still has a opener link to the window
1416         in the old process. They would see that the window is still there and navigated
1417         to 'about:blank' due to our page suspension logic. To address the issue, we no
1418         longer suspend the old WebPage if the process swap was forced by the client and
1419         we make sure that the old WebPage gets closed.
1420
1421         * UIProcess/WebPageProxy.cpp:
1422         (WebKit::WebPageProxy::suspendCurrentPageIfPossible):
1423         (WebKit::WebPageProxy::swapToWebProcess):
1424         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
1425         (WebKit::WebPageProxy::continueNavigationInNewProcess):
1426         * UIProcess/WebPageProxy.h:
1427         * UIProcess/WebProcessPool.cpp:
1428         (WebKit::WebProcessPool::processForNavigationInternal):
1429
1430 2018-12-03  Keith Rollin  <krollin@apple.com>
1431
1432         Add .xcfilelist files
1433         https://bugs.webkit.org/show_bug.cgi?id=192082
1434         <rdar://problem/46312533>
1435
1436         Reviewed by Brent Fulgham.
1437
1438         Add .xcfilelist files for Generate Derived Sources and Generate
1439         Unified Sources build phases in Xcode. These are just being staged for
1440         now; they'll be added to the Xcode projects later.
1441
1442         * DerivedSources-input.xcfilelist: Added.
1443         * DerivedSources-output.xcfilelist: Added.
1444         * UnifiedSources-input.xcfilelist: Added.
1445         * UnifiedSources-output.xcfilelist: Added.
1446
1447 2018-12-03  Zalan Bujtas  <zalan@apple.com>
1448
1449         [iOS] Unreviewed build fix.
1450
1451         * Platform/Logging.h:
1452
1453 2018-12-03  Alex Christensen  <achristensen@webkit.org>
1454
1455         Remove unused NetworkProcessCreationParameters.diskCacheSizeOverride
1456         https://bugs.webkit.org/show_bug.cgi?id=192246
1457
1458         Reviewed by Chris Dumez.
1459
1460         The last use of this functionality was removed in rdar://problem/46344871
1461
1462         * NetworkProcess/NetworkProcess.cpp:
1463         (WebKit::NetworkProcess::initializeNetworkProcess):
1464         (WebKit::NetworkProcess::setCacheModel):
1465         * NetworkProcess/NetworkProcess.h:
1466         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1467         (WebKit::NetworkProcessCreationParameters::encode const):
1468         (WebKit::NetworkProcessCreationParameters::decode):
1469         * NetworkProcess/NetworkProcessCreationParameters.h:
1470         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1471         (API::ProcessPoolConfiguration::copy):
1472         * UIProcess/API/APIProcessPoolConfiguration.h:
1473         * UIProcess/API/C/WKContextConfigurationRef.cpp:
1474         (WKContextConfigurationDiskCacheSizeOverride):
1475         (WKContextConfigurationSetDiskCacheSizeOverride):
1476         * UIProcess/API/C/WKContextConfigurationRef.h:
1477         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
1478         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
1479         (-[_WKProcessPoolConfiguration diskCacheSizeOverride]):
1480         (-[_WKProcessPoolConfiguration setDiskCacheSizeOverride:]):
1481         * UIProcess/WebProcessPool.cpp:
1482         (WebKit::WebProcessPool::ensureNetworkProcess):
1483
1484 2018-12-03  Alex Christensen  <achristensen@webkit.org>
1485
1486         Add WKWebProcessPlugInLoadDelegate SPI willStartProvisionalLoadForFrame with a completion handler
1487         https://bugs.webkit.org/show_bug.cgi?id=192272
1488
1489         Reviewed by Brady Eidson.
1490
1491         * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h:
1492         (API::InjectedBundle::PageLoaderClient::didStartProvisionalLoadForFrame):
1493         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h:
1494         * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
1495         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
1496         (ResourceLoadClient::ResourceLoadClient):
1497         (ResourceLoadClient::loadDelegate const):
1498         (ResourceLoadClient::pluginContextController const):
1499         (PageLoaderClient::PageLoaderClient):
1500         (PageLoaderClient::loadDelegate const):
1501         (PageLoaderClient::pluginContextController const):
1502         (PageLoaderClient::didStartProvisionalLoadForFrame):
1503         (PageLoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame):
1504         (PageLoaderClient::didFinishLoadForFrame):
1505         (PageLoaderClient::globalObjectIsAvailableForFrame):
1506         (PageLoaderClient::didRemoveFrameFromHierarchy):
1507         (PageLoaderClient::didCommitLoadForFrame):
1508         (PageLoaderClient::didFinishDocumentLoadForFrame):
1509         (PageLoaderClient::didFailProvisionalLoadWithErrorForFrame):
1510         (PageLoaderClient::didFailLoadWithErrorForFrame):
1511         (PageLoaderClient::didSameDocumentNavigationForFrame):
1512         (PageLoaderClient::didLayoutForFrame):
1513         (PageLoaderClient::didReachLayoutMilestone):
1514         (PageLoaderClient::didFirstVisuallyNonEmptyLayoutForFrame):
1515         (PageLoaderClient::didHandleOnloadEventsForFrame):
1516         (PageLoaderClient::userAgentForURL const):
1517         (ResourceLoadClient::willSendRequestForFrame):
1518         (ResourceLoadClient::didInitiateLoadForResource):
1519         (ResourceLoadClient::didFinishLoadForResource):
1520         (ResourceLoadClient::didFailLoadForResource):
1521         (-[WKWebProcessPlugInBrowserContextController setLoadDelegate:]):
1522         (didStartProvisionalLoadForFrame): Deleted.
1523         (didReceiveServerRedirectForProvisionalLoadForFrame): Deleted.
1524         (didFinishLoadForFrame): Deleted.
1525         (globalObjectIsAvailableForFrame): Deleted.
1526         (didRemoveFrameFromHierarchy): Deleted.
1527         (didCommitLoadForFrame): Deleted.
1528         (didFinishDocumentLoadForFrame): Deleted.
1529         (didFailProvisionalLoadWithErrorForFrame): Deleted.
1530         (didFailLoadWithErrorForFrame): Deleted.
1531         (didSameDocumentNavigationForFrame): Deleted.
1532         (didLayoutForFrame): Deleted.
1533         (didReachLayoutMilestone): Deleted.
1534         (didFirstVisuallyNonEmptyLayoutForFrame): Deleted.
1535         (didHandleOnloadEventsForFrame): Deleted.
1536         (userAgentForURL): Deleted.
1537         (setUpPageLoaderClient): Deleted.
1538         (willSendRequestForFrame): Deleted.
1539         (didInitiateLoadForResource): Deleted.
1540         (didFinishLoadForResource): Deleted.
1541         (didFailLoadForResource): Deleted.
1542         (setUpResourceLoadClient): Deleted.
1543         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
1544         (WebKit::InjectedBundlePageLoaderClient::didStartProvisionalLoadForFrame):
1545         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
1546         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1547         (WebKit::WebFrameLoaderClient::dispatchDidStartProvisionalLoad):
1548         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1549
1550 2018-12-03  Tim Horton  <timothy_horton@apple.com>
1551
1552         Swipe snapshot stays up too long swiping around on apple.com (waiting for first paint)
1553         https://bugs.webkit.org/show_bug.cgi?id=192319
1554         <rdar://problem/45928708>
1555
1556         Reviewed by Simon Fraser.
1557
1558         * UIProcess/Cocoa/ViewGestureController.cpp:
1559         (WebKit::ViewGestureController::didStartProvisionalLoadForMainFrame):
1560         * UIProcess/Cocoa/ViewGestureController.h:
1561         * UIProcess/ios/ViewGestureControllerIOS.mm:
1562         (WebKit::ViewGestureController::endSwipeGesture):
1563         In r236966, I reverted slightly too much of r232416.
1564         We still need to defer requesting a presentation update callback until
1565         after the provisional load starts. Otherwise, we could get the callback
1566         while we're in the 'paused' state, and drop it on the floor. That would
1567         then mean that we time out instead of promptly removing the snapshot.
1568
1569 2018-12-03  Alex Christensen  <achristensen@webkit.org>
1570
1571         Update process assertions after swapping processes
1572         https://bugs.webkit.org/show_bug.cgi?id=192318
1573         <rdar://problem/46377552>
1574
1575         Reviewed by Chris Dumez.
1576
1577         If the previous WebProcess had a ProcessAssertion to prevent it from being suspended,
1578         after navigation and process swapping we need the new WebProcess to update its process assertions.
1579
1580         * UIProcess/API/Cocoa/PageLoadStateObserver.h:
1581         * UIProcess/Cocoa/NavigationState.h:
1582         * UIProcess/Cocoa/NavigationState.mm:
1583         (WebKit::NavigationState::didSwapWebProcesses):
1584         * UIProcess/PageLoadState.cpp:
1585         (WebKit::PageLoadState::didSwapWebProcesses):
1586         * UIProcess/PageLoadState.h:
1587         * UIProcess/WebPageProxy.cpp:
1588         (WebKit::WebPageProxy::finishAttachingToWebProcess):
1589
1590 2018-12-03  Daniel Bates  <dabates@apple.com>
1591
1592         [iOS] Do not handle key events that are key commands
1593         https://bugs.webkit.org/show_bug.cgi?id=191608
1594         <rdar://problem/46046013>
1595
1596         Reviewed by Ryosuke Niwa.
1597
1598         A key down event may be associated with a key command. If it is then we want to execute the
1599         key command instead of inserting or deleting text. We need to ask UIKit to handle the current
1600         event as a key command to find out.
1601
1602         * UIProcess/ios/WKContentViewInteraction.mm:
1603         (-[WKContentView _interpretKeyEvent:isCharEvent:]): Ask UIKit to handle the current event
1604         as a key command. If it handles it then we're done. Otherwise, do what we do now.
1605
1606 2018-12-03  Zalan Bujtas  <zalan@apple.com>
1607
1608         [iOS] Add logging channel for hover related content observation
1609         https://bugs.webkit.org/show_bug.cgi?id=192312
1610
1611         Reviewed by Simon Fraser.
1612
1613         * WebProcess/WebPage/ios/WebPageIOS.mm:
1614         (WebKit::WebPage::handleSyntheticClick):
1615         (WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
1616
1617 2018-12-03  Tim Horton  <timothy_horton@apple.com>
1618
1619         Enable swipe snapshot removal logging in release builds
1620         https://bugs.webkit.org/show_bug.cgi?id=192313
1621
1622         Reviewed by Dean Jackson.
1623
1624         * UIProcess/Cocoa/ViewGestureController.cpp:
1625         (WebKit::ViewGestureController::SnapshotRemovalTracker::log const):
1626         This is super-low-traffic and super-helpful logging.
1627         Turn it on all the time.
1628
1629 2018-12-03  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
1630
1631         Use WallTime for file time
1632         https://bugs.webkit.org/show_bug.cgi?id=192287
1633
1634         Reviewed by Darin Adler.
1635
1636         * Shared/SessionState.h:
1637         * Shared/WebCoreArgumentCoders.cpp:
1638         (IPC::ArgumentCoder<DatabaseDetails>::decode):
1639         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
1640         (WKKeyValueStorageManagerGetStorageDetailsByOrigin):
1641         * UIProcess/API/glib/WebKitWebViewSessionState.cpp:
1642         (decodeHTTPBody):
1643         * UIProcess/Plugins/gtk/PluginInfoCache.cpp:
1644         (WebKit::PluginInfoCache::getPluginInfo):
1645         (WebKit::PluginInfoCache::updatePluginInfo):
1646         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
1647         (WebKit::hasFileChangedSince):
1648         * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
1649         (WebKit::LocalStorageDatabaseTracker::databasesModifiedSince):
1650         (WebKit::LocalStorageDatabaseTracker::originDetails):
1651         * UIProcess/WebStorage/LocalStorageDatabaseTracker.h:
1652         * UIProcess/mac/LegacySessionStateCoding.cpp:
1653         (WebKit::encodeFormDataElement):
1654         (WebKit::decodeFormDataElement):
1655         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
1656         (WebKit::removeAllMediaKeyStorageForOriginPath):
1657         (WebKit::WebMediaKeyStorageManager::deleteMediaKeyEntriesForOrigin):
1658         (WebKit::WebMediaKeyStorageManager::deleteMediaKeyEntriesModifiedBetweenDates):
1659         (WebKit::WebMediaKeyStorageManager::deleteAllMediaKeyEntries):
1660         * WebProcess/MediaCache/WebMediaKeyStorageManager.h:
1661         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
1662         (WebKit::toHTTPBody):
1663         (WebKit::toFormData):
1664
1665 2018-12-03  Darin Adler  <darin@apple.com>
1666
1667         [Cocoa] Check message IDs when decoding Mach messages in IPC::Connection
1668         https://bugs.webkit.org/show_bug.cgi?id=192300
1669         rdar://problem/46215523
1670
1671         Reviewed by Chris Dumez.
1672
1673         * Platform/IPC/mac/ConnectionMac.mm:
1674         (IPC::Connection::sendOutgoingMessage): Use message IDs other than 0 and 1 for
1675         the messages, as suggested by an expert at Apple.
1676         (IPC::createMessageDecoder): Update for the new message IDs.
1677         (IPC::Connection::receiveSourceEventHandler): Ignore messages with unexpected
1678         message IDs.
1679
1680 2018-12-03  Darin Adler  <darin@apple.com>
1681
1682         [Cocoa] Check descriptor types in createMessageDecoder
1683         https://bugs.webkit.org/show_bug.cgi?id=192302
1684
1685         Reviewed by Chris Dumez.
1686
1687         Not sure how to construct a test case for Connection, so not adding any
1688         tests at this time.
1689
1690         * Platform/IPC/mac/ConnectionMac.mm:
1691         (IPC::createMessageDecoder): Check descriptor types and return nullptr if they
1692         are incorrect. Retained the assertions to help with debugging.
1693         (IPC::Connection::receiveSourceEventHandler): Ignore the message if no decoder
1694         is created, which means the message is invalid.
1695
1696 2018-12-03  Darin Adler  <darin@apple.com>
1697
1698         Alignment padding needs to be zeroed out in IPC::Encoder
1699         https://bugs.webkit.org/show_bug.cgi?id=192304
1700
1701         Reviewed by Chris Dumez.
1702
1703         Might be useful to make a regression test for this, but I couldn't find any
1704         other tests for this code.
1705
1706         * Platform/IPC/Encoder.cpp:
1707         (IPC::Encoder::grow): Use std::memset to zero-fill padding bytes.
1708
1709         * UIProcess/mac/LegacySessionStateCoding.cpp:
1710         (WebKit::HistoryEntryDataEncoder::grow): Ditto.
1711
1712 2018-12-03  Darin Adler  <darin@apple.com>
1713
1714         [Cocoa] Streamline sandbox code a tiny bit
1715         https://bugs.webkit.org/show_bug.cgi?id=192299
1716
1717         Reviewed by Anders Carlsson.
1718
1719         * Shared/mac/SandboxUtilities.mm:
1720         (WebKit::processHasContainer): Removed separate function, just use the
1721         pathForProcessContainer instead of repeating logic. This costs a tiny
1722         bit of memory allocation overhead the first time this function is called,
1723         but in return we can eliminate a second copy of the code to call
1724         sandbox_container_path_for_pid.
1725
1726 2018-12-03  Eric Carlson  <eric.carlson@apple.com>
1727
1728         [MediaStream] 'devicechange' event when more capture device information are revealed.
1729         https://bugs.webkit.org/show_bug.cgi?id=192268
1730
1731         Reviewed by Youenn Fablet.
1732
1733         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1734         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Call captureDevicesChanged
1735         if a filtered device list was returned previously.
1736         (WebKit::UserMediaPermissionRequestManagerProxy::resetAccess): Clear m_hasFilteredDeviceList.
1737         (WebKit::UserMediaPermissionRequestManagerProxy::wasGrantedVideoOrAudioAccess): New.
1738         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Filter device
1739         list and strip device IDs if gUM permission hasn't been given.
1740         (WebKit::UserMediaPermissionRequestManagerProxy::watchdogTimerFired): Clear m_hasFilteredDeviceList.
1741         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
1742
1743 2018-12-03  Keith Rollin  <krollin@apple.com>
1744
1745         Remove Network Capture
1746         https://bugs.webkit.org/show_bug.cgi?id=192296
1747         <rdar://problem/46408648>
1748
1749         Reviewed by Daniel Bates.
1750
1751         r209498 introduced an embedded record and replay facility for network
1752         resource loading. This facility was added in order to support a new
1753         implementation of the PLT and related performance tests. The PLT is
1754         currenty taking a different direction, and so this record/replace
1755         facility is no longer needed. Removing it as unused code.
1756
1757         * CMakeLists.txt:
1758         * NetworkProcess/NetworkLoad.cpp:
1759         (WebKit::NetworkLoad::NetworkLoad):
1760         (WebKit::NetworkLoad::setDefersLoading):
1761         (WebKit::NetworkLoad::continueWillSendRequest):
1762         (WebKit::NetworkLoad::willPerformHTTPRedirection):
1763         (WebKit::NetworkLoad::notifyDidReceiveResponse):
1764         (WebKit::NetworkLoad::didReceiveData):
1765         (WebKit::NetworkLoad::didCompleteWithError):
1766         (WebKit::NetworkLoad::initializeForRecord): Deleted.
1767         (WebKit::NetworkLoad::initializeForReplay): Deleted.
1768         * NetworkProcess/NetworkLoad.h:
1769         * NetworkProcess/NetworkProcess.cpp:
1770         (WebKit::NetworkProcess::initializeNetworkProcess):
1771         (WebKit::NetworkProcess::terminate):
1772         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1773         (WebKit::NetworkProcessCreationParameters::encode const):
1774         (WebKit::NetworkProcessCreationParameters::decode):
1775         * NetworkProcess/NetworkProcessCreationParameters.h:
1776         * NetworkProcess/capture/NetworkCaptureEvent.cpp: Removed.
1777         * NetworkProcess/capture/NetworkCaptureEvent.h: Removed.
1778         * NetworkProcess/capture/NetworkCaptureLogging.h: Removed.
1779         * NetworkProcess/capture/NetworkCaptureManager.cpp: Removed.
1780         * NetworkProcess/capture/NetworkCaptureManager.h: Removed.
1781         * NetworkProcess/capture/NetworkCaptureRecorder.cpp: Removed.
1782         * NetworkProcess/capture/NetworkCaptureRecorder.h: Removed.
1783         * NetworkProcess/capture/NetworkCaptureReplayer.cpp: Removed.
1784         * NetworkProcess/capture/NetworkCaptureReplayer.h: Removed.
1785         * NetworkProcess/capture/NetworkCaptureResource.cpp: Removed.
1786         * NetworkProcess/capture/NetworkCaptureResource.h: Removed.
1787         * NetworkProcess/capture/NetworkDataTaskReplay.cpp: Removed.
1788         * NetworkProcess/capture/NetworkDataTaskReplay.h: Removed.
1789         * NetworkProcess/capture/json.hpp: Removed.
1790         * Sources.txt:
1791         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1792         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
1793         * WebKit.xcodeproj/project.pbxproj:
1794         * config.h:
1795
1796 2018-12-02  Zalan Bujtas  <zalan@apple.com>
1797
1798         Add a runtime feature flag for LayoutFormattingContext.
1799         https://bugs.webkit.org/show_bug.cgi?id=192280
1800
1801         Reviewed by Simon Fraser.
1802
1803         * Configurations/FeatureDefines.xcconfig:
1804         * Shared/WebPreferences.yaml:
1805         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1806         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1807
1808 2018-12-01  Chris Dumez  <cdumez@apple.com>
1809
1810         [PSON] process-swapping may occur even though opener has handle to openee
1811         https://bugs.webkit.org/show_bug.cgi?id=192277
1812
1813         Reviewed by Antti Koivisto.
1814
1815         * Shared/NavigationActionData.cpp:
1816         (WebKit::NavigationActionData::encode const):
1817         (WebKit::NavigationActionData::decode):
1818         * Shared/NavigationActionData.h:
1819         * UIProcess/API/APINavigation.h:
1820         (API::Navigation::openedByDOMWithOpener const):
1821         (API::Navigation::openedViaWindowOpenWithOpener const): Deleted.
1822         (API::Navigation::opener const): Deleted.
1823         * UIProcess/WebProcessPool.cpp:
1824         (WebKit::WebProcessPool::processForNavigationInternal):
1825         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1826         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1827
1828 2018-12-01  Alexey Proskuryakov  <ap@apple.com>
1829
1830         Modernize version check for _suppressedAutoAddedHTTPHeaders
1831         https://bugs.webkit.org/show_bug.cgi?id=192175
1832
1833         Reviewed by Tim Horton.
1834
1835         * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
1836         Also removed selector check - we only need to support running on 10.13.0 when building
1837         with 10.13.0 SDK.
1838
1839 2018-11-30  Alex Christensen  <achristensen@webkit.org>
1840
1841         Fix Windows build.
1842
1843         * UIProcess/API/C/curl/WKWebsiteDataStoreRefCurl.cpp:
1844         (WKWebsiteDataStoreEnableCustomNetworkProxySettings):
1845
1846 2018-11-30  Alex Christensen  <achristensen@webkit.org>
1847
1848         Move URL from WebCore to WTF
1849         https://bugs.webkit.org/show_bug.cgi?id=190234
1850
1851         Reviewed by Keith Miller.
1852
1853         * NetworkProcess/Cookies/WebCookieManager.cpp:
1854         * NetworkProcess/Cookies/WebCookieManager.h:
1855         * NetworkProcess/Cookies/WebCookieManager.messages.in:
1856         * NetworkProcess/CustomProtocols/Cocoa/LegacyCustomProtocolManagerCocoa.mm:
1857         * NetworkProcess/Downloads/Download.h:
1858         * NetworkProcess/Downloads/DownloadManager.cpp:
1859         (WebKit::DownloadManager::publishDownloadProgress):
1860         * NetworkProcess/Downloads/DownloadManager.h:
1861         * NetworkProcess/Downloads/PendingDownload.cpp:
1862         (WebKit::PendingDownload::publishProgress):
1863         * NetworkProcess/Downloads/PendingDownload.h:
1864         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
1865         (WebKit::Download::publishProgress):
1866         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
1867         (WebKit::NetworkBlobRegistry::registerBlobURL):
1868         (WebKit::NetworkBlobRegistry::registerBlobURLForSlice):
1869         (WebKit::NetworkBlobRegistry::unregisterBlobURL):
1870         (WebKit::NetworkBlobRegistry::blobSize):
1871         (WebKit::NetworkBlobRegistry::filesInBlob):
1872         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
1873         * NetworkProcess/NetworkConnectionToWebProcess.h:
1874         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1875         * NetworkProcess/NetworkDataTask.cpp:
1876         (WebKit::NetworkDataTask::didReceiveResponse):
1877         * NetworkProcess/NetworkDataTaskBlob.cpp:
1878         * NetworkProcess/NetworkLoadChecker.h:
1879         (WebKit::NetworkLoadChecker::setContentExtensionController):
1880         (WebKit::NetworkLoadChecker::url const):
1881         * NetworkProcess/NetworkProcess.cpp:
1882         (WebKit::NetworkProcess::writeBlobToFilePath):
1883         (WebKit::NetworkProcess::publishDownloadProgress):
1884         (WebKit::NetworkProcess::preconnectTo):
1885         * NetworkProcess/NetworkProcess.h:
1886         * NetworkProcess/NetworkProcess.messages.in:
1887         * NetworkProcess/NetworkResourceLoadParameters.h:
1888         * NetworkProcess/NetworkResourceLoader.cpp:
1889         (WebKit::logBlockedCookieInformation):
1890         (WebKit::logCookieInformationInternal):
1891         * NetworkProcess/NetworkResourceLoader.h:
1892         * NetworkProcess/NetworkSocketStream.cpp:
1893         (WebKit::NetworkSocketStream::create):
1894         * NetworkProcess/NetworkSocketStream.h:
1895         * NetworkProcess/PingLoad.h:
1896         * NetworkProcess/ServiceWorker/WebSWServerConnection.h:
1897         * NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in:
1898         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
1899         * NetworkProcess/cache/CacheStorageEngine.cpp:
1900         (WebKit::CacheStorage::Engine::retrieveRecords):
1901         * NetworkProcess/cache/CacheStorageEngine.h:
1902         * NetworkProcess/cache/CacheStorageEngineCache.h:
1903         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
1904         (WebKit::CacheStorageEngineConnection::retrieveRecords):
1905         * NetworkProcess/cache/CacheStorageEngineConnection.h:
1906         * NetworkProcess/cache/CacheStorageEngineConnection.messages.in:
1907         * NetworkProcess/cache/NetworkCache.h:
1908         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
1909         (WebKit::NetworkCache::Statistics::recordRetrievedCachedEntry):
1910         (WebKit::NetworkCache::Statistics::recordRevalidationSuccess):
1911         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.h:
1912         (WebKit::NetworkCache::SubresourceInfo::firstPartyForCookies const):
1913         * NetworkProcess/capture/NetworkCaptureEvent.cpp:
1914         (WebKit::NetworkCapture::Request::operator WebCore::ResourceRequest const):
1915         (WebKit::NetworkCapture::Response::operator WebCore::ResourceResponse const):
1916         (WebKit::NetworkCapture::Error::operator WebCore::ResourceError const):
1917         * NetworkProcess/capture/NetworkCaptureManager.cpp:
1918         (WebKit::NetworkCapture::Manager::findBestFuzzyMatch):
1919         (WebKit::NetworkCapture::Manager::fuzzyMatchURLs):
1920         (WebKit::NetworkCapture::Manager::urlIdentifyingCommonDomain):
1921         * NetworkProcess/capture/NetworkCaptureManager.h:
1922         * NetworkProcess/capture/NetworkCaptureResource.cpp:
1923         (WebKit::NetworkCapture::Resource::url):
1924         (WebKit::NetworkCapture::Resource::queryParameters):
1925         * NetworkProcess/capture/NetworkCaptureResource.h:
1926         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1927         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
1928         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1929         (WebKit::NetworkProcess::deleteHSTSCacheForHostNames):
1930         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1931         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
1932         * PluginProcess/mac/PluginProcessMac.mm:
1933         (WebKit::openCFURLRef):
1934         (WebKit::replacedNSWorkspace_launchApplicationAtURL_options_configuration_error):
1935         * Shared/API/APIURL.h:
1936         (API::URL::create):
1937         (API::URL::equals):
1938         (API::URL::URL):
1939         (API::URL::url const):
1940         (API::URL::parseURLIfNecessary const):
1941         * Shared/API/APIUserContentURLPattern.h:
1942         (API::UserContentURLPattern::matchesURL const):
1943         * Shared/API/c/WKURLRequest.cpp:
1944         * Shared/API/c/WKURLResponse.cpp:
1945         * Shared/API/c/cf/WKURLCF.mm:
1946         (WKURLCreateWithCFURL):
1947         (WKURLCopyCFURL):
1948         * Shared/API/glib/WebKitURIRequest.cpp:
1949         * Shared/API/glib/WebKitURIResponse.cpp:
1950         * Shared/APIWebArchiveResource.mm:
1951         (API::WebArchiveResource::WebArchiveResource):
1952         * Shared/AssistedNodeInformation.h:
1953         * Shared/Cocoa/WKNSURLExtras.mm:
1954         (-[NSURL _web_originalDataAsWTFString]):
1955         (): Deleted.
1956         * Shared/SessionState.h:
1957         * Shared/WebBackForwardListItem.cpp:
1958         (WebKit::WebBackForwardListItem::itemIsInSameDocument const):
1959         * Shared/WebCoreArgumentCoders.cpp:
1960         * Shared/WebCoreArgumentCoders.h:
1961         * Shared/WebErrors.h:
1962         * Shared/WebHitTestResultData.cpp:
1963         * Shared/cf/ArgumentCodersCF.cpp:
1964         (IPC::encode):
1965         (IPC::decode):
1966         * Shared/gtk/WebErrorsGtk.cpp:
1967         * Shared/ios/InteractionInformationAtPosition.h:
1968         * UIProcess/API/APIHTTPCookieStore.h:
1969         * UIProcess/API/APINavigation.cpp:
1970         (API::Navigation::appendRedirectionURL):
1971         * UIProcess/API/APINavigation.h:
1972         (API::Navigation::takeRedirectChain):
1973         * UIProcess/API/APINavigationAction.h:
1974         * UIProcess/API/APINavigationClient.h:
1975         (API::NavigationClient::signedPublicKeyAndChallengeString):
1976         (API::NavigationClient::contentRuleListNotification):
1977         (API::NavigationClient::webGLLoadPolicy const):
1978         (API::NavigationClient::resolveWebGLLoadPolicy const):
1979         * UIProcess/API/APIUIClient.h:
1980         (API::UIClient::saveDataToFileInDownloadsFolder):
1981         * UIProcess/API/APIUserScript.cpp:
1982         (API::UserScript::generateUniqueURL):
1983         * UIProcess/API/APIUserScript.h:
1984         * UIProcess/API/APIUserStyleSheet.cpp:
1985         (API::UserStyleSheet::generateUniqueURL):
1986         * UIProcess/API/APIUserStyleSheet.h:
1987         * UIProcess/API/C/WKOpenPanelResultListener.cpp:
1988         (filePathsFromFileURLs):
1989         * UIProcess/API/C/WKPage.cpp:
1990         (WKPageLoadPlainTextStringWithUserData):
1991         (WKPageSetPageUIClient):
1992         (WKPageSetPageNavigationClient):
1993         * UIProcess/API/C/WKPageGroup.cpp:
1994         (WKPageGroupAddUserStyleSheet):
1995         (WKPageGroupAddUserScript):
1996         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1997         (WKWebsiteDataStoreSetResourceLoadStatisticsPrevalentResourceForDebugMode):
1998         (WKWebsiteDataStoreSetStatisticsLastSeen):
1999         (WKWebsiteDataStoreSetStatisticsPrevalentResource):
2000         (WKWebsiteDataStoreSetStatisticsVeryPrevalentResource):
2001         (WKWebsiteDataStoreIsStatisticsPrevalentResource):
2002         (WKWebsiteDataStoreIsStatisticsVeryPrevalentResource):
2003         (WKWebsiteDataStoreIsStatisticsRegisteredAsSubresourceUnder):
2004         (WKWebsiteDataStoreIsStatisticsRegisteredAsSubFrameUnder):
2005         (WKWebsiteDataStoreIsStatisticsRegisteredAsRedirectingTo):
2006         (WKWebsiteDataStoreSetStatisticsHasHadUserInteraction):
2007         (WKWebsiteDataStoreIsStatisticsHasHadUserInteraction):
2008         (WKWebsiteDataStoreSetStatisticsGrandfathered):
2009         (WKWebsiteDataStoreIsStatisticsGrandfathered):
2010         (WKWebsiteDataStoreSetStatisticsSubframeUnderTopFrameOrigin):
2011         (WKWebsiteDataStoreSetStatisticsSubresourceUnderTopFrameOrigin):
2012         (WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectTo):
2013         (WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectFrom):
2014         (WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectTo):
2015         (WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectFrom):
2016         * UIProcess/API/Cocoa/WKHTTPCookieStore.mm:
2017         * UIProcess/API/Cocoa/WKUserScript.mm:
2018         (-[WKUserScript _initWithSource:injectionTime:forMainFrameOnly:legacyWhitelist:legacyBlacklist:associatedURL:userContentWorld:]):
2019         * UIProcess/API/Cocoa/WKWebView.mm:
2020         (-[WKWebView _showSafeBrowsingWarning:completionHandler:]):
2021         (-[WKWebView _showSafeBrowsingWarningWithTitle:warning:details:completionHandler:]):
2022         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2023         (-[WKWebViewConfiguration setURLSchemeHandler:forURLScheme:]):
2024         (-[WKWebViewConfiguration urlSchemeHandlerForURLScheme:]):
2025         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2026         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2027         * UIProcess/API/Cocoa/_WKApplicationManifest.mm:
2028         (-[_WKApplicationManifest initWithCoder:]):
2029         (+[_WKApplicationManifest applicationManifestFromJSON:manifestURL:documentURL:]):
2030         * UIProcess/API/Cocoa/_WKUserStyleSheet.mm:
2031         (-[_WKUserStyleSheet initWithSource:forMainFrameOnly:legacyWhitelist:legacyBlacklist:baseURL:userContentWorld:]):
2032         * UIProcess/API/glib/IconDatabase.cpp:
2033         * UIProcess/API/glib/WebKitCookieManager.cpp:
2034         (webkit_cookie_manager_get_cookies):
2035         * UIProcess/API/glib/WebKitFileChooserRequest.cpp:
2036         * UIProcess/API/glib/WebKitSecurityOrigin.cpp:
2037         (webkit_security_origin_new_for_uri):
2038         * UIProcess/API/glib/WebKitUIClient.cpp:
2039         * UIProcess/API/glib/WebKitURISchemeRequest.cpp:
2040         * UIProcess/API/glib/WebKitWebView.cpp:
2041         (webkit_web_view_load_plain_text):
2042         * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
2043         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
2044         (WebKit::WebPaymentCoordinatorProxy::showPaymentUI):
2045         (WebKit::WebPaymentCoordinatorProxy::validateMerchant):
2046         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
2047         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h:
2048         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
2049         (WebKit::toPKPaymentRequest):
2050         * UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
2051         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
2052         * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
2053         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
2054         * UIProcess/Automation/WebAutomationSession.cpp:
2055         (WebKit::WebAutomationSession::navigateBrowsingContext):
2056         (WebKit::domainByAddingDotPrefixIfNeeded):
2057         (WebKit::WebAutomationSession::addSingleCookie):
2058         (WebKit::WebAutomationSession::deleteAllCookies):
2059         * UIProcess/Cocoa/DownloadClient.mm:
2060         (WebKit::DownloadClient::didFinish):
2061         * UIProcess/Cocoa/NavigationState.h:
2062         * UIProcess/Cocoa/NavigationState.mm:
2063         (WebKit::NavigationState::NavigationClient::webGLLoadPolicy const):
2064         (WebKit::NavigationState::NavigationClient::resolveWebGLLoadPolicy const):
2065         (WebKit::NavigationState::NavigationClient::contentRuleListNotification):
2066         (WebKit::NavigationState::NavigationClient::willPerformClientRedirect):
2067         (WebKit::NavigationState::NavigationClient::didPerformClientRedirect):
2068         (WebKit::NavigationState::NavigationClient::signedPublicKeyAndChallengeString):
2069         * UIProcess/Cocoa/SafeBrowsingResultCocoa.mm: Copied from Source/WebKit/WebProcess/Network/WebSocketProvider.h.
2070         (WebKit::SafeBrowsingResult::SafeBrowsingResult):
2071         * UIProcess/Cocoa/SafeBrowsingWarningCocoa.mm:
2072         (WebKit::reportAnErrorURL):
2073         (WebKit::malwareDetailsURL):
2074         (WebKit::safeBrowsingDetailsText):
2075         (WebKit::SafeBrowsingWarning::SafeBrowsingWarning):
2076         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
2077         (-[_WKPreviewControllerDataSource finish:]):
2078         (WebKit::SystemPreviewController::finish):
2079         * UIProcess/Cocoa/UIDelegate.h:
2080         * UIProcess/Cocoa/UIDelegate.mm:
2081         (WebKit::UIDelegate::UIClient::createNewPage):
2082         (WebKit::UIDelegate::UIClient::saveDataToFileInDownloadsFolder):
2083         (WebKit::requestUserMediaAuthorizationForDevices):
2084         (WebKit::UIDelegate::UIClient::checkUserMediaPermissionForOrigin):
2085         * UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.mm:
2086         (-[WKReloadFrameErrorRecoveryAttempter attemptRecovery]):
2087         * UIProcess/Cocoa/WKSafeBrowsingWarning.h:
2088         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
2089         (-[WKSafeBrowsingWarning initWithFrame:safeBrowsingWarning:completionHandler:]):
2090         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
2091         * UIProcess/Cocoa/WebViewImpl.h:
2092         * UIProcess/Cocoa/WebViewImpl.mm:
2093         (WebKit::WebViewImpl::showSafeBrowsingWarning):
2094         (WebKit::WebViewImpl::writeToURLForFilePromiseProvider):
2095         * UIProcess/Downloads/DownloadProxy.cpp:
2096         (WebKit::DownloadProxy::publishProgress):
2097         * UIProcess/Downloads/DownloadProxy.h:
2098         (WebKit::DownloadProxy::setRedirectChain):
2099         (WebKit::DownloadProxy::redirectChain const):
2100         * UIProcess/FrameLoadState.cpp:
2101         (WebKit::FrameLoadState::didStartProvisionalLoad):
2102         (WebKit::FrameLoadState::didReceiveServerRedirectForProvisionalLoad):
2103         (WebKit::FrameLoadState::didSameDocumentNotification):
2104         (WebKit::FrameLoadState::setUnreachableURL):
2105         * UIProcess/FrameLoadState.h:
2106         (WebKit::FrameLoadState::url const):
2107         (WebKit::FrameLoadState::setURL):
2108         (WebKit::FrameLoadState::provisionalURL const):
2109         (WebKit::FrameLoadState::unreachableURL const):
2110         * UIProcess/Network/NetworkProcessProxy.cpp:
2111         (WebKit::NetworkProcessProxy::writeBlobToFilePath):
2112         * UIProcess/Network/NetworkProcessProxy.h:
2113         * UIProcess/PageClient.h:
2114         (WebKit::PageClient::showSafeBrowsingWarning):
2115         * UIProcess/PageLoadState.cpp:
2116         (WebKit::PageLoadState::hasOnlySecureContent):
2117         * UIProcess/Plugins/PluginInfoStore.cpp:
2118         * UIProcess/Plugins/PluginInfoStore.h:
2119         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
2120         * UIProcess/SafeBrowsingResult.h: Copied from Source/WebKit/UIProcess/SystemPreviewController.h.
2121         (WebKit::SafeBrowsingResult::create):
2122         (WebKit::SafeBrowsingResult::url const):
2123         (WebKit::SafeBrowsingResult::provider const):
2124         (WebKit::SafeBrowsingResult::isPhishing const):
2125         (WebKit::SafeBrowsingResult::isMalware const):
2126         (WebKit::SafeBrowsingResult::isUnwantedSoftware const):
2127         (WebKit::SafeBrowsingResult::isKnownToBeUnsafe const):
2128         * UIProcess/SafeBrowsingWarning.h:
2129         (WebKit::SafeBrowsingWarning::create):
2130         * UIProcess/SuspendedPageProxy.cpp:
2131         * UIProcess/SystemPreviewController.h:
2132         * UIProcess/WebCookieManagerProxy.h:
2133         * UIProcess/WebFrameProxy.h:
2134         (WebKit::WebFrameProxy::url const):
2135         (WebKit::WebFrameProxy::provisionalURL const):
2136         (WebKit::WebFrameProxy::unreachableURL const):
2137         * UIProcess/WebInspectorProxy.h:
2138         * UIProcess/WebOpenPanelResultListenerProxy.cpp:
2139         * UIProcess/WebPageProxy.cpp:
2140         (WebKit::WebPageProxy::loadDataWithNavigation):
2141         (WebKit::WebPageProxy::loadAlternateHTML):
2142         (WebKit::WebPageProxy::loadWebArchiveData):
2143         (WebKit::WebPageProxy::navigateToPDFLinkWithSimulatedClick):
2144         (WebKit::WebPageProxy::continueNavigationInNewProcess):
2145         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
2146         (WebKit::WebPageProxy::didChangeProvisionalURLForFrame):
2147         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
2148         (WebKit::WebPageProxy::contentRuleListNotification):
2149         (WebKit::WebPageProxy::processDidTerminate):
2150         (WebKit::WebPageProxy::signedPublicKeyAndChallengeString):
2151         (WebKit::WebPageProxy::setURLSchemeHandlerForScheme):
2152         * UIProcess/WebPageProxy.h:
2153         * UIProcess/WebPageProxy.messages.in:
2154         * UIProcess/WebProcessPool.cpp:
2155         (WebKit::WebProcessPool::tryPrewarmWithDomainInformation):
2156         * UIProcess/WebProcessPool.h:
2157         * UIProcess/WebProcessProxy.cpp:
2158         (WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):
2159         * UIProcess/WebProcessProxy.h:
2160         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2161         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResourceForDebugMode):
2162         (WebKit::WebResourceLoadStatisticsStore::logFrameNavigation):
2163         * UIProcess/WebResourceLoadStatisticsStore.h:
2164         * UIProcess/ios/DragDropInteractionState.h:
2165         * UIProcess/ios/PageClientImplIOS.h:
2166         * UIProcess/ios/PageClientImplIOS.mm:
2167         (WebKit::PageClientImpl::showSafeBrowsingWarning):
2168         * UIProcess/ios/WKActionSheetAssistant.mm:
2169         (-[WKActionSheetAssistant _createSheetWithElementActions:showLinkTitle:]):
2170         * UIProcess/ios/WKContentViewInteraction.mm:
2171         (-[WKContentView actionSheetAssistant:shareElementWithURL:rect:]):
2172         (-[WKContentView _presentedViewControllerForPreviewItemController:]):
2173         * UIProcess/ios/WKGeolocationProviderIOS.mm:
2174         (-[WKGeolocationProviderIOS geolocationAuthorizationGranted]):
2175         * UIProcess/ios/WKLegacyPDFView.mm:
2176         (-[WKLegacyPDFView actionSheetAssistant:shareElementWithURL:rect:]):
2177         * UIProcess/ios/WKPDFView.mm:
2178         (-[WKPDFView actionSheetAssistant:shareElementWithURL:rect:]):
2179         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
2180         (-[WKFullScreenWindowController _updateLocationInfo]):
2181         * UIProcess/mac/LegacySessionStateCoding.cpp:
2182         (WebKit::decodeLegacySessionState):
2183         * UIProcess/mac/PageClientImplMac.h:
2184         * UIProcess/mac/PageClientImplMac.mm:
2185         (WebKit::PageClientImpl::showSafeBrowsingWarning):
2186         * UIProcess/mac/WKImmediateActionController.mm:
2187         (-[WKImmediateActionController _defaultAnimationController]):
2188         * UIProcess/win/WebInspectorProxyWin.cpp:
2189         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
2190         (WebKit::WebPaymentCoordinator::showPaymentUI):
2191         (WebKit::WebPaymentCoordinator::validateMerchant):
2192         * WebProcess/ApplePay/WebPaymentCoordinator.h:
2193         * WebProcess/Cache/WebCacheStorageConnection.cpp:
2194         (WebKit::WebCacheStorageConnection::doRetrieveRecords):
2195         * WebProcess/Cache/WebCacheStorageConnection.h:
2196         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
2197         (WebKit::BlobRegistryProxy::registerFileBlobURL):
2198         * WebProcess/FileAPI/BlobRegistryProxy.h:
2199         * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h:
2200         (API::InjectedBundle::PageLoaderClient::willLoadDataRequest):
2201         (API::InjectedBundle::PageLoaderClient::userAgentForURL const):
2202         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
2203         (WKBundleFrameAllowsFollowingLink):
2204         (WKBundleFrameCopySuggestedFilenameForResourceWithURL):
2205         (WKBundleFrameCopyMIMETypeForResourceWithURL):
2206         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2207         (WKBundlePageHasLocalDataForURL):
2208         * WebProcess/InjectedBundle/API/gtk/DOM/ConvertToUTF8String.cpp:
2209         (convertToUTF8String):
2210         * WebProcess/InjectedBundle/API/gtk/DOM/ConvertToUTF8String.h:
2211         * WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp:
2212         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
2213         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
2214         * WebProcess/Network/WebLoaderStrategy.cpp:
2215         (WebKit::WebLoaderStrategy::preconnectTo):
2216         * WebProcess/Network/WebLoaderStrategy.h:
2217         * WebProcess/Network/WebSocketProvider.h:
2218         * WebProcess/Network/WebSocketStream.cpp:
2219         (WebKit::WebSocketStream::WebSocketStream):
2220         * WebProcess/Network/WebSocketStream.h:
2221         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
2222         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
2223         * WebProcess/Plugins/Netscape/NetscapePluginStream.h:
2224         * WebProcess/Plugins/PDF/PDFPlugin.h:
2225         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2226         (WebKit::PDFPlugin::clickedLink):
2227         * WebProcess/Plugins/Plugin.h:
2228         * WebProcess/Plugins/PluginController.h:
2229         * WebProcess/Plugins/PluginProxy.h:
2230         * WebProcess/Plugins/PluginView.cpp:
2231         (WebKit::PluginView::performURLRequest):
2232         (WebKit::PluginView::performJavaScriptURLRequest):
2233         * WebProcess/Plugins/WebPluginInfoProvider.cpp:
2234         (WebKit::WebPluginInfoProvider::webVisiblePluginInfo):
2235         * WebProcess/Plugins/WebPluginInfoProvider.h:
2236         * WebProcess/Storage/WebSWClientConnection.h:
2237         * WebProcess/Storage/WebSWContextManagerConnection.h:
2238         * WebProcess/UserContent/WebUserContentController.h:
2239         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2240         (WebKit::WebChromeClient::signedPublicKeyAndChallengeString const):
2241         * WebProcess/WebCoreSupport/WebChromeClient.h:
2242         * WebProcess/WebCoreSupport/WebContextMenuClient.h:
2243         * WebProcess/WebCoreSupport/WebDragClient.h:
2244         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2245         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
2246         (WebKit::WebFrameLoaderClient::shouldForceUniversalAccessFromLocalURL):
2247         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2248         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2249         (WebKit::WebPlatformStrategies::readURLFromPasteboard):
2250         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
2251         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
2252         (WebKit::WebDragClient::declareAndWriteDragImage):
2253         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
2254         * WebProcess/WebPage/VisitedLinkTableController.h:
2255         * WebProcess/WebPage/WebFrame.cpp:
2256         (WebKit::WebFrame::allowsFollowingLink const):
2257         * WebProcess/WebPage/WebFrame.h:
2258         * WebProcess/WebPage/WebPage.cpp:
2259         (WebKit::WebPage::loadURLInFrame):
2260         (WebKit::WebPage::loadData):
2261         (WebKit::WebPage::loadAlternateHTML):
2262         (WebKit::WebPage::dumpHistoryForTesting):
2263         (WebKit::WebPage::sendCSPViolationReport):
2264         (WebKit::WebPage::addUserScript):
2265         (WebKit::WebPage::addUserStyleSheet):
2266         * WebProcess/WebPage/WebPage.h:
2267         * WebProcess/WebPage/WebPage.messages.in:
2268         * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
2269         (WebKit::WebPrintOperationGtk::frameURL const):
2270         * WebProcess/WebPage/gtk/WebPrintOperationGtk.h:
2271         * WebProcess/WebProcess.cpp:
2272         (WebKit::WebProcess::sendPrewarmInformation):
2273         * WebProcess/WebProcess.h:
2274         * WebProcess/cocoa/WebProcessCocoa.mm:
2275         (WebKit::activePagesOrigins):
2276
2277 2018-11-30  Per Arne Vollan  <pvollan@apple.com>
2278
2279         [macOS] Add more logging of sandbox call entries.
2280         https://bugs.webkit.org/show_bug.cgi?id=192261
2281         rdar://problem/45772445
2282
2283         Reviewed by Dean Jackson.
2284
2285         * WebProcess/com.apple.WebProcess.sb.in:
2286
2287 2018-11-30  Tim Horton  <timothy_horton@apple.com>
2288
2289         Editable images should always return some data, even if the canvas doesn't have a size yet
2290         https://bugs.webkit.org/show_bug.cgi?id=192265
2291         <rdar://problem/46385911>
2292
2293         Reviewed by Wenson Hsieh.
2294
2295         * UIProcess/ios/WKDrawingView.mm:
2296         (-[WKDrawingView layoutSubviews]):
2297         (emptyImage):
2298         (-[WKDrawingView renderedDrawing]):
2299         (-[WKDrawingView PNGRepresentation]):
2300         Some clients strongly depend on there being some data in an image, even if
2301         it's not of a usable size yet. We'll invalidate the attachment when the
2302         canvas size changes, so it will eventually settle at a usable size (after
2303         the first layer tree commit that includes the editable image).
2304
2305 2018-11-30  Don Olmstead  <don.olmstead@sony.com>
2306
2307         Rename ENABLE_SUBTLE_CRYPTO to ENABLE_WEB_CRYPTO
2308         https://bugs.webkit.org/show_bug.cgi?id=192197
2309
2310         Reviewed by Jiewen Tan.
2311
2312         * Configurations/FeatureDefines.xcconfig:
2313         * UIProcess/API/C/WKPage.cpp:
2314         (WKPageSetPageNavigationClient):
2315         * UIProcess/WebPageProxy.cpp:
2316         * UIProcess/WebPageProxy.h:
2317         * UIProcess/WebPageProxy.messages.in:
2318         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2319         * WebProcess/WebCoreSupport/WebChromeClient.h:
2320
2321 2018-11-30  Alexey Proskuryakov  <ap@apple.com>
2322
2323         Move USE_CFNETWORK_IGNORE_HSTS to its proper place
2324         https://bugs.webkit.org/show_bug.cgi?id=192173
2325
2326         Reviewed by Tim Horton.
2327
2328         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2329         (updateIgnoreStrictTransportSecuritySettingIfNecessary):
2330         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
2331         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
2332
2333 2018-11-30  Alex Christensen  <achristensen@webkit.org>
2334
2335         Remove unused WebProcessCreationParameters.uiProcessCookieStorageIdentifier
2336         https://bugs.webkit.org/show_bug.cgi?id=192157
2337
2338         Reviewed by Chris Dumez.
2339
2340         * Shared/WebProcessCreationParameters.cpp:
2341         (WebKit::WebProcessCreationParameters::encode const):
2342         (WebKit::WebProcessCreationParameters::decode):
2343         * Shared/WebProcessCreationParameters.h:
2344         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2345         (WebKit::WebProcessPool::platformInitializeWebProcess):
2346
2347 2018-11-30  Alex Christensen  <achristensen@webkit.org>
2348
2349         Remove privateBrowsingEnabled from NetworkProcessCreationParameters
2350         https://bugs.webkit.org/show_bug.cgi?id=192156
2351
2352         Reviewed by Chris Dumez.
2353
2354         * NetworkProcess/NetworkProcess.cpp:
2355         (WebKit::NetworkProcess::initializeNetworkProcess):
2356         * NetworkProcess/NetworkProcessCreationParameters.cpp:
2357         (WebKit::NetworkProcessCreationParameters::encode const):
2358         (WebKit::NetworkProcessCreationParameters::decode):
2359         * NetworkProcess/NetworkProcessCreationParameters.h:
2360         * UIProcess/WebProcessPool.cpp:
2361         (WebKit::WebProcessPool::ensureNetworkProcess):
2362
2363 2018-11-30  Basuke Suzuki  <basuke.suzuki@sony.com>
2364
2365         [Curl] Add API for ProtectionSpace.
2366         https://bugs.webkit.org/show_bug.cgi?id=191648
2367
2368         Reviewed by Alex Christensen.
2369
2370         Added API to get certificate information from protection space.
2371
2372         * PlatformWin.cmake:
2373         * Shared/curl/WebCoreArgumentCodersCurl.cpp:
2374         (IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData):
2375         (IPC::ArgumentCoder<ProtectionSpace>::decodePlatformData):
2376         * UIProcess/API/C/curl/WKProtectionSpaceCurl.cpp: Added.
2377         (WKProtectionSpaceCopyCertificateInfo):
2378         * UIProcess/API/C/curl/WKProtectionSpaceCurl.h: Added.
2379
2380 2018-11-30  David Quesada  <david_quesada@apple.com>
2381
2382         -[WKProcessPool _downloadURLRequest:] should allow specifying the initiating web view
2383         https://bugs.webkit.org/show_bug.cgi?id=192212
2384         rdar://problem/46363706
2385
2386         Reviewed by Alex Christensen.
2387
2388         * UIProcess/API/Cocoa/WKProcessPool.mm:
2389         (-[WKProcessPool _downloadURLRequest:originatingWebView:]):
2390         (-[WKProcessPool _downloadURLRequest:]): Deleted.
2391         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2392
2393 2018-11-30  Per Arne Vollan  <pvollan@apple.com>
2394
2395         Remove invalid character in sandbox introduced in r238703.
2396
2397         Unreviewed sandbox fix.
2398
2399         * WebProcess/com.apple.WebProcess.sb.in:
2400
2401 2018-11-30  Andy Estes  <aestes@apple.com>
2402
2403         [Cocoa] Add some WKA extension points
2404         https://bugs.webkit.org/show_bug.cgi?id=192131
2405         <rdar://problem/46330293>
2406
2407         Reviewed by Tim Horton.
2408
2409         * DerivedSources.make: Added an extension point for WebPreferences.yaml.
2410         * Platform/IPC/MessageSender.h:
2411         (IPC::MessageSender::sendWithAsyncReply): Send async messages via IPC::MessageSender.
2412         * Platform/cocoa/WebKitAdditions.mm: A an extension point for additional WebKit sources.
2413         * SourcesCocoa.txt: Added WebKitAdditions.mm as non-unified source.
2414         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
2415         (WebKit::WebPaymentCoordinatorProxy::WebPaymentCoordinatorProxy): Called finishConstruction.
2416         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h: Added an extension point for
2417         WebPaymentCoordinatorProxy.
2418         * WebKit.xcodeproj/project.pbxproj: Added WebKitAdditions.mm.
2419         * WebProcess/ApplePay/WebPaymentCoordinator.h: Added an extension point for
2420         WebPaymentCoordinator.
2421
2422 2018-11-30  Frederic Wang  <fwang@igalia.com>
2423
2424         [WebAuthN] Support CTAP HID authenticators on macOS
2425         https://bugs.webkit.org/show_bug.cgi?id=188623
2426
2427         Unreviewed build fix.
2428
2429         * UIProcess/WebAuthentication/Cocoa/HidConnection.mm: Add missing header.
2430
2431 2018-11-29  Wenson Hsieh  <wenson_hsieh@apple.com>
2432
2433         REGRESSION (r238635): Dragging a text selection within WKWebView causes the selection highlight to get into a bad state
2434         https://bugs.webkit.org/show_bug.cgi?id=192165
2435         <rdar://problem/46346682>
2436
2437         Reviewed by Daniel Bates.
2438
2439         Fixes a bug in PageClientImpl::isViewFocused. Consider the following scenario:
2440         1. WKWebView is hosted within the view hierarchy
2441         2. First responder is *not* WKContentView
2442         3. The active focus retain count is nonzero
2443
2444         Before r238635, we would return true, due to condition (3). However, after r238635, we only consider whether the
2445         first responder is WKContentView, since the web view is in the view hierarchy. This breaks scenarios where
2446         WebKit or UIKit attempts to retain focus and later restore the content view to be the first responder (an
2447         example of this is dragging a text selection between editable elements in the same web view).
2448
2449         To fix this, simply bail early and return true if focus is being retained.
2450
2451         * UIProcess/ios/PageClientImplIOS.mm:
2452         (WebKit::PageClientImpl::isViewFocused):
2453
2454 2018-11-29  Tim Horton  <timothy_horton@apple.com>
2455
2456         Inform clients when editable image attachment backing data changes
2457         https://bugs.webkit.org/show_bug.cgi?id=192206
2458         <rdar://problem/46350277>
2459
2460         Reviewed by Wenson Hsieh.
2461
2462         * UIProcess/API/Cocoa/APIAttachmentCocoa.mm:
2463         (API::Attachment::invalidateGeneratedFileWrapper):
2464         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2465         * UIProcess/API/Cocoa/WKWebView.mm:
2466         (-[WKWebView _didInvalidateDataForAttachment:]):
2467         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2468         * UIProcess/Cocoa/PageClientImplCocoa.h:
2469         * UIProcess/Cocoa/PageClientImplCocoa.mm:
2470         (WebKit::PageClientImplCocoa::didInvalidateDataForAttachment):
2471         * UIProcess/PageClient.h:
2472         (WebKit::PageClient::didInvalidateDataForAttachment):
2473         * UIProcess/WebPageProxy.cpp:
2474         (WebKit::WebPageProxy::didInvalidateDataForAttachment):
2475         * UIProcess/WebPageProxy.h:
2476         Plumb file-wrapper-invalidation through from APIAttachment to WKUIDelegate.
2477
2478 2018-11-29  Eric Carlson  <eric.carlson@apple.com>
2479
2480         [MediaStream] DeviceIdHashSaltStorage should use iframe and top level documents
2481         https://bugs.webkit.org/show_bug.cgi?id=192182
2482
2483         Reviewed by Youenn Fablet.
2484
2485         * UIProcess/DeviceIdHashSaltStorage.cpp:
2486         (WebKit::DeviceIdHashSaltStorage::deviceIdHashSaltForOrigin): Key off of request and top 
2487         level documents.
2488         (WebKit::DeviceIdHashSaltStorage::deleteDeviceIdHashSaltForOrigins): Ditto.
2489         * UIProcess/DeviceIdHashSaltStorage.h:
2490         (WebKit::DeviceIdHashSaltStorage::HashSaltForOrigin::HashSaltForOrigin):
2491
2492         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2493         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Pass both documents.
2494         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Ditto.
2495         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Ditto.
2496
2497 2018-11-29  Ryan Haddad  <ryanhaddad@apple.com>
2498
2499         Unreviewed, rolling out r238713.
2500
2501         Breaks internal builds.
2502
2503         Reverted changeset:
2504
2505         "[Cocoa] Add some WKA extension points"
2506         https://bugs.webkit.org/show_bug.cgi?id=192131
2507         https://trac.webkit.org/changeset/238713
2508
2509 2018-11-29  Simon Fraser  <simon.fraser@apple.com>
2510
2511         Add an internal feature flag to enable async overflow scrolling
2512         https://bugs.webkit.org/show_bug.cgi?id=192184
2513
2514         Reviewed by Tim Horton.
2515
2516         Add a new internal feature flag that will enable async overflow-scrolling for
2517         most overflow:scroll elements. Defaults to off.
2518
2519         * Shared/WebPreferences.yaml:
2520
2521 2018-11-29  Andy Estes  <aestes@apple.com>
2522
2523         [Cocoa] Add some WKA extension points
2524         https://bugs.webkit.org/show_bug.cgi?id=192131
2525         <rdar://problem/46330293>
2526
2527         Reviewed by Tim Horton.
2528
2529         * DerivedSources.make: Added an extension point for WebPreferences.yaml.
2530         * Platform/IPC/MessageSender.h:
2531         (IPC::MessageSender::sendWithAsyncReply): Send async messages via IPC::MessageSender.
2532         * Platform/cocoa/WebKitAdditions.mm: A an extension point for additional WebKit sources.
2533         * SourcesCocoa.txt: Added WebKitAdditions.mm as non-unified source.
2534         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
2535         (WebKit::WebPaymentCoordinatorProxy::WebPaymentCoordinatorProxy): Called finishConstruction.
2536         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h: Added an extension point for
2537         WebPaymentCoordinatorProxy.
2538         * WebKit.xcodeproj/project.pbxproj: Added WebKitAdditions.mm.
2539         * WebProcess/ApplePay/WebPaymentCoordinator.h: Added an extension point for
2540         WebPaymentCoordinator.
2541
2542 2018-11-29  Tim Horton  <timothy_horton@apple.com>
2543
2544         Try to fix the build.
2545
2546         * Platform/spi/ios/PencilKitSPI.h:
2547
2548 2018-11-29  David Quesada  <david_quesada@apple.com>
2549
2550         Add SPI to publish NSProgress on active downloads
2551         https://bugs.webkit.org/show_bug.cgi?id=192021
2552         rdar://problem/44405661
2553
2554         Reviewed by Alex Christensen.
2555
2556         Make it possible for clients to allow other processes to monitor the state of active
2557         downloads. On Cocoa platforms, this can be done by creating an NSProgress, publishing
2558         it on an appropriate file URL (potentially a different file URL than where the download
2559         data is being written), updating properties on it as the download makes progress, and
2560         wiring up a cancellation handler that allows it to be remotely canceled. Interested
2561         clients can then subscribe to progress on that URL and receive a proxy to the progress
2562         that WebKit publishes.
2563
2564         * NetworkProcess/Downloads/Download.cpp:
2565         (WebKit::Download::~Download):
2566         (WebKit::Download::platformDestroyDownload):
2567             Add a platform-customizable hook for destructing the Download. DownloadCocoa.mm
2568             will interact with its Objective-C NSProgress instance at this point.
2569
2570         * NetworkProcess/Downloads/Download.h:
2571         * NetworkProcess/Downloads/DownloadManager.cpp:
2572         (WebKit::DownloadManager::dataTaskBecameDownloadTask):
2573             See comments for publishDownloadProgress().
2574         (WebKit::DownloadManager::publishDownloadProgress):
2575             If the provided downloadID corresponds to a non-Pending Download, hand the URL
2576             and a matching sandbox extension to the Download so it can create its progress.
2577             Otherwise, store the URL and sandbox extension on the PendingDownload to be used
2578             later when the full Download is created. When this happens, dataTaskBecameDownloadTask()
2579             will tell the PendingDownload about the Download it has become. The PendingDownload
2580             will then relay the progress URL and sandbox extension to the Download.
2581
2582         * NetworkProcess/Downloads/DownloadManager.h:
2583         * NetworkProcess/Downloads/PendingDownload.cpp:
2584         (WebKit::PendingDownload::publishProgress):
2585             Store the progress info for later use, when the proper Download is created.
2586         (WebKit::PendingDownload::didBecomeDownload):
2587             If there was a progress URL provided earlier, tell the Download corresponding to this
2588             PendingDownload to publish its progress using that URL.
2589
2590         * NetworkProcess/Downloads/PendingDownload.h:
2591         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
2592         (WebKit::Download::platformDestroyDownload):
2593             When the Download is destroyed (i.e. when the download succeeds, fails, or is canceled),
2594             unpublish the progress, since there is no longer any activity to report.
2595         (WebKit::Download::publishProgress):
2596             Resolve the sandbox extension, create a progress configured to reflect the progress of
2597             this Download's NSURLSessionDownloadTask, and publish it at the given file URL.
2598
2599         * NetworkProcess/Downloads/cocoa/WKDownloadProgress.h: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKDownload.h.
2600         * NetworkProcess/Downloads/cocoa/WKDownloadProgress.mm: Added.
2601         (-[WKDownloadProgress initWithDownloadTask:download:URL:sandboxExtension:]):
2602             Configure this progress, start observing properties on the download task that this
2603             progress will reflect, and connect the cancellation handler of the progress to cancel
2604             the corresponding Download.
2605         (-[WKDownloadProgress publish]):
2606         (-[WKDownloadProgress unpublish]):
2607             Override these methods to consume and revoke the sandbox extension to make sure the
2608             process has access to the progress file while the progress will be published.
2609         (-[WKDownloadProgress dealloc]):
2610         (-[WKDownloadProgress observeValueForKeyPath:ofObject:change:context:]):
2611             When either byte count (number received, or number expected to receive) of the download
2612             task changes, update this progress to reflect that.
2613
2614         * NetworkProcess/NetworkProcess.cpp:
2615         (WebKit::NetworkProcess::publishDownloadProgress):
2616         * NetworkProcess/NetworkProcess.h:
2617         * NetworkProcess/NetworkProcess.messages.in:
2618
2619         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
2620         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
2621             Allow looking up the services that manages published NSProgresses.
2622
2623         * UIProcess/API/Cocoa/_WKDownload.h:
2624         * UIProcess/API/Cocoa/_WKDownload.mm:
2625         (-[_WKDownload publishProgressAtURL:]):
2626         * UIProcess/Downloads/DownloadProxy.cpp:
2627         (WebKit::DownloadProxy::publishProgress):
2628         * UIProcess/Downloads/DownloadProxy.h:
2629         * WebKit.xcodeproj/project.pbxproj:
2630
2631 2018-11-29  Tim Horton  <timothy_horton@apple.com>
2632
2633         Make drawing tools available when an editable image is focused
2634         https://bugs.webkit.org/show_bug.cgi?id=192172
2635         <rdar://problem/30337960>
2636
2637         Reviewed by Dean Jackson.
2638
2639         * Platform/spi/ios/PencilKitSPI.h:
2640         Add some more SPI.
2641
2642         * Shared/AssistedNodeInformation.cpp:
2643         (WebKit::AssistedNodeInformation::encode const):
2644         (WebKit::AssistedNodeInformation::decode):
2645         * Shared/AssistedNodeInformation.h:
2646         * WebProcess/WebPage/ios/WebPageIOS.mm:
2647         (WebKit::WebPage::handleStylusSingleTapAtPoint):
2648         (WebKit::isAssistableElement):
2649         (WebKit::WebPage::getAssistedNodeInformation):
2650         Plumb the assisted node's embedded view ID, if available.
2651         Also add a new input type for drawings, and use it when appropriate.
2652
2653         * SourcesCocoa.txt:
2654         * UIProcess/API/Cocoa/_WKFocusedElementInfo.h:
2655         Add WKInputTypeDrawing.
2656
2657         * UIProcess/ios/PencilKitSoftLink.h: Added.
2658         * UIProcess/ios/PencilKitSoftLink.mm: Added.
2659         Pull soft-linking out into its own file, to fix unified sources.
2660
2661         * UIProcess/ios/WKContentViewInteraction.mm:
2662         (-[WKFocusedElementInfo initWithAssistedNodeInformation:isUserInitiated:userObject:]):
2663         (-[WKContentView _requiresKeyboardWhenFirstResponder]):
2664         (-[WKContentView requiresAccessoryView]):
2665         Install a keyboard when a drawing is focused.
2666         Also, deduplicate one "curretUserInterfaceIdiomIsPad"; just fall through.
2667
2668         (-[WKContentView inputView]):
2669         Make a WKInkPickerControl when a drawing is focused.
2670
2671         (-[WKContentView textInputTraits]):
2672         (isAssistableInputType):
2673         * UIProcess/ios/WKDrawingView.h:
2674         * UIProcess/ios/WKDrawingView.mm:
2675         (-[WKDrawingView initWithEmbeddedViewID:webPageProxy:]):
2676         (-[WKDrawingView PNGRepresentation]):
2677         (-[WKDrawingView loadDrawingFromPNGRepresentation:]):
2678         Adopt PencilKitSoftLink.
2679
2680         (-[WKDrawingView canvasView]):
2681         Expose the internal canvas view for use by WKInkPickerControl.
2682
2683         * UIProcess/ios/WKInkPickerControl.h: Copied from Source/WebKit/Platform/spi/ios/PencilKitSPI.h.
2684         * UIProcess/ios/WKInkPickerControl.mm: Added.
2685         (-[WKInkPickerView initWithFrame:drawingView:]):
2686         (-[WKInkPickerView didPickInk]):
2687         (-[WKInkPickerView inlineInkPickerDidToggleRuler:]):
2688         (-[WKInkPickerView inlineInkPicker:didSelectTool:]):
2689         (-[WKInkPickerView inlineInkPicker:didSelectColor:]):
2690         (-[WKInkPickerView inkPickerSize]):
2691         (-[WKInkPickerView layoutSubviews]):
2692         (-[WKInkPickerView sizeThatFits:]):
2693         (-[WKInkPickerView viewControllerForPopoverPresentationFromInlineInkPicker:]):
2694         (-[WKInkPickerControl initWithDrawingView:]):
2695         (-[WKInkPickerControl beginEditing]):
2696         (-[WKInkPickerControl endEditing]):
2697         (-[WKInkPickerControl assistantView]):
2698         Install and hook up a PKInlineInkPicker.
2699         Center it in the keyboard.
2700         Plumb changes through to the canvas view.
2701
2702         * WebKit.xcodeproj/project.pbxproj:
2703
2704 2018-11-29  Per Arne Vollan  <pvollan@apple.com>
2705
2706         [macOS] Add logging for some sandbox entries.
2707         https://bugs.webkit.org/show_bug.cgi?id=192126
2708
2709         Reviewed by Brent Fulgham.
2710
2711         Add logging for sandbox entries which are possibly not needed.
2712
2713         * WebProcess/com.apple.WebProcess.sb.in:
2714
2715 2018-11-29  Alex Christensen  <achristensen@webkit.org>
2716
2717         Fix _WKWebsiteDataStoreConfiguration. sourceApplicationBundleIdentifier and sourceApplicationSecondaryIdentifier SPI introduced in r235127
2718         https://bugs.webkit.org/show_bug.cgi?id=192191
2719
2720         Reviewed by Andy Estes.
2721
2722         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2723         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
2724         When trying to adopt the new SPI and verify it worked, I found that the strings are not copied in one place where they should be.
2725
2726 2018-11-29  Megan Gardner  <megan_gardner@apple.com>
2727
2728         Move Lookup Code for better cross platform usage
2729         https://bugs.webkit.org/show_bug.cgi?id=191732
2730
2731         Reviewed by Alex Christensen.
2732
2733         Lookup is being replaced by Reveal. This framework should work on all platforms.
2734         The patch moves the code that we expect will be needed for all platforms to the more
2735         general cocoa area. This patch changes no funcationality, and should not change
2736         anything currently. This work will be build on later when Reveal is ready to support
2737         multiple platforms.
2738
2739         * Platform/spi/ios/UIKitSPI.h:
2740         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
2741         (WebKit::WebPageProxy::performDictionaryLookupAtLocation):
2742         (WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection):
2743         * UIProcess/ios/WKContentViewInteraction.h:
2744         * UIProcess/ios/WKContentViewInteraction.mm:
2745         (-[WKContentView setupInteraction]):
2746         (-[WKContentView cleanupInteraction]):
2747         (-[WKContentView _removeDefaultGestureRecognizers]):
2748         (-[WKContentView _addDefaultGestureRecognizers]):
2749         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
2750         (-[WKContentView _lookupGestureRecognized:]):
2751         * UIProcess/ios/WebPageProxyIOS.mm:
2752         (WebKit::WebPageProxy::performDictionaryLookupAtLocation): Deleted.
2753         * UIProcess/mac/WebPageProxyMac.mm:
2754         (WebKit::WebPageProxy::performDictionaryLookupAtLocation): Deleted.
2755         (WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection): Deleted.
2756         * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
2757         (WebKit::WebPage::performDictionaryLookupAtLocation):
2758         (WebKit::WebPage::performDictionaryLookupForSelection):
2759         (WebKit::WebPage::performDictionaryLookupOfCurrentSelection):
2760         (WebKit::WebPage::performDictionaryLookupForRange):
2761         (WebKit::WebPage::dictionaryPopupInfoForRange):
2762         * WebProcess/WebPage/WebPage.messages.in:
2763         * WebProcess/WebPage/ios/WebPageIOS.mm:
2764         (WebKit::WebPage::performDictionaryLookupAtLocation): Deleted.
2765         (WebKit::WebPage::performDictionaryLookupForSelection): Deleted.
2766         (WebKit::WebPage::performDictionaryLookupForRange): Deleted.
2767         * WebProcess/WebPage/mac/WebPageMac.mm:
2768         (WebKit::WebPage::performDictionaryLookupAtLocation): Deleted.
2769         (WebKit::WebPage::performDictionaryLookupForSelection): Deleted.
2770         (WebKit::WebPage::performDictionaryLookupOfCurrentSelection): Deleted.
2771         (WebKit::WebPage::dictionaryPopupInfoForRange): Deleted.
2772         (WebKit::WebPage::performDictionaryLookupForRange): Deleted.
2773
2774 2018-11-29  Zalan Bujtas  <zalan@apple.com>
2775
2776         [ContentObservation] Decouple content change and DOM timer scheduling observation
2777         https://bugs.webkit.org/show_bug.cgi?id=192170
2778
2779         Reviewed by Simon Fraser.
2780
2781         * WebProcess/WebPage/ios/WebPageIOS.mm:
2782         (WebKit::WebPage::handleSyntheticClick):
2783
2784 2018-11-29  Eric Carlson  <eric.carlson@apple.com>
2785
2786         [iOS] Tell AirPlay picker when a file has video
2787         https://bugs.webkit.org/show_bug.cgi?id=192155
2788         <rdar://problem/43843865>
2789
2790         Reviewed by Jer Noble.
2791
2792         * UIProcess/ios/WKContentViewInteraction.mm:
2793         (-[WKContentView _showPlaybackTargetPicker:fromRect:routeSharingPolicy:routingContextUID:]):
2794         Add hasVideo parameter.
2795
2796         * UIProcess/ios/forms/WKAirPlayRoutePicker.h:
2797         * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
2798         (-[WKAirPlayRoutePicker showFromView:routeSharingPolicy:routingContextUID:hasVideo:]): Add
2799         hasVideo parameter, pass info to MPMediaControlsViewController.
2800         (-[WKAirPlayRoutePicker showFromView:routeSharingPolicy:routingContextUID:]): Deleted.
2801
2802 2018-11-29  Alexey Proskuryakov  <ap@apple.com>
2803
2804         Modernize the check for kCFURLRequestContentDecoderSkipURLCheck existence
2805         https://bugs.webkit.org/show_bug.cgi?id=192041
2806
2807         Reviewed by Tim Horton.
2808
2809         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2810         (WebKit::NetworkDataTaskCocoa::applySniffingPoliciesAndBindRequestToInferfaceIfNeeded):
2811
2812 2018-11-29  Ryan Haddad  <ryanhaddad@apple.com>
2813
2814         Unreviewed, rolling out r238678.
2815
2816         Breaks internal builds.
2817
2818         Reverted changeset:
2819
2820         "Move Lookup Code for better cross platform usage"
2821         https://bugs.webkit.org/show_bug.cgi?id=191732
2822         https://trac.webkit.org/changeset/238678
2823
2824 2018-11-29  Suresh Koppisetty  <skoppisetty@apple.com>
2825
2826         Addressed a FIXME by removing an unnecessary call to [NSApplication sharedApplication].
2827         https://bugs.webkit.org/show_bug.cgi?id=192099
2828
2829         Reviewed by Geoffrey Garen.
2830
2831         [NSApplication sharedApplication] call is no longer needed in platformInitializeWebProcess as [NSApplication _accessibilityInitialize] calls [NSApplication sharedApplication].
2832
2833         * WebProcess/cocoa/WebProcessCocoa.mm:
2834         (WebKit::WebProcess::platformInitializeWebProcess):
2835
2836 2018-11-29  Megan Gardner  <megan_gardner@apple.com>
2837
2838         Move Lookup Code for better cross platform usage
2839         https://bugs.webkit.org/show_bug.cgi?id=191732
2840
2841         Reviewed by Alex Christensen.
2842
2843         Lookup is being replaced by Reveal. This framework should work on all platforms.
2844         The patch moves the code that we expect will be needed for all platforms to the more
2845         general cocoa area. This patch changes no funcationality, and should not change
2846         anything currently. This work will be build on later when Reveal is ready to support
2847         multiple platforms.
2848
2849         * Platform/spi/ios/UIKitSPI.h:
2850         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
2851         (WebKit::WebPageProxy::performDictionaryLookupAtLocation):
2852         (WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection):
2853         * UIProcess/ios/WKContentViewInteraction.h:
2854         * UIProcess/ios/WKContentViewInteraction.mm:
2855         (-[WKContentView setupInteraction]):
2856         (-[WKContentView cleanupInteraction]):
2857         (-[WKContentView _removeDefaultGestureRecognizers]):
2858         (-[WKContentView _addDefaultGestureRecognizers]):
2859         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
2860         (-[WKContentView _lookupGestureRecognized:]):
2861         * UIProcess/ios/WebPageProxyIOS.mm:
2862         (WebKit::WebPageProxy::performDictionaryLookupAtLocation): Deleted.
2863         * UIProcess/mac/WebPageProxyMac.mm:
2864         (WebKit::WebPageProxy::performDictionaryLookupAtLocation): Deleted.
2865         (WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection): Deleted.
2866         * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
2867         (WebKit::WebPage::performDictionaryLookupAtLocation):
2868         (WebKit::WebPage::performDictionaryLookupForSelection):
2869         (WebKit::WebPage::performDictionaryLookupOfCurrentSelection):
2870         (WebKit::WebPage::performDictionaryLookupForRange):
2871         (WebKit::WebPage::dictionaryPopupInfoForRange):
2872         * WebProcess/WebPage/WebPage.messages.in:
2873         * WebProcess/WebPage/ios/WebPageIOS.mm:
2874         (WebKit::WebPage::performDictionaryLookupAtLocation): Deleted.
2875         (WebKit::WebPage::performDictionaryLookupForSelection): Deleted.
2876         (WebKit::WebPage::performDictionaryLookupForRange): Deleted.
2877         * WebProcess/WebPage/mac/WebPageMac.mm:
2878         (WebKit::WebPage::performDictionaryLookupAtLocation): Deleted.
2879         (WebKit::WebPage::performDictionaryLookupForSelection): Deleted.
2880         (WebKit::WebPage::performDictionaryLookupOfCurrentSelection): Deleted.
2881         (WebKit::WebPage::dictionaryPopupInfoForRange): Deleted.
2882         (WebKit::WebPage::performDictionaryLookupForRange): Deleted.
2883
2884 2018-11-29  Conrad Shultz  <conrad_shultz@apple.com>
2885
2886         Factor out configuration of the file upload image picker
2887         https://bugs.webkit.org/show_bug.cgi?id=192138
2888         <rdar://problem/46334871>
2889
2890         Reviewed by Tim Horton.
2891
2892         By factoring configuration of the picker into its own method, it makes it easier
2893         to apply custom configuration in subclasses in the future.
2894
2895         * UIProcess/ios/forms/WKFileUploadPanel.mm:
2896         (-[WKFileUploadPanel _showPhotoPickerWithSourceType:]):
2897         (-[WKFileUploadPanel _configureImagePicker:]):
2898
2899 2018-11-29  Tomas Popela  <tpopela@redhat.com>
2900
2901         [GTK][WPE] Fix BubblewrapLauncher clang warnings
2902         https://bugs.webkit.org/show_bug.cgi?id=192086
2903
2904         Reviewed by Michael Catanzaro.
2905
2906         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
2907         (WebKit::bindPathVar): Initialize the i variable to 0.
2908         (WebKit::setupSeccomp): Initialize the optional datum_b member.
2909
2910 2018-11-28  Joseph Pecoraro  <pecoraro@apple.com>
2911
2912         Web Inspector: REGRESSION(?): all "Show *" develop menu items cause the page to crash
2913         https://bugs.webkit.org/show_bug.cgi?id=192016
2914         <rdar://problem/46284417>
2915
2916         Reviewed by Devin Rousso.
2917
2918         Previously calling the Page's inspectorController.show()
2919         would create a frontend connection on the WebProcess side.
2920         However now the frontend connection is handed to the WebProcess
2921         once the UIProcess creates it. So queue actions that take place
2922         immediately after showing the inspector until we have a frontend
2923         to send the actions to.
2924
2925         * WebProcess/WebPage/WebInspector.h:
2926         * WebProcess/WebPage/WebInspector.cpp:
2927         (WebKit::WebInspector::setFrontendConnection):
2928         (WebKit::WebInspector::closeFrontendConnection):
2929         (WebKit::WebInspector::whenFrontendConnectionEstablished):
2930         (WebKit::WebInspector::showConsole):
2931         (WebKit::WebInspector::showResources):
2932         (WebKit::WebInspector::showTimelines):
2933         (WebKit::WebInspector::showMainResourceForFrame):
2934         (WebKit::WebInspector::startPageProfiling):
2935         (WebKit::WebInspector::stopPageProfiling):
2936         (WebKit::WebInspector::startElementSelection):
2937         (WebKit::WebInspector::stopElementSelection):
2938
2939 2018-11-28  Vivek Seth  <v_seth@apple.com>
2940
2941         Consult dummy storage for HTTPS Upgrade, Apply If Appropriate
2942         https://bugs.webkit.org/show_bug.cgi?id=192094
2943         <rdar://problem/45851103> HTTPS Upgrade: Consult dummy storage for HTTPS Upgrade, Apply If Appropriate
2944
2945         Reviewed by Chris Dumez.
2946
2947         For main page loads upgrade HTTP requests to HTTPS if the hostname belongs to a set of upgradable hostnames.
2948
2949         * NetworkProcess/NetworkLoadChecker.cpp:
2950         (WebKit::NetworkLoadChecker::applyHTTPSUpgradeIfNeeded):
2951         (WebKit::NetworkLoadChecker::checkRequest):
2952         * NetworkProcess/NetworkLoadChecker.h:
2953         * NetworkProcess/NetworkResourceLoader.cpp:
2954         (WebKit::NetworkResourceLoader::start):
2955
2956 2018-11-28  Simon Fraser  <simon.fraser@apple.com>
2957
2958         REGRESSION (r234980): Crash in -[WKWebView _restorePageStateToUnobscuredCenter:scale:]
2959         https://bugs.webkit.org/show_bug.cgi?id=192127
2960         rdar://problem/44194179
2961
2962         Reviewed by Tim Horton.
2963         
2964         _restorePageStateToUnobscuredCenter: could receive an Optional<FloatRect> from the
2965         web process, and unconditionally called .value() even though it may not be engaged.
2966         
2967         No repro steps known, so no testcase.
2968
2969         * UIProcess/API/Cocoa/WKWebView.mm:
2970         (-[WKWebView _restorePageStateToUnobscuredCenter:scale:]):
2971
2972 2018-11-28  Commit Queue  <commit-queue@webkit.org>
2973
2974         Unreviewed, rolling out r238653 and r238656.
2975         https://bugs.webkit.org/show_bug.cgi?id=192130
2976
2977         Breaks iOS build (Requested by smfr on #webkit).
2978
2979         Reverted changesets:
2980
2981         "Move Lookup Code for better cross platform usage"
2982         https://bugs.webkit.org/show_bug.cgi?id=191732
2983         https://trac.webkit.org/changeset/238653
2984
2985         "Attempt to fix the iOS build by only including RevealSPI.h
2986         when it's needed."
2987         https://trac.webkit.org/changeset/238656
2988
2989 2018-11-28  Alex Christensen  <achristensen@webkit.org>
2990
2991         Modernize BlobRegistry::writeBlobsToTemporaryFiles
2992         https://bugs.webkit.org/show_bug.cgi?id=192117
2993
2994         Reviewed by Dean Jackson.
2995
2996         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
2997         (WebKit::NetworkBlobRegistry::writeBlobsToTemporaryFiles):
2998         (WebKit::NetworkBlobRegistry::writeBlobToFilePath):
2999         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
3000         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3001         (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
3002         * NetworkProcess/NetworkConnectionToWebProcess.h:
3003         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
3004         * NetworkProcess/NetworkProcess.cpp:
3005         (WebKit::NetworkProcess::writeBlobToFilePath):
3006         * NetworkProcess/NetworkProcess.h:
3007         * NetworkProcess/NetworkProcess.messages.in:
3008         * UIProcess/ChildProcessProxy.h:
3009         (WebKit::ChildProcessProxy::sendWithAsyncReply):
3010         * UIProcess/Network/NetworkProcessProxy.cpp:
3011         (WebKit::NetworkProcessProxy::didClose):
3012         (WebKit::NetworkProcessProxy::writeBlobToFilePath):
3013         (WebKit::NetworkProcessProxy::didWriteBlobToFilePath): Deleted.
3014         * UIProcess/Network/NetworkProcessProxy.h:
3015         * UIProcess/Network/NetworkProcessProxy.messages.in:
3016         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
3017         (WebKit::BlobRegistryProxy::writeBlobsToTemporaryFiles):
3018         * WebProcess/FileAPI/BlobRegistryProxy.h:
3019         * WebProcess/Network/NetworkProcessConnection.cpp:
3020         (WebKit::NetworkProcessConnection::didClose):
3021         (WebKit::NetworkProcessConnection::writeBlobsToTemporaryFiles):
3022         (WebKit::NetworkProcessConnection::didWriteBlobsToTemporaryFiles): Deleted.
3023         * WebProcess/Network/NetworkProcessConnection.h:
3024         * WebProcess/Network/NetworkProcessConnection.messages.in:
3025
3026 2018-11-28  Alex Christensen  <achristensen@webkit.org>
3027
3028         Move loadThrottleLatency from NetworkProcessCreationParameters to NetworkSessionCreationParameters
3029         https://bugs.webkit.org/show_bug.cgi?id=192122
3030
3031         Reviewed by Dean Jackson.
3032
3033         This is part of an effort to reduce global variables in the NetworkProcess.
3034
3035         * NetworkProcess/NetworkLoad.cpp:
3036         (WebKit::NetworkLoad::NetworkLoad):
3037         (WebKit::NetworkLoad::didReceiveResponse):
3038         * NetworkProcess/NetworkLoad.h:
3039         * NetworkProcess/NetworkProcess.cpp:
3040         (WebKit::NetworkProcess::initializeNetworkProcess):
3041         * NetworkProcess/NetworkProcess.h:
3042         (WebKit::NetworkProcess::loadThrottleLatency const): Deleted.
3043         * NetworkProcess/NetworkProcessCreationParameters.cpp:
3044         (WebKit::NetworkProcessCreationParameters::encode const):
3045         (WebKit::NetworkProcessCreationParameters::decode):
3046         * NetworkProcess/NetworkSession.h:
3047         (WebKit::NetworkSession::loadThrottleLatency const):
3048         * NetworkProcess/NetworkSessionCreationParameters.cpp: Added.
3049         (WebKit::NetworkSessionCreationParameters::privateSessionParameters):
3050         (WebKit::NetworkSessionCreationParameters::encode const):
3051         (WebKit::NetworkSessionCreationParameters::decode):
3052         * NetworkProcess/NetworkSessionCreationParameters.h:
3053         (WebKit::NetworkSessionCreationParameters::encode const): Deleted.
3054         (WebKit::NetworkSessionCreationParameters::decode): Deleted.
3055         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
3056         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3057         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
3058         * Shared/WebsiteDataStoreParameters.cpp:
3059         (WebKit::WebsiteDataStoreParameters::privateSessionParameters):
3060         * Sources.txt:
3061         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3062         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
3063         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
3064         (WebKit::WebsiteDataStore::parameters):
3065         * WebKit.xcodeproj/project.pbxproj:
3066
3067 2018-11-15  Megan Gardner  <megan_gardner@apple.com>
3068
3069         Move Lookup Code for better cross platform usage
3070         https://bugs.webkit.org/show_bug.cgi?id=191732
3071
3072         Reviewed by Alex Christensen.
3073
3074         Lookup is being replaced by Reveal. This framework should work on all platforms.
3075         The patch moves the code that we expect will be needed for all platforms to the more
3076         general cocoa area. This patch changes no funcationality, and should not change
3077         anything currently. This work will be build on later when Reveal is ready to support
3078         multiple platforms.
3079
3080         * Platform/spi/ios/UIKitSPI.h:
3081         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
3082         (WebKit::WebPageProxy::performDictionaryLookupAtLocation):
3083         (WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection):
3084         * UIProcess/ios/WKContentViewInteraction.h:
3085         * UIProcess/ios/WKContentViewInteraction.mm:
3086         (-[WKContentView setupInteraction]):
3087         (-[WKContentView cleanupInteraction]):
3088         (-[WKContentView _removeDefaultGestureRecognizers]):
3089         (-[WKContentView _addDefaultGestureRecognizers]):
3090         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
3091         (-[WKContentView _lookupGestureRecognized:]):
3092         * UIProcess/ios/WebPageProxyIOS.mm:
3093         (WebKit::WebPageProxy::performDictionaryLookupAtLocation): Deleted.
3094         * UIProcess/mac/WebPageProxyMac.mm:
3095         (WebKit::WebPageProxy::performDictionaryLookupAtLocation): Deleted.
3096         (WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection): Deleted.
3097         * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
3098         (WebKit::WebPage::performDictionaryLookupAtLocation):
3099         (WebKit::WebPage::performDictionaryLookupForSelection):
3100         (WebKit::WebPage::performDictionaryLookupOfCurrentSelection):
3101         (WebKit::WebPage::performDictionaryLookupForRange):
3102         (WebKit::WebPage::dictionaryPopupInfoForRange):
3103         * WebProcess/WebPage/WebPage.messages.in:
3104         * WebProcess/WebPage/ios/WebPageIOS.mm:
3105         (WebKit::WebPage::performDictionaryLookupAtLocation): Deleted.
3106         (WebKit::WebPage::performDictionaryLookupForSelection): Deleted.
3107         (WebKit::WebPage::performDictionaryLookupForRange): Deleted.
3108         * WebProcess/WebPage/mac/WebPageMac.mm:
3109         (WebKit::WebPage::performDictionaryLookupAtLocation): Deleted.
3110         (WebKit::WebPage::performDictionaryLookupForSelection): Deleted.
3111         (WebKit::WebPage::performDictionaryLookupOfCurrentSelection): Deleted.
3112         (WebKit::WebPage::dictionaryPopupInfoForRange): Deleted.
3113         (WebKit::WebPage::performDictionaryLookupForRange): Deleted.
3114
3115 2018-11-28  Keith Rollin  <krollin@apple.com>
3116
3117         Update generate-{derived,unified}-sources scripts to support generating .xcfilelist files
3118         https://bugs.webkit.org/show_bug.cgi?id=192031
3119         <rdar://problem/46286816>
3120
3121         Reviewed by Alex Christensen.
3122
3123         The Generate Derived Sources and Generate Unified Sources build phases
3124         in Xcode need to have their inputs and outputs specified. This
3125         specification will come in the form of .xcfilelist files that will be
3126         attached to these build phases. There is one .xcfilelist file that
3127         lists the input file and one that lists the output files. As part of
3128         this work, the various generate-{derived,unified}-sources scripts that
3129         are executed in these Generate build phases are modified to help in
3130         the creation of these .xcfilelist files. In particular, they can now
3131         be invoked with command-line parameters. These parameters are then
3132         used to alter the normal execution of these scripts, causing them to
3133         produce the .xcfilelist files as opposed to actually generating the
3134         files that are listed in those files.
3135
3136         * Scripts/generate-derived-sources.sh:
3137         * Scripts/generate-unified-sources.sh:
3138
3139 2018-11-28  Keith Rollin  <krollin@apple.com>
3140
3141         Revert print_all_generated_files work in r238008; tighten up target specifications
3142         https://bugs.webkit.org/show_bug.cgi?id=192025
3143         <rdar://problem/46284301>
3144
3145         Reviewed by Alex Christensen.
3146
3147         In r238008, I added a facility for DerivedSources.make makefiles to
3148         print out the list of files that they generate. This output was used
3149         in the generation of .xcfilelist files used to specify the output of
3150         the associated Generate Derived Sources build phases in Xcode. This
3151         approach worked, but it meant that people would need to follow a
3152         specific convention to keep this mechanism working.
3153
3154         Instead of continuing this approach, I'm going to implement a new
3155         facility based on the output of `make` when passed the -d flag (which
3156         prints dependency information). This new mechanism is completely
3157         automatic and doesn't need maintainers to follow a convention. To that
3158         end, remove most of the work performed in r238008 that supports the
3159         print_all_generated_files target.
3160
3161         At the same time, it's important for the sets of targets and their
3162         dependencies to be complete and correct. Therefore, also include
3163         changes to bring those up-to-date. As part of that, you'll see
3164         prevalent use of a particular technique. Here's an example:
3165
3166             BYTECODE_FILES = \
3167                 Bytecodes.h \
3168                 BytecodeIndices.h \
3169                 BytecodeStructs.h \
3170                 InitBytecodes.asm \
3171             #
3172             BYTECODE_FILES_PATTERNS = $(subst .,%,$(BYTECODE_FILES))
3173
3174             all : $(BYTECODE_FILES)
3175
3176             $(BYTECODE_FILES_PATTERNS): $(wildcard $(JavaScriptCore)/generator/*.rb) $(JavaScriptCore)/bytecode/BytecodeList.rb
3177                 ...
3178
3179         These lines indicate a set of generated files (those specified in
3180         BYTECODE_FILES). These files are generated by the BytecodeList.rb
3181         tool. But, as opposed to the normal rule where a single foo.output is
3182         generated by foo.input plus some additional dependencies, this rule
3183         produces multiple output files from a tool whose connection to the
3184         output files is not immediately clear. A special approach is needed
3185         where a single rule produces multiple output files. The normal way to
3186         implement this is to use an .INTERMEDIATE target. However, we used
3187         this approach in the past and ran into a problem with it, addressing
3188         it with an alternate approach in r210507. The above example shows this
3189         approach. The .'s in the list of target files are replaced with %'s,
3190         and the result is used as the left side of the dependency rule.
3191
3192         * DerivedSources.make:
3193
3194 2018-11-28  Daniel Bates  <dabates@apple.com>
3195
3196         [iOS] Page not defocused when Find-in-page becomes first responder
3197         https://bugs.webkit.org/show_bug.cgi?id=192084
3198         <rdar://problem/46146777>
3199
3200         Reviewed by Tim Horton.
3201
3202         When -becomeFirstResponder and -resignFirstResponder is called the page should become focused
3203         and defocused, respectively. WebKit adjusts it behavior depending on whether it knows it has
3204         focus. This includes decisions about whether to allow an element to be focused. We need to
3205         ensure that WebKit knows whether the web view is focused for it to make good decisions.
3206
3207         * UIProcess/ios/PageClientImplIOS.mm:
3208         (WebKit::PageClientImpl::isViewFocused): Check if the content view is the first responder and
3209         hence is accepting keyboard input. Note that picture-in-picture views do not accept keyboard
3210         input.
3211         * UIProcess/ios/WKContentViewInteraction.mm:
3212         (-[WKContentView becomeFirstResponderForWebView]): Update activity state when the view
3213         becomes focused.
3214         (-[WKContentView resignFirstResponderForWebView]): Update activity state when the view
3215         becomes defocused.
3216
3217 2018-11-28  Alex Christensen  <achristensen@webkit.org>
3218
3219         Remove dead code from an earlier attempt at implementing safe browsing
3220         https://bugs.webkit.org/show_bug.cgi?id=192067
3221
3222         Reviewed by Chris Dumez.
3223
3224         * Shared/LoadParameters.cpp:
3225         (WebKit::LoadParameters::encode const):
3226         (WebKit::LoadParameters::decode):
3227         * Shared/LoadParameters.h:
3228         * UIProcess/WebPageProxy.cpp:
3229         (WebKit::WebPageProxy::loadAlternateHTML):
3230         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
3231         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
3232         (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
3233         * UIProcess/WebPageProxy.h:
3234         * UIProcess/WebPageProxy.messages.in:
3235         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3236         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
3237         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
3238
3239 2018-11-28  Alex Christensen  <achristensen@webkit.org>
3240
3241         Move logCookieInformation bool from NetworkProcess to NetworkSession
3242         https://bugs.webkit.org/show_bug.cgi?id=192049
3243
3244         Reviewed by Chris Dumez.
3245
3246         Part of an effort to remove globals in the NetworkProcess.
3247
3248         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3249         (WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
3250         (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
3251         * NetworkProcess/NetworkProcess.cpp:
3252         (WebKit::NetworkProcess::initializeNetworkProcess):
3253         * NetworkProcess/NetworkProcess.h:
3254         (WebKit::NetworkProcess::shouldLogCookieInformation const): Deleted.
3255         * NetworkProcess/NetworkProcessCreationParameters.cpp:
3256         (WebKit::NetworkProcessCreationParameters::encode const):
3257         (WebKit::NetworkProcessCreationParameters::decode):
3258         * NetworkProcess/NetworkProcessCreationParameters.h:
3259         * NetworkProcess/NetworkResourceLoader.cpp:
3260         (WebKit::NetworkResourceLoader::didFinishLoading):
3261         (WebKit::NetworkResourceLoader::sendResultForCacheEntry):
3262         (WebKit::NetworkResourceLoader::shouldLogCookieInformation):
3263         (WebKit::NetworkResourceLoader::logCookieInformation const):
3264         (WebKit::logBlockedCookieInformation):
3265         (WebKit::logCookieInformationInternal):
3266         (WebKit::NetworkResourceLoader::logCookieInformation):
3267         * NetworkProcess/NetworkResourceLoader.h:
3268         * NetworkProcess/NetworkSession.h:
3269         (WebKit::NetworkSession::logCookieInformation const):
3270         * NetworkProcess/NetworkSessionCreationParameters.h:
3271         (WebKit::NetworkSessionCreationParameters::encode const):
3272         (WebKit::NetworkSessionCreationParameters::decode):
3273         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
3274         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
3275         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
3276         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
3277         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3278         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
3279         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3280         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
3281         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
3282         (WebKit::WebsiteDataStore::parameters):
3283
3284 2018-11-28  Ryan Haddad  <ryanhaddad@apple.com>
3285
3286         Unreviewed, rolling out r238620.
3287
3288         Broke internal builds again.
3289
3290         Reverted changeset:
3291
3292         "Remove @no-unify of InjectedBundleRangeHandle.cpp and
3293         InjectedBundleNodeHandle.cpp"
3294         https://bugs.webkit.org/show_bug.cgi?id=191853
3295         https://trac.webkit.org/changeset/238620
3296
3297 2018-11-28  Yongjun Zhang  <yongjun_zhang@apple.com>
3298
3299         Allow WebKit clients to specify a minimum effective width for layout.
3300         https://bugs.webkit.org/show_bug.cgi?id=191499
3301         <rdar://problem/45362678>
3302
3303         Reviewed by Wenson Hsieh.
3304
3305         If we ignore the meta viewport (_shouldIgnoreMetaViewport is true), the default layout width will be device
3306         width. For clients that wish to lay out the content with a different width value, we would need to add a way
3307         to specify the effective width for layout.
3308
3309         * UIProcess/API/Cocoa/WKWebView.mm: Add an iVar _minimumEffectiveDeviceWidth.
3310         (-[WKWebView _dispatchSetViewLayoutSize:]): Call the new setViewportConfigurationViewLayoutSize method.
3311         (-[WKWebView _setViewScale:]): Ditto.
3312         (-[WKWebView _setMinimumEffectiveWidth:]): The setter for _minimumEffectiveDeviceWidth.
3313         (-[WKWebView _minimumEffectiveWidth]): Getter for _minimumEffectiveDeviceWidth
3314         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Add a property _minimumEffectiveDeviceWidth to WKWebView.
3315         * UIProcess/WebPageProxy.h: Change setViewportConfigurationViewLayoutSize to take another argument minimumEffectiveDeviceWidth.
3316         * UIProcess/ios/WebPageProxyIOS.mm:
3317         (WebKit::WebPageProxy::setViewportConfigurationViewLayoutSize): Also send effectiveWidth to WebContent process.
3318         * WebProcess/WebPage/WebPage.cpp:
3319         (WebKit::WebPage::WebPage): Set the initial effective width to 0 when creating a web page, this tells ViewportConfiguration
3320              to ignore the minimum effective width value.
3321         * WebProcess/WebPage/WebPage.h: Change setViewportConfigurationViewLayoutSize to take another argument effectiveWidth.
3322         * WebProcess/WebPage/WebPage.messages.in:
3323         * WebProcess/WebPage/ios/WebPageIOS.mm:
3324         (WebKit::WebPage::setViewportConfigurationViewLayoutSize): Also pass effectiveWidth value to ViewportConfiguration.
3325
3326 2018-11-28  Fujii Hironori  <Hironori.Fujii@sony.com>
3327
3328         Remove @no-unify of InjectedBundleRangeHandle.cpp and InjectedBundleNodeHandle.cpp
3329         https://bugs.webkit.org/show_bug.cgi?id=191853
3330
3331         Reviewed by Michael Catanzaro.
3332
3333         In r235845, I excluded InjectedBundleRangeHandle.cpp and
3334         InjectedBundleNodeHandle.cpp from unify source builds in order to
3335         work around a MSVC bug.
3336
3337         Then, I commited a different workaround for the MSVC bug in
3338         r238386. Now, we can include InjectedBundleRangeHandle.cpp and
3339         InjectedBundleNodeHandle.cpp in unified source builds. Revert
3340         r235845.
3341
3342         * Sources.txt: Removed @no-unify of InjectedBundleRangeHandle.cpp
3343         and InjectedBundleNodeHandle.cpp
3344         * WebKit.xcodeproj/project.pbxproj: Unchecked Target Membership
3345         not to be compiled by XCode.
3346
3347 2018-11-28  Joseph Pecoraro  <pecoraro@apple.com>
3348
3349         Web Inspector: REGRESSION(r238378): reloading WebInspector after a settings change doesn't re-show WebInspector
3350         https://bugs.webkit.org/show_bug.cgi?id=191971
3351
3352         Reviewed by Matt Baker.
3353
3354         * WebProcess/WebPage/WebInspector.cpp:
3355         (WebKit::WebInspector::reopen): Deleted.
3356         * WebProcess/WebPage/WebInspector.h:
3357         * WebProcess/WebPage/WebInspector.messages.in:
3358         Move reopen out of the WebProcess...
3359
3360         * UIProcess/WebInspectorProxy.cpp:
3361         (WebKit::WebInspectorProxy::reopen):
3362         * UIProcess/WebInspectorProxy.h:
3363         * UIProcess/WebInspectorProxy.messages.in:
3364         And into the UIProcess where the order of messages won't
3365         be as problematic.
3366
3367         * WebProcess/WebPage/WebInspectorUI.cpp:
3368         (WebKit::WebInspectorUI::reopen):
3369         Send a message to the WebInspectorProxy instead.
3370
3371 2018-11-28  Alexey Proskuryakov  <ap@apple.com>
3372
3373         Remove another OS version check from NetworkDataTaskCocoa.mm
3374         https://bugs.webkit.org/show_bug.cgi?id=192046
3375
3376         Reviewed by Alex Christensen.
3377
3378         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
3379         (WebKit::NetworkDataTaskCocoa::statelessCookieStorage):
3380
3381 2018-11-28  Alexey Proskuryakov  <ap@apple.com>
3382
3383         Modernize version checks for same site cookie support
3384         https://bugs.webkit.org/show_bug.cgi?id=192054
3385
3386         Reviewed by Tim Horton.
3387
3388         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::updateTaskWithFirstPartyForSameSiteCookies):
3389         Also removed runtime checks, which are no longer relevant.
3390
3391 2018-11-27  Mark Lam  <mark.lam@apple.com>
3392
3393         ENABLE_FAST_JIT_PERMISSIONS should be false for iosmac.
3394         https://bugs.webkit.org/show_bug.cgi?id=192055
3395         <rdar://problem/46288783>
3396
3397         Reviewed by Saam Barati.
3398
3399         * Configurations/FeatureDefines.xcconfig:
3400
3401 2018-11-27  Alex Christensen  <achristensen@webkit.org>
3402
3403         Make synchronous IPC introduced in r237267 asynchronous
3404         https://bugs.webkit.org/show_bug.cgi?id=190757
3405
3406         Reviewed by Chris Dumez.
3407
3408         * UIProcess/API/Cocoa/WKProcessPool.mm:
3409         (-[WKProcessPool _getActivePagesOriginsInWebProcessForTesting:completionHandler:]):
3410         (-[WKProcessPool _getActivePagesOriginsInWebProcessForTesting:]): Deleted.
3411         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
3412         * UIProcess/WebProcessPool.cpp:
3413         (WebKit::WebProcessPool::activePagesOriginsInWebProcessForTesting):
3414         * UIProcess/WebProcessPool.h:
3415         * UIProcess/WebProcessProxy.cpp:
3416         (WebKit::WebProcessProxy::activePagesDomainsForTesting):
3417         * UIProcess/WebProcessProxy.h:
3418         * WebProcess/WebProcess.cpp:
3419         (WebKit::WebProcess::getActivePagesOriginsForTesting):
3420         * WebProcess/WebProcess.messages.in:
3421         * WebProcess/cocoa/WebProcessCocoa.mm:
3422         (WebKit::WebProcess::getActivePagesOriginsForTesting):
3423
3424 2018-11-27  Alex Christensen  <achristensen@webkit.org>
3425
3426         Safe browsing warning text needs to be visible on High Sierra
3427         https://bugs.webkit.org/show_bug.cgi?id=192022
3428
3429         Reviewed by Tim Horton.
3430
3431         Something about AppKit, autolayout, view insertion order, and NSTextView makes the text lay
3432         out with initial size of {0, 0} on High Sierra. Using an NSTextField instead makes the details visible.
3433
3434         Covered by an API test.
3435
3436         * UIProcess/Cocoa/WKSafeBrowsingWarning.h:
3437         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
3438         (makeLabel):
3439         (-[WKSafeBrowsingWarning addContent]):
3440         (-[WKSafeBrowsingWarning showDetailsClicked]):
3441         (-[WKSafeBrowsingWarning layoutText]):
3442         (makeTitleLabel): Deleted.
3443
3444 2018-11-27  Tim Horton  <timothy_horton@apple.com>
3445
3446         WKNavigation.AutomaticViewReloadAfterWebProcessCrash asserts after r238538
3447         https://bugs.webkit.org/show_bug.cgi?id=192038
3448         <rdar://problem/46288457>
3449
3450         Reviewed by Wenson Hsieh.
3451
3452         * UIProcess/WebPageProxy.cpp:
3453         (WebKit::m_resetRecentCrashCountTimer):
3454         (WebKit::WebPageProxy::finishAttachingToWebProcess):
3455         (WebKit::WebPageProxy::resetState):
3456         (WebKit::m_editableImageController): Deleted.
3457         Properly invalidate m_editableImageController when resetting WebPageProxy.
3458         Otherwise, the MessageReceiverMaps get invalidated, then later when
3459         EditableImageController goes away we assert trying to remove the receiver.
3460
3461 2018-11-27  Jiewen Tan  <jiewen_tan@apple.com>
3462
3463         (r238246) [ MacOS Debug ] Layout Test http/wpt/webauthn/ctap-hid-failure.https.html is Crashing
3464         https://bugs.webkit.org/show_bug.cgi?id=191757
3465
3466         Reviewed by Chris Dumez.
3467
3468         Wrong nonce error causes retransmission, which then trigger wrong nonce error. This is expected
3469         behavior for mock testing. However, the main thread could time out when MockHidConnection::send
3470         is excuting the block on another thread. The block will then return without invoking the callback,
3471         which triggers this WTFCrash. The solution is always invoking the callback before return in the
3472         block.
3473
3474         * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
3475         (WebKit::MockHidConnection::send):
3476
3477 2018-11-27  Keith Rollin  <krollin@apple.com>
3478
3479         Better parsing of comments in generate-message*.py
3480         https://bugs.webkit.org/show_bug.cgi?id=191866
3481         <rdar://problem/46189563>
3482
3483         Reviewed by Chris Dumez.
3484
3485         The script parsing the *.messages.in files would treat a line starting
3486         with '#' as a comment, but not a line starting with '<whitespace>#'.
3487         This means that jamming a '#' right in front of the first character of
3488         a message definition (as opposed to the beginning of a line) will have
3489         no effect and the line will get treated just the same as a
3490         non-commented line. Fix this by trimming all white space from the
3491         beginning and ending of the line before processing it.
3492
3493         * Scripts/webkit/parser.py:
3494         (parse):
3495         * Scripts/webkit/test-messages.in:
3496
3497 2018-11-27  Thibault Saunier  <tsaunier@igalia.com>
3498
3499         [GTK|WPE] Allow disabling WebRTC unified plan SDP through an env var
3500         https://bugs.webkit.org/show_bug.cgi?id=192024
3501
3502         Reviewed by Michael Catanzaro.
3503
3504         * UIProcess/API/glib/WebKitSettings.cpp:
3505         (webKitSettingsConstructed):
3506
3507 2018-11-27  Alexey Proskuryakov  <ap@apple.com>
3508
3509         Modernize the check for async _saveCookies existence
3510         https://bugs.webkit.org/show_bug.cgi?id=191987
3511
3512         Reviewed by Dean Jackson.
3513
3514         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3515         (WebKit::NetworkProcess::platformSyncAllCookies):
3516
3517 2018-11-27  Tim Horton  <timothy_horton@apple.com>
3518
3519         Serialize and deserialize editable image strokes
3520         https://bugs.webkit.org/show_bug.cgi?id=192002
3521         <rdar://problem/30900149>
3522
3523         Reviewed by Dean Jackson.
3524
3525         * UIProcess/API/APIAttachment.cpp:
3526         (API::Attachment::updateAttributes):
3527         * UIProcess/WebPageProxy.cpp:
3528         (WebKit::WebPageProxy::willUpdateAttachmentAttributes):
3529         * UIProcess/WebPageProxy.h:
3530         When an attachment would update its DOM attributes, plumb a notification
3531         to EditableImageController, and allow it to block the update (because
3532         we don't really want to set src for editable image attachments,
3533         we just want the UI process to fully own the data).
3534
3535         * Platform/spi/ios/PencilKitSPI.h:
3536         Add some SPI.
3537
3538         * UIProcess/ios/EditableImageController.h:
3539         * UIProcess/ios/EditableImageController.mm:
3540         (WebKit::EditableImageController::loadStrokesFromAttachment):
3541         Add a helper to load strokes from an attachment.
3542
3543         (WebKit::EditableImageController::associateWithAttachment):
3544         Try to load strokes from the attachment when initially associated.
3545         Don't create a file wrapper around a null image, so it will be regenerated later.
3546
3547         (WebKit::EditableImageController::willUpdateAttachmentAttributes):
3548         The aforementioned plumbing at update time.
3549
3550         * UIProcess/ios/WKDrawingView.h:
3551         * UIProcess/ios/WKDrawingView.mm:
3552         (-[WKDrawingView layoutSubviews]):
3553         Invalidate the attachment (so it will be regenerated upon request) if the
3554         canvas size changes.
3555
3556         (-[WKDrawingView PNGRepresentation]):
3557         Serialize strokes into the EXIF User Comment field.
3558         We will find a different field to use (ideally a custom vendor-specific
3559         field that nobody else will use for anything), but this works for now.
3560
3561         Don't try to render an image if we don't have a size or scale;
3562         PKImageRenderer will just fail anyway, so bail early.
3563
3564         In the iOS Simulator, PKImageRenderer currently returns an unusable image.
3565         Instead, so that we have a image on which to serialize the strokes,
3566         create a transparent 1x1 image. This makes it possible to serialize strokes
3567         even though we don't have a usable rendered image, so that we can still test
3568         this change (and future changes).
3569
3570         (-[WKDrawingView loadDrawingFromPNGRepresentation:]):
3571         If available, deserialize strokes from the EXIF User Comment field.
3572
3573         (-[WKDrawingView drawingDidChange:]):
3574         (-[WKDrawingView invalidateAttachment]):
3575         Factor invalidateAttachment out of drawingDidChange so we can call
3576         it from layoutSubviews too!
3577
3578 2018-11-27  Chris Dumez  <cdumez@apple.com>
3579
3580         Regression(PSON) crash under WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame()
3581         https://bugs.webkit.org/show_bug.cgi?id=191983
3582         <rdar://problem/46246863>
3583
3584         Reviewed by Geoffrey Garen.
3585
3586         * UIProcess/WebPageProxy.cpp:
3587         (WebKit::WebPageProxy::continueNavigationInNewProcess):
3588         Make sure the navigation still exists in m_mainFrameCreationHandler and return early if it
3589         does not.
3590
3591         (WebKit::WebPageProxy::resetState):
3592         Clear out m_mainFrameCreationHandler / m_mainFrameWindowCreationHandler if we resetting the state
3593         after a crash. At this point, there is no chance the WebProcess will send us the IPC that will
3594         cause these to get called and we do not want old state to remain for future navigations.
3595
3596 2018-11-16  Jiewen Tan  <jiewen_tan@apple.com>
3597
3598         Disallow loading webarchives as iframes
3599         https://bugs.webkit.org/show_bug.cgi?id=191728
3600         <rdar://problem/45524528>
3601
3602         Reviewed by Youenn Fablet.
3603
3604         * UIProcess/WebPageProxy.cpp:
3605         (WebKit::WebPageProxy::unableToImplementPolicy):
3606         Add a check to prevent null pointer dereference.
3607
3608 2018-11-27  Wenson Hsieh  <wenson_hsieh@apple.com>
3609
3610         WebKit.AddAndRemoveDataDetectors hits a debug assertion after r238515
3611         https://bugs.webkit.org/show_bug.cgi?id=191996
3612
3613         Reviewed by Tim Horton.
3614
3615         This assertion is hit because `decode(Decoder& decoder, NSArray<Class> *allowedClasses)` expects the decoded
3616         object (of class `_NSArrayM`) to be equal to `NSArray.class`.
3617
3618         We fix the crash by relaxing the debug assertion when decoding securely-codable objects over IPC. Instead of
3619         checking that the class of the decoded object is equal to one of the allowed classes, check that the object is a
3620         kind of any of the allowed classes.
3621
3622         * Shared/Cocoa/ArgumentCodersCocoa.h:
3623         (IPC::isObjectClassAllowed):
3624         (IPC::decode):
3625
3626 2018-11-27  Tomas Popela  <tpopela@redhat.com>
3627
3628         [GTK][WPE] Remove temporary workaround in Source/WebKit/Platform*.cmake
3629         https://bugs.webkit.org/show_bug.cgi?id=192008
3630
3631         Reviewed by Michael Catanzaro.
3632
3633         Looks like it's not needed anymore as the code compiles fine without
3634         it.
3635
3636         * PlatformGTK.cmake:
3637         * PlatformWPE.cmake:
3638
3639 2018-11-27  Antti Koivisto  <antti@apple.com>
3640
3641         Factor mask layer applying in RemoteLayerTreePropertyApplier into a shared function
3642         https://bugs.webkit.org/show_bug.cgi?id=192001
3643
3644         Reviewed by Tim Horton.
3645
3646         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.h:
3647         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
3648         (WebKit::RemoteLayerTreePropertyApplier::applyProperties):
3649         (WebKit::RemoteLayerTreePropertyApplier::updateMask):
3650
3651         Shared function, with some special tricks for iOS backdrop layers.
3652
3653         (WebKit::RemoteLayerTreePropertyApplier::applyPropertiesToUIView):
3654
3655 2018-11-27  Antti Koivisto  <antti@apple.com>
3656
3657         Stop collecting related layers in RemoteLayerTreeHost::updateLayerTree
3658         https://bugs.webkit.org/show_bug.cgi?id=192003
3659
3660         Reviewed by Tim Horton.
3661
3662         We can pass the node hash directly to RemoteLayerTreePropertyApplier. The collection step doesn't seem
3663         to add anything except an extra hash lookup.
3664
3665         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.h:
3666         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
3667         (WebKit::RemoteLayerTreeHost::updateLayerTree):
3668
3669         Pass m_nodes directly.
3670         Some random cleanups.
3671
3672 2018-11-27  Antti Koivisto  <antti@apple.com>
3673
3674         Remote tile layers shouldn't be UIViews
3675         https://bugs.webkit.org/show_bug.cgi?id=191953
3676
3677         Reviewed by Tim Horton.
3678
3679         They don't need any UIView functionality, nor do they ever have UIView descendants.
3680         We can use lighter weight objects.
3681
3682         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.h:
3683         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
3684         (WebKit::RemoteLayerTreePropertyApplier::applyProperties):
3685         (WebKit::RemoteLayerTreePropertyApplier::updateChildren):
3686
3687         Factor to a function shared between platforms.
3688         Support having both views and plain layers in the same tree.
3689         Assert that all siblings are of the same type and that we don't attempt to add views to layers.
3690
3691         (WebKit::RemoteLayerTreePropertyApplier::applyPropertiesToUIView):
3692         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
3693         (WebKit::RemoteLayerTreeHost::makeNode):
3694
3695         Use new plain layer on Mac too.
3696
3697         * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h:
3698         * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm:
3699         (-[WKPlainRemoteLayer description]):
3700
3701         Add a CALayer subclass so we can have a description, similar to WKCompositingView and pals.
3702
3703         (WebKit::RemoteLayerTreeNode::createWithPlainLayer):
3704         (WebKit::RemoteLayerTreeNode::detachFromParent):
3705
3706         Support having null view.
3707
3708         (WebKit::RemoteLayerTreeNode::appendLayerDescription):
3709
3710         Helper for layer descriptions.
3711
3712         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
3713         (WebKit::RemoteLayerTreeHost::makeNode):
3714
3715         Construct plain layers for tiles.
3716
3717         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
3718         (-[WKCompositingView description]):
3719         (-[WKUIRemoteView description]):
3720         (-[WKBackdropView description]):
3721
3722 2018-11-27  Fujii Hironori  <Hironori.Fujii@sony.com>
3723
3724         Remove "using namespace WebCore" under Source/WebKit/WebProcess/InjectedBundle/API
3725         https://bugs.webkit.org/show_bug.cgi?id=191995
3726
3727         Reviewed by Alex Christensen.
3728
3729         The statement "using namespace WebCore" should be placed inside
3730         namespace WebKit for unified source builds. But, source files
3731         defining WebKit API can't be enclosed by namespace WebKit { }
3732         becuase they are defined in the global scope.
3733
3734         "using namespace WebCore" in global scope and unified source
3735         builds may cause build breaks (Bug 191853).
3736
3737         Remove "using namespace WebCore" in the global scope. Use
3738         "WebCore::" prefix instead.
3739
3740         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
3741         (WKBundleClearAllDatabases):
3742         (WKBundleSetDatabaseQuota):
3743         (WKBundleClearResourceLoadStatistics):
3744         (WKBundleResourceLoadStatisticsNotifyObserver):
3745         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
3746         (WKBundleFrameGetFrameLoadState):
3747         (WKBundleFrameClearOpener):
3748         (WKBundleFrameCallShouldCloseOnWebView):
3749         (WKBundleFrameCopySecurityOrigin):
3750         (WKBundleFrameFocus):
3751         * WebProcess/InjectedBundle/API/c/WKBundleInspector.cpp:
3752         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
3753
3754 2018-11-26  Wenson Hsieh  <wenson_hsieh@apple.com>
3755
3756         [Cocoa] No way for clients to tell whether the content view is in the responder chain when the web view is
3757         https://bugs.webkit.org/show_bug.cgi?id=169212
3758         <rdar://problem/30899656>
3759
3760         Reviewed by Tim Horton.
3761
3762         Add an SPI hook to allow internal WKWebView clients to determine whether the WKWebView's content view is the
3763         first responder. Intended for use by clients, such as Mail, that embed native text input views and other views
3764         that may become first responder within the view hierarchy of the WKWebView.
3765
3766         * UIProcess/API/Cocoa/WKWebView.mm:
3767         (-[WKWebView _contentViewIsFirstResponder]):
3768         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3769
3770 2018-11-26  Tim Horton  <timothy_horton@apple.com>
3771
3772         Insert <attachment> elements under editable images to make their backing data accessible
3773         https://bugs.webkit.org/show_bug.cgi?id=191844
3774         <rdar://problem/30900149>
3775
3776         Reviewed by Simon Fraser.
3777
3778         * DerivedSources.make:
3779         * SourcesCocoa.txt:
3780         * UIProcess/API/APIAttachment.h:
3781         fileWrapper() is no longer a trivial getter; it can now construct
3782         the file wrapper from a file wrapper generator if necessary.
3783
3784         Add setFileWrapperGenerator() and invalidateGeneratedFileWrapper().
3785
3786         Make m_fileWrapper mutable so it can be adjusted inside its own getter.
3787
3788         * UIProcess/API/Cocoa/APIAttachmentCocoa.mm:
3789         (API::Attachment::fileWrapper const):
3790         If we have a fileWrapperGenerator and don't have a cached file wrapper,
3791         create one before returning it.
3792
3793         (API::Attachment::invalidateGeneratedFileWrapper):
3794         Invalidate the currently-cached file wrapper. The next time a client
3795         requests the file wrapper it will be regenerated.
3796
3797         (API::Attachment::fileName const):
3798         (API::Attachment::fileSizeForDisplay const):
3799         (API::Attachment::enclosingImageData const):
3800         (API::Attachment::isEmpty const):
3801         (API::Attachment::createSerializedRepresentation const):
3802         Make use of fileWrapper() instead of m_fileWrapper directly, to ensure
3803         that it is created lazily if necessary.
3804
3805         (API::Attachment::setFileWrapperGenerator):
3806         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
3807         (WebKit::RemoteLayerTreeHost::createEmbeddedView):
3808         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h:
3809         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
3810         (-[WKEmbeddedView initWithEmbeddedViewID:]):
3811         Defer to EditableImageController for creating WKDrawingViews for
3812         editable images. This is done primarily so we don't have to pollute
3813         Remote Layer Tree and DrawingArea interfaces with editable-image-specific messages.
3814
3815         * UIProcess/WebPageProxy.cpp:
3816         (WebKit::m_editableImageController):
3817         (WebKit::m_resetRecentCrashCountTimer): Deleted.
3818         * UIProcess/WebPageProxy.h:
3819         (WebKit::WebPageProxy::editableImageController):
3820         Keep an EditableImageController on the WebPageProxy.
3821
3822         * UIProcess/ios/EditableImageController.h: Added.
3823         * UIProcess/ios/EditableImageController.messages.in: Added.
3824         * UIProcess/ios/EditableImageController.mm: Added.
3825         (WebKit::EditableImageController::EditableImageController):
3826         (WebKit::EditableImageController::~EditableImageController):
3827         (WebKit::EditableImageController::ensureEditableImage):
3828         (WebKit::EditableImageController::editableImage):
3829         (WebKit::EditableImageController::didCreateEditableImage):
3830         (WebKit::EditableImageController::didDestroyEditableImage):
3831         (WebKit::EditableImageController::associateWithAttachment):
3832         (WebKit::EditableImageController::invalidateAttachmentForEditableImage):
3833         Add EditableImageController, which keeps track of EditableImages.
3834         It can be messaged directly to create or destroy the UI-side state
3835         of an editable image, and also to associate a WKDrawingView with
3836         a particular attachment.
3837
3838         * UIProcess/ios/WKDrawingView.h:
3839         * UIProcess/ios/WKDrawingView.mm:
3840         (-[WKDrawingView initWithEmbeddedViewID:webPageProxy:]):
3841         Store the WebPageProxy (weakly) so that we can get to the EditableImageController.
3842
3843         (-[WKDrawingView layoutSubviews]):
3844         (-[WKDrawingView PNGRepresentation]):
3845         Synchronously render the PKCanvasView to PNG.
3846
3847         (-[WKDrawingView drawingDidChange:]):
3848         If the drawing changes, inform the APIAttachment that it needs
3849         to discard its NSFileWrapper; a new one will be generated lazily.
3850
3851         (-[WKDrawingView init]): Deleted.
3852         * WebKit.xcodeproj/project.pbxproj:
3853         * WebProcess/WebCoreSupport/WebChromeClient.h:
3854         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
3855         (WebKit::WebChromeClient::associateEditableImageWithAttachment):
3856         (WebKit::WebChromeClient::didCreateEditableImage):
3857         (WebKit::WebChromeClient::didDestroyEditableImage):
3858
3859 2018-11-26  Jer Noble  <jer.noble@apple.com>
3860
3861         Adopt -setOverrideRouteSharingPolicy:routingContextUID: SPI
3862         https://bugs.webkit.org/show_bug.cgi?id=190951
3863         <rdar://problem/45213065>
3864
3865         Reviewed by Alex Christensen.
3866
3867         Add an asyncronous reply request to VideoFullscreenManager.
3868
3869         * Platform/IPC/MessageSender.h:
3870         (IPC::MessageSender::sendWithAsyncReply):
3871         * UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
3872         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
3873         (WebKit::VideoFullscreenModelContext::requestRouteSharingPolicyAndContextUID):
3874         * WebProcess/cocoa/VideoFullscreenManager.h:
3875         * WebProcess/cocoa/VideoFullscreenManager.messages.in:
3876         * WebProcess/cocoa/VideoFullscreenManager.mm:
3877         (WebKit::VideoFullscreenManager::requestRouteSharingPolicyAndContextUID):
3878
3879 2018-11-26  Alex Christensen  <achristensen@webkit.org>
3880
3881         Rename WKWebView._safeBrowsingWarningForTesting to _safeBrowsingWarning to use it for more than testing
3882         https://bugs.webkit.org/show_bug.cgi?id=191981
3883
3884         Reviewed by Tim Horton.
3885
3886         * UIProcess/API/Cocoa/WKWebView.mm:
3887         (-[WKWebView _safeBrowsingWarning]):
3888         (-[WKWebView _safeBrowsingWarningForTesting]): Deleted.
3889         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3890
3891 2018-11-26  Daniel Bates  <dabates@apple.com>
3892
3893         REGRESSION (r237738): Command Down Arrow doesn't scroll to the end of a page anymore
3894         https://bugs.webkit.org/show_bug.cgi?id=191967
3895         <rdar://problem/45976390>
3896
3897         Reviewed by Tim Horton.
3898
3899         Fixes an issue where pressing Command + Down Arrow does not scroll the view to the end of the page.
3900
3901         Following r237738 the value of the enumerations used to identify modifier keys (e.g. Shift) changed
3902         to match the values of the corresponding enumerations in GraphicsServices, which are the
3903         enumerations UIKit uses to computes the modifier flags bitmask when instantiating a WebEvent to
3904         pass to WebKit. Before r237738 WebKit was using enumerations whose values matched the values
3905         of the corresponding UIKit public API UIKeyModifier* enumerations. For non-content editable elements,
3906         WebKit intercepts UIKit events in -_handleKeyUIEvent, synthesizes and dispatches its own WebEvent.
3907         However it was creating WebEvents with a modifier flags bitmask built from the UIKeyModifier* enumerations,
3908         -_modifierFlags, as opposed to a bitmask from the GraphicsServices enumerations, -_gsModifierFlags.
3909         Instead WebKit should call -_gsModifierFlags to compute the GraphicsServices-compatible modifier
3910         flags bitmask when instantiating a WebEvent.
3911
3912         * Platform/spi/ios/UIKitSPI.h: Expose -_gsModifierFlags and remove -_modifierFlags.
3913         * UIProcess/ios/WKContentViewInteraction.mm:
3914         (-[WKContentView _handleKeyUIEvent:]): Remove unnecessary code to update the current modifier state.
3915         This will be done by the WebProcess when it receives the keyboard event.
3916         (-[WKContentView _didHandleKeyEvent:eventWasHandled:]): Do not pass modifier flags changed events
3917         to the scrolling animator as it does not know how to handle these kinds of events and triggers an
3918         assertion failure when it tries to read the input string from the event (calls -charactersIgnoringModifiers).
3919         FlagsChanged WebEvents events do not have an input string just like a FlagsChanged NSEvent that
3920         they model on Mac.
3921         * UIProcess/ios/WKWebEvent.mm:
3922         (-[WKWebEvent initWithEvent:]): Pass the value of -_gsModifierFlags for the modifier flags bitmask
3923         instead of the value of -_modifierFlags.
3924
3925 2018-11-26  Chris Dumez  <cdumez@apple.com>
3926
3927         [PSON] process pre-warming should not be on for everyone
3928         https://bugs.webkit.org/show_bug.cgi?id=191966
3929         <rdar://problem/46138499>
3930
3931         Reviewed by Ryosuke Niwa.
3932
3933         If automatic process-prewarming is not explicitly turned on/off by the client, then we now only
3934         turn it on automatically after the first process swap. Previously, it was always enabled if
3935         process-swap on cross-site navigation was enabled (which is the case by default for all apps).
3936
3937         This is important because some apps do not actually browse (only display static content) or never
3938         browse cross-site, and thus would not benefit from process prewarming and yet pay a memory cost.
3939
3940         * UIProcess/API/APIProcessPoolConfiguration.h:
3941         Add m_clientWouldBenefitFromAutomaticProcessPrewarming flag which is false by default and is used
3942         as a fallback if the client did not call setIsAutomaticProcessWarmingEnabled().
3943
3944         * UIProcess/API/C/WKContextConfigurationRef.cpp:
3945         (WKContextConfigurationPrewarmsProcessesAutomatically):
3946         (WKContextConfigurationSetPrewarmsProcessesAutomatically):
3947         Add C API to toggle automatic process prewarming. It is needed for Safari to turn on this feature
3948         by default for browsing. This way Safari does not have to wait for the first process swap to
3949         start prewarming.
3950
3951         * UIProcess/API/C/WKContextConfigurationRef.h:
3952         * UIProcess/WebProcessPool.cpp:
3953         (WebKit::WebProcessPool::didReachGoodTimeToPrewarm):
3954         Only do automatic process prewarming if process-swap on cross-site navigation is also enabled.
3955         This is needed for clients like Safari that explicitly enable automatic process prewarming but
3956         only want to have it enabled if PSON is also enabled via experimental features.
3957
3958         (WebKit::WebProcessPool::processForNavigation):
3959         On first process swap, if the client did not explicitly turn on or off automatic process prewarming
3960         then we enable it then. This avoids paying the cost of process prewarming in apps that would not
3961         benefit from it.
3962
3963 2018-11-26  Andy Estes  <aestes@apple.com>
3964
3965         [Cocoa] Make it easier to encode NSObjects
3966         https://bugs.webkit.org/show_bug.cgi?id=191948
3967
3968         Reviewed by Dean Jackson.
3969
3970         It should be easier to encode objects that conform to NSSecureCoding for WebKit IPC. Right
3971         now, several argument coders duplicate the logic for encoding and decoding objects using
3972         NSKeyedArchiver and NSKeyedUnarchiver.
3973
3974         This patch adds encodeObject() and decodeObject() primitives for encoding and decoding using
3975         Foundation keyed archiving. It then partially specializes ArgumentCoder for raw pointers and
3976         RetainPtrs whose pointee conforms to NSSecureCoding to call these new primitives.
3977
3978         This allows us to use Encoder::operator<< to encode raw pointers or RetainPtrs and use
3979         Decoder::operator>> to decode to an optional RetainPtr. By default, IPC::decode infers the
3980         allowed class for decoding by calling `[T class]`. We can also specify the allowed classes
3981         explicitly for containers and classes that are loaded at runtime.
3982
3983         * Shared/Cocoa/ArgumentCodersCocoa.h: Added.
3984         * Shared/Cocoa/ArgumentCodersCocoa.mm: Added.
3985         * Shared/Cocoa/DataDetectionResult.mm:
3986         (WebKit::DataDetectionResult::encode const): Removed custom encoding code and used ArgumentCodersCocoa instead.
3987         (WebKit::DataDetectionResult::decode): Ditto.
3988         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
3989         (IPC::ArgumentCoder<WebCore::Payment>::encode): Ditto.
3990         (IPC::ArgumentCoder<WebCore::Payment>::decode): Ditto.
3991         (IPC::ArgumentCoder<WebCore::PaymentAuthorizationResult>::decode): Ditto.
3992         (IPC::ArgumentCoder<WebCore::PaymentContact>::encode): Ditto.
3993         (IPC::ArgumentCoder<WebCore::PaymentContact>::decode): Ditto.
3994         (IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::encode): Ditto.
3995         (IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::decode): Ditto.
3996         (IPC::ArgumentCoder<WebCore::PaymentMethod>::encode): Ditto.
3997         (IPC::ArgumentCoder<WebCore::PaymentMethod>::decode): Ditto.
3998         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest>::decode): Ditto.
3999         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
4000         (WebKit::RemoteLayerTreeTransaction::description const): Added some needed