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