ChangeLog-2020-04-10   [plain text]


2020-04-10  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Fix media accessibility sandbox violation in the WebContent process
        https://bugs.webkit.org/show_bug.cgi?id=210301

        Reviewed by Daniel Bates.

        The media accessibility service is a global name, not a xpc service name.

        No new tests, since I have not observed any bugs related to the denial of this service.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

2020-04-10  Youenn Fablet  <youenn@apple.com>

        Introduce a RealtimeMediaSource observer dedicated to receiving audio samples
        https://bugs.webkit.org/show_bug.cgi?id=210180

        Reviewed by Eric Carlson.

        Update SourceProxy to be an AudioSampleObserver.
        Update MediaRecorder to only listen for audio samples if GPU remote writer is successfully created.
        It also stops listening to audio samples as soon as stopping the recording.

        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
        (WebKit::UserMediaCaptureManagerProxy::SourceProxy::SourceProxy):
        (WebKit::UserMediaCaptureManagerProxy::SourceProxy::~SourceProxy):
        * WebProcess/GPU/webrtc/MediaRecorderPrivate.cpp:
        (WebKit::MediaRecorderPrivate::MediaRecorderPrivate):
        (WebKit::MediaRecorderPrivate::~MediaRecorderPrivate):
        (WebKit::MediaRecorderPrivate::audioSamplesAvailable):
        (WebKit::MediaRecorderPrivate::stopRecording):
        * WebProcess/GPU/webrtc/MediaRecorderPrivate.h:
        * WebProcess/GPU/webrtc/MediaRecorderProvider.cpp:
        (WebKit::MediaRecorderProvider::createMediaRecorderPrivate):
        * WebProcess/GPU/webrtc/MediaRecorderProvider.h:

2020-04-10  Youenn Fablet  <youenn@apple.com>

        SWServer should not run a service worker that is terminating
        https://bugs.webkit.org/show_bug.cgi?id=210044

        Reviewed by Chris Dumez.

        Implement whenServiceWorkerIsTerminated check.

        * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
        (WebKit::WebSWServerConnection::whenServiceWorkerIsTerminatedForTesting):
        * NetworkProcess/ServiceWorker/WebSWServerConnection.h:
        * NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in:
        * WebProcess/Storage/WebSWClientConnection.cpp:
        (WebKit::WebSWClientConnection::whenServiceWorkerIsTerminatedForTesting):
        * WebProcess/Storage/WebSWClientConnection.h:

2020-04-10  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, reverting r259818.
        https://bugs.webkit.org/show_bug.cgi?id=210330

        "Causes crashes in at least three layout tests on iOS bots."
        (Requested by ddkilzer on #webkit).

        Reverted changeset:

        "Reset view navigation gesture state between tests"
        https://bugs.webkit.org/show_bug.cgi?id=210283
        https://trac.webkit.org/changeset/259818

2020-04-10  Claudio Saavedra  <csaavedra@igalia.com>

        [GTK] Use X11-specific GDK API in Netscape plugin
        https://bugs.webkit.org/show_bug.cgi?id=210325

        Reviewed by Adrian Perez de Castro.

        Since the code is X11-specific we can do that and remove
        deprecated API use.

        * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
        (WebKit::getPluginDisplay):
        (WebKit::x11Screen):

2020-04-10  Claudio Saavedra  <csaavedra@igalia.com>

        [GTK] Drop deprecated Drag and Drop API use
        https://bugs.webkit.org/show_bug.cgi?id=210327

        Reviewed by Adrian Perez de Castro.

        Use gtk_drag_begin_with_coordinates(), even if we let it guess the
        coordinates itself from the event, as gtk_drag_begin() is
        deprecated.

        * UIProcess/gtk/DragAndDropHandler.cpp:
        (WebKit::DragAndDropHandler::startDrag):

2020-04-09  David Kilzer  <ddkilzer@apple.com>

        Add WARN_UNUSED_RETURN to decode methods in Source/WebKit/Platform/IPC
        <https://webkit.org/b/210316>

        Reviewed by Alex Christensen.

        * Platform/IPC/ArgumentCoder.h:
        * Platform/IPC/ArgumentCoders.cpp:
        (IPC::ArgumentCoder<WallTime>::decode):
        (IPC::ArgumentCoder<AtomString>::decode):
        (IPC::ArgumentCoder<CString>::decode):
        (IPC::ArgumentCoder<String>::decode):
        (IPC::ArgumentCoder<SHA1::Digest>::decode):
        (IPC::ArgumentCoder<audit_token_t>::decode):
        (IPC::ArgumentCoder<Monostate>::decode):
        * Platform/IPC/ArgumentCoders.h:
        (IPC::SimpleArgumentCoder::decode):
        (IPC::ArgumentCoder<OptionSet<T>>::decode):
        (IPC::ArgumentCoder<Optional<T>>::decode):
        (IPC::ArgumentCoder<Box<T>>::decode):
        (IPC::TupleDecoderImpl::decode):
        (IPC::TupleDecoderImpl<Type>::decode):
        (IPC::TupleDecoder::decode):
        (IPC::TupleDecoder<0>::decode):
        (IPC::VariantCoder::decode):
        * Platform/IPC/Attachment.h:
        * Platform/IPC/DataReference.h:
        * Platform/IPC/Decoder.h:
        (IPC::Decoder::decodeEnum):
        * Platform/IPC/FormDataReference.h:
        (IPC::FormDataReference::decode):
        * Platform/IPC/ImageDataReference.h:
        (IPC::ImageDataReference::decode):
        * Platform/IPC/SharedBufferDataReference.h:
        (IPC::SharedBufferDataReference::decode):
        * Platform/IPC/StringReference.h:
        * Platform/IPC/cocoa/MachPort.h:
        (IPC::MachPort::decode):

2020-04-09  Alex Christensen  <achristensen@webkit.org>

        IPC serialization of enums should serialize std::underlying_type instead of uint64_t
        https://bugs.webkit.org/show_bug.cgi?id=210228

        Reviewed by Chris Dumez and Darin Adler.

        * Platform/IPC/Decoder.h:
        (IPC::Decoder::decode):
        (IPC::Decoder::operator>>):
        (IPC::Decoder::decodeEnum):
        * Platform/IPC/Encoder.h:
        * Shared/cf/ArgumentCodersCF.cpp:
        (IPC::encode):
        (IPC::decode):

2020-04-08  Darin Adler  <darin@apple.com>

        [Cocoa] Simplify NSArray, NSDictionary, and NSNumber idioms throughout WebKit
        https://bugs.webkit.org/show_bug.cgi?id=210138

        Reviewed by Alex Christensen.

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm: Remove uneeded include.
        * Platform/mac/StringUtilities.mm: Ditto.

        * PluginProcess/mac/PluginProcessMac.mm:
        (WebKit::replacedNSConcreteTask_launch): Use makeVector<String>.
        (WebKit::replacedNSWorkspace_launchApplicationAtURL_options_configuration_error):
        Ditto.

        * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
        (WebKit::toSupportedNetworks): Deleted.
        (WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest): Use createNSArray.

        * Shared/mac/PasteboardTypes.mm:
        (WebKit::PasteboardTypes::forEditing): Use @[].
        (WebKit::PasteboardTypes::forURL): Ditto.
        (WebKit::PasteboardTypes::forImages): Ditto.
        (WebKit::PasteboardTypes::forImagesWithArchive): Ditto.
        (WebKit::PasteboardTypes::forSelection): Ditto.

        * UIProcess/API/Cocoa/WKContentRuleListStore.mm:
        (-[WKContentRuleListStore getAvailableContentRuleListIdentifiers:]): Use createNSArray.
        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _getActivePagesOriginsInWebProcessForTesting:completionHandler:]): Ditto.

        * UIProcess/API/Cocoa/WKUserScript.mm:
        (-[WKUserScript _initWithSource:injectionTime:forMainFrameOnly:legacyWhitelist:legacyBlacklist:userContentWorld:]):
        (-[WKUserScript _initWithSource:injectionTime:forMainFrameOnly:legacyWhitelist:legacyBlacklist:associatedURL:userContentWorld:]):
        (-[WKUserScript _initWithSource:injectionTime:forMainFrameOnly:legacyWhitelist:legacyBlacklist:contentWorld:]):
        (-[WKUserScript _initWithSource:injectionTime:forMainFrameOnly:legacyWhitelist:legacyBlacklist:associatedURL:contentWorld:]):
        (-[WKUserScript _initWithSource:injectionTime:forMainFrameOnly:legacyWhitelist:legacyBlacklist:associatedURL:contentWorld:deferRunningUntilNotification:]):
        Use makeVector<String>.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _setupPageConfiguration:]): Use makeVector<String>.
        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
        (-[WKWebViewConfiguration _corsDisablingPatterns]): Use createNSArray.
        (-[WKWebViewConfiguration _setCORSDisablingPatterns:]): Use makeVector<String>.
        * UIProcess/API/Cocoa/WKWebViewTesting.mm:
        (-[WKWebView _contentsOfUserInterfaceItem:]): Use @().
        * UIProcess/API/Cocoa/_WKContentRuleListAction.mm:
        (-[_WKContentRuleListAction notifications]): Use createNSArray.
        * UIProcess/API/Cocoa/_WKCustomHeaderFields.mm:
        (-[_WKCustomHeaderFields thirdPartyDomains]): Use createNSArray.
        (-[_WKCustomHeaderFields setThirdPartyDomains:]): Use makeVector<String>.
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
        (-[_WKProcessPoolConfiguration cachePartitionedURLSchemes]): Use createNSArray.
        (-[_WKProcessPoolConfiguration setCachePartitionedURLSchemes:]): Use makeVector<String>.
        (-[_WKProcessPoolConfiguration alwaysRevalidatedURLSchemes]): Use createNSArray.
        (-[_WKProcessPoolConfiguration setAlwaysRevalidatedURLSchemes:]): Use makeVector<String>.

        * UIProcess/API/Cocoa/_WKUserContentWorldInternal.h:
        (API::toStringVector): Deleted.

        * UIProcess/API/Cocoa/_WKUserStyleSheet.mm:
        (-[_WKUserStyleSheet initWithSource:forMainFrameOnly:legacyWhitelist:legacyBlacklist:userContentWorld:]):
        (-[_WKUserStyleSheet initWithSource:forMainFrameOnly:legacyWhitelist:legacyBlacklist:baseURL:userContentWorld:]):
        Use makeVector<String>.

        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::accessibilityAttributeValue): Use @[].
        (WebKit::WebViewImpl::performDragOperation): Use makeVector<String>.
        (WebKit::WebViewImpl::namesOfPromisedFilesDroppedAtDestination): Use @[].
        (WebKit::WebViewImpl::collectKeyboardLayoutCommandsForEvent): Use @[].

        * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
        (WebKit::PluginProcessProxy::launchProcess): Use createNSArray.
        (WebKit::isJavaUpdaterURL): Use @[].
        (WebKit::PluginProcessProxy::launchApplicationAtURL): Use @{} and createNSArray.
        (WebKit::isSilverlightPreferencesURL): Use @[].

        * UIProcess/WebAuthentication/Cocoa/HidService.mm:
        (WebKit::HidService::HidService): Use @() and fixed an over-release mistake.
        This code was doing adoptNS on the result of +[NSNumberWithInt:], which is incorrect.

        * UIProcess/WebAuthentication/Mock/MockLocalConnection.mm:
        (WebKit::MockLocalConnection::getAttestation const): Use @[].

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView textStylingAtPosition:inDirection:]): Use @().
        (-[WKContentView requestRectsToEvadeForSelectionCommandsWithCompletionHandler:]): Use createNSArray.
        (-[WKContentView _itemsForBeginningOrAddingToSessionWithRegistrationLists:stagedDragSource:]):
        Fixed a wasteful call to autorelease where we are adding an item to a dictionary. Calling get
        is more efficient and still correct.

        * UIProcess/ios/forms/WKFileUploadPanel.mm:
        (-[WKFileUploadPanel imagePickerController:didFinishPickingMediaWithInfo:]): Use @[].

        * UIProcess/ios/forms/WKFormColorPicker.mm:
        (-[WKColorMatrixView initWithFrame:colorMatrix:]): Removed uneeded RetainPtr
        local variable.

        * UIProcess/mac/CorrectionPanel.mm:
        (WebKit::CorrectionPanel::show): Use createNSArray.

        * UIProcess/mac/TextCheckerMac.mm:
        (WebKit::TextChecker::updateSpellingUIWithGrammarString): Use createNSArray.
        (WebKit::TextChecker::getGuessesForWord): Use makeVector<String>.

        * UIProcess/mac/WKPrintingView.mm:
        (-[WKPrintingView _adjustPrintingMarginsForHeaderAndFooter]): Use @().

        * UIProcess/mac/WKTextFinderClient.mm:
        (arrayFromRects): Deleted.
        (-[WKTextFinderClient didFindStringMatchesWithRects:didWrapAround:]): Use createNSArray.

        * UIProcess/mac/WebDataListSuggestionsDropdownMac.mm:
        (-[WKDataListSuggestionsController notifyAccessibilityClients:]): Use @{}
        and fix a bug where this was creating a backwards dictionary. So this never
        could have been working before, making me wonder how we test it.

        * UIProcess/mac/WebPageProxyMac.mm:
        (WebKit::WebPageProxy::searchTheWeb): Use @[].

        * WebProcess/InjectedBundle/API/mac/WKDOMInternals.h: Removed toNSArray.
        * WebProcess/InjectedBundle/API/mac/WKDOMInternals.mm:
        (WebKit::toNSArray): Deleted.

        * WebProcess/InjectedBundle/API/mac/WKDOMNode.mm:
        (-[WKDOMNode textRects]): Use createNSArray.
        * WebProcess/InjectedBundle/API/mac/WKDOMRange.mm:
        (-[WKDOMRange textRects]): Ditto.

        * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
        (WebKit::InjectedBundle::setBundleParameter): Use @{}.

        * WebProcess/Plugins/Netscape/mac/PluginProxyMac.mm:
        (WebKit::makeRenderLayer): Use @[].

        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit::PDFPlugin::writeItemsToPasteboard): Use makeVector<String>.

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::applicationDidEnterBackground): Use @().

        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
        (WebKit::TiledCoreAnimationDrawingArea::suspendPainting): Use @{}.
        (WebKit::TiledCoreAnimationDrawingArea::resumePainting): Use @{}.

        * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
        Removed an unneeded include.
        * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm: Ditto.
        (-[WKAccessibilityWebPageObject accessibilityActionNames]): Use @[].
        (-[WKAccessibilityWebPageObject accessibilityChildren]): Use @[].

        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::getActivePagesOriginsForTesting): Use makeVector<String>.

2020-04-09  Megan Gardner  <megan_gardner@apple.com>

        Popovers are dismissed immediately when they try and bring up the keyboard.
        https://bugs.webkit.org/show_bug.cgi?id=210230
        <rdar://problem/60385504>

        Reviewed by Darin Adler.

        When popovers use keyboards we dismiss them because the
        web view loses firstResponder. We already have ways of 
        retaining focus when we lose first responde, so extend that
        code to cover the case where a keyboard comes up in a popover.

        We are also callling controlBeginEditing twice on refocusing a
        popover due to behaviour with touch and syntheticClick, so 
        keep up from presenting the popover twice, and allow for the focus
        count to be correclty incremented and decremented.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView preserveFocus]):
        (-[WKContentView releaseFocus]):
        * UIProcess/ios/forms/WKFormInputControl.mm:
        (-[WKDateTimePopover popoverWasDismissed:]):
        (-[WKDateTimePopover controlBeginEditing]):
        (-[WKDateTimePopover controlEndEditing]):

2020-04-09  David Kilzer  <ddkilzer@apple.com>

        Add using WTF::isInBounds to CheckedArithmetic.h
        <https://webkit.org/b/210299>

        Reviewed by Darin Adler.

        * Platform/IPC/ArgumentCoders.h:
        * Shared/UserData.cpp:
        (WebKit::UserData::decode):
        - Remove WTF:: prefix from isInBounds().

2020-04-09  Keith Rollin  <krollin@apple.com>

        Set ENTITLEMENTS_REQUIRED=NO for some Xcode build targets
        https://bugs.webkit.org/show_bug.cgi?id=210250
        <rdar://problem/61502270>

        Reviewed by Jonathan Bedard.

        When building with the public version of Xcode 11.4, with XCBuild
        enabled, and targeting the iOS device, some build targets issue an
        error like:

            error: An empty identity is not valid when signing a binary for
                the product type 'Command-line Tool'. (in target 'yasm' from
                project 'libwebrtc')

        A comment in <rdar://problem/47092353> suggests setting
        ENTITLEMENTS_REQUIRED=NO to relax the requirement. To that end, when
        building with the public Xcode, establish that setting for the
        affected targets.

        * Configurations/GPUService.xcconfig:
        * Configurations/NetworkService.xcconfig:
        * Configurations/PluginProcessShim.xcconfig:
        * Configurations/PluginService.64.xcconfig:
        * Configurations/SecItemShim.xcconfig:
        * Configurations/WebContentService.xcconfig:

2020-04-09  Jacob Uphoff  <jacob_uphoff@apple.com>

        Unreviewed, reverting r259816.

        This commit broke the webkit build for macOS and iOS

        Reverted changeset:

        "Introduce a RealtimeMediaSource observer dedicated to
        receiving audio samples"
        https://bugs.webkit.org/show_bug.cgi?id=210180
        https://trac.webkit.org/changeset/259816

2020-04-09  Simon Fraser  <simon.fraser@apple.com>

        eventSender.monitorWheelEvents() should clear latching state
        https://bugs.webkit.org/show_bug.cgi?id=210288

        Reviewed by Tim Horton.

        Use monitorWheelEvents() as a trigger to clear scroll latching state, both main-thread (via Page)
        and scrolling thread (via ScrollingTree).

        Page::ensureWheelEventTestMonitor() had side-effects, so hide it, and have clients explicitly call Page::startMonitoringWheelEvents().

        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
        (WKBundlePageStartMonitoringScrollOperations):
        (WKBundlePageRegisterScrollOperationCompletionCallback):

2020-04-09  Simon Fraser  <simon.fraser@apple.com>

        Reset view navigation gesture state between tests
        https://bugs.webkit.org/show_bug.cgi?id=210283

        Reviewed by Tim Horton.

        State in ViewGestureController could leak between tests if a test did not wait for the gesture to complete.
        Specifically m_activeGestureType could be left as non-None.
        
        Fix by plumbing a 'reset' through from TestController::resetStateToConsistentValues().

        The implementations leverage code from removeSwipeSnapshot(), but avoid the fact that removeSwipeSnapshot()
        early returns in various cases by just always calling reset code, which is factored into a new resetState function.

        * UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h:
        * UIProcess/API/Cocoa/WKWebViewTesting.mm:
        (-[WKWebView _resetNavigationGestureStateForTesting]):
        * UIProcess/ViewGestureController.cpp:
        (WebKit::ViewGestureController::willBeginGesture):
        (WebKit::ViewGestureController::didEndGesture):
        (WebKit::ViewGestureController::PendingSwipeTracker::handleEvent):
        (WebKit::ViewGestureController::PendingSwipeTracker::eventWasNotHandledByWebCore):
        * UIProcess/ViewGestureController.h:
        * UIProcess/ios/ViewGestureControllerIOS.mm:
        (WebKit::ViewGestureController::removeSwipeSnapshot):
        (WebKit::ViewGestureController::resetState):
        (WebKit::ViewGestureController::reset):
        * UIProcess/mac/ViewGestureControllerMac.mm:
        (WebKit::ViewGestureController::removeSwipeSnapshot):
        (WebKit::ViewGestureController::resetState):
        (WebKit::ViewGestureController::reset):

2020-04-09  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, reverting r259804.

        Breaks the watchOS build.

        Reverted changeset:

        "IPC serialization of enums should serialize
        std::underlying_type instead of uint64_t"
        https://bugs.webkit.org/show_bug.cgi?id=210228
        https://trac.webkit.org/changeset/259804

2020-04-09  Youenn Fablet  <youenn@apple.com>

        Introduce a RealtimeMediaSource observer dedicated to receiving audio samples
        https://bugs.webkit.org/show_bug.cgi?id=210180

        Reviewed by Eric Carlson.

        Update SourceProxy to be an AudioSampleObserver.
        Update MediaRecorder to only listen for audio samples if GPU remote writer is successfully created.
        It also stops listening to audio samples as soon as stopping the recording.

        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
        (WebKit::UserMediaCaptureManagerProxy::SourceProxy::SourceProxy):
        (WebKit::UserMediaCaptureManagerProxy::SourceProxy::~SourceProxy):
        * WebProcess/GPU/webrtc/MediaRecorderPrivate.cpp:
        (WebKit::MediaRecorderPrivate::MediaRecorderPrivate):
        (WebKit::MediaRecorderPrivate::~MediaRecorderPrivate):
        (WebKit::MediaRecorderPrivate::audioSamplesAvailable):
        (WebKit::MediaRecorderPrivate::stopRecording):
        * WebProcess/GPU/webrtc/MediaRecorderPrivate.h:
        * WebProcess/GPU/webrtc/MediaRecorderProvider.cpp:
        (WebKit::MediaRecorderProvider::createMediaRecorderPrivate):
        * WebProcess/GPU/webrtc/MediaRecorderProvider.h:

2020-04-09  David Kilzer  <ddkilzer@apple.com>

        WTF::Persistence::Coder and WTF::Persistence::Decoder should use WARN_UNUSED_RETURN
        <https://webkit.org/b/210238>
        <rdar://problem/61491575>

        Reviewed by Darin Adler.

        * NetworkProcess/cache/NetworkCacheEntry.cpp:
        (WebKit::NetworkCache::Entry::decodeStorageRecord):
        - Add missing return value check for decode.decode().

2020-04-09  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Add routines to message filter in the WebContent sandbox
        https://bugs.webkit.org/show_bug.cgi?id=210293

        Reviewed by Geoffrey Garen.

        Add required routines to the message filter in the WebContent process. This set of routines was compiled
        from local testing, and is therefore probably not the complete set.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

2020-04-09  Megan Gardner  <megan_gardner@apple.com>

        [iOS] Date and time form controls are presented at the wrong size in some modes
        https://bugs.webkit.org/show_bug.cgi?id=210194
        <rdar://problem/60385475>

        Reviewed by Tim Horton.

        Instead of relying on the default size for date/time controls, we should let the
        UIDatePicker determine its own size given the configuration we're going to use.

        * UIProcess/ios/forms/WKFormInputControl.mm:
        (-[WKDateTimePicker initWithView:datePickerMode:]):
        (-[WKDateTimePopover initWithView:datePickerMode:]):
        * UIProcess/ios/forms/WKFormSelectPopover.mm:
        (-[WKSelectPopover initWithView:hasGroups:]):

2020-04-08  Simon Fraser  <simon.fraser@apple.com>

        [Async overflow scroll] Horizontal scrolls can trigger unwanted back swipes
        https://bugs.webkit.org/show_bug.cgi?id=210095
        <rdar://problem/61376245>

        Reviewed by Tim Horton.

        With async overflow/frame scrolling, EventDispatcher::wheelEvent() can't immediately
        determine whether the scrolling tree handled the scroll; we have to wait until the
        event has been processed by the scrolling thread. To allow that, add a
        ScrollingEventResult::SendToScrollingThread return value and a give tryToHandleWheelEvent()
        a callback that's called when the scrolling thread is done with the event. EventDispatcher
        uses that to send the "didReceiveEvent" with "handled" back to the UI process, which then
        proceeds with history or reading list swipes.

        Various fixes were necessary to correctly determine whether the event was handled.
        
        ScrollingTreeFrameScrollingNodeMac::handleWheelEvent() didn't return an accurate ScrollingEventResult,
        and ScrollController didn't return false in cases where rubber-banding was disabled (which broke navigation swipes
        and reading list navigation).

        * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
        (WebKit::RemoteScrollingCoordinatorProxy::handleWheelEvent):
        * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
        (WebKit::RemoteScrollingTree::tryToHandleWheelEvent):
        * UIProcess/RemoteLayerTree/RemoteScrollingTree.h:
        * WebProcess/WebPage/EventDispatcher.cpp:
        (WebKit::EventDispatcher::wheelEvent):
        (WebKit::EventDispatcher::sendDidReceiveEvent):
        * WebProcess/WebPage/EventDispatcher.h:

2020-04-09  Alex Christensen  <achristensen@webkit.org>

        IPC serialization of enums should serialize std::underlying_type instead of uint64_t
        https://bugs.webkit.org/show_bug.cgi?id=210228

        Reviewed by Chris Dumez and Darin Adler.

        * Platform/IPC/Decoder.h:
        (IPC::Decoder::decode):
        (IPC::Decoder::operator>>):
        (IPC::Decoder::decodeEnum):
        * Platform/IPC/Encoder.h:
        * Shared/cf/ArgumentCodersCF.cpp:
        (IPC::encode):
        (IPC::decode):

2020-04-09  Youenn Fablet  <youenn@apple.com>

        [MacOS] REGRESSION (r253275): Stopping a cloned audio capture track should not stop the original audio track
        https://bugs.webkit.org/show_bug.cgi?id=210259
        <rdar://problem/61466486>

        Reviewed by Eric Carlson.

        We changed video track cloning so that each cloned track would get its own source.
        The source is getting video sample from the real capture source.
        The real capture source will get stopped if all its client sources are stopped.

        For audio, we are still using the same audio source for each track.
        We should thus not close the source until all its tracks are stopped.
        To do so, we reuse RealtimeMediaSource::requestToEnd instead of directly sending
        the order to stop observing the remote audio source.

        Test: fast/mediastream/mediastreamtrack-audio-clone.html

        * WebProcess/cocoa/UserMediaCaptureManager.cpp:
        (WebKit::UserMediaCaptureManager::Source::requestToEnd):
        (WebKit::UserMediaCaptureManager::Source::stopBeingObserved): Deleted.

2020-04-09  Claudio Saavedra  <csaavedra@igalia.com>

        [GTK] Clean-up use of deprecated GtkAction
        https://bugs.webkit.org/show_bug.cgi?id=210273

        Reviewed by Carlos Garcia Campos.

        GtkAction is deprecated, however we use it because it's exposed
        in the public API. Guard deprecated API usage to remove warnings and
        update docs to not suggest using the deprecated API.

        * Shared/API/glib/WebKitContextMenuItem.cpp:
        * Shared/glib/WebContextMenuItemGlib.cpp:
        (WebKit::WebContextMenuItemGlib::buildActionName const):
        (WebKit::WebContextMenuItemGlib::createActionIfNeeded):

2020-04-09  David Kilzer  <ddkilzer@apple.com>

        UserData::decode should add bounds checks
        <https://webkit.org/b/210247>
        <rdar://problem/61467748>

        Reviewed by Alex Christensen.

        * Shared/UserData.cpp:
        (WebKit::UserData::decode):
        - Add bounds checks using WTF::isInBounds<size_t>.
        * Shared/UserData.h:
        (WebKit::UserData::decode):
        - Add WARN_UNUSED_RETURN.

2020-04-09  David Kilzer  <ddkilzer@apple.com>

        Follow-up: WTF::Persistence::VectorCoder and IPC::VectorArgumentCoder should do bounds checking without crashing
        <https://webkit.org/b/210227>
        <rdar://problem/60832243>

        Reviewed by Alex Christensen.

        * Platform/IPC/ArgumentCoders.h:
        - Add missing call to decoder.markInvalid() if decoding of
          `decodedSize` fails.
        - Replace safeCast<size_t> with isInBounds<size_t> so that we
          don't crash if `decodedSize` is too big.  Instead we fail
          decoding by marking the decoder invalid and returning early.
        - Revert checked arithemtic for multiplication since
          bufferIsLargeEnoughToContain<T(size) already did this check
          for us.

2020-04-08  David Kilzer  <ddkilzer@apple.com>

        WTF::Persistence::VectorCoder and IPC::VectorArgumentCoder should use checked arithmetic
        <https://webkit.org/b/210227>
        <rdar://problem/60832243>

        Reviewed by Alex Christensen.

        * Platform/IPC/ArgumentCoders.h:
        (IPC::VectorArgumentCoder::decode):
        - Use safeCast<> to cast from uint64_t to size_t.
        - Use checked arithemtic for multiplication.

2020-04-08  Alexey Proskuryakov  <ap@apple.com>

        Fix WebContent process launching after r259758.

        * WebProcess/com.apple.WebProcess.sb.in:

2020-04-08  Brady Eidson  <beidson@apple.com>

        Enable incremental PDF loading.
        <rdar://problem/60396263> and https://bugs.webkit.org/show_bug.cgi?id=210241

        Reviewed by Tim Horton.

        * FeatureFlags/WebKit.plist:

2020-04-08  David Kilzer  <ddkilzer@apple.com>

        UserMediaCaptureManagerProxy::clone should validate its parameters
        <https://webkit.org/b/210221>
        <rdar://problem/61063019>

        Reviewed by Alex Christensen.

        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
        (MESSAGE_CHECK): Define (and undef) new macro for assertion.
        (WebKit::UserMediaCaptureManagerProxy::clone): Change ASSERT()
        to MESSAGE_CHECK().

2020-04-08  David Kilzer  <ddkilzer@apple.com>

        WebKit::ShareableBitmap::Handle::decode() should validate m_size instance variables
        <https://webkit.org/b/210211>
        <rdar://problem/60543986>

        Reviewed by Alex Christensen.

        * Shared/ShareableBitmap.cpp:
        (WebKit::ShareableBitmap::Handle::decode): Return early if
        either m_size instance variable is less than zero.

2020-04-08  Alex Christensen  <achristensen@webkit.org>

        _corsDisablingPatterns should allow security policy access to those patterns
        https://bugs.webkit.org/show_bug.cgi?id=210218
        <rdar://problem/61395166>

        Reviewed by Timothy Hatcher.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_processDisplayName):

2020-04-08  Brent Fulgham  <bfulgham@apple.com>

        REGRESSION(r257758): Launch time performance regression
        https://bugs.webkit.org/show_bug.cgi?id=210157
        <rdar://problem/61119881>

        Reviewed by Alex Christensen.

        Address a launch time performance regression in the WebProcessPool constructor
        by starting a potentially slow server call in the constructor, and only waiting
        for its result if it has not been received when the value is needed.

        * UIProcess/WebProcessPool.cpp:
        (WebProcessPool::WebProcessPool): Start initialization function in constructor,
        rather than blocking for the 

2020-04-08  Alex Christensen  <achristensen@webkit.org>

        WKWebViews should behave as if they had loaded something after restoring session state
        https://bugs.webkit.org/show_bug.cgi?id=210097
        <rdar://problem/58778490>

        Reviewed by Chris Dumez.

        Specifically, we don't want to close a WKWebView after restoring the session state into another
        WKWebView into it then navigating to a phishing page.  We want to be at the previous page after
        the user clicks "Go back".

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::restoreFromSessionState):

2020-04-08  Kate Cheney  <katherine_cheney@apple.com>

        Add curly braces after one line if statement for the case when we aren't using the internal SDK
        https://bugs.webkit.org/show_bug.cgi?id=210225
        <rdar://problem/61485209>

        Reviewed by David Kilzer.

        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::initializeAppBoundDomains):

2020-04-08  Brady Eidson  <beidson@apple.com>

        Handle [PDFDocument initWithProvider:] returning nil
        <rdar://problem/61482395> and https://bugs.webkit.org/show_bug.cgi?id=210224

        Reviewed by Geoff Garen.

        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit::PDFPlugin::threadEntry): Treat a nil PDFDocument as "non-linearized, fallback to normal loading"

2020-04-08  Daniel Bates  <dabates@apple.com>

        Track editable elements on screen
        https://bugs.webkit.org/show_bug.cgi?id=209888
        <rdar://problem/61196886>

        Reviewed by Simon Fraser.

        Speed up -_requestTextInputContextsInRect when the rect does not intersect any editable
        elements by over 4450 times on reddit.com! Another way of saying this is that it reduces
        the time from an average of 303.252ms to 0.0680625ms in a Production build.

        This speed up is accomplished by having the web process track the rects of the editable
        elements on the page and send this information as a region data structure over to the UI
        process as part of the EventRegion object. This region is used to determine if there
        *may* be an editable element inside the rectangele. It never reports a false negative,
        but it can report a false positive: a rectangle is over an editable element when it
        actually isn't, (e.g. there is a non-composited element with a higher z-order than the
        editable element that intersects the search rect).

        * Configurations/FeatureDefines.xcconfig: Add feature define to track editable elements on
        screen (enabled by default on iOS and iOS Simulator).
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _mayContainEditableElementsInRect:]): Added.
        (-[WKWebView _requestTextInputContextsInRect:completionHandler:]): Checks if the search
        rects hits an editable element in a RemoteLayerTree node's editable region. If it does
        not hit any then we know there are no editable elements and return immediately. If it
        does hit something then we still need to ask the web process to perform a hit test to
        find the actual elements, respecting z-ordering (which is lost when these elements' rects
        are united to form the editable region).
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h:
        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
        (WebKit::collectDescendantViewsInRect): Added.
        (WebKit::mayContainEditableElementsInRect): Added.

2020-04-08  Daniel Bates  <dabates@apple.com>

        Should find touch-action elements inside non-composited iframes
        https://bugs.webkit.org/show_bug.cgi?id=210041
        <rdar://problem/61323558>

        Reviewed by Simon Fraser.

        Pass EventRegionContext through. It is unused as it's not applicable for plugin painting.

        * WebProcess/Plugins/PluginView.cpp:
        (WebKit::PluginView::paint):
        * WebProcess/Plugins/PluginView.h:

2020-04-08  Brady Eidson  <beidson@apple.com>

        Fix handling non-linearized PDFs when incremental PDF loading is enabled.
        <rdar://problem/60619506> and https://bugs.webkit.org/show_bug.cgi?id=210208

        Reviewed by Tim Horton (and I think Geoff Garen, probably. It's confusing.)

        When we try to load a non-linearized PDF with PDFKit, it makes an outlandishly large range request
        to try to verify the PDF file size.
        
        That's covered by <rdar://problem/61473378>
        
        Meanwhile we need to detect that and fallback to non-incremental PDF loading.

        * WebProcess/Plugins/PDF/PDFPlugin.h:
        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit::PDFPlugin::receivedInvalidRangeRequest):
        (WebKit::dataProviderGetBytesAtPositionCallback):
        (WebKit::PDFPlugin::threadEntry):
        (WebKit::PDFPlugin::installPDFDocument):

2020-04-08  Per Arne Vollan  <pvollan@apple.com>

        Allow use of syscall from the WebContent sandbox
        https://bugs.webkit.org/show_bug.cgi?id=209920

        Reviewed by Geoffrey Garen.

        Add syscall to the WebContent sandbox on macOS.

        * WebProcess/com.apple.WebProcess.sb.in:

2020-04-08  Per Arne Vollan  <pvollan@apple.com>

        [macOS] Crash under WebKit::SandboxExtension::consume
        https://bugs.webkit.org/show_bug.cgi?id=210188

        Reviewed by Geoffrey Garen.

        When issuing a mach lookup extension to the database mapping service in the UI process fails, the WebContent
        process will crash when trying to consume the extension.

        No new tests, since I am not able to reproduce the issue.

        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        * WebProcess/com.apple.WebProcess.sb.in:

2020-04-08  Rob Buis  <rbuis@igalia.com>

        Make more use of FrameLoader pageID/frameID getters
        https://bugs.webkit.org/show_bug.cgi?id=210182

        Reviewed by Chris Dumez.

        Make more use of FrameLoader pageID/frameID getters, before
        this change they were only used internally in FrameLoader.

        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::addParametersShared):

2020-04-08  David Kilzer  <ddkilzer@apple.com>

        Follow-up: [iOS] WebPageProxy::didCommitLoadForFrame should not crash with null or empty `mimeType` parameter
        <https://webkit.org/b/209994>
        <rdar://problem/60068700>

        * UIProcess/mac/PageClientImplMac.mm:
        (WebKit::PageClientImpl::didCommitLoadForMainFrame):
        - Remove UNUSED_PARAM() in lieu of deleting parameter names.

2020-04-08  Michael Catanzaro  <mcatanzaro@gnome.org>

        Remove unused WebProcessPool::sendToAllProcessesRelaunchingThemIfNecessary and WebProcessPool::sendToOneProcess
        https://bugs.webkit.org/show_bug.cgi?id=210199

        Reviewed by Alex Christensen.

        Remove unused functions.

        * UIProcess/WebProcessPool.h:
        (WebKit::WebProcessPool::sendToAllProcessesRelaunchingThemIfNecessary): Deleted.
        (WebKit::WebProcessPool::sendToOneProcess): Deleted.

2020-04-08  Devin Rousso  <drousso@apple.com>

        Web Inspector: only broadcast the console message to main frames
        https://bugs.webkit.org/show_bug.cgi?id=210122

        Reviewed by Timothy Hatcher.

        * WebProcess/Network/NetworkProcessConnection.cpp:
        (WebKit::NetworkProcessConnection::broadcastConsoleMessage):

2020-04-08  Kate Cheney  <katherine_cheney@apple.com>

        Return app-bound sessions for instances where WKAppBoundDomains is
        empty
        https://bugs.webkit.org/show_bug.cgi?id=210124
        <rdar://problem/61276630>

        Reviewed by Brent Fulgham.

        No new tests. Behavior confirmed by existing In-App Browser Privacy
        tests.

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::sessionWrapperForTask):
        Remove the flag checking if In-App Browser Privacy is enabled. We
        should return an app-bound session if WKAppBoundDomains is empty so
        we no longer need to check the flag here.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::setIsNavigatingToAppBoundDomain):
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
        * UIProcess/WebPageProxy.h:
        As described above, we no longer need to check the flag in this
        instance as we are determining behavior based on the WKAppBoundDomains
        list. Also moved the logic for checking an empty list to setIsNavigatingToAppBoundDomain,
        so it should take an Optional (WTF::nullopt indicates an empty list).

        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::initializeAppBoundDomains):
        Use the flag to enable internal debugging for testing purposes.

        * UIProcess/API/APIHTTPCookieStore.cpp:
        (API::HTTPCookieStore::filterAppBoundCookies):
        Flag no longer needed. This should be gated by whether the domains
        list is empty or not.

2020-04-08  David Kilzer  <ddkilzer@apple.com>

        [iOS] WebPageProxy::didCommitLoadForFrame should not crash with null or empty `mimeType` parameter
        <https://webkit.org/b/209994>
        <rdar://problem/60068700>

        Reviewed by Chris Dumez.

        * UIProcess/API/ios/WKWebViewIOS.mm:
        (-[WKWebView _setHasCustomContentView:loadedMIMEType:]):
        - Extract logic for `representationClass` since
          -[WKWebViewContentProviderRegistry providerForMIMEType:] may
          return nil.
        * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
        (-[WKWebViewContentProviderRegistry providerForMIMEType:]):
        - Add early return if `mimeType` is null or empty as those are
          not valid keys for `_contentProviderForMIMEType`.
        * UIProcess/mac/PageClientImplMac.mm:
        (WebKit::PageClientImpl::didCommitLoadForMainFrame):
        - Add UNUSED_PARAM() for when -Wno-unused-parameter is removed
          in place of GCC_WARN_UNUSED_VARIABLE=YES.

2020-04-08  Brian Burg  <bburg@apple.com>

        REGRESSION(r253346): some Automation commands targeted at an iframe do not return
        https://bugs.webkit.org/show_bug.cgi?id=210139
        <rdar://problem/60561009>

        Reviewed by Devin Rousso.

        WebAutomationSession / WebAutomationSessionProxy are singletons, and only one
        exists at a time in the UIProcess / WebProcess respectively. A recent change was
        made to call Connection::sendWithAsyncReply from the WebPageProxy object rather
        than WebProcess. The effect of this is that the WebPage's destinationID is
        used for the response message rather than the WebProcess.

        Because WebAutomationSessionProxy registers itself as a global IPC message receiver,
        the page-targeted destinationID cannot find any receivers for the message at the
        destinationID, which causes an ASSERT in debug builds and a hang in non-debug builds.

        The fix is to continue sending messages via the WebProcess object, whose messages
        are tagged with a destinationID of 0 (eg, global message receiver). This could alternatively
        be accomplished by passing a destinationID of 0 to every sendWithAsyncReply, but
        as is this change is a straightforward partial revert of r253346.

        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::switchToBrowsingContext):
        (WebKit::WebAutomationSession::evaluateJavaScriptFunction):
        (WebKit::WebAutomationSession::resolveChildFrameHandle):
        (WebKit::WebAutomationSession::resolveParentFrameHandle):
        (WebKit::WebAutomationSession::computeElementLayout):
        (WebKit::WebAutomationSession::selectOptionElement):
        (WebKit::WebAutomationSession::setFilesForInputFileUpload):
        (WebKit::WebAutomationSession::getAllCookies):
        (WebKit::WebAutomationSession::deleteSingleCookie):
        (WebKit::WebAutomationSession::takeScreenshot):

2020-04-08  Truitt Savell  <tsavell@apple.com>

        Unreviewed, reverting r259708.

        Broke the iOS device Build

        Reverted changeset:

        "Enable the use of XCBuild by default in Apple builds"
        https://bugs.webkit.org/show_bug.cgi?id=209890
        https://trac.webkit.org/changeset/259708

2020-04-08  Chris Dumez  <cdumez@apple.com>

        Ref WebProcessProxy in NetworkProcessProxy::terminateUnresponsiveServiceWorkerProcesses()
        https://bugs.webkit.org/show_bug.cgi?id=210196

        Reviewed by Youenn Fablet.

        Ref WebProcessProxy in NetworkProcessProxy::terminateUnresponsiveServiceWorkerProcesses()
        since the call to WebProcessProxy::disableServiceWorkers() may cause it to get destroyed
        otherwise.

        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::terminateUnresponsiveServiceWorkerProcesses):

2020-04-08  Chris Dumez  <cdumez@apple.com>

        Regression(r259610) [RBSTarget targetWithPid:] may throw a 'must specify a valid pid' exception
        https://bugs.webkit.org/show_bug.cgi?id=210159

        Reviewed by Alex Christensen.

        [RBSTarget targetWithPid:] may throw a 'must specify a valid pid' exception since r259610. There
        are apparently cases where the PID we are passing the ProcessAssertion is 0 (likely process crash
        on startup). BKSAssertion used to deal with this silently but RBSAssertion actually throws an
        exception in this case. To maintain the old behavior, we should do an explicit check to make sure
        the PID is valid before passing it to RunningBoard.

        * UIProcess/ios/ProcessAssertionIOS.mm:
        (WebKit::ProcessAssertion::ProcessAssertion):

2020-04-08  Claudio Saavedra  <csaavedra@igalia.com>

        [GTK] Drop usage of deprecated GdkDeviceManager
        https://bugs.webkit.org/show_bug.cgi?id=210179

        Reviewed by Adrian Perez de Castro.

        Replace GdkDeviceManager usage for GdkSeat.
        For GTK4 further changes will be needed but this is a
        start.

        * UIProcess/gtk/ViewGestureControllerGtk.cpp:
        (WebKit::createScrollEvent):

2020-04-08  Carlos Garcia Campos  <cgarcia@igalia.com>

        Ensure base cache path exists before calculating disk cache capacity
        https://bugs.webkit.org/show_bug.cgi?id=209338

        Reviewed by Adrian Perez de Castro.

        The base cache path might not exist yet in Cache::open() since it's Storage::open() the one calling
        FileSystem::makeAllDirectories() with the final cache directory. In such case, computeCapacity() fails because
        FileSystem::getVolumeFreeSpace() needs an existing file.

        * NetworkProcess/cache/NetworkCache.cpp:
        (WebKit::NetworkCache::Cache::open):

2020-04-08  Keith Rollin  <krollin@apple.com>

        Enable the use of XCBuild by default in Apple builds
        https://bugs.webkit.org/show_bug.cgi?id=209890
        <rdar://problem/44182078>

        Reviewed by Darin Adler.

        Switch from the "legacy" Xcode build system to the "new" build system
        (also known as "XCBuild"). Switching to the new system speeds up
        builds by a small percentage, better validates projects for
        build-related issues (such as dependency cycles), lets WebKit benefit
        from future improvements in XCBuild such as those coming from the
        underlying llbuild open source project, and prepares us for any other
        tools built for this new ecosystem.

        Specific changes:

        - Remove Xcode project and workspace settings that selected the Build
          system, allowing the default to take hold (which is currently the
          New build system).
        - Updated webkitdirs.pm with a terser check for Xcode version.
        - Update build-webkit and Makefile.shared to be explicit when using
          the old build system (no longer treat it as a default or fall-back
          configuration).
        - Update various xcconfig files similarly to treat the default as
          using the new build system.
        - Update various post-processing build steps to check for Xcode 11.4
          and to no longer treat the default as using the old build system.

        * Configurations/WebKit.xcconfig:
        * WebKit.xcodeproj/project.pbxproj:

2020-04-07  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] WTR: fix handling of WebsiteDataStore
        https://bugs.webkit.org/show_bug.cgi?id=210106

        Reviewed by Adrian Perez de Castro.

        Add WKContextSetPrimaryWebsiteDataStore() to expose WebProcessPool::setPrimaryDataStore().

        * UIProcess/API/C/WKContext.cpp:
        (WKContextSetPrimaryWebsiteDataStore):
        * UIProcess/API/C/WKContextPrivate.h:

2020-04-07  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Deny mach lookup access to the runningboard service in the WebContent process
        https://bugs.webkit.org/show_bug.cgi?id=209933

        Reviewed by Chris Dumez.

        Creating the dependency process assertion in the WebContent process requires access to runningboard, but since
        this is only done on process startup, we can issue a temporary extension to the runningboard service, which
        will be immediately revoked after the process assertion has been created.

        Test: fast/sandbox/ios/sandbox-mach-lookup.html

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const):
        (WebKit::WebProcessCreationParameters::decode):
        * Shared/WebProcessCreationParameters.h:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::initializeConnection):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):

2020-04-07  John Wilander  <wilander@apple.com>

        ITP Debug Mode logs should be more generic now that it blocks all third-party cookies by default
        https://bugs.webkit.org/show_bug.cgi?id=210133
        <rdar://problem/61399686>

        Reviewed by Brent Fulgham.

        No new tests. Just a change of logging.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        (WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlocking):
            Now logs if either vector has entries and uses more generic language.
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
        (WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlocking):
            Now logs if either vector has entries and uses more generic language.
        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
        (WebKit::ResourceLoadStatisticsStore::debugLogDomainsInBatches):
            Removed hard-coded references to third-party cookie blocking and parameterized it instead.

2020-04-07  Joonghun Park  <jh718.park@samsung.com>

        Move the misplaced statement to the proper place where in
        RESOURCE_LOAD_STATISTICS macro.

        This patch removes the build warning below since r259275.
        warning: unused variable ‘sameSiteStrictEnforcementEnabled’ [-Wunused-variable]

        No new tests, no new behavior changes.

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):

2020-04-07  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthn] Cancel WebAuthn requests when users cancel LocalAuthentication prompts
        https://bugs.webkit.org/show_bug.cgi?id=209923
        <rdar://problem/61223713>

        Reviewed by Brent Fulgham.

        This patch intents to streamline WebAuthn local authenticator UX a bit more. Here, we should treat user
        cancellation of the LocalAuthentication UI as if it were being done on the UI Client's WebAuthn UI.

        * UIProcess/WebAuthentication/Authenticator.h:
        * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
        (WebKit::AuthenticatorManager::cancelRequest):
        * UIProcess/WebAuthentication/AuthenticatorManager.h:
        * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.h:
        * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
        (WebKit::LocalAuthenticator::continueMakeCredentialAfterUserVerification):
        (WebKit::LocalAuthenticator::continueGetAssertionAfterUserVerification):
        (WebKit::LocalAuthenticator::validateUserVerification const):
        * UIProcess/WebAuthentication/Cocoa/LocalConnection.h:
        * UIProcess/WebAuthentication/Cocoa/LocalConnection.mm:
        (WebKit::LocalConnection::verifyUser const):
        * UIProcess/WebAuthentication/Mock/MockLocalConnection.mm:
        (WebKit::MockLocalConnection::MockLocalConnection):
        (WebKit::MockLocalConnection::verifyUser const):
        (WebKit::MockLocalConnection::filterResponses const):
        * WebKit.xcodeproj/project.pbxproj:

2020-04-07  Sihui Liu  <sihui_liu@hotmail.com>

        [ macOS ] Update sandbox rules for storage
        https://bugs.webkit.org/show_bug.cgi?id=210120
        <rdar://problem/60972224>

        Reviewed by Geoffrey Garen.

        This direcotry is used for cookie storage.

        * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:

2020-04-07  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, reverting r259655.

        Caused assertion failures and timeouts on iOS bots

        Reverted changeset:

        "Return app-bound sessions for instances where
        WKAppBoundDomains is"
        https://bugs.webkit.org/show_bug.cgi?id=210124
        https://trac.webkit.org/changeset/259655

2020-04-07  Chris Dumez  <cdumez@apple.com>

        Merge DependencyAssertion into ProcessAssertion
        https://bugs.webkit.org/show_bug.cgi?id=210076

        Reviewed by Alex Christensen.

        Merge DependencyAssertion into ProcessAssertion. After r259610, ProcessAssertion can use
        RunningBoard assertions so there is no longer any need to a separate DependencyAssertion
        class. We can simply introduce a new assertion type to ProcessAssertion.

        * Shared/DependencyProcessAssertion.cpp: Removed.
        * Shared/DependencyProcessAssertion.h: Removed.
        * Shared/ios/DependencyProcessAssertionIOS.mm: Removed.
        * Sources.txt:
        * SourcesCocoa.txt:
        * UIProcess/ProcessAssertion.h:
        * UIProcess/ios/ProcessAssertionIOS.mm:
        (-[WKProcessAssertionBackgroundTaskManager init]):
        (-[WKProcessAssertionBackgroundTaskManager _hasBackgroundTask]):
        (-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]):
        (-[WKProcessAssertionBackgroundTaskManager _releaseBackgroundTask]):
        (WebKit::runningBoardNameForAssertionType):
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::initializeConnection):
        * WebProcess/WebProcess.h:

2020-04-07  Alex Christensen  <achristensen@webkit.org>

        Simplify and fortify network getNetworkProcessConnection and getGPUProcessConnection
        https://bugs.webkit.org/show_bug.cgi?id=210142
        <rdar://problem/59488963>

        Reviewed by Youenn Fablet.

        We have reports of hangs inside WebKit::getNetworkProcessConnection that seem to last forever.
        Some of the reports indicate the network process is being suspended while a connection is being established with it.

        To fix this issue we do three things:
        1. We take a foregroundActivity when sending an async message to establish a connection.
        2. We use sendWithAsyncReply which already has logic to handle the case where we are currently launching the process.
           Instead of the complicated retry logic, we add a retry attempt in WebProcessPool if the connection identifier is invalid.
        3. Add some release logging so we can better diagnose problems with this flow in the future.

        The functional change is adding the foreground activity, which should prevent some hangs.
        The rest is just to make this code more sane to understand and debug.
        I do the same changes to NetworkProcess and GPUProcess because they are intended to be the same.  The latter is based on the former.

        The API test WebKit.NetworkProcessCrashWithPendingConnection covers what happens when the network process crashes during connection establishment.
        It fails if we don't retry somewhere, which I did in WebProcessPool.  We also need to try again in getNetworkProcessConnection and getGPUProcessConnection.
        If it fails twice, there's nothing we can do, and we crash the web process to avoid a crash loop.

        * UIProcess/GPU/GPUProcessProxy.cpp:
        (WebKit::GPUProcessProxy::getGPUProcessConnection):
        (WebKit::GPUProcessProxy::didFinishLaunching):
        (WebKit::GPUProcessProxy::~GPUProcessProxy): Deleted.
        (WebKit::GPUProcessProxy::openGPUProcessConnection): Deleted.
        * UIProcess/GPU/GPUProcessProxy.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::~NetworkProcessProxy):
        (WebKit::NetworkProcessProxy::getNetworkProcessConnection):
        (WebKit::NetworkProcessProxy::networkProcessCrashed):
        (WebKit::NetworkProcessProxy::didFinishLaunching):
        (WebKit::NetworkProcessProxy::openNetworkProcessConnection): Deleted.
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::networkProcessCrashed):
        (WebKit::WebProcessPool::getNetworkProcessConnection):
        (WebKit::WebProcessPool::getGPUProcessConnection):
        * UIProcess/WebProcessPool.h:
        * WebProcess/GPU/GPUProcessConnectionInfo.h:
        (WebKit::GPUProcessConnectionInfo::identifier const):
        (WebKit::GPUProcessConnectionInfo::identifier): Deleted.
        * WebProcess/Network/NetworkProcessConnectionInfo.h:
        (WebKit::NetworkProcessConnectionInfo::identifier const):
        (WebKit::NetworkProcessConnectionInfo::identifier): Deleted.

2020-04-07  Simon Fraser  <simon.fraser@apple.com>

        Use RectEdges<> in some scrolling tree code
        https://bugs.webkit.org/show_bug.cgi?id=210141

        Reviewed by Tim Horton.
        
        Construct a RectEdges<>. Order is top, right, bottom, left.

        * WebProcess/WebPage/EventDispatcher.cpp:
        (WebKit::EventDispatcher::wheelEvent):

2020-04-07  Lauro Moura  <lmoura@igalia.com>

        [GLIB] Avoid potential segfault in getPlatformEditorState
        https://bugs.webkit.org/show_bug.cgi?id=210149

        Reviewed by Carlos Alberto Lopez Perez.

        Avoid potential surroundingRange dereference segfault.

        * WebProcess/WebPage/glib/WebPageGLib.cpp:
        (WebKit::WebPage::getPlatformEditorState const):

2020-04-07  Wenson Hsieh  <wenson_hsieh@apple.com>

        Preventing touch events should not prevent gestures installed above WKWebView from recognizing
        https://bugs.webkit.org/show_bug.cgi?id=210080
        <rdar://problem/61365814>

        Reviewed by Tim Horton.

        Makes a small adjustment to native gesture deferral logic, so that gestures installed above WKWebView (in the
        view hierarchy) are not prevented from recognizing by WKDeferringGestureRecognizer. This makes it possible for
        WebKit clients to install custom gestures outside of WKWebView that cannot be prevented by web content, without
        having to create a separate window and pass touches through to the WKWebView.

        Test: fast/events/touch/ios/prevent-default-with-window-tap-gesture.html

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView deferringGestureRecognizer:shouldDeferOtherGestureRecognizer:]):

2020-04-07  Brian Burg  <bburg@apple.com>

        Web Automation: Automation.inspectBrowsingContext should bring Web Inspector to front automatically
        https://bugs.webkit.org/show_bug.cgi?id=210137

        Reviewed by Joseph Pecoraro.

        * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
        (WebKit::WebAutomationSession::inspectBrowsingContext):
        Previously, calling connect() would preload Web Inspector but not show its window. This
        made it awkward to use the 'safari:automaticInspection' capability without subsequently
        evaluating a `debugger;` statement to bring Web Inspector to front.

2020-04-07  Kate Cheney  <katherine_cheney@apple.com>

        Return app-bound sessions for instances where WKAppBoundDomains is
        empty
        https://bugs.webkit.org/show_bug.cgi?id=210124
        <rdar://problem/61276630>

        Reviewed by Brent Fulgham.

        No new tests. Behavior confirmed by existing In-App Browser Privacy
        tests.

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::sessionWrapperForTask):
        Remove the flag checking if In-App Browser Privacy is enabled. We
        should return an app-bound session if WKAppBoundDomains is empty so
        we no longer need to check the flag here.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::setIsNavigatingToAppBoundDomain):
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
        * UIProcess/WebPageProxy.h:
        As described above, we no longer need to check the flag in this
        instance as we are determining behavior based on the WKAppBoundDomains
        list. Also moved the logic for checking an empty list to setIsNavigatingToAppBoundDomain,
        so it should take an Optional (WTF::nullopt indicates an empty list).

        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::initializeAppBoundDomains):
        Use the flag to enable internal debugging for testing purposes.

        * UIProcess/API/APIHTTPCookieStore.cpp:
        (API::HTTPCookieStore::filterAppBoundCookies):
        Flag no longer needed. This should be gated by whether the domains
        list is empty or not.

2020-04-07  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Add message to message filter in the WebContent sandbox
        https://bugs.webkit.org/show_bug.cgi?id=210130

        Reviewed by Brent Fulgham.

        Add a required syscall-mach message to the message filter in the WebContent sandbox on iOS.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

2020-04-07  Youenn Fablet  <youenn@apple.com>

        REGRESSION (r259383-259384): ASSERTION FAILED: 'Completion handler should always be called' seen with http/wpt/service-workers/service-worker-different-process.https.html
        https://bugs.webkit.org/show_bug.cgi?id=209977

        Reviewed by Chris Dumez.

        * UIProcess/AuxiliaryProcessProxy.cpp:
        (WebKit::AuxiliaryProcessProxy::~AuxiliaryProcessProxy):
        In case AuxiliaryProcessProxy has some enqueued messages but process crashes on launch for instance,
        we should call the completion handlers and fail.

2020-04-07  David Kilzer  <ddkilzer@apple.com>

        VisitedLinkStore.messages.in and VisitedLinkStore::addVisitedLinkHashFromPage() don't agree on type of `linkHash`
        <https://webkit.org/b/210094>
        <rdar://problem/60334644>

        Reviewed by Chris Dumez.

        * Scripts/webkit/messages.py:
        (types_that_cannot_be_forward_declared):
        - Don't forward-declare WebCore::SharedStringHash as a class
          since it is a uint32_t.
        * UIProcess/VisitedLinkStore.messages.in:
        - Use WebCore::SharedStringHash type for `linkHash` to fix the
          type mismatch.

2020-04-07  Chris Dumez  <cdumez@apple.com>

        Unreviewed, drop bad assertion introduced in r259610.

        On some bots (in particular OpenSource iOS ones), we are unable to take the assertion
        so this assertion does not hold true.

        * UIProcess/ios/ProcessAssertionIOS.mm:
        (WebKit::ProcessAssertion::ProcessAssertion):

2020-04-07  Rob Buis  <rbuis@igalia.com>

        Use GlobalFrameIdentifier in NavigationAction
        https://bugs.webkit.org/show_bug.cgi?id=210036

        Reviewed by Darin Adler.

        Adapt to API change.

        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):

2020-04-06  Kate Cheney  <katherine_cheney@apple.com>

        Create a way to signal if the WKAppBoundDomains list is empty
        https://bugs.webkit.org/show_bug.cgi?id=210074
        <rdar://problem/61359228>

        Reviewed by Brent Fulgham.

        Updates the WebFramePolicyListener to return an Optional<NavigatingToAppBoundDomain>
        to signal if the WKAppBoundDomains list is empty. If so, we don't want to update
        any app-bound domain parameters in WebPageProxy.

        * UIProcess/WebFramePolicyListenerProxy.cpp:
        (WebKit::WebFramePolicyListenerProxy::didReceiveAppBoundDomainResult):
        * UIProcess/WebFramePolicyListenerProxy.h:
        * UIProcess/WebFrameProxy.cpp:
        (WebKit::WebFrameProxy::setUpPolicyListenerProxy):
        * UIProcess/WebFrameProxy.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
        (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
        (WebKit::WebPageProxy::decidePolicyForResponseShared):
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::beginAppBoundDomainCheck):
        Changed the WebFramePolicyListener to take a NavigatingToAppBoundDomain
        type as opposed to a boolean to allow it to handle the empty value.

2020-04-06  Chris Dumez  <cdumez@apple.com>

        [iOS] Transition most process assertions to RunningBoard
        https://bugs.webkit.org/show_bug.cgi?id=210065
        <rdar://problem/61354901>

        Reviewed by Geoffrey Garen.

        Transition most process assertions to RunningBoard, instead of legacy BKSProcessAssertion.
        The only assertion that still uses BKSProcessAssertion is the MediaPlayback once because
        we do not have a RunningBoard equivalent for this one yet (see <rdar://problem/61263147>).

        * UIProcess/ProcessAssertion.h:
        * UIProcess/ios/ProcessAssertionIOS.mm:
        (-[WKRBSAssertionDelegate assertionWillInvalidate:]):
        (-[WKRBSAssertionDelegate assertion:didInvalidateWithError:]):
        (WebKit::runningBoardNameForAssertionType):
        (WebKit::ProcessAssertion::ProcessAssertion):
        (WebKit::ProcessAssertion::~ProcessAssertion):
        (WebKit::ProcessAssertion::processAssertionWasInvalidated):

2020-04-06  Ross Kirsling  <ross.kirsling@sony.com>

        Update minimum ICU version to 60.2
        https://bugs.webkit.org/show_bug.cgi?id=209694

        Reviewed by Darin Adler.

        * WebProcess/InjectedBundle/API/mac/WKDOMTextIterator.mm:
        (-[WKDOMTextIterator currentTextPointer]):
        Manually convert between UChar and UniChar/unichar where needed.

2020-04-06  Simon Fraser  <simon.fraser@apple.com>

        Make ScrollableArea TextStream-loggable
        https://bugs.webkit.org/show_bug.cgi?id=210042

        Reviewed by Darin Adler.

        ScrollableArea is a pure virtual base class, so has to dump via a virtual function,
        so add debugDescription() and implement it in derived classes.

        Make the common pattern be that operator<<(TextStream&, ...) calls debugDescription.

        * UIProcess/win/WebPopupMenuProxyWin.cpp:
        (WebKit::WebPopupMenuProxyWin::debugDescription const):
        * UIProcess/win/WebPopupMenuProxyWin.h:
        * WebProcess/Plugins/PDF/PDFPlugin.h:
        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit::PDFPlugin::debugDescription const):

2020-04-06  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, reverting r259469.
        https://bugs.webkit.org/show_bug.cgi?id=210066

        Introduced media playback regression (Requested by perarne on
        #webkit).

        Reverted changeset:

        "[iOS] Deny mach lookup access to the runningboard service in
        the WebContent process"
        https://bugs.webkit.org/show_bug.cgi?id=209933
        https://trac.webkit.org/changeset/259469

2020-04-06  Per Arne Vollan  <pvollan@apple.com>

        Unreviewed sandbox compile fix.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

2020-04-06  Víctor Manuel Jáquez Leal  <vjaquez@igalia.com>

        [GTK] Remove unused header in web process
        https://bugs.webkit.org/show_bug.cgi?id=210053

        Reviewed by Michael Catanzaro.

        Remove unused headers from code removed in r203774.

        No new tests required.

        * WebProcess/gtk/WebProcessMainGtk.cpp:

2020-04-06  Dean Jackson  <dino@apple.com>

        CrashTracer: MobileSafari at WebKit: WebKit::SystemPreviewController::updateProgress
        https://bugs.webkit.org/show_bug.cgi?id=210040
        rdar://51410841

        Reviewed by Darin Adler.

        It appears that the SystemPreviewController on WebPageProxy can
        become null causing a call to an in-progress download to crash
        as it tries to talk to the QuickLook delegate. Guard against this
        by checking the SystemPreviewController each time.

        * UIProcess/Cocoa/DownloadClient.mm:
        (WebKit::systemPreviewController):
        (WebKit::DownloadClient::didReceiveResponse):
        (WebKit::DownloadClient::didReceiveData):
        (WebKit::DownloadClient::processDidCrash):
        (WebKit::DownloadClient::didFinish):
        (WebKit::DownloadClient::didFail):
        (WebKit::DownloadClient::didCancel):

2020-04-06  Chris Dumez  <cdumez@apple.com>

        ProcessAssertion should use ASCIILiteral for its reason
        https://bugs.webkit.org/show_bug.cgi?id=210049

        Reviewed by Alex Christensen.

        ProcessAssertion should use ASCIILiteral for its reason, instead of a String.

        * Shared/ios/DependencyProcessAssertionIOS.mm:
        (WebKit::DependencyProcessAssertion::DependencyProcessAssertion):
        * UIProcess/ProcessAssertion.cpp:
        (WebKit::ProcessAssertion::ProcessAssertion):
        * UIProcess/ProcessAssertion.h:
        * UIProcess/ios/ProcessAssertionIOS.mm:
        (WebKit::ProcessAssertion::ProcessAssertion):
        (WebKit::ProcessAndUIAssertion::ProcessAndUIAssertion):

2020-04-04  Darin Adler  <darin@apple.com>

        Stop using live ranges in DocumentMarkerController
        https://bugs.webkit.org/show_bug.cgi?id=209985

        Reviewed by Antti Koivisto.

        * UIProcess/ViewSnapshotStore.h: Removed unused "Cocoa without IOSurface" code paths.
        * UIProcess/mac/ViewSnapshotStoreMac.mm:
        (WebKit::ViewSnapshot::create): Ditto.
        (WebKit::ViewSnapshot::ViewSnapshot): Ditto.
        (WebKit::ViewSnapshot::setSurface): Ditto.
        (WebKit::ViewSnapshot::hasImage const): Ditto.
        (WebKit::ViewSnapshot::clearImage): Ditto.
        (WebKit::ViewSnapshot::setVolatile): Ditto.
        (WebKit::ViewSnapshot::asLayerContents): Ditto.
        (WebKit::ViewSnapshot::asImageForTesting): Ditto.
        (WebKit::ViewSnapshotStore::snapshottingContext): Deleted.

        * WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.mm:
        (WebKit::TextCheckingControllerProxy::replaceRelativeToSelection): Updated since
        addPlatformTextCheckingMarker no longer exists.
        (WebKit::TextCheckingControllerProxy::removeAnnotationRelativeToSelection):
        Updated since filterMarkers passes a reference instead of a pointer now.
        (WebKit::TextCheckingControllerProxy::annotatedSubstringBetweenPositions):
        Simplified code a bit by removing local variables.

        * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
        (WebKit::WebPage::dictionaryPopupInfoForRange): Use
        RenderObject::absoluteTextQuads.
        * WebProcess/WebPage/mac/WebPageMac.mm:
        (WebKit::WebPage::performImmediateActionHitTestAtLocation): Use
        RenderObject::absoluteTextQuads and unitedBoundingBoxes.

2020-04-06  Per Arne Vollan  <pvollan@apple.com>

        Add syscall to the WebContent sandbox
        https://bugs.webkit.org/show_bug.cgi?id=210048

        Reviewed by Brent Fulgham.

        Add a required syscall to the WebContent sandbox on iOS and macOS.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
        * WebProcess/com.apple.WebProcess.sb.in:

2020-04-06  youenn fablet  <youenn@apple.com>

        Add HEVC support in GPU Process for WebRTC
        https://bugs.webkit.org/show_bug.cgi?id=209857

        Reviewed by Eric Carlson.

        * GPUProcess/webrtc/LibWebRTCCodecsProxy.h:
        * GPUProcess/webrtc/LibWebRTCCodecsProxy.messages.in:
        * GPUProcess/webrtc/LibWebRTCCodecsProxy.mm:
        (WebKit::LibWebRTCCodecsProxy::createH264Decoder):
        (WebKit::LibWebRTCCodecsProxy::createH265Decoder):
        (WebKit::LibWebRTCCodecsProxy::createEncoder):
        (WebKit::LibWebRTCCodecsProxy::createDecoder): Deleted.
        * WebProcess/GPU/webrtc/LibWebRTCCodecs.cpp:
        (WebKit::createVideoDecoder):
        (WebKit::createVideoEncoder):
        (WebKit::LibWebRTCCodecs::createDecoder):
        (WebKit::formatNameFromCodecType):
        (WebKit::LibWebRTCCodecs::createEncoder):
        * WebProcess/GPU/webrtc/LibWebRTCCodecs.h:

2020-04-05  Don Olmstead  <don.olmstead@sony.com>

        [CMake] Add WebKit::WebKit target
        https://bugs.webkit.org/show_bug.cgi?id=210033

        Reviewed by Fujii Hironori.

        Use WEBKIT_EXECUTABLE macros for the Process executables. Rename the output
        file names to fit with the macro's expectations.

        Add Headers.cmake which lists out all the public headers that are currently
        shared by the PlayStation and Windows ports. This is then included on each
        platform that is using it. Additionally use WEBKIT_COPY_FILES to create a
        target which copies headers.

        Finally use WEBKIT_FRAMEWORK_TARGET to create a WebKit target. Its dependent
        on the WebKit library itself, the processes being built, and any headers that
        are copied. This ensures that everything is built for dependent targets.

        * CMakeLists.txt:
        * Headers.cmake: Copied from Source/WebKit/PlatformPlayStation.cmake.
        * PlatformFTW.cmake:
        * PlatformGTK.cmake:
        * PlatformMac.cmake:
        * PlatformPlayStation.cmake:
        * PlatformWPE.cmake:
        * PlatformWin.cmake:

2020-04-05  Zan Dobersek  <zdobersek@igalia.com>

        Unreviewed, adding missing header inclusions to get
        non-unified build building.

        * Shared/UserContentControllerParameters.cpp:

2020-04-04  Wenson Hsieh  <wenson_hsieh@apple.com>

        Add a fourth round of logging to help diagnose <webkit.org/b/209685>
        https://bugs.webkit.org/show_bug.cgi?id=210011

        Reviewed by Darin Adler.

        Remove all logging previously added to WKContentView and DragDropInteractionState.

        * UIProcess/ios/DragDropInteractionState.mm:
        (WebKit::DragDropInteractionState::stageDragItem):
        (WebKit::DragDropInteractionState::clearStagedDragSource):
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _didHandleDragStartRequest:]):

2020-04-04  Chris Dumez  <cdumez@apple.com>

        [iOS] Simplify ProcessAssertion class in preparation for switch to RunningBoard
        https://bugs.webkit.org/show_bug.cgi?id=209984
        <rdar://problem/61273941>

        Reviewed by Darin Adler.

        Simplify ProcessAssertion class in preparation for switch to RunningBoard. There
        is a slight mismatch between the way BKS and RunningBoard process assertion API.
        This refactoring makes it so that we can use the same ProcessAssertion class in
        WebKit to work with either BKS or RunningBoard. Support for RunningBoard will
        come later.

        In particular, the following changes were made:
        - Replace AssertionState & AssertionReason enums with a single ProcessAssertionType
          one since RunningBoard does not have 2 separate concepts.
        - Drop ProcessAssertion::setState() since it is not possible to change the flags
          on an existing RunningBoard assertion. Instead, we are expected to create a
          brand new process assertion of the expected type.

        * NetworkProcess/Downloads/DownloadMap.cpp:
        (WebKit::DownloadMap::add):
        * Platform/IPC/cocoa/ConnectionCocoa.mm:
        (IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog):
        * UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h:
        * UIProcess/API/Cocoa/WKWebViewTesting.mm:
        (-[WKWebView _setAssertionTypeForTesting:]):
        (-[WKWebView _setAssertionStateForTesting:]): Deleted.
        * UIProcess/Downloads/DownloadProxyMap.cpp:
        (WebKit::DownloadProxyMap::createDownloadProxy):
        * UIProcess/GPU/GPUProcessProxy.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::sendProcessDidResume):
        (WebKit::NetworkProcessProxy::takeUploadAssertion):
        (WebKit::NetworkProcessProxy::didSetAssertionState): Deleted.
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/ProcessAssertion.cpp:
        (WebKit::ProcessAssertion::ProcessAssertion):
        (WebKit::ProcessAssertion::setState): Deleted.
        * UIProcess/ProcessAssertion.h:
        (WebKit::ProcessAssertion::type const):
        (WebKit::ProcessAssertion::state const): Deleted.
        * UIProcess/ProcessThrottler.cpp:
        (WebKit::ProcessThrottler::expectedAssertionType):
        (WebKit::ProcessThrottler::updateAssertionTypeNow):
        (WebKit::ProcessThrottler::setAssertionType):
        (WebKit::ProcessThrottler::updateAssertionIfNeeded):
        (WebKit::ProcessThrottler::didConnectToProcess):
        (WebKit::ProcessThrottler::prepareToSuspendTimeoutTimerFired):
        (WebKit::ProcessThrottler::processReadyToSuspend):
        (WebKit::ProcessThrottler::sendPrepareToSuspendIPC):
        (WebKit::ProcessThrottler::expectedAssertionState): Deleted.
        (WebKit::ProcessThrottler::updateAssertionStateNow): Deleted.
        (WebKit::ProcessThrottler::setAssertionState): Deleted.
        * UIProcess/ProcessThrottler.h:
        * UIProcess/ProcessThrottlerClient.h:
        (WebKit::ProcessThrottlerClient::didSetAssertionType):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::setWebProcessHasUploads):
        (WebKit::WebProcessPool::setWebProcessIsPlayingAudibleMedia):
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::didSetAssertionType):
        (WebKit::WebProcessProxy::didSetAssertionState): Deleted.
        * UIProcess/WebProcessProxy.h:
        (WebKit::WebProcessProxy::setAssertionTypeForTesting):
        (WebKit::WebProcessProxy::setAssertionStateForTesting): Deleted.
        * UIProcess/ios/ProcessAssertionIOS.mm:
        (WebKit::flagsForAssertionType):
        (WebKit::toBKSProcessAssertionReason):
        (WebKit::ProcessAssertion::ProcessAssertion):
        (WebKit::ProcessAndUIAssertion::updateRunInBackgroundCount):
        (WebKit::ProcessAndUIAssertion::ProcessAndUIAssertion):
        (WebKit::flagsForState): Deleted.
        (WebKit::reasonForState): Deleted.
        (WebKit::ProcessAssertion::setState): Deleted.
        (WebKit::ProcessAndUIAssertion::setState): Deleted.

2020-04-04  David Kilzer  <ddkilzer@apple.com>

        [GPUP] Remove unnecessary RemoteCDMInstanceSessionIdentifier argument from RemoteCDMFactory::addSession()
        <https://webkit.org/b/210006>

        Reviewed by Darin Adler.

        * WebProcess/GPU/media/RemoteCDMFactory.cpp:
        (WebKit::RemoteCDMFactory::addSession):
        - Remove argument. Use `session` parameter to retrieve the ID.
        * WebProcess/GPU/media/RemoteCDMFactory.h:
        (WebKit::RemoteCDMFactory::addSession):
        - Remove argument.
        * WebProcess/GPU/media/RemoteCDMInstance.cpp:
        (WebKit::RemoteCDMInstance::createSession):
        - Remove argument.

2020-04-04  Wenson Hsieh  <wenson_hsieh@apple.com>

        Add even more logging to try and diagnose <webkit.org/b/209685>
        https://bugs.webkit.org/show_bug.cgi?id=210008

        Reviewed by Tim Horton.

        Revert all (except one) of the logging statements added in r259518, and add several new ones. This last logging
        pass demonstrated that DragController had failed to start a drag, since -[WKContentView _didHandleDragStartRequest:]
        receives word that the drag has started, yet there are no staged drag items.

        * UIProcess/ios/DragDropInteractionState.mm:
        (WebKit::DragDropInteractionState::stageDragItem):
        (WebKit::DragDropInteractionState::clearStagedDragSource):
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _didHandleAdditionalDragItemsRequest:]):
        (-[WKContentView cleanUpDragSourceSessionState]):
        (-[WKContentView _didPerformDragOperation:]):
        (-[WKContentView _prepareToDragPromisedAttachment:]):
        (-[WKContentView _dragInteraction:prepareForSession:completion:]):
        (-[WKContentView dragInteraction:itemsForBeginningSession:]):
        (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]):
        (-[WKContentView dragInteraction:sessionWillBegin:]):
        (-[WKContentView dragInteraction:session:didEndWithOperation:]):
        (-[WKContentView dragInteraction:item:willAnimateCancelWithAnimator:]):
        (-[WKContentView dropInteraction:canHandleSession:]):
        (-[WKContentView dropInteraction:sessionDidEnter:]):
        (-[WKContentView dropInteraction:sessionDidExit:]):
        (-[WKContentView dropInteraction:performDrop:]):
        (-[WKContentView dropInteraction:sessionDidEnd:]):

2020-04-03  David Kilzer  <ddkilzer@apple.com>

        WebPlatformStrategies::{readBufferFromPasteboard,bufferForType} should validate their `size` parameter
        <https://webkit.org/b/209997>
        <rdar://problem/60890565>

        Reviewed by Wenson Hsieh.

        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
        (WebKit::WebPlatformStrategies::bufferForType):
        (WebKit::WebPlatformStrategies::readBufferFromPasteboard):
        - Validate the `size` parameter.

2020-04-03  Wenson Hsieh  <wenson_hsieh@apple.com>

        The IPC message “registerAttachmentsFromSerializedData" should be capitalized
        https://bugs.webkit.org/show_bug.cgi?id=209995
        <rdar://problem/61283172>

        Reviewed by Tim Horton.

        Tweak the name of this IPC message so that it begins with a capital letter. No change in behavior.

        * UIProcess/WebPageProxy.messages.in:
        * WebProcess/WebCoreSupport/WebEditorClient.cpp:
        (WebKit::WebEditorClient::registerAttachments):

2020-04-03  Alex Christensen  <achristensen@webkit.org>

        Add SPI to make WKUserScripts wait for a notification
        https://bugs.webkit.org/show_bug.cgi?id=209845
        <rdar://problem/60342299>

        Reviewed by Chris Dumez.

        * Shared/API/c/WKSharedAPICast.h:
        (WebKit::toUserScriptInjectionTime):
        (WebKit::toWKUserScriptInjectionTime):
        (WebKit::toUserContentInjectedFrames):
        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:
        * Shared/WebUserContentControllerDataTypes.cpp:
        (WebKit::WebUserScriptData::decode):
        * UIProcess/API/APIPageConfiguration.h:
        (API::PageConfiguration::userScriptsShouldWaitUntilNotification const):
        (API::PageConfiguration::setUserScriptsShouldWaitUntilNotification):
        * UIProcess/API/APIUserScript.h:
        * UIProcess/API/C/WKPageGroup.cpp:
        (WKPageGroupAddUserScript):
        * UIProcess/API/C/WKUserScriptRef.cpp:
        (WKUserScriptCreateWithSource):
        (WKUserScriptGetMainFrameOnly):
        * UIProcess/API/Cocoa/WKUserScript.mm:
        (-[WKUserScript initWithSource:injectionTime:forMainFrameOnly:]):
        (-[WKUserScript isForMainFrameOnly]):
        (-[WKUserScript _initWithSource:injectionTime:forMainFrameOnly:legacyWhitelist:legacyBlacklist:userContentWorld:]):
        (-[WKUserScript _initWithSource:injectionTime:forMainFrameOnly:legacyWhitelist:legacyBlacklist:associatedURL:userContentWorld:]):
        (-[WKUserScript _initWithSource:injectionTime:forMainFrameOnly:legacyWhitelist:legacyBlacklist:contentWorld:]):
        (-[WKUserScript _initWithSource:injectionTime:forMainFrameOnly:legacyWhitelist:legacyBlacklist:associatedURL:contentWorld:]):
        (-[WKUserScript _initWithSource:injectionTime:forMainFrameOnly:legacyWhitelist:legacyBlacklist:associatedURL:contentWorld:waitForNotification:]):
        * UIProcess/API/Cocoa/WKUserScriptInternal.h:
        (API::toWebCoreUserScriptInjectionTime):
        (API::toWKUserScriptInjectionTime):
        * UIProcess/API/Cocoa/WKUserScriptPrivate.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _notifyUserScripts]):
        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
        (-[WKWebViewConfiguration _userScriptsShouldWaitUntilNotification]):
        (-[WKWebViewConfiguration _setUserScriptsShouldWaitUntilNotification:]):
        * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/API/Cocoa/_WKUserStyleSheet.mm:
        (-[_WKUserStyleSheet initWithSource:forMainFrameOnly:]):
        (-[_WKUserStyleSheet initWithSource:forWKWebView:forMainFrameOnly:userContentWorld:]):
        (-[_WKUserStyleSheet initWithSource:forMainFrameOnly:legacyWhitelist:legacyBlacklist:userContentWorld:]):
        (-[_WKUserStyleSheet initWithSource:forMainFrameOnly:legacyWhitelist:legacyBlacklist:baseURL:userContentWorld:]):
        (-[_WKUserStyleSheet isForMainFrameOnly]):
        * UIProcess/WebPageProxy.cpp:
        * UIProcess/WebPageProxy.h:
        * WebProcess/UserContent/WebUserContentController.cpp:
        (WebKit::WebUserContentController::addUserScriptInternal):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_processDisplayName):
        (WebKit::WebPage::notifyUserScripts):
        (WebKit::WebPage::addUserScript):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2020-04-03  Alex Christensen  <achristensen@webkit.org>

        Use AuthenticationChallenge instead of AuthenticationChallengeProxy for ResourceLoadDelegate
        https://bugs.webkit.org/show_bug.cgi?id=207639

        Reviewed by David Kilzer.

        In r254345 my younger and more naive self used AuthenticationChallengeProxy instead of AuthenticationChallenge
        because he didn't know about the WebCore::mac function, which is called by AuthenticationChallengeProxy, and it's
        all I needed to get an NSURLAuthenticationChallenge.  Skipping the AuthenticationChallengeProxy step cleans up
        AuthenticationChallengeProxy by removing the unnecessary ability to have a null CompletionHandler.

        Covered by existing tests.

        * UIProcess/API/APIResourceLoadClient.h:
        * UIProcess/Authentication/AuthenticationChallengeProxy.cpp:
        (WebKit::AuthenticationChallengeProxy::AuthenticationChallengeProxy):
        (): Deleted.
        * UIProcess/Cocoa/ResourceLoadDelegate.h:
        * UIProcess/Cocoa/ResourceLoadDelegate.mm:
        (WebKit::ResourceLoadDelegate::ResourceLoadClient::didReceiveChallenge const):
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::resourceLoadDidReceiveChallenge):
        * UIProcess/WebPageProxy.cpp:
        * UIProcess/WebPageProxy.h:

2020-04-03  Kate Cheney  <katherine_cheney@apple.com>

        Prevent non app-bound domain cookies from being read or set using API calls
        https://bugs.webkit.org/show_bug.cgi?id=209926
        <rdar://problem/61071428>

        Reviewed by Brady Eidson.

        This patch filters out setting and fetching of cookies via API call 
        to only set or return app-bound cookies.

        * UIProcess/API/APIHTTPCookieStore.cpp:
        (API::HTTPCookieStore::filterAppBoundCookies):
        This function queries the websiteDataStore for the WKAppBoundDomains
        entries and filters out non app-bound domains.

        (API::HTTPCookieStore::cookies):
        (API::HTTPCookieStore::cookiesForURL):
        (API::HTTPCookieStore::setCookies):
        These functions were updated to set/return the cookies after they've
        been filtered through the WKAppBoundDomains.

        * UIProcess/API/APIHTTPCookieStore.h:
        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _appBoundDomains:]):
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::getAppBoundDomains const):
        (WebKit::WebsiteDataStore::appBoundDomainsForTesting const): Deleted.
        Utilize a function formerly used for testing only to be used in the
        HTTPCookieStore.

        * UIProcess/WebsiteData/WebsiteDataStore.h:

2020-04-03  Wenson Hsieh  <wenson_hsieh@apple.com>

        Add more logging to help diagnose <webkit.org/b/209685>
        https://bugs.webkit.org/show_bug.cgi?id=209988

        Reviewed by Timothy Hatcher.

        Replace logging that was previously added in r259465 with different logging. The fact that the prior logging
        never showed up in the failing tests suggests that the problem happens earlier than I had expected, so we need
        to ensure that codepaths for preparing and beginning a drag session are logged instead.

        This turns several existing `RELEASE_LOG`s in WKContentView into `NSLog`s, so that they will show up in test
        failure output when run on the bots.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _didHandleAdditionalDragItemsRequest:]):
        (-[WKContentView _didHandleDragStartRequest:]):
        (-[WKContentView cleanUpDragSourceSessionState]):
        (-[WKContentView _didPerformDragOperation:]):
        (-[WKContentView _prepareToDragPromisedAttachment:]):
        (-[WKContentView _dragInteraction:prepareForSession:completion:]):
        (-[WKContentView dragInteraction:itemsForBeginningSession:]):
        (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]):
        (-[WKContentView dragInteraction:sessionWillBegin:]):
        (-[WKContentView dragInteraction:session:didEndWithOperation:]):
        (-[WKContentView dragInteraction:item:willAnimateCancelWithAnimator:]):
        (-[WKContentView dropInteraction:canHandleSession:]):
        (-[WKContentView dropInteraction:sessionDidEnter:]):
        (-[WKContentView dropInteraction:sessionDidUpdate:]):
        (-[WKContentView dropInteraction:sessionDidExit:]):
        (-[WKContentView dropInteraction:performDrop:]):
        (-[WKContentView dropInteraction:sessionDidEnd:]):

2020-04-03  Chris Dumez  <cdumez@apple.com>

        [iOS] Give RunningBoard entitlement to all our child processes
        https://bugs.webkit.org/show_bug.cgi?id=209986
        <rdar://problem/61275270>

        Reviewed by Geoffrey Garen.

        Give RunningBoard entitlement to all our child processes on iOS. As we are
        transitioning to RunningBoard process assertions, it is important for the
        target process of those assertion to have the 
        com.apple.runningboard.assertions.webkit entitlement.

        * Scripts/process-entitlements.sh:

2020-04-03  Truitt Savell  <tsavell@apple.com>

        Unreviewed, reverting r259440.

        Introduced 2 failing tests on Mac and iOS

        Reverted changeset:

        "Add SPI to configure WebsiteDataStores with a URL for
        standalone web applications and use it to disable first-party
        website data removal in ITP"
        https://bugs.webkit.org/show_bug.cgi?id=209634
        https://trac.webkit.org/changeset/259440

2020-04-03  Tim Horton  <timothy_horton@apple.com>

        Add a visual debug indicator for locating and identifying all kinds of WebViews
        https://bugs.webkit.org/show_bug.cgi?id=209982
        <rdar://problem/60339870>

        Reviewed by Simon Fraser.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]):
        * UIProcess/API/mac/WKView.mm:
        (-[WKView initWithFrame:processPool:configuration:]):
        Adopt in WKWebView and WKView.

2020-04-03  Kate Cheney  <katherine_cheney@apple.com>

        Remove _setIsNavigatingToAppBoundDomain testing SPI
        https://bugs.webkit.org/show_bug.cgi?id=209973
        <rdar://problem/61264350>

        Reviewed by David Kilzer.

        This SPI is no longer needed to set a webView as navigating to an
        app-bound domain. We can now load a local file instead.

        No new tests, confirmed behavior by existing tests.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _setIsNavigatingToAppBoundDomain:completionHandler:]): Deleted.
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::setIsNavigatingToAppBoundDomainTesting): Deleted.
        * UIProcess/WebPageProxy.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::setIsNavigatingToAppBoundDomainTesting): Deleted.
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2020-04-03  Per Arne Vollan  <pvollan@apple.com>

        Unreviewed sandbox compile fix.

        * WebProcess/com.apple.WebProcess.sb.in:

2020-04-03  David Kilzer  <ddkilzer@apple.com>

        [Cocoa] Update MESSAGE_CHECK macros used in WebProcessProxy::didCreateSleepDisabler/WebProcessProxy::didDestroySleepDisabler
        <https://webkit.org/b/209981>
        <rdar://problem/61237674>

        Reviewed by Darin Adler.

        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::didCreateSleepDisabler):
        - Remove MESSAGE_CHECK for `identifier` since decoding detects
          invalid values.
        - Add MESSAGE_CHECK for `reason` since a NULL string would cause
          CFStringCreateWithCString() to crash later.
        (WebKit::WebProcessProxy::didDestroySleepDisabler):
        - Remove MESSAGE_CHECK for `identifier` since decoding detects
          invalid values.

2020-04-03  Megan Gardner  <megan_gardner@apple.com>

        Color Form Control does not come up on second selection in macCatalyst
        https://bugs.webkit.org/show_bug.cgi?id=209939
        <rdar://problem/61131345>

        Reviewed by Wenson Hsieh.

        On selection and manual dismissal of the form, we need to also call accessoryDone,
        as the UIKit callbacks are not called on manual dismissal.

        * UIProcess/ios/forms/WKFormColorPicker.mm:
        (-[WKColorPicker colorMatrixView:didTapColorButton:]):

2020-04-03  Brent Fulgham  <bfulgham@apple.com>

        [macOS] Update sandbox rules for correct sanitizer paths in current OS releases
        https://bugs.webkit.org/show_bug.cgi?id=209818
        <rdar://problem/58422996>

        Unreviewed follow-up based on feedback from the sanitizer team.

        The change in r259317 left the original, incorrect, 'literal' form of the path, rather
        than the correct 'subpath' form. This corrects that issue.

        * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
        * WebProcess/com.apple.WebProcess.sb.in:

2020-04-03  Brent Fulgham  <bfulgham@apple.com>

        Remove unneeded sandbox access to some file paths
        https://bugs.webkit.org/show_bug.cgi?id=209938
        <rdar://problem/59529620>

        Reviewed by Per Arne Vollan.

        Remove unnecessary access to some locations in /etc. These may have been needed in
        the past, but the WebContent process no longer requires this access. We should
        remove it.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
        * WebProcess/com.apple.WebProcess.sb.in:

2020-04-03  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Deny mach lookup access to the runningboard service in the WebContent process
        https://bugs.webkit.org/show_bug.cgi?id=209933
        <rdar://problem/56995639>

        Reviewed by Brent Fulgham.

        On iOS, after <https://trac.webkit.org/changeset/258180/webkit>, mach lookup access to "com.apple.runningboard"
        can be denied in the WebContent process.

        Test: fast/sandbox/ios/sandbox-mach-lookup.html

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

2020-04-03  Diego Pino Garcia  <dpino@igalia.com>

        REGRESSION(r259401): [GTK] Check surroundingRange is not null
        https://bugs.webkit.org/show_bug.cgi?id=209966

        Reviewed by Darin Adler & Philippe Normand.

        * WebProcess/WebPage/glib/WebPageGLib.cpp:
        (WebKit::WebPage::getPlatformEditorState const):

2020-04-03  David Kilzer  <ddkilzer@apple.com>

        [Xcode] Replace ASAN_OTHER_CFLAGS and ASAN_OTHER_CPLUSPLUSFLAGS with $(inherited)
        <https://webkit.org/b/209963>
        <rdar://problem/61257504>

        Reviewed by Alexey Proskuryakov.

        * Configurations/Base.xcconfig:
        - Remove ASAN_OTHER_CFLAGS, ASAN_OTHER_CPLUSPLUSFLAGS and
          ASAN_OTHER_LDFLAGS.

2020-04-03  Wenson Hsieh  <wenson_hsieh@apple.com>

        Add logging to help diagnose <webkit.org/b/209685>
        https://bugs.webkit.org/show_bug.cgi?id=209967

        Reviewed by Darin Adler.

        See WebCore/ChangeLog.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView dropInteraction:sessionDidUpdate:]):

2020-04-03  youenn fablet  <youenn@apple.com>

        ServiceWorkerFetchTask::timeoutTimerFired should not call contextClosed
        https://bugs.webkit.org/show_bug.cgi?id=209906
        <rdar://problem/61207801>

        Reviewed by Chris Dumez.

        Covered by http/tests/workers/service/basic-timeout.https.html no longer crashing.

        * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp:
        (WebKit::ServiceWorkerFetchTask::timeoutTimerFired):
        We should not call contextClosed now that we are nullying m_swServerConnection in contextClosed.
        Instead, we should just call cannotHandle since the timer can only fire if we have not yet received any response.

2020-04-03  Adrian Perez de Castro  <aperez@igalia.com>

        Unreviewed fix after r259382

        Rubber-stamped by Carlos Garcia Campos.

        No new tests needed.

        * UIProcess/API/glib/WebKitWebContext.cpp:
        (webkit_web_context_register_uri_scheme): Change g_return_if_fail()
        calls to actually check that the passed scheme is not one of the
        special ones.

2020-04-03  youenn fablet  <youenn@apple.com>

        Add initial support for WebRTC HEVC
        https://bugs.webkit.org/show_bug.cgi?id=204283

        Reviewed by Eric Carlson.

        Remove VP8 runtime flag and add a H365 runtime flag instead.

        * Shared/WebPreferences.yaml:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::updatePreferences):

2020-04-03  Yousuke Kimoto  <yousuke.kimoto@sony.com>

        FileSystem handle leaks in CurlCacheManager and NetworkCacheData when failed to open a file
        https://bugs.webkit.org/show_bug.cgi?id=209949

        Reviewed by Fujii Hironori.

        A file handle of FileSystem is not closed when the file handle doesn't
        return its status. The handle should be released before returning.

        No new tests, no behavior change.

        * NetworkProcess/cache/NetworkCacheData.cpp:
        (WebKit::NetworkCache::mapFile):

2020-04-03  Peng Liu  <peng.liu6@apple.com>

        WebCore::HTMLMediaElement::mediaCanStart crashes
        https://bugs.webkit.org/show_bug.cgi?id=209950

        Reviewed by Jer Noble.

        UserMediaPermissionRequestManager does not need to inherit from
        CanMakeWeakPtr<UserMediaPermissionRequestManager> because its
        parent class MediaCanStartListener supports WeakPtr now.

        * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:

2020-04-02  John Wilander  <wilander@apple.com>

        Add SPI to configure WebsiteDataStores with a URL for standalone web applications and use it to disable first-party website data removal in ITP
        https://bugs.webkit.org/show_bug.cgi?id=209634
        <rdar://problem/60943970>

        Reviewed by Alex Christensen.

        This change adds a new property to _WKWebsiteDataStoreConfiguration.h called
        standaloneApplicationURL with which the hosting application can inform the
        website data store that it's running as a standalone web application.

        This change also forwards an existing standaloneApplicationURL as a
        WebCore::RegistrableDomain into ITP so that explicit exemptions can be made
        to first parties of standalone web applications. The exemptions made here
        all for all of ITP's website data removal. This part of the change is
        covered by the new layout tests.

        Tests: http/tests/resourceLoadStatistics/standalone-web-application-exempt-from-website-data-deletion-database.html
               http/tests/resourceLoadStatistics/standalone-web-application-exempt-from-website-data-deletion.html

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
        (WebKit::ResourceLoadStatisticsMemoryStore::registrableDomainsToDeleteOrRestrictWebsiteDataFor):
        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
        (WebKit::ResourceLoadStatisticsStore::setStandaloneApplicationDomain):
        (WebKit::ResourceLoadStatisticsStore::standaloneApplicationDomain const):
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::setStandaloneApplicationDomain):
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::NetworkSession):
        (WebKit::NetworkSession::forwardResourceLoadStatisticsSettings):
        * NetworkProcess/NetworkSession.h:
        * Shared/ResourceLoadStatisticsParameters.h:
        (WebKit::ResourceLoadStatisticsParameters::encode const):
        (WebKit::ResourceLoadStatisticsParameters::decode):
        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
        (-[_WKWebsiteDataStoreConfiguration standaloneApplicationURL]):
        (-[_WKWebsiteDataStoreConfiguration setStandaloneApplication:]):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::platformSetNetworkParameters):
        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
        (WebKit::WebsiteDataStoreConfiguration::copy const):
        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
        (WebKit::WebsiteDataStoreConfiguration::standaloneApplicationURL const):
        (WebKit::WebsiteDataStoreConfiguration::setStandaloneApplicationURL):

2020-04-02  Per Arne Vollan  <pvollan@apple.com>

        Unreviewed build fix after r259396.

        * Shared/mac/AuxiliaryProcessMac.mm:

2020-04-02  David Kilzer  <ddkilzer@apple.com>

        WebPageProxy attachment methods should return early if attachment element is not enabled
        <https://webkit.org/b/209451>
        <rdar://problem/60253260>

        Reviewed by Chris Dumez.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::registerAttachmentIdentifierFromData):
        (WebKit::WebPageProxy::registerAttachmentIdentifierFromFilePath):
        (WebKit::WebPageProxy::registerAttachmentIdentifier):
        (WebKit::WebPageProxy::registerAttachmentsFromSerializedData):
        (WebKit::WebPageProxy::cloneAttachmentData):
        (WebKit::WebPageProxy::serializedAttachmentDataForIdentifiers):
        (WebKit::WebPageProxy::didInsertAttachmentWithIdentifier):
        - Add a message check for the attachment element being enabled.
        (WebKit::WebPageProxy::didRemoveAttachmentWithIdentifier): Ditto.
        - Also add a missing message check to validate `identifier`.

2020-04-02  Chris Dumez  <cdumez@apple.com>

        [iOS] Replace UIKit background task with a RunningBoard FinishTaskInterruptable assertion
        https://bugs.webkit.org/show_bug.cgi?id=209825
        <rdar://problem/61118503>

        Reviewed by Geoffrey Garen.

        Replace UIKit background task with a RunningBoard FinishTaskInterruptable assertion on iOS.
        Our UIProcess gets terminated too frequently when the UIKit background task expires when
        the UIProcess holds it for longer than 30 seconds in the background. The RunningBoard
        FinishTaskInterruptable assertion is supposed to be equivalent but would cause suspension
        of our UIProcess on expiration, instead of termination.

        * UIProcess/ios/ProcessAssertionIOS.mm:
        (-[WKProcessAssertionBackgroundTaskManager init]):
        (-[WKProcessAssertionBackgroundTaskManager _scheduleReleaseTask]):
        (-[WKProcessAssertionBackgroundTaskManager _cancelPendingReleaseTask]):
        (-[WKProcessAssertionBackgroundTaskManager _hasBackgroundTask]):
        (-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]):
        (-[WKProcessAssertionBackgroundTaskManager assertionWillInvalidate:]):
        (-[WKProcessAssertionBackgroundTaskManager assertion:didInvalidateWithError:]):
        (-[WKProcessAssertionBackgroundTaskManager _handleBackgroundTaskExpiration]):
        (-[WKProcessAssertionBackgroundTaskManager _releaseBackgroundTask]):

2020-04-02  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Allow use of syscall from the WebContent sandbox
        https://bugs.webkit.org/show_bug.cgi?id=209920
        <rdar://problem/58743778>

        Reviewed by Darin Adler.

        Add syscall to the WebContent sandbox on iOS.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

2020-04-02  Brent Fulgham  <bfulgham@apple.com>

        [iOS] Remove use of 'apple-signed-executable?' from Sandbox
        https://bugs.webkit.org/show_bug.cgi?id=209914
        <rdar://problem/45088481>

        Reviewed by Per Arne Vollan.

        Some of the rules imported from the system sandbox make decisions based on whether the software is
        an apple-signed executable or not. This predicate is not relevant for the WebKit processes, and
        should be removed (it is always apple-signed).

        This patch makes the following changes:
        1. Removes all uses of 'apple-signed-executable?' (since it is always true for WebKit).
        2. Removed two iCloud preference reads that are not used in WebKit.
        3. Switches from the deprecated 'com.apple.ReportCrash.SimulateCrash' XPC service to its
        correct name 'com.apple.osanalytics.osanalyticshelper'.

        Covered by existing regression tests.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb:
        * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

2020-04-01  Darin Adler  <darin@apple.com>

        Remove all uses of live ranges from TextIterator
        https://bugs.webkit.org/show_bug.cgi?id=209723

        Reviewed by Antti Koivisto.

        * Shared/EditingRange.cpp:
        (WebKit::EditingRange::fromRange): Use characterRange.

        * Shared/mac/AttributedString.h: Added a constructor that takes rvalue
        references so we can initialize this slightly more efficiently.

        * Shared/mac/AttributedString.mm:
        (IPC::ArgumentCoder<WebKit::AttributedString>::decode): Pass rvalue
        references when creating an AttributedString.

        * UIProcess/mac/TextCheckerMac.mm:
        (WebKit::TextChecker::updateSpellingUIWithGrammarString): Simplify the
        code to remove some local variables that weren't helpful.

        * WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.h: Made the
        annotatedSubstringBetweenPositions a static member function. Also used
        const& argument types to cut down on reference count churn a bit.

        * WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.mm:
        (WebKit::TextCheckingControllerProxy::rangeAndOffsetRelativeToSelection):
        Streamlined and made this use characterCount instead of
        TextIterator::getLocationAndLengthFromRange.
        (WebKit::TextCheckingControllerProxy::replaceRelativeToSelection): Tweaked
        the argument type.
        (WebKit::TextCheckingControllerProxy::removeAnnotationRelativeToSelection):
        Ditto. Also removed some unnecessary use of NSString.
        (WebKit::TextCheckingControllerProxy::annotatedSubstringBetweenPositions):
        Rewrote to no longer use live ranges.

        * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
        (WebKit::WebPage::getContentsAsAttributedString): Use construction and
        rvalue references to tigten things up a bit.

        * WebProcess/WebPage/WebFrame.cpp:
        (WebKit::WebFrame::contentsAsString const): Use a SimpleRange instead of
        a live range to pass to plainText.
        * WebProcess/WebPage/glib/WebPageGLib.cpp:
        (WebKit::WebPage::getPlatformEditorState const): Pass references to
        live ranges to plainText.
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::updateSelectionWithDelta): Rewrote to minimize use of
        live ranges.
        (WebKit::WebPage::requestDocumentEditingContext): Ditto.
        * WebProcess/WebPage/mac/WebPageMac.mm:
        (WebKit::WebPage::getPlatformEditorState const): Pass reference to
        a live range to plainText.

2020-04-02  David Kilzer  <ddkilzer@apple.com>

        API::PageConfiguration may have conflicting preference values between WebPreferences and WebPreferencesStore::ValueMap instance variables
        <https://webkit.org/b/209678>
        <rdar://problem/60981271>

        Reviewed by Brent Fulgham.

        We fix this bug by removing
        API::PageConfiguration::m_preferenceValues and
        WebPageProxy::m_configurationPreferenceValues, and instead set
        values directly on the WebPreferences object, which holds values
        in its WebPreferencesStore instance variable.  This change only
        requires that the API::PageConfiguration object has
        m_preferences set to a valid WebPreferences object before using
        the settings APIs.

        Covered by WKAttachment TestWebKitAPI tests and
        editing/undo-manager layout tests, among others.

        * UIProcess/API/APIPageConfiguration.cpp:
        (API::PageConfiguration::copy const):
        - Remove use of m_preferenceValues instance variable.
        * UIProcess/API/APIPageConfiguration.h:
        - Update headers after removing WebPreferencesStore.h.
        (API::PageConfiguration::preferenceValues): Delete.
        - Remove use of m_preferenceValues instance variable.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _setupPageConfiguration:]):
        - Switch to use WebPreferences methods for settings.

        * UIProcess/API/mac/WKView.mm:
        (-[WKView initWithFrame:contextRef:pageGroupRef:relatedToPage:]):
        - Create WebPreferences object for API::PageConfiguration
          object.  This is what WebProcessPool::createWebPage() does
          when creating a WebPageProxy object.
        - Switch to use WebPreferences method to set
          SystemLayoutDirection.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::WebPageProxy):
        - Remove initialization of m_configurationPreferenceValues.
        - Switch to use WebPreferences method to set
          DisableScreenSizeOverride.
        (WebKit::WebPageProxy::preferencesStore const):
        - Simplify this method after removing
          m_configurationPreferenceValues.
        * UIProcess/WebPageProxy.h:
        - Remove m_configurationPreferenceValues.

2020-04-02  Per Arne Vollan  <pvollan@apple.com>

        [macOS] Remove redundant call to check in with Launch Services
        https://bugs.webkit.org/show_bug.cgi?id=209911

        Reviewed by Darin Adler.

        There is no need to explicitly check in with Launch Services or call RegisterApplication in the WebContent process,
        since this is handled when calling [NSApplication _accessibilityInitialize].

        No new tests, since this only removes a redundant call, and should be covered by existing tests.

        * Shared/mac/AuxiliaryProcessMac.mm:
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):
        (WebKit::WebProcess::updateProcessName):
        (WebKit::WebProcess::platformInitializeProcess):

2020-04-02  Alex Christensen  <achristensen@webkit.org>

        Add SPI to restrict loading to main resources or non-network loads
        https://bugs.webkit.org/show_bug.cgi?id=209893

        Reviewed by Tim Horton.

        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:
        * UIProcess/API/APIPageConfiguration.cpp:
        (API::PageConfiguration::copy const):
        * UIProcess/API/APIPageConfiguration.h:
        (API::PageConfiguration::loadsSubresources const):
        (API::PageConfiguration::setLoadsSubresources):
        (API::PageConfiguration::loadsFromNetwork const):
        (API::PageConfiguration::setLoadsFromNetwork):
        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
        (-[WKWebViewConfiguration _setLoadsFromNetwork:]):
        (-[WKWebViewConfiguration _loadsFromNetwork]):
        (-[WKWebViewConfiguration _setLoadsSubresources:]):
        (-[WKWebViewConfiguration _loadsSubresources]):
        * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
        * UIProcess/WebPageProxy.cpp:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_processDisplayName):

2020-04-02  youenn fablet  <youenn@apple.com>

        Debug crash: ASSERTION FAILED: m_ongoingFetches.contains(task.fetchIdentifier())
        https://bugs.webkit.org/show_bug.cgi?id=209743

        Reviewed by Darin Adler.

        When context gets closed, we make ServiceWorkerFetchTask::m_serviceWorkerConnection null as it no longer
        needs to send messages and does not need to unregister itself.

        Test: http/wpt/service-workers/service-worker-crashing-while-fetching.https.html

        * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp:
        (WebKit::ServiceWorkerFetchTask::contextClosed):

2020-04-02  youenn fablet  <youenn@apple.com>

        Remove synchronous termination of service workers
        https://bugs.webkit.org/show_bug.cgi?id=209666

        Reviewed by Chris Dumez.

        Update IPC code according removal of synchronous termination of service worker.
        Implement async-with-reply termination instead.

        * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
        (WebKit::WebSWServerConnection::terminateWorkerFromClient):
        (WebKit::WebSWServerConnection::fetchTaskTimedOut):
        * NetworkProcess/ServiceWorker/WebSWServerConnection.h:
        * NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in:
        * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
        (WebKit::WebSWServerToContextConnection::terminateDueToUnresponsiveness):
        * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
        * WebProcess/Storage/WebServiceWorkerProvider.cpp:
        * WebProcess/Storage/WebServiceWorkerProvider.h:
        * WebProcess/Storage/WebSWClientConnection.cpp:
        (WebKit::WebSWClientConnection::terminateWorkerForTesting):
        * WebProcess/Storage/WebSWClientConnection.h:
        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        * WebProcess/Storage/WebSWContextManagerConnection.h:
        * WebProcess/Storage/WebSWContextManagerConnection.messages.in:

2020-04-02  Adrian Perez de Castro  <aperez@igalia.com>

        [WPE][GTK] Public API should not allow trying to register a special URI scheme
        https://bugs.webkit.org/show_bug.cgi?id=209900

        Reviewed by Carlos Garcia Campos.

        No new tests needed.

        * UIProcess/API/glib/WebKitWebContext.cpp:
        (webkit_web_context_register_uri_scheme): Use g_return_if_fail() to
        check at the public API level whether the passed URI scheme is
        special and bail out early.

2020-04-02  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] [2.28.0] The Yelp build crashes if DISPLAY is not set
        https://bugs.webkit.org/show_bug.cgi?id=209431

        Reviewed by Carlos Alberto Lopez Perez.

        Remove the assert when display is not X11 nor Wayland, and simply return false to ensure acceleration is not used.

        * UIProcess/gtk/AcceleratedBackingStore.cpp:
        (WebKit::AcceleratedBackingStore::checkRequirements):

2020-04-01  Per Arne Vollan  <pvollan@apple.com>

        [Cocoa] UTI from MIME type cache can be removed after r258915
        https://bugs.webkit.org/show_bug.cgi?id=209787

        Unreviewed rollout of r257828.

        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const):
        (WebKit::WebProcessCreationParameters::decode):
        * Shared/WebProcessCreationParameters.h:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):

2020-04-01  Per Arne Vollan  <pvollan@apple.com>

        [macOS] Deny mach-lookup access to "com.apple.lsd.mapdb" in sandbox
        https://bugs.webkit.org/show_bug.cgi?id=209814

        Reviewed by Darin Adler.

        This was done for iOS in <https://trac.webkit.org/changeset/258915>, and in order to be able to do this
        on macOS, checking in with Launch Services and updating the process name needs to be done after the
        Launch Services database mapping has been done in WebProcess::platformInitializeWebProcess. Also, the
        previous call to RegisterApplication has been replaced with a call to launchServicesCheckIn, since
        RegisterApplication is an AppKit function, and should be avoided since the WebContent process is not
        a NSApplication anymore.

        Test: fast/sandbox/mac/sandbox-mach-lookup.html

        * Shared/mac/AuxiliaryProcessMac.mm:
        (WebKit::AuxiliaryProcess::launchServicesCheckIn):
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):
        (WebKit::WebProcess::initializeProcessName):
        (WebKit::WebProcess::updateProcessName):
        (WebKit::WebProcess::platformInitializeProcess):
        * WebProcess/com.apple.WebProcess.sb.in:

2020-04-01  Chris Dumez  <cdumez@apple.com>

        Regression(r257963) didFailProvisionalNavigation delegate no longer gets called when cancelling a cross-site provisional navigation
        https://bugs.webkit.org/show_bug.cgi?id=209873
        <rdar://problem/61132068>

        Reviewed by Alex Christensen.

        ProvisionalPageProxy::cancel() was calling didFailProvisionalLoadForFrame() was not passing a valid
        FrameInfoData struct as parameter. As a result, FrameInfoData::isMainFrame ended up being false
        instead of true. This was an issue because NavigationState::NavigationClient::didFailProvisionalNavigationWithError()
        was relying on this flag to decide whether to call webViewDidFailProvisionalNavigationWithError or
        webViewNavigationDidFailProvisionalLoadInSubframeWithError, since r257963.

        Change is covered by new API tests.

        * UIProcess/ProvisionalPageProxy.cpp:
        (WebKit::ProvisionalPageProxy::cancel):

2020-04-01  Don Olmstead  <don.olmstead@sony.com>

        [GPUP][PlayStation] Enable GPU Process
        https://bugs.webkit.org/show_bug.cgi?id=209865

        Reviewed by Eric Carlson.

        A generic LayerHostingContext is provided in this patch. It may make sense for
        this to be platform specific but it may also be possible to have some shared
        implementation with Cocoa ports. Once there are more implementations that
        can be decided.

        Add stubs for building out the GPU Process on the PlayStation port. No
        implementation is provided at this time but the GPU Process will compile
        and link with these changes.

        * GPUProcess/media/playstation/RemoteMediaPlayerProxyPlayStation.cpp: Added.
        (WebKit::RemoteMediaPlayerProxy::prepareForPlayback):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerFirstVideoFrameAvailable):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerRenderingModeChanged):
        (WebKit::RemoteMediaPlayerProxy::enterFullscreen):
        (WebKit::RemoteMediaPlayerProxy::exitFullscreen):
        * GPUProcess/playstation/GPUProcessMainPlayStation.cpp: Added.
        (WebKit::initializeAuxiliaryProcess<GPUProcess>):
        (WebKit::GPUProcessMain):
        * GPUProcess/playstation/GPUProcessPlayStation.cpp: Added.
        (WebKit::GPUProcess::initializeProcess):
        (WebKit::GPUProcess::initializeProcessName):
        (WebKit::GPUProcess::initializeSandbox):
        * Platform/generic/LayerHostingContext.h: Added.
        * PlatformPlayStation.cmake:
        * WebProcess/GPU/media/playstation/VideoLayerRemotePlayStation.cpp: Added.
        (WebKit::createVideoLayerRemote):

2020-04-01  Don Olmstead  <don.olmstead@sony.com>

        [PlayStation] Use OBJECT libraries for WebCore and PAL
        https://bugs.webkit.org/show_bug.cgi?id=209835

        Reviewed by Ross Kirsling.

        Use the object libraries when building WebKit.

        * PlatformPlayStation.cmake:

2020-04-01  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, reverting r259328.
        https://bugs.webkit.org/show_bug.cgi?id=209861

        Introduced API test failures (Requested by perarne on
        #webkit).

        Reverted changeset:

        "[macOS] Deny mach-lookup access to "com.apple.lsd.mapdb" in
        sandbox"
        https://bugs.webkit.org/show_bug.cgi?id=209814
        https://trac.webkit.org/changeset/259328

2020-04-01  Brent Fulgham  <bfulgham@apple.com>

        Convert app-bound domain categorization parameter to a method
        https://bugs.webkit.org/show_bug.cgi?id=209842
        <rdar://problem/61128744>

        Reviewed by John Wilander.

        SSIA.

        Covered by existing TestWebKitAPI tests.

        * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:

2020-04-01  Alex Christensen  <achristensen@webkit.org>

        Deprecate WKWebsiteDataStore._indexedDBDatabaseDirectory
        https://bugs.webkit.org/show_bug.cgi?id=209243

        Reviewed by David Kilzer.

        Luckily it's read-only, but we have a way to get the configuration, so let's encourage that instead.

        * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:

2020-04-01  Wenson Hsieh  <wenson_hsieh@apple.com>

        Make WebPasteboardProxy::didModifyContentsOfPasteboard robust when pasteboardName is null
        https://bugs.webkit.org/show_bug.cgi?id=209848
        <rdar://problem/61121810>

        Reviewed by Megan Gardner and David Kilzer.

        Add more IPC message checks in WebPasteboardProxy; see below for more detail.

        * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:

        Rename what is currently MESSAGE_CHECK to MESSAGE_CHECK_COMPLETION, and introduce two more message check macros:
        MESSAGE_CHECK_WITH_RETURN_VALUE, which supports a return value, and MESSAGE_CHECK, which returns with no value.

        (WebKit::WebPasteboardProxy::canAccessPasteboardData const):

        Replace the early returns when pasteboardName is empty or when the web process for the given connection is null
        with `MESSAGE_CHECK`s. When the web content process is well-behaved, these early returns should never be hit.

        (WebKit::WebPasteboardProxy::didModifyContentsOfPasteboard):

        Similarly, replace this early return with a message check, and additionally `MESSAGE_CHECK` when the pasteboard
        name is empty. This addresses the main issue caught by this radar.

        (WebKit::WebPasteboardProxy::setPasteboardBufferForType):

2020-04-01  Victor M. Jaquez <vjaquez@igalia.com>

        Bump libwebrtc to M82
        https://bugs.webkit.org/show_bug.cgi?id=209542

        Reviewed by Eric Carlson and Youenn Fablet.

        Update include paths to latest libwebrtc paths.

        * WebProcess/Network/webrtc/LibWebRTCResolver.h:
        * WebProcess/Network/webrtc/LibWebRTCSocketFactory.h:

2020-04-01  youenn fablet  <youenn@apple.com>

        Support resolution of IPv6 STUN/TURN addresses
        https://bugs.webkit.org/show_bug.cgi?id=209808

        Reviewed by Eric Carlson.

        Update code to support IPv6 addresses when doing DNS resolution of TURN/STUN servers.
        Refactor code to share more code between Cocoa ports and non Cocoa ports.
        Manually tested with external IPv6 TURN servers.

        * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
        (WebKit::NetworkRTCProvider::createResolver):
        * NetworkProcess/webrtc/NetworkRTCResolverCocoa.cpp:
        (WebKit::resolvedName):

2020-03-31  Megan Gardner  <megan_gardner@apple.com>

        Dismiss color picker on color selection on MacCatalyst
        https://bugs.webkit.org/show_bug.cgi?id=209840
        <rdar://problem/46793808>

        Reviewed by Darin Adler.

        To have correct behavior on mac, we need to dismiss the color picker popover once
        a color has been selected.

        * UIProcess/ios/forms/WKFormColorControl.mm:
        (-[WKColorPopover initWithView:]):
        * UIProcess/ios/forms/WKFormColorPicker.h:
        * UIProcess/ios/forms/WKFormColorPicker.mm:
        (-[WKColorPicker initWithView:]):
        (-[WKColorPicker initWithView:inPopover:]):
        (-[WKColorPicker colorMatrixView:didTapColorButton:]):

2020-03-31  Simon Fraser  <simon.fraser@apple.com>

        Add type traits for ScrollableArea, and other cleanup
        https://bugs.webkit.org/show_bug.cgi?id=209838

        Reviewed by Chris Dumez.

        Because PDFPlugin inherits from both Plugin and ScrollableArea, expand out its SPECIALIZE_TYPE_TRAITS macros
        and change the macros to use the isFoo() pattern.

        * WebProcess/Plugins/Netscape/NetscapePlugin.h:
        * WebProcess/Plugins/PDF/PDFPlugin.h:
        (isType):
        * WebProcess/Plugins/Plugin.h:
        (WebKit::Plugin::isPluginProxy const):
        (WebKit::Plugin::isNetscapePlugin const):
        (WebKit::Plugin::isPDFPlugin const):
        * WebProcess/Plugins/PluginProxy.h:

2020-03-31  Wenson Hsieh  <wenson_hsieh@apple.com>

        Datalist option's label not used
        https://bugs.webkit.org/show_bug.cgi?id=201768
        <rdar://problem/55361186>

        Reviewed by Darin Adler.

        Add support on macOS for showing option labels in datalist suggestions.

        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<DataListSuggestionInformation>::encode): Deleted.
        (IPC::ArgumentCoder<DataListSuggestionInformation>::decode): Deleted.
        * Shared/WebCoreArgumentCoders.h:

        Remove WebCoreArgumentCoders logic for encoding and decoding DataListSuggestionInformation. See
        DataListSuggestionInformation.h in WebCore for more detail.

        * UIProcess/gtk/WebDataListSuggestionsDropdownGtk.cpp:
        (WebKit::WebDataListSuggestionsDropdownGtk::show):

        Tweak GTK code to adjust for the change from `String` to `DataListSuggestion`.

        * UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm:
        (-[WKDataListSuggestionsControl didSelectOptionAtIndex:]):
        (-[WKDataListSuggestionsControl textSuggestions]):
        (-[WKDataListSuggestionsControl suggestionAtIndex:]):

        Adjust some iOS codepaths to use DataListSuggestion::value as the value string to display.

        * UIProcess/mac/WebDataListSuggestionsDropdownMac.mm:

        Tweak several UI constants. A suggestion cell may now be either 20 or 40pt tall, depending on whether it has
        label text to show.

        Currently, the maximum combined height of the table view cells is 120 (not including spacing between cells and
        vertical padding around the top and bottom of the table view), since the maximum number of cells to show is 6
        and each cell is 20pt tall. Maintain this constant by making the maximum cell height 120, which accomodates
        either three labeled cells, or 6 unlabeled cells (i.e. to match shipping behavior).

        (-[WKDataListSuggestionView initWithFrame:]):
        (-[WKDataListSuggestionView layout]):

        Maintain two text fields or value and (optionally) label text: `_valueField` and `_labelField`. The value field
        fills the bounds of the cell in the case where there is no label text, but fills only the top half of the cell
        in the case where there is label text. The label field takes the bottom half of the cell in this case.

        Additionally, add a divider view that may appear at the very bottom of each cell. This divider view is present
        when one or more suggestions in the datalist are labeled.

        (-[WKDataListSuggestionView setValue:label:]):

        Renamed from -setText:. Add a label string argument as well.

        (-[WKDataListSuggestionView setShouldShowBottomDivider:]):

        Add getters and setters for the -shouldShowBottomDivider property, which can be used to make the divider view
        visible or hidden.

        (-[WKDataListSuggestionView shouldShowBottomDivider]):
        (-[WKDataListSuggestionView setBackgroundStyle:]):

        Use -[NSColor secondaryLabelColor] for the label text field.

        (shouldShowDividersBetweenCells):

        Add a helper method to determine whether the table view should be showing clear dividers between each item.
        We only do so if there are one or more labels to be shown.

        (-[WKDataListSuggestionsController initWithInformation:inView:]):
        (-[WKDataListSuggestionsController currentSelectedString]):
        (-[WKDataListSuggestionsController updateWithInformation:]):
        (-[WKDataListSuggestionsController moveSelectionByDirection:]):

        Drive-by fix: scroll to reveal each selected row when using the arrow keys to navigate between items.

        (-[WKDataListSuggestionsController dropdownRectForElementRect:]):
        (-[WKDataListSuggestionsController tableView:heightOfRow:]):

        Return either `dropdownRowHeightWithoutLabel` or `dropdownRowHeightWithLabel`, depending on whether there is
        label text to be shown in that suggestion cell.

        (-[WKDataListSuggestionsController tableView:viewForTableColumn:row:]):
        (-[WKDataListSuggestionView setText:]): Deleted.
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::canShowDataListSuggestionLabels const):
        * WebProcess/WebCoreSupport/WebChromeClient.h:

2020-03-31  Per Arne Vollan  <pvollan@apple.com>

        [macOS] Deny mach-lookup access to "com.apple.lsd.mapdb" in sandbox
        https://bugs.webkit.org/show_bug.cgi?id=209814

        Reviewed by Darin Adler.

        This was done for iOS in <https://trac.webkit.org/changeset/258915>, and in order to be able to do this
        on macOS, checking in with Launch Services and updating the process name needs to be done after the
        Launch Services database mapping has been done in WebProcess::platformInitializeWebProcess. Also, the
        previous call to RegisterApplication has been replaced with a call to launchServicesCheckIn, since
        RegisterApplication is an AppKit function, and should be avoided since the WebContent process is not
        a NSApplication anymore.

        Test: fast/sandbox/mac/sandbox-mach-lookup.html

        * Shared/mac/AuxiliaryProcessMac.mm:
        (WebKit::AuxiliaryProcess::launchServicesCheckIn):
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):
        (WebKit::WebProcess::initializeProcessName):
        (WebKit::WebProcess::updateProcessName):
        (WebKit::WebProcess::platformInitializeProcess):
        * WebProcess/com.apple.WebProcess.sb.in:

2020-03-31  Don Olmstead  <don.olmstead@sony.com>

        [PlayStation] Fix build breaks after r259112
        https://bugs.webkit.org/show_bug.cgi?id=209830

        Unreviewed build fix.

        Replace PLATFORM(WPE) with USE(LIBWPE) within WebWheelEvent.

        * Shared/WebEvent.h:
        * Shared/WebWheelEvent.cpp:
        (WebKit::WebWheelEvent::encode const):
        (WebKit::WebWheelEvent::decode):

2020-03-31  Alex Christensen  <achristensen@webkit.org>

        Send correct UserContentControllerIdentifier after using SPI WKWebpagePreferences._userContentController
        https://bugs.webkit.org/show_bug.cgi?id=209833

        Reviewed by Tim Hatcher.

        Covered by an API test.  I knew something was broken in r259307 and this was it.

        * Shared/UserContentControllerParameters.cpp:
        (WebKit::UserContentControllerParameters::encode const):
        (WebKit::UserContentControllerParameters::decode):
        * Shared/UserContentControllerParameters.h:
        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:
        * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
        (WebKit::WebUserContentControllerProxy::parameters const):
        * UIProcess/WebPageProxy.cpp:
        * WebProcess/WebPage/WebPage.cpp:

2020-03-31  Fujii Hironori  <Hironori.Fujii@sony.com>

        Deduplicate WebsiteDataStore::parameters() of Cocoa port and non-Cocoa port
        https://bugs.webkit.org/show_bug.cgi?id=209644

        Reviewed by Youenn Fablet.

        WinCairo WTR was failing an assertion ensuring
        ResourceLoadStatistics was enabled in
        NetworkSession::setThirdPartyCookieBlockingMode while running
        LayoutTests with useEphemeralSession=true becuase
        ResourceLoadStatisticsParameters was not set in
        WebsiteDataStoreParameters.

        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::platformSetNetworkParameters): Added.
        (WebKit::WebsiteDataStore::parameters): Deleted.
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::parameters):
        * UIProcess/WebsiteData/WebsiteDataStore.h:

2020-03-31  Brent Fulgham  <bfulgham@apple.com>

        Allow WKAppBoundDomains to be initialized with eTLD+1 only (no protocol)
        https://bugs.webkit.org/show_bug.cgi?id=209839
        <rdar://problem/61129400>

        Reviewed by Darin Adler.

        Create a convenience mode for WKAppBoundDomains that assumes https if the user does
        not supply the full URL. This doesn't effect the behavior of the app-bound domains
        because we only deal in RegistrableDomains.

        Tested by TestWebKitAPI.

        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::initializeAppBoundDomains): If the protocol is missing from
        a domain supplied by WKAppBoundDomains, assume it was https.

2020-03-31  Brent Fulgham  <bfulgham@apple.com>

        [macOS] Update sandbox rules for correct sanitizer paths in current OS releases
        https://bugs.webkit.org/show_bug.cgi?id=209818
        <rdar://problem/58422996>

        Reviewed by Per Arne Vollan.

        Update the sandbox rules to allow access to the new system Asan library
        locations.

        * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in: Note: Don't bother leaving
        the old location in this sandbox, since it is not being used on any shipping
        software.
        * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
        * WebProcess/com.apple.WebProcess.sb.in:

2020-03-31  Sihui Liu  <sihui_liu@apple.com>

        IndexedDB: destroy WebIDBServer when session is removed in network process
        https://bugs.webkit.org/show_bug.cgi?id=209606
        <rdar://problem/59310081>

        Reviewed by Geoffrey Garen.

        Tested manually to verify WebIDBServer is removed and its thread ends when session is removed.

        * NetworkProcess/IndexedDB/WebIDBServer.cpp:
        (WebKit::WebIDBServer::~WebIDBServer):
        (WebKit::WebIDBServer::addConnection):
        (WebKit::WebIDBServer::removeConnection):
        (WebKit::WebIDBServer::close):
        * NetworkProcess/IndexedDB/WebIDBServer.h:
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::destroySession):
        (WebKit::NetworkProcess::connectionToWebProcessClosed):

2020-03-31  Chris Dumez  <cdumez@apple.com>

        Regression(r253357) DeviceMotionEvent acceleration and rotationRate are null
        https://bugs.webkit.org/show_bug.cgi?id=209831
        <rdar://problem/60720953>

        Reviewed by Darin Adler.

        * UIProcess/ios/WebDeviceOrientationUpdateProviderProxy.h:
        * UIProcess/ios/WebDeviceOrientationUpdateProviderProxy.mm:
        (WebKit::WebDeviceOrientationUpdateProviderProxy::motionChanged):
        * WebProcess/WebCoreSupport/WebDeviceOrientationUpdateProvider.cpp:
        (WebKit::WebDeviceOrientationUpdateProvider::deviceMotionChanged):
        * WebProcess/WebCoreSupport/WebDeviceOrientationUpdateProvider.h:
        * WebProcess/WebCoreSupport/WebDeviceOrientationUpdateProvider.messages.in:

2020-03-31  Alex Christensen  <achristensen@webkit.org>

        Add SPI WKWebpagePreferences._userContentController
        https://bugs.webkit.org/show_bug.cgi?id=209795

        Reviewed by Tim Hatcher.

        This will allow us to switch which WKUserContentController we are using at decidePolicyForNavigationAction time
        like we do WKWebsiteDataStores.  This is only allowed with main frame navigations.

        To do this I moved UserContentControllerParameters into their own struct.
        I remove unused WebsitePoliciesData.websiteDataStoreParameters.
        I pass an API::WebsitePolicies* further down the chain instead of switching to Optional<WebsitePoliciesData>,
        which allows us to access the WebUserContentControllerProxy* from the former in WebPageProxy::creationParameters.
        I removed an unused WebsitePolicies constructor.
        I added a missing copied member variable in WebsitePolicies::copy.

        * NetworkProcess/NetworkSession.cpp:
        * Shared/UserContentControllerParameters.cpp: Added.
        (WebKit::UserContentControllerParameters::encode const):
        (WebKit::UserContentControllerParameters::decode):
        * Shared/UserContentControllerParameters.h: Added.
        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:
        * Shared/WebsitePoliciesData.cpp:
        (WebKit::WebsitePoliciesData::encode const):
        (WebKit::WebsitePoliciesData::decode):
        * Shared/WebsitePoliciesData.h:
        * Sources.txt:
        * UIProcess/API/APIWebsitePolicies.cpp:
        (API::WebsitePolicies::copy const):
        (API::WebsitePolicies::setUserContentController):
        (API::WebsitePolicies::data):
        (API::WebsitePolicies::WebsitePolicies): Deleted.
        * UIProcess/API/APIWebsitePolicies.h:
        * UIProcess/API/C/WKPage.cpp:
        (WKPageUpdateWebsitePolicies):
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _updateWebpagePreferences:]):
        * UIProcess/API/Cocoa/WKWebpagePreferences.mm:
        (-[WKWebpagePreferences _userContentController]):
        (-[WKWebpagePreferences _setUserContentController:]):
        * UIProcess/API/Cocoa/WKWebpagePreferencesPrivate.h:
        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
        * UIProcess/ProvisionalPageProxy.cpp:
        (WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
        (WebKit::ProvisionalPageProxy::initializeWebPage):
        (WebKit::ProvisionalPageProxy::goToBackForwardItem):
        * UIProcess/ProvisionalPageProxy.h:
        * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
        (WebKit::WebUserContentControllerProxy::addProcess):
        (WebKit::WebUserContentControllerProxy::parameters const):
        (WebKit::WebUserContentControllerProxy::contentRuleListData const):
        (WebKit::WebUserContentControllerProxy::contentRuleListData): Deleted.
        * UIProcess/UserContent/WebUserContentControllerProxy.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
        (WebKit::WebPageProxy::receivedPolicyDecision):
        (WebKit::WebPageProxy::continueNavigationInNewProcess):
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
        (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
        (WebKit::WebPageProxy::decidePolicyForResponseShared):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::addWebUserContentControllerProxy):
        * UIProcess/WebProcessProxy.h:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_processDisplayName):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::didReceiveMessage):

2020-03-31  Alex Christensen  <achristensen@webkit.org>

        Remove call to PageConfiguration::setUserContentController added in r225765
        https://bugs.webkit.org/show_bug.cgi?id=209828
        <rdar://problem/61114052>

        Reviewed by Brian Weinstein.

        r225765 added a way for a certain Mac application to use WKWebViewConfiguration._pageGroup to set its WKUserContentController.
        That Mac application has transitioned to setting the WKUserContentController manually, and this workaround needs to be removed
        for that application's WKUserContentControllers to continue working as desired.  I verified this fixes that application, and
        it is the only user of WKWebViewConfiguration._pageGroup and all other applications will have no change in behavior.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _setupPageConfiguration:]):

2020-03-31  Brent Fulgham  <bfulgham@apple.com>

        [macOS] Add additional IPC permission needed by Security.framework
        https://bugs.webkit.org/show_bug.cgi?id=209815
        <rdar://problem/60892378>

        Reviewed by Per Arne Vollan.

        Add missing permission needed for recent macOS releases.

        * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:

2020-03-31  Per Arne Vollan  <pvollan@apple.com>

        Silence preference write sandbox violations in the WebContent process
        https://bugs.webkit.org/show_bug.cgi?id=209806

        Reviewed by Brent Fulgham.

        When CFPrefs direct mode is enabled in the WebContent process, the UI process will notify the WebContent about preference changes.
        When receiving these notifications, the WebContent process will  use the CFPrefs API to update the value of these preferences
        in-process, which will also attempt to write these values to disk. Writing the preference values to disk is unnecessary, and will
        also be denied by the sandbox, so the sandbox violations should be silenced.

        No new tests, no behavior change.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
        * WebProcess/com.apple.WebProcess.sb.in:

2020-03-31  Devin Rousso  <drousso@apple.com>

        REGRESSION: (r259236) [ iOS and Catalina wk2 Debug ] ASSERTION FAILED: m_debugLoggingEnabled in WebKit::ResourceLoadStatisticsStore::debugBroadcastConsoleMessage
        https://bugs.webkit.org/show_bug.cgi?id=209810
        <rdar://problem/61106971>

        Unreviewed, covered by existing tests.

        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
        (WebKit::ResourceLoadStatisticsStore::debugBroadcastConsoleMessage):
        Remove the assertion since `debugBroadcastConsoleMessage` is also called when turning off
        debug logging mode via `setResourceLoadStatisticsDebugMode`. Fundamentally, it's just a
        wrapper function for `broadcastConsoleMessage` anyways, so it doesn't need to be gated.

2020-03-31  Pablo Saavedra  <psaavedra@igalia.com>

        Several refactorings done in the MemoryPressureMonitor.cpp
        https://bugs.webkit.org/show_bug.cgi?id=209464

        Reviewed by Adrian Perez de Castro.

        1) toIntegralType() parses the C-string str interpreting its content
        as an `unsigned long long int` which is more appropriate for
        the size_t (unsigned integer type) variables used by the
        MemoryPressureMonitor functions in counterpoint of atoll() what
        returns a `long long int`.

        This change also controls if the parsing was succesful. In negative
        case returns `notSet`.

        2) Added the getCgroupFileValue() function what encapsulates the
        manipulation of the opened files in the `/sys/fs/cgroup` hierarchy.
        This change simplify the code avoding unnecessary code repetion.

        3) getCgroupControllerPath() now checks if there is a `name=systemd`
        controller listed in the `/proc/self/cgroup`. This important for
        cgroup v2 activated with `systemd.unified_cgroup_hierarchy=yes`
        through the Linux kernel cmdline. The unified hierarchy simplies
        path of the controllers under the same directory (check the
        "Deprecated v1 Core Features" section in the Linux Kernel
        documentation fir cgroup v2 [1]):

            Multiple hierarchies including named ones are not supported

        [1] https://www.kernel.org/doc/Documentation/cgroup-v2.txt

        4) Because 3) the patch composited for cgroupV2 changes
        getMemoryUsageWithCgroup() slightly. The name of the controller
        is not needed anymore.

        5) For cgroup v2, the MemoryTotal is calculated as the minimum
        between memory.high and memory.max.

        * UIProcess/linux/MemoryPressureMonitor.cpp:
        (WebKit::lowWatermarkPages):
        (WebKit::getCgroupFileValue):
        (WebKit::getMemoryTotalWithCgroup):
        (WebKit::getMemoryUsageWithCgroup):
        (WebKit::getCgroupControllerPath):
        (WebKit::systemMemoryUsedAsPercentage):
        (WebKit::getCgroupController): Deleted.

2020-03-31  Zan Dobersek  <zdobersek@igalia.com>

        [GTK][WPE] Jumpy rendering of fixed-element layers while scrolling
        https://bugs.webkit.org/show_bug.cgi?id=209466

        Reviewed by Carlos Garcia Campos.

        Move the Nicosia::SceneIntegration ownership into the
        CompositingCoordinator class, along with the SceneIntegration::Client
        inheritance. LayerTreeHost in turn now implements the updateScene()
        method that triggers a scene update when invoked.

        * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
        (WebKit::CompositingCoordinator::CompositingCoordinator):
        (WebKit::CompositingCoordinator::invalidate):
        (WebKit::CompositingCoordinator::attachLayer):
        (WebKit::CompositingCoordinator::requestUpdate):
        * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
        * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
        (WebKit::LayerTreeHost::LayerTreeHost):
        (WebKit::LayerTreeHost::~LayerTreeHost):
        (WebKit::LayerTreeHost::updateScene):
        (WebKit::LayerTreeHost::sceneIntegration): Deleted.
        (WebKit::LayerTreeHost::requestUpdate): Deleted.
        * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h:

2020-03-31  Carlos Garcia Campos  <cgarcia@igalia.com>

        REGRESSION(r258829): [CoordinatedGraphics] Web view not updated after cross site navigation with PSON enabled
        https://bugs.webkit.org/show_bug.cgi?id=209741

        Reviewed by Žan Doberšek.

        Since r258829, the drawing area proxy of a provisional page ignores all messages until the load is
        committed. This is causing 2 problems for coordinated graphics drawing area. When not in accelerated compositing
        mode, Update message is sent before the commit is loaded, and the web process keeps waiting for the DidUpdate
        response message forever. When accelerated compositing mode is forced, the EnterAcceleratedCompositing message
        is also sent before the load is committed and ignored, so the UI process doesn't know it's in accelerated mode.

        * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
        (WebKit::DrawingAreaCoordinatedGraphics::scheduleRenderingUpdate): Return early if layer tree is frozen. This
        ensures that Update messages are not sent to the UI process while layer tree is frozen.
        (WebKit::DrawingAreaCoordinatedGraphics::enterAcceleratedCompositingMode): Disable layer flush on the newly
        created LayerTreeHost if layer tree is frozen. This ensures that EnterAcceleratedCompositing message is sent
        after the first layer flush once the layer tree is no longer frozen.

2020-03-30  David Kilzer  <ddkilzer@apple.com>

        REGRESSION (r251574, r251600): _WKTextManipulationToken and _WKTextManipulationConfiguration are missing -dealloc
        <https://webkit.org/b/209794>

        Reviewed by Wenson Hsieh.

        * UIProcess/API/Cocoa/_WKTextManipulationConfiguration.mm:
        (-[_WKTextManipulationConfiguration dealloc]): Add.
        * UIProcess/API/Cocoa/_WKTextManipulationToken.mm:
        (-[_WKTextManipulationToken dealloc]): Add.

2020-03-30  John Wilander  <wilander@apple.com>

        Experimental: Enforce SameSite=strict for domains classified as bounce trackers
        https://bugs.webkit.org/show_bug.cgi?id=209761
        <rdar://problem/59394943>

        Reviewed by Brent Fulgham and Kate Cheney (informal).

        This experimental feature is part of Intelligent Tracking Prevention and only enabled if
        ITP (Resource Load Statistics) are. A new enum WebCore::SameSiteStrictEnforcementEnabled
        controls the new behavior with default setting WebCore::SameSiteStrictEnforcementEnabled::No.

        The features keeps a separate count of topFrameUniqueRedirectsToSinceSameSiteStrictEnforcement
        which builds up to a threshold. Once a domain goes above the threshold, its cookies are
        rewritten as SameSite=strict and the topFrameUniqueRedirectsToSinceSameSiteStrictEnforcement
        counter for that domain is reset, effectively giving the domain a new chance to change its
        behavior.

        Test infrastructure is added to allow for layout tests.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        (WebKit::ResourceLoadStatisticsDatabaseStore::createUniqueIndices):
        (WebKit::ResourceLoadStatisticsDatabaseStore::createSchema):
        (WebKit::ResourceLoadStatisticsDatabaseStore::insertDomainRelationships):
        (WebKit::CompletionHandler<void):
        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
        (WebKit::ResourceLoadStatisticsMemoryStore::logFrameNavigation):
        (WebKit::ResourceLoadStatisticsMemoryStore::setTopFrameUniqueRedirectTo):
        (WebKit::ResourceLoadStatisticsMemoryStore::shouldEnforceSameSiteStrictFor):
        (WebKit::ResourceLoadStatisticsMemoryStore::registrableDomainsToDeleteOrRestrictWebsiteDataFor):
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
        (WebKit::ResourceLoadStatisticsStore::setSameSiteStrictEnforcementEnabled):
        (WebKit::ResourceLoadStatisticsStore::isSameSiteStrictEnforcementEnabled const):
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::setSameSiteStrictEnforcementEnabled):
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
        (WebKit::RegistrableDomainsToDeleteOrRestrictWebsiteDataFor::isolatedCopy const):
        (WebKit::RegistrableDomainsToDeleteOrRestrictWebsiteDataFor::isEmpty const):
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::setShouldEnbleSameSiteStrictEnforcementForTesting):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
            Added SetShouldEnbleSameSiteStrictEnforcementForTesting.
        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::NetworkSession):
        (WebKit::NetworkSession::forwardResourceLoadStatisticsSettings):
        (WebKit::NetworkSession::deleteAndRestrictWebsiteDataForRegistrableDomains):
        (WebKit::NetworkSession::setShouldEnbleSameSiteStrictEnforcement):
        * NetworkProcess/NetworkSession.h:
        * Scripts/webkit/messages.py:
            IPC instructions to find WebCore::SameSiteStrictEnforcementEnabled in
            WebCore/NetworkStorageSession.h. 
        * Shared/ResourceLoadStatisticsParameters.h:
        (WebKit::ResourceLoadStatisticsParameters::encode const):
        (WebKit::ResourceLoadStatisticsParameters::decode):
        * Shared/WebPreferences.yaml:
        * UIProcess/API/APINavigation.h:
        (API::Navigation::setIsLoadedWithNavigationShared):
        (API::Navigation::isLoadedWithNavigationShared const):
            Keeps track of how a navigation occurs to make sure that
            WebPageProxy::logFrameNavigation() can capture navigations initiated by the
            user through the hosting application.
        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreStatisticsResetToConsistentState):
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::setShouldEnbleSameSiteStrictEnforcementForTesting):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::loadRequestWithNavigationShared):
            See comment above for API::Navigation.
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
            See comment above for API::Navigation.
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::parameters):
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::setResourceLoadStatisticsShouldEnbleSameSiteStrictEnforcementForTesting):
        * UIProcess/WebsiteData/WebsiteDataStore.h:

2020-03-30  Andres Gonzalez  <andresg_22@apple.com>

        Cache [WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames] to avoid hitting often the main thread in isolated tree mode.
        https://bugs.webkit.org/show_bug.cgi?id=209767

        Reviewed by Chris Fleizach.

        [WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]
        is called often in isolated tree mode causing a dispatch to the main thread.
        This change caches this value so it doesn't keep hitting the main thread.

        * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
        (-[WKAccessibilityWebPageObject ALLOW_DEPRECATED_IMPLEMENTATIONS_END]):

2020-03-30  Chris Dumez  <cdumez@apple.com>

        WebKit should take a foreground assertion for offscreen loads when the app is foreground
        https://bugs.webkit.org/show_bug.cgi?id=209748
        <rdar://problem/59169812>

        Reviewed by Geoffrey Garen.

        * UIProcess/API/APIPageConfiguration.h:

2020-03-30  Chris Dumez  <cdumez@apple.com>

        REGRESSION (r259211): ASSERT(window) in applicationType() under shouldUseForegroundPriorityForClientNavigation()
        https://bugs.webkit.org/show_bug.cgi?id=209759

        Reviewed by Darin Adler.

        Make sure to not call applicationType() with a null window. This patch maintains previous behavior
        in release builds.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::loadRequest):
        (WebKit::WebPageProxy::loadFile):
        (WebKit::WebPageProxy::loadData):
        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::isApplicationVisible):
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::shouldForceForegroundPriorityForClientNavigation const):
        (WebKit::WebPageProxy::shouldUseForegroundPriorityForClientNavigation const): Deleted.

2020-03-30  Don Olmstead  <don.olmstead@sony.com>

        Non-unified build fixes late March 2020 edition
        https://bugs.webkit.org/show_bug.cgi?id=209781

        Unreviewed build fix.

        * NetworkProcess/NetworkDataTask.cpp:

2020-03-30  Kate Cheney  <katherine_cheney@apple.com>

        Known app-bound domain protocols should not check the app-bound domain list
        https://bugs.webkit.org/show_bug.cgi?id=209755
        <rdar://problem/60875376> 

        Reviewed by Chris Dumez.

        This patch checks if a url should be treated as app-bound based on
        protocol before deciding to check the app-bound domain list.
        It is wasteful to check the app-bound domain list when some protocols
        are automatically considered app-bound.

        Existing behavior should be maintained, this is tested by existing
        In-App Browser Privacy layout and API tests.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::setIsNavigatingToAppBoundDomain):
        (WebKit::shouldBeTreatedAsAppBound): Deleted.
        We can remove the check for the url protocol here because we are
        doing it instead in WebsiteDataStore::beginAppBoundDomainCheck.
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
        Changed if PLATFORM(COCOA) to if PLATFORM(IOS_FAMILY) because it
        is unnecessary to check the app-bound domain list for other
        platforms (the values returned would be ignored in
        setIsNavigatingToAppBoundDomain).

        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::shouldTreatURLProtocolAsAppBound):
        (WebKit::WebsiteDataStore::beginAppBoundDomainCheck):
        * UIProcess/WebsiteData/WebsiteDataStore.h:

2020-03-30  David Kilzer  <ddkilzer@apple.com>

        REGRESSION (r256756): -[WKPreferenceObserver init]: Instance variable used while 'self' is not set to the result of '[(super or self) init...]'
        <https://webkit.org/b/209765>

        Reviewed by Darin Adler.

        * UIProcess/Cocoa/PreferenceObserver.mm:
        (-[WKPreferenceObserver init]): Call `[self init]` and set
        `self` to fix the clang static analyzer warning.

2020-03-30  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, reverting r259211.

        Caused API test assertion failures on iOS

        Reverted changeset:

        "WebKit should take a foreground assertion for offscreen loads
        when the app is foreground"
        https://bugs.webkit.org/show_bug.cgi?id=209748
        https://trac.webkit.org/changeset/259211

2020-03-30  Devin Rousso  <drousso@apple.com>

        Web Inspector: provide a way to log messages from the network process
        https://bugs.webkit.org/show_bug.cgi?id=204775

        Reviewed by Brian Burg.

        ITP can be influenced by multiple pages simultaneously, meaning that sending a console
        message to the Web Inspector that's connected to the page that caused a change may not be
        useful as developers often don't test in complete isolation. As such, having a way to
        broadcast a console message to all Web Inspectors ensures that any changes caused by any
        page are always able to be seen, no matter which page is being actively inspected.

        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::broadcastConsoleMessage): Added.
        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        (WebKit::NetworkConnectionToWebProcess::broadcastConsoleMessage): Added.
        * WebProcess/Network/NetworkProcessConnection.messages.in:
        * WebProcess/Network/NetworkProcessConnection.h:
        * WebProcess/Network/NetworkProcessConnection.cpp:
        (WebKit::NetworkProcessConnection::broadcastConsoleMessage): Added.
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::webFrames const): Added.
        Broadcasted console messages are relayed from the network process to the web process via the
        functions above in the order that they are written.

        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::NetworkSession):
        * NetworkProcess/AdClickAttributionManager.h:
        (WebKit::AdClickAttributionManager::AdClickAttributionManager):
        * NetworkProcess/AdClickAttributionManager.cpp:
        (WebKit::AdClickAttributionManager::storeUnconverted):
        (WebKit::AdClickAttributionManager::handleConversion):
        (WebKit::AdClickAttributionManager::convert):
        (WebKit::AdClickAttributionManager::fireConversionRequest):

        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
        (WebKit::ResourceLoadStatisticsStore::removeDataRecords):
        (WebKit::ResourceLoadStatisticsStore::setResourceLoadStatisticsDebugMode):
        (WebKit::ResourceLoadStatisticsStore::debugBroadcastConsoleMessage): Added.
        (WebKit::ResourceLoadStatisticsStore::debugLogDomainsInBatches):
        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccess):
        (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccessUnderOpener):
        (WebKit::ResourceLoadStatisticsDatabaseStore::ensurePrevalentResourcesForDebugMode):
        (WebKit::ResourceLoadStatisticsDatabaseStore::updateCookieBlocking):
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
        (WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccess):
        (WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccessUnderOpener):
        (WebKit::ResourceLoadStatisticsMemoryStore::ensurePrevalentResourcesForDebugMode):
        (WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlocking):

        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
        Send a console message for the result of `WebCore::AdClickAttribution::parseConversionRequest`.

2020-03-30  Per Arne Vollan  <pvollan@apple.com>

        Unreviewed build fix after r259200.

        * WebProcess/WebSleepDisablerClient.cpp:
        (WebKit::WebSleepDisablerClient::didCreateSleepDisabler):
        (WebKit::WebSleepDisablerClient::didDestroySleepDisabler):
        * WebProcess/WebSleepDisablerClient.h:

2020-03-30  Chris Dumez  <cdumez@apple.com>

        WebKit should take a foreground assertion for offscreen loads when the app is foreground
        https://bugs.webkit.org/show_bug.cgi?id=209748
        <rdar://problem/59169812>

        Reviewed by Geoffrey Garen.

        * UIProcess/API/APIPageConfiguration.h:

2020-03-30  Chris Dumez  <cdumez@apple.com>

        Regression(r246188) WebProcess is launched too eagerly when [WKWebView _restoreSessionState] is called
        https://bugs.webkit.org/show_bug.cgi?id=207908
        <rdar://problem/59619323>

        Reviewed by Darin Adler.

        Since r246188, the WebProcess is launched eagerly when [WKWebView _restoreSessionState] is called. This is bad
        for performance because we are unable to leverage the process cache at this point (since we don't know which
        domain will be loaded).

        This patch thus reverts r246188 and fixes what r246188 was trying to address in a different way. If the process
        was not launched yet when restoreSessionState() is called, the session state properly gets sent to the WebProcess
        after launch, via the WebPageCreationParameters. What was missing at that point was that the session state was
        restore by an API Request. To fix this, we now pass an extra itemStatesWereRestoredByAPIRequest flag in
        WebPageCreationParameters.

        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::restoreFromSessionState):
        * UIProcess/WebPageProxy.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_processDisplayName):

2020-03-30  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Cocoa] Minor code cleanup around WebDataListSuggestionsDropdown
        https://bugs.webkit.org/show_bug.cgi?id=209747

        Reviewed by Tim Horton.

        Refactor WKDataListSuggestionsController and WKDataListSuggestionsControl, such that their `_dropdown`s are
        `WeakPtr`s instead of raw pointers. Also, make `-showSuggestionsDropdown:` take a reference instead of a
        pointer, since the argument is always `this` (and assumed to be non-null).

        No change in behavior.

        * UIProcess/WebDataListSuggestionsDropdown.h:
        * UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm:
        (WebKit::WebDataListSuggestionsDropdownIOS::show):
        (-[WKDataListSuggestionsControl showSuggestionsDropdown:activationType:]):
        (-[WKDataListSuggestionsPicker showSuggestionsDropdown:activationType:]):
        (-[WKDataListSuggestionsPopover showSuggestionsDropdown:activationType:]):
        * UIProcess/mac/WebDataListSuggestionsDropdownMac.mm:
        (WebKit::WebDataListSuggestionsDropdownMac::show):
        (-[WKDataListSuggestionsController showSuggestionsDropdown:]):

2020-03-30  David Kilzer  <ddkilzer@apple.com>

        NetworkConnectionToWebProcess::registerFileBlobURL should validate its parameters
        <https://webkit.org/b/209713>
        <rdar://problem/60097168>

        Reviewed by Youenn Fablet.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::registerFileBlobURL):
        - Add message check to validate `url` parameter.

2020-03-30  Per Arne Vollan  <pvollan@apple.com>

        [Cocoa] Sleep disabling should be performed in the UI process
        https://bugs.webkit.org/show_bug.cgi?id=209676

        Reviewed by Darin Adler.

        Since sleep disabling is causing communication with the power management service, it should be performed in the UI process.
        The UI process will be notified by the WebContent process about sleep disablers being created and destroyed, and will perform
        the actual sleep disabling and enabling.

        * Scripts/webkit/messages.py:
        * Sources.txt:
        * UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h:
        * UIProcess/API/Cocoa/WKWebViewTesting.mm:
        (-[WKWebView _hasSleepDisabler]):
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::didCreateSleepDisabler):
        (WebKit::WebProcessProxy::didDestroySleepDisabler):
        (WebKit::WebProcessProxy::hasSleepDisabler):
        * UIProcess/WebProcessProxy.h:
        * UIProcess/WebProcessProxy.messages.in:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/GPU/media/RemoteLegacyCDM.cpp:
        * WebProcess/GPU/media/ios/RemoteMediaSessionHelper.cpp:
        * WebProcess/GPU/media/ios/RemoteMediaSessionHelper.h:
        * WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
        * WebProcess/WebSleepDisablerClient.cpp: Added.
        (WebKit::WebSleepDisablerClient::didCreateSleepDisabler):
        (WebKit::WebSleepDisablerClient::didDestroySleepDisabler):
        * WebProcess/WebSleepDisablerClient.h: Added.
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):

2020-03-30  Wenson Hsieh  <wenson_hsieh@apple.com>

        [macOS] Datalist dropdown suggestions table can be scrolled too far
        https://bugs.webkit.org/show_bug.cgi?id=209721

        Reviewed by Tim Horton.

        WKDataListSuggestionTableView's enclosing scroll view is set to an incorrect size while laying out the table
        view, due to AppKit logic that attempts to adjust the size of the table view's enclosing scroll view after we've
        already attempted to set the frame of the scroll view under the overridden call to -layout.

        Fix this by refactoring the logic around the suggestion table view's enclosing scroll view; currently,
        WKDataListSuggestionTableView overrides -enclosingScrollView to return its own NSScrollView, which it sizes
        underneath an overridden call to -layout. This is a bit strange, since the table view is actually a subview of
        the scroll view it owns; the fact that laying out the table view causes an ancestor view to change size (and
        subsequently invalidate the table view's layout) seems to be what breaks AppKit's enclosing scroll view
        adjustment logic.

        Instead, we can have own both the table view and the table view's enclosing scroll view.

        * UIProcess/mac/WebDataListSuggestionsDropdownMac.mm:
        (-[WKDataListSuggestionTableView initWithElementRect:]):
        (-[WKDataListSuggestionsController initWithInformation:inView:]):

        Move the scroll view initialization logic out of -[WKDataListSuggestionTableView initWithElementRect:] and into
        this method. This also means that we can initialize the scroll view with the bounds of the window's content
        view, instead of waiting until we lay out the table view underneath the scroll view.

        (-[WKDataListSuggestionsController updateWithInformation:]):
        (-[WKDataListSuggestionsController invalidate]):

        Clear out and remove _scrollView as well when we tear down the controller.

        (-[WKDataListSuggestionsController showSuggestionsDropdown:]):
        (-[WKDataListSuggestionTableView layout]): Deleted.
        (-[WKDataListSuggestionTableView enclosingScrollView]): Deleted.
        (-[WKDataListSuggestionTableView removeFromSuperviewWithoutNeedingDisplay]): Deleted.

        Now that the controller owns the scroll view, we don't need to override these anymore.

2020-03-29  Antoine Quint  <graouts@apple.com>

        [AutoSizing] Bring back the old auto-sizing code as a deprecated codepath for compatibility reasons
        https://bugs.webkit.org/show_bug.cgi?id=209669
        <rdar://problem/60111081>

        Reviewed by Alan Bujtas and Darin Adler.

        We changed the auto-sizing code for webkit.org/b/196743 in r244098, but some clients need it and we bring it back
        via a new dedicated -[WKWebView _setSizeToContentAutoSizeMaximumSize:] SPI.

        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:
        * UIProcess/API/Cocoa/WKViewPrivate.h:
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/API/mac/WKView.mm:
        (-[WKView sizeToContentAutoSizeMaximumSize]):
        (-[WKView setSizeToContentAutoSizeMaximumSize:]):
        * UIProcess/API/mac/WKWebViewMac.mm:
        (-[WKWebView _sizeToContentAutoSizeMaximumSize]):
        (-[WKWebView _setSizeToContentAutoSizeMaximumSize:]):
        * UIProcess/Cocoa/WebViewImpl.h:
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::setSizeToContentAutoSizeMaximumSize):
        (WebKit::WebViewImpl::sizeToContentAutoSizeMaximumSize const):
        (WebKit::WebViewImpl::setIntrinsicContentSize):
        * UIProcess/DrawingAreaProxy.h:
        (WebKit::DrawingAreaProxy::sizeToContentAutoSizeMaximumSizeDidChange):
        * UIProcess/WebPageProxy.cpp:
        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::sizeToContentAutoSizeMaximumSize const):
        * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
        * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
        (WebKit::TiledCoreAnimationDrawingAreaProxy::sizeToContentAutoSizeMaximumSizeDidChange):
        (WebKit::TiledCoreAnimationDrawingAreaProxy::didUpdateGeometry):
        (WebKit::TiledCoreAnimationDrawingAreaProxy::willSendUpdateGeometry):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_processDisplayName):
        (WebKit::WebPage::reinitializeWebPage):
        (WebKit::WebPage::setMinimumSizeForAutoLayout):
        (WebKit::WebPage::setSizeToContentAutoSizeMaximumSize):
        (WebKit::WebPage::updateIntrinsicContentSizeIfNeeded):
        * WebProcess/WebPage/WebPage.h:
        (WebKit::WebPage::sizeToContentAutoSizeMaximumSize const):
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
        (WebKit::TiledCoreAnimationDrawingArea::updateGeometry):

2020-03-29  Darin Adler  <darin@apple.com>

        Move TextIterator::rangeFromLocationAndLength off of live ranges
        https://bugs.webkit.org/show_bug.cgi?id=209408

        Reviewed by Antti Koivisto.

        * Shared/EditingRange.cpp:
        (WebKit::EditingRange::toRange): Use CharacterRange,
        resolveCharacterLocation/Range.

        * Shared/EditingRange.h: Added a FIXME about replacing with CharacterRange.

        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<CharacterRange>::encode): Added.
        (IPC::ArgumentCoder<CharacterRange>::decode): Added.
        (IPC::ArgumentCoder<GrammarDetail>::encode): Updated to use CharacterRange.
        (IPC::ArgumentCoder<GrammarDetail>::decode): Ditto.
        (IPC::ArgumentCoder<TextCheckingResult>::encode): Ditto.
        (IPC::ArgumentCoder<TextCheckingResult>::decode): Ditto.
        * Shared/WebCoreArgumentCoders.h: Added CharacterRange.

        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::textCheckingResultFromNSTextCheckingResult): Use CharacterRange,
        resolveCharacterLocation/Range.
        * UIProcess/WebGrammarDetail.cpp:
        (WebKit::WebGrammarDetail::WebGrammarDetail): Ditto.
        * UIProcess/WebGrammarDetail.h:
        (WebKit::WebGrammarDetail::location const): Ditto.
        (WebKit::WebGrammarDetail::length const): Ditto.
        * UIProcess/gtk/TextCheckerGtk.cpp:
        (WebKit::TextChecker::checkTextOfParagraph): Ditto.
        * UIProcess/ios/TextCheckerIOS.mm:
        (WebKit::TextChecker::checkTextOfParagraph): Ditto.
        * UIProcess/mac/TextCheckerMac.mm:
        (WebKit::TextChecker::checkTextOfParagraph): Ditto.
        (WebKit::TextChecker::updateSpellingUIWithGrammarString): Ditto.
        * WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.mm:
        (WebKit::TextCheckingControllerProxy::rangeAndOffsetRelativeToSelection): Ditto.
        (WebKit::TextCheckingControllerProxy::replaceRelativeToSelection): Ditto.
        (WebKit::TextCheckingControllerProxy::annotatedSubstringBetweenPositions): Ditto.
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::deleteSurrounding): Ditto.
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::getPlatformEditorState const): Small tweak.
        (WebKit::WebPage::updateSelectionWithDelta): Ditto.
        (WebKit::WebPage::requestDocumentEditingContext): Ditto.

2020-03-29  Daniel Bates  <dabates@apple.com>

        Attempt to fix the Mac Catalyst build after r258989
        <https://bugs.webkit.org/show_bug.cgi?id=199960>

        Remove code that has since been moved to WebPage::platformNeedsLayoutForEditorState().

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::getPlatformEditorState const):

2020-03-29  ddkilzer@apple.com  <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>

        Build fix for: [iOS] Delay process suspension for a while after loading an app link
        https://bugs.webkit.org/show_bug.cgi?id=209686#c12
        <rdar://problem/60888891>

        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::tryInterceptNavigation):
        - Restrict call to WebPageProxy::willOpenAppLink() to
          PLATFORM(IOS_FAMILY) to fix the build.

2020-03-29  David Kilzer  <ddkilzer@apple.com>

        REGRESSION (r257867): [GPUP] Use-after-move in RemoteCDMInstance::createSession()
        <https://webkit.org/b/209712>
        <rdar://problem/61018795>

        Reviewed by Darin Adler.

        * WebProcess/GPU/media/RemoteCDMInstance.cpp:
        (WebKit::RemoteCDMInstance::createSession): Fix use-after-move
        by using RemoteCDMInstanceSession::identifier().
        * WebProcess/GPU/media/RemoteCDMInstanceSession.h:
        (RemoteCDMInstanceSession::identifier): Add getter.

2020-03-28  Devin Rousso  <drousso@apple.com>

        Web Inspector: support editing cookie key/values from inspector
        https://bugs.webkit.org/show_bug.cgi?id=31157
        <rdar://problem/19281523>

        Reviewed by Timothy Hatcher.

        * WebProcess/WebPage/WebCookieJar.h:
        * WebProcess/WebPage/WebCookieJar.cpp:
        (WebKit::WebCookieJar::setRawCookie):

        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::setRawCookie): Added.

2020-03-28  David Kilzer  <ddkilzer@apple.com>

        REGRESSION (r258201): Use-after-move in UserMediaCaptureManager::Source::didFail()
        <https://webkit.org/b/209711>
        <rdar://problem/61018569>

        Reviewed by Darin Adler.

        * WebProcess/cocoa/UserMediaCaptureManager.cpp:
        (WebKit::UserMediaCaptureManager::Source::didFail):
        - Use `m_errorMessage` to fix the use-after-move.

2020-03-28  Alex Christensen  <achristensen@webkit.org>

        REGRESSION(r257963) UI process crashes when setting navigation delegate inside navigation delegate callbacks
        https://bugs.webkit.org/show_bug.cgi?id=209705
        <rdar://problem/60814765>

        Reviewed by Darin Adler.

        I introduced a pattern of making multiple delegate calls sequentially.  This is bad because the delegate can change.
        We need to go back to the WebPageProxy and get the navigation client again between calls.
        I manually verified this fixes the crash in the radar.
        Covered by modifying an existing API test to modify the navigation delegate in a callback.

        * UIProcess/API/APINavigationClient.h:
        (API::NavigationClient::didStartProvisionalNavigation):
        (API::NavigationClient::didStartProvisionalLoadForFrame):
        (API::NavigationClient::didFailProvisionalNavigationWithError):
        (API::NavigationClient::didFailProvisionalLoadWithErrorForFrame):
        (API::NavigationClient::didCommitNavigation):
        (API::NavigationClient::didCommitLoadForFrame):
        (API::NavigationClient::didFinishNavigation):
        (API::NavigationClient::didFinishLoadForFrame):
        (API::NavigationClient::didFailNavigationWithError):
        (API::NavigationClient::didFailLoadWithErrorForFrame):
        * UIProcess/API/C/WKPage.cpp:
        (WKPageSetPageNavigationClient):
        * UIProcess/API/glib/WebKitNavigationClient.cpp:
        * UIProcess/Cocoa/NavigationState.h:
        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::~NavigationState):
        (WebKit::NavigationState::NavigationClient::didStartProvisionalNavigation):
        (WebKit::NavigationState::NavigationClient::didStartProvisionalLoadForFrame):
        (WebKit::NavigationState::NavigationClient::didFailProvisionalNavigationWithError):
        (WebKit::NavigationState::NavigationClient::didFailProvisionalLoadWithErrorForFrame):
        (WebKit::NavigationState::NavigationClient::didCommitNavigation):
        (WebKit::NavigationState::NavigationClient::didCommitLoadForFrame):
        (WebKit::NavigationState::NavigationClient::didFinishNavigation):
        (WebKit::NavigationState::NavigationClient::didFinishLoadForFrame):
        (WebKit::NavigationState::NavigationClient::didFailNavigationWithError):
        (WebKit::NavigationState::NavigationClient::didFailLoadWithErrorForFrame):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
        (WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared):
        (WebKit::WebPageProxy::didCommitLoadForFrame):
        (WebKit::WebPageProxy::didFinishLoadForFrame):
        (WebKit::WebPageProxy::didFailLoadForFrame):

2020-03-28  David Kilzer  <ddkilzer@apple.com>

        Use-after-move in NetworkProcess::addServiceWorkerSession()
        <https://webkit.org/b/209710>
        <rdar://problem/61017857>

        Reviewed by Darin Adler.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::addServiceWorkerSession):
        - Use `addResult.iterator->value.databasePath` instead of the
          `serviceWorkerRegistrationDirectory` parameter to fix the
          use-after-move.

2020-03-28  Chris Dumez  <cdumez@apple.com>

        [iOS] Delay process suspension for a while after loading an app link
        https://bugs.webkit.org/show_bug.cgi?id=209686
        <rdar://problem/60888891>

        Reviewed by Darin Adler.

        Client apps that rely on WebKit to open app links cannot call the [WKWebView _willOpenAppLink] SPI
        that was added in r259146. Instead, we need to call WebPageProxy::willOpenAppLink() in
        tryInterceptNavigation() when WebKit opens the AppLink itself.

        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::tryInterceptNavigation):

2020-03-28  Alex Christensen  <achristensen@webkit.org>

        Deprecate injected bundle page group SPI
        https://bugs.webkit.org/show_bug.cgi?id=209687

        Reviewed by Timothy Hatcher.

        This old code is problematic, and the use of it is being removed in rdar://problem/60987265

        * Shared/WebPageGroupData.cpp:
        (WebKit::WebPageGroupData::encode const):
        (WebKit::WebPageGroupData::decode):
        * Shared/WebPageGroupData.h:
        * UIProcess/WebPageGroup.cpp:
        (WebKit::WebPageGroup::WebPageGroup):
        * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
        (WKBundleAddUserScript):
        (WKBundleAddUserStyleSheet):
        (WKBundleRemoveUserScript):
        (WKBundleRemoveUserStyleSheet):
        (WKBundleRemoveUserScripts):
        (WKBundleRemoveUserStyleSheets):
        (WKBundleRemoveAllUserContent):
        * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
        * WebProcess/InjectedBundle/InjectedBundle.cpp:
        (WebKit::InjectedBundle::addUserScript): Deleted.
        (WebKit::InjectedBundle::addUserStyleSheet): Deleted.
        (WebKit::InjectedBundle::removeUserScript): Deleted.
        (WebKit::InjectedBundle::removeUserStyleSheet): Deleted.
        (WebKit::InjectedBundle::removeUserScripts): Deleted.
        (WebKit::InjectedBundle::removeUserStyleSheets): Deleted.
        (WebKit::InjectedBundle::removeAllUserContent): Deleted.
        * WebProcess/InjectedBundle/InjectedBundle.h:
        * WebProcess/WebPage/WebPageGroupProxy.cpp:
        (WebKit::WebPageGroupProxy::WebPageGroupProxy):
        (WebKit::WebPageGroupProxy::userContentController): Deleted.
        * WebProcess/WebPage/WebPageGroupProxy.h:

2020-03-27  Wenson Hsieh  <wenson_hsieh@apple.com>

        Web content processes should not be able to arbitrarily request pasteboard data from the UI process
        https://bugs.webkit.org/show_bug.cgi?id=209657
        <rdar://problem/59611585>

        Reviewed by Geoff Garen.

        This patch adds a mechanism to prevent the UI process from sending pasteboard data to the web process in
        response to WebPasteboardProxy IPC messages, unless the user (or the WebKit client, on behalf of the user) has
        explicitly made the contents of the pasteboard available to a page in that web process. We determine the latter
        by maintaining information about the `changeCount`s of each pasteboard we allow each web process to read. This
        mapping is updated when either the user interacts with trusted UI (context menus, DOM paste menu) for pasting,
        or an API client calls into -[WKWebView paste:], as is the case when pasting via the callout bar on iOS or
        pasting via keyboard shortcuts (i.e. cmd + V) on macOS and iOS.

        See per-change comments below for more details. Under normal circumstances, there should be no change in
        behavior; refer to the radar for more context.

        * UIProcess/Cocoa/WebPageProxyCocoa.mm:
        (WebKit::WebPageProxy::grantAccessToCurrentPasteboardData):

        Add a helper method to grant access to the data currently on the pasteboard with the given name; for now, this
        grants access to all related pages that reside in the same web process, but this may be refactored in a future
        change to make the mapping granular to each WebPageProxy rather than WebProcessProxy.

        (Note: it is _critical_ that this method is never invoked as a result of IPC from the web process.)

        * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
        (WebKit::WebPasteboardProxy::grantAccessToCurrentData):

        Helper method to grant access to the current contents on the named pasteboard. Calling this method updates
        `m_pasteboardNameToChangeCountAndProcessesMap`, such that the given web process is able to read from the
        pasteboard with the given name, as long as the `changeCount` is still the same. To implement this behavior,
        we either (1) add the process to an existing `WeakHashSet` of process proxies in the case where the
        `changeCount` is the same as it was when we added the existing `WeakHashSet`, or in all other cases, (2) add a
        replace the current (changeCount, processes) pair with the new change count and a weak set containing only the
        given WebProcessProxy.

        (WebKit::WebPasteboardProxy::revokeAccessToAllData):

        Helper method to revoke all pasteboard access for the given WebProcessProxy. Called when resetting state, e.g.
        after web process termination.

        (WebKit::WebPasteboardProxy::canAccessPasteboardData const):

        Private helper method to check whether an IPC message can access pasteboard data, based on the IPC::Connection
        used to receive the message. This helper method returns true if either the WebKit client has used SPI
        (both DOMPasteAllowed and JavaScriptCanAccessClipboard) to grant unmitigated access to the clipboard from the
        web process, or access has been previously granted due to user interaction in the UI process or API calls made
        directly by the WebKit client.

        (WebKit::WebPasteboardProxy::didModifyContentsOfPasteboard):

        Private helper method to update the pasteboard changeCount that has been granted to a given web process, in the
        case where that web process was also responsible for writing data to the pasteboard and the pasteboard
        changeCount prior to modifying the pasteboard was still valid. In other words, we should always allow a web
        process to read contents it has just written. This allows us to maintain the use case where a WKWebView client
        copies and pastes using back-to-back API calls:

        ```
        [webView copy:nil];
        [webView paste:nil];
        ```

        (WebKit::WebPasteboardProxy::getPasteboardPathnamesForType):

        Add a FIXME to add the `canAccessPasteboardData` check here as well. We can't do this yet because the web
        process currently relies on being able to read the full list of pasteboard path names when dragging over the
        page, but this will be fixed in a followup patch in the near future (see https://webkit.org/b/209671).

        (WebKit::WebPasteboardProxy::getPasteboardStringForType):
        (WebKit::WebPasteboardProxy::getPasteboardStringsForType):
        (WebKit::WebPasteboardProxy::getPasteboardBufferForType):
        (WebKit::WebPasteboardProxy::getPasteboardColor):
        (WebKit::WebPasteboardProxy::getPasteboardURL):

        In all the call sites where we ask for pasteboard data (with the exception of getPasteboardPathnamesForType, for
        the time being), check whether we're allowed to read pasteboard data by consulting canAccessPasteboardData. If
        not, return early with no data.

        (WebKit::WebPasteboardProxy::addPasteboardTypes):
        (WebKit::WebPasteboardProxy::setPasteboardTypes):
        (WebKit::WebPasteboardProxy::setPasteboardURL):
        (WebKit::WebPasteboardProxy::setPasteboardColor):
        (WebKit::WebPasteboardProxy::setPasteboardStringForType):

        In all the call sites where we knowingly mutate the pasteboard (and bump the changeCount as a result),
        additionally update the changeCount to which we've granted access on behalf of the web process that is modifying
        the pasteboard.

        (WebKit::WebPasteboardProxy::urlStringSuitableForLoading):
        (WebKit::WebPasteboardProxy::setPasteboardBufferForType):
        (WebKit::WebPasteboardProxy::writeCustomData):
        (WebKit::WebPasteboardProxy::readStringFromPasteboard):
        (WebKit::WebPasteboardProxy::readURLFromPasteboard):
        (WebKit::WebPasteboardProxy::readBufferFromPasteboard):
        (WebKit::WebPasteboardProxy::writeURLToPasteboard):
        (WebKit::WebPasteboardProxy::writeWebContentToPasteboard):
        (WebKit::WebPasteboardProxy::writeImageToPasteboard):
        (WebKit::WebPasteboardProxy::writeStringToPasteboard):

        (See comments above).

        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::performDragOperation):

        When performing a drop on macOS, grant temporary access to the drag pasteboard.

        (WebKit::WebViewImpl::requestDOMPasteAccess):
        (WebKit::WebViewImpl::handleDOMPasteRequestWithResult):

        If the user has granted DOM paste access, additionally grant access to the general pasteboard.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::isPasteCommandName):
        (WebKit::WebPageProxy::executeEditCommand):

        When executing an edit command on behalf of a WebKit client, check to see if it is a paste command (one of
        the four that are defined in EditorCommand.cpp). If so, we grant access to the current contents of the general
        pasteboard.

        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPasteboardProxy.cpp:
        (WebKit::WebPasteboardProxy::webProcessProxyForConnection const):

        Add a helper method to map a given IPC::Connection to a WebProcessProxy. While we have a list of WebProcessProxy
        objects, we know a priori that at most one of them will have the given connection, so returning a single
        `WebProcessProxy*` here is sufficient (rather than a list of `WebProcessProxy*`s).

        (WebKit::WebPasteboardProxy::allPasteboardItemInfo):
        (WebKit::WebPasteboardProxy::informationForItemAtIndex):
        (WebKit::WebPasteboardProxy::getPasteboardItemsCount):
        (WebKit::WebPasteboardProxy::readURLFromPasteboard):
        (WebKit::WebPasteboardProxy::readBufferFromPasteboard):
        (WebKit::WebPasteboardProxy::readStringFromPasteboard):
        (WebKit::WebPasteboardProxy::urlStringSuitableForLoading):

        Update interface stubs for non-Cocoa platforms.

        * UIProcess/WebPasteboardProxy.h:
        * UIProcess/WebPasteboardProxy.messages.in:

        Decorate more IPC endpoints with `WantsConnection`, so that we can reason about the `IPC::Connection`s used to
        receive pasteboard messages.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _handleDOMPasteRequestWithResult:]):

        If the user has granted DOM paste access, additionally grant access to the general pasteboard.

        (-[WKContentView dropInteraction:performDrop:]):

        When performing a drop on iOS, grant temporary access to the drag pasteboard.

        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::willPerformPasteCommand):
        * UIProcess/libwpe/WebPasteboardProxyLibWPE.cpp:
        (WebKit::WebPasteboardProxy::readStringFromPasteboard):
        * UIProcess/mac/WebPageProxyMac.mm:
        (WebKit::WebPageProxy::platformDidSelectItemFromActiveContextMenu):

        Grant pasteboard access when using the context menu to paste on macOS.

        (WebKit::WebPageProxy::willPerformPasteCommand):

        Grant pasteboard access when triggering the "Paste" edit command using WebKit SPI.

2020-03-27  Chris Dumez  <cdumez@apple.com>

        [iOS] Delay process suspension for a while after loading an app link
        https://bugs.webkit.org/show_bug.cgi?id=209686
        <rdar://problem/60888891>

        Reviewed by Darin Adler.

        Delay process suspension for a while after loading an app link. This will allow the page's script to pass
        information more reliably to the native app handling the navigation.

        This patch adds a [WKWebView _willOpenAppLink] SPI that the client needs to call before opening the
        app link.

        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/API/ios/WKWebViewIOS.mm:
        (-[WKWebView _willOpenAppLink]):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::close):
        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::willOpenAppLink):

2020-03-27  David Kilzer  <ddkilzer@apple.com>

        NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked should validate its parameters
        <https://webkit.org/b/209614>
        <rdar://problem/60096304>

        Reviewed by Alex Christensen.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (NETWORK_PROCESS_MESSAGE_CHECK):
        - Define/undef macro for killing WebContent process when an
          invalid IPC message is received.
        (WebKit::NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked):
        - Use NETWORK_PROCESS_MESSAGE_CHECK to validate its parameters.

2020-03-27  Tim Horton  <timothy_horton@apple.com>

        Unable to build WebKit with iOS 13.4 SDK
        https://bugs.webkit.org/show_bug.cgi?id=209317

        Reviewed by Dean Jackson.

        * Platform/spi/ios/UIKitSPI.h:
        One more attempt. __IPHONE_OS_VERSION_MAX_ALLOWED is inaccurate.

2020-03-27  Daniel Bates  <dabates@apple.com>

        Use -_hasFocusedElement in -_didUpdateInputMode
        https://bugs.webkit.org/show_bug.cgi?id=209662

        Reviewed by Wenson Hsieh.

        Remove duplication by using -_hasFocusedElement.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _didUpdateInputMode:]):

2020-03-27  Wenson Hsieh  <wenson_hsieh@apple.com>

        DragData::containsURL() should avoid reading URL strings from the pasteboard
        https://bugs.webkit.org/show_bug.cgi?id=209642
        Work towards <rdar://problem/59611585>

        Reviewed by Tim Horton.

        See WebCore/ChangeLog for more details.

        * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
        (WebKit::WebPasteboardProxy::containsURLStringSuitableForLoading):
        (WebKit::WebPasteboardProxy::urlStringSuitableForLoading):
        * UIProcess/WebPasteboardProxy.cpp:
        (WebKit::WebPasteboardProxy::containsURLStringSuitableForLoading):
        (WebKit::WebPasteboardProxy::urlStringSuitableForLoading):
        * UIProcess/WebPasteboardProxy.h:
        * UIProcess/WebPasteboardProxy.messages.in:

        Add IPC plumbing for the new pasteboard strategy methods: containsURLStringSuitableForLoading and
        urlStringSuitableForLoading.

        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
        (WebKit::WebPlatformStrategies::containsURLStringSuitableForLoading):
        (WebKit::WebPlatformStrategies::urlStringSuitableForLoading):
        * WebProcess/WebCoreSupport/WebPlatformStrategies.h:

2020-03-27  youenn fablet  <youenn@apple.com>

        Filter DOMCache records in network process to reduce the number of records being sent to WebProcess
        https://bugs.webkit.org/show_bug.cgi?id=209469
        <rdar://problem/55207565>

        Reviewed by Alex Christensen.

        Receive new retrieve record options and make use of them to filter the records sent back to the WebProcess.
        This includes filtering the records for a given requests.
        This includes removing responses in case the request is made to gather all requests for Cache.keys().

        * NetworkProcess/cache/CacheStorageEngine.cpp:
        (WebKit::CacheStorage::Engine::retrieveRecords):
        * NetworkProcess/cache/CacheStorageEngine.h:
        * NetworkProcess/cache/CacheStorageEngineCache.cpp:
        (WebKit::CacheStorage::Cache::retrieveRecords):
        * NetworkProcess/cache/CacheStorageEngineCache.h:
        * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
        (WebKit::CacheStorageEngineConnection::retrieveRecords):
        * NetworkProcess/cache/CacheStorageEngineConnection.h:
        * NetworkProcess/cache/CacheStorageEngineConnection.messages.in:
        * WebProcess/Cache/WebCacheStorageConnection.cpp:
        (WebKit::WebCacheStorageConnection::retrieveRecords):
        * WebProcess/Cache/WebCacheStorageConnection.h:

2020-03-27  Chris Lord  <clord@igalia.com>

        [GTK][WPE] Enable kinetic scrolling with async scrolling
        https://bugs.webkit.org/show_bug.cgi?id=209230

        Reviewed by Žan Doberšek.

        Modify WPE mousewheel event delivery so that it includes the necessary
        phases needed to infer press/release times and allow for kinetic
        scrolling.

        * Shared/NativeWebWheelEvent.h:
        * Shared/WebEvent.h:
        * Shared/WebWheelEvent.cpp:
        (WebKit::WebWheelEvent::encode const):
        (WebKit::WebWheelEvent::decode):
        * Shared/libwpe/NativeWebWheelEventLibWPE.cpp:
        (WebKit::NativeWebWheelEvent::NativeWebWheelEvent):
        * Shared/libwpe/WebEventFactory.cpp:
        (WebKit::WebEventFactory::createWebWheelEvent):
        * Shared/libwpe/WebEventFactory.h:
        * UIProcess/API/wpe/PageClientImpl.cpp:
        (WebKit::PageClientImpl::doneWithTouchEvent):
        * UIProcess/API/wpe/ScrollGestureController.cpp:
        (WebKit::ScrollGestureController::handleEvent):
        * UIProcess/API/wpe/ScrollGestureController.h:
        (WebKit::ScrollGestureController::phase):
        * UIProcess/API/wpe/WPEView.cpp:
        (WKWPE::m_backend):

2020-03-26  David Kilzer  <ddkilzer@apple.com>

        NetworkConnectionToWebProcess::domCookiesForHost should validate its `host` parameter
        <https://webkit.org/b/209612>
        <rdar://problem/60097830>

        Reviewed by Alex Christensen.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (NETWORK_PROCESS_MESSAGE_CHECK_COMPLETION):
        - Define/undef macro for killing WebContent process when an
          invalid IPC message is received.
        (WebKit::NetworkConnectionToWebProcess::domCookiesForHost):
        - Use NETWORK_PROCESS_MESSAGE_CHECK_COMPLETION) to validate
          `host` parameter.

2020-03-26  Chris Dumez  <cdumez@apple.com>

        REGRESSION: Unable to show Web Inspector on empty tabs in Safari
        https://bugs.webkit.org/show_bug.cgi?id=209639
        <rdar://problem/60937524>

        Reviewed by Darin Adler.

        Make sure we launch the WebPageProxy's initial process when trying to inspect the
        page using Web Inspector (i.e. WebInspectorProxy::connect() is called).

        * UIProcess/Inspector/WebInspectorProxy.cpp:
        (WebKit::WebInspectorProxy::WebInspectorProxy):
        - Take in a reference instead of a raw pointer as it could never be null.
        - Store the inspected page and add the message receiver to its process, even
          if the process is the dummy one (due to delayed process launch).

        (WebKit::WebInspectorProxy::invalidate):
        Call reset() to avoid code duplication.

        (WebKit::WebInspectorProxy::connect):
        Launch the page's initial process if necessary before trying to send IPC to that
        process.

        (WebKit::WebInspectorProxy::updateForNewPageProcess):
        Take in a reference instead of a raw pointer as it could never be null.

        * UIProcess/Inspector/WebInspectorProxy.h:
        (WebKit::WebInspectorProxy::create):
        Take in a reference instead of a raw pointer as it could never be null.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::launchProcess):
        Call WebInspectorProxy::reset() before launching and connecting to the new process.
        This is important now that the WebInspectorProxy connect to the dummy process proxy.
        We need to make sure the WebInspectorProxy disconnects from the dummy process proxy
        because we connect it to the newly launched process.

        (WebKit::WebPageProxy::finishAttachingToWebProcess):

2020-03-26  Chris Dumez  <cdumez@apple.com>

        Regression: Unable to trigger context menu on empty tabs in Safari
        https://bugs.webkit.org/show_bug.cgi?id=209628

        Reviewed by Geoffrey Garen.

        Launch the WebPageProxy's initial process if it starts processing mouse events.
        As an optimization, the WebPageProxy only launches its initial process when it
        really needs to.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::handleMouseEvent):

2020-03-26  Michael Catanzaro  <mcatanzaro@gnome.org>

        Fix various compiler warnings
        https://bugs.webkit.org/show_bug.cgi?id=209438

        Reviewed by Darin Adler.

        * UIProcess/API/C/WKPage.cpp: Suppress -Wdeprecated-declaration warnings.
        (WKPageSetPageLoaderClient):
        (WKPageSetPagePolicyClient):

2020-03-26  Daniel Bates  <dabates@apple.com>

        Rename -_isInteractingWithFocusedElement, add it to the header, and replace calls to hasFocusedElement() with it
        https://bugs.webkit.org/show_bug.cgi?id=209623

        Reviewed by Simon Fraser.

        Rename -_isInteractingWithFocusedElement to -_hasFocusedElement. For now, standardize around
        the convention of using -_hasFocusedElement instead of hasFocusedElement(_focusedElementInformation).

        I think in the ideal world -_hasFocusedElement would not exist and instead -_elementDidBlur would
        reset the state of _focusedElementInformation to what it was when a page is first loaded. I will
        look to do this in a subsequent patch because it is risky. Doing so requires a careful audit of all
        call sites that use _focusedElementInformation as they may have inadvertently depended on stale state.

        While I am here, I added -_hasFocusedElement to WKContentViewInteraction.h so that I can make use
        of it in the fix for <rdar://problem/60871807>.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _didGetTapHighlightForRequest:color:quads:topLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:nodeHasBuiltInClickHandling:]):
        (-[WKContentView inputViewForWebView]):
        (-[WKContentView _selectionClipRect]):
        (-[WKContentView gestureRecognizerShouldBegin:]):
        (-[WKContentView canPerformActionForWebView:withSender:]):
        (-[WKContentView _hasFocusedElement]):
        (-[WKContentView changeSelectionWithGestureAt:withGesture:withState:withFlags:]):
        (-[WKContentView selectPositionAtPoint:completionHandler:]):
        (-[WKContentView selectPositionAtBoundary:inDirection:fromPoint:completionHandler:]):
        (-[WKContentView selectTextWithGranularity:atPoint:completionHandler:]):
        (-[WKContentView updateSelectionWithExtentPoint:completionHandler:]):
        (-[WKContentView updateSelectionWithExtentPoint:withBoundary:completionHandler:]):
        (-[WKContentView setSelectedTextRange:]):
        (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:activityStateChanges:userObject:]):
        (-[WKContentView _updateInputContextAfterBlurringAndRefocusingElement]):
        (-[WKContentView _updateSelectionAssistantSuppressionState]):
        (-[WKContentView _autofillContext]):
        (hasFocusedElement): Deleted.
        (-[WKContentView _isInteractingWithFocusedElement]): Deleted.

2020-03-26  Daniel Bates  <dabates@apple.com>

        Remove hitTestOrder from ElementContext as it is no longer need
        https://bugs.webkit.org/show_bug.cgi?id=209561
        <rdar://problem/60888305>

        Reviewed by Wenson Hsieh.

        Revert the temporary workaround made in r257749 as <rdar://problem/59602885>
        has been fixed: WebKit no longer needs to explicitly annotate the resulting
        elements found in textInputContextsInRect() with their hit test order.
        Instead client code has been updated to assume these elements are returned
        in hit test order.

        * UIProcess/API/Cocoa/_WKTextInputContext.mm:
        (-[_WKTextInputContext _hitTestOrder]): Deleted.
        * UIProcess/API/Cocoa/_WKTextInputContextInternal.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::textInputContextsInRect):
        (WebKit::WebPage::contextForElement const):

2020-03-26  Tim Horton  <timothy_horton@apple.com>

        Pinch to zoom gesture has to be repeated twice if the cursor isn't moved between gestures
        https://bugs.webkit.org/show_bug.cgi?id=203132
        <rdar://problem/27439348>

        Reviewed by Simon Fraser.

        * UIProcess/WebPageProxy.cpp:
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/mac/ViewGestureControllerMac.mm:
        (WebKit::ViewGestureController::endMagnificationGesture):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/mac/WebPageMac.mm:
        (WebKit::WebPage::didEndMagnificationGesture):
        Plumb the end of a pinch-zoom gesture to EventHandler.

2020-03-26  Chris Dumez  <cdumez@apple.com>

        Regression(r258949) Safari sometimes crashes when becoming the foreground application
        https://bugs.webkit.org/show_bug.cgi?id=209620
        <rdar://problem/60930466>

        Reviewed by Per Arne Vollan.

        Make sure m_activationObserver gets unregistered on all Cocoa platforms, not just on iOS.

        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::unregisterNotificationObservers):

2020-03-26  Daniel Bates  <dabates@apple.com>

        WebPage::selectPositionAtPoint() does not focus an element in a non-focused frame
        https://bugs.webkit.org/show_bug.cgi?id=209559
        <rdar://problem/60887055>

        Reviewed by Wenson Hsieh.

        Call setFocusedFrameBeforeSelectingTextAtLocation() in WebPage::selectPositionAtPoint() to
        update the focused frame before performing the selection. This way the target element will
        be focused by the selection, if not already focused.

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::selectPositionAtPoint):

2020-03-26  Fujii Hironori  <Hironori.Fujii@sony.com>

        WebKitTestRunner should enable ResourceLoadStatistics also for non-Cocoa ports
        https://bugs.webkit.org/show_bug.cgi?id=209410

        Reviewed by Youenn Fablet.

        NetworkSession's member variables for ResourceLoadStatistics were
        initialized only for Cocoa port. They also should be initialized
        for non-Cocoa ports.

        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::NetworkSession): Added member initializers for ResourceLoadStatistics.
        * NetworkProcess/NetworkSession.h: Have m_resourceLoadStatisticsDirectory only if ENABLE(RESOURCE_LOAD_STATISTICS).
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): Removed the code to initialize member variables for ResourceLoadStatistics.

2020-03-26  Kate Cheney  <katherine_cheney@apple.com>

        Guard AppBound domain protections with PLATFORM(iOS_FAMILY)
        https://bugs.webkit.org/show_bug.cgi?id=209615
        <rdar://problem/60931014>

        Reviewed by Darin Adler.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::setIsNavigatingToAppBoundDomain):

2020-03-26  Brent Fulgham  <bfulgham@apple.com>

        [iOS] Deny mach lookup to 'com.apple.webinspector' in the WebContent process.
        https://bugs.webkit.org/show_bug.cgi?id=207170
        <rdar://problem/59134038>

        Reviewed by Per Arne Vollan.

        We now dynamically add access to the 'com.apple.webinspector' service, so we should remove the blanket
        allow rule from the sandbox.

        * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in:
        * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb:
        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

2020-03-26  Daniel Bates  <dabates@apple.com>

        REGRESSION (r258989): ASSERTION FAILED: !isMissingPostLayoutData in WebKit::EditorState::PostLayoutData
        https://bugs.webkit.org/show_bug.cgi?id=209570
        <rdar://problem/60895050>

        Reviewed by Darin Adler.

        Send an editor state update before responding to a request for position information
        to ensure that the UI process has up-to-date selection state. Otherwise, calling code
        that uses this information to determine whether to query for the selection text will
        cause an assertion failure.

        This fixes the test failure TestWebKitAPI.ActionSheetTests.DataDetectorsLinkIsNotPresentedAsALink
        caused by r258989. Following r258989 WebKit now accurately reports whether editor state
        has or does not have post-layout details. Prior to this the default EditorState was marked
        as having post-layout data even if it did not actually have such data.

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::getPositionInformation):
        (WebKit::WebPage::requestPositionInformation):

2020-03-26  David Quesada  <david_quesada@apple.com>

        Add SPI to specify whether file upload panels are uploading to an enterprise-managed destination
        https://bugs.webkit.org/show_bug.cgi?id=209607
        rdar://problem/60888386

        Reviewed by Darin Adler.

        When presenting the file upload panel, set the UIDocumentPickerViewController.isContentManaged
        property to a value ultimately provided by the UI delegate. This can be used to prevent the upload
        of personal data to enterprise websites on managed devices configured to prevent such a transfer.

        * Platform/spi/ios/UIKitSPI.h:
        * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
        * UIProcess/PageClient.h:
        (WebKit::PageClient::handleRunOpenPanel):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::runOpenPanel):
        * UIProcess/ios/PageClientImplIOS.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::handleRunOpenPanel):
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _showRunOpenPanel:frameInfo:resultListener:]):
        (-[WKContentView fileUploadPanelDestinationIsManaged:]):
        (-[WKContentView _showRunOpenPanel:resultListener:]): Deleted.
        * UIProcess/ios/forms/WKFileUploadPanel.h:
        * UIProcess/ios/forms/WKFileUploadPanel.mm:
        (-[WKFileUploadPanel showFilePickerMenu]):

2020-03-26  Dean Jackson  <dino@apple.com>

        Force Touch preview on file:/// URL works while clicking on the URL is blocked
        https://bugs.webkit.org/show_bug.cgi?id=209589
        <rdar://57687893>

        Reviewed by Antoine Quint.

        The immediate action for links should never trigger on file: URLs.

        * UIProcess/mac/WKImmediateActionController.mm:
        (-[WKImmediateActionController _defaultAnimationController]):

2020-03-26  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Deny mach lookup access to frontboard services in the WebContent process
        https://bugs.webkit.org/show_bug.cgi?id=209604

        Reviewed by Darin Adler.

        Deny mach lookup access to "com.apple.frontboard.systemappservices" in the WebContent process on iOS.

        Test: fast/sandbox/ios/sandbox-mach-lookup.html

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

2020-03-26  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Adopt ScreenProperties class.
        https://bugs.webkit.org/show_bug.cgi?id=191767

        Reviewed by Brent Fulgham.

        Make relevent macOS platform code cross platform.

        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const):
        (WebKit::WebProcessCreationParameters::decode):
        * Shared/WebProcessCreationParameters.h:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::setScreenProperties):
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:

2020-03-26  David Kilzer  <ddkilzer@apple.com>

        MESSAGE_CHECK base macros should use UNLIKELY()
        <https://webkit.org/b/209581>
        <rdar://problem/60901307>

        Reviewed by Youenn Fablet.

        * Platform/IPC/Connection.h:
        (MESSAGE_CHECK_COMPLETION_BASE):
        (MESSAGE_CHECK_WITH_RETURN_VALUE_BASE):
        - Add UNLIKELY() macro since these code paths should not be
          taken under normal conditions.
        - Add curly braces to multi-line do-while loops per WebKit style
          guidelines, and is required after moving the ASSERT().
        - Move the ASSERT() outside the if statement since that's more
          idomatic.

2020-03-26  Per Arne Vollan  <pvollan@apple.com>

        [Cocoa] Fix incorrect rebase
        https://bugs.webkit.org/show_bug.cgi?id=209600

        Reviewed by Brent Fulgham.

        A rebase went wrong in <https://bugs.webkit.org/show_bug.cgi?id=203214> and placed the method call to
        enableRemoteInspectorIfNeeded() in the wrong method. It should be called in WebProcessProxy::didFinishLaunching.

        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::mayBecomeUnresponsive):
        (WebKit::WebProcessProxy::didFinishLaunching):

2020-03-26  Michael Catanzaro  <mcatanzaro@gnome.org>

        [GTK] Crash in WebKit::LayerTreeHost::LayerTreeHost with bubblewrap sandbox enabled
        https://bugs.webkit.org/show_bug.cgi?id=209106

        Reviewed by Carlos Garcia Campos.

        Don't bind the WaylandCompositor socket unless we're running under Wayland and it's actually
        started successfully.

        * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
        (WebKit::bindWayland):

2020-03-26  David Kilzer  <ddkilzer@apple.com>

        VideoFullscreenManagerProxy::setupFullscreenWithID should message check videoLayerID
        <https://webkit.org/b/209578>
        <rdar://problem/60703503>

        Reviewed by Eric Carlson.

        * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
        (MESSAGE_CHECK): Define (and undef) new macro for assertions.
        (WebKit::VideoFullscreenManagerProxy::setupFullscreenWithID):
        Change ASSERT() to MESSAGE_CHECK().

2020-03-26  Michael Catanzaro  <mcatanzaro@gnome.org>

        Syscall param sendmsg(msg.msg_iov[0]) points to uninitialised byte(s) in IPC::Connection::sendOutgoingMessage
        https://bugs.webkit.org/show_bug.cgi?id=146729

        Reviewed by Carlos Garcia Campos.

        The entire MessageInfo is passed to write(), so we have to zero the padding bytes to avoid
        writing uninitialized memory.

        * Platform/IPC/unix/UnixMessage.h:
        (IPC::MessageInfo::MessageInfo):

2020-03-25  Timothy Horton  <timothy_horton@apple.com>

        Unable to build WebKit with iOS 13.4 SDK
        https://bugs.webkit.org/show_bug.cgi?id=209317

        * Platform/spi/ios/UIKitSPI.h:
        Address post-landing review comment; use SDK conditionals, not deployment
        target conditionals, since SPI headers are mimicing SDK content.

2020-03-25  Ryosuke Niwa  <rniwa@webkit.org>

        Mini browser immediately hit an assertion in debug build
        https://bugs.webkit.org/show_bug.cgi?id=209575

        Reviewed by Simon Fraser.

        Use 1 instead of 0 as the desination ID to avoid hitting assertions.

        * WebProcess/GPU/media/RemoteAudioSession.cpp:
        (WebKit::RemoteAudioSession::RemoteAudioSession):
        (WebKit::RemoteAudioSession::~RemoteAudioSession):

2020-03-25  Tim Horton  <timothy_horton@apple.com>

        Unable to build WebKit with iOS 13.4 SDK
        https://bugs.webkit.org/show_bug.cgi?id=209317

        Reviewed by Megan Gardner.

        * Platform/spi/ios/UIKitSPI.h:
        Stop defining some UIKit SPI that is now API (hurray!).

2020-03-25  Per Arne Vollan  <pvollan@apple.com>

        [macOS] Fix sandbox violations related to media playback
        https://bugs.webkit.org/show_bug.cgi?id=209568
        <rdar://problem/60262125>

        Reviewed by Brent Fulgham.

        Fix observed sandbox violations during media playback.

        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::mediaRelatedMachServices):

2020-03-25  Daniel Bates  <dabates@apple.com>

        Element context character rects may be in wrong coordinate system
        https://bugs.webkit.org/show_bug.cgi?id=209493
        <rdar://problem/60840261>

        Reviewed by Wenson Hsieh.

        Convert the character rects from content view coordinates to root view coordinates
        as that is the coordinate system callers of -requestDocumentContext expect.

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::requestDocumentEditingContext):

2020-03-25  Wenson Hsieh  <wenson_hsieh@apple.com>

        Rename "data interaction pasteboard" to "drag and drop pasteboard"
        https://bugs.webkit.org/show_bug.cgi?id=209556

        Reviewed by Tim Horton.

        Adopt Pasteboard::nameOfDragPasteboard instead of the literal string "data interaction pasteboard".

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView dropInteraction:sessionDidEnter:]):
        (-[WKContentView dropInteraction:sessionDidUpdate:]):
        (-[WKContentView dropInteraction:sessionDidExit:]):
        (-[WKContentView dropInteraction:performDrop:]):

2020-03-25  Brady Eidson  <beidson@apple.com>

        Some WKWebView.h header doc cleanup.
        https://bugs.webkit.org/show_bug.cgi?id=209549

        Reviewed by Simon Fraser.

        * UIProcess/API/Cocoa/WKWebView.h:

2020-03-25  Daniel Bates  <dabates@apple.com>

        Remove newline that I accidentally added in r258989.

        * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:

2020-03-25  Brent Fulgham  <bfulgham@apple.com>

        Avoid logging sensitive information for all network sessions
        https://bugs.webkit.org/show_bug.cgi?id=209522
        <rdar://problem/54807157>

        Reviewed by Alex Christensen.

        We avoid logging sensitive information (such as visited URLs) on production builds and for ephemeral sessions.

        We should also avoid such logging for engineering and prerelease builds to reduce the possibility of any
        personally identifiable information being retained in logs.

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::configurationForSessionID): Deny senstive logging for all sessions.

2020-03-24  Daniel Bates  <dabates@apple.com>

        [iOS] ASSERTION FAILURE: !isMissingPostLayoutData in WebKit::EditorState::postLayoutData()
        https://bugs.webkit.org/show_bug.cgi?id=199960
        <rdar://problem/53323966>

        Reviewed by Simon Fraser.

        Refactor the computation of editor state so that we can request that a layout be performed
        each time we compute the editor state as part of asking the UI process to interpret a key
        event. The full (read: after layout) editor state is needed for UIKit to perform a deletion
        because UIKit wants to know how many characters are before the selection. Otherwise, we hit
        an assert due to the fact the last editor state sent (when the Web process asked the UI process
        to interpret the key) is missing layout data.

        The refactoring also moves the Cocoa-common code out of the platform-independent WebPage.cpp
        file into WebPageCocoa.mm.

        One side effect of the refactoring is that we no longer allow the platformEditorState() function
        to override the isMissingPostLayoutData bit. Currently it can even though the calling code, the
        platform independent code (PIE) in WebPage, may have attached layout data. Now the PIE code sets
        this bit if it attached layout data and the platformEditorState() function only attaches more
        layout data if that bit is set. platformEditorState() never unsets that bit (i.e. sets isMissingPostLayoutData
        to true).

        The patch also removes m_isEditorStateMissingPostLayoutData in WebPage.h. This instance variable
        has been unused since <https://trac.webkit.org/changeset/221064/webkit>. Also we haven't been using
        IncludePostLayoutDataHint::No since the last reference to it was removed in <https://trac.webkit.org/changeset/244494/webkit>.

        I also renamed platformEditorState() to getPlatformEditorState() since it has an out argument.

        Test: editing/deleting/ios/backspace-last-character.html

        * Shared/EditorState.h:
        * UIProcess/API/glib/WebKitEditorState.cpp:
        (webkitEditorStateCreate): Initialize _WebKitEditorStatePrivate::typingAttributes to WEBKIT_EDITOR_TYPING_ATTRIBUTE_NONE.
        * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
        (WebKit::WebPage::getPlatformEditorStateCommon const): Added. Moved Cocoa-common code from WebPage.cpp to here.
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::editorState const): Move Cocoa-common code to WebPageCocoa.mm. Change enum to
        track whether a layout should be performed. Keep the current behavior of only including post layout
        data if the frame view does not need a layout. This behavior is encoded in the enumerator ShouldPerformLayout::Default.
        which is the default argument value for the argument shouldPerformLayout.
        * WebProcess/WebPage/WebPage.h:
        (WebKit::WebPage::platformNeedsLayoutForEditorState const): Added. Non-Cocoa port implementation
        that returns false.
        * WebProcess/WebPage/glib/WebPageGLib.cpp:
        (WebKit::WebPage::getPlatformEditorState const): Early return if isMissingPostLayoutData is true.
        (WebKit::WebPage::platformEditorState const): Deleted.
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::platformNeedsLayoutForEditorState const): Added. Keep the current behavior of
        performing a layout if we have a composition or a hardware keyboard is attached.
        (WebKit::WebPage::getPlatformEditorState const): Call platformEditorStateCommon(). Bail out early
        if isMissingPostLayoutData is true.
        (WebKit::WebPage::handleEditingKeyboardEvent): The important part of this patch. Request a layout
        when computing the editor state that we will send to the UI process.
        (WebKit::WebPage::platformEditorState const): Deleted.
        * WebProcess/WebPage/mac/WebPageMac.mm:
        (WebKit::WebPage::getPlatformEditorState const): Call platformEditorStateCommon(). Bail out early
        if isMissingPostLayoutData is true.
        (WebKit::WebPage::platformEditorState const): Deleted.
        * WebProcess/WebPage/playstation/WebPagePlayStation.cpp:
        (WebKit::WebPage::getPlatformEditorState const): Update as needed.
        (WebKit::WebPage::platformEditorState const): Deleted.
        * WebProcess/WebPage/win/WebPageWin.cpp:
        (WebKit::WebPage::getPlatformEditorState const): Update as needed.
        (WebKit::WebPage::platformEditorState const): Deleted.

2020-03-25  Kate Cheney  <katherine_cheney@apple.com>

        App-bound domain checks should provide more debugging details at script evaluation sites
        https://bugs.webkit.org/show_bug.cgi?id=209521
        <rdar://problem/60837954>

        Reviewed by Chris Dumez.

        Return an exception because that option is available here, and also add
        console and release logging for consistency across app-bound domain checks.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::runJavaScript):

2020-03-25  Wenson Hsieh  <wenson_hsieh@apple.com>

        Avoid querying pasteboard strings while dragging content over a potential drop target
        https://bugs.webkit.org/show_bug.cgi?id=209531

        Reviewed by Tim Horton and Ryosuke Niwa.

        Add PasteboardStrategy and WebPasteboardProxy (IPC) plumbing; see WebCore for more details.

        * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
        (WebKit::WebPasteboardProxy::containsStringSafeForDOMToReadForType):
        * UIProcess/WebPasteboardProxy.cpp:
        (WebKit::WebPasteboardProxy::containsStringSafeForDOMToReadForType):
        * UIProcess/WebPasteboardProxy.h:
        * UIProcess/WebPasteboardProxy.messages.in:
        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
        (WebKit::WebPlatformStrategies::containsStringSafeForDOMToReadForType):
        * WebProcess/WebCoreSupport/WebPlatformStrategies.h:

2020-03-24  Daniel Bates  <dabates@apple.com>

        Unreviewed, reverting r258945.

        Revert change that broke API tests while I investigate
        offline.

        Reverted changeset:

        "Element context character rects may be in wrong coordinate
        system"
        https://bugs.webkit.org/show_bug.cgi?id=209493
        https://trac.webkit.org/changeset/258945

2020-03-24  John Wilander  <wilander@apple.com>

        Refactor ResourceLoadStatisticsStore::registrableDomainsToDeleteOrRestrictWebsiteDataFor() to return a struct instead of a Vector of pairs
        https://bugs.webkit.org/show_bug.cgi?id=209463
        <rdar://problem/60808759>

        Reviewed by Alex Christensen.

        This change does three things:

        1. Replaces the Vector<std::pair<RegistrableDomain, WebsiteDataToRemove>> with a new struct called
        RegistrableDomainsToDeleteOrRestrictWebsiteDataFor for sending around which domains to delete website data for.

        2. Removes the enum WebsiteDataToRemove, replacing its structure with the members of the above mentioned struct:
        - domainsToDeleteAllCookiesFor
        - domainsToDeleteAllButHttpOnlyCookiesFor
        - domainsToDeleteAllNonCookieWebsiteDataFor

        3. Consistently renames "domainsToDeleteFor" to "domainsToDeleteOrRestrictFor" in preparation for website data
        policies that are not about deletion, see for instance recently landed https://trac.webkit.org/changeset/258884.

        No new tests. No changed functionality. This code is covered by several existing tests.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
        (WebKit::ResourceLoadStatisticsMemoryStore::registrableDomainsToDeleteOrRestrictWebsiteDataFor):
        (WebKit::ResourceLoadStatisticsMemoryStore::registrableDomainsToRemoveWebsiteDataFor): Deleted.
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
        (WebKit::domainsToString):
        (WebKit::ResourceLoadStatisticsStore::removeDataRecords):
        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::deleteAndRestrictWebsiteDataForRegistrableDomains):
        (WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForRegistrableDomains): Deleted.
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
        (WebKit::RegistrableDomainsToDeleteOrRestrictWebsiteDataFor::isolatedCopy const):
        (WebKit::RegistrableDomainsToDeleteOrRestrictWebsiteDataFor::isEmpty const):
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::deleteAndRestrictWebsiteDataForRegistrableDomains):
        (WebKit::NetworkProcess::deleteCookiesForTesting):
        (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains): Deleted.
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::deleteAndRestrictWebsiteDataForRegistrableDomains):
        (WebKit::NetworkSession::deleteWebsiteDataForRegistrableDomains): Deleted.
        * NetworkProcess/NetworkSession.h:

2020-03-24  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthn] Customize a bit more on the macOS LocalAuthentication prompt
        https://bugs.webkit.org/show_bug.cgi?id=208703
        <rdar://problem/60136974>

        Reviewed by Brent Fulgham.

        Part 2.

        This patch adds a different LocalAuthentication prompt title for getAssertion.
        It also polishes the text used for makeCredential.

        Besides that, it also enhances the iOS title strings.

        * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
        (WebKit::LocalAuthenticator::continueMakeCredentialAfterDecidePolicy):
        (WebKit::LocalAuthenticator::continueGetAssertionAfterResponseSelected):
        * UIProcess/WebAuthentication/Cocoa/LocalConnection.h:
        * UIProcess/WebAuthentication/Cocoa/LocalConnection.mm:
        (WebKit::LocalConnection::verifyUser const):
        * UIProcess/WebAuthentication/Mock/MockLocalConnection.h:
        * UIProcess/WebAuthentication/Mock/MockLocalConnection.mm:
        (WebKit::MockLocalConnection::verifyUser const):

2020-03-24  Kate Cheney  <katherine_cheney@apple.com>

        Ignore in-app browser privacy checks for apps with com.apple.private.applemediaservices entitlement
        https://bugs.webkit.org/show_bug.cgi?id=209509
        <rdar://problem/60750956>

        Reviewed by Brent Fulgham.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::m_ignoresAppBoundDomains):
        (WebKit::WebPageProxy::setIsNavigatingToAppBoundDomain):
        * UIProcess/WebPageProxy.h:

2020-03-24  Per Arne Vollan  <pvollan@apple.com>

        [Cocoa] Fix launch time regression with CF prefs direct mode enabled
        https://bugs.webkit.org/show_bug.cgi?id=209244
        <rdar://problem/60542149>

        Reviewed by Darin Adler.

        When CF prefs direct mode was enabled in https://trac.webkit.org/changeset/258064/webkit, it introduced
        a significant launch time regression. This patch addresses this regression. The number of observed domains
        is reduced and domain observation is initiated later when Safari is first activated. Swizzling code is
        removed, since that has a performance cost in the Objective-C runtime. Normal priority instead of
        QOS_CLASS_BACKGROUND is used in the thread which starts the observing, since using a background priority
        class can lead to priority inversion. Finally, a dictionary comparison is removed when a notification
        about a preference change is received, since this check is redundant and doubles the cost of this method.

        * UIProcess/Cocoa/PreferenceObserver.mm:
        (-[WKPreferenceObserver init]):
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitialize):
        (WebKit::WebProcessPool::registerNotificationObservers):
        (WebKit::WebProcessPool::unregisterNotificationObservers):
        * UIProcess/WebProcessPool.h:

2020-03-24  Daniel Bates  <dabates@apple.com>

        Element context character rects may be in wrong coordinate system
        https://bugs.webkit.org/show_bug.cgi?id=209493
        <rdar://problem/60840261>

        Reviewed by Wenson Hsieh.

        Convert the character rects from content view coordinates to root view coordinates
        as that is the coordinate system callers of -requestDocumentContext expect.

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::requestDocumentEditingContext):

2020-03-24  Daniel Bates  <dabates@apple.com>

        Use SimpleRange in characterRectsForRange()
        https://bugs.webkit.org/show_bug.cgi?id=209495

        Reviewed by Darin Adler.

        The function characterRectsForRange() is capable of working correctly with a SimpleRange
        instead of a Range. Callers currently pass a Range. So, there is still a conversion, but
        maybe someday they can pass a SimpleRange. This change is towards that future.

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::requestDocumentEditingContext):

2020-03-24  Chris Dumez  <cdumez@apple.com>

        Unreviewed, reverting r258928.

        Broke the build

        Reverted changeset:

        "Refactor
        ResourceLoadStatisticsStore::registrableDomainsToDeleteOrRestrictWebsiteDataFor()
        to return a struct instead of a Vector of pairs"
        https://bugs.webkit.org/show_bug.cgi?id=209463
        https://trac.webkit.org/changeset/258928

2020-03-24  John Wilander  <wilander@apple.com>

        Refactor ResourceLoadStatisticsStore::registrableDomainsToDeleteOrRestrictWebsiteDataFor() to return a struct instead of a Vector of pairs
        https://bugs.webkit.org/show_bug.cgi?id=209463
        <rdar://problem/60808759>

        Reviewed by Alex Christensen.

        This change does three things:

        1. Replaces the Vector<std::pair<RegistrableDomain, WebsiteDataToRemove>> with a new struct called
        RegistrableDomainsToDeleteOrRestrictWebsiteDataFor for sending around which domains to delete website data for.

        2. Removes the enum WebsiteDataToRemove, replacing its structure with the members of the above mentioned struct:
        - domainsToDeleteAllCookiesFor
        - domainsToDeleteAllButHttpOnlyCookiesFor
        - domainsToDeleteAllNonCookieWebsiteDataFor

        3. Consistently renames "domainsToDeleteFor" to "domainsToDeleteOrRestrictFor" in preparation for website data
        policies that are not about deletion, see for instance recently landed https://trac.webkit.org/changeset/258884.

        No new tests. No changed functionality. This code is covered by several existing tests.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
        (WebKit::ResourceLoadStatisticsMemoryStore::registrableDomainsToDeleteOrRestrictWebsiteDataFor):
        (WebKit::ResourceLoadStatisticsMemoryStore::registrableDomainsToRemoveWebsiteDataFor): Deleted.
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
        (WebKit::domainsToString):
        (WebKit::ResourceLoadStatisticsStore::removeDataRecords):
        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::deleteAndRestrictWebsiteDataForRegistrableDomains):
        (WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForRegistrableDomains): Deleted.
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
        (WebKit::RegistrableDomainsToDeleteOrRestrictWebsiteDataFor::isolatedCopy const):
        (WebKit::RegistrableDomainsToDeleteOrRestrictWebsiteDataFor::isEmpty const):
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::deleteAndRestrictWebsiteDataForRegistrableDomains):
        (WebKit::NetworkProcess::deleteCookiesForTesting):
        (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains): Deleted.
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::deleteAndRestrictWebsiteDataForRegistrableDomains):
        (WebKit::NetworkSession::deleteWebsiteDataForRegistrableDomains): Deleted.
        * NetworkProcess/NetworkSession.h:

2020-03-24  Michael Catanzaro  <mcatanzaro@gnome.org>

        [GTK] Crash in WebKit::LayerTreeHost::LayerTreeHost with bubblewrap sandbox enabled
        https://bugs.webkit.org/show_bug.cgi?id=209106

        Reviewed by Adrian Perez de Castro.

        The bubblewrap sandbox is blocking access to WebKit's nested Wayland compositor. Apparently
        nobody has ever tested the nested Wayland compositor with the sandbox enabled until now.

        * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
        (WebKit::bindWayland):

2020-03-24  Daniel Bates  <dabates@apple.com>

        Simplify characterRectsForRange() in WebPage::requestDocumentEditingContext()
        https://bugs.webkit.org/show_bug.cgi?id=209462

        Reviewed by Wenson Hsieh.

        No need to allow by-reference capture by default. Update code to take a const
        Range& and unsigned instead of non-const and uint64_t params. The former is
        const correct for this code, which doesn't modify anything. The latter is
        actually the max width data type callers pass. Simplify the inside of the loop
        by using StringView::isEmpty(). Lastly add a constant for the stride length
        to make the 1s less mysterious despite the name of the function alluding to
        this stride.

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::requestDocumentEditingContext):

2020-03-24  Daniel Bates  <dabates@apple.com>

        [iOS][WK2] Set text trait isSingleLineDocument
        https://bugs.webkit.org/show_bug.cgi?id=209391
        <rdar://problem/60705870>

        Reviewed by Darin Adler.

        Set the SPI text trait isSingleLineDocument to NO if the focused element is
        a <textarea> or contenteditable element because these elements support multi-
        line text. For all other elements, consider them single line text fields and
        return YES.

        Note that I chose to go with the above criterion because it is simple. In reality,
        it is possible to make a <textarea> or contenteditable behave like a single-line
        document, but it requires going out of your way to to do so and may involve
        platform-specific heuristics. See <https://bugs.webkit.org/show_bug.cgi?id=209391#c9>
        for more details. For now, let's try something simple.

        * Platform/spi/ios/UIKitSPI.h: Expose more SPI.
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView textInputTraits]):

2020-03-24  Diego Pino Garcia  <dpino@igalia.com>

        REGRESSION(r258871): [GTK] test bot exiting early due to too many crashes
        https://bugs.webkit.org/show_bug.cgi?id=209467

        Reviewed by Darin Adler.

        * WebProcess/WebPage/glib/WebPageGLib.cpp:
        (WebKit::WebPage::platformEditorState const): Add a check to prevent start
        and end position of selection range is not null.

2020-03-24  Per Arne Vollan  <pvollan@apple.com>

        [Cocoa] Deny access to database mapping service
        https://bugs.webkit.org/show_bug.cgi?id=209339
        <rdar://problem/56966010>

        Reviewed by Brent Fulgham.

        In order for the WebContent process to not have permantent access to the database mapping service,
        this patch creates an extension for the service in the UI process, sends it to the WebContent
        process, where it is consumed. Then, an API call is made which will map the database, and next the
        WebContent process will revoke the extension. The WebContent process has then mapped the database,
        and access to the database mapping service is no longer needed.

        Tested by: fast/sandbox/ios/sandbox-mach-lookup.html

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const):
        (WebKit::WebProcessCreationParameters::decode):
        * Shared/WebProcessCreationParameters.h:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):
        * WebProcess/com.apple.WebProcess.sb.in:

2020-03-24  Alex Christensen  <achristensen@webkit.org>

        Unreviewed, reverting r258862.

        SPI was not what was needed

        Reverted changeset:

        "Add SPI to move localStorage to a different domain"
        https://bugs.webkit.org/show_bug.cgi?id=209260
        https://trac.webkit.org/changeset/258862

2020-03-23  David Kilzer  <ddkilzer@apple.com>

        IPC::Decoder::decodeFixedLengthData() should be marked WARN_UNUSED_RETURN
        <https://webkit.org/b/209448>
        <rdar://problem/60797998>

        Reviewed by Chris Dumez.

        * Platform/IPC/ArgumentCoders.h:
        (struct VectorArgumentCoder::decode):
        - Check the return value of Decoder::decodeFixedLengthData().
        * Platform/IPC/Decoder.h:
        (IPC::Decoder::decodeFixedLengthData): Add WARN_UNUSED_RETURN.

2020-03-23  Wenson Hsieh  <wenson_hsieh@apple.com>

        Remove the unused method PasteboardStrategy::uniqueName()
        https://bugs.webkit.org/show_bug.cgi?id=209452

        Reviewed by Tim Horton.

        See WebCore/ChangeLog for more detail.

        * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
        (WebKit::WebPasteboardProxy::getPasteboardUniqueName): Deleted.
        * UIProcess/WebPasteboardProxy.h:
        * UIProcess/WebPasteboardProxy.messages.in:
        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
        (WebKit::WebPlatformStrategies::uniqueName): Deleted.
        * WebProcess/WebCoreSupport/WebPlatformStrategies.h:

2020-03-23  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, reverting r258891.
        https://bugs.webkit.org/show_bug.cgi?id=209459

        Introduced layout test failures (Requested by perarne on
        #webkit).

        Reverted changeset:

        "[Cocoa] Deny access to database mapping service"
        https://bugs.webkit.org/show_bug.cgi?id=209339
        https://trac.webkit.org/changeset/258891

2020-03-23  Per Arne Vollan  <pvollan@apple.com>

        [Cocoa] Deny access to database mapping service
        https://bugs.webkit.org/show_bug.cgi?id=209339
        <rdar://problem/56966010>

        Reviewed by Brent Fulgham.

        In order for the WebContent process to not have permantent access to the database mapping service,
        this patch creates an extension for the service in the UI process, sends it to the WebContent
        process, where it is consumed. Then, an API call is made which will map the database, and next the
        WebContent process will revoke the extension. The WebContent process has then mapped the database,
        and access to the database mapping service is no longer needed.

        Tested by: fast/sandbox/ios/sandbox-mach-lookup.html

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const):
        (WebKit::WebProcessCreationParameters::decode):
        * Shared/WebProcessCreationParameters.h:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):
        * WebProcess/com.apple.WebProcess.sb.in:

2020-03-23  Megan Gardner  <megan_gardner@apple.com>

        Removed FIXME comment for work that had already been done.

        * UIProcess/ios/WKSyntheticTapGestureRecognizer.mm:
        (-[WKSyntheticTapGestureRecognizer touchesEnded:withEvent:]):

2020-03-23  John Wilander  <wilander@apple.com>

        Add the capability to change all of a website's cookies to SameSite=Strict
        https://bugs.webkit.org/show_bug.cgi?id=209369
        <rdar://problem/60710690>

        Reviewed by Alex Christensen and David Kilzer.

        These changes add test infrastructure to run function
        WebCore::NetworkStorageSession::setAllCookiesToSameSiteStrict() in the
        network process.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::setToSameSiteStrictCookiesForTesting):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreSetResourceLoadStatisticsToSameSiteStrictCookiesForTesting):
        * UIProcess/API/C/WKWebsiteDataStoreRef.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::setToSameSiteStrictCookiesForTesting):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::setResourceLoadStatisticsToSameSiteStrictCookiesForTesting):
        * UIProcess/WebsiteData/WebsiteDataStore.h:

2020-03-23  Daniel Bates  <dabates@apple.com>

        Support inserting text or dictation alternative by simulating keyboard input
        https://bugs.webkit.org/show_bug.cgi?id=209380
        <rdar://problem/59445102>

        Reviewed by Darin Adler.

        As a workaround for sites the implement their own editing system (e.g. facebook.com)
        add a new insertion option that makes the insertion having a passing resemblance
        of a person typing. The resemblance is achieved by dispatching DOM events with type
        "keydown", "keyup", and "change".

        * Shared/Cocoa/InsertTextOptions.cpp:
        (IPC::ArgumentCoder<WebKit::InsertTextOptions>::encode):
        (IPC::ArgumentCoder<WebKit::InsertTextOptions>::decode):
        Encode and decode the new option.

        * Shared/Cocoa/InsertTextOptions.h: Default the new option, shouldSimulateKeyboardInput,
        to false to keep our current behavior.
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _shouldSimulateKeyboardInputOnTextInsertion]): Added. Returns NO when
        building without USE(TEXT_INTERACTION_ADDITIONS) to keep the current behavior.

        (-[WKContentView insertText:]):
        (-[WKContentView insertText:alternatives:style:]):
        Set the shouldSimulateKeyboardInput option.

        * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
        (WebKit::WebPage::insertDictatedTextAsync):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::insertTextAsync):
        If shouldSimulateKeyboardInput is false then do what we do now. Otherwise, dispatch a DOM event
        of type "keydown" and perform the insertion. Then dispatch DOM events of type "keyup" and "change". 

2020-03-23  Darin Adler  <darin@apple.com>

        Change TextIterator::rangeLength to not require a live range
        https://bugs.webkit.org/show_bug.cgi?id=209207

        Reviewed by Antti Koivisto.

        * Shared/EditingRange.cpp:
        (WebKit::EditingRange::toRange): Use characterCount.
        * WebProcess/WebCoreSupport/WebEditorClient.cpp:
        (WebKit::insertionPointFromCurrentSelection): Changed return type to
        CharacterCount and use characterCount.
        (WebKit::WebEditorClient::supportsGlobalSelection): Tweaked #if.
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::targetFrameForEditing): Use characterCount.
        * WebProcess/WebPage/glib/WebPageGLib.cpp:
        (WebKit::WebPage::platformEditorState const): Ditto.
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::rangeNearPositionMatchesText): Ditto.
        * WebProcess/WebPage/mac/WebPageMac.mm:
        (WebKit::WebPage::platformEditorState const): Ditto.

2020-03-23  youenn fablet  <youenn@apple.com>

        Rename blankURL to aboutBlankURL
        https://bugs.webkit.org/show_bug.cgi?id=209344

        Reviewed by Darin Adler.

        * UIProcess/API/C/WKPage.cpp:
        (WKPageLoadPlainTextStringWithUserData):
        * UIProcess/API/C/WKPageGroup.cpp:
        (WKPageGroupAddUserStyleSheet):
        (WKPageGroupAddUserScript):
        * UIProcess/API/glib/WebKitWebView.cpp:
        (webkit_web_view_load_plain_text):
        * UIProcess/Inspector/WebPageDebuggable.cpp:
        (WebKit::WebPageDebuggable::url const):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::loadDataWithNavigationShared):
        (WebKit::WebPageProxy::loadWebArchiveData):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::loadData):
        (WebKit::WebPage::loadAlternateHTML):
        (WebKit::WebPage::dumpHistoryForTesting):
        (WebKit::WebPage::addUserScript):
        (WebKit::WebPage::addUserStyleSheet):

2020-03-23  Alex Christensen  <achristensen@webkit.org>

        Add SPI to move localStorage to a different domain
        https://bugs.webkit.org/show_bug.cgi?id=209260
        <rdar://problem/60285683>

        Reviewed by Brady Eidson.

        Covered by an API test.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::renameDomainInWebsiteData):
        (WebKit::NetworkProcess::getLocalStorageOriginDetails):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * NetworkProcess/WebStorage/LocalStorageNamespace.cpp:
        (WebKit::LocalStorageNamespace::renameDomain):
        * NetworkProcess/WebStorage/LocalStorageNamespace.h:
        * NetworkProcess/WebStorage/StorageArea.cpp:
        (WebKit::StorageArea::close):
        * NetworkProcess/WebStorage/StorageArea.h:
        * NetworkProcess/WebStorage/StorageManager.cpp:
        (WebKit::StorageManager::renameDomain):
        * NetworkProcess/WebStorage/StorageManager.h:
        * NetworkProcess/WebStorage/StorageManagerSet.cpp:
        (WebKit::StorageManagerSet::renameDomain):
        * NetworkProcess/WebStorage/StorageManagerSet.h:
        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _renameDomain:to:forDataOfTypes:completionHandler:]):
        * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::renameDomainInWebsiteData):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::renameDomainInWebsiteData):
        * UIProcess/WebsiteData/WebsiteDataStore.h:

2020-03-23  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Deny mach lookup access to icon services
        https://bugs.webkit.org/show_bug.cgi?id=209340

        Reviewed by Brent Fulgham.

        Tested by fast/sandbox/ios/sandbox-mach-lookup.html

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

2020-03-23  Jacob Uphoff  <jacob_uphoff@apple.com>

        Unreviewed, reverting r258803.

        This revision caused many layout tests and 10 API tests to
        start failing/crashing

        Reverted changeset:

        "[Cocoa] Deny access to database mapping service"
        https://bugs.webkit.org/show_bug.cgi?id=209339
        https://trac.webkit.org/changeset/258803

2020-03-23  Youenn Fablet  <youenn@apple.com>

        RemoteAudioSession should listen to GPUProcess messages
        https://bugs.webkit.org/show_bug.cgi?id=209422

        Reviewed by Eric Carlson.

        Make sure RemoteAudioSession is registered as a listener to GPUProcess messages.

        * WebProcess/GPU/media/RemoteAudioSession.cpp:
        (WebKit::RemoteAudioSession::RemoteAudioSession):
        (WebKit::RemoteAudioSession::~RemoteAudioSession):

2020-03-23  Pablo Saavedra  <psaavedra@igalia.com>

        [GTK][WPE] Check the cgroups memory limits (v1 and v2) to calculate the systemMemoryUsedAsPercentage() in the MemoryPressureMonitor
        https://bugs.webkit.org/show_bug.cgi?id=209186

        Reviewed by Carlos Alberto Lopez Perez.

        Modifies the systemMemoryUsedAsPercentage() function adding the logic
        to read the memory limits and the current memory used in the cgroup
        associated to the WebKit process:

        - memory.memsw.usage_in_bytes (or memory.memsw.max in cgroupV2):
          current usage for memory+Swap
        - memory.limit_in_bytes (or memory.current in cgroupV2):
          limit of memory usage
        - memory.memsw.limit_in_bytes (or memory.max in cgroupV2):
          limit of memory+Swap usage

        In case of the WK processes are associated to a cgroup with memory
        controller, the function reads the memory.limit_in_bytes or
        the memory.memsw.limit_in_bytes and the and memory.usage_in_bytes
        from the cgroup mount point and calculates the percentage of
        memory used.

        In other cases (no cgroup memory controller associated or limits
        higher than the real memory available), the function will return the
        percentage based on the real memory available and real total memory
        in the system.

        The logic supports supports both cgroupV1 and cgroupV2

        * UIProcess/linux/MemoryPressureMonitor.cpp:
        (WebKit::getMemoryTotalWithCgroup):
        (WebKit::getMemoryUsageWithCgroup):
        (WebKit::getCgroupController):
        (WebKit::systemMemoryUsedAsPercentage):

2020-03-23  Chris Lord  <clord@igalia.com>

        [WPE] AsyncScrolling: horizontal scrolling is inverted
        https://bugs.webkit.org/show_bug.cgi?id=208638

        Reviewed by Adrian Perez de Castro.

        * UIProcess/API/wpe/ScrollGestureController.cpp:
        (WebKit::ScrollGestureController::handleEvent):

2020-03-23  youenn fablet  <youenn@apple.com>

        Explicitly activate the new DrawingAreaProxy on PSON navigation
        https://bugs.webkit.org/show_bug.cgi?id=209232

        Reviewed by Antti Koivisto.

        Delay tree unfreezing for provisional pages until the main frame load is committed.
        At that point, UIProcess is made aware and is doing the process swap.
        We can thus unfreeze the tree so that UIProcess starts getting DrawAreaProxy messages.

        This allows UIProcess to start listening to DrawAreaProxy messages at the time of doing process swapping in WebPageProxy.

        * UIProcess/DrawingAreaProxy.cpp:
        (WebKit::DrawingAreaProxy::DrawingAreaProxy):
        (WebKit::DrawingAreaProxy::startReceivingMessages):
        * UIProcess/DrawingAreaProxy.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::setDrawingArea):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::didCompletePageTransition):
        (WebKit::WebPage::didCommitLoad):

2020-03-22  Wenson Hsieh  <wenson_hsieh@apple.com>

        Adopt -[UIWindowScene interfaceOrientation] when determining device orientation
        https://bugs.webkit.org/show_bug.cgi?id=209372
        <rdar://problem/60491857>

        Reviewed by Darin Adler.

        Currently, for WebKit clients that have adopted the UIScene lifecycle (and also do not set an interface
        orientation override, like MobileSafari does), device orientation APIs will always report that the device is in
        portrait mode, regardless of the actual device orientation. This is because our current mechanism for tracking
        device orientation asks the shared UIApplication for its -statusBarOrientation. This is hard-coded to always
        return UIInterfaceOrientationPortrait for apps that adopt the UIScene lifecycle, and will additionally trigger a
        simulated crash, explaining that it is invalid for any scene-based app to call -statusBarOrientation.

        To fix this, we adjust the `deviceOrientation` helper in WKWebViewIOS.mm to work for scene-based apps. See below
        for more details.

        * Platform/spi/ios/UIKitSPI.h:
        * UIProcess/API/ios/WKWebViewIOS.h:
        * UIProcess/API/ios/WKWebViewIOS.mm:
        (-[WKWebView _setupScrollAndContentViews]):

        Change call sites of `deviceOrientation()` to be `[self _deviceOrientation]` instead.

        (-[WKWebView _deviceOrientation]):

        Replace `deviceOrientation()` with a `_deviceOrientation` helper method on `WKWebView`. For non-scene-based
        apps, this new helper method does not change any behavior, and continues to go through UIApplication. However,
        for scene-based apps, we instead ask the web view's window's `UIWindowScene` for its interface orientation.

        Importantly, this means that if a WKWebView is not parented, it doesn't have a valid device orientation (i.e.
        the orientation is UIInterfaceOrientationUnknown). As such, a newly created WKWebView that is unparented will
        start out with no orientation; it's only upon moving the view into a window that it is able to determine the
        device orientation. To ensure this, we add logic to -didMoveToWindow to recompute device orientation and
        dispatch an update if needed.

        To avoid sending unnecessary updates, if a WKWebView is unparented, we wait until it's parented again to send
        the new device orientation.

        (-[WKWebView didMoveToWindow]):
        (-[WKWebView _windowDidRotate:]):
        (deviceOrientation): Deleted.

        See -[WKWebView _deviceOrientation] above.

2020-03-21  David Kilzer  <ddkilzer@apple.com>

        decodeSharedBuffer() in WebCoreArgumentCoders.cpp should validate `bufferSize`
        <https://webkit.org/b/209373>
        <rdar://problem/60610919>

        Reviewed by Darin Adler.

        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::decodeSharedBuffer):
        - Return early if `bufferSize` is too big.

2020-03-20  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iPadOS] Yahoo! search results are sometimes zoomed in a little
        https://bugs.webkit.org/show_bug.cgi?id=209356
        <rdar://problem/60563952>

        Reviewed by Tim Horton.

        When the web content process uses `WebPage::scalePage()` to modify the viewport scale (e.g. after a viewport
        configuration change) on iOS, it's possible for this new scale to be replaced by a previous scale when
        dispatching the next visible content rect update. Consider the following scenario:

        1. A remote layer tree transaction is sent to the UI process containing scale `a`.
        2. `WebPage::scalePage` is called with a scale `b`.
        3. A visible content rect update with scale `a` is scheduled, sent to the web process and dispatched.
        4. The page scale reverts to `a`.

        This bug exercises the above scenario: the Yahoo search results page specifies a responsive viewport
        (device-width and scale=1), but proceeds to lay out outside of the bounds of the device width. As such, after
        the document finishes parsing, we attempt to shrink the page to fit; however, if this shrinking happens after
        a remote layer tree transaction with the old scale but before the next visible content rect update containing
        that old scale, we will end up reverting to this old scale instead of the scale after shrinking to fit. This
        same bug is present when using `setViewScale`, which was exercised by the flaky test below, since the new scale
        after the viewport configuration change may be overridden by an incoming visible content rect update.

        To fix this, we add a mechanism to detect when the page scale has been changed by the web process (e.g. after a
        viewport change) and remember the last committed layer tree identifier at that moment. Later, if we get a
        visible content rect update with a layer tree commit identifier equal to (or older than) the layer tree commit
        identifier when we changed the page scale, don't set the page scale factor using this incoming scale; instead,
        wait for the next visible content rect update (which will contain the new scale).

        Fixes an existing flaky test: fast/viewport/ios/device-width-viewport-after-changing-view-scale.html

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::close):
        (WebKit::WebPage::scalePage):
        (WebKit::WebPage::platformDidScalePage):

        Add a platform hook that is invoked after scaling the page via `scalePage`. See below for the iOS version.

        (WebKit::WebPage::didCommitLoad):
        (WebKit::WebPage::didFinishDocumentLoad):
        (WebKit::WebPage::didFinishLoad):

        Drive-by fix: remove an unnecessary `UNUSED_PARAM`. Also, replace calls to schedule the shrink to fit content
        timer with a call to `shrinkToFitContent` instead.

        * WebProcess/WebPage/WebPage.h:

        Add a member variable to remember the last sent layer tree commit ID and page scale, when we last changed the
        page scale via the web process. This is set in `platformDidScalePage` below.

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::dynamicViewportSizeUpdate):
        (WebKit::WebPage::shrinkToFitContent):

        Refactor this to not return a bool, but instead call `viewportConfigurationChanged` at the end if the viewport
        actually changed.

        (WebKit::WebPage::updateVisibleContentRects):

        Ignore the incoming page scale when updating visible content rects if it:
        1. Is the same as the last page scale we sent via layer tree commit.
        2. After sending the above scale, we've since adjusted the page scale such that it is no longer the same.

        (WebKit::WebPage::platformDidScalePage):

        Update `m_lastLayerTreeTransactionIdAndPageScaleBeforeScalingPage`.

        (WebKit::WebPage::scheduleShrinkToFitContent): Deleted.
        (WebKit::WebPage::shrinkToFitContentTimerFired): Deleted.

        Remove the zero-delay timer before running the shrink-to-fit heuristic, and just call `shrinkToFitContent`
        directly. This was a source of flakiness when trying to reproduce the bug, and doesn't seem to serve any
        purpose since we shrink-to-fit after dispatching the "DOMContentLoaded" and "load" events anyways.

        (WebKit::WebPage::immediatelyShrinkToFitContent): Deleted.

2020-03-20  Per Arne Vollan  <pvollan@apple.com>

        [Cocoa] Deny access to database mapping service
        https://bugs.webkit.org/show_bug.cgi?id=209339
        <rdar://problem/56966010>

        Reviewed by Brent Fulgham.

        In order for the WebContent process to not have permantent access to the database mapping service,
        this patch creates an extension for the service in the UI process, sends it to the WebContent
        process, where it is consumed. Then, an API call is made which will map the database, and next the
        WebContent process will revoke the extension. The WebContent process has then mapped the database,
        and access to the database mapping service is no longer needed.

        Tested by: fast/sandbox/ios/sandbox-mach-lookup.html

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const):
        (WebKit::WebProcessCreationParameters::decode):
        * Shared/WebProcessCreationParameters.h:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):
        * WebProcess/com.apple.WebProcess.sb.in:

2020-03-20  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Add telemetry for message filtering
        https://bugs.webkit.org/show_bug.cgi?id=209003
        <rdar://problem/60376722>

        Reviewed by Brent Fulgham.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

2020-03-20  Daniel Bates  <dabates@apple.com>

        Have insertDictatedTextAsync() take an InsertTextOptions
        https://bugs.webkit.org/show_bug.cgi?id=209308
        <rdar://problem/60652838>

        Reviewed by Darin Adler.

        This will provide future extensibility, which I plan to make use of in a subsequent patch,
        in addition to making the interface for insertDictatedTextAsync() more like insertTextAsync().

        * UIProcess/Cocoa/WebPageProxyCocoa.mm:
        (WebKit::WebPageProxy::insertDictatedTextAsync): Pass the options through. The caller is now
        responsible for setting the registerUndoGroup insertion option.
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::insertText): Stack-allocate a InsertTextOptions setting its registerUndoGroup
        field and pass this object through.
        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView insertText:alternatives:style:]): Pass the default constructed InsertTextOptions,
        which defaults registerUndoGroup to false to keep the current behavior.
        * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
        (WebKit::WebPage::insertDictatedTextAsync): Write in terms of InsertTextOptions.registerUndoGroup.
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2020-03-20  Daniel Bates  <dabates@apple.com>

        Replace "deferred element focus" functionality with alternative solution
        https://bugs.webkit.org/show_bug.cgi?id=201608

        Reviewed by Wenson Hsieh.

        This is a partial revert of r190278. Have the web process perform a layout, if needed, when
        computing focus element information and send an editor state update immediately. If layout is
        not needed then explicitly schedule a full editor state update.

        Currently, fetching focus element information neither sends an editor state update nor
        schedules one. As a result, when the web process tells the UI process to focus an element the
        UI process may need to defer doing so if the last received update did not include details
        that require up-to-date layout (e.g. the bounding rect of the focused element, which is used
        to scroll and zoom to center the focused element). The UI process then schedules an async message
        to the web process to fetch the full editor state, which will arrive in a layer tree commit message
        from the web process. (Note that the UI process schedules this request to ensure the web process
        knows that it is waiting for a layer tree commit. The web process can use this info to expedite
        a layer tree commit, if needed). This deferral mechanism complicates the element focusing and
        defocusing logic in the UI process and prevents fixing <https://bugs.webkit.org/show_bug.cgi?id=199960>.
        Instead remove this deferral concept and have the web process ensure that a full editor state
        update is sent or will be sent when computing the focus element information.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::resetStateAfterProcessExited):
        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::didCommitLayerTree):
        (WebKit::WebPageProxy::elementDidFocus):
        (WebKit::WebPageProxy::elementDidBlur):
        Remove bookkeeping code to track a deferred focus event or to perform the deferred event
        on layer tree commit.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::elementDidFocus):
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::getFocusedElementInformation): Save off whether a layout is needed then
        tell the page to layout if needed. If a layout was needed then send an editor state update
        immediately (it's an async message): this update will be a "full editor state" update that
        includes up-to-date layout details. Otherwise, schedule a full editor state update. While I
        am here, I updated the code to take out a ref on the focused frame's document before performing
        a layout because layout can cause arbitrary JavaScript execution that could detach the document
        from its frame view as part of destroying the document. Document destruction is detected by
        checking whether the document has been detached from its frame view. If this happens then
        bail out as there is no need to get focus element info.

2020-03-20  Don Olmstead  <don.olmstead@sony.com>

        [GPUP] Add PlatformLayerContainer to hold pointer to PlatformLayer
        https://bugs.webkit.org/show_bug.cgi?id=208963

        Reviewed by Eric Carlson.

        Use PlatformLayerContainer since RetainPtr is a Cocoa only construct. This
        allows non-Cocoa ports to get further with compiling out the GPU Process.

        * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.h:
        * WebProcess/GPU/media/VideoLayerRemote.h:
        * WebProcess/GPU/media/cocoa/MediaPlayerPrivateRemoteCocoa.mm:
        (WebKit::MediaPlayerPrivateRemote::createVideoFullscreenLayer):
        * WebProcess/GPU/media/cocoa/VideoLayerRemoteCocoa.mm:
        (WebKit::createVideoLayerRemote):
        * WebProcess/GPU/webrtc/SampleBufferDisplayLayer.h:

2020-03-20  Tim Horton  <timothy_horton@apple.com>

        Upstream a variety of Cocoa-platform HAVE and ENABLE macros
        https://bugs.webkit.org/show_bug.cgi?id=209307

        Reviewed by Andy Estes.

        * Configurations/FeatureDefines.xcconfig:
        * Platform/spi/ios/PDFKitSPI.h:
        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
        (WebKit::createRemoteView):
        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
        * UIProcess/ios/WKPDFView.mm:
        (-[WKPDFView web_initWithFrame:webView:mimeType:]):

2020-03-20  Alex Christensen  <achristensen@webkit.org>

        Use same syntax for ComputePagesForPrintingAndDrawToPDF message as other messages
        https://bugs.webkit.org/show_bug.cgi?id=209310
        <rdar://problem/60648013>

        Reviewed by Sam Weinig.

        This makes it easier for scripts to find which messages are unused.

        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::computePagesForPrintingAndDrawToPDF):

2020-03-20  youenn fablet  <youenn@apple.com>

        Add routines to check about:blank and about:srcdoc URLs
        https://bugs.webkit.org/show_bug.cgi?id=209174

        Reviewed by Alex Christensen.

        * WebProcess/WebCoreSupport/WebResourceLoadObserver.cpp:
        (WebKit::WebResourceLoadObserver::requestStorageAccessUnderOpener):

2020-03-20  Chris Dumez  <cdumez@apple.com>

        [iOS] Articles on NYTimes.com get truncated when switching between MobileSafari and another app
        https://bugs.webkit.org/show_bug.cgi?id=209321
        <rdar://problem/59763843>

        Reviewed by Tim Horton.

        Articles on NYTimes.com get truncated when switching between MobileSafari and another app
        (multitasking). The reason is that when you home out of MobileSafari, snapshots of the 
        web view are taken at various sizes and we were firing 5 resizes events at the page as a
        result. Those resize events were confusing the logic on NYTimes.com and causing it to
        truncate the article.

        To address the issue, we stop firing resize events at the page if the resize is happening
        during the snapshotting sequence.

        * Platform/spi/ios/UIKitSPI.h:
        * UIProcess/ApplicationStateTracker.h:
        * UIProcess/ApplicationStateTracker.mm:
        (WebKit::ApplicationStateTracker::ApplicationStateTracker):
        (WebKit::ApplicationStateTracker::~ApplicationStateTracker):
        (WebKit::ApplicationStateTracker::willBeginSnapshotSequence):
        (WebKit::ApplicationStateTracker::didCompleteSnapshotSequence):
        * UIProcess/WebPageProxy.cpp:
        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/WKApplicationStateTrackingView.mm:
        (-[WKApplicationStateTrackingView didMoveToWindow]):
        (-[WKApplicationStateTrackingView _willBeginSnapshotSequence]):
        (-[WKApplicationStateTrackingView _didCompleteSnapshotSequence]):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::setShouldFireResizeEvents):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2020-03-20  Jacob Uphoff  <jacob_uphoff@apple.com>

        Unreviewed, reverting r258748.

        This commit broke the Catalina build

        Reverted changeset:

        "Upstream a variety of Cocoa-platform HAVE and ENABLE macros"
        https://bugs.webkit.org/show_bug.cgi?id=209307
        https://trac.webkit.org/changeset/258748

2020-03-19  David Kilzer  <ddkilzer@apple.com>

        SharedMemory::allocate() should initialize `address`
        <https://webkit.org/b/209315>
        <rdar://problem/60606720>

        Reviewed by Geoffrey Garen.

        * Platform/cocoa/SharedMemoryCocoa.cpp:
        (WebKit::SharedMemory::allocate): Initialize `address` to zero.

2020-03-19  Tim Horton  <timothy_horton@apple.com>

        Unable to build WebKit with iOS 13.4 SDK
        https://bugs.webkit.org/show_bug.cgi?id=209317

        Reviewed by Simon Fraser.

        * Platform/spi/ios/UIKitSPI.h:
        * UIProcess/ios/WKMouseGestureRecognizer.mm:

2020-03-19  Brent Fulgham  <bfulgham@apple.com>

        [macoOS] Remove access to 'apple-extension-services' from the WebContent sandbox
        https://bugs.webkit.org/show_bug.cgi?id=209324
        <rdar://problem/58089661>

        Reviewed by Per Arne Vollan.

        Remove the last of permissions for the unused 'apple-extension-services' mach service.

        * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in:
        * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb:
        * WebProcess/com.apple.WebProcess.sb.in:

2020-03-19  Tim Horton  <timothy_horton@apple.com>

        Upstream a variety of Cocoa-platform HAVE and ENABLE macros
        https://bugs.webkit.org/show_bug.cgi?id=209307

        Reviewed by Andy Estes.

        * Configurations/FeatureDefines.xcconfig:
        * Platform/spi/ios/PDFKitSPI.h:
        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
        (WebKit::createRemoteView):
        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
        * UIProcess/ios/WKPDFView.mm:
        (-[WKPDFView web_initWithFrame:webView:mimeType:]):

2020-03-19  Alex Christensen  <achristensen@webkit.org>

        Sanitize suggested download filename received from web process
        https://bugs.webkit.org/show_bug.cgi?id=209300
        <rdar://problem/59487723>

        Reviewed by Chris Dumez.

        * UIProcess/Downloads/DownloadProxy.cpp:
        (WebKit::DownloadProxy::decideDestinationWithSuggestedFilenameAsync):

2020-03-19  Kate Cheney  <katherine_cheney@apple.com>

        Handle failed ITP Database insert attempts
        https://bugs.webkit.org/show_bug.cgi?id=209253
        <rdar://problem/58886756>

        Reviewed by David Kilzer.

        A first step toward handling I/O errors in the database. Adds checks
        so that in the case where a domain insert fails, we don't execute
        code which relies on this domain being in the database.

        Future steps will be figuring out a way to schedule failed queries
        to execute when the database is accepting inputs in the future.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        (WebKit::ResourceLoadStatisticsDatabaseStore::ensureResourceStatisticsForRegistrableDomain):
        Check if the query to insert a domain failed. If so, return
        WTF::nullopt in place of the domain ID to indicate the failure.

        (WebKit::ResourceLoadStatisticsDatabaseStore::ensureAndMakeDomainList):
        The simplest solution here was to only append strings to this list
        if they are already in the database, or are successfully inserted,
        because insertDomainRelationshipList() relies on these being in the database.

        (WebKit::ResourceLoadStatisticsDatabaseStore::hasStorageAccess):
        (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccess):
        (WebKit::ResourceLoadStatisticsDatabaseStore::grantStorageAccess):
        (WebKit::ResourceLoadStatisticsDatabaseStore::grantStorageAccessInternal):
        (WebKit::ResourceLoadStatisticsDatabaseStore::grandfatherDataForDomains):
        (WebKit::ResourceLoadStatisticsDatabaseStore::ensurePrevalentResourcesForDebugMode):
        (WebKit::ResourceLoadStatisticsDatabaseStore::logFrameNavigation):
        (WebKit::ResourceLoadStatisticsDatabaseStore::logCrossSiteLoadWithLinkDecoration):
        (WebKit::ResourceLoadStatisticsDatabaseStore::logUserInteraction):
        (WebKit::ResourceLoadStatisticsDatabaseStore::clearUserInteraction):
        (WebKit::ResourceLoadStatisticsDatabaseStore::clearPrevalentResource):
        (WebKit::ResourceLoadStatisticsDatabaseStore::setGrandfathered):
        (WebKit::ResourceLoadStatisticsDatabaseStore::setIsScheduledForAllButCookieDataRemoval):
        (WebKit::ResourceLoadStatisticsDatabaseStore::setSubframeUnderTopFrameDomain):
        (WebKit::ResourceLoadStatisticsDatabaseStore::setSubresourceUnderTopFrameDomain):
        (WebKit::ResourceLoadStatisticsDatabaseStore::setSubresourceUniqueRedirectTo):
        (WebKit::ResourceLoadStatisticsDatabaseStore::setSubresourceUniqueRedirectFrom):
        (WebKit::ResourceLoadStatisticsDatabaseStore::setTopFrameUniqueRedirectTo):
        (WebKit::ResourceLoadStatisticsDatabaseStore::setTopFrameUniqueRedirectFrom):
        (WebKit::ResourceLoadStatisticsDatabaseStore::setLastSeen):
        (WebKit::ResourceLoadStatisticsDatabaseStore::setPrevalentResource):
        (WebKit::ResourceLoadStatisticsDatabaseStore::setVeryPrevalentResource):
        Every call to ensureResourceStatisticsForRegistrableDomain should
        check the result to make sure the domain was inserted before
        continuing, and return early (or return a value that does not further
        rely on the database information, like an empty vector). Log these
        errors but don't add a debug assert because there already is one in
        ensureResourceStatisticsForRegistrableDomain.

        * (WebKit::ResourceLoadStatisticsDatabaseStore::populateFromMemoryStore):
        * (WebKit::ResourceLoadStatisticsDatabaseStore::mergeStatistics):
        The simplest thing to do in this case is to return early if any domain
        inserts fail before inserting domain relationships as a best-effort
        approach. A future step could be maintaining a vector of statistics
        which successfully inserted, and only adding those relationships.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
        ensureResourceStatisticsForRegistrableDomain should return an
        Optional domain ID to account for failed inserts.

2020-03-19  Tim Horton  <timothy_horton@apple.com>

        Upstream the definition of HAVE_READ_ONLY_SYSTEM_VOLUME
        https://bugs.webkit.org/show_bug.cgi?id=209305

        Reviewed by Andy Estes.

        * Shared/mac/AuxiliaryProcessMac.mm:
        (WebKit::AuxiliaryProcess::isSystemWebKit):

2020-03-19  Brent Fulgham  <bfulgham@apple.com>

        Remove Mobile Asset access from the WebContent process
        https://bugs.webkit.org/show_bug.cgi?id=209302
        <rdar://problem/56305023>

        Reviewed by Per Arne Vollan.

        Tested by fast/sandbox/ios/sandbox-mach-lookup.html

        * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb:
        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

2020-03-19  Alex Christensen  <achristensen@webkit.org>

        Remove unused WebProcessPool::didGetStatistics
        https://bugs.webkit.org/show_bug.cgi?id=209303
        <rdar://problem/60648454>

        Reviewed by Geoffrey Garen.

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::didGetStatistics): Deleted.
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebProcessPool.messages.in:

2020-03-19  Takashi Komori  <Takashi.Komori@sony.com>

        [Curl] Add an API returns description of verification errors.
        https://bugs.webkit.org/show_bug.cgi?id=208913

        Reviewed by Fujii Hironori.

        WKCertificateInfoCopyVerificationErrorDescription returns the description of SSL verification error as human readable string.
        Browser can display more precise error information with this API.

        API Test: Curl.CertificateAPI

        * Shared/API/c/curl/WKCertificateInfoCurl.cpp:
        (WKCertificateInfoCopyVerificationErrorDescription):
        * Shared/API/c/curl/WKCertificateInfoCurl.h:

2020-03-19  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Deny mach lookup access to power service
        https://bugs.webkit.org/show_bug.cgi?id=208460
        <rdar://problem/57026325>

        Reviewed by Darin Adler.

        On iOS, deny mach lookup access to the power service in the WebContent process.
        
        Test: fast/sandbox/ios/sandbox-mach-lookup.html

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

2020-03-19  Tim Horton  <timothy_horton@apple.com>

        Implement support for cursor interactions on iPad
        https://bugs.webkit.org/show_bug.cgi?id=209268

        Reviewed by Darin Adler.

        * Platform/spi/ios/UIKitSPI.h:
        * UIProcess/Cocoa/VersionChecks.h:
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView setupInteraction]):
        (-[WKContentView cleanupInteraction]):
        (-[WKContentView _removeDefaultGestureRecognizers]):
        (-[WKContentView _addDefaultGestureRecognizers]):
        (-[WKContentView gestureRecognizer:shouldReceiveTouch:]):
        (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
        (-[WKContentView _showShareSheet:inRect:completionHandler:]):
        (-[WKContentView setupDragAndDropInteractions]):
        (-[WKContentView shouldUseMouseGestureRecognizer]):
        (-[WKContentView setupMouseGestureRecognizer]):
        (-[WKContentView mouseGestureRecognizerChanged:]):
        (-[WKContentView setupCursorInteraction]):
        (-[WKContentView _cursorInteraction:regionForLocation:defaultRegion:completion:]):
        (-[WKContentView cursorRegionForPositionInformation:point:]):
        (-[WKContentView cursorInteraction:styleForRegion:modifiers:]):
        (-[WKContentView _mouseGestureRecognizerChanged:]): Deleted.
        * UIProcess/ios/WKMouseGestureRecognizer.h:
        * UIProcess/ios/WKMouseGestureRecognizer.mm:
        * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
        (WebKit::WebChromeClient::shouldUseMouseEventForSelection):

2020-03-19  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Add telemetry for message filtering
        https://bugs.webkit.org/show_bug.cgi?id=208925
        <rdar://problem/58885485>

        Reviewed by Darin Adler.

        On iOS, add telemetry for message filtering in the WebContent process' sandbox.

        No new tests, no behavior change.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

2020-03-19  Charlie Turner  <cturner@igalia.com>

        Fix many warnings with Clang 7.0 on GTK x86-64 in Debug.
        https://bugs.webkit.org/show_bug.cgi?id=209146

        Reviewed by Darin Adler.

        * NetworkProcess/NetworkHTTPSUpgradeChecker.cpp:
        (WebKit::NetworkHTTPSUpgradeChecker::query):
        * NetworkProcess/NetworkLoadChecker.cpp: The m_isHTTPSUpgradeEnabled
        ivar is only used on Cocoa platforms, on GTK it is causing warning
        spam.
        (WebKit::NetworkLoadChecker::NetworkLoadChecker):
        * NetworkProcess/NetworkLoadChecker.h:
        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
        (WebKit::CoordinatedGraphicsScene::updateSceneState):
        *
        Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
        m_inForceRepaint is not being used anymore.
        (WebKit::ThreadedCompositor::forceRepaint):
        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
        * UIProcess/API/glib/WebKitNavigationClient.cpp:
        * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
        (WebKit::RemoteInspectorProtocolHandler::RemoteInspectorProtocolHandler):
        * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.h:

2020-03-19  youenn fablet  <youenn@apple.com>

        Make URL::path() return a StringView
        https://bugs.webkit.org/show_bug.cgi?id=209173

        Reviewed by Alex Christensen.

        Update code according new path return type.

        * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
        (WebKit::NetworkDataTaskSoup::didSendRequest):
        * Shared/API/APIURL.h:
        (API::URL::path const):
        * UIProcess/API/glib/WebKitURISchemeRequest.cpp:
        (webkitURISchemeRequestReadCallback):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::objectContentType):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::createPlugin):

2020-03-19  Megan Gardner  <megan_gardner@apple.com>

        Correctly set up context for Data Detectors
        https://bugs.webkit.org/show_bug.cgi?id=209258
        <rdar://problem/60612327>

        Reviewed by Tim Horton.

        Stop passing in a nil context. This is OK now, but won't be in the near future.
        Also, call -updateContext:withSourceRect: so that DataDetectors can populate the context appropriately.

        * UIProcess/ios/WKActionSheetAssistant.mm:
        (-[WKActionSheetAssistant contextMenuInteraction:configurationForMenuAtLocation:]):
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView dataDetectionContextForPositionInformation:]):

2020-03-18  Simon Fraser  <simon.fraser@apple.com>

        eventSender.monitorWheelEvents() is very fragile
        https://bugs.webkit.org/show_bug.cgi?id=197819
        <rdar://problem/51319456>

        Reviewed by Tim Horton.

        Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
        adding back changes from r257844 that were reverted in r258558.
        
        First, have EventSendingController keep track of whether it's seen then "end" event
        for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
        now waits until it sees these, which prevents premature triggering which was a common cause of
        failure before.
        
        Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
        for completion in a callout from the end of Page::updateRendering(), which makes it test
        and fire at a more consistent time.
        
        Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
        can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
        used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
        also resulting in a premature trigger.

        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
        (WKBundlePageRegisterScrollOperationCompletionCallback):
        * WebProcess/InjectedBundle/API/c/WKBundlePage.h:

2020-03-18  Alex Christensen  <achristensen@webkit.org>

        Add HTTP3 as an experimental feature
        https://bugs.webkit.org/show_bug.cgi?id=209267
        <rdar://problem/60245262> and <rdar://problem/60245168>

        Reviewed by Brent Fulgham.

        Manually verified this sets the CFNetwork SPI as expected.

        * NetworkProcess/NetworkSessionCreationParameters.cpp:
        (WebKit::NetworkSessionCreationParameters::encode const):
        (WebKit::NetworkSessionCreationParameters::decode):
        * NetworkProcess/NetworkSessionCreationParameters.h:
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
        * Shared/WebPreferences.yaml:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::parameters):
        (WebKit::WebsiteDataStore::http3Enabled):
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::http3Enabled):
        * UIProcess/WebsiteData/WebsiteDataStore.h:

2020-03-18  Saam Barati  <sbarati@apple.com>

        SharedMemory::Handle::decode shouldn't check rounded size
        https://bugs.webkit.org/show_bug.cgi?id=209263

        Reviewed by Sam Weinig.

        * Platform/cocoa/SharedMemoryCocoa.cpp:
        (WebKit::SharedMemory::Handle::decode):
        (WebKit::SharedMemory::map):

2020-03-18  Fujii Hironori  <Hironori.Fujii@sony.com>

        WebCoreArgumentCoders should check bufferIsLargeEnoughToContain before allocating buffers
        https://bugs.webkit.org/show_bug.cgi?id=209219

        Reviewed by Darin Adler.

        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::decodeSharedBuffer): Added checking of bufferIsLargeEnoughToContain.
        (IPC::decodeTypesAndData): Don't allocate a buffer with the
        decoded size. bufferIsLargeEnoughToContain can't be used in this
        case because SharedBuffer is encoded as variable length data.
        Instead, append items one-by-one.

2020-03-18  John Wilander  <wilander@apple.com>

        WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener() should call its ephemeral counterpart when appropriate
        https://bugs.webkit.org/show_bug.cgi?id=209245
        <rdar://problem/60511121>

        Reviewed by Chris Dumez.

        This change makes sure that WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener()
        calls WebResourceLoadStatisticsStore::requestStorageAccessUnderOpenerEphemeral() for ephemeral
        sessions.

        Tests: http/tests/storageAccess/deny-storage-access-under-opener-ephemeral.html
               http/tests/storageAccess/deny-storage-access-under-opener-if-auto-dismiss-ephemeral.html
               http/tests/storageAccess/grant-storage-access-under-opener-at-popup-user-gesture-ephemeral.html

        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener):

2020-03-18  Brent Fulgham  <bfulgham@apple.com>

        Avoid calling 'notifyThisWebProcessPoolWasCreated' inside the constructor
        https://bugs.webkit.org/show_bug.cgi?id=209254
        <rdar://problem/60564526>

        Reviewed by Alex Christensen and Chris Dumez.

        Enqueue calls to 'notifyThisWebProcessPoolWasCreated' so they are not invoked until
        after the process pool is finished with its constructor.

        Behavior covered by existing tests.

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::WebProcessPool):

2020-03-18  Ross Kirsling  <ross.kirsling@sony.com>

        Unreviewed WinCairo build fix following r258665.

        * NetworkProcess/curl/NetworkProcessCurl.cpp:
        (WebKit::NetworkProcess::clearCacheForAllOrigins): Deleted.

2020-03-18  Kate Cheney  <katherine_cheney@apple.com>

        Pass isNavigatingToAppBoundDomain for speculative loads, preconnect tasks and downloads
        https://bugs.webkit.org/show_bug.cgi?id=209246
        <rdar://problem/60552712>

        Reviewed by Alex Christensen.

        Pass isNavigatingToAppBoundDomain in 4 new places:

        1) Speculative Loads
        2) Preconnect Tasks
        3) Downloads
        4) CORS preflight checker

        These loads should happen in an app-bound session if isNavigatingToAppBoundDomain
        is true.

        * NetworkProcess/Downloads/DownloadManager.cpp:
        (WebKit::DownloadManager::startDownload):
        * NetworkProcess/Downloads/DownloadManager.h:
        (WebKit::DownloadManager::startDownload):
        * NetworkProcess/Downloads/PendingDownload.cpp:
        (WebKit::PendingDownload::PendingDownload):
        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::startDownload):
        (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        (WebKit::NetworkConnectionToWebProcess::startDownload):
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::preconnectTo):
        (WebKit::NetworkProcess::downloadRequest):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::start):
        (WebKit::NetworkResourceLoader::retrieveCacheEntry):
        (WebKit::NetworkResourceLoader::convertToDownload):
        * NetworkProcess/PreconnectTask.cpp:
        * NetworkProcess/ServiceWorker/ServiceWorkerSoftUpdateLoader.cpp:
        (WebKit::ServiceWorkerSoftUpdateLoader::ServiceWorkerSoftUpdateLoader):
        The service worker script should be considered an app-bound load.

        * NetworkProcess/cache/AsyncRevalidation.cpp:
        (WebKit::NetworkCache::AsyncRevalidation::AsyncRevalidation):
        * NetworkProcess/cache/AsyncRevalidation.h:
        * NetworkProcess/cache/NetworkCache.cpp:
        (WebKit::NetworkCache::Cache::startAsyncRevalidationIfNeeded):
        (WebKit::NetworkCache::Cache::retrieve):
        * NetworkProcess/cache/NetworkCache.h:
        * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
        (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
        * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
        * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
        (WebKit::NetworkCache::SpeculativeLoadManager::registerLoad):
        (WebKit::NetworkCache::SpeculativeLoadManager::preconnectForSubresource):
        (WebKit::NetworkCache::SpeculativeLoadManager::revalidateSubresource):
        (WebKit::NetworkCache::SpeculativeLoadManager::preloadEntry):
        (WebKit::NetworkCache::SpeculativeLoadManager::startSpeculativeRevalidation):
        * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:
        * NetworkProcess/cocoa/NetworkSessionCocoa.h:
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::sessionWrapperForTask):
        * Shared/NavigatingToAppBoundDomain.h:
        Separates NavigatingToAppBoundDomain to its own file to allow for
        sending over IPC.

        * Shared/PolicyDecision.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::preconnectTo):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::setIsNavigatingToAppBoundDomain):
        (WebKit::WebPageProxy::preconnectTo):
        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::isNavigatingToAppBoundDomain const):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::download):
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::preconnectTo):
        * WebProcess/WebPage/WebFrame.cpp:
        (WebKit::WebFrame::startDownload):
        (WebKit::WebFrame::convertMainResourceLoadToDownload):

2020-03-18  Sihui Liu  <sihui_liu@apple.com>

        Remove unused IPC message NetworkProcess::ClearCacheForAllOrigins
        https://bugs.webkit.org/show_bug.cgi?id=209152
        <rdar://problem/59681717>

        Reviewed by Chris Dumez.

        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * NetworkProcess/ios/NetworkProcessIOS.mm:
        (WebKit::NetworkProcess::clearCacheForAllOrigins): Deleted.
        * NetworkProcess/mac/NetworkProcessMac.mm:
        (WebKit::NetworkProcess::clearCacheForAllOrigins): Deleted.
        * NetworkProcess/soup/NetworkProcessSoup.cpp:
        (WebKit::NetworkProcess::clearCacheForAllOrigins): Deleted.
        * Shared/ResourceCachesToClear.h: Removed.
        * UIProcess/API/C/WKAPICast.h:
        (WebKit::toResourceCachesToClear): Deleted.
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::clearResourceCaches): Deleted.
        * WebProcess/WebProcess.h:

2020-03-18  youenn fablet  <youenn@apple.com>

        WebPage should own a Ref<WebFrame>
        https://bugs.webkit.org/show_bug.cgi?id=209235

        Reviewed by Geoffrey Garen.

        Update code since m_mainFrame is now a Ref and no longer a RefPtr.

        Update WebPage constructor to set its m_mainFrame very early.
        We update WebPage::didCompletePageTransition to compute whether this is initialization or not using the frame state machine state
        instead of m_mainFrame being null.

        * WebProcess/Automation/WebAutomationSessionProxy.cpp:
        (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction):
        (WebKit::WebAutomationSessionProxy::resolveChildFrameWithOrdinal):
        (WebKit::WebAutomationSessionProxy::resolveChildFrameWithNodeHandle):
        (WebKit::WebAutomationSessionProxy::resolveChildFrameWithName):
        (WebKit::WebAutomationSessionProxy::resolveParentFrame):
        (WebKit::WebAutomationSessionProxy::focusFrame):
        (WebKit::WebAutomationSessionProxy::computeElementLayout):
        (WebKit::WebAutomationSessionProxy::selectOptionElement):
        (WebKit::WebAutomationSessionProxy::setFilesForInputFileUpload):
        (WebKit::WebAutomationSessionProxy::takeScreenshot):
        (WebKit::WebAutomationSessionProxy::snapshotRectForScreenshot):
        (WebKit::WebAutomationSessionProxy::getCookiesForFrame):
        (WebKit::WebAutomationSessionProxy::deleteCookie):
        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
        (WKBundlePageGetMainFrame):
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::findLargestFrameInFrameSet):
        (WebKit::WebChromeClient::closeWindowSoon):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDidReachLayoutMilestone):
        (WebKit::WebFrameLoaderClient::dispatchDidLayout):
        (WebKit::WebFrameLoaderClient::restoreViewState):
        * WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
        (WebKit::ViewGestureGeometryCollector::collectGeometryForSmartMagnificationGesture):
        (WebKit::ViewGestureGeometryCollector::collectGeometryForMagnificationGesture):
        * WebProcess/WebPage/WebBackForwardListProxy.cpp:
        (WebKit::WebBackForwardListProxy::goToItem):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::WebPage):
        (WebKit::m_processDisplayName):
        (WebKit::WebPage::close):
        (WebKit::WebPage::suspendForProcessSwap):
        (WebKit::WebPage::loadDataInFrame):
        (WebKit::WebPage::loadRequest):
        (WebKit::WebPage::reload):
        (WebKit::WebPage::didCompletePageTransition):
        (WebKit::WebPage::runJavaScriptInFrameInScriptWorld):
        (WebKit::WebPage::setIsSuspended):
        (WebKit::WebPage::didLoadFromRegistrableDomain):
        * WebProcess/WebPage/WebPage.h:
        (WebKit::WebPage::mainWebFrame const):
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::cancelPotentialTap):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::origin):

2020-03-18  Wenson Hsieh  <wenson_hsieh@apple.com>

        REGRESSION (r257214): Targeted preview animates to the wrong place when dropping in editable content
        https://bugs.webkit.org/show_bug.cgi?id=209218
        <rdar://problem/60560831>

        Reviewed by Tim Horton.

        In r257214, we split out the context menu hint preview container view into two views: one for drag and drop, and
        another for the context menu hint. The container view used for both drag and drop previews was removed under
        -cleanUpDragSourceSessionState, which is invoked after both drag and drop sessions have ended; however, in the
        case of a drop in editable content where the drop preview is delayed, the drop animation can end up finishing
        after -cleanUpDragSourceSessionState is invoked. This means we end up prematurely unparenting the preview
        container, which results in a broken drop animation.

        To fix this, split the drag and drop container views further, into separate container views for dragging and for
        dropping. The drag preview container will continue to be removed under -cleanUpDragSourceSessionState, and the
        drop preview container will now be removed under the delegate call to -dropInteraction:concludeDrop:, which is
        invoked by UIKit after all drop previews are finished animating.

        Covered by adding additional test assertions while running existing API tests (see Tools/ChangeLog for more
        details).

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _createPreviewContainerWithLayerName:]):

        Pull out common logic for creating and setting up a preview container view into a helper method. This is used by
        the three methods below, which ensure container views for each of the types of previews we create when showing
        the context menu, dragging an element, and dropping.

        (-[WKContentView containerForDropPreviews]):
        (-[WKContentView containerForDragPreviews]):
        (-[WKContentView containerForContextMenuHintPreviews]):

        Add a third preview container view for drop previews, and factor duplicated code in these three methods into a
        common helper (see above).

        (-[WKContentView _hideTargetedPreviewContainerViews]):
        (-[WKContentView _deliverDelayedDropPreviewIfPossible:]):

        Instead of using the container for drag previews, use the container for drop previews.

        (-[WKContentView dropInteraction:concludeDrop:]):

        Remove the drop preview container after the drop has concluded (i.e. all animations are complete).

2020-03-18  Chris Dumez  <cdumez@apple.com>

        Unreviewed, fix iOS build with recent SDKs.

        * Platform/cocoa/PaymentAuthorizationViewController.mm:

2020-03-18  Megan Gardner  <megan_gardner@apple.com>

        Remove unneeded and incorrect respondsToSelector checks.
        https://bugs.webkit.org/show_bug.cgi?id=209208
        <rdar://problem/60512470>

        Reviewed by Tim Horton.

        No behaviour change, no tests needed.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView continueContextMenuInteractionWithDataDetectors:]):

2020-03-18  Brent Fulgham  <bfulgham@apple.com>

        Switch from debug ASSERT to RELEASE_ASSERT in toNPObjectProxy
        https://bugs.webkit.org/show_bug.cgi?id=209212
        <rdar://problem/59595502>

        Reviewed by Alex Christensen.

        * Shared/Plugins/NPObjectProxy.h:
        (WebKit::NPObjectProxy::toNPObjectProxy):

2020-03-18  Brent Fulgham  <bfulgham@apple.com>

        Switch to release asserts for MediaDeviceSandboxExtension class
        https://bugs.webkit.org/show_bug.cgi?id=209211
        <rdar://problem/59595299>

        Reviewed by Eric Carlson.

        Switch from debug ASSERT to RELEASE_ASSERT.

        * WebProcess/MediaStream/MediaDeviceSandboxExtensions.cpp:
        (WebKit::MediaDeviceSandboxExtensions::MediaDeviceSandboxExtensions):
        (WebKit::MediaDeviceSandboxExtensions::operator[]):

2020-03-18  Brent Fulgham  <bfulgham@apple.com>

        Switch from debug ASSERT to RELEASE_ASSERT in PluginQuirks.h
        https://bugs.webkit.org/show_bug.cgi?id=209213
        <rdar://problem/59595834>

        Reviewed by Alex Christensen.

        * Shared/Plugins/PluginQuirks.h:
        (WebKit::PluginQuirks::add):

2020-03-18  youenn fablet  <youenn@apple.com>

        REGRESSION (r257472): Can't start old Safari with new WebKit (dyld: Symbol not found: _WKContextConfigurationSetShouldCaptureAudioInUIProcess)
        https://bugs.webkit.org/show_bug.cgi?id=209155

        Reviewed by Eric Carlson.

        Add a no-op WKContextConfigurationSetShouldCaptureAudioInUIProcess to allow latest WebKit being run on older Safari.

        * UIProcess/API/C/WKContextConfigurationRef.cpp:
        (WKContextConfigurationSetShouldCaptureAudioInUIProcess):
        * UIProcess/API/C/WKContextConfigurationRef.h:

2020-03-18  youenn fablet  <youenn@apple.com>

        FrameLoader should own its FrameLoaderClient
        https://bugs.webkit.org/show_bug.cgi?id=208918

        Reviewed by Geoff Garen.

        Pass a UniqueRef to the PageConfiguration.
        Update WebFrameLoaderClient according updated FrameLoaderClient interface.

        WebFrame no longer needs to ref/unref itself to keep the loader client alive.
        Update WebFrame construction to not need a static_cast at initialization of the main frame.

        The ownership is now that a WebCore::FrameLoader owns a FrameLoaderClient who owns a WebFrame.

        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::tryLoadingUsingURLSchemeHandler):
        (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
        (WebKit::WebLoaderStrategy::tryLoadingSynchronouslyUsingURLSchemeHandler):
        (WebKit::WebLoaderStrategy::loadResourceSynchronously):
        (WebKit::WebLoaderStrategy::startPingLoad):
        (WebKit::WebLoaderStrategy::preconnectTo):
        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        (WebKit::WebSWContextManagerConnection::installServiceWorker):
        * WebProcess/Storage/WebSWContextManagerConnection.h:
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::WebFrameLoaderClient):
        (WebKit::WebFrameLoaderClient::~WebFrameLoaderClient):
        (WebKit::WebFrameLoaderClient::webPageProxyID const):
        (WebKit::WebFrameLoaderClient::pageID const):
        (WebKit::WebFrameLoaderClient::frameID const):
        (WebKit::WebFrameLoaderClient::detachedFromParent2):
        (WebKit::WebFrameLoaderClient::assignIdentifierToInitialRequest):
        (WebKit::WebFrameLoaderClient::dispatchWillSendRequest):
        (WebKit::WebFrameLoaderClient::shouldUseCredentialStorage):
        (WebKit::WebFrameLoaderClient::dispatchDidReceiveResponse):
        (WebKit::WebFrameLoaderClient::dispatchDidReceiveContentLength):
        (WebKit::WebFrameLoaderClient::dispatchDidFinishLoading):
        (WebKit::WebFrameLoaderClient::dispatchDidFailLoading):
        (WebKit::WebFrameLoaderClient::dispatchDidDispatchOnloadEvents):
        (WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad):
        (WebKit::WebFrameLoaderClient::dispatchDidCancelClientRedirect):
        (WebKit::WebFrameLoaderClient::dispatchWillPerformClientRedirect):
        (WebKit::WebFrameLoaderClient::dispatchDidChangeLocationWithinPage):
        (WebKit::WebFrameLoaderClient::dispatchDidPushStateWithinPage):
        (WebKit::WebFrameLoaderClient::dispatchDidReplaceStateWithinPage):
        (WebKit::WebFrameLoaderClient::dispatchDidPopStateWithinPage):
        (WebKit::WebFrameLoaderClient::dispatchDidStartProvisionalLoad):
        (WebKit::WebFrameLoaderClient::dispatchDidReceiveTitle):
        (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):
        (WebKit::WebFrameLoaderClient::dispatchDidFailProvisionalLoad):
        (WebKit::WebFrameLoaderClient::dispatchDidFailLoad):
        (WebKit::WebFrameLoaderClient::dispatchDidFinishDocumentLoad):
        (WebKit::WebFrameLoaderClient::dispatchDidFinishLoad):
        (WebKit::WebFrameLoaderClient::dispatchDidReachLayoutMilestone):
        (WebKit::WebFrameLoaderClient::dispatchDidLayout):
        (WebKit::WebFrameLoaderClient::dispatchShow):
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
        (WebKit::WebFrameLoaderClient::applyToDocumentLoader):
        (WebKit::WebFrameLoaderClient::allowsContentJavaScriptFromMostRecentNavigation const):
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
        (WebKit::WebFrameLoaderClient::dispatchUnableToImplementPolicy):
        (WebKit::WebFrameLoaderClient::dispatchWillSendSubmitEvent):
        (WebKit::WebFrameLoaderClient::dispatchWillSubmitForm):
        (WebKit::WebFrameLoaderClient::willReplaceMultipartContent):
        (WebKit::WebFrameLoaderClient::didReplaceMultipartContent):
        (WebKit::WebFrameLoaderClient::didDisplayInsecureContent):
        (WebKit::WebFrameLoaderClient::didRunInsecureContent):
        (WebKit::WebFrameLoaderClient::didDetectXSS):
        (WebKit::WebFrameLoaderClient::cancelledError const):
        (WebKit::WebFrameLoaderClient::blockedError const):
        (WebKit::WebFrameLoaderClient::blockedByContentBlockerError const):
        (WebKit::WebFrameLoaderClient::cannotShowURLError const):
        (WebKit::WebFrameLoaderClient::interruptedForPolicyChangeError const):
        (WebKit::WebFrameLoaderClient::blockedByContentFilterError const):
        (WebKit::WebFrameLoaderClient::cannotShowMIMETypeError const):
        (WebKit::WebFrameLoaderClient::fileDoesNotExistError const):
        (WebKit::WebFrameLoaderClient::pluginWillHandleLoadError const):
        (WebKit::WebFrameLoaderClient::shouldFallBack const):
        (WebKit::WebFrameLoaderClient::restoreViewState):
        (WebKit::WebFrameLoaderClient::didFinishLoad):
        (WebKit::WebFrameLoaderClient::userAgent const):
        (WebKit::WebFrameLoaderClient::createPlugin):
        (WebKit::WebFrameLoaderClient::webGLPolicyForURL const):
        (WebKit::WebFrameLoaderClient::resolveWebGLPolicyForURL const):
        (WebKit::WebFrameLoaderClient::objectContentType):
        (WebKit::WebFrameLoaderClient::overrideMediaType const):
        (WebKit::WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld):
        (WebKit::WebFrameLoaderClient::dispatchGlobalObjectAvailable):
        (WebKit::WebFrameLoaderClient::willInjectUserScript):
        (WebKit::WebFrameLoaderClient::willCacheResponse const):
        (WebKit::WebFrameLoaderClient::createNetworkingContext):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
        * WebProcess/WebPage/WebFrame.cpp:
        (WebKit::WebFrame::initWithCoreMainFrame):
        (WebKit::WebFrame::createSubframe):
        (WebKit::WebFrame::WebFrame):
        (WebKit::WebFrame::frameLoaderClient const):
        (WebKit::WebFrame::fromCoreFrame):
        (WebKit::WebFrame::didReceivePolicyDecision):
        * WebProcess/WebPage/WebFrame.h:
        (WebKit::WebFrame::create):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_processDisplayName):

2020-03-17  David Kilzer  <ddkilzer@apple.com>

        SharedMemory::Handle::m_size should be more consistent
        <https://webkit.org/b/209007>
        <rdar://problem/60340890>

        Reviewed by Darin Adler.

        * Platform/cocoa/SharedMemoryCocoa.cpp:
        (WebKit::SharedMemory::Handle::decode):
        - Return early if an invalid `size` is decoded.
        (WebKit::SharedMemory::map):
        - Drive-by fix to change '0' to 'nullptr'.
        - Since all known methods of creating a SharedMemory::Handle()
          set SharedMemory::Handle::m_size to a value of round_page(),
          this means we can also change `round_page(handle.m_size)` to
          `handle.m_size` in the call to mach_vm_map() since we know
          they're equal.

2020-03-17  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, reverting r258496.
        https://bugs.webkit.org/show_bug.cgi?id=209217

        Introduced sandbox regression (Requested by perarne on
        #webkit).

        Reverted changeset:

        "[iOS] Add telemetry for message filtering"
        https://bugs.webkit.org/show_bug.cgi?id=208925
        https://trac.webkit.org/changeset/258496

2020-03-17  Kate Cheney  <katherine_cheney@apple.com>

        Expand In-App-Browser-Privacy testing
        https://bugs.webkit.org/show_bug.cgi?id=209142
        <rdar://problem/60496618>

        Reviewed by Darin Adler.

        Adds a testing API to check whether a navigation was classified as
        app-bound.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _isNavigatingToAppBoundDomain:]):
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::isNavigatingToAppBoundDomainTesting):
        * UIProcess/WebPageProxy.h:

2020-03-17  Alex Christensen  <achristensen@webkit.org>

        Fix API tests after r258574
        https://bugs.webkit.org/show_bug.cgi?id=209192

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::printFrame):
        I forgot to call the CompletionHandler from the IPC call.

2020-03-17  Jiewen Tan  <jiewen_tan@apple.com>

        WebKit::LocalAuthenticator::deleteDuplicateCredential() should check buffer size before memcmp
        https://bugs.webkit.org/show_bug.cgi?id=209156
        <rdar://problem/60444655>

        Reviewed by Alex Christensen.

        Covered by existing tests.

        * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
        (WebKit::LocalAuthenticator::deleteDuplicateCredential const):

2020-03-17  Kate Cheney  <katherine_cheney@apple.com>

       Add internal debugging when initializing an app-bound session
       https://bugs.webkit.org/show_bug.cgi?id=209190
       <rdar://problem/60371620>

        Reviewed by Brent Fulgham.

        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
        * NetworkProcess/cocoa/NetworkSessionCocoa.h:
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::SessionWrapper::initialize):
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
        (WebKit::NetworkSessionCocoa::initializeEphemeralStatelessSession):
        (WebKit::NetworkSessionCocoa::sessionWrapperForTask):
        (WebKit::NetworkSessionCocoa::appBoundSession):
        (WebKit::NetworkSessionCocoa::isolatedSession):

2020-03-17  John Wilander  <wilander@apple.com>

        Add quirk for cookie blocking latch mode ymail.com redirecting to yahoo.com under yahoo.com
        https://bugs.webkit.org/show_bug.cgi?id=209193
        <rdar://problem/60089022>

        Reviewed by Brent Fulgham.

        No new tests. Site-specific quirk tested manually on the site in question.

        * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        (WebKit::NetworkDataTaskCocoa::unblockCookies):
        (WebKit::NetworkDataTaskCocoa::needsFirstPartyCookieBlockingLatchModeQuirk const):
        (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):

2020-03-17  Brian Burg  <bburg@apple.com>

        REGRESSION(r256882): WebDriver commands that run before initial navigation do not complete
        https://bugs.webkit.org/show_bug.cgi?id=209185
        <rdar://problem/60010248>

        Reviewed by Brian Weinstein.

        No new tests, covered by w3c/webdriver/tests/back/back.py.

        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::createBrowsingContext):
        Force eager creation of WebProcess when a browsing context is created. This allows
        all subsequent commands that use WebProcess IPC to proceed instead of hanging.

2020-03-17  Alex Christensen  <achristensen@webkit.org>

        Fix GTK build.
        https://bugs.webkit.org/show_bug.cgi?id=209192

        * UIProcess/API/glib/WebKitUIClient.cpp:
        I committed r258574 too fast.

2020-03-17  Alex Christensen  <achristensen@webkit.org>

        Add WKUIDelegatePrivate SPI _webView:printFrame:completionHandler:
        https://bugs.webkit.org/show_bug.cgi?id=209192
        <rdar://problem/51313336>

        Reviewed by Geoff Garen.

        This is just like the existing _webView:printFrame: but you tell it when you're done instead of just returning.
        Covered by API tests.

        * UIProcess/API/APIUIClient.h:
        (API::UIClient::printFrame):
        * UIProcess/API/C/WKPage.cpp:
        (WKPageSetPageUIClient):
        * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
        * UIProcess/Cocoa/UIDelegate.h:
        * UIProcess/Cocoa/UIDelegate.mm:
        (WebKit::UIDelegate::setDelegate):
        (WebKit::UIDelegate::UIClient::printFrame):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::printFrame):

2020-03-17  David Kilzer  <ddkilzer@apple.com>

        REGRESSION (r258334): WebPasteboardProxy::setPasteboardBufferForType should allow zero-size buffers
        <https://webkit.org/b/209167>
        <rdar://problem/60516302>

        Reviewed by Geoffrey Garen.

        * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
        (WebKit::WebPasteboardProxy::setPasteboardBufferForType):
        - Remove check for zero-size buffer to match
          WebPageProxy::dataSelectionForPasteboard().

2020-03-17  Brent Fulgham  <bfulgham@apple.com>

        Terminate the WebContent process when receiving invalid IPC from a WebInspector session
        https://bugs.webkit.org/show_bug.cgi?id=209157
        <rdar://problem/58961055>

        Reviewed by Chris Dumez.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::backForwardGoToItemShared): Add a message check that we are not receiving
        the request from a WebInspector page.
        (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle): Switch to a release assert.

2020-03-17  Per Arne Vollan  <pvollan@apple.com>

        [Cocoa] Disable CF prefs direct mode
        https://bugs.webkit.org/show_bug.cgi?id=209166
        <rdar://problem/60517387>

        Reviewed by Brent Fulgham.

        Revert <https://trac.webkit.org/changeset/258064> by disabling the CF prefs direct mode feature,
        since it caused performance regressions.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
        * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
        (WebKit::XPCServiceMain):
        * UIProcess/Cocoa/PreferenceObserver.mm:
        * UIProcess/Cocoa/WebPageProxyCocoa.mm:
        (WebKit::WebPageProxy::grantAccessToPreferenceService):
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebProcessProxy.h:
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:

2020-03-17  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, reverting r258339.
        https://bugs.webkit.org/show_bug.cgi?id=209179

        "Is it sometimes breaking rendering" (Requested by youenn on
        #webkit).

        Reverted changeset:

        "FrameLoader should own its FrameLoaderClient"
        https://bugs.webkit.org/show_bug.cgi?id=208918
        https://trac.webkit.org/changeset/258339

2020-03-16  Simon Fraser  <simon.fraser@apple.com>

        Add a bit more UIHitTesting logging, and make it possible to dump EventRegions from WebKit
        https://bugs.webkit.org/show_bug.cgi?id=209058

        Reviewed by Antti Koivisto.

        Add a UIHitTesting log.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView gestureRecognizer:shouldReceiveTouch:]):

2020-03-16  Chris Dumez  <cdumez@apple.com>

        Crash under WebCookieCache::clearForHost()
        https://bugs.webkit.org/show_bug.cgi?id=209149
        <rdar://problem/60453086>

        Reviewed by Darin Adler.

        Alternative fix for Bug 209149 based on comments from Darin.

        * WebProcess/WebPage/WebCookieCache.cpp:
        (WebKit::WebCookieCache::clearForHost):
        (WebKit::WebCookieCache::pruneCacheIfNecessary):

2020-03-16  Tim Horton  <timothy_horton@apple.com>

        Fix the macCatalyst build after r258525

        * WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.mm:
        (WebKit::TextCheckingControllerProxy::annotatedSubstringBetweenPositions):

2020-03-15  Darin Adler  <darin@apple.com>

        Move most of TextIterator off of live ranges
        https://bugs.webkit.org/show_bug.cgi?id=209129

        Reviewed by Antti Koivisto.

        * WebProcess/InjectedBundle/API/mac/WKDOMTextIterator.mm:
        (-[WKDOMTextIterator initWithRange:]): Leave _textIterator as a nullptr
        if the passed-in range is nil since we no longer offer a way to create
        an empty TextIterator; other clients don't seem to need one.
        (-[WKDOMTextIterator advance]): Add a null check.
        (-[WKDOMTextIterator atEnd]): Ditto.
        (-[WKDOMTextIterator currentRange]): Ditto.
        (-[WKDOMTextIterator currentTextPointer]): Ditto.
        (-[WKDOMTextIterator currentTextLength]): Ditto.

        * WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.mm: Removed include.

        * WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
        (WebKit::ViewGestureGeometryCollector::computeTextLegibilityScales): Pass
        a reference to a range known not to be null.

        * WebProcess/WebPage/WebPage.cpp: Removed an include.

        * WebProcess/WebPage/ios/WebPageIOS.mm: Removed a "using naemsapce WebCore".
        Added two local functions
        (WebKit::plainTextForContext): Added. Helper for just this file where calling
        plainTextReplacingNoBreakSpace on a possibly null Range is common.
        (WebKit::plainTextForDisplay): Ditto. This one passes true for isDisplayString.
        Not entirely clear how carefully we chose which of the two to call, or if there
        is sufficient test coverage.
        (WebKit::WebPage::platformEditorState const): Use plainTextForContext
        and plainTextForDisplay.
        (WebKit::WebPage::getSelectionContext): Ditto.
        (WebKit::WebPage::getRectsAtSelectionOffsetWithText): Use plainTextForDisplay.
        (WebKit::WebPage::requestDictationContext): Use plainTextForContext.
        (WebKit::WebPage::replaceSelectedText): Ditto.
        (WebKit::WebPage::replaceDictatedText): Ditto.
        (WebKit::WebPage::requestAutocorrectionData): Ditto.
        (WebKit::WebPage::applyAutocorrectionInternal): Ditto.
        (WebKit::WebPage::autocorrectionContext): Ditto.
        (WebKit::dataDetectorLinkPositionInformation): Use plainTextForDisplay.
        (WebKit::WebPage::requestDocumentEditingContext): Use RetainPtr instead of
        autorelease. Use makeBoundaryPoint to convert Position objects to SimpleRange.

2020-03-16  Chris Dumez  <cdumez@apple.com>

        Crash under WebCookieCache::clearForHost()
        https://bugs.webkit.org/show_bug.cgi?id=209149
        <rdar://problem/60453086>

        Reviewed by Alex Christensen.

        Make sure WebCookieCache::pruneCacheIfNecessary() keeps alive the host String it is passing
        to WebCookieCache::clearForHost(). Previously, it was merely deferencing a HashSet iterator
        and passing that to clearForHost(). However, clearForHost() would then drop the String from
        the HashSet and the host would no longer be valid.

        Change covered by new API test.

        * WebProcess/WebPage/WebCookieCache.cpp:
        (WebKit::WebCookieCache::pruneCacheIfNecessary):

2020-03-16  Per Arne Vollan  <pvollan@apple.com>

        [macOS] Accessibility sandbox regressions
        https://bugs.webkit.org/show_bug.cgi?id=209065
        <rdar://problem/60202450>

        Reviewed by Brent Fulgham.

        When Accessibility is enabled, the WebContent process needs access to the preference service, since Accessibility
        is relying on some advanced features of the service. Also, when CF prefs direct mode is enabled, the WebContent
        sandbox needs to explicitly allow reading of the various plist files.

        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::registerNotificationObservers):
        * WebProcess/com.apple.WebProcess.sb.in:

2020-03-16  Per Arne Vollan  <pvollan@apple.com>

        [Cocoa] Crash under -[WKPreferenceObserver init]
        https://bugs.webkit.org/show_bug.cgi?id=209145

        Reviewed by Darin Adler.

        Handle the case when calling [NSUserDefaults initWithSuiteName:] did not succeed.

        No new tests, since I have not been able to reproduce.

        * UIProcess/Cocoa/PreferenceObserver.mm:
        (-[WKPreferenceObserver init]):

2020-03-16  Brent Fulgham  <bfulgham@apple.com>

        Remove unused IPC messages from DrawingAreaProxy
        https://bugs.webkit.org/show_bug.cgi?id=209090
        <rdar://problem/60333300>

        Reviewed by Wenson Hsieh.

        Do not compile the following three unused messages in DrawingAreaProxy when
        building for a Cocoa platform target.

        DrawingAreaProxy::Update
        DrawingAreaProxy::DidUpdateBackingStoreState
        DrawingAreaProxy::ExitAcceleratedCompositingMode

        * UIProcess/DrawingAreaProxy.h:
        (WebKit::DrawingAreaProxy::enterAcceleratedCompositingMode):
        (WebKit::DrawingAreaProxy::update):
        (WebKit::DrawingAreaProxy::didUpdateBackingStoreState):
        (WebKit::DrawingAreaProxy::exitAcceleratedCompositingMode):
        * UIProcess/DrawingAreaProxy.messages.in:
        * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
        * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
        (WebKit::TiledCoreAnimationDrawingAreaProxy::exitAcceleratedCompositingMode): Deleted.

2020-03-16  Per Arne Vollan  <pvollan@apple.com>

        [Cocoa] Only set CF prefs direct mode for the WebContent process
        https://bugs.webkit.org/show_bug.cgi?id=209091
        <rdar://problem/60337842>

        Reviewed by Brent Fulgham.

        Currently, we enable CF prefs direct mode in XPCServiceMain. This is incorrect, it should only be enabled
        for the WebContent process.

        * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
        (WebKit::XPCServiceMain):

2020-03-16  David Kilzer  <ddkilzer@apple.com>

        WebPage::GetDataSelectionForPasteboard should validate its `size` variable
        <https://webkit.org/b/209092>
        <rdar://problem/60181345>

        Reviewed by Brent Fulgham.

        * Platform/IPC/Connection.h:
        (MESSAGE_CHECK_WITH_RETURN_VALUE_BASE): Add.
        - Variant of MESSAGE_CHECK_BASE() that takes a return value.
        * UIProcess/mac/WebPageProxyMac.mm:
        (MESSAGE_CHECK_WITH_RETURN_VALUE): Add.
        (WebKit::WebPageProxy::dataSelectionForPasteboard):
        - Use new MESSAGE_CHECK_WITH_RETURN_VALUE() macro to update
          check for handle.isNull() and to add check for `size`
          variable.
        - Add static_cast<size_t>() to `size` variable to denote type
          change.

2020-03-16  Youenn Fablet  <youenn@apple.com>

        Apply rotation at source level if WebRTC sink ask so
        https://bugs.webkit.org/show_bug.cgi?id=205645

        Reviewed by Eric Carlson.

        Implement RealtimeMediaSource setShouldApplyRotation by sending IPC to capture process.
        In capture process, if rotation should be applied, use an ImageRotationSessionVT session to apply it before sending the video frame.
        This allows WebProcess to no longer need an ImageRotationSessionVT for WebRTC.

        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
        (WebKit::UserMediaCaptureManagerProxy::SourceProxy::setShouldApplyRotation):
        (WebKit::UserMediaCaptureManagerProxy::SourceProxy::rotatePixelBuffer):
        (WebKit::UserMediaCaptureManagerProxy::setShouldApplyRotation):
        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
        * WebProcess/cocoa/UserMediaCaptureManager.cpp:
        (WebKit::UserMediaCaptureManager::Source::setShouldApplyRotation):

        * WebProcess/WebPage/mac/WebPageMac.mm: Removed an include.

2020-03-13  Sergio Villar Senin  <svillar@igalia.com>

        [WebXR] IDLs, stubs and build configuration for WPE
        https://bugs.webkit.org/show_bug.cgi?id=208702

        Reviewed by Dean Jackson.

        Added WebXR to the list of experimental features.

        * Configurations/FeatureDefines.xcconfig: Added ENABLE_WEBXR off by default.
        * Shared/WebPreferences.yaml: Added WebXR feature.
        * Shared/WebPreferencesDefaultValues.cpp:
        (WebKit::defaultWebXREnabled): Set WebXR to off by default unless HAVE_SYSTEM_FEATURE_FLAGS.
        * Shared/WebPreferencesDefaultValues.h:
        * WebProcess/InjectedBundle/InjectedBundle.cpp:
        (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):

2020-03-16  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Add telemetry for message filtering
        https://bugs.webkit.org/show_bug.cgi?id=208925
        <rdar://problem/58885485>

        Reviewed by Darin Adler.

        On iOS, add telemetry for message filtering in the WebContent process' sandbox.

        No new tests, no behavior change.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

2020-03-16  Per Arne Vollan  <pvollan@apple.com>

        [Cocoa] Limit set of classes that can be decoded when a preference has changed
        https://bugs.webkit.org/show_bug.cgi?id=208012

        Reviewed by Brent Fulgham.

        As a hardening measure, limit the set of ObjectiveC classes that can be decoded in the WebContent process
        as a result of a preference change.

        API tests: WebKit.PreferenceChangesDictionary
                   WebKit.PreferenceChangesData
                   WebKit.PreferenceChangesDate

        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::notifyPreferencesChanged):

2020-03-16  youenn fablet  <youenn@apple.com>

        Unique origins should not be Potentially Trustworthy
        https://bugs.webkit.org/show_bug.cgi?id=209049

        Reviewed by Darin Adler.

        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::hasNavigatedAwayFromAppBoundDomain):
        We should only check this for the main frame since this is tied to the page.

2020-03-16  Rob Buis  <rbuis@igalia.com>

        Simplify ChromeClient.createWindow
        https://bugs.webkit.org/show_bug.cgi?id=209123

        Reviewed by Darin Adler.

        Adapt to API change.

        * WebProcess/Inspector/WebInspector.cpp:
        (WebKit::WebInspector::openInNewTab):
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::createWindow):
        * WebProcess/WebCoreSupport/WebChromeClient.h:
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchCreatePage):

2020-03-15  Yusuke Suzuki  <ysuzuki@apple.com>

        Should not use variable-length-array (VLA)
        https://bugs.webkit.org/show_bug.cgi?id=209043

        Reviewed by Mark Lam.

        * Configurations/Base.xcconfig:
        * UIProcess/_WKTouchEventGenerator.mm:
        (-[_WKTouchEventGenerator touchDown:touchCount:]):
        (-[_WKTouchEventGenerator liftUp:touchCount:]):
        (-[_WKTouchEventGenerator moveToPoints:touchCount:duration:]):

2020-03-14  Brady Eidson  <beidson@apple.com>

        Fix the "deliver cached ranges" logic in PDFPlugin (and other small cleanups)
        https://bugs.webkit.org/show_bug.cgi?id=209097

        Reviewed by Tim Hatcher.

        Streaming in data always appended to the buffer instead of first growing the buffer.
        This wasn't noticed earlier because we often did not grow the buffer for successful range request completion.
        But now we often do!
        
        So this cleans that all up.
        
        At the same time it revealed other interactions with PDFKit that force us to handle data requests on the main
        thread after the document load is complete - Which is fine!

        * WebProcess/Plugins/PDF/PDFPlugin.h:
        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit::dataProviderGetBytesAtPositionCallback): If on the main thread (and the document load is complete)
          handle the request directly!
        (WebKit::PDFPlugin::getResourceBytesAtPositionMainThread):
        (WebKit::PDFPlugin::ByteRangeRequest::completeWithAccumulatedData):
        (WebKit::PDFPlugin::ensureDataBufferLength):
        (WebKit::PDFPlugin::didFail):
        (WebKit::PDFPlugin::maybeClearHighLatencyDataProviderFlag):
        (WebKit::PDFPlugin::documentDataDidFinishLoading):
        (WebKit::PDFPlugin::installPDFDocument):
        (WebKit::PDFPlugin::manualStreamDidReceiveData): Grow the buffer instead of append.


2020-03-14  Brent Fulgham  <bfulgham@apple.com>

        Add missing checks needed for AppBound Quirk
        https://bugs.webkit.org/show_bug.cgi?id=209117
        <rdar://problem/60460097>

        Reviewed by John Wilander.

        The checks for the 'NeedsInAppBrowserPrivacyQuirks' flag added in r258101 was incomplete.
        These changes let the WebFrameLoaderClient report the quirk state to WebCore code. 

        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::needsInAppBrowserPrivacyQuirks): Added.
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
        * WebProcess/WebPage/WebPage.h:
        (WebKit::WebPage::needsInAppBrowserPrivacyQuirks const): Added.

2020-03-10  Darin Adler  <darin@apple.com>

        Change all return values in TextIterator header from live ranges to SimpleRange
        https://bugs.webkit.org/show_bug.cgi?id=208906

        Reviewed by Antti Koivisto.

        * WebProcess/WebPage/Cocoa/WebPageCocoa.mm: Removed unneeded include of
        TextIterator.h.

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::rangeNearPositionMatchesText): Removed unused originalRange argument,
        changed return type to Optional<SimpleRange> since findClosestPlainText now
        returns a SimpleRange.
        (WebKit::WebPage::getRectsAtSelectionOffsetWithText): Updated since
        rangeNearPositionMatchesText now returns Optional<SimpleRange>, use createLiveRange.
        (WebKit::WebPage::requestDocumentEditingContext): Updated since
        CharacterIterator::range returns SimpleRange, use createLiveRange.

2020-03-14  Brady Eidson  <beidson@apple.com>

        Gather PDF scripts to run on a background thread.
        https://bugs.webkit.org/show_bug.cgi?id=209063

        Reviewed by Geoff Garen.
        
        In incremental loading mode, gathering document scripts will sometimes require PDFKit/CG
        to lock and wait on data loads from our data provider.
        
        So if we gather them on the main thread, we will hang the main thread and therefore deadlock
        with our data provider thread/queue.
        
        So let's gather those scripts on a background thread!

        * WebProcess/Plugins/PDF/PDFPlugin.h:
        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit::PDFPlugin::threadEntry):
        (WebKit::PDFPlugin::ByteRangeRequest::completeWithAccumulatedData):
        (WebKit::PDFPlugin::documentDataDidFinishLoading):
        (WebKit::PDFPlugin::installPDFDocument):
        (WebKit::PDFPlugin::streamDidFinishLoading):
        (WebKit::PDFPlugin::manualStreamDidFinishLoading):
        (WebKit::PDFPlugin::tryRunScriptsInPDFDocument): Only actually gathers scripts to execute if there
          is a m_pdfDocument and the entire document data finished loading.
        (WebKit::PDFPlugin::pdfDocumentDidLoad): Deleted.
        (WebKit::PDFPlugin::runScriptsInPDFDocument): Deleted.

2020-03-13  Alex Christensen  <achristensen@webkit.org>

        WKWebView._negotiatedLegacyTLS should be correct after back/forward navigations
        https://bugs.webkit.org/show_bug.cgi?id=209011
        <rdar://problem/59370588>

        Reviewed by Youenn Fablet.

        * NetworkProcess/NetworkDataTask.cpp:
        (WebKit::NetworkDataTask::didReceiveResponse):
        * NetworkProcess/NetworkLoad.cpp:
        (WebKit::NetworkLoad::notifyDidReceiveResponse):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::usedLegacyTLS): Deleted.
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * WebProcess/Network/WebResourceLoader.cpp:
        (WebKit::WebResourceLoader::didReceiveResponse):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::savePlatformDataToCachedFrame):

2020-03-13  Wenson Hsieh  <wenson_hsieh@apple.com>

        [watchOS] Don’t display empty text suggestions in Quickboard when editing input fields
        https://bugs.webkit.org/show_bug.cgi?id=209089

        Reviewed by Tim Horton.

        Handle text suggestions that lack `displayText` gracefully in Quickboard by not showing them as AutoFill
        candidates. Currently, they are presented as blank collection view cells in Quickboard, which leads to a
        confusing user experience.

        Test: WKWebViewAutoFillTests.DoNotShowBlankTextSuggestions

        * UIProcess/ios/forms/WKFocusedFormControlView.mm:
        (-[WKFocusedFormControlView setSuggestions:]):

2020-03-13  Brent Fulgham  <bfulgham@apple.com>

        Clean up sandbox violations found during testing
        https://bugs.webkit.org/show_bug.cgi?id=209096
        <rdar://problem/59931477>

        Reviewed by Geoffrey Garen.

        Remove telemetry from some items, and allow access to some IOKit properties
        needed for media playback on macOS and iOS.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
        * WebProcess/com.apple.WebProcess.sb.in:

2020-03-13  Chris Dumez  <cdumez@apple.com>

        Unreviewed, drop unused variable in WebPageProxy::backForwardGoToItem().

        * UIProcess/WebPageProxy.cpp:

2020-03-13  John Wilander  <wilander@apple.com>

        Remove unused code related to removePrevalentDomains()
        https://bugs.webkit.org/show_bug.cgi?id=209078
        <rdar://problem/59681984>

        Reviewed by Brent Fulgham.

        The various removePrevalentDomains() functions and its IPC endpoint are unused and should be removed.

        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
        (WebKit::ResourceLoadStatisticsStore::clearBlockingStateForDomains): Deleted.
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::removePrevalentDomains): Deleted.
        (WebKit::WebResourceLoadStatisticsStore::callRemoveDomainsHandler): Deleted.
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::removePrevalentDomains): Deleted.
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:

2020-03-13  Myles C. Maxfield  <mmaxfield@apple.com>

        [Cocoa] Push applicationSDKVersion() down from WebCore into WTF
        https://bugs.webkit.org/show_bug.cgi?id=209030

        Reviewed by Simon Fraser.

        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
        * Shared/WebPreferencesDefaultValues.cpp:
        (WebKit::defaultCSSOMViewScrollingAPIEnabled):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):

2020-03-13  Brent Fulgham  <bfulgham@apple.com>

        Remove unused IPC function UserMediaCaptureManagerProxy::SetMuted
        https://bugs.webkit.org/show_bug.cgi?id=209087
        <rdar://problem/59658963>

        Reviewed by Eric Carlson.

        Remove the unused UserMediaCaptureManagerProxy message 'SetMuted'.

        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
        (WebKit::UserMediaCaptureManagerProxy::setMuted): Deleted.
        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:

2020-03-13  Brent Fulgham  <bfulgham@apple.com>

        Remove unused GetNetworkLoadInformationRequest call
        https://bugs.webkit.org/show_bug.cgi?id=209081
        <rdar://problem/59659064>

        Reviewed by Geoffrey Garen.

        Remove dead code associated with an unused IPC message.

        * NetworkProcess/NetworkConnectionToWebProcess.h:
        (WebKit::NetworkConnectionToWebProcess::getNetworkLoadInformationRequest): Deleted.
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:

2020-03-13  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthn] Customize a bit more on the macOS LocalAuthentication prompt
        https://bugs.webkit.org/show_bug.cgi?id=208703
        <rdar://problem/60136974>

        Reviewed by Darin Adler.

        On macOS, LocalAuthentication prompt can be shown anywhere that is probably not on top of
        our UI clients. Therefore, add a RP ID to the dialog to help users to identify what has
        happened. In addition, it removes the password fallback button.

        * Platform/spi/Cocoa/LocalAuthenticationSPI.h:
        * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
        (WebKit::LocalAuthenticator::continueMakeCredentialAfterDecidePolicy):
        (WebKit::LocalAuthenticator::continueGetAssertionAfterResponseSelected):
        * UIProcess/WebAuthentication/Cocoa/LocalConnection.h:
        * UIProcess/WebAuthentication/Cocoa/LocalConnection.mm:
        (WebKit::LocalConnection::verifyUser const):
        * UIProcess/WebAuthentication/Mock/MockLocalConnection.h:
        * UIProcess/WebAuthentication/Mock/MockLocalConnection.mm:
        (WebKit::MockLocalConnection::verifyUser const):

2020-03-13  Brent Fulgham  <bfulgham@apple.com>

        Remove Unused IPC message PlaybackSessionManagerProxy::PictureInPictureActiveChanged
        https://bugs.webkit.org/show_bug.cgi?id=209085
        <rdar://problem/59658916>

        Reviewed by Geoffrey Garen.

        Remove the unused PlaybackSessionManagerProxy message 'PictureInPictureActiveChanged'.

        * UIProcess/Cocoa/PlaybackSessionManagerProxy.h:
        * UIProcess/Cocoa/PlaybackSessionManagerProxy.messages.in:
        * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
        (WebKit::PlaybackSessionManagerProxy::pictureInPictureActiveChanged): Deleted.

2020-03-13  Kate Cheney  <katherine_cheney@apple.com>

        [ iOS and Mac wk2 ] http/tests/in-app-browser-privacy/ tests failing
        https://bugs.webkit.org/show_bug.cgi?id=209016
        <rdar://problem/60329530> 

        Reviewed by Chris Dumez.

        This patch adds a function to re-initialize app bound domains for
        in-app-browser-privacy tests, since they are only initialized once
        when the WebsiteDataStore is created. This causes issues if the tests
        are run in parallel with other tests with different app-bound domains.

        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreReinitializeAppBoundDomains):
        * UIProcess/API/C/WKWebsiteDataStoreRef.h:
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::clearAppBoundDomains):
        (WebKit::WebsiteDataStore::reinitializeAppBoundDomains):
        * UIProcess/WebsiteData/WebsiteDataStore.h:

2020-03-13  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, reverting r258391.

        Breaks internal builds.

        Reverted changeset:

        "Apply rotation at source level if WebRTC sink ask so"
        https://bugs.webkit.org/show_bug.cgi?id=205645
        https://trac.webkit.org/changeset/258391

2020-03-13  Kate Cheney  <katherine_cheney@apple.com>

        Report all third party loads on a per-page basis
        https://bugs.webkit.org/show_bug.cgi?id=209032
        <rdar://problem/60397323>

        Reviewed by Chris Dumez.

        Test: http/tests/resourceLoadStatistics/loaded-registrable-domains-get-reported.html

        Removed IPC to the Network Process asking if a resource load is from
        a prevalent domain. This now stores and sends all loaded registrable
        domains. This patch is mostly updating naming to reflect this and
        deleting the unnecessary code to communicate with the
        ResourceLoadStatisticsStore.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::requestStorageAccessUnderOpener):
        (WebKit::NetworkConnectionToWebProcess::isPrevalentSubresourceLoad): Deleted.
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _loadedThirdPartyDomainsFor:completionHandler:]):
        (-[WKWebsiteDataStore _clearLoadedThirdPartyDomainsFor:]):
        (-[WKWebsiteDataStore _getPrevalentDomainsFor:completionHandler:]): Deleted.
        (-[WKWebsiteDataStore _clearPrevalentDomainsFor:]): Deleted.
        * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
        * UIProcess/WebPageProxy.cpp:
        * UIProcess/WebPageProxy.h:
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::didLoadFromRegistrableDomain):
        (WebKit::WebFrameLoaderClient::addLoadedRegistrableDomain): Deleted.
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::didCommitLoad):
        (WebKit::WebPage::didLoadFromRegistrableDomain):
        Add a check that this is a third party by comparing the target domain
        to the main frame domain.

        (WebKit::WebPage::loadedThirdPartyDomains):
        (WebKit::WebPage::clearLoadedThirdPartyDomains):
        (WebKit::WebPage::addLoadedRegistrableDomain): Deleted.
        (WebKit::WebPage::getPrevalentDomains): Deleted.
        (WebKit::WebPage::clearPrevalentDomains): Deleted.
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2020-03-13  Brent Fulgham  <bfulgham@apple.com>

        Remove unused SmartMagnificationController Magnify message
        https://bugs.webkit.org/show_bug.cgi?id=209036
        <rdar://problem/59678060>

        Reviewed by Tim Horton.

        Remove the unused Magnify message from the SmartMagnificationController, since this is dead code.

        * UIProcess/ios/SmartMagnificationController.h:
        * UIProcess/ios/SmartMagnificationController.messages.in:
        * UIProcess/ios/SmartMagnificationController.mm:
        (WebKit::SmartMagnificationController::magnify): Deleted.

2020-03-13  David Kilzer  <ddkilzer@apple.com>

        WebPageProxy::SetPromisedDataForImage should validate its `imageSize` and `archiveSize` parameters
        <https://webkit.org/b/209029>
        <rdar://problem/60181394>

        Reviewed by Youenn Fablet.

        * UIProcess/mac/WebPageProxyMac.mm:
        (WebKit::WebPageProxy::setPromisedDataForImage):
        - Validate `imageSize` and `archiveSize` using MESSAGE_CHECK().
        - Add static_cast<size_t>() to `imageSize` and `archiveSize`
          parameters to denote type change.
        - Add nullptr check for SharedMemory::map() result with
          `archiveHandle`.

2020-03-13  Carlos Garcia Campos  <cgarcia@igalia.com>

        [SOUP] Notify web process about WebSocket handshake request and response
        https://bugs.webkit.org/show_bug.cgi?id=208994

        Reviewed by Youenn Fablet.

        This makes WebSockets appear again in web inspector.

        * NetworkProcess/soup/WebSocketTaskSoup.cpp:
        (WebKit::WebSocketTask::WebSocketTask): Save the handshake message and notify the channel when the request is sent.
        (WebKit::WebSocketTask::didConnect): Notify the channel that handshake response has been received.
        (WebKit::WebSocketTask::didFail): Notify the channel that handshake response has been received if handshake
        failed.
        * NetworkProcess/soup/WebSocketTaskSoup.h:

2020-03-13  Youenn Fablet  <youenn@apple.com>

        Apply rotation at source level if WebRTC sink ask so
        https://bugs.webkit.org/show_bug.cgi?id=205645

        Reviewed by Eric Carlson.

        Implement RealtimeMediaSource setShouldApplyRotation by sending IPC to capture process.
        In capture process, if rotation should be applied, use an ImageRotationSessionVT session to apply it before sending the video frame.
        This allows WebProcess to no longer need an ImageRotationSessionVT for WebRTC.

        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
        (WebKit::UserMediaCaptureManagerProxy::SourceProxy::setShouldApplyRotation):
        (WebKit::UserMediaCaptureManagerProxy::SourceProxy::rotatePixelBuffer):
        (WebKit::UserMediaCaptureManagerProxy::setShouldApplyRotation):
        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
        * WebProcess/cocoa/UserMediaCaptureManager.cpp:
        (WebKit::UserMediaCaptureManager::Source::setShouldApplyRotation):

2020-03-13  youenn fablet  <youenn@apple.com>

        Remove use of PlatformMediaSession types in AudioSession
        https://bugs.webkit.org/show_bug.cgi?id=208995

        Reviewed by Eric Carlson.

        Update code according WebCore API changes.
        Make use of AudioSession current code path to make RemoteAudioSession notify its observers.

        * GPUProcess/media/RemoteAudioSessionProxy.cpp:
        (WebKit::RemoteAudioSessionProxy::setCategory):
        (WebKit::RemoteAudioSessionProxy::beginInterruption):
        (WebKit::RemoteAudioSessionProxy::endInterruption):
        * GPUProcess/media/RemoteAudioSessionProxy.h:
        * GPUProcess/media/RemoteAudioSessionProxyManager.cpp:
        (WebKit::RemoteAudioSessionProxyManager::tryToSetActiveForProcess):
        (WebKit::RemoteAudioSessionProxyManager::beginAudioSessionInterruption):
        (WebKit::RemoteAudioSessionProxyManager::endAudioSessionInterruption):
        * GPUProcess/media/RemoteAudioSessionProxyManager.h:
        * WebProcess/GPU/media/RemoteAudioSession.cpp:
        (WebKit::RemoteAudioSession::beginInterruption): Deleted.
        (WebKit::RemoteAudioSession::endInterruption): Deleted.
        * WebProcess/GPU/media/RemoteAudioSession.h:
        * WebProcess/GPU/media/RemoteAudioSession.messages.in:

2020-03-13  Ryosuke Niwa  <rniwa@webkit.org>

        Release build fix after r258384.

        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit::PDFPlugin::threadEntry):
        (WebKit::PDFPlugin::ByteRangeRequest::maybeComplete):

2020-03-12  Brady Eidson  <beidson@apple.com>

        Add a very verbose logging mode for incremental PDF loading
        https://bugs.webkit.org/show_bug.cgi?id=208975

        Reviewed by Simon Fraser.

        Adds a verbose logging channel that includes a full dump of the PDFPlugin's loading status
        for each logging message.
        
        * Platform/Logging.h:

        * WebProcess/Plugins/PDF/PDFPlugin.h:
        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit::PDFPlugin::pdfLog):
        (WebKit::PDFPlugin::logStreamLoader):
        (WebKit::PDFPlugin::verboseLog):
        (WebKit::dataProviderGetBytesAtPositionCallback):
        (WebKit::dataProviderGetByteRangesCallback):
        (WebKit::PDFPlugin::getResourceBytesAtPosition):
        (WebKit::PDFPlugin::adoptBackgroundThreadDocument):
        (WebKit::PDFPlugin::ByteRangeRequest::completeWithBytes):
        (WebKit::PDFPlugin::ByteRangeRequest::completeWithAccumulatedData):
        (WebKit::PDFPlugin::forgetLoader):

2020-03-12  Brent Fulgham  <bfulgham@apple.com>

        Correct preference handling and naming conventions in AppBound browsing preferences
        https://bugs.webkit.org/show_bug.cgi?id=209031
        <rdar://problem/60396298>

        Reviewed by John Wilander.

        I made a mistake in the handling of preferences related to the IsInAppBrowserPrivacyEnabled
        and the quirk flag, which led to some code not executing when expected.

        This patch does the following:

        1. Uses the correct naming scheme for WebKit Internal Debug flags. They should be
           'WebKitDebug', not 'WebKitInternal' or 'WebKitInternalDebug'.
        2. Updates the local quirk state in WebPage when page settings change.

        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::parameters):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::updatePreferences):

2020-03-12  David Kilzer  <ddkilzer@apple.com>

        WebPageProxy::SaveImageToLibrary should validate its `imageSize` parameter
        <https://webkit.org/b/209012>
        <rdar://problem/60181295>

        Reviewed by Chris Dumez.

        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::saveImageToLibrary):
        - Validate upper bound of `imageSize` parameter.
        - Add static_cast<size_t>() to `imageSize` parameter to denote
          type change.

2020-03-12  Chris Dumez  <cdumez@apple.com>

        Check for overflows in MachMessage::messageSize()
        https://bugs.webkit.org/show_bug.cgi?id=209020
        <rdar://problem/58264215>

        Reviewed by Alex Christensen.

        * Platform/IPC/cocoa/ConnectionCocoa.mm:
        (IPC::Connection::sendOutgoingMessage):
        * Platform/IPC/cocoa/MachMessage.cpp:
        (IPC::MachMessage::messageSize):
        * Platform/IPC/cocoa/MachMessage.h:

2020-03-12  Per Arne Vollan  <pvollan@apple.com>

        [macOS] _AXSApplicationAccessibilityEnabled should not be called
        https://bugs.webkit.org/show_bug.cgi?id=208953

        Reviewed by Brent Fulgham.

        On macOS, stop using the function _AXSApplicationAccessibilityEnabled and listening to the notification
        kAXSApplicationAccessibilityEnabledNotification, since they do not have the same behavior as on iOS.

        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        (WebKit::WebProcessPool::registerNotificationObservers):
        (WebKit::WebProcessPool::unregisterNotificationObservers):
        * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
        (WebKit::WebProcessProxy::unblockAccessibilityServerIfNeeded):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeProcess):
        (WebKit::WebProcess::unblockAccessibilityServer):

2020-03-12  Kate Cheney  <katherine_cheney@apple.com>

        Resource load statistics data summary should return all third party data
        https://bugs.webkit.org/show_bug.cgi?id=209000
        <rdar://problem/60348306>

        Reviewed by John Wilander.

        No new tests, this patch adjusts old tests to test this new behavior

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _setThirdPartyCookieBlockingMode:onlyOnSitesWithoutUserInteraction:completionHandler:]):
        * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
        Added new function _setThirdPartyCookieBlockingMode so API tests can
        set this parameter.

2020-03-12  Alex Christensen  <achristensen@webkit.org>

        WKWebView.hasOnlySecureContent should be correct after back/forward navigations
        https://bugs.webkit.org/show_bug.cgi?id=207609

        Reviewed by Ryosuke Niwa.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::usedLegacyTLS):
        (WebKit::WebPageProxy::hasInsecureContent): Deleted.
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::savePlatformDataToCachedFrame):

2020-03-12  Chris Dumez  <cdumez@apple.com>

        Drop unused WebProcess::UpdateActivePages IPC
        https://bugs.webkit.org/show_bug.cgi?id=209002
        <rdar://problem/59682658>

        Reviewed by Geoffrey Garen.

        * WebProcess/WebProcess.messages.in:

2020-03-12  youenn fablet  <youenn@apple.com>

        FrameLoader should own its FrameLoaderClient
        https://bugs.webkit.org/show_bug.cgi?id=208918

        Reviewed by Geoffrey Garen.

        Pass a UniqueRef to the PageConfiguration.
        Update WebFrameLoaderClient according updated FrameLoaderClient interface.

        WebFrame no longer needs to ref/unref itself to keep the loader client alive.
        Update WebFrame construction to not need a static_cast at initialization of the main frame.

        The ownership is now that a WebCore::FrameLoader owns a FrameLoaderClient who owns a WebFrame.

        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::tryLoadingUsingURLSchemeHandler):
        (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
        (WebKit::WebLoaderStrategy::tryLoadingSynchronouslyUsingURLSchemeHandler):
        (WebKit::WebLoaderStrategy::loadResourceSynchronously):
        (WebKit::WebLoaderStrategy::startPingLoad):
        (WebKit::WebLoaderStrategy::preconnectTo):
        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        (WebKit::WebSWContextManagerConnection::installServiceWorker):
        * WebProcess/Storage/WebSWContextManagerConnection.h:
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::WebFrameLoaderClient):
        (WebKit::WebFrameLoaderClient::~WebFrameLoaderClient):
        (WebKit::WebFrameLoaderClient::webPageProxyID const):
        (WebKit::WebFrameLoaderClient::pageID const):
        (WebKit::WebFrameLoaderClient::frameID const):
        (WebKit::WebFrameLoaderClient::detachedFromParent2):
        (WebKit::WebFrameLoaderClient::assignIdentifierToInitialRequest):
        (WebKit::WebFrameLoaderClient::dispatchWillSendRequest):
        (WebKit::WebFrameLoaderClient::shouldUseCredentialStorage):
        (WebKit::WebFrameLoaderClient::dispatchDidReceiveResponse):
        (WebKit::WebFrameLoaderClient::dispatchDidReceiveContentLength):
        (WebKit::WebFrameLoaderClient::dispatchDidFinishLoading):
        (WebKit::WebFrameLoaderClient::dispatchDidFailLoading):
        (WebKit::WebFrameLoaderClient::dispatchDidDispatchOnloadEvents):
        (WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad):
        (WebKit::WebFrameLoaderClient::dispatchDidCancelClientRedirect):
        (WebKit::WebFrameLoaderClient::dispatchWillPerformClientRedirect):
        (WebKit::WebFrameLoaderClient::dispatchDidChangeLocationWithinPage):
        (WebKit::WebFrameLoaderClient::dispatchDidPushStateWithinPage):
        (WebKit::WebFrameLoaderClient::dispatchDidReplaceStateWithinPage):
        (WebKit::WebFrameLoaderClient::dispatchDidPopStateWithinPage):
        (WebKit::WebFrameLoaderClient::dispatchDidStartProvisionalLoad):
        (WebKit::WebFrameLoaderClient::dispatchDidReceiveTitle):
        (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):
        (WebKit::WebFrameLoaderClient::dispatchDidFailProvisionalLoad):
        (WebKit::WebFrameLoaderClient::dispatchDidFailLoad):
        (WebKit::WebFrameLoaderClient::dispatchDidFinishDocumentLoad):
        (WebKit::WebFrameLoaderClient::dispatchDidFinishLoad):
        (WebKit::WebFrameLoaderClient::dispatchDidReachLayoutMilestone):
        (WebKit::WebFrameLoaderClient::dispatchDidLayout):
        (WebKit::WebFrameLoaderClient::dispatchShow):
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
        (WebKit::WebFrameLoaderClient::applyToDocumentLoader):
        (WebKit::WebFrameLoaderClient::allowsContentJavaScriptFromMostRecentNavigation const):
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
        (WebKit::WebFrameLoaderClient::dispatchUnableToImplementPolicy):
        (WebKit::WebFrameLoaderClient::dispatchWillSendSubmitEvent):
        (WebKit::WebFrameLoaderClient::dispatchWillSubmitForm):
        (WebKit::WebFrameLoaderClient::willReplaceMultipartContent):
        (WebKit::WebFrameLoaderClient::didReplaceMultipartContent):
        (WebKit::WebFrameLoaderClient::didDisplayInsecureContent):
        (WebKit::WebFrameLoaderClient::didRunInsecureContent):
        (WebKit::WebFrameLoaderClient::didDetectXSS):
        (WebKit::WebFrameLoaderClient::cancelledError const):
        (WebKit::WebFrameLoaderClient::blockedError const):
        (WebKit::WebFrameLoaderClient::blockedByContentBlockerError const):
        (WebKit::WebFrameLoaderClient::cannotShowURLError const):
        (WebKit::WebFrameLoaderClient::interruptedForPolicyChangeError const):
        (WebKit::WebFrameLoaderClient::blockedByContentFilterError const):
        (WebKit::WebFrameLoaderClient::cannotShowMIMETypeError const):
        (WebKit::WebFrameLoaderClient::fileDoesNotExistError const):
        (WebKit::WebFrameLoaderClient::pluginWillHandleLoadError const):
        (WebKit::WebFrameLoaderClient::shouldFallBack const):
        (WebKit::WebFrameLoaderClient::restoreViewState):
        (WebKit::WebFrameLoaderClient::didFinishLoad):
        (WebKit::WebFrameLoaderClient::userAgent const):
        (WebKit::WebFrameLoaderClient::createPlugin):
        (WebKit::WebFrameLoaderClient::webGLPolicyForURL const):
        (WebKit::WebFrameLoaderClient::resolveWebGLPolicyForURL const):
        (WebKit::WebFrameLoaderClient::objectContentType):
        (WebKit::WebFrameLoaderClient::overrideMediaType const):
        (WebKit::WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld):
        (WebKit::WebFrameLoaderClient::dispatchGlobalObjectAvailable):
        (WebKit::WebFrameLoaderClient::willInjectUserScript):
        (WebKit::WebFrameLoaderClient::willCacheResponse const):
        (WebKit::WebFrameLoaderClient::createNetworkingContext):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
        * WebProcess/WebPage/WebFrame.cpp:
        (WebKit::WebFrame::initWithCoreMainFrame):
        (WebKit::WebFrame::createSubframe):
        (WebKit::WebFrame::WebFrame):
        (WebKit::WebFrame::frameLoaderClient const):
        (WebKit::WebFrame::fromCoreFrame):
        (WebKit::WebFrame::didReceivePolicyDecision):
        * WebProcess/WebPage/WebFrame.h:
        (WebKit::WebFrame::create):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_processDisplayName):

2020-03-12  Brent Fulgham  <bfulgham@apple.com>

        Drop unused LogGlobalDiagnosticMessageWithValue IPC message
        https://bugs.webkit.org/show_bug.cgi?id=208974
        <rdar://problem/59682189>

        Reviewed by Chris Dumez.

        I added these messages for ITP, but we later switched to tracking network sessions
        individually and no longer need this "global" message.

        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::logGlobalDiagnosticMessageWithValue): Deleted.
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/Network/NetworkProcessProxy.messages.in:

2020-03-12  Chris Dumez  <cdumez@apple.com>

        Networking process should kill the WebContent process if an invalid IPC message is received from it
        https://bugs.webkit.org/show_bug.cgi?id=208999

        Reviewed by Geoffrey Garen.

        If the NetworkProcess receives a bad IPC from a WebProcess, it now sends an IPC to the UIProcess
        asking for said WebProcess to be terminated.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::didReceiveInvalidMessage):

        * Platform/IPC/HandleMessage.h:
        (IPC::handleMessage):
        (IPC::handleMessageSynchronous):
        (IPC::handleMessageSynchronousWantsConnection):
        (IPC::handleMessageAsync):
        I noticed when testing this patch that the decoder was sometimes not marked as invalid even though
        decoding failed (verified this by not decoding enough data or decoding too much data). As a result,
        the IPC message would get ignored but didReceiveInvalidMessage() would not get called. To address
        this, I know mark the decoder as invalid anytime decoding fails, instead of asserting that it is
        already invalid.

        * Shared/ProcessTerminationReason.h:
        * UIProcess/API/C/WKAPICast.h:
        (WebKit::toAPI):
        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::wkProcessTerminationReason):
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::terminateWebProcess):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/Network/NetworkProcessProxy.messages.in:
        * UIProcess/WebPageProxy.cpp:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::requestTermination):

2020-03-12  Alex Christensen  <achristensen@webkit.org>

        Remove unused GetWebCoreStatistics message
        https://bugs.webkit.org/show_bug.cgi?id=209001
        <rdar://problem/59682747>

        Reviewed by Chris Dumez.

        * WebProcess/WebProcess.cpp:
        (WebKit::fromCountedSetToHashMap): Deleted.
        (WebKit::getWebCoreMemoryCacheStatistics): Deleted.
        (WebKit::WebProcess::getWebCoreStatistics): Deleted.
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:

2020-03-12  David Kilzer  <ddkilzer@apple.com>

        WebPasteboardProxy::SetPasteboardBufferForType should validate its `size` parameter
        <https://webkit.org/b/208902>
        <rdar://problem/60181117>

        Reviewed by Chris Dumez.

        * Platform/IPC/Connection.h:
        (MESSAGE_CHECK_BASE):
        - Define in terms of MESSAGE_CHECK_COMPLETION_BASE() with a
          no-op completion handler.
        (MESSAGE_CHECK_COMPLETION_BASE):
        - Rename from MESSAGE_CHECK_BASE() and add completion handler
          parameter.

        * Platform/SharedMemory.h:
        (WebKit::SharedMemory::Handle::size const): Add.

        * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
        (MESSAGE_CHECK):
        - Define macro to use in
          WebPasteboardProxy::setPasteboardBufferForType().
        - Undefine macro at end of source file due to unified sources.
        (WebKit::WebPasteboardProxy::setPasteboardBufferForType):
        - Add IPC::Connection& parameter after change to
          WebPasteboardProxy.messages.in.  Use with MESSAGE_CHECK().
        - Validate `size` parameter using MESSAGE_CHECK().  Because
          SharedMemory::Handle::size() returns a size_t value, we do not
          need to check `size <= std::numeric_limits<size_t>::max()`.
        - Add static_cast<size_t>() to size parameter to denote type
          change.
        * UIProcess/WebPasteboardProxy.h:
        (WebKit::WebPasteboardProxy::setPasteboardBufferForType):
        - Add IPC::Connection& parameter after change to
          WebPasteboardProxy.messages.in.
        * UIProcess/WebPasteboardProxy.messages.in:
        (SetPasteboardBufferForType):
        - Add 'WantsConnection' attribute to add IPC::Connection&
          parameter to WebPasteboardProxy::setPasteboardBufferForType().

2020-03-12  Youenn Fablet  <youenn@apple.com>

        Provide orientation to GPUProcess when it will start to capture
        https://bugs.webkit.org/show_bug.cgi?id=208911

        Reviewed by Eric Carlson.

        Provide orientation to GPUProcess whenever starting to capture.
        This fixes the case of spinning the GPUProcess/starting capture in landscape mode.
        Do not send orientation to GPUProcess if it is not yet started as an optimization.

        Manually tested.

        * UIProcess/WebPageProxy.cpp:

2020-03-12  Eric Carlson  <eric.carlson@apple.com>

        Remove TextTrackPrivateRemote.messages.in
        https://bugs.webkit.org/show_bug.cgi?id=208935

        Reviewed by Don Olmstead.

        No new tests, no functional change.

        * CMakeLists.txt:
        * DerivedSources-input.xcfilelist:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/GPU/media/TextTrackPrivateRemote.messages.in: Removed.

2020-03-12  youenn fablet  <youenn@apple.com>

        Move AudioSession interruption listener code to AudioSession
        https://bugs.webkit.org/show_bug.cgi?id=208714

        Reviewed by Jer Noble.

        Make RemoteAudioSessionProxyManager an observer for AudioSession interruptions.
        When being interrupted, notify all WebProcesses and trigger begin/end interruption mechanisms.
        We only send interruption to sessions that are active in RemoteAudioSessionProxyManager.
        Minor refactorting to move manager proxies from a map to a weak hash set.

        * GPUProcess/GPUConnectionToWebProcess.cpp:
        (WebKit::GPUConnectionToWebProcess::didClose):
        (WebKit::GPUConnectionToWebProcess::audioSessionProxy):
        * GPUProcess/media/RemoteAudioSessionProxy.cpp:
        (WebKit::RemoteAudioSessionProxy::setCategory):
        (WebKit::RemoteAudioSessionProxy::setPreferredBufferSize):
        (WebKit::RemoteAudioSessionProxy::tryToSetActive):
        * GPUProcess/media/RemoteAudioSessionProxyManager.cpp:
        (WebKit::RemoteAudioSessionProxyManager::RemoteAudioSessionProxyManager):
        (WebKit::RemoteAudioSessionProxyManager::~RemoteAudioSessionProxyManager):
        (WebKit::RemoteAudioSessionProxyManager::addProxy):
        (WebKit::RemoteAudioSessionProxyManager::removeProxy):
        (WebKit::RemoteAudioSessionProxyManager::setCategoryForProcess):
        (WebKit::RemoteAudioSessionProxyManager::setPreferredBufferSizeForProcess):
        (WebKit::RemoteAudioSessionProxyManager::tryToSetActiveForProcess):
        (WebKit::RemoteAudioSessionProxyManager::beginAudioSessionInterruption):
        (WebKit::RemoteAudioSessionProxyManager::endAudioSessionInterruption):
        * GPUProcess/media/RemoteAudioSessionProxyManager.h:
        * GPUProcess/media/ios/RemoteMediaSessionHelperProxy.cpp:
        * GPUProcess/media/ios/RemoteMediaSessionHelperProxy.h:
        * WebProcess/GPU/media/ios/RemoteMediaSessionHelper.cpp:
        * WebProcess/GPU/media/ios/RemoteMediaSessionHelper.h:
        * WebProcess/GPU/media/ios/RemoteMediaSessionHelper.messages.in:

2020-03-12  Don Olmstead  <don.olmstead@sony.com>

        [GPUP] Use standard int type in RemoteMediaPlayerState
        https://bugs.webkit.org/show_bug.cgi?id=208962

        Reviewed by Eric Carlson.

        An unsigned long long is at least 64-bits so use uint64_t instead. This issue
        was found when compiling out the GPU Process. No specialization of unsigned long
        long was found which resulted in errors. This appears to be a non-Cocoa problem.

        * WebProcess/GPU/media/RemoteMediaPlayerState.h:
        (WebKit::RemoteMediaPlayerState::decode):

2020-03-12  youenn fablet  <youenn@apple.com>

        GPUProcess should ensure UIProcess granted capture access to a WebProcess making a capture request
        https://bugs.webkit.org/show_bug.cgi?id=208910

        Reviewed by Eric Carlson.

        When UIProcess receives a getUserMedia request, it will send to GPUProcess a notification of what is allowed.
        GPUProcess stores for each connection to web process whether microphone, camera and/or display are allowed.
        We do not disable access for a given process for now.
        A future refactoring should probably streamline the implementation so that, in case capture happens in GPUProcess,
        GPUProcess receives the getUserMedia request, asks permission to UIProcess and, upon granted permission, creates directly the sources.

        Covered by existing tests.

        * GPUProcess/GPUConnectionToWebProcess.cpp:
        (WebKit::GPUConnectionToWebProcess::updateCaptureAccess):
        * GPUProcess/GPUConnectionToWebProcess.h:
        (WebKit::GPUConnectionToWebProcess::allowsAudioCapture const):
        (WebKit::GPUConnectionToWebProcess::allowsVideoCapture const):
        (WebKit::GPUConnectionToWebProcess::allowsDisplayCapture const):
        * GPUProcess/GPUProcess.cpp:
        (WebKit::GPUProcess::createGPUConnectionToWebProcess):
        (WebKit::GPUProcess::updateCaptureAccess):
        * GPUProcess/GPUProcess.h:
        * GPUProcess/GPUProcess.messages.in:
        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
        (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
        * UIProcess/GPU/GPUProcessProxy.cpp:
        (WebKit::GPUProcessProxy::updateCaptureAccess):
        * UIProcess/GPU/GPUProcessProxy.h:
        * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
        (WebKit::UserMediaPermissionRequestManagerProxy::finishGrantingRequest):
        * UIProcess/WebPageProxy.cpp:
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebProcessProxy.cpp:

2020-03-12  Brent Fulgham  <bfulgham@apple.com>

        Drop unused EnableEnumeratingAllNetworkInterfaces / DisableEnumeratingAllNetworkInterfaces IPC messages
        https://bugs.webkit.org/show_bug.cgi?id=208973
        <rdar://problem/59683940>

        Reviewed by Youenn Fablet.

        Remove two unused IPC messages.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::disableEnumeratingAllNetworkInterfaces): Deleted.
        (WebKit::WebPage::enableEnumeratingAllNetworkInterfaces): Deleted.
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2020-03-11  Said Abou-Hallawa  <sabouhallawa@apple.com>

        [GPU Process] encodeNativeImage() should pass imageSize to GraphicsContext::drawNativeImage()
        https://bugs.webkit.org/show_bug.cgi?id=208936

        Reviewed by Myles C. Maxfield.

        Passing an empty FloatSize makes drawNativeImage() draws nothing to
        the ShareableBitmap

        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::encodeNativeImage):

2020-03-11  Said Abou-Hallawa  <sabouhallawa@apple.com>

        RemoteImageBuffer::getImageData() has to clear its DisplayList after calling flushDrawingContext()
        https://bugs.webkit.org/show_bug.cgi?id=208931

        Reviewed by Myles C. Maxfield.

        Instead of letting every caller to flushDrawingContextAndWaitCommit() or
        flushDrawingContext() be responsible of clearing the DisplayList, we can
        make these functions take this responsibility.

        * WebProcess/GPU/graphics/RemoteImageBuffer.h:
        * WebProcess/GPU/graphics/RemoteImageBufferMessageHandler.cpp:
        (WebKit::RemoteImageBufferMessageHandler::flushDrawingContext):
        (WebKit::RemoteImageBufferMessageHandler::flushDrawingContextAndWaitCommit):
        * WebProcess/GPU/graphics/RemoteImageBufferMessageHandler.h:

2020-03-11  Don Olmstead  <don.olmstead@sony.com>

        Non-unified build fixes early March 2020 edition Take 2
        https://bugs.webkit.org/show_bug.cgi?id=208968

        Unreviewed build fix.

        * WebProcess/GPU/graphics/RemoteImageBufferMessageHandler.cpp:
        * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp:
        (WebKit::RemoteMediaPlayerManager::createRemoteMediaPlayer):

2020-03-11  Don Olmstead  <don.olmstead@sony.com>

        [GPUP] Add entry points for non-Cocoa ports
        https://bugs.webkit.org/show_bug.cgi?id=208965

        Reviewed by Michael Catanzaro.

        Add a CMake target for the GPU Process that is optionally defined based on
        whether the process is enabled.

        Add an entry point for the GPU Process for unix and windows ports. Use this
        as the source for the GPU Process by specifying it in the Platform CMake file.

        Add in hooks for both Windows and GLib to launch the GPU Process if it is
        enabled in the port.

        * CMakeLists.txt:
        * GPUProcess/EntryPoint/unix/GPUProcessMain.cpp: Added.
        (main):
        * GPUProcess/EntryPoint/win/GPUProcessMain.cpp: Added.
        (main):
        * GPUProcess/GPUProcessMain.h: Added.
        * PlatformFTW.cmake:
        * PlatformGTK.cmake:
        * PlatformMac.cmake:
        * PlatformPlayStation.cmake:
        * PlatformWPE.cmake:
        * PlatformWin.cmake:
        * Shared/ProcessExecutablePath.h:
        * Shared/glib/ProcessExecutablePathGLib.cpp:
        (WebKit::executablePathOfGPUProcess):
        * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
        (WebKit::ProcessLauncher::launchProcess):
        * UIProcess/Launcher/win/ProcessLauncherWin.cpp:
        (WebKit::processName):

2020-03-11  Don Olmstead  <don.olmstead@sony.com>

        [GPUP] Add special handling of MediaTime within message generator
        https://bugs.webkit.org/show_bug.cgi?id=208958

        Reviewed by Eric Carlson.

        When compiling the GPU Process sources without unified sources there were
        numerous compilation errors around MediaTime. Only GPU Process .messages.in
        files reference this type so there was no special handling within messages.py.
        Adding explicit references to MediaTime so the proper header is used and all
        sources compile.

        * Scripts/webkit/messages.py:

2020-03-11  Per Arne Vollan  <pvollan@apple.com>

        [macOS] Register with accessibility when the WebContent process starts
        https://bugs.webkit.org/show_bug.cgi?id=208960

        Reviewed by Brent Fulgham.

        When we reenabled CF prefs direct mode in <https://bugs.webkit.org/show_bug.cgi?id=208690>, we started to register
        with accessibility when we received a message to do so from the UI process. This would typically happen when the user
        enabled accessibility. On macOS, this notification does not work the same way as on iOS, and it is assumed that
        accessibility should always be enabled. Therefore we should go back to registering with accessibility on startup of
        the WebContent process on macOS.

        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeProcess):
        (WebKit::WebProcess::unblockAccessibilityServer):

2020-03-11  Don Olmstead  <don.olmstead@sony.com>

        [GPUP] RemoteAudioDestination classes should require ENABLE(WEB_AUDIO)
        https://bugs.webkit.org/show_bug.cgi?id=208956

        Reviewed by Dean Jackson.

        RemoteAudioDestinationProxy uses AudioBus directly. For ports that don't 
        ENABLE(WEB_AUDIO) there is no implementation and linker errors will occur after
        building with ENABLE(GPU_PROCESS).

        Add guards for ENABLE(WEB_AUDIO) around relevant implementations.

        * GPUProcess/GPUConnectionToWebProcess.cpp:
        (WebKit::GPUConnectionToWebProcess::dispatchMessage):
        (WebKit::GPUConnectionToWebProcess::dispatchSyncMessage):
        * GPUProcess/GPUConnectionToWebProcess.h:
        * GPUProcess/media/RemoteAudioDestinationManager.cpp:
        * GPUProcess/media/RemoteAudioDestinationManager.h:
        * GPUProcess/media/RemoteAudioDestinationManager.messages.in:
        * WebProcess/GPU/media/RemoteAudioDestinationProxy.cpp:
        * WebProcess/GPU/media/RemoteAudioDestinationProxy.h:
        * WebProcess/GPU/media/RemoteAudioDestinationProxy.messages.in:

2020-03-11  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, reverting r258294.
        https://bugs.webkit.org/show_bug.cgi?id=208957

        Introduced API failure (Requested by perarne on #webkit).

        Reverted changeset:

        "[macOS] _AXSApplicationAccessibilityEnabled should not be
        called"
        https://bugs.webkit.org/show_bug.cgi?id=208953
        https://trac.webkit.org/changeset/258294

2020-03-11  Kate Cheney  <katherine_cheney@apple.com>

        Add a parameter to allow ignoring app-bound domain categorization
        https://bugs.webkit.org/show_bug.cgi?id=208949
        <rdar://problem/60239187>

        Reviewed by Brent Fulgham.

        Introduce a new parameter to ignore app-bound domain categorization
        for specific WebViews.

        * UIProcess/API/APIPageConfiguration.h:
        (API::PageConfiguration::ignoresAppBoundDomains const):
        (API::PageConfiguration::setIgnoresAppBoundDomains):
        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
        (-[WKWebViewConfiguration _ignoresAppBoundDomains]):
        (-[WKWebViewConfiguration _setIgnoresAppBoundDomains:]):
        * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::setIsNavigatingToAppBoundDomain):

2020-03-11  Per Arne Vollan  <pvollan@apple.com>

        [macOS] _AXSApplicationAccessibilityEnabled should not be called
        https://bugs.webkit.org/show_bug.cgi?id=208953

        Reviewed by Brent Fulgham.

        This function should only be called on iOS, not on macOS.

        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
        (WebKit::WebProcessProxy::unblockAccessibilityServerIfNeeded):

2020-03-11  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthn] Formalize the Keychain schema
        https://bugs.webkit.org/show_bug.cgi?id=183533
        <rdar://problem/43347926>

        Reviewed by Brent Fulgham.

        This patch formalizes the schema for the Keychain as follows:
        kSecAttrLabel: RP ID
        kSecAttrApplicationLabel: Credential ID (auto-gen by Keychain)
        kSecAttrApplicationTag: { "id": UserEntity.id, "name": UserEntity.name } (CBOR encoded)
        Noted, the vale of kSecAttrApplicationLabel is automatically generated by the Keychain, which is a SHA-1 hash of
        the public key.

        According to the Step 7. from https://www.w3.org/TR/webauthn/#op-make-cred, the following fields are mandatory
        1. rpId (rpEntity.id);
        2. userHandle (userEntity.id), this is required for authenticators that support resident keys;
        3. credentialId.

        Some other optional fields are:
        (from https://www.w3.org/TR/webauthn/#dictdef-publickeycredentialrpentity)
        1. rpEntity.name;
        2. rpEnitty.icon;
        (from https://www.w3.org/TR/webauthn/#dictdef-publickeycredentialuserentity)
        3. userEntity.displayName;
        4. userEntity.name;
        5. userEntity.icon;
        (from https://www.w3.org/TR/webauthn/#sign-counter)
        6. signature counter.

        Among the six possible fields, only 4. is chosen to store. Here is why:
        For rpEntity, rpEntity.id which is either the domain or the eTLD + 1 of the website is
        sufficient enough to either classify the credential or serving the UI. Also, this is the only
        trustworthy information that the UserAgent produce. Others could potentially be used by
        malicious websites for attacking the Keychain or spoofing/phishing users when being displayed
        in the UI. Also, rpEnitty.icon is a URL to the website's favicon, which if not implemented
        correctly can be used for tracking.

        For userEntity, userEntity.name is the human readable version of userEntity.id, and therefore
        is chosen to store such that later on WebKit can pass it to UI client to help users disambiguate
        different credentials. And it is necessary as userEntity.id is not guaranteed to be human
        readable. Others are abandoned for the very same reason as above.

        We hard code a zero value for 'signature counter'. While this is a theoretically interesting
        technique for a RP to detect private key cloning, it is unlikely to be useful in practice.
        We store the private keys in our SEP. This counter would only be a meaningful protection if
        adversaries were able to extract private key data from the SEP without Apple noticing, but
        were not able to manipulate this counter to fool the RP.

        In terms of the schema,
        1) RP ID is needed to query all credentials related, and therefore it needs a column and kSecAttrLabel
        is supposed to be human readable;
        2) kSecAttrApplicationLabel is the auto generated programmatical identifier for a SecItem, and
        therefore is suitable as the credential ID. Given the input to the SHA-1 is generated by us, and
        it is only needed to be powerful enough to be unique across the keychain within a device, and potentially
        to be unique across different other credential ID for the same user. The SHA-1 collision attack
        doesn't seem valid here.
        3) kSecAttrApplicationTag is the only other column Keychain allows applications to modify. Therefore,
        UserEntity.id and UserEntity.name is bundled to use this slot. The reason to use CBOR here is that
        it is more friendly then JSON to encode binaries, and it is used widely in WebAuthn.

        * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.h:
        * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
        (WebKit::LocalAuthenticatorInternal::toArrayBuffer):
        (WebKit::LocalAuthenticatorInternal::getExistingCredentials):
        (WebKit::LocalAuthenticator::makeCredential):
        (WebKit::LocalAuthenticator::continueMakeCredentialAfterUserVerification):
        (WebKit::LocalAuthenticator::continueMakeCredentialAfterAttested):
        (WebKit::LocalAuthenticator::getAssertion):
        (WebKit::LocalAuthenticator::deleteDuplicateCredential const):
        * UIProcess/WebAuthentication/Mock/MockLocalConnection.mm:
        (WebKit::MockLocalConnection::filterResponses const):

2020-03-11  Per Arne Vollan  <pvollan@apple.com>

        [macOS] Crash under WebKit::WebProcessPool::platformInitialize()
        https://bugs.webkit.org/show_bug.cgi?id=208945

        Unreviewed temporary compile fix.

        * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
        (WebKit::WebProcessProxy::unblockAccessibilityServerIfNeeded):

2020-03-11  Per Arne Vollan  <pvollan@apple.com>

        [macOS] Crash under WebKit::WebProcessPool::platformInitialize()
        https://bugs.webkit.org/show_bug.cgi?id=208945

        Reviewed by Tim Horton.

        Check that accessibility library is present before attempting to call functions in it.

        No new tests, since I am not able to reproduce.

        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
        (WebKit::WebProcessProxy::unblockAccessibilityServerIfNeeded):

2020-03-11  Per Arne Vollan  <pvollan@apple.com>

        [macOS] Crash under WebKit::WebProcessPool::platformInitialize()
        https://bugs.webkit.org/show_bug.cgi?id=208945
        <rdar://problem/60330751>
        
        Reviewed by Brent Fulgham.

        Check that accessibility library is present before attempting to use constants from it.

        No new tests, since I am unable to reproduce.

        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::registerNotificationObservers):
        (WebKit::WebProcessPool::unregisterNotificationObservers):

2020-03-11  Alex Christensen  <achristensen@webkit.org>

        Enable safe browsing warnings in Mac Catalyst WebKit
        https://bugs.webkit.org/show_bug.cgi?id=208944
        <rdar://problem/58854302>

        Reviewed by Tim Horton.

        I manually verified using the steps in the radar that it works as one would hope.

        * Configurations/WebKit.xcconfig:

2020-03-11  Alex Christensen  <achristensen@webkit.org>

        Fix the macCatalyst build after r258250

        * WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.mm:
        (WebKit::TextCheckingControllerProxy::annotatedSubstringBetweenPositions):

2020-03-11  Chris Dumez  <cdumez@apple.com>

        Terminate the Network / Plugin processes when receiving invalid IPC from them
        https://bugs.webkit.org/show_bug.cgi?id=208933
        <rdar://problem/58026473>

        Reviewed by Geoffrey Garen.

        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::didReceiveInvalidMessage):
        * UIProcess/Plugins/PluginProcessProxy.cpp:
        (WebKit::PluginProcessProxy::didReceiveInvalidMessage):

2020-03-11  Timothy Horton  <timothy_horton@apple.com>

        Fix the macCatalyst build after r258250

        * WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.mm:

2020-03-11  Chris Dumez  <cdumez@apple.com>

        Assertion hit under WebPageProxy::suspendCurrentPageIfPossible() when bypassing certificate warning page
        https://bugs.webkit.org/show_bug.cgi?id=208927
        <rdar://problem/55448331>

        Reviewed by Alex Christensen.

        When suspending a previous page after a process-swap, we refuse to do the suspension if the currently
        committed URL does not match the url of the current back/forward list item. This makes sense since we
        will store the suspended page on the back/forward list item and restore that back when navigating back
        to that item. I had a debug assertion in there to help me figure out how this could happen. It turns
        out that calling loadAlternateHTML on the view will replace the content of the view with the provided
        HTML string, update the committed URL but not create a new back/forward list item. This is so that
        if you reload or go/back to this back/forward list item, we will attempt to load the original URL
        again. This would however trip my assertion. I am therefore removing my debug assertion and adding API
        test coverage.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::suspendCurrentPageIfPossible):

2020-03-11  Alex Christensen  <achristensen@webkit.org>

        Introduce ResourceLoadStatisticsParameters and move members from NetworkSessionCreationParameters
        https://bugs.webkit.org/show_bug.cgi?id=208895

        Reviewed by Youenn Fablet.

        No change in behavior yet, but this will help us organize things better.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::initializeNetworkProcess):
        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::NetworkSession):
        * NetworkProcess/NetworkSessionCreationParameters.cpp:
        (WebKit::NetworkSessionCreationParameters::encode const):
        (WebKit::NetworkSessionCreationParameters::decode):
        * NetworkProcess/NetworkSessionCreationParameters.h:
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
        * Shared/ResourceLoadStatisticsParameters.h: Added.
        (WebKit::ResourceLoadStatisticsParameters::encode const):
        (WebKit::ResourceLoadStatisticsParameters::decode):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::parameters):
        * WebKit.xcodeproj/project.pbxproj:

2020-03-11  Chris Dumez  <cdumez@apple.com>

        Defer async scripts until DOMContentLoaded or first paint, whichever comes first
        https://bugs.webkit.org/show_bug.cgi?id=208896

        Reviewed by Darin Adler.

        Defer async scripts until DOMContentLoaded or first paint, whichever comes first. In
        Bug 207698, we deferred them until DOMContentLoaded, as a first-paint optimization.
        However, this seems overly aggressive on pages like wikipedia and it is sufficient
        to defer those scripts until first-paint to get the performance win.

        * Shared/WebPreferences.yaml:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _setupPageConfiguration:]):

2020-03-11  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, reverting r258263.
        https://bugs.webkit.org/show_bug.cgi?id=208922

        it is breaking internal builds (Requested by youenn on
        #webkit).

        Reverted changeset:

        "Move AudioSession interruption listener code to AudioSession"
        https://bugs.webkit.org/show_bug.cgi?id=208714
        https://trac.webkit.org/changeset/258263

2020-03-11  youenn fablet  <youenn@apple.com>

        Move AudioSession interruption listener code to AudioSession
        https://bugs.webkit.org/show_bug.cgi?id=208714

        Reviewed by Jer Noble.

        Make RemoteAudioSessionProxyManager an observer for AudioSession interruptions.
        When being interrupted, notify all WebProcesses and trigger begin/end interruption mechanisms.
        We only send interruption to sessions that are active in RemoteAudioSessionProxyManager.
        Minor refactorting to move manager proxies from a map to a weak hash set.

        * GPUProcess/GPUConnectionToWebProcess.cpp:
        (WebKit::GPUConnectionToWebProcess::didClose):
        (WebKit::GPUConnectionToWebProcess::audioSessionProxy):
        * GPUProcess/media/RemoteAudioSessionProxy.cpp:
        (WebKit::RemoteAudioSessionProxy::setCategory):
        (WebKit::RemoteAudioSessionProxy::setPreferredBufferSize):
        (WebKit::RemoteAudioSessionProxy::tryToSetActive):
        * GPUProcess/media/RemoteAudioSessionProxyManager.cpp:
        (WebKit::RemoteAudioSessionProxyManager::RemoteAudioSessionProxyManager):
        (WebKit::RemoteAudioSessionProxyManager::~RemoteAudioSessionProxyManager):
        (WebKit::RemoteAudioSessionProxyManager::addProxy):
        (WebKit::RemoteAudioSessionProxyManager::removeProxy):
        (WebKit::RemoteAudioSessionProxyManager::setCategoryForProcess):
        (WebKit::RemoteAudioSessionProxyManager::setPreferredBufferSizeForProcess):
        (WebKit::RemoteAudioSessionProxyManager::tryToSetActiveForProcess):
        (WebKit::RemoteAudioSessionProxyManager::beginAudioSessionInterruption):
        (WebKit::RemoteAudioSessionProxyManager::endAudioSessionInterruption):
        * GPUProcess/media/RemoteAudioSessionProxyManager.h:
        * GPUProcess/media/ios/RemoteMediaSessionHelperProxy.cpp:
        * GPUProcess/media/ios/RemoteMediaSessionHelperProxy.h:
        * WebProcess/GPU/media/ios/RemoteMediaSessionHelper.cpp:
        * WebProcess/GPU/media/ios/RemoteMediaSessionHelper.h:
        * WebProcess/GPU/media/ios/RemoteMediaSessionHelper.messages.in:

2020-03-10  Don Olmstead  <don.olmstead@sony.com>

        [GPU Process] Work towards compiling out on non-Cocoa ports
        https://bugs.webkit.org/show_bug.cgi?id=208899

        Reviewed by Darin Adler.

        Work through some compilation issues on non-Cocoa ports when attempting to build
        out the GPU Process. Fix platform guards for some methods. Fix compilation issues
        for non-unified builds.

        Add in CMake listing of messages.in and include directories required for building
        with ENABLE_GPU_PROCESS.

        * CMakeLists.txt:
        * GPUProcess/GPUConnectionToWebProcess.cpp:
        (WebKit::GPUConnectionToWebProcess::didClose):
        * GPUProcess/GPUConnectionToWebProcess.messages.in:
        * GPUProcess/GPUProcess.cpp:
        * GPUProcess/graphics/RemoteImageBufferMessageHandlerProxy.h:
        * GPUProcess/graphics/RemoteImageBufferProxy.h:
        (WebKit::RemoteImageBufferProxy::create):
        * GPUProcess/graphics/RemoteRenderingBackendProxy.cpp:
        * GPUProcess/graphics/RemoteRenderingBackendProxy.h:
        * GPUProcess/media/RemoteMediaPlayerProxy.cpp:
        (WebKit::RemoteMediaPlayerProxy::getConfiguration):
        (WebKit::RemoteMediaPlayerProxy::setVideoFullscreenGravity):
        (WebKit::RemoteMediaPlayerProxy::updateVideoFullscreenInlineImage):
        (WebKit::RemoteMediaPlayerProxy::setVideoFullscreenMode):
        (WebKit::RemoteMediaPlayerProxy::videoFullscreenStandbyChanged):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerReadyStateChanged):
        (WebKit::RemoteMediaPlayerProxy::notifyTrackModeChanged):
        * GPUProcess/media/RemoteMediaPlayerProxy.h:
        * GPUProcess/media/RemoteMediaPlayerProxy.messages.in:
        * UIProcess/GPU/GPUProcessProxy.h:
        * WebProcess/GPU/GPUProcessConnection.cpp:
        * WebProcess/GPU/graphics/ImageBufferShareableBitmapBackend.cpp:
        * WebProcess/GPU/graphics/ImageBufferShareableBitmapBackend.h:
        * WebProcess/GPU/graphics/RemoteImageBufferMessageHandler.h:
        * WebProcess/GPU/graphics/RemoteRenderingBackend.cpp:
        * WebProcess/GPU/media/AudioTrackPrivateRemote.h:
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
        * WebProcess/GPU/media/TextTrackPrivateRemote.h:

2020-03-10  Per Arne Vollan  <pvollan@apple.com>

        [iOS] A syscall is denied by the sandbox
        https://bugs.webkit.org/show_bug.cgi?id=208892
        <rdar://problem/60294880>

        Reviewed by Brent Fulgham.

        Add denied syscall to sandbox on iOS.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

2020-03-08  Darin Adler  <darin@apple.com>

        Make TextIterator::range return a SimpleRange
        https://bugs.webkit.org/show_bug.cgi?id=208797

        Reviewed by Don Olmstead.

        * WebProcess/InjectedBundle/API/mac/WKDOMTextIterator.mm:
        (-[WKDOMTextIterator currentRange]): Use createLiveRange.

        * WebProcess/WebPage/Cocoa/WebPageCocoa.mm: Added includes.

2020-03-10  Don Olmstead  <don.olmstead@sony.com>

        Non-unified build fixes early March 2020 edition
        https://bugs.webkit.org/show_bug.cgi?id=208897

        Unreviewed build fix.

        * NetworkProcess/NetworkLoadChecker.h:

2020-03-10  Kate Cheney  <katherine_cheney@apple.com>

        Some common domains should always be App-bound domains
        https://bugs.webkit.org/show_bug.cgi?id=208893
         <rdar://problem/60280943>

        Reviewed by Brent Fulgham.

        Some domains, like about:blank and pages loaded from files should
        always be considered app-bound.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::shouldBeTreatedAsAppBound):
        (WebKit::WebPageProxy::setIsNavigatingToAppBoundDomain):

2020-03-10  Devin Rousso  <drousso@apple.com>

        Web Inspector: make `WebKit::WebInspectorProxy::m_isOpening` GTK only
        https://bugs.webkit.org/show_bug.cgi?id=208831
        <rdar://problem/57720692>

        Reviewed by Brian Burg.

        * UIProcess/Inspector/WebInspectorProxy.h:
        * UIProcess/Inspector/WebInspectorProxy.cpp:
        (WebKit::WebInspectorProxy::open):

2020-03-10  David Kilzer  <ddkilzer@apple.com>

        [CoreIPC] WebPasteboardProxy::SetPasteboardBufferForType uses "0" for both uint64_t and a pointer value
        <https://webkit.org/b/208879>
        <rdar://problem/60165624>

        Reviewed by Wenson Hsieh.

        * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
        (WebKit::WebPasteboardProxy::setPasteboardBufferForType):
        - Change 0 to nullptr to make code easier to read.

2020-03-10  Andres Gonzalez  <andresg_22@apple.com>

        Enable accessibility IsolatedTree in WebKit.
        https://bugs.webkit.org/show_bug.cgi?id=208881

        Reviewed by Chris Fleizach.

        Sets the default value of accessibility IsolatedTree support to true.

        * Shared/WebPreferences.yaml:

2020-03-10  Megan Gardner  <megan_gardner@apple.com>

        File upload cancels before files can be uploaded.
        https://bugs.webkit.org/show_bug.cgi?id=208846
        <rdar://problem/60244249>

        Reviewed by Tim Horton.

        With the new UIContextMenus, we needed to cancel in order for everything to be 
        reset correctly in WebCore. But this can only be done in the animation completion
        handler, but we only want to cancel if we aren't presenting a different picker.

        * UIProcess/ios/forms/WKFileUploadPanel.mm:
        (-[WKFileUploadPanel contextMenuInteraction:configurationForMenuAtLocation:]):
        (-[WKFileUploadPanel contextMenuInteraction:willEndForConfiguration:animator:]):
        (-[WKFileUploadPanel ensureContextMenuInteraction]):

2020-03-10  youenn fablet  <youenn@apple.com>

        Make sure that ServiceWorkerFrameLoaderClient lifetime exceeds its frame lifetime
        https://bugs.webkit.org/show_bug.cgi?id=208855
        <rdar://problem/60187332>

        Reviewed by Geoffrey Garen.

        In case connection is destroyed, for instance due to network process crashing,
        we destroy all service worker frame loader clients.
        This is too soon as service worker thread proxy is refcounted and can last longer.
        For that reason, we now let the SWContextManager handle the lifetime of the frame loader clients.
        Drive-by fix: generate a new frame identifier instead of using an internal counter which can be wrong in case of new connection
        and might clash with other frame identifiers now that service workers can run in process with pages.

        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        (WebKit::ServiceWorkerFrameLoaderClient::create):
        (WebKit::ServiceWorkerFrameLoaderClient::ServiceWorkerFrameLoaderClient):
        (WebKit::ServiceWorkerFrameLoaderClient::frameLoaderDestroyed):
        (WebKit::WebSWContextManagerConnection::installServiceWorker):
        * WebProcess/Storage/WebSWContextManagerConnection.h:

2020-03-10  Youenn Fablet  <youenn@apple.com>

        Do not create a service worker connection if service worker is not enabled in network process
        https://bugs.webkit.org/show_bug.cgi?id=208851

        Reviewed by Simon Fraser.

        In case of navigation redirection, we were trying to go to service worker without checking the service worker entitlement.
        Instead, we should check the service worker entitlement and return early in that case.

        Covered by manually running minibrowser on simulator.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::isServiceWorkerAllowed const):
        (WebKit::NetworkConnectionToWebProcess::createFetchTask):
        (WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::continueWillSendRequest):
        (WebKit::NetworkResourceLoader::startWithServiceWorker):

2020-03-10  youenn fablet  <youenn@apple.com>

        Remove SampleBufferDisplayLayer sync IPC
        https://bugs.webkit.org/show_bug.cgi?id=208804

        Reviewed by Eric Carlson.

        Implement the initialize method as an async IPC.

        * GPUProcess/GPUConnectionToWebProcess.cpp:
        (WebKit::GPUConnectionToWebProcess::dispatchSyncMessage):
        * GPUProcess/webrtc/RemoteSampleBufferDisplayLayer.cpp:
        (WebKit::RemoteSampleBufferDisplayLayer::RemoteSampleBufferDisplayLayer):
        * GPUProcess/webrtc/RemoteSampleBufferDisplayLayerManager.cpp:
        (WebKit::RemoteSampleBufferDisplayLayerManager::createLayer):
        * GPUProcess/webrtc/RemoteSampleBufferDisplayLayerManager.h:
        * GPUProcess/webrtc/RemoteSampleBufferDisplayLayerManager.messages.in:
        * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp:
        (WebKit::RemoteMediaPlayerManager::updatePreferences):
        * WebProcess/GPU/webrtc/SampleBufferDisplayLayer.cpp:
        (WebKit::SampleBufferDisplayLayer::create):
        (WebKit::SampleBufferDisplayLayer::SampleBufferDisplayLayer):
        (WebKit::SampleBufferDisplayLayer::initialize):
        * WebProcess/GPU/webrtc/SampleBufferDisplayLayer.h:
        * WebProcess/GPU/webrtc/SampleBufferDisplayLayerManager.cpp:
        (WebKit::SampleBufferDisplayLayerManager::createLayer):
        * WebProcess/GPU/webrtc/SampleBufferDisplayLayerManager.h:

2020-03-10  youenn fablet  <youenn@apple.com>

        [iOS] Make sure a MediStreamTrack clone does not interrupt the being cloned track
        https://bugs.webkit.org/show_bug.cgi?id=208634

        Reviewed by Eric Carlson.

        * WebProcess/cocoa/UserMediaCaptureManager.cpp:
        (WebKit::UserMediaCaptureManager::VideoFactory::setActiveSource):
        Do nothing since GPUProcess will handle the muting itself if it creates multiple sources.
        * WebProcess/cocoa/UserMediaCaptureManager.h:

2020-03-10  youenn fablet  <youenn@apple.com>

        Remove sync IPC when creating a remote capture source
        https://bugs.webkit.org/show_bug.cgi?id=208816

        Reviewed by Eric Carlson.

        Use whenInitialized to wait for the async IPC that tells whether the remote source was created successfully.
        Use the async response to gather the capabilities so as to remove the corresponding sync IPC.

        * Platform/IPC/Connection.h:
        (IPC::AsyncReplyError::create):
        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
        (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
        * WebProcess/cocoa/UserMediaCaptureManager.cpp:
        (WebKit::UserMediaCaptureManager::Source::didFail):
        (WebKit::UserMediaCaptureManager::Source::setAsReady):
        (WebKit::UserMediaCaptureManager::Source::setCapabilities):
        (WebKit::UserMediaCaptureManager::createCaptureSource):
        (WebKit::UserMediaCaptureManager::Source::capabilities):

2020-03-10  youenn fablet  <youenn@apple.com>

        Do not process RTC Network messages coming from NetworkProcess if LibWebRTCNetwork is not active
        https://bugs.webkit.org/show_bug.cgi?id=207376

        Reviewed by Eric Carlson.

        In case LibWebRTCNetwork is not active, we do not have instantiated any peer connection.
        We do not have started any related RTC thread so we are not expecting any RTC message from Network Process.
        Exit early in that case.

        * WebProcess/Network/NetworkProcessConnection.cpp:
        (WebKit::NetworkProcessConnection::didReceiveMessage):
        * WebProcess/Network/webrtc/LibWebRTCNetwork.h:
        (WebKit::LibWebRTCNetwork::isActive const):

2020-03-10  Diego Pino Garcia  <dpino@igalia.com>

        REGRESSION(r258182): [GTK] Remove reference to unrequestedTextCheckingSequence
        https://bugs.webkit.org/show_bug.cgi?id=208852

        Reviewed by Carlos Garcia Campos.
        
        unrequestedTextCheckingSequence was removed in r258182. This variable
        was still used in an assertion, which broke GTK Debug build.

        * UIProcess/gtk/TextCheckerGtk.cpp:
        (WebKit::TextChecker::requestCheckingOfString):

2020-03-10  Chris Dumez  <cdumez@apple.com>

        Drop unused DisableICECandidateFiltering / EnableICECandidateFiltering IPC messages
        https://bugs.webkit.org/show_bug.cgi?id=208843
        <rdar://problem/59683940>

        Reviewed by Youenn Fablet.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_processDisplayName):
        (WebKit::WebPage::disableICECandidateFiltering): Deleted.
        (WebKit::WebPage::enableICECandidateFiltering): Deleted.
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2020-03-09  Megan Gardner  <megan_gardner@apple.com>

        Build Fix
        https://bugs.webkit.org/show_bug.cgi?id=208838

        Build fix of older iOS.

        Reviewed by Tim Horton.

        * UIProcess/ios/WKActionSheetAssistant.mm:
        (-[WKActionSheetAssistant showDataDetectorsSheet]):
        * UIProcess/ios/forms/WKFileUploadPanel.mm:
        (-[WKFileUploadPanel showDocumentPickerMenu]):

2020-03-09  Simon Fraser  <simon.fraser@apple.com>

        ASSERT(!m_textCheckingRequest) on editing/spelling/spellcheck-async-remove-frame.html
        https://bugs.webkit.org/show_bug.cgi?id=126606

        Reviewed by Wenson Hsieh.

        SpellChecker's sequence numbers need to be unique between frames, because they are sent out
        to EditorClient which may be one per web view, so use a static to hold the current
        sequence number.

        Also convert from int to TextCheckingSequence to make them easier to find, and use
        Markable and Optional in TextCheckingRequestData to represent the unset state.

        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<TextCheckingRequestData>::encode):
        (IPC::ArgumentCoder<TextCheckingRequestData>::decode):

2020-03-09  Don Olmstead  <don.olmstead@sony.com>

        Remove obsolete feature flags
        https://bugs.webkit.org/show_bug.cgi?id=208830

        Reviewed by Alex Christensen.

        Remove ENABLE_CUSTOM_SCHEME_HANDLER and ENABLE_MAC_VIDEO_TOOLBOX since they
        are no longer used.

        * Configurations/FeatureDefines.xcconfig:
        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: ENABLE(WIRELESS_TARGET_PLAYBACK) -> ENABLE(WIRELESS_PLAYBACK_TARGET).
        (-[WKWebViewConfiguration copyWithZone:]):

2020-03-09  Chris Dumez  <cdumez@apple.com>

        [iOS] Replace "unexpectedly resumed" observer with RunningBoard suspendible assertions
        https://bugs.webkit.org/show_bug.cgi?id=205687
        <rdar://problem/57890246>

        Reviewed by Tim Horton.

        Adopt new RunningBoard process assertion to indicate that WebContent processes depend on their
        UIProcess (and therefore, the UIProcess must be running if the WebContent process is). This
        replaces our "Unexpectedly resumed" assertion which was causing unexpected terminations in some
        cases.

        * Configurations/WebKit.xcconfig:
        * Platform/spi/ios/RunningBoardServicesSPI.h: Added.
        * Scripts/process-entitlements.sh:
        * Shared/DependencyProcessAssertion.cpp: Added.
        (WebKit::DependencyProcessAssertion::DependencyProcessAssertion):
        (WebKit::DependencyProcessAssertion::~DependencyProcessAssertion):
        * Shared/DependencyProcessAssertion.h: Added.
        * Shared/ios/DependencyProcessAssertionIOS.mm: Added.
        (WebKit::DependencyProcessAssertion::DependencyProcessAssertion):
        (WebKit::DependencyProcessAssertion::~DependencyProcessAssertion):
        * Sources.txt:
        * SourcesCocoa.txt:
        * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
        * UIProcess/WebProcessProxy.h:
        * UIProcess/WebProcessProxy.messages.in:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::initializeConnection):
        * WebProcess/WebProcess.h:
        * WebProcess/cocoa/WebProcessCocoa.mm:

2020-03-09  Per Arne Vollan  <pvollan@apple.com>

        [macOS] Notification observer is not removed
        https://bugs.webkit.org/show_bug.cgi?id=208834

        Reviewed by Tim Horton.

        The Accessibility notification observer is not being removed on macOS.

        API test: WebKit.EnableAccessibilityCrash

        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::unregisterNotificationObservers):

2020-03-09  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Only map UTI from tags in Safari
        https://bugs.webkit.org/show_bug.cgi?id=208829
        <rdar://problem/60234672>

        Reviewed by Tim Horton.

        Since this mapping caused regressions in other apps, only enable it for Safari as a temporary workaround.

        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):

2020-03-09  Per Arne Vollan  <pvollan@apple.com>

        Unreviewed build fix.

        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::decode):

2020-03-09  Jer Noble  <jer.noble@apple.com>

        [GPUP] Implement Legacy EME API in the GPU Process
        https://bugs.webkit.org/show_bug.cgi?id=208402
        <rdar://problem/60178488>

        Reviewed by Eric Carlson.

        Follow-up: adding the RemoteLegacyCDMFactory as a suppliment got dropped from the initial patch by
        a merge/rebase mistake.

        * WebProcess/WebProcess.cpp:

2020-03-09  David Kilzer  <ddkilzer@apple.com>

        [IPC] WebPageProxy::dataSelectionForPasteboard should check the result of SharedMemory::map
        <https://webkit.org/b/208735>
        <rdar://problem/58701732>

        Reviewed by Darin Adler.

        * UIProcess/mac/WebPageProxyMac.mm:
        (WebKit::WebPageProxy::dataSelectionForPasteboard): Add null
        check.

2020-03-09  Antoine Quint  <graouts@apple.com>

        Remove the compile-time flag for Pointer Events
        https://bugs.webkit.org/show_bug.cgi?id=208821
        <rdar://problem/60223471>

        Reviewed by Dean Jackson.

        * Configurations/FeatureDefines.xcconfig:
        * Shared/WebCoreArgumentCoders.h:
        * Shared/WebPreferencesDefaultValues.h:
        * UIProcess/API/ios/WKWebViewIOS.mm:
        (-[WKWebView scrollViewWillBeginZooming:withView:]):
        (-[WKWebView scrollViewWillEndDragging:withVelocity:targetContentOffset:]):
        (-[WKWebView _scrollView:adjustedOffsetForOffset:translation:startPoint:locationInView:horizontalVelocity:verticalVelocity:]):
        * UIProcess/PageClient.h:
        * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
        * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h:
        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
        (WebKit::touchActionsForPoint):
        * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
        * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
        (-[WKScrollingNodeScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]):
        (-[WKScrollingNodeScrollViewDelegate cancelPointersForGestureRecognizer:]):
        (WebKit::ScrollingTreeScrollingNodeDelegateIOS::cancelPointersForGestureRecognizer):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::touchWithIdentifierWasRemoved):
        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/PageClientImplIOS.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::activeTouchIdentifierForGestureRecognizer):
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView preventsPanningInYAxis]):
        (-[WKContentView setupInteraction]):
        (-[WKContentView cleanupInteraction]):
        (-[WKContentView _removeDefaultGestureRecognizers]):
        (-[WKContentView _addDefaultGestureRecognizers]):
        (-[WKContentView activeTouchIdentifierForGestureRecognizer:]):
        (-[WKContentView _webTouchEventsRecognized:]):
        (-[WKContentView _resetPanningPreventionFlags]):
        (-[WKContentView _singleTapDidReset:]):
        (-[WKContentView _commitPotentialTapFailed]):
        (-[WKContentView _didCompleteSyntheticClick]):
        (-[WKContentView _singleTapRecognized:]):
        (-[WKContentView _didEndScrollingOrZooming]):
        * UIProcess/ios/WKSyntheticTapGestureRecognizer.h:
        * UIProcess/ios/WKSyntheticTapGestureRecognizer.mm:
        (-[WKSyntheticTapGestureRecognizer reset]):
        (-[WKSyntheticTapGestureRecognizer touchesEnded:withEvent:]):
        * UIProcess/ios/WKTouchActionGestureRecognizer.h:
        * UIProcess/ios/WKTouchActionGestureRecognizer.mm:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::touchWithIdentifierWasRemoved):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2020-03-09  Rob Buis  <rbuis@igalia.com>

        Rename urlSelected to changeLocation
        https://bugs.webkit.org/show_bug.cgi?id=208529

        Reviewed by Darin Adler.

        Adapt to API change.

        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit::PDFPlugin::clickedLink):
        * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
        (WebKit::WebContextMenuClient::searchWithGoogle):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::navigateToPDFLinkWithSimulatedClick):

2020-03-09  Jer Noble  <jer.noble@apple.com>

        Unreviewed build fix after r258129: include WebCore/SimpleRange.h where VisibleSelection is used.

        * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:

2020-03-09  Zan Dobersek  <zdobersek@igalia.com>

        [WPE] AsyncScrolling: scrolling with the mouse wheel over sub-scrollable areas scrolls the main frame
        https://bugs.webkit.org/show_bug.cgi?id=208635

        Reviewed by Carlos Garcia Campos.

        Rework the default values for the async frame and overflow scrolling
        so that the latter stays disabled for Nicosia-using ports as it
        undergoes bigger changes.

        * Shared/WebPreferencesDefaultValues.cpp:
        (WebKit::defaultAsyncFrameAndOverflowScrollingEnabled):
        (WebKit::defaultAsyncFrameScrollingEnabled):

2020-03-09  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] Surrounding text for input methods should not be limited to the current paragraph
        https://bugs.webkit.org/show_bug.cgi?id=208706

        Reviewed by Žan Doberšek.

        It should include all the text around the cursor position.

        * Shared/EditorState.cpp:
        (WebKit::EditorState::PostLayoutData::encode const): Rename paragraphContext* as surroundingContext*.
        (WebKit::EditorState::PostLayoutData::decode): Ditto.
        * Shared/EditorState.h:
        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (webkitWebViewBaseUpdateTextInputState): Ditto.
        * UIProcess/API/wpe/WPEView.cpp:
        (WKWPE::View::selectionDidChange): Ditto.
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::deleteSurrounding): Use content editable text as context instead of just paragraph.
        * WebProcess/WebPage/glib/WebPageGLib.cpp:
        (WebKit::WebPage::platformEditorState const): Ditto.

2020-03-07  Darin Adler  <darin@apple.com>

        Begin moving off of live ranges for WebKit internals
        https://bugs.webkit.org/show_bug.cgi?id=208432

        Reviewed by Daniel Bates.

        * Shared/EditingRange.cpp:
        (WebKit::EditingRange::fromRange): Initialize out arguments.

        * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp: Added include.
        * WebProcess/WebPage/FindController.cpp: Ditto.
        * WebProcess/WebPage/WebPage.cpp: Ditto.
        * WebProcess/WebPage/mac/WebPageMac.mm: Ditto.

2020-03-08  Wenson Hsieh  <wenson_hsieh@apple.com>

        CAN_SECURELY_ARCHIVE_FILE_WRAPPER incorrectly excludes watchOS and tvOS
        https://bugs.webkit.org/show_bug.cgi?id=208791

        Reviewed by Tim Horton.

        This is one of several places where a __IPHONE_OS_VERSION_MIN_REQUIRED check unintentionally caused a compiler
        flag to not be defined on watchOS, when it really should apply to all iOS family targets. Now that we don't
        care about building for any iOS family targets aligned with iOS 11 or prior, and also don't build for 10.13 and
        prior, we can simply remove the !CAN_SECURELY_ARCHIVE_FILE_WRAPPER codepath.

        * UIProcess/API/Cocoa/APIAttachmentCocoa.mm:
        (API::Attachment::createSerializedRepresentation const):
        (API::Attachment::updateFromSerializedRepresentation):

2020-03-08  Brent Fulgham  <bfulgham@apple.com>

        Revise In-App Browser Privacy checks to better reflect the meaning of the flag
        https://bugs.webkit.org/show_bug.cgi?id=208793
        <rdar://problem/60206256>

        Reviewed by John Wilander.

        The 'isInAppBrowserPrivacyEnabled' seems like a feature, but it's really an internal debugging flag.

        Revise the use of these calls to make it clearer.

        Tested by existing test cases.

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::sessionWrapperForTask):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::setIsNavigatingToAppBoundDomain):

2020-03-08  Brady Eidson  <beidson@apple.com>

        Remember completed subranges during incremental PDF loading.
        https://bugs.webkit.org/show_bug.cgi?id=208785

        Reviewed by Tim Horton.

        When a range request from a stream loader completes, we will now extend the main resource buffer
        to be large enough to hold that range, then we memcpy the data into the main buffer.
        
        We then keep a RangeSet to remember which ranges we've loaded.
        Any future range request that comes in we first check against that RangeSet to see if we can handle it from memory.
        
        This is a necessary optimization because PDFKit tends to ask for the same (or overlapping) ranges quite often.
        
        * WebProcess/Plugins/PDF/PDFPlugin.h:
        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit::PDFPlugin::ByteRangeRequest::completeWithAccumulatedData):
        (WebKit::PDFPlugin::ByteRangeRequest::maybeComplete):
        (WebKit::PDFPlugin::pdfDocumentDidLoad):
        (WebKit::PDFPlugin::manualStreamDidReceiveData):

2020-02-28  Jer Noble  <jer.noble@apple.com>

        [GPUP] Implement Legacy EME API in the GPU Process
        https://bugs.webkit.org/show_bug.cgi?id=208402

        Reviewed by Eric Carlson.

        Add support for RemoteLegacyCDMFactory, RemateLegacyCDM,RemoteLegacyCDMSession, and all
        of their associated Proxy objects.

        * DerivedSources-input.xcfilelist:
        * DerivedSources-output.xcfilelist:
        * DerivedSources.make:
        * GPUProcess/GPUConnectionToWebProcess.cpp:
        (WebKit::GPUConnectionToWebProcess::legacyCdmFactoryProxy):
        (WebKit::GPUConnectionToWebProcess::dispatchMessage):
        (WebKit::GPUConnectionToWebProcess::dispatchSyncMessage):
        * GPUProcess/GPUConnectionToWebProcess.h:
        * GPUProcess/media/RemoteLegacyCDMFactoryProxy.cpp: Added.
        (WebKit::RemoteLegacyCDMFactoryProxy::RemoteLegacyCDMFactoryProxy):
        (WebKit::RemoteLegacyCDMFactoryProxy::createCDM):
        (WebKit::RemoteLegacyCDMFactoryProxy::supportsKeySystem):
        (WebKit::RemoteLegacyCDMFactoryProxy::didReceiveCDMMessage):
        (WebKit::RemoteLegacyCDMFactoryProxy::didReceiveCDMSessionMessage):
        (WebKit::RemoteLegacyCDMFactoryProxy::didReceiveSyncCDMMessage):
        (WebKit::RemoteLegacyCDMFactoryProxy::didReceiveSyncCDMSessionMessage):
        (WebKit::RemoteLegacyCDMFactoryProxy::addProxy):
        (WebKit::RemoteLegacyCDMFactoryProxy::removeProxy):
        (WebKit::RemoteLegacyCDMFactoryProxy::addSession):
        (WebKit::RemoteLegacyCDMFactoryProxy::removeSession):
        (WebKit::RemoteLegacyCDMFactoryProxy::getSession const):
        * GPUProcess/media/RemoteLegacyCDMFactoryProxy.h: Added.
        * GPUProcess/media/RemoteLegacyCDMFactoryProxy.messages.in: Added.
        * GPUProcess/media/RemoteLegacyCDMProxy.cpp: Added.
        (WebKit::RemoteLegacyCDMProxy::create):
        (WebKit::RemoteLegacyCDMProxy::RemoteLegacyCDMProxy):
        (WebKit::RemoteLegacyCDMProxy::supportsMIMEType):
        (WebKit::RemoteLegacyCDMProxy::createSession):
        (WebKit::RemoteLegacyCDMProxy::setPlayerId):
        (WebKit::RemoteLegacyCDMProxy::cdmMediaPlayer const):
        * GPUProcess/media/RemoteLegacyCDMProxy.h: Added.
        (WebKit::RemoteLegacyCDMProxy::factory const):
        * GPUProcess/media/RemoteLegacyCDMProxy.messages.in: Added.
        * GPUProcess/media/RemoteLegacyCDMSessionProxy.cpp: Added.
        (WebKit::RemoteLegacyCDMSessionProxy::create):
        (WebKit::RemoteLegacyCDMSessionProxy::RemoteLegacyCDMSessionProxy):
        (WebKit::convertToUint8Array):
        (WebKit::convertToOptionalDataReference):
        (WebKit::RemoteLegacyCDMSessionProxy::generateKeyRequest):
        (WebKit::RemoteLegacyCDMSessionProxy::releaseKeys):
        (WebKit::RemoteLegacyCDMSessionProxy::update):
        (WebKit::RemoteLegacyCDMSessionProxy::getCachedKeyForKeyId):
        (WebKit::RemoteLegacyCDMSessionProxy::cachedKeyForKeyID):
        (WebKit::RemoteLegacyCDMSessionProxy::sendMessage):
        (WebKit::RemoteLegacyCDMSessionProxy::sendError):
        (WebKit::RemoteLegacyCDMSessionProxy::mediaKeysStorageDirectory const):
        * GPUProcess/media/RemoteLegacyCDMSessionProxy.h: Added.
        (WebKit::RemoteLegacyCDMSessionProxy::factory const):
        (WebKit::RemoteLegacyCDMSessionProxy::session const):
        (WebKit::RemoteLegacyCDMSessionProxy::setPlayer):
        * GPUProcess/media/RemoteLegacyCDMSessionProxy.messages.in: Added.
        * GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp:
        (WebKit::RemoteMediaPlayerManagerProxy::getProxy):
        * GPUProcess/media/RemoteMediaPlayerManagerProxy.h:
        * GPUProcess/media/RemoteMediaPlayerProxy.cpp:
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerCachedKeyForKeyId const):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerKeyNeeded):
        (WebKit::RemoteMediaPlayerProxy::setLegacyCDMSession):
        * GPUProcess/media/RemoteMediaPlayerProxy.h:
        * GPUProcess/media/RemoteMediaPlayerProxy.messages.in:
        * GPUProcess/media/RemoteTextTrackProxy.cpp:
        * GPUProcess/media/RemoteTextTrackProxy.h:
        * Scripts/webkit/messages.py:
        * Sources.txt:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/GPU/GPUProcessConnection.cpp:
        (WebKit::GPUProcessConnection::mediaPlayerManager):
        (WebKit::GPUProcessConnection::legacyCDMFactory):
        * WebProcess/GPU/GPUProcessConnection.h:
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
        (WebKit::MediaPlayerPrivateRemote::setCDM):
        (WebKit::MediaPlayerPrivateRemote::setCDMSession):
        (WebKit::MediaPlayerPrivateRemote::mediaPlayerKeyNeeded):
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.h:
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.messages.in:
        * WebProcess/GPU/media/RemoteLegacyCDM.cpp: Added.
        (WebKit::RemoteLegacyCDM::create):
        (WebKit::RemoteLegacyCDM::RemoteLegacyCDM):
        (WebKit::RemoteLegacyCDM::supportsMIMEType):
        (WebKit::RemoteLegacyCDM::createSession):
        (WebKit::RemoteLegacyCDM::setPlayerId):
        * WebProcess/GPU/media/RemoteLegacyCDM.h: Added.
        * WebProcess/GPU/media/RemoteLegacyCDMFactory.cpp: Added.
        (WebKit::RemoteLegacyCDMFactory::RemoteLegacyCDMFactory):
        (WebKit::RemoteLegacyCDMFactory::registerFactory):
        (WebKit::RemoteLegacyCDMFactory::supplementName):
        (WebKit::RemoteLegacyCDMFactory::gpuProcessConnection):
        (WebKit::RemoteLegacyCDMFactory::supportsKeySystem):
        (WebKit::RemoteLegacyCDMFactory::supportsKeySystemAndMimeType):
        (WebKit::RemoteLegacyCDMFactory::createCDM):
        (WebKit::RemoteLegacyCDMFactory::addSession):
        (WebKit::RemoteLegacyCDMFactory::removeSession):
        (WebKit::RemoteLegacyCDMFactory::findCDM const):
        (WebKit::RemoteLegacyCDMFactory::didReceiveSessionMessage):
        * WebProcess/GPU/media/RemoteLegacyCDMFactory.h: Added.
        * WebProcess/GPU/media/RemoteLegacyCDMIdentifier.h: Added.
        * WebProcess/GPU/media/RemoteLegacyCDMSession.cpp: Added.
        (WebKit::convertToArrayBuffer):
        (WebKit::convertToUint8Array):
        (WebKit::convertToOptionalDataReference):
        (WebKit::convertToDataReference):
        (WebKit::RemoteLegacyCDMSession::create):
        (WebKit::RemoteLegacyCDMSession::RemoteLegacyCDMSession):
        (WebKit::RemoteLegacyCDMSession::generateKeyRequest):
        (WebKit::RemoteLegacyCDMSession::releaseKeys):
        (WebKit::RemoteLegacyCDMSession::update):
        (WebKit::RemoteLegacyCDMSession::cachedKeyForKeyID const):
        (WebKit::RemoteLegacyCDMSession::sendMessage):
        (WebKit::RemoteLegacyCDMSession::sendError):
        * WebProcess/GPU/media/RemoteLegacyCDMSession.h: Added.
        * WebProcess/GPU/media/RemoteLegacyCDMSession.messages.in: Added.
        * WebProcess/GPU/media/RemoteLegacyCDMSessionIdentifier.h: Added.
        * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp:
        (WebKit::RemoteMediaPlayerManager::findRemotePlayerId):
        * WebProcess/GPU/media/RemoteMediaPlayerManager.h:
        * WebProcess/GPU/media/WebMediaStrategy.cpp:
        (WebKit::WebMediaStrategy::registerLegacyCDMFactories):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::updatePreferences):
        * WebProcess/WebProcess.cpp:

2020-03-08  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Mapping to UTI from tag and tag class should be performed in the UI process
        https://bugs.webkit.org/show_bug.cgi?id=208783

        Reviewed by Brent Fulgham.

        Send mapping from tag/tag class to UTI from the UI process to the WebContent process as part of the WebProcess
        creation parameters. Also, issue some mach-lookup extensions to the WebContent process if Accessibility is
        enabled.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const):
        (WebKit::WebProcessCreationParameters::decode):
        * Shared/WebProcessCreationParameters.h:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):

2020-03-08  Per Arne Vollan  <pvollan@apple.com>

        REGRESSION (r258064): API tests intermittently crashing under WebKit::registerDefaultsOverride
        https://bugs.webkit.org/show_bug.cgi?id=208784
        <rdar://problem/60201631>

        Reviewed by Darin Adler.

        Speculative crash fix; swizzle [NSUserDefaults registerDefaults:] on the main thread, instead of on a worker thread.

        No new tests, since I have not been able to reproduce this issue.

        * UIProcess/Cocoa/PreferenceObserver.h:
        * UIProcess/Cocoa/PreferenceObserver.mm:
        (registerDefaultsOverride):
        (+[WKPreferenceObserver swizzleRegisterDefaults]):
        (-[WKPreferenceObserver init]):
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitialize):

2020-03-08  Wenson Hsieh  <wenson_hsieh@apple.com>

        Lazily generate CGPaths for some simple types of paths, such as arcs and lines
        https://bugs.webkit.org/show_bug.cgi?id=208464
        <rdar://problem/59963226>

        Reviewed by Daniel Bates, Darin Adler and Tim Horton.

        Add argument coders for `WTF::Monostate`, so that Variants of the form: `Variant<Monostate, Foo, Bar>` can be
        encoded and decoded over IPC.

        * Platform/IPC/ArgumentCoders.cpp:
        (IPC::ArgumentCoder<Monostate>::encode):
        (IPC::ArgumentCoder<Monostate>::decode):
        * Platform/IPC/ArgumentCoders.h:

2020-03-08  Brady Eidson  <beidson@apple.com>

        Better stream loader management with incremental PDF loading.
        https://bugs.webkit.org/show_bug.cgi?id=208790

        Reviewed by Tim Horton.

        When a stream loader was completing normally, we were leaking it forever.
        This adds much better management of outstanding stream loaders
        (and logging to help verify the count is as expected)

        * WebProcess/Plugins/PDF/PDFPlugin.h:
        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit::PDFPlugin::getResourceBytesAtPosition):
        (WebKit::PDFPlugin::ByteRangeRequest::completeWithBytes):
        (WebKit::PDFPlugin::ByteRangeRequest::completeWithAccumulatedData):
        (WebKit::PDFPlugin::ByteRangeRequest::maybeComplete):
        (WebKit::PDFPlugin::ByteRangeRequest::completeUnconditionally):
        (WebKit::PDFPlugin::didReceiveResponse):
        (WebKit::PDFPlugin::didFinishLoading):
        (WebKit::PDFPlugin::forgetLoader):
        (WebKit::PDFPlugin::cancelAndForgetLoader):

2020-03-08  Konstantin Tokarev  <annulen@yandex.ru>

        [CMake] Some fixes for building Mac port
        https://bugs.webkit.org/show_bug.cgi?id=208770

        Reviewed by Don Olmstead.

        * PlatformMac.cmake:

2020-03-08  Andres Gonzalez  <andresg_22@apple.com>

        Implementation of AccessibilitySupport AXSIsolatedTreeMode.
        https://bugs.webkit.org/show_bug.cgi?id=208691
        <rdar://problem/60178602>

        Reviewed by Chris Fleizach.

        Honors system AccessibilitySupport IsolatedTreeMode setting.

        * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
        (-[WKAccessibilityWebPageObject accessibilityHitTest:]):

2020-03-08  Megan Gardner  <megan_gardner@apple.com>

        Build Fix Watch
        https://bugs.webkit.org/show_bug.cgi?id=208789

        Reviewed by Tim Horton.

        * UIProcess/ios/WKActionSheetAssistant.mm:
        * UIProcess/ios/forms/WKFileUploadPanel.mm:
        (-[WKFileUploadPanel dealloc]):
        (-[WKFileUploadPanel showDocumentPickerMenu]):

2020-03-08  Tim Horton  <timothy_horton@apple.com>

        Fix the watchOS build

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):

2020-03-08  Megan Gardner  <megan_gardner@apple.com>

        Build Fix
        https://bugs.webkit.org/show_bug.cgi?id=208787
        <rdar://problem/60203011>

        Reviewed by Tim Horton.

        * Platform/spi/ios/UIKitSPI.h:
        * UIProcess/ios/WKActionSheetAssistant.mm:
        * UIProcess/ios/forms/WKFileUploadPanel.mm:
        (-[WKFileUploadPanel showDocumentPickerMenu]):

2020-03-06  Jer Noble  <jer.noble@apple.com>

        [GPUP] Move AVSystemController code into the GPU process
        https://bugs.webkit.org/show_bug.cgi?id=208727

        Reviewed by Eric Carlson.

        Add a new class pair RemoteMediaSessionHelper/Proxy.

        * DerivedSources-input.xcfilelist:
        * DerivedSources-output.xcfilelist:
        * DerivedSources.make:
        * GPUProcess/GPUConnectionToWebProcess.cpp:
        (WebKit::GPUConnectionToWebProcess::mediaSessionHelperProxy):
        (WebKit::GPUConnectionToWebProcess::ensureMediaSessionHelper):
        * GPUProcess/GPUConnectionToWebProcess.h:
        * GPUProcess/GPUConnectionToWebProcess.messages.in:
        * GPUProcess/media/ios/RemoteMediaSessionHelperProxy.cpp: Added.
        (WebKit::RemoteMediaSessionHelperProxy::RemoteMediaSessionHelperProxy):
        (WebKit::RemoteMediaSessionHelperProxy::~RemoteMediaSessionHelperProxy):
        (WebKit::RemoteMediaSessionHelperProxy::startMonitoringWirelessRoutes):
        (WebKit::RemoteMediaSessionHelperProxy::stopMonitoringWirelessRoutes):
        (WebKit::RemoteMediaSessionHelperProxy::providePresentingApplicationPID):
        (WebKit::RemoteMediaSessionHelperProxy::receivedInterruption):
        (WebKit::RemoteMediaSessionHelperProxy::applicationWillEnterForeground):
        (WebKit::RemoteMediaSessionHelperProxy::applicationDidEnterBackground):
        (WebKit::RemoteMediaSessionHelperProxy::applicationWillBecomeInactive):
        (WebKit::RemoteMediaSessionHelperProxy::applicationDidBecomeActive):
        (WebKit::RemoteMediaSessionHelperProxy::externalOutputDeviceAvailableDidChange):
        (WebKit::RemoteMediaSessionHelperProxy::isPlayingToAutomotiveHeadUnitDidChange):
        (WebKit::RemoteMediaSessionHelperProxy::activeAudioRouteDidChange):
        (WebKit::RemoteMediaSessionHelperProxy::activeVideoRouteDidChange):
        * GPUProcess/media/ios/RemoteMediaSessionHelperProxy.h: Added.
        * GPUProcess/media/ios/RemoteMediaSessionHelperProxy.messages.in: Added.
        * Sources.txt:
        * SourcesCocoa.txt:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/GPU/media/ios/RemoteMediaSessionHelper.cpp: Added.
        (WebKit::RemoteMediaSessionHelper::RemoteMediaSessionHelper):
        (WebKit::RemoteMediaSessionHelper::connection):
        (WebKit::RemoteMediaSessionHelper::startMonitoringWirelessRoutes):
        (WebKit::RemoteMediaSessionHelper::stopMonitoringWirelessRoutes):
        (WebKit::RemoteMediaSessionHelper::providePresentingApplicationPID):
        (WebKit::RemoteMediaSessionHelper::receivedInterruption):
        (WebKit::RemoteMediaSessionHelper::applicationWillEnterForeground):
        (WebKit::RemoteMediaSessionHelper::applicationDidEnterBackground):
        (WebKit::RemoteMediaSessionHelper::applicationWillBecomeInactive):
        (WebKit::RemoteMediaSessionHelper::applicationDidBecomeActive):
        (WebKit::RemoteMediaSessionHelper::externalOutputDeviceAvailableDidChange):
        (WebKit::RemoteMediaSessionHelper::isPlayingToAutomotiveHeadUnitDidChange):
        (WebKit::RemoteMediaSessionHelper::activeAudioRouteDidChange):
        (WebKit::RemoteMediaSessionHelper::activeVideoRouteDidChange):
        * WebProcess/GPU/media/ios/RemoteMediaSessionHelper.h: Added.
        * WebProcess/GPU/media/ios/RemoteMediaSessionHelper.messages.in: Added.
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::setUseGPUProcessForMedia):

2020-03-08  Jer Noble  <jer.noble@apple.com>

        [GPUP] Null-dereference crash in GPUProcessProxy::openGPUProcessConnection()
        https://bugs.webkit.org/show_bug.cgi?id=208772

        Reviewed by Maciej Stachowiak.

        AuxiliaryProcessProxy::connection() will return a null-pointer if called before the remote
        process has launched and a connection established. Rather than send a message directly to
        the proxy's IPC::Connection object (which can be null), just call sendWithAsyncReply()
        directly on the proxy inself, which will correctly enqueue the message for sending when the
        connection is fully established.

        Because this crash occurs whenever the "useGPUProcessForMedia" setting is enabled, this is
        covered by existing WP2 tests when those tests are run with that setting enabled.

        * UIProcess/GPU/GPUProcessProxy.cpp:
        (WebKit::GPUProcessProxy::openGPUProcessConnection):

2020-03-08  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Canvas drawing commands have to be flushed to the GPUProcess in batches
        https://bugs.webkit.org/show_bug.cgi?id=208597

        Reviewed by Myles C. Maxfield.

        RemoteImageBuffer, which is a superclass of DisplayList::ImageBuffer, will
        prevent growing its DisplayList more than some limit (512 for now).
        When this limit is reached, the recoded DisplayListItems will be flushed to
        the GPUProcess in a batch. Flushing this batch would not require GPUProcess
        to reply back. RemoteImageBuffer will have to run a full flush anyway
        when the pixels are needed because the batch flushing does not include the
        current DisplayList::Item.

        * GPUProcess/graphics/RemoteImageBufferMessageHandlerProxy.h:
        * GPUProcess/graphics/RemoteImageBufferProxy.h:
        * GPUProcess/graphics/RemoteRenderingBackendProxy.cpp:
        (WebKit::RemoteRenderingBackendProxy::flushImageBufferDrawingContext):
        (WebKit::RemoteRenderingBackendProxy::flushImageBufferDrawingContextAndCommit):
        * GPUProcess/graphics/RemoteRenderingBackendProxy.h:
        * GPUProcess/graphics/RemoteRenderingBackendProxy.messages.in:
        * WebProcess/GPU/graphics/RemoteImageBuffer.h:
        * WebProcess/GPU/graphics/RemoteImageBufferMessageHandler.cpp:
        (WebKit::RemoteImageBufferMessageHandler::flushDrawingContext):
        (WebKit::RemoteImageBufferMessageHandler::flushDrawingContextAndWaitCommit):

2020-03-08  Konstantin Tokarev  <annulen@yandex.ru>

        [GTK] Fix compilation with disabled OpenGL
        https://bugs.webkit.org/show_bug.cgi?id=208773

        Reviewed by Yusuke Suzuki.

        * UIProcess/API/glib/WebKitProtocolHandler.cpp:
        (WebKit::WebKitProtocolHandler::handleGPU):

2020-03-08  Megan Gardner  <megan_gardner@apple.com>

        Adopt Context Menus for Data Detectors
        https://bugs.webkit.org/show_bug.cgi?id=208779

        Switch to context menus for data detector action sheets.

        Reviewed by Tim Horton.

        * UIProcess/ios/WKActionSheetAssistant.h:
        * UIProcess/ios/WKActionSheetAssistant.mm:
        (-[WKActionSheetAssistant removeContextMenuInteraction]):
        (-[WKActionSheetAssistant ensureContextMenuInteraction]):
        (-[WKActionSheetAssistant showDataDetectorsSheet]):
        (-[WKActionSheetAssistant contextMenuInteraction:configurationForMenuAtLocation:]):
        (-[WKActionSheetAssistant contextMenuInteraction:previewForHighlightingMenuWithConfiguration:]):
        (-[WKActionSheetAssistant _contextMenuInteraction:styleForMenuWithConfiguration:]):
        (-[WKActionSheetAssistant contextMenuInteraction:willEndForConfiguration:animator:]):
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView contextMenuDisplayLocationForActionSheetAssistant:]):

2020-03-07  Brent Fulgham  <bfulgham@apple.com>

        Create a flag to disable in-app browser quirks
        https://bugs.webkit.org/show_bug.cgi?id=208777
        <rdar://problem/60062197>

        Reviewed by Simon Fraser.

        This patch makes the following changes:

        1. Adds a new flag 'NeedsInAppBrowserPrivacyQuirks' to allow quirks to be toggled
           during testing.
        2. Reclassify this new flag, and the existing 'InAppBrowserPrivacyEnabled' flag from 
           'settings' to Internal Debug settings

        The renamed flags are covered by existing tests.

        * FeatureFlags/WebKit.plist:
        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:
        * Shared/WebPreferences.yaml:
        * Shared/WebPreferencesDefaultValues.cpp:
        (WebKit::defaultInAppBrowserPrivacy):
        (WebKit::defaultNeedsInAppBrowserPrivacyQuirks):
        * Shared/WebPreferencesDefaultValues.h:
        * UIProcess/API/Cocoa/WKPreferences.mm:
        (-[WKPreferences _needsInAppBrowserPrivacyQuirks]):
        (-[WKPreferences _setNeedsInAppBrowserPrivacyQuirks:]):
        * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
        * UIProcess/WebPageProxy.cpp:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::runJavaScript):
        * WebProcess/WebPage/WebPage.h:

2020-03-07  Simon Fraser  <simon.fraser@apple.com>

        Generalize setSynchronousScrollingReasons() to take a ScrollingNodeID
        https://bugs.webkit.org/show_bug.cgi?id=208774

        Reviewed by Zalan Bujtas.

        Whitespace.

        * WebProcess/WebPage/EventDispatcher.h:

2020-03-07  Brady Eidson  <beidson@apple.com>

        Make PDF range requests to the network.
        https://bugs.webkit.org/show_bug.cgi?id=208776

        Reviewed by Alex Christensen.

        We already handle a set of range requests from our data provider callbacks.
        The current strategy is "wait until we've streamed enough of the entire resource, 
        perform that request's callback"
        
        For linearized PDFs the second request ever made is for the very end of the PDF document,
        so we have to wait for the entire document to load (which is what we already do in non-incremental mode)
        
        Now, we'll actually make the requests for missing data chunks from the network by using the document's request
        and adding range headers.
        
        While it is now entirely misnamed, NetscapePlugInStreamLoader is a perfect fit for this.
        
        Once the range request completes from the network we can unblock the PDF thread and go to the next request.

        * WebProcess/Plugins/PDF/PDFPlugin.h:
        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit::PDFPlugin::unconditionalCompleteOutstandingRangeRequests):
        (WebKit::PDFPlugin::getResourceBytesAtPosition):
        (WebKit::PDFPlugin::ByteRangeRequest::clearStreamLoader):
        (WebKit::PDFPlugin::ByteRangeRequest::completeWithBytes):
        (WebKit::PDFPlugin::ByteRangeRequest::completeWithAccumulatedData):
        (WebKit::PDFPlugin::ByteRangeRequest::maybeComplete):
        (WebKit::PDFPlugin::ByteRangeRequest::completeUnconditionally):
        (WebKit::PDFPlugin::willSendRequest):
        (WebKit::PDFPlugin::didReceiveResponse):
        (WebKit::PDFPlugin::didReceiveData):
        (WebKit::PDFPlugin::didFail):
        (WebKit::PDFPlugin::didFinishLoading):
        (WebKit::PDFPlugin::byteRangeRequestForLoader):
        (WebKit::PDFPlugin::cancelAndForgetLoader):
        (WebKit::PDFPlugin::manualStreamDidReceiveData):
        (WebKit::PDFPlugin::unconditionalCompleteRangeRequest): Deleted.

2020-03-07  David Quesada  <david_quesada@apple.com>

        Crash in -[_WKRemoteObjectRegistry _invokeMethod:] block when calling a reply block after the web view has deallocated
        https://bugs.webkit.org/show_bug.cgi?id=208781
        rdar://problem/60061016

        Reviewed by Alex Christensen.

        Covered by API tests.

        * Shared/API/Cocoa/_WKRemoteObjectRegistry.mm:
        (-[_WKRemoteObjectRegistry _invokeMethod:]):
            When the app calls a reply block for a message from the injected bundle, add a nil
            check for the underlying WebKit::RemoteObjectRegistry before attempting to send the
            reply details back to the web process. It's possible that before this block is
            called, the associated web view could have been deallocated, which would invalidate
            this _WKRemoteObjectRegistry.

2020-03-07  Megan Gardner  <megan_gardner@apple.com>

        Adopt UIContextMenu for WKFileUploadPanel
        https://bugs.webkit.org/show_bug.cgi?id=208687

        Reviewed by Tim Horton.

        Move from the depricated UIDocumentMenuViewController to UIContextMenu.
        UI change, not currently testable.

        * Platform/spi/ios/UIKitSPI.h:
        * UIProcess/ios/forms/WKFileUploadPanel.mm:
        (-[WKFileUploadPanel dealloc]):
        (-[WKFileUploadPanel presentWithParameters:resultListener:]):
        (-[WKFileUploadPanel dismiss]):
        (-[WKFileUploadPanel _browseFilesButtonLabel]):
        (-[WKFileUploadPanel contextMenuInteraction:previewForHighlightingMenuWithConfiguration:]):
        (-[WKFileUploadPanel _contextMenuInteraction:styleForMenuWithConfiguration:]):
        (-[WKFileUploadPanel contextMenuInteraction:configurationForMenuAtLocation:]):
        (-[WKFileUploadPanel contextMenuInteraction:willEndForConfiguration:animator:]):
        (-[WKFileUploadPanel _removeInteraction]):
        (-[WKFileUploadPanel _initInteraction]):
        (-[WKFileUploadPanel _showFilePickerMenu]):
        (-[WKFileUploadPanel _showDocumentPickerMenu]):
        (-[WKFileUploadPanel _presentPopoverWithContentViewController:animated:]):
        (-[WKFileUploadPanel _presentFullscreenViewController:animated:]):
        (photoLibraryIcon): Deleted.
        (cameraIcon): Deleted.
        (-[WKFileUploadPanel documentMenu:didPickDocumentPicker:]): Deleted.
        (-[WKFileUploadPanel documentMenuWasCancelled:]): Deleted.

2020-03-07  Peng Liu  <peng.liu6@apple.com>

        Use the feature flags mechanism to give default feature preference values
        https://bugs.webkit.org/show_bug.cgi?id=208607

        Reviewed by Simon Fraser.

        Fix a Catalyst build failure (We should not copy the WebKit.plist for the Catalyst build).

        * WebKit.xcodeproj/project.pbxproj:

2020-03-07  Daniel Bates  <dabates@apple.com>

        [iOS] Implement support for dictation alternatives
        https://bugs.webkit.org/show_bug.cgi?id=208720
        <rdar://problem/58540114>

        Reviewed by Brady Eidson.

        Part 4

        This patch was originally written by Morgan Winer. I just simplified it a bit and fixed some
        formatting issues to conform to the code style guidelines.

        Note that I haven't enable USE_DICTATION_ALTERNATIVES on iOS. So, this code isn't being
        compiled for iOS. I will do that in a subsequent change once after all the code is in place
        to do so.

        * Platform/spi/ios/UIKitSPI.h: Expose more SPI.
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView insertText:alternatives:style:]): Added.

2020-03-07  Daniel Bates  <dabates@apple.com>

        [iOS] Implement support for dictation alternatives
        https://bugs.webkit.org/show_bug.cgi?id=208720
        <rdar://problem/58540114>

        Reviewed by Brent Fulgham.

        Part 3

        Move code that was guarded under PLATFORM(MAC) outside of that guard so that we compile it
        so long as USE(DICTATION_ALTERNATIVES) is enabled.

        Note that I haven't enable USE_DICTATION_ALTERNATIVES on iOS. So, this code isn't being
        compiled for iOS. I will do that in a subsequent change once after all the code is in place
        to do so.

        * UIProcess/PageClient.h:
        * UIProcess/WebPageProxy.cpp:
        * UIProcess/WebPageProxy.h:

2020-03-07  Daniel Bates  <dabates@apple.com>

        [iOS] Implement support for dictation alternatives
        https://bugs.webkit.org/show_bug.cgi?id=208720
        <rdar://problem/58540114>

        Reviewed by Wenson Hsieh.

        Part 2

        Move insertDictatedTextAsync() from the Mac-specific implementation files to Cocoa-specific
        implementation files as it can be shared by both Mac and iOS. I did very minor C++ modernization:
        just more uses of auto and uniform initializer syntax.

        Note that I haven't enable USE_DICTATION_ALTERNATIVES on iOS. So, this code isn't being
        compiled for iOS. I will do that in a subsequent change once after all the code is in place
        to do so.

        * UIProcess/Cocoa/WebPageProxyCocoa.mm:
        (WebKit::WebPageProxy::insertDictatedTextAsync):
        * UIProcess/WebPageProxy.cpp:
        * UIProcess/WebPageProxy.h:
        * UIProcess/mac/WebPageProxyMac.mm:
        (WebKit::WebPageProxy::insertDictatedTextAsync): Deleted.
        * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
        (WebKit::WebPage::insertDictatedTextAsync):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/mac/WebPageMac.mm:
        (WebKit::WebPage::insertDictatedTextAsync): Deleted.

2020-03-07  Daniel Bates  <dabates@apple.com>

        [iOS] Implement support for dictation alternatives
        https://bugs.webkit.org/show_bug.cgi?id=208720
        <rdar://problem/58540114>

        Reviewed by Wenson Hsieh.

        Part 1

        Move some of the PageClientMac dictation alternatives code to PageClientImplCocoa so that it
        can be shared with iOS.

        Note that I haven't enable USE_DICTATION_ALTERNATIVES on iOS. So, this code isn't being
        compiled for iOS. I will do that in a subsequent change once after all the code is in place
        to do so.

        * UIProcess/Cocoa/PageClientImplCocoa.h:
        (WebKit::PageClientImplCocoa::PageClientImplCocoa): Deleted; moved to be out-of-line to avoid
        needing to #include AlternativeTextUIController.h from this file. Declare out-of-line destructor
        for the same reason.
        * UIProcess/Cocoa/PageClientImplCocoa.mm:
        (WebKit::PageClientImplCocoa::PageClientImplCocoa): Moved from PageClientImplCocoa.h.
        (WebKit::PageClientImplCocoa::pageClosed):
        (WebKit::PageClientImplCocoa::addDictationAlternatives): Moved from PageClientImplMac.mm.
        (WebKit::PageClientImplCocoa::removeDictationAlternatives): Ditto.
        (WebKit::PageClientImplCocoa::dictationAlternatives): Ditto.
        * UIProcess/PageClient.h:
        * UIProcess/ios/PageClientImplIOS.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::showDictationAlternativeUI): Added; stub function.
        (WebKit::PageClientImpl::pageClosed): Deleted; now we will use the base class implementation.
        * UIProcess/mac/PageClientImplMac.h:
        * UIProcess/mac/PageClientImplMac.mm:
        (WebKit::PageClientImpl::PageClientImpl): Moved AlternativeTextUIController logic from here to PageClientImplCocoa::PageClientImplCocoa().
        (WebKit::PageClientImpl::pageClosed): Moved AlternativeTextUIController logic from here to PageClientImplCocoa::pageClosed()
        so it can be shared and modified this function to call the base class implementation.
        (WebKit::PageClientImpl::~PageClientImpl): Deleted; moved to PageClientImplCocoa.mm.
        (WebKit::PageClientImpl::addDictationAlternatives): Deleted; moved to PageClientImplCocoa.mm.
        (WebKit::PageClientImpl::removeDictationAlternatives): Deleted; moved to PageClientImplCocoa.mm.
        (WebKit::PageClientImpl::dictationAlternatives): Deleted; moved to PageClientImplCocoa.mm.

2020-03-07  Eric Carlson  <eric.carlson@apple.com>

        Implement setWirelessPlaybackTarget, performTaskAtMediaTime, and wouldTaintOrigin in GPUProcess
        https://bugs.webkit.org/show_bug.cgi?id=208651
        <rdar://problem/60088298>

        Reviewed by Youenn Fablet.

        * GPUProcess/GPUConnectionToWebProcess.cpp:
        (WebKit::GPUConnectionToWebProcess::dispatchSyncMessage): Dispatch player manager messages.

        * GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp:
        (WebKit::RemoteMediaPlayerManagerProxy::didReceiveSyncPlayerMessage): Dispatch player messages.
        * GPUProcess/media/RemoteMediaPlayerManagerProxy.h:

        * GPUProcess/media/RemoteMediaPlayerProxy.cpp:
        (WebKit::RemoteMediaPlayerProxy::~RemoteMediaPlayerProxy): Clear the completion handler
        do its destructor doesn't assert.
        (WebKit::RemoteMediaPlayerProxy::setWirelessPlaybackTarget): Implement.
        (WebKit::RemoteMediaPlayerProxy::performTaskAtMediaTime): Ditto.
        (WebKit::RemoteMediaPlayerProxy::wouldTaintOrigin): Ditto.
        * GPUProcess/media/RemoteMediaPlayerProxy.h:
        * GPUProcess/media/RemoteMediaPlayerProxy.messages.in:

        * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
        (WebKit::MediaPlayerPrivateRemote::updateCachedState): Update wireless playback target name.
        (WebKit::MediaPlayerPrivateRemote::load): Don't log as unimplemented.
        (WebKit::MediaPlayerPrivateRemote::wirelessPlaybackTargetName const): Return cached name.
        (WebKit::MediaPlayerPrivateRemote::setWirelessPlaybackTarget): Implement.
        (WebKit::MediaPlayerPrivateRemote::wouldTaintOrigin const): Ditto.
        (WebKit::MediaPlayerPrivateRemote::performTaskAtMediaTime): Ditto.
        (WebKit::MediaPlayerPrivateRemote::setClosedCaptionsVisible): Deleted, not needed.
        (WebKit::MediaPlayerPrivateRemote::simulateAudioInterruption): Ditto.
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.h:

        * WebProcess/GPU/media/RemoteMediaPlayerConfiguration.h:
        (WebKit::RemoteMediaPlayerConfiguration::decode): Decode supportsFullscreen too.

2020-03-07  Brady Eidson  <beidson@apple.com>

        Add runtime flag for incremental PDF loading.
        https://bugs.webkit.org/show_bug.cgi?id=208763

        Reviewed by Tim Horton.

        * Shared/WebPreferences.yaml:
        * Shared/WebPreferencesDefaultValues.cpp:
        (WebKit::defaultIncrementalPDFEnabled):
        * Shared/WebPreferencesDefaultValues.h:
        
        * WebProcess/Plugins/PDF/PDFPlugin.h:
        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit::PDFPlugin::PDFPlugin):
        (WebKit::PDFPlugin::pdfDocumentDidLoad):
        (WebKit::PDFPlugin::manualStreamDidReceiveData):
        (WebKit::PDFPlugin::manualStreamDidFail):

2020-03-05  Sam Weinig  <weinig@apple.com>

        Move JavaScriptCore related feature defines from FeatureDefines.xcconfig to PlatformEnableCocoa.h
        https://bugs.webkit.org/show_bug.cgi?id=207436
        <rdar://problem/59296762>

        Reviewed by Darin Adler.

        * Configurations/FeatureDefines.xcconfig:
        Remove JSC related defines.

2020-03-07  Jer Noble  <jer.noble@apple.com>

        Unreviewed unified build fix; forward declare referenced types. In this case, WebCore::ImageData.

        * WebProcess/GPU/graphics/RemoteImageBufferMessageHandler.h:

2020-03-07  Myles C. Maxfield  <mmaxfield@apple.com>

        [GPU Process] Implement CanvasRenderingContext2D.getImageData()
        https://bugs.webkit.org/show_bug.cgi?id=208560
        <rdar://problem/60060618>

        Reviewed by Said Abou-Hallawa.

        Adds a new synchronous message between the Web Process and the GPU Process.
        Unfortunately, getImageData() synchronously returns results, and we don't
        have the infrastructure to make JavaScript interruptible, so this means that
        the message has to be synchronous, at least until we add that infrastructure.

        When the RemoteImageBuffer receives the getImageData() call, it first
        asynchronously flushes the pending display list, doesn't wait for a response, 
        and then sends the synchronous getImageData() message. Because the GPU Process
        receives messages in-order, the Web Process doesn't have to wait for the
        response from the flush message.

        After this patch, there are a few optimization opportunities we can exploit
        where we use SharedBuffer directly instead of copying into and out of the
        ImageData.

        No new tests because there is no behavior change. We're just using the GPU
        process now, instead of implementing the command locally in the Web Process.

        * GPUProcess/graphics/RemoteImageBufferMessageHandlerProxy.h:
        * GPUProcess/graphics/RemoteImageBufferProxy.h:
        * GPUProcess/graphics/RemoteRenderingBackendProxy.cpp:
        (WebKit::RemoteRenderingBackendProxy::getImageData):
        * GPUProcess/graphics/RemoteRenderingBackendProxy.h:
        * GPUProcess/graphics/RemoteRenderingBackendProxy.messages.in:
        * Platform/IPC/ImageDataReference.h: Added.
        (IPC::ImageDataReference::ImageDataReference):
        (IPC::ImageDataReference::buffer):
        (IPC::ImageDataReference::buffer const):
        (IPC::ImageDataReference::encode const):
        (IPC::ImageDataReference::decode):
        * Platform/IPC/MessageSender.h:
        (IPC::MessageSender::sendSync):
        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<RefPtr<WebCore::ImageData>>::encode):
        (IPC::ArgumentCoder<RefPtr<WebCore::ImageData>>::decode):
        * Shared/WebCoreArgumentCoders.h:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/GPU/graphics/RemoteImageBuffer.h:
        * WebProcess/GPU/graphics/RemoteImageBufferMessageHandler.cpp:
        (WebKit::RemoteImageBufferMessageHandler::getImageData const):
        (WebKit::RemoteImageBufferMessageHandler::flushDrawingContext):
        (WebKit::RemoteImageBufferMessageHandler::flushDrawingContextAndWaitCommit):
        * WebProcess/GPU/graphics/RemoteImageBufferMessageHandler.h:

2020-03-07  chris fleizach  <cfleizach@apple.com>

        Unreviewed, rolling out r258047.

        Referenced SPI not yet available for Safari builders.

        Reverted changeset:

        "Implementation of AccessibilitySupport AXSIsolatedTreeMode."
        https://bugs.webkit.org/show_bug.cgi?id=208691
        https://trac.webkit.org/changeset/258047

2020-03-06  Per Arne Vollan  <pvollan@apple.com>

        [Cocoa] Re-enable CFPrefs direct mode
        https://bugs.webkit.org/show_bug.cgi?id=208690

        Reviewed by Brent Fulgham.

        This patch re-enabled CF prefs direct mode on iOS and macOS, and addresses performance issues and Accessibility issues
        with the original patch. Performance issues are addressed by creating the NSUserDefaults objects in the UI process on
        a non-main thread, while the Accessibility issues are fixed by issuing an extension to the preferences service when
        Accessibility is enabled.

        API test: WebKit.GrantAccessPreferencesService

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const):
        (WebKit::WebProcessCreationParameters::decode):
        * Shared/WebProcessCreationParameters.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _grantAccessToPreferenceService]):
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/Cocoa/PreferenceObserver.mm:
        (registerDefaultsOverride):
        (-[WKUserDefaults _notifyObserversOfChangeFromValuesForKeys:toValuesForKeys:]):
        (-[WKPreferenceObserver init]):
        * UIProcess/Cocoa/WebPageProxyCocoa.mm:
        (WebKit::WebPageProxy::grantAccessToPreferenceService):
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitialize):
        (WebKit::WebProcessPool::platformResolvePathsForSandboxExtensions):
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        (WebKit::WebProcessPool::registerNotificationObservers):
        * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
        (WebKit::WebProcessProxy::unblockAccessibilityServerIfNeeded):
        (WebKit::WebProcessProxy::unblockPreferenceServiceIfNeeded):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::didFinishLaunching):
        * UIProcess/WebProcessProxy.h:
        * UIProcess/ios/WebProcessProxyIOS.mm:
        (WebKit::WebProcessProxy::unblockAccessibilityServerIfNeeded): Deleted.
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::unblockAccessibilityServer): Deleted.
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):
        (WebKit::WebProcess::platformInitializeProcess):
        (WebKit::WebProcess::unblockPreferenceService):
        (WebKit::WebProcess::unblockAccessibilityServer):
        * WebProcess/com.apple.WebProcess.sb.in:

2020-03-06  Kate Cheney  <katherine_cheney@apple.com>

        UIProcess needs mechanism to specify AppBound domains
        https://bugs.webkit.org/show_bug.cgi?id=208528
        <rdar://problem/59980340>

        Reviewed by Brent Fulgham.

        Adds functionality to read app-bound domains from the Info.plist on
        background thread via the WebFramePolicyListenerProxy and report
        whether a domain is app-bound. 

        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _appBoundDomains:]):
        * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
        Test API call to get appBoundDomains.

        * UIProcess/WebFramePolicyListenerProxy.cpp:
        (WebKit::WebFramePolicyListenerProxy::WebFramePolicyListenerProxy):
        (WebKit::WebFramePolicyListenerProxy::didReceiveAppBoundDomainResult):
        (WebFramePolicyListenerProxy::didReceiveSafeBrowsingResults):
        (WebFramePolicyListenerProxy::use):
        (WebFramePolicyListenerProxy::download):
        (WebFramePolicyListenerProxy::ignore):
        * UIProcess/WebFramePolicyListenerProxy.h:
        (WebKit::WebFramePolicyListenerProxy::create):
        * UIProcess/WebFrameProxy.cpp:
        (WebKit::WebFrameProxy::setUpPolicyListenerProxy):
        * UIProcess/WebFrameProxy.h:
        * UIProcess/WebPageProxy.cpp:
        Added a new function to WebFramePolicyListenerProxy to wait for the
        app-bound domains to be read before completing a navigation. Each
        other function must now check if m_isNavigatingToAppBoundDomain has
        been set before sending a full reply. Also added an enum class
        ShouldExpectAppBoundDomainResult to tell the listener not to wait for
        the results in unecessary cases.

        (WebKit::WebPageProxy::isAppBoundDomain const): Deleted
        (WebKit::WebPageProxy::setIsNavigatingToAppBoundDomain):
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
        After the listener responds with the results, set the new
        value in WebPageProxy. We no longer need to check for isAppBound
        domain now that we have received the value.

        (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
        (WebKit::WebPageProxy::decidePolicyForResponseShared):
        No need to listen for app-bound domain response here.

        * UIProcess/WebPageProxy.h:
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::appBoundDomains):
        (WebKit::appBoundDomainQueue):
        Add a separate static queue for reading app-bound domains to avoid
        raciness.

        (WebKit::WebsiteDataStore::beginAppBoundDomainCheck):
        (WebKit::WebsiteDataStore::getAppBoundDomainsForTesting):
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        Read the app-bound domain list on the background thread, and once
        done, call the listener on the main thread.

2020-03-06  David Kilzer  <ddkilzer@apple.com>

        IPC hardening for WebPageProxy::SaveImageToLibrary message
        <https://webkit.org/b/208730>
        <rdar://problem/58700693>

        Reviewed by Chris Dumez.

        * UIProcess/ios/WebPageProxyIOS.mm:
        (MESSAGE_CHECK): Define macro only for methods in this source file.
        (WebKit::WebPageProxy::saveImageToLibrary):
        - Make sure the shared memory handle sent over IPC is not null.
        - Make sure the image size sent over IPC is not zero.
        - Null check the SharedMemory object after calling
          SharedMemory::map().

2020-03-06  Alex Christensen  <achristensen@webkit.org>

        Add SPI to disable cross origin access control checks
        https://bugs.webkit.org/show_bug.cgi?id=208748
        <rdar://problem/59861114>

        Reviewed by Tim Hatcher.

        * NetworkProcess/NetworkCORSPreflightChecker.cpp:
        (WebKit::NetworkCORSPreflightChecker::NetworkCORSPreflightChecker):
        (WebKit::NetworkCORSPreflightChecker::didCompleteWithError):
        * NetworkProcess/NetworkCORSPreflightChecker.h:
        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::NetworkLoadChecker):
        (WebKit::NetworkLoadChecker::validateResponse):
        (WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
        * NetworkProcess/NetworkLoadChecker.h:
        * NetworkProcess/NetworkResourceLoadParameters.cpp:
        (WebKit::NetworkResourceLoadParameters::encode const):
        (WebKit::NetworkResourceLoadParameters::decode):
        * NetworkProcess/NetworkResourceLoadParameters.h:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::crossOriginAccessControlCheckEnabled const):
        * NetworkProcess/NetworkResourceLoader.h:
        * NetworkProcess/PingLoad.cpp:
        (WebKit::PingLoad::PingLoad):
        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:
        * UIProcess/API/APIPageConfiguration.cpp:
        (API::PageConfiguration::copy const):
        * UIProcess/API/APIPageConfiguration.h:
        (API::PageConfiguration::crossOriginAccessControlCheckEnabled const):
        (API::PageConfiguration::setCrossOriginAccessControlCheckEnabled):
        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
        (-[WKWebViewConfiguration _setCrossOriginAccessControlCheckEnabled:]):
        (-[WKWebViewConfiguration _crossOriginAccessControlCheckEnabled]):
        * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
        * UIProcess/WebPageProxy.cpp:
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::addParametersShared):
        (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
        (WebKit::WebLoaderStrategy::loadResourceSynchronously):
        (WebKit::WebLoaderStrategy::startPingLoad):
        (WebKit::addParametersFromFrame): Deleted.
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_processDisplayName):

2020-03-06  Myles C. Maxfield  <mmaxfield@apple.com>

        [GPU Process] Implement CanvasRenderingContext2D.putImageData()
        https://bugs.webkit.org/show_bug.cgi?id=208621
        <rdar://problem/60068047>

        Reviewed by Simon Fraser.

        * GPUProcess/graphics/RemoteImageBufferProxy.h:
        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<Ref<WebCore::SharedBuffer>>::encode):
        (IPC::ArgumentCoder<Ref<WebCore::SharedBuffer>>::decode):
        (IPC::ArgumentCoder<Ref<WebCore::ImageData>>::encode):
        (IPC::ArgumentCoder<Ref<WebCore::ImageData>>::decode):
        * Shared/WebCoreArgumentCoders.h:
        * WebProcess/GPU/graphics/RemoteImageBuffer.h:
        (WebKit::RemoteImageBuffer::putImageData):

2020-03-06  Daniel Bates  <dabates@apple.com>

        Add support for inserting and removing a text placeholder
        https://bugs.webkit.org/show_bug.cgi?id=208661
        <rdar://problem/59371073>

        Reviewed by Simon Fraser and Ryosuke Niwa.

        Implements the UITextInput protocol functions -insertTextPlaceholderWithSize and -removeTextPlaceholder.

        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView insertTextPlaceholderWithSize:completionHandler:]):
        (-[WKContentView removeTextPlaceholder:willInsertText:completionHandler:]):
        Implement more of the UITextInput protocol. These functions turn around and call
        the corresponding WebPageProxy functions.

        * UIProcess/ios/WKTextPlaceholder.h:
        * UIProcess/ios/WKTextPlaceholder.mm: Added.
        (-[WKTextPlaceholder initWithElementContext:]):
        (-[WKTextPlaceholder elementContext]):
        (-[WKTextPlaceholder rects]):
        * UIProcess/ios/WKTextSelectionRect.h: Remove an unncessary #pragma once since I am here.
        This file is only included from Objective-C/C++ files so that #pragma is unnecessary.

        * UIProcess/ios/WKTextSelectionRect.mm:
        (-[WKTextSelectionRect initWithCGRect:]): Added.
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::insertTextPlaceholder): Added
        (WebKit::WebPageProxy::removeTextPlaceholder): Added.
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in: Add new messages to insert and remove a placeholder.
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::insertTextPlaceholder):
        (WebKit::WebPage::removeTextPlaceholder):
        Turn around and call the corresponding Editor functions.

2020-03-06  Andres Gonzalez  <andresg_22@apple.com>

        Implementation of AccessibilitySupport AXSIsolatedTreeMode.
        https://bugs.webkit.org/show_bug.cgi?id=208691

        Reviewed by Chris Fleizach.

        * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
        (-[WKAccessibilityWebPageObject accessibilityHitTest:]):
        Honors AXIsolatedTreeMode setting.

2020-03-06  Simon Fraser  <simon.fraser@apple.com>

        Hit-test CALayers on the scrolling thread for async frame/overflow scrolling
        https://bugs.webkit.org/show_bug.cgi?id=208740
        <rdar://problem/48028836>

        Reviewed by Tim Horton.

        Make sure that each call to eventSender.monitorWheelEvents() clears previous state.

        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
        (WKBundlePageStartMonitoringScrollOperations):

2020-03-06  Brady Eidson  <beidson@apple.com>

        Some PDFPlugin cleanup in prep for incremental loading.
        https://bugs.webkit.org/show_bug.cgi?id=208698

        Reviewed by Alex Christensen.

        - The frame is never cleared, so make it a reference.
        - Use a new "number of streamed bytes" variable instead of grabbing m_data's length, 
          as m_data will soon become a "sparse" data buffer

        Refactor only.

        * WebProcess/Plugins/PDF/PDFPlugin.h:
        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit::PDFPlugin::PDFPlugin):
        (WebKit::PDFPlugin::unconditionalCompleteRangeRequest):
        (WebKit::PDFPlugin::getResourceBytesAtPosition):
        (WebKit::PDFPlugin::updateScrollbars):
        (WebKit::PDFPlugin::createScrollbar):
        (WebKit::PDFPlugin::isActive const):
        (WebKit::PDFPlugin::forceUpdateScrollbarsOnMainThreadForPerformanceTesting const):
        (WebKit::PDFPlugin::jsPDFDocPrint):
        (WebKit::PDFPlugin::installPDFDocument):
        (WebKit::PDFPlugin::streamDidReceiveData):
        (WebKit::PDFPlugin::manualStreamDidReceiveData):
        (WebKit::PDFPlugin::updatePageAndDeviceScaleFactors):
        (WebKit::PDFPlugin::willDetachRenderer):
        (WebKit::PDFPlugin::destroy):
        (WebKit::PDFPlugin::paintControlForLayerInContext):
        (WebKit::PDFPlugin::convertFromPDFViewToScreen const):
        (WebKit::PDFPlugin::boundsOnScreen const):
        (WebKit::PDFPlugin::showContextMenuAtPoint):
        (WebKit::PDFPlugin::handleContextMenuEvent):
        (WebKit::PDFPlugin::isFullFramePlugin const):
        (WebKit::PDFPlugin::handlesPageScaleFactor const):
        (WebKit::PDFPlugin::clickedLink):
        (WebKit::PDFPlugin::saveToPDF):
        (WebKit::PDFPlugin::openWithNativeApplication):
        (WebKit::PDFPlugin::showDefinitionForAttributedString):
        (WebKit::PDFPlugin::notifySelectionChanged):
        (WebKit::PDFPlugin::notifyCursorChanged):
        (WebKit::PDFPlugin::axObjectCache const):
        (WebKit::PDFPlugin::performWebSearch):
        (WebKit::PDFPlugin::performSpotlightSearch):

2020-03-06  Alex Christensen  <achristensen@webkit.org>

        Evaluating JavaScript in main frame before loading should succeed
        https://bugs.webkit.org/show_bug.cgi?id=208733

        Reviewed by Tim Horton.

        This fixes a bug in the SPI I introduced in r257882 with a test.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _evaluateJavaScript:asAsyncFunction:withArguments:forceUserGesture:inFrame:inWorld:completionHandler:]):

2020-03-06  Brent Fulgham  <bfulgham@apple.com>

        Expand the feature flags mechanism with additional default feature preference values
        https://bugs.webkit.org/show_bug.cgi?id=208737
        <rdar://problem/60109390>

        Reviewed by Simon Fraser.

        No new tests, no functional change.

        Update the new default feature preference implementation with additional flags
        that would benefit from this approach.

        * FeatureFlags/WebKit.plist:
        * Shared/WebPreferences.yaml:
        * Shared/WebPreferencesDefaultValues.cpp:
        (WebKit::defaultInAppBrowserPrivacy):
        (WebKit::defaultWebGPUEnabled):
        * Shared/WebPreferencesDefaultValues.h:

2020-03-06  Jer Noble  <jer.noble@apple.com>

        [GPUP] Convert CDMFactory away from platformStrategies() and use WebProcess settings instead
        https://bugs.webkit.org/show_bug.cgi?id=208699

        Reviewed by Youenn Fablet.

        Since platformStrategies() is entirely absent in the UIProcess and GPUProcesses, with no
        intention of adding strategies there, it must be possible to retain the default behavior
        of WebCore objects. To that end, rather than require clients to implement a MediaStrategy
        method in order to register CDMFactory objects, simply replace the factories at runtime
        when necessary, and only in those processes where such a replacement is necessary.

        * WebProcess/GPU/media/WebMediaStrategy.cpp:
        (WebKit::WebMediaStrategy::registerCDMFactories): Deleted.
        * WebProcess/GPU/media/WebMediaStrategy.h:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::setUseGPUProcessForMedia):

2020-03-06  Jer Noble  <jer.noble@apple.com>

        Unreviewed unified build fix; Include what you use, in this case: FrameInfoData.h.

        * WebProcess/WebAuthentication/WebAuthenticatorCoordinator.cpp:

2020-03-06  Peng Liu  <peng.liu6@apple.com>

        [GPUP] Enable Picture-in-Picture support on Mac
        https://bugs.webkit.org/show_bug.cgi?id=208732

        Reviewed by Eric Carlson.

        Covered by existing tests.

        RemoteMediaPlayerProxy needs to send "hasVideo" state to MediaPlayerPrivateRemote
        in the Web process in order to enable the Picture-in-Picture mode support (on Mac).

        * GPUProcess/media/RemoteMediaPlayerProxy.cpp:
        (WebKit::RemoteMediaPlayerProxy::updateCachedState):

2020-03-06  Peng Liu  <peng.liu6@apple.com>

        Use the feature flags mechanism to give default feature preference values
        https://bugs.webkit.org/show_bug.cgi?id=208607

        Reviewed by Youenn Fablet.

        No new tests, no functional change.

        Add WebKit.plist to the project in order to use the feature flags mechanism.
        * FeatureFlags/WebKit.plist: Added.

        Replace the default feature preference values defined with macros (for async_frame_and_overflow_scrolling,
        incremental_pdf, canvas_and_media_in_gpu_process, WebGL2, WebGPU, and webrtc_in_gpu_process) with
        functions implemented with the feature flags mechanism.
        * Shared/WebPreferences.yaml:
        * Shared/WebPreferencesDefaultValues.cpp:
        (WebKit::defaultAsyncFrameAndOverflowScrollingEnabled):
        (WebKit::defaultAsyncFrameScrollingEnabled):
        (WebKit::defaultAsyncOverflowScrollingEnabled):
        (WebKit::defaultUseGPUProcessForMedia):
        (WebKit::defaultRenderCanvasInGPUProcessEnabled):
        (WebKit::defaultCaptureAudioInGPUProcessEnabled):
        (WebKit::defaultCaptureAudioInUIProcessEnabled):
        (WebKit::defaultCaptureVideoInGPUProcessEnabled):
        (WebKit::defaultWebRTCCodecsInGPUProcess):
        (WebKit::defaultWebGL2Enabled):
        (WebKit::defaultWebGPUEnabled):
        * Shared/WebPreferencesDefaultValues.h:
        * WebKit.xcodeproj/project.pbxproj:

2020-03-06  Youenn Fablet  <youenn@apple.com>

        Use ObjectIdentifier to identify media sessions
        https://bugs.webkit.org/show_bug.cgi?id=208710

        Reviewed by Eric Carlson.

        * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
        (WebKit::WebPage::requestActiveNowPlayingSessionInfo):

2020-03-05  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthn] Do not perform Attestation with type is 'none'
        https://bugs.webkit.org/show_bug.cgi?id=208676
        <rdar://problem/59692104>

        Reviewed by Brent Fulgham.

        Besides the suggested title, this patch also adds a whitelist to restrict
        access until validation is complete. The whitelist allows file URLs and
        test-related domains.

        Covered by existing tests with new contents.

        * UIProcess/API/APIWebAuthenticationPanelClient.h:
        (API::WebAuthenticationPanelClient::selectAssertionResponse const):
        * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.h:
        * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
        (WebKit::LocalAuthenticatorInternal::whitelistedRpId):
        (WebKit::LocalAuthenticator::continueMakeCredentialAfterUserVerification):
        (WebKit::LocalAuthenticator::continueMakeCredentialAfterAttested):

2020-03-06  Youenn Fablet  <youenn@apple.com>

        Make sure completion handler given to AuxiliaryProcessProxy::sendMessage is called asynchronously
        https://bugs.webkit.org/show_bug.cgi?id=208701

        Reviewed by Chris Dumez.

        This is difficult to test as we change the behavior in the case a sendWithAsyncReply fails synchronously.

        * UIProcess/AuxiliaryProcessProxy.cpp:
        (WebKit::AuxiliaryProcessProxy::sendMessage):
        sendMessage completion handler is always called asynchronously for usual cases except in rare cases
        like terminated processes or invalid connections.
        To make things more consistent, call completion handler asynchronously for these rare cases as well.

2020-03-06  David Quesada  <david_quesada@apple.com>

        Add _WKResourceLoadInfo.resourceType SPI
        https://bugs.webkit.org/show_bug.cgi?id=208723

        Reviewed by Alex Christensen.

        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::resourceLoadInfo):
        * Shared/ResourceLoadInfo.h:
        (WebKit::ResourceLoadInfo::encode const):
        (WebKit::ResourceLoadInfo::decode):
        * UIProcess/API/APIResourceLoadInfo.h:
        * UIProcess/API/Cocoa/_WKResourceLoadInfo.h:
        * UIProcess/API/Cocoa/_WKResourceLoadInfo.mm:
        (toWKResourceLoadInfoResourceType):
        (-[_WKResourceLoadInfo resourceType]):
        (-[_WKResourceLoadInfo initWithCoder:]):
        (-[_WKResourceLoadInfo encodeWithCoder:]):

2020-03-06  Youenn Fablet  <youenn@apple.com>

        Add support for NowPlaying commands in GPUProcess
        https://bugs.webkit.org/show_bug.cgi?id=208707

        Reviewed by Eric Carlson.

        Add a global NowPlayingManager.
        Each GPUConnectionToWebProcess is now a NowPlayingManager client.
        On updating NowPlayingInfo, it becomes a client and can start receiving commands.

        * GPUProcess/GPUConnectionToWebProcess.cpp:
        (WebKit::GPUConnectionToWebProcess::clearNowPlayingInfo):
        (WebKit::GPUConnectionToWebProcess::setNowPlayingInfo):
        (WebKit::GPUConnectionToWebProcess::didReceiveRemoteControlCommand):
        * GPUProcess/GPUConnectionToWebProcess.h:
        * GPUProcess/GPUProcess.cpp:
        (WebKit::GPUProcess::nowPlayingManager):
        * GPUProcess/GPUProcess.h:
        * GPUProcess/media/RemoteAudioSessionProxy.cpp:
        * GPUProcess/media/RemoteAudioSessionProxyManager.cpp:
        (WebKit::RemoteAudioSessionProxyManager::tryToSetActiveForProcess):
        * WebProcess/GPU/GPUProcessConnection.cpp:
        (WebKit::GPUProcessConnection::didReceiveRemoteCommand):
        * WebProcess/GPU/GPUProcessConnection.h:
        * WebProcess/GPU/GPUProcessConnection.messages.in:

2020-03-06  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Adopt entitlement to avoid treating webcontent as a trusted binary in some cases
        https://bugs.webkit.org/show_bug.cgi?id=208668

        Reviewed by Brent Fulgham.

        On iOS, adopt entitlement to avoid treating the WebContent process as a trusted binary in some cases.

        * Scripts/process-entitlements.sh:

2020-03-06  Simon Fraser  <simon.fraser@apple.com>

        Move synchronousScrollingReasons to ScrollingTreeScrollingNode
        https://bugs.webkit.org/show_bug.cgi?id=208721

        Reviewed by Antti Koivisto.

        No need to send synchronousScrollingReasons to the UI process; it makes no sense there.

        * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
        (ArgumentCoder<ScrollingStateScrollingNode>::encode):
        (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
        (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
        (WebKit::dump):

2020-03-06  Sihui Liu  <sihui_liu@apple.com>

        UIProcess crash after using _prepareForMoveToWindow, then deallocating the WKWebView before moving to the window
        https://bugs.webkit.org/show_bug.cgi?id=208365
        <rdar://problem/59877296>

        Reviewed by Geoffrey Garen.

        Fix the issue that observers in WebView may not be removed when WebView is prepared to move to some window but 
        does not actually move. Make WebView hold strong reference to the target window so it knows to stop observing at
        dealloc even if the move does not happen. The strong reference will be released when WebView actually moves to a
        window to avoid reference cycle.

        New API tests: WKWebView.PrepareForMoveToWindowThenViewDeallocBeforeMoving
                       WKWebView.PrepareForMoveToWindowThenWindowDeallocBeforeMoving

        * UIProcess/Cocoa/WebViewImpl.h:
        (WebKit::WebViewImpl::targetWindowForMovePreparation const):
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::~WebViewImpl):
        (WebKit::WebViewImpl::intrinsicDeviceScaleFactor const):
        (WebKit::WebViewImpl::windowDidChangeScreen):
        (WebKit::WebViewImpl::viewWillMoveToWindowImpl):
        (WebKit::WebViewImpl::viewWillMoveToWindow):
        (WebKit::WebViewImpl::viewDidMoveToWindow):
        (WebKit::WebViewImpl::colorSpace):
        (WebKit::WebViewImpl::prepareForMoveToWindow):

2020-03-06  Kate Cheney  <katherine_cheney@apple.com>

        Remove redundant flags in script evaluation checks
        https://bugs.webkit.org/show_bug.cgi?id=208609
        <rdar://problem/60058656>

        Reviewed by Brent Fulgham.

        hasNavigatedAwayFromAppBoundDomain only gets set in WebPageProxy if
        its a main frame navigation and In-App Browser privacy is enabled,
        we don't need to check again at the sites.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::runJavaScript):

2020-03-05  Simon Fraser  <simon.fraser@apple.com>

        Use an OptionSet<> for SynchronousScrollingReasons
        https://bugs.webkit.org/show_bug.cgi?id=208697

        Reviewed by Antti Koivisto.

        Convert SynchronousScrollingReasons to an OptionSet<SynchronousScrollingReason>.

        * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
        (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
        * UIProcess/WebPageProxy.cpp:

2020-03-06  Jer Noble  <jer.noble@apple.com>

        [GPUP] Set the WebProcess's useGPUProcessForMedia setting during the first page load
        https://bugs.webkit.org/show_bug.cgi?id=208694

        Reviewed by Youenn Fablet.

        Until such a time as we can pass through the correct preference during WebProcess creation,
        set the WebProcess's "useGPUProcessForMedia" setting just before the first page load.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::updatePreferences):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::initializeWebProcess):
        * WebProcess/WebProcess.h:

2020-03-06  Antoine Quint  <graouts@webkit.org>

        Remove the experimental flag for Pointer Events
        https://bugs.webkit.org/show_bug.cgi?id=208655
        <rdar://problem/60090545>

        Reviewed by Dean Jackson.

        * Shared/WebPreferences.yaml:

2020-03-05  Brent Fulgham  <bfulgham@apple.com>

        [iOS] Remove reporting for some well-understood framebuffer routines
        https://bugs.webkit.org/show_bug.cgi?id=208686
        <rdar://problem/59181061>

        Reviewed by Per Arne Vollan.

        We have captured backlogs capturing the use of more framebuffer-related rules. We
        should remove this reporting to reduce log spam.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb:
        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

2020-03-05  Brent Fulgham  <bfulgham@apple.com>

        GPU Process sandbox errors
        https://bugs.webkit.org/show_bug.cgi?id=208688
        <rdar://problem/60085171>

        Reviewed by Per Arne Vollan.

        The new GPU Process needs access to a number of properties to support media playback
        features available in our shipping software.

        * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in:

2020-03-05  Brady Eidson  <beidson@apple.com>

        Pre-fetch first page in new PDF loading model.
        https://bugs.webkit.org/show_bug.cgi?id=208669

        Reviewed by Alex Christensen.

        Also add some logging.

        * Platform/Logging.h:
        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit::dataProviderGetBytesAtPositionCallback):
        (WebKit::dataProviderGetByteRangesCallback):
        (WebKit::PDFPlugin::threadEntry):

2020-03-05  Alex Christensen  <achristensen@webkit.org>

        Add WKNavigationDelegatePrivate SPI to inform application of subframe navigations
        https://bugs.webkit.org/show_bug.cgi?id=208670

        Reviewed by Brady Eidson.

        There is no WKNavigation for subframe navigations, so just expose the NSURLRequest directly.
        This is equivalent to WKNavigation._request, which is distinct from WKFrameInfo.request.
        The former is the currently pending request, the latter is the request that has already loaded.
        I needed to move the isMainFrame check to the NavigationClient implementations.
        This is needed for <rdar://problem/57201034>.
        Covered by API tests.

        * UIProcess/API/APINavigationClient.h:
        (API::NavigationClient::didStartProvisionalNavigation):
        (API::NavigationClient::didFailProvisionalNavigationWithError):
        (API::NavigationClient::didCommitNavigation):
        (API::NavigationClient::didFinishNavigation):
        (API::NavigationClient::didFailNavigationWithError):
        (API::NavigationClient::didFailProvisionalLoadInSubframeWithError): Deleted.
        * UIProcess/API/C/WKPage.cpp:
        (WKPageSetPageNavigationClient):
        * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
        * UIProcess/API/glib/WebKitNavigationClient.cpp:
        * UIProcess/Cocoa/NavigationState.h:
        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::setNavigationDelegate):
        (WebKit::NavigationState::NavigationClient::didStartProvisionalNavigation):
        (WebKit::createErrorWithRecoveryAttempter):
        (WebKit::NavigationState::NavigationClient::didFailProvisionalNavigationWithError):
        (WebKit::NavigationState::NavigationClient::didCommitNavigation):
        (WebKit::NavigationState::NavigationClient::didFinishNavigation):
        (WebKit::NavigationState::NavigationClient::didFailNavigationWithError):
        (WebKit::NavigationState::NavigationClient::didFailProvisionalLoadInSubframeWithError): Deleted.
        * UIProcess/ProvisionalPageProxy.cpp:
        (WebKit::ProvisionalPageProxy::cancel):
        (WebKit::ProvisionalPageProxy::didStartProvisionalLoadForFrame):
        (WebKit::ProvisionalPageProxy::didFailProvisionalLoadForFrame):
        (WebKit::ProvisionalPageProxy::didCommitLoadForFrame):
        * UIProcess/ProvisionalPageProxy.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::commitProvisionalPage):
        (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
        (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
        (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
        (WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared):
        (WebKit::WebPageProxy::didCommitLoadForFrame):
        (WebKit::WebPageProxy::didFinishLoadForFrame):
        (WebKit::WebPageProxy::didFailLoadForFrame):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDidStartProvisionalLoad):
        (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):
        (WebKit::WebFrameLoaderClient::dispatchDidFailProvisionalLoad):
        (WebKit::WebFrameLoaderClient::dispatchDidFailLoad):
        (WebKit::WebFrameLoaderClient::dispatchDidFinishLoad):

2020-03-05  Alex Christensen  <achristensen@webkit.org>

        Add WKFrameInfo._parentFrameHandle SPI
        https://bugs.webkit.org/show_bug.cgi?id=208674

        Reviewed by Brady Eidson.

        I got carried away and removed it in r257872 but it's still needed for <rdar://problem/57201034>
        Covered by API tests.

        * Shared/FrameInfoData.cpp:
        (WebKit::FrameInfoData::encode const):
        (WebKit::FrameInfoData::decode):
        * Shared/FrameInfoData.h:
        * UIProcess/API/APIFrameInfo.cpp:
        (API::FrameInfo::parentFrameHandle const):
        * UIProcess/API/APIFrameInfo.h:
        * UIProcess/API/APIFrameTreeNode.cpp:
        (API::FrameTreeNode::parentFrameHandle const):
        * UIProcess/API/APIFrameTreeNode.h:
        * UIProcess/API/Cocoa/WKFrameInfo.mm:
        (-[WKFrameInfo _parentFrameHandle]):
        * UIProcess/API/Cocoa/WKFrameInfoPrivate.h:
        * UIProcess/API/Cocoa/_WKFrameTreeNode.mm:
        (-[_WKFrameTreeNode _parentFrameHandle]):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
        * WebProcess/WebPage/WebFrame.cpp:
        (WebKit::WebFrame::info const):

2020-03-05  Kate Cheney  <katherine_cheney@apple.com>

        Add web page additions to WebPageProxy
        https://bugs.webkit.org/show_bug.cgi?id=208666
        <rdar://problem/60100413>

        Reviewed by Brent Fulgham.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::isAppBoundDomain const):
        (WebKit::WebPageProxy::setIsNavigatingToAppBoundDomain):

2020-03-05  Brent Fulgham  <bfulgham@apple.com>

        [macOS] Create sandbox extension for "com.apple.tccd"
        https://bugs.webkit.org/show_bug.cgi?id=208660
        <rdar://problem/57666569>

        Reviewed by Per Arne Vollan.

        Make the same changes for macOS as we did for iOS in Bug 204367. Specifically, remove the
        blanket mach-lookup permission for 'com.apple.tccd', and instead make a dynamic extension
        only when a camera or microphone request is made.

        * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
        (WebKit::UserMediaPermissionRequestManagerProxy::finishGrantingRequest): Update to create the
        extensions on macOS, too.
        * UIProcess/UserMediaPermissionRequestManagerProxy.h:
        * WebProcess/com.apple.WebProcess.sb.in: Remove blanket access permissions and move them to
        the dynamic access permissions section of the sandbox.

2020-03-05  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthn] Implement SPI -[_WKWebAuthenticationPanelDelegate panel:selectAssertionResponse:source:completionHandler:]
        https://bugs.webkit.org/show_bug.cgi?id=208626
        <rdar://problem/60074148>

        Reviewed by Brent Fulgham.

        The patch adds a parameter (source) to the original SPI such that clients can know where those responses are from.
        Besides that this patch also changes the completionHandler to accept a pointer instead of a reference such that clients
        can pass a nullptr as a no op. In order to keep WebKitTestRunner running, the patch then overrides this SPI in the C API to
        always return the first item.

        * UIProcess/API/APIWebAuthenticationAssertionResponse.h:
        * UIProcess/API/APIWebAuthenticationPanelClient.h:
        (API::WebAuthenticationPanelClient::selectAssertionResponse const):
        * UIProcess/API/C/WKPage.cpp:
        (WKPageSetPageUIClient):
        * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.h:
        * UIProcess/WebAuthentication/Authenticator.h:
        * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
        (WebKit::AuthenticatorManager::selectAssertionResponse):
        * UIProcess/WebAuthentication/AuthenticatorManager.h:
        * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
        (WebKit::LocalAuthenticator::getAssertion):
        * UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.h:
        * UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.mm:
        (WebKit::WebAuthenticationPanelClient::WebAuthenticationPanelClient):
        (WebKit::wkWebAuthenticationSource):
        (WebKit::WebAuthenticationPanelClient::selectAssertionResponse const):
        * UIProcess/WebAuthentication/WebAuthenticationFlags.h:
        * UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp:
        (WebKit::CtapAuthenticator::continueGetNextAssertionAfterResponseReceived):

2020-03-05  Chris Dumez  <cdumez@apple.com>

        Running a single layout test makes 28 WebProcessPools (and launches 6 Network processes)
        https://bugs.webkit.org/show_bug.cgi?id=208541
        <rdar://problem/60018602>

        Reviewed by Youenn Fablet.

        WebKitTestRunner was contructing a page / process pool and then calling into various
        WebsiteDataStore APIs to reset / clear state. Because nothing had been loaded in the
        view yet, the page would still be using a dummy process proxy (due to delayed process
        launch optimization) at the time the WebsiteDataStore APIs are called. Because the
        dummy process proxy would not register itself with the WebsiteDataStore (unlike other
        processes), the WebsiteDataStore thought it had no associated process pool and would
        thus construct a temporary one every time it needed one.

        To address the issue, we now construct one dummy process proxy per session (instead of
        one for all sessions). As a result, the dummy process proxy can now behave as a normal
        WebProcessProxy and have an associated data store and register / unregister itself from
        it, depending on whether or not it has pages.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::launchInitialProcessIfNecessary):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess):
        (WebKit::WebProcessPool::disconnectProcess):
        (WebKit::WebProcessPool::processForRegistrableDomain):
        (WebKit::WebProcessPool::createWebPage):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::isDummyProcessProxy const):
        (WebKit::WebProcessProxy::updateRegistrationWithDataStore):
        (WebKit::WebProcessProxy::maybeShutDown):
        * UIProcess/WebProcessProxy.h:

2020-03-05  Jer Noble  <jer.noble@apple.com>

        Unreviewed unified build fix; forward-declare and include GPUConnectionToWebProcess where it's used.

        * GPUProcess/media/RemoteAudioSessionProxy.cpp:
        * GPUProcess/media/RemoteAudioSessionProxy.h:

2020-03-05  Jer Noble  <jer.noble@apple.com>

        [GPUP] Implement RemoteAudioSession
        https://bugs.webkit.org/show_bug.cgi?id=208583

        Reviewed by Alex Christensen.

        Add a subclass of AudioSession which, instead of modifying the audio behavior of the current process, modifies the
        audio behavior of the GPU Process. And, in the GPU Process, since it represents the audio behavior of potentially
        multiple separate WebContent processes.

        Override the default shared AudioSession at WebProcess initialization time.

        * DerivedSources-input.xcfilelist:
        * DerivedSources-output.xcfilelist:
        * DerivedSources.make:
        * GPUProcess/GPUConnectionToWebProcess.cpp:
        (WebKit::GPUConnectionToWebProcess::didClose):
        (WebKit::GPUConnectionToWebProcess::audioSessionProxy):
        (WebKit::GPUConnectionToWebProcess::ensureAudioSession):
        (WebKit::GPUConnectionToWebProcess::legacyCdmFactoryProxy):
        (WebKit::GPUConnectionToWebProcess::dispatchMessage):
        (WebKit::GPUConnectionToWebProcess::dispatchSyncMessage):
        * GPUProcess/GPUConnectionToWebProcess.h:
        * GPUProcess/GPUConnectionToWebProcess.messages.in:
        * GPUProcess/GPUProcess.cpp:
        (WebKit::GPUProcess::initializeGPUProcess):
        (WebKit::GPUProcess::audioSessionManager const):
        * GPUProcess/GPUProcess.h:
        * GPUProcess/media/RemoteAudioSessionProxy.cpp: Added.
        (WebKit::RemoteAudioSessionProxy::create):
        (WebKit::RemoteAudioSessionProxy::RemoteAudioSessionProxy):
        (WebKit::RemoteAudioSessionProxy::processIdentifier):
        (WebKit::RemoteAudioSessionProxy::configuration):
        (WebKit::RemoteAudioSessionProxy::setCategory):
        (WebKit::RemoteAudioSessionProxy::setPreferredBufferSize):
        (WebKit::RemoteAudioSessionProxy::tryToSetActive):
        (WebKit::RemoteAudioSessionProxy::beginInterruption):
        (WebKit::RemoteAudioSessionProxy::endInterruption):
        (WebKit::RemoteAudioSessionProxy::audioSessionManager):
        (WebKit::RemoteAudioSessionProxy::connection):
        * GPUProcess/media/RemoteAudioSessionProxy.h: Added.
        (WebKit::RemoteAudioSessionProxy::category const):
        (WebKit::RemoteAudioSessionProxy::routeSharingPolicy const):
        (WebKit::RemoteAudioSessionProxy::preferredBufferSize const):
        (WebKit::RemoteAudioSessionProxy::isActive const):
        * GPUProcess/media/RemoteAudioSessionProxy.messages.in:
        * GPUProcess/media/RemoteAudioSessionProxyManager.cpp: Added.
        (WebKit::RemoteAudioSessionProxyManager::RemoteAudioSessionProxyManager):
        (WebKit::RemoteAudioSessionProxyManager::addProxy):
        (WebKit::RemoteAudioSessionProxyManager::removeProxy):
        (WebKit::RemoteAudioSessionProxyManager::getProxy):
        (WebKit::RemoteAudioSessionProxyManager::setCategoryForProcess):
        (WebKit::RemoteAudioSessionProxyManager::setPreferredBufferSizeForProcess):
        (WebKit::RemoteAudioSessionProxyManager::tryToSetActiveForProcess):
        * GPUProcess/media/RemoteAudioSessionProxyManager.h:
        (WebKit::RemoteAudioSessionProxyManager::session const):
        * GPUProcess/media/RemoteAudioSessionProxyManager.messages.in:
        * Scripts/webkit/messages.py:
        * Sources.txt:
        * SourcesCocoa.txt:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/GPU/media/RemoteAudioSession.cpp: Added.
        (WebKit::RemoteAudioSession::create):
        (WebKit::RemoteAudioSession::RemoteAudioSession):
        (WebKit::RemoteAudioSession::connection):
        (WebKit::RemoteAudioSession::setCategory):
        (WebKit::RemoteAudioSession::setPreferredBufferSize):
        (WebKit::RemoteAudioSession::tryToSetActiveInternal):
        (WebKit::RemoteAudioSession::configurationChanged):
        (WebKit::RemoteAudioSession::beginInterruption):
        (WebKit::RemoteAudioSession::endInterruption):
        * WebProcess/GPU/media/RemoteAudioSession.h: Added.
        * WebProcess/GPU/media/RemoteAudioSession.messages.in:
        * WebProcess/GPU/media/RemoteAudioSessionConfiguration.h: Added.
        (WebKit::RemoteAudioSessionConfiguration::encode const):
        (WebKit::RemoteAudioSessionConfiguration::decode):
        * WebProcess/GPU/media/RemoteAudioSessionIdentifier.h:

2020-03-05  Brent Fulgham  <bfulgham@apple.com>

        Sandbox: Allow sysctl read of "kern.ostype"
        https://bugs.webkit.org/show_bug.cgi?id=208650
        <rdar://problem/60010603>

        Reviewed by Alexey Proskuryakov.

        NSURLSession needs access to "kern.ostype", so the Networking and WebContent
        sandboxes should allow it. I corrected this for the iOS Network sandbox in
        Bug 208346. I should have handled macOS and the WebContent process (on both
        platforms) at the same time.

        * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
        * WebProcess/com.apple.WebProcess.sb.in:

2020-03-05  Sihui Liu  <sihui_liu@apple.com>

        Assertion failed: shouldBeActive() in BackgroundProcessResponsivenessTimer::responsivenessCheckTimerFired()
        https://bugs.webkit.org/show_bug.cgi?id=208596

        Reviewed by Chris Dumez.

        Update state of BackgroundProcessResponsivenessTimer when ServiceWorker is enabled or disabled in web process.

        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::disableServiceWorkers):
        (WebKit::WebProcessProxy::enableServiceWorkers):

2020-03-05  youenn fablet  <youenn@apple.com>

        Add logging support for capture sources in GPUProcess
        https://bugs.webkit.org/show_bug.cgi?id=208637

        Reviewed by Eric Carlson.

        Add a logger getter to the ConnectionProxy.
        Implement it for GPUProcess and UIProcess.
        Set source logger to the connection proxy logger.

        * GPUProcess/GPUConnectionToWebProcess.cpp:
        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
        (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
        * UIProcess/WebProcessProxy.cpp:
        * UIProcess/WebProcessProxy.h:

2020-03-05  Youenn Fablet  <youenn@apple.com>

        Export NowPlaying commands to GPUProcess when media playing in GPUProcess is enabled
        https://bugs.webkit.org/show_bug.cgi?id=208568

        Reviewed by Eric Carlson.

        Export NowPlaying orders to GPU process through IPC if GPUProcess is turned on.
        Otherwise use the regular in process implementation.
        Make sure to sync the hasAudio state so that it gets set properly in WebProcess.

        Remove the use of a PlatformMediaSessionManager for capture since it is now using platform strategies in two places.
        Instead use directly static methods of MediaSessionManageriOS to implement pid forwarding and AudioSession to set category and buffer size.
        A follow-up refactoring should probably rearchitect AudioSession handling.

        * GPUProcess/GPUConnectionToWebProcess.cpp:
        (WebKit::GPUConnectionToWebProcess::clearNowPlayingInfo):
        (WebKit::GPUConnectionToWebProcess::setNowPlayingInfo):
        (WebKit::GPUConnectionToWebProcess::sessionManager): Deleted.
        * GPUProcess/GPUConnectionToWebProcess.h:
        * GPUProcess/GPUConnectionToWebProcess.messages.in:
        * GPUProcess/media/RemoteMediaPlayerProxy.cpp:
        (WebKit::RemoteMediaPlayerProxy::updateCachedState):
        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
        (WebKit::UserMediaCaptureManagerProxy::SourceProxy::SourceProxy):
        (WebKit::UserMediaCaptureManagerProxy::SourceProxy::~SourceProxy):
        (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
        (WebKit::UserMediaCaptureManagerProxy::clone):
        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
        * UIProcess/WebProcessProxy.cpp:
        * WebProcess/GPU/media/WebMediaStrategy.cpp:
        (WebKit::WebMediaStrategy::clearNowPlayingInfo):
        (WebKit::WebMediaStrategy::setNowPlayingInfo):
        * WebProcess/GPU/media/WebMediaStrategy.h:

2020-03-05  Carlos Garcia Campos  <cgarcia@igalia.com>

        REGRESSION(r257667): [UNIX] Tests http/tests/incremental/split-hex-entities.pl and http/tests/misc/large-js-program.php are crashing
        https://bugs.webkit.org/show_bug.cgi?id=208571

        Reviewed by Alex Christensen.

        We get a release assert in Connection::processMessage() when trying to get a file descriptor from
        m_fileDescriptors array that is empty. The problem is that since r257667, a shared buffer is always used by the
        network process to send data to the web process (NetworkResourceLoader::sendBuffer) and shared buffer
        encoding/decoding was changed to always use shared memory and send the file descriptor over the IPC. When
        sending large data in small chunks like these tests are doing, we easily end up with many messages queued in the
        web process receiver (Connection::enqueueIncomingMessage), all of them having one file descriptor open. When the
        maximum number of open file descriptors per process is reached, recvmsg doesn't fail but it sets the flag
        MSG_CTRUNC in msg_flags and the file descriptor is not actually included as part of the control message. The
        message info still claims to include a file descriptor, but it hasn't been created and added to the
        m_fileDescriptors array. We could check msg_flags, but only to assert earlier, not to fix the problem, since we
        are unable to get the file descriptor sent. So, at least in linux I think it's better to send the data over the
        IPC instead of using shared memory. We are already using shared memory for any IPC message bigger than 4096.

        * Platform/IPC/unix/ConnectionUnix.cpp:
        (IPC::readBytesFromSocket): Consider also a read failure when control data is discarded.
        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::encodeSharedBuffer): Do not use shared memory to encode a SharedBuffer in Unix.
        (IPC::decodeSharedBuffer): Do not use shared memory to decode a SharedBuffer in Unix.

2020-03-04  Chris Dumez  <cdumez@apple.com>

        WebsiteDataStore methods often create process pools and launch network processes unnecessarily
        https://bugs.webkit.org/show_bug.cgi?id=208619

        Reviewed by Alex Christensen.

        These methods were potentially creating a temporary WebProcessPool object and launching a network
        process only to go change something in memory in the network process. Since the newly created
        WebProcessPool is temporary, it gets destroyed as soon as we get out of the for loop and the
        network go away too. Therefore, the information in memory of the new network process would not
        survive. Those methods should never be created a process pool and this patch fixes this.

        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::setMaxStatisticsEntries):
        (WebKit::WebsiteDataStore::setPruneEntriesDownTo):
        (WebKit::WebsiteDataStore::setGrandfatheringTime):
        (WebKit::WebsiteDataStore::setMinimumTimeBetweenDataRecordsRemoval):
        (WebKit::WebsiteDataStore::setPrevalentResource):
        (WebKit::WebsiteDataStore::setVeryPrevalentResource):
        (WebKit::WebsiteDataStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
        (WebKit::WebsiteDataStore::setNotifyPagesWhenDataRecordsWereScanned):
        (WebKit::WebsiteDataStore::setIsRunningResourceLoadStatisticsTest):
        (WebKit::WebsiteDataStore::setNotifyPagesWhenTelemetryWasCaptured):
        (WebKit::WebsiteDataStore::getAllStorageAccessEntries):
        (WebKit::WebsiteDataStore::setTimeToLiveUserInteraction):
        (WebKit::WebsiteDataStore::setCacheMaxAgeCapForPrevalentResources):
        (WebKit::WebsiteDataStore::setResourceLoadStatisticsDebugMode):
        (WebKit::WebsiteDataStore::clearResourceLoadStatisticsInWebProcesses):

2020-03-04  Simon Fraser  <simon.fraser@apple.com>

        Make m_slowRepaintObjects a WeakHashSet
        https://bugs.webkit.org/show_bug.cgi?id=208623

        Reviewed by Ryosuke Niwa.

        Fix namespace errors triggered by FrameView include changes.

        * UIProcess/API/APIPageConfiguration.cpp:
        (API::PageConfiguration::visitedLinkStore):
        (API::PageConfiguration::setVisitedLinkStore):

2020-03-04  Brady Eidson  <beidson@apple.com>

        Lay initial groundwork for new PDF loading model
        https://bugs.webkit.org/show_bug.cgi?id=208599

        Reviewed by Alex Christensen.

        First piece of adopting some new platform PDF APIs.
        Disabled by default even on platforms that support it.
        No behavior change for shipping configs.

        * WebProcess/Plugins/PDF/PDFPlugin.h:
        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit::PDFPlugin::PDFPlugin):
        (WebKit::dataProviderGetBytesAtPositionCallback):
        (WebKit::dataProviderGetByteRangesCallback):
        (WebKit::dataProviderReleaseInfoCallback):
        (WebKit::PDFPlugin::threadEntry):
        (WebKit::PDFPlugin::unconditionalCompleteRangeRequest):
        (WebKit::PDFPlugin::getResourceBytesAtPosition):
        (WebKit::PDFPlugin::adoptBackgroundThreadDocument):
        (WebKit::PDFPlugin::pdfDocumentDidLoad):
        (WebKit::PDFPlugin::installPDFDocument):
        (WebKit::PDFPlugin::manualStreamDidReceiveData):
        (WebKit::PDFPlugin::attemptToUnlockPDF):
        (WebKit::PDFPlugin::calculateSizes):
        (WebKit::PDFPlugin::handleMouseEvent):
        (WebKit::PDFPlugin::saveToPDF):
        (WebKit::PDFPlugin::openWithNativeApplication):
        (WebKit::PDFPlugin::countFindMatches):
        (WebKit::PDFPlugin::nextMatchForString):

2020-03-04  Chris Dumez  <cdumez@apple.com>

        Construct fewer unnecessary temporary WebProcessPool objects in WebsiteDataStore implementation
        https://bugs.webkit.org/show_bug.cgi?id=208610

        Reviewed by Alex Christensen.

        A lot of methods in WebsiteDataStore were calling ensureProcessPools() and then it a loop do something
        if the pool already has a network process. When you construct a new process pool, the pool has initially
        no network process. As a result, this code should be using processPools() instead of ensureProcessPools()
        to avoid unnecessarily constructing a temporary WebProcessPool object.

        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::fetchDataAndApply):
        (WebKit::WebsiteDataStore::removeData):
        (WebKit::WebsiteDataStore::dumpResourceLoadStatistics):
        (WebKit::WebsiteDataStore::isPrevalentResource):
        (WebKit::WebsiteDataStore::isGrandfathered):
        (WebKit::WebsiteDataStore::setPrevalentResourceForDebugMode):
        (WebKit::WebsiteDataStore::isVeryPrevalentResource):
        (WebKit::WebsiteDataStore::setVeryPrevalentResource):
        (WebKit::WebsiteDataStore::setSubframeUnderTopFrameDomain):
        (WebKit::WebsiteDataStore::isRegisteredAsSubFrameUnder):
        (WebKit::WebsiteDataStore::setSubresourceUnderTopFrameDomain):
        (WebKit::WebsiteDataStore::isRegisteredAsSubresourceUnder):
        (WebKit::WebsiteDataStore::setSubresourceUniqueRedirectTo):
        (WebKit::WebsiteDataStore::setSubresourceUniqueRedirectFrom):
        (WebKit::WebsiteDataStore::setTopFrameUniqueRedirectTo):
        (WebKit::WebsiteDataStore::setTopFrameUniqueRedirectFrom):
        (WebKit::WebsiteDataStore::isRegisteredAsRedirectingTo):
        (WebKit::WebsiteDataStore::clearPrevalentResource):
        (WebKit::WebsiteDataStore::resetParametersToDefaultValues):
        (WebKit::WebsiteDataStore::submitTelemetry):
        (WebKit::WebsiteDataStore::scheduleClearInMemoryAndPersistent):
        (WebKit::WebsiteDataStore::getResourceLoadStatisticsDataSummary):
        (WebKit::WebsiteDataStore::scheduleCookieBlockingUpdate):
        (WebKit::WebsiteDataStore::scheduleStatisticsAndDataRecordsProcessing):
        (WebKit::WebsiteDataStore::setLastSeen):
        (WebKit::WebsiteDataStore::mergeStatisticForTesting):
        (WebKit::WebsiteDataStore::logUserInteraction):
        (WebKit::WebsiteDataStore::hasHadUserInteraction):
        (WebKit::WebsiteDataStore::isRelationshipOnlyInDatabaseOnce):
        (WebKit::WebsiteDataStore::clearUserInteraction):
        (WebKit::WebsiteDataStore::setGrandfathered):
        (WebKit::WebsiteDataStore::setUseITPDatabase):
        (WebKit::WebsiteDataStore::setCrossSiteLoadWithLinkDecorationForTesting):
        (WebKit::WebsiteDataStore::resetCrossSiteLoadsWithLinkDecorationForTesting):
        (WebKit::WebsiteDataStore::deleteCookiesForTesting):
        (WebKit::WebsiteDataStore::hasLocalStorageForTesting const):
        (WebKit::WebsiteDataStore::hasIsolatedSessionForTesting const):
        (WebKit::WebsiteDataStore::setResourceLoadStatisticsShouldDowngradeReferrerForTesting):
        (WebKit::WebsiteDataStore::setResourceLoadStatisticsShouldBlockThirdPartyCookiesForTesting):
        (WebKit::WebsiteDataStore::setResourceLoadStatisticsFirstPartyWebsiteDataRemovalModeForTesting):
        (WebKit::WebsiteDataStore::resetCacheMaxAgeCapForPrevalentResources):
        (WebKit::WebsiteDataStore::isResourceLoadStatisticsEphemeral const):
        (WebKit::WebsiteDataStore::getLocalStorageDetails):
        (WebKit::WebsiteDataStore::resetQuota):
        (WebKit::WebsiteDataStore::hasAppBoundSession const):
        (WebKit::WebsiteDataStore::setInAppBrowserPrivacyEnabled):

2020-03-04  Alex Christensen  <achristensen@webkit.org>

        Call globalObjectIsAvailableForFrame before evaluating JavaScript in newly created worlds
        https://bugs.webkit.org/show_bug.cgi?id=208615
        <rdar://problem/59406743>

        Reviewed by Alex Christensen.

        globalObjectIsAvailableForFrame is often used for initialization code for a content world.
        If we evaluate JavaScript in a content world as the first thing we do in that world, 
        globalObjectIsAvailableForFrame hadn't been called, so things were not initialized.
        So call it when evaluating JavaScript if we create the world to evaluate in.

        Covered by new API tests.

        * WebProcess/UserContent/WebUserContentController.cpp:
        (WebKit::WebUserContentController::addContentWorld):
        * WebProcess/UserContent/WebUserContentController.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::runJavaScriptInFrameInScriptWorld):

2020-03-04  Jiewen Tan  <jiewen_tan@apple.com>

        Unreviewed, a build fix after r257877

        * UIProcess/WebAuthentication/Cocoa/LocalConnection.mm:
        (WebKit::LocalConnection::verifyUser const):
        Restricts LAOptionPasscodeTitle to iOS for now.

2020-03-04  Chris Dumez  <cdumez@apple.com>

        Adopt new and improved CFNetwork SPI for cookie change notifications
        https://bugs.webkit.org/show_bug.cgi?id=208594
        <rdar://problem/60053313>

        Reviewed by Alex Christensen.

        Adopt new and improved CFNetwork SPI for cookie change notifications. Notifications are now per domain
        and the domain matches one of the domains we listen for cookie changes on.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::cookiesDeleted):
        (WebKit::NetworkConnectionToWebProcess::allCookiesDeleted):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * WebProcess/Network/NetworkProcessConnection.cpp:
        (WebKit::NetworkProcessConnection::cookiesDeleted):
        (WebKit::NetworkProcessConnection::allCookiesDeleted):
        * WebProcess/Network/NetworkProcessConnection.h:
        * WebProcess/Network/NetworkProcessConnection.messages.in:
        * WebProcess/WebPage/WebCookieCache.cpp:
        (WebKit::WebCookieCache::cookiesDeleted):
        (WebKit::WebCookieCache::allCookiesDeleted):
        * WebProcess/WebPage/WebCookieCache.h:
        * WebProcess/WebPage/WebCookieJar.cpp:
        (WebKit::WebCookieJar::cookiesDeleted):
        (WebKit::WebCookieJar::allCookiesDeleted):
        * WebProcess/WebPage/WebCookieJar.h:

2020-03-04  Alex Christensen  <achristensen@webkit.org>

        Add SPI to evaluate JavaScript in an iframe
        https://bugs.webkit.org/show_bug.cgi?id=208605

        Reviewed by Brady Eidson.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView evaluateJavaScript:completionHandler:]):
        (-[WKWebView evaluateJavaScript:inContentWorld:completionHandler:]):
        (-[WKWebView callAsyncJavaScript:arguments:inContentWorld:completionHandler:]):
        (-[WKWebView _evaluateJavaScript:asAsyncFunction:withArguments:forceUserGesture:inFrame:inWorld:completionHandler:]):
        (-[WKWebView _evaluateJavaScriptWithoutUserGesture:completionHandler:]):
        (-[WKWebView _callAsyncJavaScript:arguments:inFrame:inContentWorld:completionHandler:]):
        (-[WKWebView _evaluateJavaScript:inFrame:inContentWorld:completionHandler:]):
        (-[WKWebView _evaluateJavaScript:asAsyncFunction:withArguments:forceUserGesture:completionHandler:inWorld:]): Deleted.
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::runJavaScriptInMainFrame):
        (WebKit::WebPageProxy::runJavaScriptInFrameInScriptWorld):
        (WebKit::WebPageProxy::runJavaScriptInMainFrameScriptWorld): Deleted.
        (WebKit::WebPageProxy::runJavaScriptInFrame): Deleted.
        * UIProcess/WebPageProxy.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::runJavaScriptInFrameInScriptWorld):
        (WebKit::WebPage::runJavaScriptInMainFrameScriptWorld): Deleted.
        (WebKit::WebPage::runJavaScriptInFrame): Deleted.
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2020-03-04  Per Arne Vollan  <pvollan@apple.com>

        Partially revert r256756, since it introduced bugs related to Accessibility.
        <rdar://problem/60005574>

        Unreviewed partial revert of r256756.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
        * WebProcess/com.apple.WebProcess.sb.in:

2020-03-03  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthn] Implement -[_WKWebAuthenticationPanelDelegate panel:decidePolicyForLocalAuthenticatorWithCompletionHandler:] SPI
        https://bugs.webkit.org/show_bug.cgi?id=208533
        <rdar://problem/60010184>

        Reviewed by Alex Christensen.

        This patch implements the above SPI to replace -[_WKWebAuthenticationPanelDelegate panel:verifyUserWithAccessControl:completionHandler:].
        The original SPI is designed on the premise that Safari is going to highly customize the LocalAuthentication UI, and that is not happening
        anymore. Therefore, WebKit takes back the invocation of LocalAuthentication and offer a new SPI to tell clients when WebKit is about to
        show LocalAuthentication UI. Clients then have the trigger to pull at their pleasure.

        This patch implements all plumbings to replace the SPI. Besides that, this patch also:
        1) enhances the LocalConnection::verifyUser with a slightly customized LocalAuthentication dialog;
        2) adds the SPI used above into the SPI header;
        3) makes _WKWebAuthenticationPanelDelegate.transports as a NSSet instead of a NSArray;
        4) lets LocalService::isAvailable return false if Apple attestation is not available.

        * Platform/spi/Cocoa/LocalAuthenticationSPI.h:
        * UIProcess/API/APIWebAuthenticationPanelClient.h:
        (API::WebAuthenticationPanelClient::decidePolicyForLocalAuthenticator const):
        (API::WebAuthenticationPanelClient::verifyUser const): Deleted.
        * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.h:
        * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm:
        (-[_WKWebAuthenticationPanel transports]):
        * UIProcess/WebAuthentication/Authenticator.h:
        * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
        (WebKit::AuthenticatorManager::decidePolicyForLocalAuthenticator):
        (WebKit::AuthenticatorManager::verifyUser): Deleted.
        * UIProcess/WebAuthentication/AuthenticatorManager.h:
        * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.h:
        * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
        (WebKit::LocalAuthenticator::makeCredential):
        (WebKit::LocalAuthenticator::continueMakeCredentialAfterDecidePolicy):
        (WebKit::LocalAuthenticator::continueMakeCredentialAfterUserVerification):
        (WebKit::LocalAuthenticator::continueMakeCredentialAfterAttested):
        (WebKit::LocalAuthenticator::getAssertion):
        (WebKit::LocalAuthenticator::continueGetAssertionAfterResponseSelected):
        (WebKit::LocalAuthenticator::continueGetAssertionAfterUserVerification):
        (WebKit::LocalAuthenticator::continueMakeCredentialAfterUserConsented): Deleted.
        (WebKit::LocalAuthenticator::continueGetAssertionAfterUserConsented): Deleted.
        * UIProcess/WebAuthentication/Cocoa/LocalConnection.h:
        * UIProcess/WebAuthentication/Cocoa/LocalConnection.mm:
        (WebKit::LocalConnection::verifyUser const):
        (WebKit::LocalConnection::isUnlocked const): Deleted.
        * UIProcess/WebAuthentication/Cocoa/LocalService.mm:
        (WebKit::LocalService::isAvailable):
        * UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.h:
        * UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.mm:
        (WebKit::WebAuthenticationPanelClient::WebAuthenticationPanelClient):
        (WebKit::localAuthenticatorPolicy):
        (WebKit::WebAuthenticationPanelClient::decidePolicyForLocalAuthenticator const):
        (WebKit::WebAuthenticationPanelClient::verifyUser const): Deleted.
        * UIProcess/WebAuthentication/Mock/MockLocalConnection.h:
        * UIProcess/WebAuthentication/Mock/MockLocalConnection.mm:
        (WebKit::MockLocalConnection::verifyUser const):
        (WebKit::MockLocalConnection::isUnlocked const): Deleted.
        * UIProcess/WebAuthentication/WebAuthenticationFlags.h:

2020-03-04  Alex Christensen  <achristensen@webkit.org>

        callAsyncJavaScript with an invalid parameter and no completionHandler should not crash
        https://bugs.webkit.org/show_bug.cgi?id=208593

        Reviewed by Brady Eidson.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _evaluateJavaScript:asAsyncFunction:withArguments:forceUserGesture:completionHandler:inWorld:]):

2020-03-04  Per Arne Vollan  <pvollan@apple.com>

        [Cocoa] Add enable flag to disable direct mode for preferences
        https://bugs.webkit.org/show_bug.cgi?id=208588

        Reviewed by Brent Fulgham.

        Add an enable flag for this feature so it can be toggled, and turn it off.

        No new tests, since this patch is reverting to previous behavior covered by existing tests.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
        * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
        (WebKit::XPCServiceMain):
        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const):
        (WebKit::WebProcessCreationParameters::decode):
        * Shared/WebProcessCreationParameters.h:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformResolvePathsForSandboxExtensions):
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):
        * WebProcess/com.apple.WebProcess.sb.in:

2020-03-04  Fujii Hironori  <Hironori.Fujii@sony.com>

        Unreviewed build fix for WinCairo
        https://bugs.webkit.org/show_bug.cgi?id=208591

        * Shared/FrameTreeNodeData.h: Replaced #import with #include.

2020-03-04  Alex Christensen  <achristensen@webkit.org>

        WKWebView's frames accessor should return a traversable type
        https://bugs.webkit.org/show_bug.cgi?id=208591

        Reviewed by Brady Eidson.

        Rather than return an array of information that can technically be used to reconstruct a tree,
        let's just return the root of a tree. This introduces _WKFrameTreeNode which inherits from WKFrameInfo.
        Covered by API tests.

        * Shared/API/APIObject.h:
        * Shared/Cocoa/APIObject.mm:
        (API::Object::newObject):
        * Shared/FrameInfoData.cpp:
        (WebKit::FrameInfoData::encode const):
        (WebKit::FrameInfoData::decode):
        * Shared/FrameInfoData.h:
        * Shared/FrameTreeNodeData.h: Added.
        (WebKit::FrameTreeNodeData::encode const):
        (WebKit::FrameTreeNodeData::decode):
        * Sources.txt:
        * SourcesCocoa.txt:
        * UIProcess/API/APIFrameInfo.cpp:
        (API::FrameInfo::parentFrameHandle const): Deleted.
        (API::FrameInfo::childFrameHandles const): Deleted.
        * UIProcess/API/APIFrameInfo.h:
        * UIProcess/API/APIFrameTreeNode.cpp: Added.
        (API::FrameTreeNode::handle const):
        * UIProcess/API/APIFrameTreeNode.h: Added.
        * UIProcess/API/Cocoa/WKFrameInfo.mm:
        (-[WKFrameInfo _parentFrameHandle]): Deleted.
        (-[WKFrameInfo _childFrameHandles]): Deleted.
        * UIProcess/API/Cocoa/WKFrameInfoPrivate.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _frames:]):
        (-[WKWebView _allFrames:]): Deleted.
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/API/Cocoa/_WKFrameTreeNode.h: Added.
        * UIProcess/API/Cocoa/_WKFrameTreeNode.mm: Added.
        (-[_WKFrameTreeNode dealloc]):
        (-[_WKFrameTreeNode isMainFrame]):
        (-[_WKFrameTreeNode request]):
        (-[_WKFrameTreeNode securityOrigin]):
        (-[_WKFrameTreeNode webView]):
        (-[_WKFrameTreeNode childFrames]):
        (-[_WKFrameTreeNode copyWithZone:]):
        (-[_WKFrameTreeNode _handle]):
        (-[_WKFrameTreeNode _apiObject]):
        * UIProcess/API/Cocoa/_WKFrameTreeNodeInternal.h: Added.
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::getAllFrames):
        * UIProcess/WebPageProxy.h:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp:
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
        * WebProcess/WebPage/WebFrame.cpp:
        (WebKit::WebFrame::info const):
        (WebKit::WebFrame::childFrameIDs const): Deleted.
        * WebProcess/WebPage/WebFrame.h:
        (WebKit::WebFrame::frameID const):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::frameTreeNodeData):
        (WebKit::WebPage::getAllFrames):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2020-03-04  Antoine Quint  <graouts@apple.com>

        Add an SPI to allow UserStyleSheet injection to target a specific WKWebView
        https://bugs.webkit.org/show_bug.cgi?id=208575
        <rdar://problem/59773690>

        Reviewed by Brady Eidson.

        Since WebCore adds a new Optional<PageIdentifier> member to UserStyleSheet, we now encode that member to be preserved
        across UI and Web processes.

        Using this new member, WebUserContentController now determines that a UserStyleSheet meant to target a specific page
        was added in addUserStyleSheetInternal(), finds the matching WebPage, and calls injectUserStyleSheet() on its backing Page
        object. Conversely, WebUserContentController::removeUserStyleSheetInternal() will call into Page::removeInjectedUserStyleSheet().

        Finally, we offer a new initializer on _WKUserStyleSheet to target a specific WKWebView, and its page's ID will be set on the
        backing UserStyleSheet.

        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<UserStyleSheet>::encode):
        (IPC::ArgumentCoder<UserStyleSheet>::decode):
        * UIProcess/API/Cocoa/_WKUserStyleSheet.h:
        * UIProcess/API/Cocoa/_WKUserStyleSheet.mm:
        (-[_WKUserStyleSheet initWithSource:forWKWebView:forMainFrameOnly:userContentWorld:]):
        * WebProcess/UserContent/WebUserContentController.cpp:
        (WebKit::WebUserContentController::addUserStyleSheetInternal):
        (WebKit::WebUserContentController::removeUserStyleSheetInternal):

2020-03-04  Jer Noble  <jer.noble@apple.com>

        [GPUP] Implement Modern EME API in the GPU Process
        https://bugs.webkit.org/show_bug.cgi?id=208090

        Reviewed by Eric Carlson.

        Add support for RemoteCDMFactory, RemateCDM, RemoteCDMInstance, RemoteCDMInstanceSession, and all
        of their associated Proxy objects.

        Allow the existing CDMFactory machinery to work normally  when the GPU process is disabled,
        by making initialization of the CDM factories contingent upon the "use GPU" setting.

        * DerivedSources-input.xcfilelist:
        * DerivedSources-output.xcfilelist:
        * DerivedSources.make:
        * GPUProcess/GPUConnectionToWebProcess.cpp:
        (WebKit::GPUConnectionToWebProcess::cdmFactoryProxy):
        (WebKit::GPUConnectionToWebProcess::didReceiveMessage):
        (WebKit::GPUConnectionToWebProcess::didReceiveSyncMessage):
        * GPUProcess/GPUConnectionToWebProcess.h:
        * GPUProcess/media/RemoteCDMFactoryProxy.cpp: Added.
        (WebKit::RemoteCDMFactoryProxy::RemoteCDMFactoryProxy):
        (WebKit::factoryForKeySystem):
        (WebKit::RemoteCDMFactoryProxy::createCDM):
        (WebKit::RemoteCDMFactoryProxy::supportsKeySystem):
        (WebKit::RemoteCDMFactoryProxy::didReceiveCDMMessage):
        (WebKit::RemoteCDMFactoryProxy::didReceiveCDMInstanceMessage):
        (WebKit::RemoteCDMFactoryProxy::didReceiveCDMInstanceSessionMessage):
        (WebKit::RemoteCDMFactoryProxy::didReceiveSyncCDMMessage):
        (WebKit::RemoteCDMFactoryProxy::didReceiveSyncCDMInstanceMessage):
        (WebKit::RemoteCDMFactoryProxy::didReceiveSyncCDMInstanceSessionMessage):
        (WebKit::RemoteCDMFactoryProxy::addProxy):
        (WebKit::RemoteCDMFactoryProxy::removeProxy):
        (WebKit::RemoteCDMFactoryProxy::addInstance):
        (WebKit::RemoteCDMFactoryProxy::removeInstance):
        (WebKit::RemoteCDMFactoryProxy::getInstance):
        (WebKit::RemoteCDMFactoryProxy::addSession):
        (WebKit::RemoteCDMFactoryProxy::removeSession):
        * GPUProcess/media/RemoteCDMFactoryProxy.h: Added.
        * GPUProcess/media/RemoteCDMFactoryProxy.messages.in: Added.
        * GPUProcess/media/RemoteCDMInstanceProxy.cpp: Added.
        (WebKit::RemoteCDMInstanceProxy::create):
        (WebKit::RemoteCDMInstanceProxy::RemoteCDMInstanceProxy):
        (WebKit::RemoteCDMInstanceProxy::initializeWithConfiguration):
        (WebKit::RemoteCDMInstanceProxy::setServerCertificate):
        (WebKit::RemoteCDMInstanceProxy::setStorageDirectory):
        (WebKit::RemoteCDMInstanceProxy::createSession):
        * GPUProcess/media/RemoteCDMInstanceProxy.h: Added.
        (WebKit::RemoteCDMInstanceProxy::configuration const):
        (WebKit::RemoteCDMInstanceProxy::instance):
        * GPUProcess/media/RemoteCDMInstanceProxy.messages.in: Added.
        * GPUProcess/media/RemoteCDMInstanceSessionProxy.cpp: Added.
        (WebKit::RemoteCDMInstanceSessionProxy::create):
        (WebKit::RemoteCDMInstanceSessionProxy::RemoteCDMInstanceSessionProxy):
        (WebKit::RemoteCDMInstanceSessionProxy::~RemoteCDMInstanceSessionProxy):
        (WebKit::RemoteCDMInstanceSessionProxy::requestLicense):
        (WebKit::RemoteCDMInstanceSessionProxy::updateLicense):
        (WebKit::RemoteCDMInstanceSessionProxy::loadSession):
        (WebKit::RemoteCDMInstanceSessionProxy::closeSession):
        (WebKit::RemoteCDMInstanceSessionProxy::removeSessionData):
        (WebKit::RemoteCDMInstanceSessionProxy::storeRecordOfKeyUsage):
        (WebKit::RemoteCDMInstanceSessionProxy::updateKeyStatuses):
        (WebKit::RemoteCDMInstanceSessionProxy::sendMessage):
        (WebKit::RemoteCDMInstanceSessionProxy::sessionIdChanged):
        * GPUProcess/media/RemoteCDMInstanceSessionProxy.h: Added.
        * GPUProcess/media/RemoteCDMInstanceSessionProxy.messages.in: Added.
        * GPUProcess/media/RemoteCDMProxy.cpp: Added.
        (WebKit::RemoteCDMProxy::create):
        (WebKit::RemoteCDMProxy::RemoteCDMProxy):
        (WebKit::RemoteCDMProxy::supportsInitData):
        (WebKit::RemoteCDMProxy::sanitizeResponse):
        (WebKit::RemoteCDMProxy::sanitizeSessionId):
        (WebKit::RemoteCDMProxy::getSupportedConfiguration):
        (WebKit::RemoteCDMProxy::createInstance):
        (WebKit::RemoteCDMProxy::loadAndInitialize):
        * GPUProcess/media/RemoteCDMProxy.h: Added.
        (WebKit::RemoteCDMProxy::configuration const):
        (WebKit::RemoteCDMProxy::factory const):
        * GPUProcess/media/RemoteCDMProxy.messages.in: Added.
        * GPUProcess/media/RemoteMediaPlayerProxy.cpp:
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerInitializationDataEncountered):
        (WebKit::RemoteMediaPlayerProxy::cdmInstanceAttached):
        (WebKit::RemoteMediaPlayerProxy::cdmInstanceDetached):
        (WebKit::RemoteMediaPlayerProxy::attemptToDecryptWithInstance):
        (WebKit::RemoteMediaPlayerProxy::setShouldContinueAfterKeyNeeded):
        * GPUProcess/media/RemoteMediaPlayerProxy.h:
        * GPUProcess/media/RemoteMediaPlayerProxy.messages.in:
        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<WebCore::CDMInstanceSession::Message>::encode):
        (IPC::ArgumentCoder<WebCore::CDMInstanceSession::Message>::decode):
        (IPC::ArgumentCoder<WebCore::CDMInstanceSession::KeyStatusVector>::encode):
        (IPC::ArgumentCoder<WebCore::CDMInstanceSession::KeyStatusVector>::decode):
        * Shared/WebCoreArgumentCoders.h:
        * Sources.txt:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/GPU/GPUProcessConnection.cpp:
        (WebKit::GPUProcessConnection::didReceiveMessage):
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
        (WebKit::MediaPlayerPrivateRemote::cdmInstanceAttached):
        (WebKit::MediaPlayerPrivateRemote::cdmInstanceDetached):
        (WebKit::MediaPlayerPrivateRemote::attemptToDecryptWithInstance):
        (WebKit::MediaPlayerPrivateRemote::initializationDataEncountered):
        (WebKit::MediaPlayerPrivateRemote::setShouldContinueAfterKeyNeeded):
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.h:
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.messages.in:
        * WebProcess/GPU/media/RemoteCDM.cpp: Added.
        (WebKit::RemoteCDM::create):
        (WebKit::RemoteCDM::RemoteCDM):
        (WebKit::RemoteCDM::getSupportedConfiguration):
        (WebKit::RemoteCDM::supportsConfiguration const):
        (WebKit::RemoteCDM::supportsConfigurationWithRestrictions const):
        (WebKit::RemoteCDM::supportsSessionTypeWithConfiguration const):
        (WebKit::RemoteCDM::supportsInitData const):
        (WebKit::RemoteCDM::distinctiveIdentifiersRequirement const):
        (WebKit::RemoteCDM::persistentStateRequirement const):
        (WebKit::RemoteCDM::distinctiveIdentifiersAreUniquePerOriginAndClearable const):
        (WebKit::RemoteCDM::createInstance):
        (WebKit::RemoteCDM::loadAndInitialize):
        (WebKit::RemoteCDM::sanitizeResponse const):
        (WebKit::RemoteCDM::sanitizeSessionId const):
        * WebProcess/GPU/media/RemoteCDM.h: Added.
        * WebProcess/GPU/media/RemoteCDMConfiguration.h: Added.
        (WebKit::RemoteCDMConfiguration::encode const):
        (WebKit::RemoteCDMConfiguration::decode):
        * WebProcess/GPU/media/RemoteCDMFactory.cpp: Added.
        (WebKit::RemoteCDMFactory::RemoteCDMFactory):
        (WebKit::RemoteCDMFactory::updatePreferences):
        (WebKit::RemoteCDMFactory::supplementName):
        (WebKit::RemoteCDMFactory::gpuProcessConnection):
        (WebKit::RemoteCDMFactory::supportsKeySystem):
        (WebKit::RemoteCDMFactory::createCDM):
        (WebKit::RemoteCDMFactory::addSession):
        (WebKit::RemoteCDMFactory::removeSession):
        (WebKit::RemoteCDMFactory::didReceiveSessionMessage):
        * WebProcess/GPU/media/RemoteCDMFactory.h: Added.
        * WebProcess/GPU/media/RemoteCDMIdentifier.h: Added.
        * WebProcess/GPU/media/RemoteCDMInstance.cpp: Added.
        (WebKit::RemoteCDMInstance::create):
        (WebKit::RemoteCDMInstance::RemoteCDMInstance):
        (WebKit::RemoteCDMInstance::initializeWithConfiguration):
        (WebKit::RemoteCDMInstance::setServerCertificate):
        (WebKit::RemoteCDMInstance::setStorageDirectory):
        (WebKit::RemoteCDMInstance::createSession):
        * WebProcess/GPU/media/RemoteCDMInstance.h: Added.
        * WebProcess/GPU/media/RemoteCDMInstanceConfiguration.h: Added.
        (WebKit::RemoteCDMInstanceConfiguration::encode const):
        (WebKit::RemoteCDMInstanceConfiguration::decode):
        * WebProcess/GPU/media/RemoteCDMInstanceIdentifier.h: Added.
        * WebProcess/GPU/media/RemoteCDMInstanceSession.cpp: Added.
        (WebKit::RemoteCDMInstanceSession::create):
        (WebKit::RemoteCDMInstanceSession::RemoteCDMInstanceSession):
        (WebKit::RemoteCDMInstanceSession::requestLicense):
        (WebKit::RemoteCDMInstanceSession::updateLicense):
        (WebKit::RemoteCDMInstanceSession::loadSession):
        (WebKit::RemoteCDMInstanceSession::closeSession):
        (WebKit::RemoteCDMInstanceSession::removeSessionData):
        (WebKit::RemoteCDMInstanceSession::storeRecordOfKeyUsage):
        (WebKit::RemoteCDMInstanceSession::updateKeyStatuses):
        (WebKit::RemoteCDMInstanceSession::sendMessage):
        (WebKit::RemoteCDMInstanceSession::sessionIdChanged):
        * WebProcess/GPU/media/RemoteCDMInstanceSession.h: Added.
        * WebProcess/GPU/media/RemoteCDMInstanceSession.messages.in: Added.
        * WebProcess/GPU/media/RemoteCDMInstanceSessionIdentifier.h: Added.
        * WebProcess/GPU/webrtc/SampleBufferDisplayLayer.cpp:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::updatePreferences):
        * WebProcess/WebProcess.cpp:

2020-03-04  Sihui Liu  <sihui_liu@apple.com>

        Assertion failed: !m_function in CompletionHandler::~CompletionHandler()
        https://bugs.webkit.org/show_bug.cgi?id=208457

        Reviewed by Chris Dumez.

        Ensure completion handler is called in WebsiteDataStore::getResourceLoadStatisticsDataSummary.

        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::getResourceLoadStatisticsDataSummary):

2020-03-04  Ben Nham  <nham@apple.com>

        Remove initial layout throttler
        https://bugs.webkit.org/show_bug.cgi?id=208285

        Reviewed by Antti Koivisto.

        * Shared/WebPreferences.yaml:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::updatePreferences):

2020-03-04  Chris Dumez  <cdumez@apple.com>

        Drop WebsiteDataStore::processPools()'s ensureAPoolExists optional parameter and add a ensureProcessPools() method instead
        https://bugs.webkit.org/show_bug.cgi?id=208546

        Reviewed by Sam Weinig.

        Drop WebsiteDataStore::processPools()'s ensureAPoolExists optional parameter and add a ensureProcessPools()
        method instead. This was error-prone and we are a lot of code creating process pools unnecessarily as a
        result.

        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::processPoolForCookieStorageOperations):
        (WebKit::WebsiteDataStore::fetchDataAndApply):
        (WebKit::WebsiteDataStore::removeData):
        (WebKit::WebsiteDataStore::setMaxStatisticsEntries):
        (WebKit::WebsiteDataStore::setPruneEntriesDownTo):
        (WebKit::WebsiteDataStore::setGrandfatheringTime):
        (WebKit::WebsiteDataStore::setMinimumTimeBetweenDataRecordsRemoval):
        (WebKit::WebsiteDataStore::dumpResourceLoadStatistics):
        (WebKit::WebsiteDataStore::isPrevalentResource):
        (WebKit::WebsiteDataStore::isGrandfathered):
        (WebKit::WebsiteDataStore::setPrevalentResource):
        (WebKit::WebsiteDataStore::setPrevalentResourceForDebugMode):
        (WebKit::WebsiteDataStore::isVeryPrevalentResource):
        (WebKit::WebsiteDataStore::setVeryPrevalentResource):
        (WebKit::WebsiteDataStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
        (WebKit::WebsiteDataStore::setSubframeUnderTopFrameDomain):
        (WebKit::WebsiteDataStore::isRegisteredAsSubFrameUnder):
        (WebKit::WebsiteDataStore::setSubresourceUnderTopFrameDomain):
        (WebKit::WebsiteDataStore::isRegisteredAsSubresourceUnder):
        (WebKit::WebsiteDataStore::setSubresourceUniqueRedirectTo):
        (WebKit::WebsiteDataStore::setSubresourceUniqueRedirectFrom):
        (WebKit::WebsiteDataStore::setTopFrameUniqueRedirectTo):
        (WebKit::WebsiteDataStore::setTopFrameUniqueRedirectFrom):
        (WebKit::WebsiteDataStore::isRegisteredAsRedirectingTo):
        (WebKit::WebsiteDataStore::clearPrevalentResource):
        (WebKit::WebsiteDataStore::resetParametersToDefaultValues):
        (WebKit::WebsiteDataStore::submitTelemetry):
        (WebKit::WebsiteDataStore::scheduleClearInMemoryAndPersistent):
        (WebKit::WebsiteDataStore::getResourceLoadStatisticsDataSummary):
        (WebKit::WebsiteDataStore::scheduleCookieBlockingUpdate):
        (WebKit::WebsiteDataStore::scheduleStatisticsAndDataRecordsProcessing):
        (WebKit::WebsiteDataStore::setLastSeen):
        (WebKit::WebsiteDataStore::mergeStatisticForTesting):
        (WebKit::WebsiteDataStore::setNotifyPagesWhenDataRecordsWereScanned):
        (WebKit::WebsiteDataStore::setIsRunningResourceLoadStatisticsTest):
        (WebKit::WebsiteDataStore::setNotifyPagesWhenTelemetryWasCaptured):
        (WebKit::WebsiteDataStore::setTimeToLiveUserInteraction):
        (WebKit::WebsiteDataStore::logUserInteraction):
        (WebKit::WebsiteDataStore::hasHadUserInteraction):
        (WebKit::WebsiteDataStore::isRelationshipOnlyInDatabaseOnce):
        (WebKit::WebsiteDataStore::clearUserInteraction):
        (WebKit::WebsiteDataStore::setGrandfathered):
        (WebKit::WebsiteDataStore::setUseITPDatabase):
        (WebKit::WebsiteDataStore::setCrossSiteLoadWithLinkDecorationForTesting):
        (WebKit::WebsiteDataStore::resetCrossSiteLoadsWithLinkDecorationForTesting):
        (WebKit::WebsiteDataStore::deleteCookiesForTesting):
        (WebKit::WebsiteDataStore::hasLocalStorageForTesting const):
        (WebKit::WebsiteDataStore::hasIsolatedSessionForTesting const):
        (WebKit::WebsiteDataStore::setResourceLoadStatisticsShouldDowngradeReferrerForTesting):
        (WebKit::WebsiteDataStore::setResourceLoadStatisticsShouldBlockThirdPartyCookiesForTesting):
        (WebKit::WebsiteDataStore::setResourceLoadStatisticsFirstPartyWebsiteDataRemovalModeForTesting):
        (WebKit::WebsiteDataStore::setCacheMaxAgeCapForPrevalentResources):
        (WebKit::WebsiteDataStore::resetCacheMaxAgeCapForPrevalentResources):
        (WebKit::WebsiteDataStore::processPools const):
        (WebKit::WebsiteDataStore::ensureProcessPools const):
        (WebKit::WebsiteDataStore::plugins const):
        (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
        (WebKit::WebsiteDataStore::setStatisticsTestingCallback):
        (WebKit::WebsiteDataStore::setResourceLoadStatisticsDebugMode):
        (WebKit::WebsiteDataStore::isResourceLoadStatisticsEphemeral const):
        (WebKit::WebsiteDataStore::clearResourceLoadStatisticsInWebProcesses):
        (WebKit::WebsiteDataStore::getLocalStorageDetails):
        (WebKit::WebsiteDataStore::resetQuota):
        (WebKit::WebsiteDataStore::hasAppBoundSession const):
        (WebKit::WebsiteDataStore::setInAppBrowserPrivacyEnabled):
        * UIProcess/WebsiteData/WebsiteDataStore.h:

2020-03-04  Daniel Bates  <dabates@apple.com>

        Implement WKTextSelectionRect in terms of WebCore::SelectionRect and WKTextRange in terms of WKTextSelectionRect
        https://bugs.webkit.org/show_bug.cgi?id=208563

        Reviewed by Alex Christensen.

        It is a layering violation that WebKit2 includes a header from WebKit. Implement
        WKTextSelectionRect in terms of WebCore::SelectionRect as a step towards fixing this.
        Also avoid the WebCore::SelectionRect -> WebSelectionRect -> WKTextSelectionRect
        dance that WKTextRange does so that -[WKTextRange selectionRectsForRange] returns
        an array of WKTextSelectionRects by writing WKTextRange in terms of NSArray<WKTextSelectionRect *>*.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _uiTextSelectionRects]):
        (-[WKContentView selectedTextRange]):
        (-[WKContentView selectionRectsForRange:]):
        * UIProcess/ios/WKTextSelectionRect.h:
        * UIProcess/ios/WKTextSelectionRect.mm:
        (-[WKTextSelectionRect initWithSelectionRect:]):
        (-[WKTextSelectionRect rect]):
        (-[WKTextSelectionRect writingDirection]):
        (-[WKTextSelectionRect containsStart]):
        (-[WKTextSelectionRect containsEnd]):
        (-[WKTextSelectionRect isVertical]):
        (-[WKTextSelectionRect initWithWebRect:]): Deleted.
        (-[WKTextSelectionRect dealloc]): Deleted.
        (+[WKTextSelectionRect textSelectionRectsWithWebRects:]): Deleted.

2020-03-04  Daniel Bates  <dabates@apple.com>

        Move WKTextSelectionRect into its own file
        https://bugs.webkit.org/show_bug.cgi?id=208561

        Reviewed by Alex Christensen.

        WKTextSelectionRect is currently defined in WKContentViewInteraction.mm. Separate it
        out into its own file to improve project organization and de-clutter WKContentViewInteraction.mm.

        * SourcesCocoa.txt:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKTextSelectionRect initWithWebRect:]): Deleted.
        (-[WKTextSelectionRect dealloc]): Deleted.
        (+[WKTextSelectionRect textSelectionRectsWithWebRects:]): Deleted.
        (-[WKTextSelectionRect rect]): Deleted.
        (-[WKTextSelectionRect writingDirection]): Deleted.
        (-[WKTextSelectionRect range]): Deleted.
        (-[WKTextSelectionRect containsStart]): Deleted.
        (-[WKTextSelectionRect containsEnd]): Deleted.
        (-[WKTextSelectionRect isVertical]): Deleted.
        * UIProcess/ios/WKTextSelectionRect.h: Added.
        * UIProcess/ios/WKTextSelectionRect.mm: Added.
        (-[WKTextSelectionRect initWithWebRect:]):
        (-[WKTextSelectionRect dealloc]):
        (+[WKTextSelectionRect textSelectionRectsWithWebRects:]):
        (-[WKTextSelectionRect rect]):
        (-[WKTextSelectionRect writingDirection]):
        (-[WKTextSelectionRect range]):
        (-[WKTextSelectionRect containsStart]):
        (-[WKTextSelectionRect containsEnd]):
        (-[WKTextSelectionRect isVertical]):
        * WebKit.xcodeproj/project.pbxproj:

2020-03-04  Youenn Fablet  <youenn@apple.com>

        WebChromeClient::createImageBuffer should not create a connection to GPU Process if page does not want remote rendering
        https://bugs.webkit.org/show_bug.cgi?id=208567
        rdar://problem/60020229

        Reviewed by Wenson Hsieh.

        Manually tested.

        * WebProcess/GPU/graphics/RemoteRenderingBackend.cpp:
        (WebKit::RemoteRenderingBackend::createImageBuffer):
        Minor refactoring to directly take a ShouldAccelerate instead of a RenderingMode.
        * WebProcess/GPU/graphics/RemoteRenderingBackend.h:
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::createImageBuffer const):
        In case page does not want to do remote rendering, do not create a remote image buffer.
        Instead, return null and let the caller create a local image buffer.

2020-03-04  Zalan Bujtas  <zalan@apple.com>

        [First paint] Going from visually empty to non-empty should immediately trigger layer unfreezing
        https://bugs.webkit.org/show_bug.cgi?id=208385
        <rdar://problem/59895900>

        Reviewed by Antti Koivisto.

        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDidReachLayoutMilestone):
        (WebKit::WebFrameLoaderClient::dispatchDidReachVisuallyNonEmptyState):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::didCompletePageTransition):
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::resetIdempotentTextAutosizingIfNeeded): We don't have this case anymore.
        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
        (WebKit::TiledCoreAnimationDrawingArea::scheduleRenderingUpdate):

2020-03-03  Devin Rousso  <drousso@apple.com>

        Web Inspector: re-add `InspectorFrontendHost` support for moving the inspected window
        https://bugs.webkit.org/show_bug.cgi?id=208555

        Reviewed by Timothy Hatcher.

        Partially revert r257759, as the design changed enough such that this code is still useful.

        Allow the Web Inspector frontend to ask the containing app (via `InspectorFrontendClient`)
        whether it supports the given docking configuration.

        * WebProcess/Inspector/WebInspectorUI.h:
        * WebProcess/Inspector/WebInspectorUI.cpp:
        (WebKit::WebInspectorUI::startWindowDrag): Added.
        (WebKit::WebInspectorUI::moveWindowBy): Added.
        (WebKit::WebInspectorUI::supportsDockSide): Added.
        (WebKit::WebInspectorUI::requestSetDockSide):
        (WebKit::WebInspectorUI::setDockSide):
        * UIProcess/Inspector/WebInspectorProxy.messages.in:
        * UIProcess/Inspector/WebInspectorProxy.h:
        * UIProcess/Inspector/WebInspectorProxy.cpp:
        (WebKit::WebInspectorProxy::startWindowDrag): Added.
        (WebKit::WebInspectorProxy::platformStartWindowDrag): Added.
        * UIProcess/Inspector/gtk/WebInspectorProxyGtk.cpp:
        (WebKit::WebInspectorProxy::platformStartWindowDrag): Added.
        * UIProcess/Inspector/mac/WebInspectorProxyMac.mm:
        (WebKit::WebInspectorProxy::platformStartWindowDrag): Added.
        * UIProcess/Inspector/win/WebInspectorProxyWin.cpp:
        (WebKit::WebInspectorProxy::platformStartWindowDrag): Added.

        * WebProcess/Inspector/RemoteWebInspectorUI.h:
        * WebProcess/Inspector/RemoteWebInspectorUI.cpp:
        (WebKit::RemoteWebInspectorUI::startWindowDrag): Added.
        (WebKit::RemoteWebInspectorUI::moveWindowBy): Added.
        (WebKit::RemoteWebInspectorUI::supportsDockSide): Added.
        * UIProcess/Inspector/RemoteWebInspectorProxy.messages.in:
        * UIProcess/Inspector/RemoteWebInspectorProxy.h:
        * UIProcess/Inspector/RemoteWebInspectorProxy.cpp:
        (WebKit::RemoteWebInspectorProxy::startWindowDrag): Added.
        (WebKit::RemoteWebInspectorProxy::platformStartWindowDrag): Added.
        * UIProcess/Inspector/gtk/RemoteWebInspectorProxyGtk.cpp:
        (WebKit::RemoteWebInspectorProxy::platformStartWindowDrag): Added.
        * UIProcess/Inspector/mac/RemoteWebInspectorProxyMac.mm:
        (WebKit::RemoteWebInspectorProxy::platformStartWindowDrag): Added.
        * UIProcess/Inspector/win/RemoteWebInspectorProxyWin.cpp:
        (WebKit::RemoteWebInspectorProxy::platformStartWindowDrag): Added.

2020-03-03  Alex Christensen  <achristensen@webkit.org>

        Add SPI _WKResourceLoadInfo.loadedFromCache
        https://bugs.webkit.org/show_bug.cgi?id=208554

        Reviewed by Wenson Hsieh.

        This exposes a boolean value indicating whether the resource was loaded from a cache based on the response source.
        This is needed for rdar://problem/57132290

        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::resourceLoadInfo):
        * Shared/ResourceLoadInfo.h:
        (WebKit::ResourceLoadInfo::encode const):
        (WebKit::ResourceLoadInfo::decode):
        * UIProcess/API/APIResourceLoadInfo.h:
        * UIProcess/API/Cocoa/_WKResourceLoadInfo.h:
        * UIProcess/API/Cocoa/_WKResourceLoadInfo.mm:
        (-[_WKResourceLoadInfo loadedFromCache]):
        (-[_WKResourceLoadInfo initWithCoder:]):
        (-[_WKResourceLoadInfo encodeWithCoder:]):

2020-03-03  Ryosuke Niwa  <rniwa@webkit.org>

        Batch observations and completions of text manipulations
        https://bugs.webkit.org/show_bug.cgi?id=208406

        Reviewed by Wenson Hsieh.

        Update WKWebView's SPI for text manipulations to batch observations and replacements of multiple paragraphs
        at once instead of observing and replacing one paragraph at a time.

        _WKTextManipulationDelegate now has a new callback, didFindTextManipulationItems, which gets an array of
        _WKTextManipulationItem instead of a single _WKTextManipulationItem like didFindTextManipulationItem,
        and WKWebView's _completeTextManipulationForItems replaces multiple paragraphs at once, and gives an array
        of NSError for each _WKTextManipulationItem that failed to replace the respective content.

        Tests: TestWebKitAPI.TextManipulation.StartTextManipulationSupportsLegacyDelegateCallback: Added.
               TestWebKitAPI.TextManipulation.LegacyCompleteTextManipulationReplaceSimpleSingleParagraph: Added.
               TestWebKitAPI.TextManipulation.CompleteTextManipulationReplaceMultipleSimpleParagraphsAtOnce: Added.
               TestWebKitAPI.TextManipulation.CompleteTextManipulationShouldBatchItemCallback: Added.
               TestWebKitAPI.TextManipulation.CompleteTextManipulationFailWhenItemIdentifierIsDuplicated: Added.
               TestWebKitAPI.TextManipulation.CompleteTextManipulationCanHandleSubsetOfItemsToFail: Added.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _startTextManipulationsWithConfiguration:completion:]):
        (coreTextManipulationItemIdentifierFromString): Added.
        (coreTextManipulationTokenIdentifierFromString): Added.
        (-[WKWebView _completeTextManipulation:completion:]): Updated to work with the new TextManipulationController
        interface.
        (makeFailureSetForAllTextManipulationItems): Added.
        (wkTextManipulationErrors): Added.
        (-[WKWebView _completeTextManipulationForItems:completion:]): Added. This is the new SPI.
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/API/Cocoa/_WKTextManipulationDelegate.h:
        * UIProcess/API/Cocoa/_WKTextManipulationItem.h:
        (_WKTextManipulationItemErrorDomain): Added.
        (_WKTextManipulationItemErrorCode): Added.
        (_WKTextManipulationItemErrorItemKey): Added.
        * UIProcess/API/Cocoa/_WKTextManipulationItem.mm:
        * UIProcess/WebPageProxy.cpp:
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::startTextManipulations):
        (WebKit::WebPage::completeTextManipulation): Updated per TextManipulationController interface change.
        To avoid having to duplicate the code to create a vector of ManipulationFailure, this function's completion
        handler has a boolean indicating that all replacements had failed.
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2020-03-03  Per Arne Vollan  <pvollan@apple.com>

        [Cocoa] Mapping from MIME type to UTI type should be done in the UI process
        https://bugs.webkit.org/show_bug.cgi?id=208415

        Reviewed by Brent Fulgham.

        Send the mapping between MIME types and UTI types to the WebContent process as part of the Web
        process creation parameters.

        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const):
        (WebKit::WebProcessCreationParameters::decode):
        * Shared/WebProcessCreationParameters.h:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):

2020-03-03  James Savage  <james.savage@apple.com>

        Refine Swift API for WKWebView JavaScript methods
        https://bugs.webkit.org/show_bug.cgi?id=208483

        Reviewed by Sam Weinig.
        
        Refine these interfaces for Swift and to align with our desired API.

        * UIProcess/API/Cocoa/WKContentWorld.h: This doesn't need to be refined
        for Swift, we can just rename it here.
        * UIProcess/API/Cocoa/WKWebView.h: This does need refinement.

2020-03-03  Alex Christensen  <achristensen@webkit.org>

        Add response to _WKResourceLoadDelegate didCompleteWithError callback
        https://bugs.webkit.org/show_bug.cgi?id=208553

        Reviewed by Simon Fraser.

        New functionality verified by API test.

        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::didFinishLoading):
        (WebKit::NetworkResourceLoader::didFailLoading):
        * UIProcess/API/APIResourceLoadClient.h:
        * UIProcess/API/Cocoa/_WKResourceLoadDelegate.h:
        * UIProcess/Cocoa/ResourceLoadDelegate.h:
        * UIProcess/Cocoa/ResourceLoadDelegate.mm:
        (WebKit::ResourceLoadDelegate::setDelegate):
        (WebKit::ResourceLoadDelegate::ResourceLoadClient::didCompleteWithError const):
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::resourceLoadDidCompleteWithError):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/Network/NetworkProcessProxy.messages.in:
        * UIProcess/WebPageProxy.cpp:
        * UIProcess/WebPageProxy.h:

2020-03-03  Alex Christensen  <achristensen@webkit.org>

        Requests sent to _WKResourceLoadDelegate should include HTTPBody
        https://bugs.webkit.org/show_bug.cgi?id=208550

        Reviewed by Tim Hatcher.

        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::startNetworkLoad):
        * UIProcess/Cocoa/ResourceLoadDelegate.mm:
        (WebKit::ResourceLoadDelegate::ResourceLoadClient::didSendRequest const):
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::resourceLoadDidSendRequest):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/Network/NetworkProcessProxy.messages.in:

2020-03-03  Ross Kirsling  <ross.kirsling@sony.com>

        Unreviewed. Fix WinCairo build following r257801.

        * UIProcess/Inspector/win/RemoteWebInspectorProxyWin.cpp:
        (WebKit::RemoteWebInspectorProxy::platformSetForcedAppearance):
        * UIProcess/Inspector/win/WebInspectorProxyWin.cpp:
        (WebKit::WebInspectorProxy::platformSetForcedAppearance):

2020-03-03  Alex Christensen  <achristensen@webkit.org>

        Expose originalURL and originalHTTPMethod on _WKResourceLoadInfo
        https://bugs.webkit.org/show_bug.cgi?id=208522

        Reviewed by Brian Weinstein.

        Covered by API tests.

        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::resourceLoadInfo):
        * Shared/ResourceLoadInfo.h:
        (WebKit::ResourceLoadInfo::encode const):
        (WebKit::ResourceLoadInfo::decode):
        * UIProcess/API/APIResourceLoadInfo.h:
        * UIProcess/API/Cocoa/_WKResourceLoadInfo.h:
        * UIProcess/API/Cocoa/_WKResourceLoadInfo.mm:
        (-[_WKResourceLoadInfo originalURL]):
        (-[_WKResourceLoadInfo initWithCoder:]):
        (-[_WKResourceLoadInfo encodeWithCoder:]):

2020-03-03  Devin Rousso  <drousso@apple.com>

        Web Inspector: setting the frontend appearance doesn't update the window when undocked
        https://bugs.webkit.org/show_bug.cgi?id=208503

        Reviewed by Timothy Hatcher.

        Notify the UIProcess when setting the forced appearance so platforms that support dark mode
        are able to run native code to adjust the appearance of the undocked window.

        * WebProcess/Inspector/WebInspectorUI.h:
        * WebProcess/Inspector/WebInspectorUI.cpp:
        (WebKit::WebInspectorUI::setForcedAppearance): Added.
        * UIProcess/Inspector/WebInspectorProxy.messages.in:
        * UIProcess/Inspector/WebInspectorProxy.h:
        * UIProcess/Inspector/WebInspectorProxy.cpp:
        (WebKit::WebInspectorProxy::setForcedAppearance): Added.
        (WebKit::WebInspectorProxy::platformSetForcedAppearance): Added.
        * UIProcess/Inspector/gtk/WebInspectorProxyGtk.cpp:
        (WebKit::WebInspectorProxy::platformSetForcedAppearance): Added.
        * UIProcess/Inspector/mac/WebInspectorProxyMac.mm:
        (WebKit::WebInspectorProxy::platformCreateFrontendWindow): Added.
        (WebKit::WebInspectorProxy::platformSetForcedAppearance): Added.
        (WebKit::WebInspectorProxy::applyForcedAppearance): Added.
        * UIProcess/Inspector/win/WebInspectorProxyWin.cpp:
        (WebKit::WebInspectorProxy::platformSetForcedAppearance): Added.

        * WebProcess/Inspector/RemoteWebInspectorUI.h:
        * WebProcess/Inspector/RemoteWebInspectorUI.cpp:
        (WebKit::RemoteWebInspectorUI::setForcedAppearance): Added.
        * UIProcess/Inspector/RemoteWebInspectorProxy.messages.in:
        * UIProcess/Inspector/RemoteWebInspectorProxy.h:
        * UIProcess/Inspector/RemoteWebInspectorProxy.cpp:
        (WebKit::RemoteWebInspectorProxy::setForcedAppearance): Added.
        (WebKit::RemoteWebInspectorProxy::platformSetForcedAppearance): Added.
        * UIProcess/Inspector/gtk/RemoteWebInspectorProxyGtk.cpp:
        (WebKit::RemoteWebInspectorProxy::platformSetForcedAppearance): Added.
        * UIProcess/Inspector/mac/RemoteWebInspectorProxyMac.mm:
        (WebKit::RemoteWebInspectorProxy::platformSetForcedAppearance): Added.
        * UIProcess/Inspector/win/RemoteWebInspectorProxyWin.cpp:
        (WebKit::RemoteWebInspectorProxy::platformSetForcedAppearance): Added.

2020-03-03  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Add entitlement for message filtering
        https://bugs.webkit.org/show_bug.cgi?id=208526
        <rdar://problem/58885485>

        Reviewed by Brent Fulgham.

        On iOS, an entitlement is needed to enable message filtering.

        * Scripts/process-entitlements.sh:

2020-03-03  Jiten Mehta  <jmehta@apple.com>

        Adopt HTTP Alternative Services Storage
        https://bugs.webkit.org/show_bug.cgi?id=208387

        Reviewed by Alex Christensen.

        Covered by a new API test which verifies that data is written to the correct directory.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::fetchWebsiteData):
        (WebKit::NetworkProcess::deleteWebsiteData):
        (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
        (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::getHostNamesWithAlternativeServices):
        (WebKit::NetworkProcess::deleteAlternativeServicesForHostNames):
        (WebKit::NetworkProcess::clearAlternativeServices):
        * Shared/WebsiteData/WebsiteData.cpp:
        (WebKit::WebsiteData::ownerProcess):
        * Shared/WebsiteData/WebsiteDataType.h:
        * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
        (dataTypesToString):
        * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
        (WebKit::toWebsiteDataType):
        (WebKit::toWKWebsiteDataTypes):
        * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h:
        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (+[WKWebsiteDataStore _allWebsiteDataTypesIncludingPrivate]):
        * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
        (WebKit::WebsiteDataRecord::addAlternativeServicesHostname):
        * UIProcess/WebsiteData/WebsiteDataRecord.h:

2020-03-03  Kate Cheney  <katherine_cheney@apple.com>

        Check for navigation to app-bound domain during script evaluation
        https://bugs.webkit.org/show_bug.cgi?id=208319
        <rdar://problem/57569321>

        Reviewed by Brent Fulgham.

        Much of this patch is passing around a new parameter,
        m_hasNavigatedAwayFromAppBoundDomain, to the Web Content Process to
        indicate conditions for script evaluation. 

        * Shared/LoadParameters.cpp:
        (WebKit::LoadParameters::encode const):
        (WebKit::LoadParameters::decode):
        * Shared/LoadParameters.h:
        * Shared/PolicyDecision.h:
        (WebKit::PolicyDecision::encode const):
        (WebKit::PolicyDecision::decode):
        * UIProcess/API/Cocoa/WKPreferences.mm:
        (-[WKPreferences _inAppBrowserPrivacyEnabled]):
        (-[WKPreferences _setInAppBrowserPrivacyEnabled:]):
        * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _setIsNavigatingToAppBoundDomain:completionHandler:]):
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/ProvisionalPageProxy.cpp:
        (WebKit::ProvisionalPageProxy::loadData):
        (WebKit::ProvisionalPageProxy::loadRequest):
        (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionSync):
        * UIProcess/ProvisionalPageProxy.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::loadRequest):
        (WebKit::WebPageProxy::loadRequestWithNavigationShared):
        (WebKit::WebPageProxy::loadData):
        (WebKit::WebPageProxy::loadDataWithNavigationShared):
        (WebKit::WebPageProxy::setIsNavigatingToAppBoundDomain):
        (WebKit::WebPageProxy::setIsNavigatingToAppBoundDomainTesting):
        (WebKit::WebPageProxy::receivedPolicyDecision):
        (WebKit::WebPageProxy::continueNavigationInNewProcess):
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
        (WebKit::WebPageProxy::decidePolicyForNavigationActionSyncShared):
        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::hasNavigatedAwayFromAppBoundDomain const):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
        (WebKit::WebFrameLoaderClient::hasNavigatedAwayFromAppBoundDomain):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::loadRequest):
        (WebKit::WebPage::loadDataImpl):
        (WebKit::WebPage::loadData):
        (WebKit::WebPage::loadAlternateHTML):
        (WebKit::WebPage::didReceivePolicyDecision):
        (WebKit::WebPage::runJavaScript):
        (WebKit::WebPage::setIsNavigatingToAppBoundDomainTesting):
        A new call to manually set isNavigatingToAppBoundDomain to mimic
        test cases in which a webView switches between app-bound and
        non-app-bound domains.

        (WebKit::WebPage::setIsNavigatingToAppBoundDomain): Deleted.
        Moved to header file because its setting a private variable.

        * WebProcess/WebPage/WebPage.h:
        (WebKit::WebPage::setIsNavigatingToAppBoundDomain):
        (WebKit::WebPage::hasNavigatedAwayFromAppBoundDomain const):
        (WebKit::WebPage::setHasNavigatedAwayFromAppBoundDomain):
        * WebProcess/WebPage/WebPage.messages.in:

2020-03-03  youenn fablet  <youenn@apple.com>

        Rename USE(GPU_PROCESS) to ENABLE(GPU_PROCESS_FOR_WEBRTC)
        https://bugs.webkit.org/show_bug.cgi?id=208505

        Reviewed by Eric Carlson.

        * Shared/WebPreferencesDefaultValues.h:

2020-03-03  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r257754.
        https://bugs.webkit.org/show_bug.cgi?id=208513

        Introduced API test failure (Requested by perarne on #webkit).

        Reverted changeset:

        "[Cocoa] Mapping from MIME type to UTI type should be done in
        the UI process"
        https://bugs.webkit.org/show_bug.cgi?id=208415
        https://trac.webkit.org/changeset/257754

2020-03-02  Rob Buis  <rbuis@igalia.com>

        https://bugs.webkit.org/show_bug.cgi?id=208447
        Make FrameLoadRequest ctor take move parameter

        Reviewed by Simon Fraser.

        Adapt to API change.

        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchCreatePage):

2020-03-02  Ben Nham  <nham@apple.com>

        [WTF] Add signpost API
        https://bugs.webkit.org/show_bug.cgi?id=208395

        Reviewed by Alex Christensen.

        We want to start using os_signpost instead of kdebug_trace when emitting performance events,
        because it is usually cheaper (doesn't require a system call unless the log buffer is full)
        and allows for richer tracepoints (allows for logging strings as well as integers).

        To facilitate this, this moves the os_signpost wrappers in NetworkDataTaskCocoa to
        WTF. Since signposts can contain sensitive strings (like URLs), currently we only enable
        them on Apple-internal devices when an environment variable is set.

        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
        (WebKit::NetworkDataTaskCocoa::didSendData):
        (WebKit::NetworkDataTaskCocoa::didReceiveChallenge):
        (WebKit::NetworkDataTaskCocoa::didCompleteWithError):
        (WebKit::NetworkDataTaskCocoa::didReceiveData):
        (WebKit::NetworkDataTaskCocoa::didReceiveResponse):
        (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
        (WebKit::NetworkDataTaskCocoa::cancel):
        (WebKit::NetworkDataTaskCocoa::resume):
        (signpostLogHandle): Deleted.
        (signpostsEnabled): Deleted.

2020-03-02  Devin Rousso  <drousso@apple.com>

        Web Inspector: Items in the toolbar take up to much vertical space
        https://bugs.webkit.org/show_bug.cgi?id=204627
        <rdar://problem/59091905>

        Reviewed by Timothy Hatcher.

        Now that there is no toolbar area, there is nothing obstructing the ability for the window
        to be moved around when dragging via the title bar area. As such, we can remove the unused
        `InspectorFrontendHost` APIs.

        * WebProcess/Inspector/WebInspectorUI.h:
        * WebProcess/Inspector/WebInspectorUI.cpp:
        (WebKit::WebInspectorUI::startWindowDrag): Deleted.
        (WebKit::WebInspectorUI::moveWindowBy): Deleted.
        * UIProcess/Inspector/WebInspectorProxy.messages.in:
        * UIProcess/Inspector/WebInspectorProxy.h:
        * UIProcess/Inspector/WebInspectorProxy.cpp:
        (WebKit::WebInspectorProxy::startWindowDrag): Deleted.
        (WebKit::WebInspectorProxy::platformStartWindowDrag): Deleted.
        * UIProcess/Inspector/gtk/WebInspectorProxyGtk.cpp:
        (WebKit::WebInspectorProxy::platformStartWindowDrag): Deleted.
        * UIProcess/Inspector/mac/WebInspectorProxyMac.mm:
        (WebKit::WebInspectorProxy::platformStartWindowDrag): Deleted.
        * UIProcess/Inspector/win/WebInspectorProxyWin.cpp:
        (WebKit::WebInspectorProxy::platformStartWindowDrag): Deleted.
        * UIProcess/Inspector/wpe/WebInspectorProxyWPE.cpp:
        (WebKit::WebInspectorProxy::platformStartWindowDrag): Deleted.

        * WebProcess/Inspector/RemoteWebInspectorUI.h:
        * WebProcess/Inspector/RemoteWebInspectorUI.cpp:
        (WebKit::RemoteWebInspectorUI::startWindowDrag): Deleted.
        (WebKit::RemoteWebInspectorUI::moveWindowBy): Deleted.
        * UIProcess/Inspector/RemoteWebInspectorProxy.messages.in:
        * UIProcess/Inspector/RemoteWebInspectorProxy.cpp:
        * UIProcess/Inspector/RemoteWebInspectorProxy.h:
        (WebKit::RemoteWebInspectorProxy::startWindowDrag): Deleted.
        (WebKit::RemoteWebInspectorProxy::platformStartWindowDrag): Deleted.
        * UIProcess/Inspector/gtk/RemoteWebInspectorProxyGtk.cpp:
        (WebKit::RemoteWebInspectorProxy::platformStartWindowDrag): Deleted.
        * UIProcess/Inspector/mac/RemoteWebInspectorProxyMac.mm:
        (WebKit::RemoteWebInspectorProxy::platformStartWindowDrag): Deleted.
        * UIProcess/Inspector/win/RemoteWebInspectorProxyWin.cpp:
        (WebKit::RemoteWebInspectorProxy::platformStartWindowDrag): Deleted.

2020-03-02  Brent Fulgham  <bfulgham@apple.com>

        Add flag to indicate that ITP state was explicitly set
        https://bugs.webkit.org/show_bug.cgi?id=208461
        <rdar://problem/59960829>

        Reviewed by John Wilander.

        Now that ITP is supported in Ephemeral sessions, we would like to move to a process-wide
        concept of ITP being on or off, rather than controlling this at a website data level.
        This patch takes the first step by adding a flag to the WebKit::NetworkSessionCreationParameters
        structure that tracks whether the state of ITP (On or Off) was explicitly set by
        SPI (primarily during testing).

        This patch also ensures that we can communicate with TCC for the purpose of checking if
        ITP is on or off.

        * NetworkProcess/NetworkSessionCreationParameters.cpp:
        (WebKit::NetworkSessionCreationParameters::encode const):
        (WebKit::NetworkSessionCreationParameters::decode):
        * NetworkProcess/NetworkSessionCreationParameters.h:
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
        * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
        * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
        * Scripts/process-entitlements.sh:
        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreSetResourceLoadStatisticsEnabled):
        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _setResourceLoadStatisticsEnabled:]):
        * UIProcess/Cocoa/VersionChecks.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::WebProcessPool):
        (WebKit::WebProcessPool::ensureNetworkProcess):
        (WebKit::WebProcessPool::createNewWebProcess):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::parameters):
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::setIsRunningResourceLoadStatisticsTest):
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        (WebKit::WebsiteDataStore::itpStateWasExplicitlySet const):
        (WebKit::WebsiteDataStore::useExplicitITPState):

2020-03-02  Alan Coon  <alancoon@apple.com>

        Add new Mac target numbers
        https://bugs.webkit.org/show_bug.cgi?id=208398

        Reviewed by Alexey Proskuryakov.

        * Configurations/Base.xcconfig:
        * Configurations/DebugRelease.xcconfig:
        * Configurations/Version.xcconfig:
        * Configurations/WebKitTargetConditionals.xcconfig:

2020-03-02  Per Arne Vollan  <pvollan@apple.com>

        [Cocoa] Mapping from MIME type to UTI type should be done in the UI process
        https://bugs.webkit.org/show_bug.cgi?id=208415

        Reviewed by Brent Fulgham.

        Send the mapping between MIME types and UTI types to the WebContent process as part of the Web
        process creation parameters.

        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const):
        (WebKit::WebProcessCreationParameters::decode):
        * Shared/WebProcessCreationParameters.h:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):

2020-03-02  Per Arne Vollan  <pvollan@apple.com>

        Unreviewed sandbox compile fix.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

2020-03-02  Daniel Bates  <dabates@apple.com>

        Annotate editable elements with hit test order
        https://bugs.webkit.org/show_bug.cgi?id=208463
        <rdar://problem/59962843>

        Reviewed by Wenson Hsieh.

        Until <rdar://problem/59737118> is fixed, annotate editable elements with their hit test
        order towards fixing <rdar://problem/59602885>. Only element contexts created as a result
        of calling WebPage::textInputContextsInRect() have a meaningful hit test order.

        Note that the hit test order of an element can only be meaningfully compared to the hit test
        order of other elements returned in the same invocation of WebPage::textInputContextsInRect().
        That is, the hit test order is not render tree-unique. So, the same element returned by two
        different invocations of WebPage::textInputContextsInRect() cannot be compared to any other
        element outside of the list it was returned in even if its order is the same in both lists.

        * UIProcess/API/Cocoa/_WKTextInputContext.mm:
        (-[_WKTextInputContext _hitTestOrder]): Added. If the context does not have a hit test order
        (e.g. returned form WebPage::contextForElement()) then I chose to return 0 – treat it as the
        frontmost element.
        * UIProcess/API/Cocoa/_WKTextInputContextInternal.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::textInputContextsInRect): Assign each element's hit test order. Following
        r257722 the elements are already ordered by hit test order (frontmost to backmost). So, we can
        simply assign monotonically increasing numbers.
        (WebKit::WebPage::contextForElement const): Pass WTF::nullopt for the hit test order as I do
        not have a need to support hit test order for individual elements.

2020-03-02  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Implement canvas remote rendering
        https://bugs.webkit.org/show_bug.cgi?id=204955

        Reviewed by Jon Lee.

        * WebProcess/GPU/graphics/RemoteImageBuffer.h:
        * WebProcess/GPU/graphics/RemoteImageBufferMessageHandler.cpp:
        (WebKit::RemoteImageBufferMessageHandler::waitForCreateImageBufferBackend):
        (WebKit::RemoteImageBufferMessageHandler::waitForCommitImageBufferFlushContext):
        Synchronize the RemoteImageBuffer backend such that the context and the
        DrawingContext are flushed to the backend in the GPUProcess only when
        its pixels are needed in the WebProcess.

        * WebProcess/GPU/graphics/RemoteImageBufferMessageHandler.h:
        (WebKit::RemoteImageBufferMessageHandler::isPendingFlush const):
        Tells whether the pixels of the backend is ready to use or a flushing is
        being committed.

        * WebProcess/GPU/graphics/RemoteRenderingBackend.cpp:
        (WebKit::RemoteRenderingBackend::waitForCreateImageBufferBackend):
        (WebKit::RemoteRenderingBackend::waitForCommitImageBufferFlushContext):
        * WebProcess/GPU/graphics/RemoteRenderingBackend.h:
        They block execution till certain RemoteRenderingBackendProxy messages
        are received.

2020-03-02  Jacob Uphoff  <jacob_uphoff@apple.com>

        Unreviewed, rolling out r257725.

        This commit caused 10 API tests to fail

        Reverted changeset:

        "[Cocoa] Mapping from MIME type to UTI type should be done in
        the UI process"
        https://bugs.webkit.org/show_bug.cgi?id=208415
        https://trac.webkit.org/changeset/257725

2020-03-02  Megan Gardner  <megan_gardner@apple.com>

        Add date/time style to macCatalyst
        https://bugs.webkit.org/show_bug.cgi?id=208456

        Reviewed by Wenson Hsieh.

        Add style flag for date/time pickers on macCatalyst.

        * Platform/spi/ios/UIKitSPI.h:
        * UIProcess/ios/forms/WKFormInputControl.mm:
        (-[WKDateTimePicker datePickerStyle]):
        (-[WKDateTimePicker initWithView:datePickerMode:]):

2020-03-02  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Implement the remote ImageBuffer
        https://bugs.webkit.org/show_bug.cgi?id=207221

        Reviewed by Jon Lee.

        RemoteImageBuffer and RemoteImageBufferProxy represent a single remote
        ImageBuffer. The back end should be created by RemoteImageBufferProxy in
        GPUProcess and shared with the RemoteImageBuffer in the WebProcess.
        Flushing the DrawingContext will be done in GPUProcess. But creating the
        native image out of the back end will be in GPUProcess.

        RemoteRenderingBackend and RemoteRenderingBackendProxy are central points
        for receiving and sending all the messages of the RemoteImageBuffer and
        RemoteImageBufferProxy.

        * GPUProcess/graphics/PlatformRemoteImageBufferProxy.h: Added.
        Defines the platform types of RemoteImageBufferProxy.

        * GPUProcess/graphics/RemoteImageBufferMessageHandlerProxy.cpp: Added.
        (WebKit::RemoteImageBufferMessageHandlerProxy::RemoteImageBufferMessageHandlerProxy):
        (WebKit::RemoteImageBufferMessageHandlerProxy::createBackend):
        (WebKit::RemoteImageBufferMessageHandlerProxy::commitFlushContext):
        * GPUProcess/graphics/RemoteImageBufferMessageHandlerProxy.h: Added.
        Manages sending and receiving the messages of RemoteImageBufferProxy

        * GPUProcess/graphics/RemoteImageBufferProxy.h: Added.
        (WebKit::RemoteImageBufferProxy::create):
        (WebKit::RemoteImageBufferProxy::RemoteImageBufferProxy):
        It is responsible for creating a shared back end and replaying back drawing
        commands.

        * GPUProcess/graphics/RemoteRenderingBackendProxy.cpp:
        (WebKit::RemoteRenderingBackendProxy::createImageBuffer):
        (WebKit::RemoteRenderingBackendProxy::releaseImageBuffer):
        (WebKit::RemoteRenderingBackendProxy::flushImageBufferDrawingContext):
        * GPUProcess/graphics/RemoteRenderingBackendProxy.h:
        (WebKit::RemoteRenderingBackendProxy::renderingBackendIdentifier const):
        * GPUProcess/graphics/RemoteRenderingBackendProxy.messages.in:
        Handle or dispatch messages received from RemoteRenderingBackend.

        * Scripts/webkit/messages.py:
        * Sources.txt:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/GPU/graphics/ImageBufferFlushIdentifier.h: Added.

        * WebProcess/GPU/graphics/ImageBufferShareableBitmapBackend.cpp:
        (WebKit::ImageBufferShareableBitmapBackend::create):
        * WebProcess/GPU/graphics/ImageBufferShareableBitmapBackend.h:
        Although hostWindow isn't used, this is what ConcreteImageBuffer::create
        expects from the creator of the backend.

        * WebProcess/GPU/graphics/PlatformRemoteImageBuffer.h: Added.
        Defines the platform types of RemoteImageBuffer.

        * WebProcess/GPU/graphics/RemoteImageBuffer.h: Added.
        (WebKit::RemoteImageBuffer::create):
        (WebKit::RemoteImageBuffer::RemoteImageBuffer):
        It is responsible for creating RemoteImageBufferProxy and performing the
        drawing commands in the GPUProcess.

        * WebProcess/GPU/graphics/RemoteImageBufferMessageHandler.cpp: Added.
        (WebKit::RemoteImageBufferMessageHandler::RemoteImageBufferMessageHandler):
        (WebKit::RemoteImageBufferMessageHandler::~RemoteImageBufferMessageHandler):
        (WebKit::RemoteImageBufferMessageHandler::flushDrawingContext):
        (WebKit::RemoteImageBufferMessageHandler::commitFlushContext):
        * WebProcess/GPU/graphics/RemoteImageBufferMessageHandler.h: Added.
        (WebKit::RemoteImageBufferMessageHandler::imageBufferIdentifier const):
        Manages sending and receiving the messages of RemoteImageBuffer.

        * WebProcess/GPU/graphics/RemoteRenderingBackend.cpp:
        (WebKit::RemoteRenderingBackend::createImageBuffer):
        (WebKit::RemoteRenderingBackend::releaseImageBuffer):
        (WebKit::RemoteRenderingBackend::createImageBufferBackend):
        (WebKit::RemoteRenderingBackend::commitImageBufferFlushContext):
        * WebProcess/GPU/graphics/RemoteRenderingBackend.h:
        (WebKit::RemoteRenderingBackend::renderingBackendIdentifier const):
        * WebProcess/GPU/graphics/RemoteRenderingBackend.messages.in:
        Handle or dispatch messages received from RemoteRenderingBackendProxy.

        * WebProcess/GPU/graphics/cocoa/ImageBufferShareableIOSurfaceBackend.cpp:
        (WebKit::ImageBufferShareableIOSurfaceBackend::create):
        * WebProcess/GPU/graphics/cocoa/ImageBufferShareableIOSurfaceBackend.h:
        Although hostWindow isn't used, this is what ConcreteImageBuffer::create
        expects from the creator of the backend.

2020-03-02  John Wilander  <wilander@apple.com>

        ResourceLoadStatistics: Enable cookie blocking and the Storage Access API in ephemeral sessions
        https://bugs.webkit.org/show_bug.cgi?id=208399
        <rdar://problem/24731650>

        Reviewed by Brent Fulgham.

        This patch enables resource load statistics, or ITP, in ephemeral sessions.

        Since full third-party cookie blocking is stateless, it can now be enabled in
        ephemeral sessions. User interaction as a gate for calling the Storage Access
        API can be captured in an ephemeral fashion as well to allow authenticated
        embeds.

        No actual statistics are captured which means that the constructor for
        WebKit::WebResourceLoadStatisticsStore skips setting up the memory store,
        the persistent store, and the database store.

        The functionality that is supported is instead carried out in a set of
        private "*Ephemeral()" functions, for instance hasStorageAccessEphemeral().
        The public functions check ephemeral status and route accordingly.

        A release assertion in WebResourceLoadStatisticsStore::postTask()
        guarantees that we never make use of the statistics layer in ephemeral
        sessions.

        Early returns for ephemeral sessions has been removed in several places.
        WebKit::WebResourceLoadObserver now accepts being instantiated in an
        ephemeral session but is told whether it is and skips all statistics
        collection except user interaction which is needed to gate the
        Storage Access API. A release assertion in
        WebResourceLoadObserver::ensureResourceStatisticsForRegistrableDomain()
        makes sure that we never start collecting statistics in ephemeral mode.

        A selection of test cases have been added with an ephemeral setting and
        a new test function isResourceLoadStatisticsEphemeral() has been added
        so that layout tests can make sure that an ephemeral setup is running.
        This last bit is important since test cases will likely still pass if a
        regression were to make the test session persistent.

        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::setNotifyPagesWhenDataRecordsWereScanned):
        (WebKit::WebResourceLoadStatisticsStore::setIsRunningTest):
        (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
        (WebKit::WebResourceLoadStatisticsStore::postTask):
        (WebKit::WebResourceLoadStatisticsStore::setResourceLoadStatisticsDebugMode):
        (WebKit::WebResourceLoadStatisticsStore::setPrevalentResourceForDebugMode):
        (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
        (WebKit::WebResourceLoadStatisticsStore::hasStorageAccessEphemeral):
        (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
        (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessEphemeral):
        (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpenerEphemeral):
        (WebKit::WebResourceLoadStatisticsStore::grantStorageAccessEphemeral):
        (WebKit::WebResourceLoadStatisticsStore::setThirdPartyCookieBlockingMode):
        (WebKit::WebResourceLoadStatisticsStore::setFirstPartyWebsiteDataRemovalMode):
        (WebKit::WebResourceLoadStatisticsStore::applicationWillTerminate):
        (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
        (WebKit::WebResourceLoadStatisticsStore::logUserInteractionEphemeral):
        (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction):
        (WebKit::WebResourceLoadStatisticsStore::clearUserInteractionEphemeral):
        (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
        (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteractionEphemeral):
        (WebKit::WebResourceLoadStatisticsStore::isPrevalentResource):
        (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
        (WebKit::WebResourceLoadStatisticsStore::clearInMemoryEphemeral):
        (WebKit::WebResourceLoadStatisticsStore::resetParametersToDefaultValues):
        (WebKit::WebResourceLoadStatisticsStore::suspend):
            Added a comment on why this function is not applicable to ephemeral sessions.
        (WebKit::WebResourceLoadStatisticsStore::resume):
            Added a comment on why this function is not applicable to ephemeral sessions.
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::resourceLoadStatisticsUpdated):
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::isResourceLoadStatisticsEphemeral const):
        (WebKit::NetworkProcess::prepareToSuspend):
            Skipped call to suspend ITP if it's running in ephemeral mode.
        (WebKit::void NetworkProcess::resume):
            Skipped call to resume ITP if it's running in ephemeral mode.
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::setResourceLoadStatisticsEnabled):
        (WebKit::NetworkSession::recreateResourceLoadStatisticStore):
        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreIsStatisticsEphemeral):
        * UIProcess/API/C/WKWebsiteDataStoreRef.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::isResourceLoadStatisticsEphemeral):
        (WebKit::NetworkProcessProxy::addSession):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
        (WebKit::WebsiteDataStore::isResourceLoadStatisticsEphemeral const):
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        * WebProcess/WebCoreSupport/WebResourceLoadObserver.cpp:
        (WebKit::WebResourceLoadObserver::WebResourceLoadObserver):
        (WebKit::WebResourceLoadObserver::ensureResourceStatisticsForRegistrableDomain):
        (WebKit::WebResourceLoadObserver::logFontLoad):
        (WebKit::WebResourceLoadObserver::logCanvasRead):
        (WebKit::WebResourceLoadObserver::logCanvasWriteOrMeasure):
        (WebKit::WebResourceLoadObserver::logNavigatorAPIAccessed):
        (WebKit::WebResourceLoadObserver::logScreenAPIAccessed):
        (WebKit::WebResourceLoadObserver::logSubresourceLoading):
        (WebKit::WebResourceLoadObserver::logWebSocketLoading):
        (WebKit::WebResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
        (WebKit::WebResourceLoadObserver::logSubresourceLoadingForTesting):
        * WebProcess/WebCoreSupport/WebResourceLoadObserver.h:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::setWebsiteDataStoreParameters):
        (WebKit::WebProcess::setResourceLoadStatisticsEnabled):

2020-03-02  Per Arne Vollan  <pvollan@apple.com>

        [Cocoa] Mapping from MIME type to UTI type should be done in the UI process
        https://bugs.webkit.org/show_bug.cgi?id=208415

        Reviewed by Brent Fulgham.

        Send the mapping between MIME types and UTI types to the WebContent process as part of the Web
        process creation parameters.

        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const):
        (WebKit::WebProcessCreationParameters::decode):
        * Shared/WebProcessCreationParameters.h:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):

2020-03-02  Eric Carlson  <eric.carlson@apple.com>

        [GPUP] Plumb through more MediaPlayer methods
        https://bugs.webkit.org/show_bug.cgi?id=208423
        <rdar://problem/59924386>

        Unreviewed, remove an invalid ASSERT that causes some tests to crash.

        * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
        (WebKit::MediaPlayerPrivateRemote::load):

2020-03-02  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Deny mach lookup access to distributed notifications in the WebContent process
        https://bugs.webkit.org/show_bug.cgi?id=208455

        Reviewed by Brent Fulgham.

        On iOS, deny mach lookup access to the service "com.apple.distributed_notifications@1v3" in the WebContent process.

        Test: fast/sandbox/ios/sandbox-mach-lookup.html

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

2020-03-02  Jacob Uphoff  <jacob_uphoff@apple.com>

        Unreviewed, rolling out r257687.

        This commit caused debug tests to crash for macOS & iOS

        Reverted changeset:

        "[Cocoa] Mapping from MIME type to UTI type should be done in
        the UI process"
        https://bugs.webkit.org/show_bug.cgi?id=208415
        https://trac.webkit.org/changeset/257687

2020-03-02  Eric Carlson  <eric.carlson@apple.com>

        [GPUP] Plumb through more MediaPlayer methods
        https://bugs.webkit.org/show_bug.cgi?id=208423
        <rdar://problem/59924386>

        Reviewed by Youenn Fablet.

        * GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp:
        (WebKit::RemoteMediaPlayerManagerProxy::updateVideoFullscreenInlineImage): Deleted.
        (WebKit::RemoteMediaPlayerManagerProxy::setVideoFullscreenFrame): Deleted.
        (WebKit::RemoteMediaPlayerManagerProxy::setVideoFullscreenGravity): Deleted.
        (WebKit::RemoteMediaPlayerManagerProxy::setVideoFullscreenMode): Deleted.
        (WebKit::RemoteMediaPlayerManagerProxy::setVolume): Deleted.
        (WebKit::RemoteMediaPlayerManagerProxy::setBufferingPolicy): Deleted.
        (WebKit::RemoteMediaPlayerManagerProxy::videoFullscreenStandbyChanged): Deleted.
        (WebKit::RemoteMediaPlayerManagerProxy::accessLog): Deleted.
        (WebKit::RemoteMediaPlayerManagerProxy::errorLog): Deleted.
        * GPUProcess/media/RemoteMediaPlayerManagerProxy.h:
        * GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in:
        * GPUProcess/media/RemoteMediaPlayerProxy.cpp:
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerPause): Deleted.
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerPlay): Deleted.
        * GPUProcess/media/RemoteMediaPlayerProxy.h:

2020-03-02  youenn fablet  <youenn@apple.com>

        Enable capture in GPUProcess by default for recent platforms only
        https://bugs.webkit.org/show_bug.cgi?id=208437

        Reviewed by Eric Carlson.

        No change of behavior.

        * Shared/WebPreferencesDefaultValues.h:

2020-03-02  Youenn Fablet  <youenn@apple.com>

        LocalSampleBufferDisplayLayer is not computing the correct bounds/position in GPUProcess
        https://bugs.webkit.org/show_bug.cgi?id=208370

        Reviewed by Eric Carlson.

        Remove the bounds getter logic.
        Make use of new LocalSampleBufferDisplayLayer routine to properly update the layer bounds.

        * GPUProcess/webrtc/RemoteSampleBufferDisplayLayer.cpp:
        (WebKit::RemoteSampleBufferDisplayLayer::updateBoundsAndPosition):
        * GPUProcess/webrtc/RemoteSampleBufferDisplayLayer.h:
        * GPUProcess/webrtc/RemoteSampleBufferDisplayLayer.messages.in:
        * GPUProcess/webrtc/RemoteSampleBufferDisplayLayerManager.cpp:
        (WebKit::RemoteSampleBufferDisplayLayerManager::createLayer):
        * GPUProcess/webrtc/RemoteSampleBufferDisplayLayerManager.messages.in:
        * WebProcess/GPU/webrtc/SampleBufferDisplayLayer.cpp:
        (WebKit::SampleBufferDisplayLayer::SampleBufferDisplayLayer):
        (WebKit::SampleBufferDisplayLayer::updateBoundsAndPosition):
        * WebProcess/GPU/webrtc/SampleBufferDisplayLayer.h:

2020-03-02  youenn fablet  <youenn@apple.com>

        Enable audio MediaStreamTrack rendering in GPUProcess if audio capture happens in GPUProcess
        https://bugs.webkit.org/show_bug.cgi?id=208435

        Reviewed by Eric Carlson.

        Instead of enabling audio track rendering in GPUProcess based on media flag,
        use the audio capture flag.
        This makes sure things work properly on iOS, where an audio session might interrupt other sessions.

        * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp:
        (WebKit::RemoteMediaPlayerManager::updatePreferences):
        * WebProcess/cocoa/UserMediaCaptureManager.cpp:
        (WebKit::UserMediaCaptureManager::setupCaptureProcesses):

2020-03-02  Rob Buis  <rbuis@igalia.com>

        Add referrerpolicy attribute support for anchors
        https://bugs.webkit.org/show_bug.cgi?id=208424

        Reviewed by Darin Adler.

        Adjust to FrameLoadRequest API change.

        * WebProcess/Inspector/WebInspector.cpp:
        (WebKit::WebInspector::openInNewTab):
        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit::PDFPlugin::clickedLink):
        * WebProcess/Plugins/PluginView.cpp:
        (WebKit::PluginView::loadURL):
        * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
        (WebKit::WebContextMenuClient::searchWithGoogle):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchCreatePage):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::navigateToPDFLinkWithSimulatedClick):

2020-03-01  Ting-Wei Lan  <lantw44@gmail.com>

        [GTK] Fix the build when Wayland target is disabled
        https://bugs.webkit.org/show_bug.cgi?id=208407

        Reviewed by Darin Adler.

        Values in the enum WebCore::PlatformDisplay::Type are only defined when
        their corresponding platform targets are enabled, so we need #if checks
        around uses of them.

        * UIProcess/API/glib/WebKitProtocolHandler.cpp:
        (WebKit::WebKitProtocolHandler::handleGPU):
        * UIProcess/API/glib/WebKitUIClient.cpp:
        (UIClient::windowConfigureEventCallback):

2020-03-01  Wenson Hsieh  <wenson_hsieh@apple.com>

        Unreviewed, rolling out r257618.

        This allegedly causes Safari to crash when closing a window
        (see rdar://problem/59922725).

        Reverted changeset:

        "UIProcess crash after using _prepareForMoveToWindow, then
        deallocating the WKWebView before moving to the window"
        https://bugs.webkit.org/show_bug.cgi?id=208365
        https://trac.webkit.org/changeset/257618

2020-03-01  Wenson Hsieh  <wenson_hsieh@apple.com>

        Many tests in canvas and fast/canvas are asserting after r257677
        https://bugs.webkit.org/show_bug.cgi?id=208431
        <rdar://problem/59911910>

        Reviewed by Tim Horton.

        RemoteRenderingBackend asserts that it should never be created with a RenderingMode that isn't either
        RemoteAccelerated or RemoteUnaccelerated. This was previously the case before r257677, because
        ImageBuffer::create() would only call into the host window (i.e. the chrome and, in turn, chrome client) to
        create the remote image buffer if the rendering mode is RemoteAccelerated or RemoteUnaccelerated. However, since
        we want to move away from any references to RemoteAccelerated or RemoteUnaccelerated rendering modes in WebCore,
        we should instead fix this by adding a similar check in the client (WebKit) layer.

        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::createImageBuffer const):

        Don't bother creating a RemoteRenderingBackend and telling it to create an image buffer, if the given
        RenderingMode isn't one of RemoteAccelerated or RemoteUnaccelerated.

2020-02-29  Yusuke Suzuki  <ysuzuki@apple.com>

        Remove std::lock_guard
        https://bugs.webkit.org/show_bug.cgi?id=206451

        Reviewed by Anders Carlsson.

        * NetworkProcess/cache/NetworkCacheStorage.cpp:
        (WebKit::NetworkCache::Storage::traverse):
        * Platform/IPC/Connection.cpp:
        (IPC::Connection::SyncMessageState::processIncomingMessage):
        (IPC::Connection::SyncMessageState::dispatchMessages):
        (IPC::Connection::SyncMessageState::dispatchMessagesAndResetDidScheduleDispatchMessagesForConnection):
        (IPC::Connection::addWorkQueueMessageReceiver):
        (IPC::Connection::removeWorkQueueMessageReceiver):
        (IPC::Connection::addThreadMessageReceiver):
        (IPC::Connection::removeThreadMessageReceiver):
        (IPC::Connection::sendMessage):
        (IPC::Connection::waitForMessage):
        (IPC::Connection::processIncomingMessage):
        (IPC::Connection::installIncomingSyncMessageCallback):
        (IPC::Connection::uninstallIncomingSyncMessageCallback):
        (IPC::Connection::hasIncomingSyncMessage):
        (IPC::Connection::connectionDidClose):
        (IPC::Connection::sendOutgoingMessages):
        (IPC::Connection::enqueueIncomingMessage):
        (IPC::Connection::dispatchMessageToWorkQueueReceiver):
        (IPC::Connection::dispatchMessageToThreadReceiver):
        (IPC::Connection::dispatchOneIncomingMessage):
        (IPC::Connection::dispatchIncomingMessages):
        * Shared/BlockingResponseMap.h:
        (BlockingResponseMap::didReceiveResponse):
        * UIProcess/mac/WKPrintingView.mm:
        (-[WKPrintingView _preparePDFDataForPrintingOnSecondaryThread]):
        (prepareDataForPrintingOnSecondaryThread):

2020-02-29  Per Arne Vollan  <pvollan@apple.com>

        [Cocoa] Mapping from MIME type to UTI type should be done in the UI process
        https://bugs.webkit.org/show_bug.cgi?id=208415

        Reviewed by Brent Fulgham.

        Send the mapping between MIME types and UTI types to the WebContent process as part of the Web
        process creation parameters.

        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const):
        (WebKit::WebProcessCreationParameters::decode):
        * Shared/WebProcessCreationParameters.h:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):

2020-02-29  Jer Noble  <jer.noble@apple.com>

        Unreviewed unified build fix; add include macro for LayerHostingContext.

        * GPUProcess/media/RemoteMediaPlayerProxy.cpp:

2020-02-28  Peng Liu  <peng.liu6@apple.com>

        [Media in GPU process] Implement the video fullscreen and Picture-in-Picture support
        https://bugs.webkit.org/show_bug.cgi?id=208252

        Reviewed by Simon Fraser.

        The RemoteMediaPlayerProxy in the GPU process creates a LayerHostingContext and
        share the context ID with the MediaPlayerPrivateRemote in the Web process,
        which in turn creates a remote layer used by the VideoFullscreenManager.

        Those functions regarding video fullscreen and picture-in-picture have been
        moved to RemoteMediaPlayerProxy.
        * GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp:
        (WebKit::RemoteMediaPlayerManagerProxy::updateVideoFullscreenInlineImage): Deleted.
        (WebKit::RemoteMediaPlayerManagerProxy::setVideoFullscreenFrame): Deleted.
        (WebKit::RemoteMediaPlayerManagerProxy::setVideoFullscreenGravity): Deleted.
        (WebKit::RemoteMediaPlayerManagerProxy::setVideoFullscreenMode): Deleted.
        (WebKit::RemoteMediaPlayerManagerProxy::setVolume): Deleted.
        (WebKit::RemoteMediaPlayerManagerProxy::setBufferingPolicy): Deleted.
        (WebKit::RemoteMediaPlayerManagerProxy::videoFullscreenStandbyChanged): Deleted.
        * GPUProcess/media/RemoteMediaPlayerManagerProxy.h:

        [GPU process]
        Add two asynchronous IPC messages (EnterFullscreen and ExitFullscreen) in RemoteMediaPlayerProxy
        and replace the message SetVideoFullscreenFrame with SetVideoFullscreenFrameFenced.
        Create the CALayer for the video fullscreen and picture-in-picture features.
        * GPUProcess/media/RemoteMediaPlayerProxy.cpp:
        (WebKit::RemoteMediaPlayerProxy::prepareForPlayback): Deleted.
        (WebKit::RemoteMediaPlayerProxy::setVideoFullscreenFrame): Deleted.
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerFirstVideoFrameAvailable): Deleted.
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerRenderingModeChanged): Deleted.
        * GPUProcess/media/RemoteMediaPlayerProxy.h:
        * GPUProcess/media/RemoteMediaPlayerProxy.messages.in:
        * GPUProcess/media/cocoa/RemoteMediaPlayerProxyCocoa.mm:
        (WebKit::RemoteMediaPlayerProxy::prepareForPlayback):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerFirstVideoFrameAvailable):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerRenderingModeChanged):
        (WebKit::RemoteMediaPlayerProxy::setVideoInlineSizeFenced):
        (WebKit::RemoteMediaPlayerProxy::enterFullscreen):
        (WebKit::RemoteMediaPlayerProxy::exitFullscreen):
        (WebKit::RemoteMediaPlayerProxy::setVideoFullscreenFrameFenced):

        * SourcesCocoa.txt:
        * WebKit.xcodeproj/project.pbxproj:

        [Web process]
        Create a hosting layer in the Web process corresponding to the CALayer in the
        GPU process for video fullscreen and picture-in-picture.
        Synchronize the properties of the layers cross process boundary with MachSendRight.
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
        (WebKit::MediaPlayerPrivateRemote::prepareForPlayback):
        (WebKit::MediaPlayerPrivateRemote::acceleratedRenderingStateChanged):
        (WebKit::MediaPlayerPrivateRemote::setVideoFullscreenLayer):
        (WebKit::MediaPlayerPrivateRemote::setVideoFullscreenFrameFenced):
        (WebKit::MediaPlayerPrivateRemote::setVideoFullscreenGravity):
        (WebKit::MediaPlayerPrivateRemote::setVideoFullscreenFrame): Deleted.
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.h:
        * WebProcess/GPU/media/cocoa/MediaPlayerPrivateRemoteCocoa.mm: Added.
        (WebKit::MediaPlayerPrivateRemote::createVideoFullscreenLayer):
        (WebKit::MediaPlayerPrivateRemote::setVideoFullscreenFrame):
        * WebProcess/GPU/media/cocoa/VideoLayerRemoteCocoa.mm:
        (WebKit::createVideoLayerRemote):
        * WebProcess/cocoa/VideoFullscreenManager.mm:
        (WebKit::VideoFullscreenManager::enterVideoFullscreenForVideoElement):

        Fix unified build failures.
        * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:

2020-02-28  Jer Noble  <jer.noble@apple.com>

        Unreviewed unified build fix; Add include header for IPC::DataReference.

        * WebProcess/Network/WebResourceLoader.cpp:

2020-02-28  Wenson Hsieh  <wenson_hsieh@apple.com>

        Add an internal setting to enable or disable canvas rendering in the GPU Process
        https://bugs.webkit.org/show_bug.cgi?id=208375

        Reviewed by Tim Horton.

        See WebCore ChangeLog for more details.

        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:

        Consult the new internal feature when creating a new web process.

        * Shared/WebPreferences.yaml:

        Add a new internal setting to enable using the GPU process for rendering canvases.

        * UIProcess/WebPageProxy.cpp:
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::createImageBuffer const):
        * WebProcess/WebCoreSupport/WebChromeClient.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::shouldUseRemoteRenderingFor):

        Add a helper method that WebChromeClient can use to determine whether it should opt into either
        RemoteAccelerated or RemoteUnaccelerated.

        * WebProcess/WebPage/WebPage.h:

2020-02-28  Chris Dumez  <cdumez@apple.com>

        [iOS 13] Crash in NetworkProcessProxy::takeUploadAssertion
        https://bugs.webkit.org/show_bug.cgi?id=204796

        Reviewed by Alex Christensen.

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::setWebProcessHasUploads):
        If the network process has previously crashed, WebProcessPool::m_networkProcess may be null
        when WebProcessPool::setWebProcessHasUploads() is called. As a result, we should call
        ensureNetworkProcess() instead of dereferencing m_networkProcess unconditionally.

2020-02-28  Jer Noble  <jer.noble@apple.com>

        [GPUP] Implement Modern EME API in the GPU Process
        https://bugs.webkit.org/show_bug.cgi?id=208090

        Reviewed by Alex Christensen.

        IPC::SharedBufferDataReference is made more efficient by using the same encode/decode path as is used in
        WebCoreArgumentCoders: the SharedBuffer is copied into shared memory, and only a handle is passed across
        the XPC boundary. This requires existing users to handle receiving a IPC::SharedBufferDataHandle on the
        remote side of the XPC boundary, but this is trivial, and many call sites require a SharedBuffer on the
        remote side in the first place. This code could be improved by allowing the SharedMemory object be adopted
        by the SharedBuffer object at creation time, potentially leading to zero-copy decoding, but is not done in
        this patch.

        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::bufferingTimerFired):
        (WebKit::NetworkResourceLoader::sendBuffer):
        * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp:
        (WebKit::ServiceWorkerFetchTask::didReceiveData):
        (WebKit::ServiceWorkerFetchTask::didReceiveSharedBuffer):
        * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h:
        * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.messages.in:
        * Platform/IPC/HandleMessage.h:
        * Platform/IPC/SharedBufferDataReference.h:
        (IPC::SharedBufferDataReference::SharedBufferDataReference):
        (IPC::SharedBufferDataReference::buffer):
        (IPC::SharedBufferDataReference::buffer const):
        (IPC::SharedBufferDataReference::data const):
        (IPC::SharedBufferDataReference::size const):
        (IPC::SharedBufferDataReference::isEmpty const):
        (IPC::SharedBufferDataReference::encode const):
        (IPC::SharedBufferDataReference::decode):
        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<RefPtr<WebCore::SharedBuffer>>::encode):
        (IPC::ArgumentCoder<RefPtr<WebCore::SharedBuffer>>::decode):
        * Shared/WebCoreArgumentCoders.h:
        * UIProcess/Cocoa/WebPageProxyCocoa.mm:
        (WebKit::WebPageProxy::platformRegisterAttachment):
        * UIProcess/WebPageProxy.cpp:
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * WebProcess/Automation/WebAutomationSessionProxy.cpp:
        * WebProcess/Network/WebResourceLoader.cpp:
        (WebKit::WebResourceLoader::didReceiveSharedBuffer):
        (WebKit::WebResourceLoader::didReceiveData):
        * WebProcess/Network/WebResourceLoader.h:
        * WebProcess/Network/WebResourceLoader.messages.in:
        * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
        (WebKit::WebServiceWorkerFetchTaskClient::didReceiveData):
        (WebKit::WebServiceWorkerFetchTaskClient::didReceiveBlobChunk):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::finishedLoadingIcon):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::getSelectionAsWebArchiveData):
        (WebKit::WebPage::getWebArchiveOfFrame):
        (WebKit::WebPage::drawPagesToPDF):
        (WebKit::WebPage::urlSchemeTaskDidReceiveData):
        (WebKit::WebPage::updateAttachmentAttributes):
        * WebProcess/WebPage/WebPage.h:

2020-02-28  Adrian Perez de Castro  <aperez@igalia.com>

        Unreviewed non-unified soures builds fix.

        * NetworkProcess/cache/NetworkCacheData.cpp:
        (WebKit::NetworkCache::readOrMakeSalt): Add missing namespace to FileSystem::fileExists() call.

2020-02-28  Jer Noble  <jer.noble@apple.com>

        [GPUP] Implement Modern EME API in the GPU Process
        https://bugs.webkit.org/show_bug.cgi?id=208090

        Reviewed by Eric Carlson.

        Adopt changes to MediaPlayerProxy.

        * GPUProcess/media/RemoteMediaPlayerProxy.cpp:
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerKeyNeeded):
        * GPUProcess/media/RemoteMediaPlayerProxy.h:
        * WebProcess/GPU/media/WebMediaStrategy.cpp:
        (WebKit::WebMediaStrategy::registerCDMFactories):
        * WebProcess/GPU/media/WebMediaStrategy.h:

2020-02-28  Tim Horton  <timothy_horton@apple.com>

        macCatalyst: 'Open' context menu item doesn't work
        https://bugs.webkit.org/show_bug.cgi?id=208388
        <rdar://problem/59820273>

        Reviewed by Wenson Hsieh.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView cleanupInteraction]):
        (-[WKContentView _webTouchEventsRecognized:]):
        (-[WKContentView _doubleTapRecognizedForDoubleClick:]):
        (-[WKContentView _singleTapRecognized:]):
        (-[WKContentView _attemptClickAtLocation:modifierFlags:]):
        (-[WKContentView _mouseGestureRecognizerChanged:]):
        In r178980, a mechanism was introduced to ensure that synthetic clicks are
        only dispatched to the page that the user originally touched.

        macCatalyst's WKMouseGestureRecognizer unintentionally entirely bypassed
        this mechanism, never setting _layerTreeTransactionIdAtLastTouchStart,
        because the touch event gesture recognizer is disabled. This was generally
        fine because in this case, we don't need to send synthetic clicks,
        instead sending proper mouse events.

        However, the "Open" context menu item works by sending a synthetic click
        at the original interaction location. Since we did not set 
        _layerTreeTransactionIdAtLastTouchStart, the Web Content process will
        ignore the click, and perform no action.

        Fix this by also setting _layerTreeTransactionIdAtLastTouchStart
        on mouseDown.

2020-02-28  Brent Fulgham  <bfulgham@apple.com>

        [iOS] Remove access to the "com.apple.lsd.open" mach service from the WebContent process
        https://bugs.webkit.org/show_bug.cgi?id=207708
        <rdar://problem/56995506>

        Reviewed by Per Arne Vollan.

        Now that we dynamically create the sandbox extension to the 'com.apple.lsd.open' mach service,
        we can remove the global allow rule from the sandbox.
 
        Reviewed by Per Arne Vollan.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb:
        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

2020-02-28  Keith Rollin  <krollin@apple.com>

        Convert frame address in logging statements to pageID+frameID
        https://bugs.webkit.org/show_bug.cgi?id=208325
        <rdar://problem/59850768>

        Reviewed by Alex Christensen.

        Some old logging prints the address of the associated frame object.
        Annotating logging statements this way makes it difficult to match up
        that logging with other logging that uses pageID+frameID. Update the
        logging to consistently use the latter format.

        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::loadResource):

2020-02-28  Eric Carlson  <eric.carlson@apple.com>

        No port uses USE_NATIVE_FULLSCREEN_VIDEO, remove it
        https://bugs.webkit.org/show_bug.cgi?id=208378
        <rdar://problem/59892497>

        Reviewed by Jer Noble.

        * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
        (WebKit::MediaPlayerPrivateRemote::setClosedCaptionsVisible):
        (WebKit::MediaPlayerPrivateRemote::enterFullscreen): Deleted.
        (WebKit::MediaPlayerPrivateRemote::exitFullscreen): Deleted.
        (WebKit::MediaPlayerPrivateRemote::canEnterFullscreen const): Deleted.
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.h:

2020-02-28  Brent Fulgham  <bfulgham@apple.com>

        [iOS] Unblock read access to aes_0 device
        https://bugs.webkit.org/show_bug.cgi?id=208344
        <rdar://problem/59746108>

        Reviewed by Alexey Proskuryakov.

        Logging needs access to /dev/aes_0 to generate random identifiers. We should unblock this service.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:

2020-02-28  youenn fablet  <youenn@apple.com>

        [MacOS/iOS] Enable audio/video capture in GPUProcess by default
        https://bugs.webkit.org/show_bug.cgi?id=208130

        Reviewed by Eric Carlson.

        Covered by existing tests.

        * Shared/WebPreferences.yaml:
        * Shared/WebPreferencesDefaultValues.h:
        * WebProcess/cocoa/UserMediaCaptureManager.cpp:
        (WebKit::UserMediaCaptureManager::cloneVideoSource):
        Make sure to select the process of the source to clone it.

2020-02-28  Youenn Fablet  <youenn@apple.com>

        Conversion between MediaSample and RemoteVideoSample should preserve the rotation information
        https://bugs.webkit.org/show_bug.cgi?id=208240

        Reviewed by Eric Carlson.

        Use new routine that preserves rotation.

        * GPUProcess/webrtc/RemoteMediaRecorder.cpp:
        (WebKit::RemoteMediaRecorder::videoSampleAvailable):
        * GPUProcess/webrtc/RemoteSampleBufferDisplayLayer.cpp:
        (WebKit::RemoteSampleBufferDisplayLayer::enqueueSample):
        * WebProcess/cocoa/UserMediaCaptureManager.cpp:
        (WebKit::UserMediaCaptureManager::Source::remoteVideoSampleAvailable):

2020-02-27  Don Olmstead  <don.olmstead@sony.com>

        Fix WebCore export macros for declspec
        https://bugs.webkit.org/show_bug.cgi?id=208363

        Reviewed by Konstantin Tokarev.

        Add compilation definitions for static linking of PAL and WebCore in WebKit.

        * PlatformFTW.cmake:
        * PlatformWin.cmake:
        * config.h:

2020-02-27  Tim Horton  <timothy_horton@apple.com>

        UIProcess crash after using _prepareForMoveToWindow, then deallocating the WKWebView before moving to the window
        https://bugs.webkit.org/show_bug.cgi?id=208365

        Reviewed by Alex Christensen.

        New test: WKWebView.PrepareForMoveToWindowCrashAfterNotMovingToWindow

        * UIProcess/Cocoa/WebViewImpl.mm:
        (-[WKWindowVisibilityObserver dealloc]):
        (-[WKWindowVisibilityObserver setWindowToObserve:]):
        (WebKit::WebViewImpl::viewWillMoveToWindow):
        Two small changes to make WKWindowVisibilityObserver safer to use, which
        fix the aforementioned bug:

        - Instead of exposing startObserving/stopObserving and making clients
        be careful about pairing them, and remembering which window to stopObserving,
        just add "setWindowToObserve", and keep track (weakly) of the current
        NSWindow being observed. This avoids double-adding observers.

        - Always stopObserving when WKWindowVisibilityObserver is deallocated.
        In the "normal" case, WKWebView will always be removed from the view
        hierarchy before it is deallocated (and thus before the
        WKWindowVisibilityObserver is deallocated), because otherwise its superview
        holds a reference to it. But in the _prepareForMoveToWindow case, we do
        not have this guarantee, and can end up deallocating the WKWebView without
        getting a willMoveToWindow:nil. Make sure to clean up the observers in
        that case, if the window is still around, otherwise when NSWindow sends
        notifications, it will try to message a deallocated WKWebView.

2020-02-27  Brent Fulgham  <bfulgham@apple.com>

        [iOS] Remove logging for sysctl access to properties used by NSURLSession
        https://bugs.webkit.org/show_bug.cgi?id=208346
        <rdar://problem/59862967>

        Reviewed by Alexey Proskuryakov.

        Telemetry and logging indicate that two sysctl calls are needed by [NSURLSession sessionWithConfiguration].
        We no longer need to log these well understood uses.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:

2020-02-27  Eric Carlson  <eric.carlson@apple.com>

        Support in-band generic cues when loading media in the GPU Process
        https://bugs.webkit.org/show_bug.cgi?id=208080
        <rdar://problem/59687943>

        Reviewed by Youenn Fablet.

        * GPUProcess/media/RemoteTextTrackProxy.cpp:
        (WebKit::RemoteTextTrackProxy::addGenericCue):
        (WebKit::RemoteTextTrackProxy::updateGenericCue):
        (WebKit::RemoteTextTrackProxy::removeGenericCue):
        * GPUProcess/media/RemoteTextTrackProxy.h:
        * Scripts/webkit/messages.py:
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
        (WebKit::MediaPlayerPrivateRemote::MediaPlayerPrivateRemote::load):
        (WebKit::MediaPlayerPrivateRemote::addGenericCue):
        (WebKit::MediaPlayerPrivateRemote::updateGenericCue):
        (WebKit::MediaPlayerPrivateRemote::removeGenericCue):
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.h:
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.messages.in:
        * WebProcess/GPU/media/TextTrackPrivateRemote.cpp:
        (WebKit::TextTrackPrivateRemote::addGenericCue):
        (WebKit::TextTrackPrivateRemote::updateGenericCue):
        (WebKit::TextTrackPrivateRemote::removeGenericCue):
        * WebProcess/GPU/media/TextTrackPrivateRemote.h:

2020-02-27  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Issue mach sandbox extensions to the WebContent process for a set of specific services
        https://bugs.webkit.org/show_bug.cgi?id=208146

        Reviewed by Brent Fulgham.

        We are still seeing some accesses from the WebContent process to a small set of services. Since we do not currently have
        backtraces for these accesses, make a speculative patch, where we issue these extension for all apps except Safari.

        Test: fast/sandbox/ios/sandbox-mach-lookup-mail.html

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const):
        (WebKit::WebProcessCreationParameters::decode):
        * Shared/WebProcessCreationParameters.h:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):

2020-02-27  Per Arne Vollan  <pvollan@apple.com>

        [iOS] The GPU process never runs as a foreground process
        https://bugs.webkit.org/show_bug.cgi?id=208250

        Reviewed by Chris Dumez.

        Currently, the GPU process always runs in the background, and never goes into the foreground mode, which is required for media
        playback on iOS. This is addressed by creating a layer in the GPU process, whose context ID is used to create a visibility
        propagation view in the UI process. This is done in the same way as it is done for the WebContent process. This makes it
        possible for the system to determine the visibility of the GPU process. In addition, create foreground process assertions
        when media is being played.

        No new tests, covered by existing tests.

        * GPUProcess/GPUProcess.cpp:
        (WebKit::GPUProcess::initializeGPUProcess):
        * GPUProcess/GPUProcess.h:
        * GPUProcess/ios/GPUProcessIOS.mm:
        * UIProcess/Cocoa/WebPageProxyCocoa.mm:
        (WebKit::WebPageProxy::didCreateContextInGPUProcessForVisibilityPropagation):
        * UIProcess/GPU/GPUProcessProxy.cpp:
        (WebKit::GPUProcessProxy::GPUProcessProxy):
        (WebKit::GPUProcessProxy::openGPUProcessConnection):
        (WebKit::GPUProcessProxy::didCreateContextForVisibilityPropagation):
        (WebKit::GPUProcessProxy::contextIDForVisibilityPropagation const):
        * UIProcess/GPU/GPUProcessProxy.h:
        * UIProcess/GPU/GPUProcessProxy.messages.in:
        * UIProcess/PageClient.h:
        (WebKit::PageClient::didCreateContextInGPUProcessForVisibilityPropagation):
        (WebKit::PageClient::gpuProcessCrashed):
        * UIProcess/WebPageProxy.cpp:
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::gpuProcessCrashed):
        (WebKit::WebProcessPool::setWebProcessIsPlayingAudibleMedia):
        (WebKit::WebProcessPool::clearWebProcessIsPlayingAudibleMedia):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::gpuProcessCrashed):
        (WebKit::WebProcessProxy::didCreateContextInGPUProcessForVisibilityPropagation):
        * UIProcess/WebProcessProxy.h:
        * UIProcess/ios/PageClientImplIOS.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::didCreateContextInGPUProcessForVisibilityPropagation):
        (WebKit::PageClientImpl::gpuProcessCrashed):
        * UIProcess/ios/WKContentView.h:
        * UIProcess/ios/WKContentView.mm:
        (-[WKContentView _commonInitializationWithProcessPool:configuration:]):
        (-[WKContentView _setupVisibilityPropagationViewForGPUProcess]):
        (-[WKContentView _removeVisibilityPropagationViewForGPUProcess]):
        (-[WKContentView _gpuProcessCrashed]):
        (-[WKContentView _gpuProcessDidCreateContextForVisibilityPropagation]):

2020-02-27  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Implement ImageBuffer shareable backends
        https://bugs.webkit.org/show_bug.cgi?id=207233

        Reviewed by Simon Fraser.

        RemoteImageBufferProxy will create a shareable backend in the GPUProcess.
        Then it will give access to this backend to RemoteImageBuffer in the
        WebProcess by sending an ImageBufferBackendHandle.

        * Sources.txt:
        * SourcesCocoa.txt:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/GPU/graphics/ImageBufferBackendHandle.h: Added.
        This is variant of shareable handles to the ImageBufferBackend data.

        * WebProcess/GPU/graphics/ImageBufferShareableBitmapBackend.cpp: Added.
        (WebKit::ImageBufferShareableBitmapBackend::create):
        The first create method will be called to create the backend of 
        RemoteImageBufferProxy GPUProcess. The second create method will be called
        to create the backend of RemoteImageBuffer in the WebProcess.

        (WebKit::ImageBufferShareableBitmapBackend::ImageBufferShareableBitmapBackend):
        (WebKit::ImageBufferShareableBitmapBackend::createImageBufferBackendHandle const):
        Creates an ImageBufferBackendHandle which will be sent from the GPUProcess
        to the WebProcess.

        (WebKit::ImageBufferShareableBitmapBackend::copyNativeImage const):
        (WebKit::ImageBufferShareableBitmapBackend::copyImage const):
        (WebKit::ImageBufferShareableBitmapBackend::toBGRAData const):
        (WebKit::ImageBufferShareableBitmapBackend::getImageData const):
        (WebKit::ImageBufferShareableBitmapBackend::putImageData):
        * WebProcess/GPU/graphics/ImageBufferShareableBitmapBackend.h: Added.

        * WebProcess/GPU/graphics/PlatformImageBufferShareableBackend.h: Added.
        Defines the platform shareable ImageBufferBackend types.

        * WebProcess/GPU/graphics/cocoa/ImageBufferShareableIOSurfaceBackend.cpp: Added.
        (WebKit::ImageBufferShareableIOSurfaceBackend::create):
        (WebKit::ImageBufferShareableIOSurfaceBackend::createImageBufferBackendHandle const):
        * WebProcess/GPU/graphics/cocoa/ImageBufferShareableIOSurfaceBackend.h: Added.
        Because ImageBufferBackendHandle has to be defined in WebKit, sharing
        the IOSurface backend has to be implemented in WebKit.

        * WebProcess/GPU/media/RemoteAudioDestinationProxy.cpp:
        * WebProcess/GPU/webrtc/MediaRecorderPrivate.cpp:
        * WebProcess/Network/WebSocketChannel.cpp:
        * WebProcess/WebPage/gtk/AcceleratedSurfaceX11.h:
        Unified sources gardening.

2020-02-27  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r257575.

        Broke the watchOS build.

        Reverted changeset:

        "[iOS] Issue mach sandbox extensions to the WebContent process
        for a set of specific services"
        https://bugs.webkit.org/show_bug.cgi?id=208146
        https://trac.webkit.org/changeset/257575

2020-02-27  Daniel Bates  <dabates@apple.com>

        Change HitTestRequestType to an OptionSet
        https://bugs.webkit.org/show_bug.cgi?id=208334

        Reviewed by Wenson Hsieh.

        * WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
        (WebKit::InjectedBundleNavigationAction::InjectedBundleNavigationAction):
        * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
        (WebKit::WebPage::performDictionaryLookupAtLocation):
        * WebProcess/WebPage/WebFrame.cpp:
        (WebKit::WebFrame::hitTest const):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::handleContextMenuEvent):
        (WebKit::WebPage::characterIndexForPointAsync):
        (WebKit::WebPage::determinePrimarySnapshottedPlugIn):
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::rectForElementAtInteractionLocation const):
        (WebKit::WebPage::handleStylusSingleTapAtPoint):
        (WebKit::rangeForPointInRootViewCoordinates):
        (WebKit::WebPage::setFocusedFrameBeforeSelectingTextAtLocation):
        (WebKit::selectionPositionInformation):
        (WebKit::textInteractionPositionInformation):
        (WebKit::WebPage::positionInformation):
        * WebProcess/WebPage/mac/WebPageMac.mm:
        (WebKit::WebPage::shouldDelayWindowOrderingEvent):
        (WebKit::WebPage::acceptsFirstMouse):
        (WebKit::WebPage::performImmediateActionHitTestAtLocation):

2020-02-27  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Unreviewed unified source builds fix.
        https://bugs.webkit.org/show_bug.cgi?id=207198

        Include header files for types referenced in RemoteRenderingBackend.h.

        * GPUProcess/graphics/RemoteRenderingBackendProxy.h:
        * WebProcess/GPU/graphics/RemoteRenderingBackend.h:

2020-02-27  Tim Monroe  <timmon@apple.com>

        Add GPU Process support for accessLog et al.
        https://bugs.webkit.org/show_bug.cgi?id=207007

        Reviewed by Jon Lee.

        No tests included here.

        * GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp:
        (WebKit::RemoteMediaPlayerManagerProxy::updateVideoFullscreenInlineImage):
        (WebKit::RemoteMediaPlayerManagerProxy::setVideoFullscreenFrame):
        (WebKit::RemoteMediaPlayerManagerProxy::setVideoFullscreenGravity):
        (WebKit::RemoteMediaPlayerManagerProxy::setVideoFullscreenMode):
        (WebKit::RemoteMediaPlayerManagerProxy::setVolume):
        (WebKit::RemoteMediaPlayerManagerProxy::setBufferingPolicy):
        (WebKit::RemoteMediaPlayerManagerProxy::videoFullscreenStandbyChanged):
        (WebKit::RemoteMediaPlayerManagerProxy::accessLog):
        (WebKit::RemoteMediaPlayerManagerProxy::errorLog):
        * GPUProcess/media/RemoteMediaPlayerManagerProxy.h:
        * GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in:
        * GPUProcess/media/RemoteMediaPlayerProxy.cpp:
        (WebKit::RemoteMediaPlayerProxy::updateVideoFullscreenInlineImage):
        (WebKit::RemoteMediaPlayerProxy::setVideoFullscreenMode):
        (WebKit::RemoteMediaPlayerProxy::setBufferingPolicy):
        (WebKit::RemoteMediaPlayerProxy::videoFullscreenStandbyChanged):
        (WebKit::RemoteMediaPlayerProxy::accessLog):
        (WebKit::RemoteMediaPlayerProxy::errorLog):
        * GPUProcess/media/RemoteMediaPlayerProxy.h:
        * GPUProcess/media/RemoteMediaPlayerProxy.messages.in:
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
        (WebKit::MediaPlayerPrivateRemote::updateVideoFullscreenInlineImage):
        (WebKit::MediaPlayerPrivateRemote::setVideoFullscreenMode):
        (WebKit::MediaPlayerPrivateRemote::videoFullscreenStandbyChanged):
        (WebKit::MediaPlayerPrivateRemote::accessLog const):
        (WebKit::MediaPlayerPrivateRemote::errorLog const):
        (WebKit::MediaPlayerPrivateRemote::setBufferingPolicy):

2020-02-27  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Issue mach sandbox extensions to the WebContent process for a set of specific services
        https://bugs.webkit.org/show_bug.cgi?id=208146

        Reviewed by Brent Fulgham.

        We are still seeing some accesses from the WebContent process to a small set of services. Since we do not currently have
        backtraces for these accesses, make a speculative patch, where we issue these extension for all apps except Safari.

        Test: fast/sandbox/ios/sandbox-mach-lookup-mail.html

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const):
        (WebKit::WebProcessCreationParameters::decode):
        * Shared/WebProcessCreationParameters.h:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):

2020-02-27  Alex Christensen  <achristensen@webkit.org>

        Add SPI to query WKFrameInfos in a WKWebView
        https://bugs.webkit.org/show_bug.cgi?id=208212

        Reviewed by Brady Eidson.

        This adds WKWebView._allFrames and SPI on WKFrameInfo to look at parent and child frames.
        This will help with rdar://problem/59783184 and other similar tasks.
        In order to do this, I needed to make API::FrameInfo::create take a WebKit::FrameInfoData,
        which I pass from the WebProcess.  Where we used to pass only a SecurityOriginData,
        we now pass a FrameInfoData which contains a SecurityOriginData and more information.
        I needed to deprecate WKFrameCreateFrameInfo which had its last use removed in rdar://problem/59768710
        because there was not enough information in its parameters to create a WKFrameInfo with this new data.
        I also replaced the test-only SPI WKFrameInfoGetFrameHandleRef with WKFrameInfoCreateFrameHandleRef
        so we don't need to keep a strong reference to the handle and other new members in API::FrameInfo.

        New functionality covered by API tests and I removed the last tests' use of now-deprecated WKFrameCreateFrameInfo.

        * Shared/FrameInfoData.cpp:
        (WebKit::FrameInfoData::encode const):
        (WebKit::FrameInfoData::decode):
        * Shared/FrameInfoData.h:
        * UIProcess/API/APIFrameInfo.cpp:
        (API::FrameInfo::FrameInfo):
        (API::FrameInfo::handle const):
        (API::FrameInfo::parentFrameHandle const):
        (API::FrameInfo::childFrameHandles const):
        (): Deleted.
        * UIProcess/API/APIFrameInfo.h:
        * UIProcess/API/APINavigationClient.h:
        (API::NavigationClient::didFailProvisionalLoadInSubframeWithError):
        * UIProcess/API/APIUIClient.h:
        (API::UIClient::runJavaScriptAlert):
        (API::UIClient::runJavaScriptConfirm):
        (API::UIClient::runJavaScriptPrompt):
        (API::UIClient::runBeforeUnloadConfirmPanel):
        (API::UIClient::runOpenPanel):
        (API::UIClient::decidePolicyForGeolocationPermissionRequest):
        (API::UIClient::runWebAuthenticationPanel):
        * UIProcess/API/C/WKFrame.cpp:
        (WKFrameCreateFrameInfo):
        * UIProcess/API/C/WKFrame.h:
        * UIProcess/API/C/WKFrameInfoRef.cpp:
        (WKFrameInfoCreateFrameHandleRef):
        (WKFrameInfoGetFrameHandleRef): Deleted.
        * UIProcess/API/C/WKFrameInfoRef.h:
        * UIProcess/API/C/WKPage.cpp:
        (WKPageSetPageUIClient):
        (WKPageSetPageNavigationClient):
        * UIProcess/API/Cocoa/WKFrameInfo.mm:
        (-[WKFrameInfo securityOrigin]):
        (-[WKFrameInfo _handle]):
        (-[WKFrameInfo _parentFrameHandle]):
        (-[WKFrameInfo _childFrameHandles]):
        * UIProcess/API/Cocoa/WKFrameInfoPrivate.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _allFrames:]):
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/Cocoa/NavigationState.h:
        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::NavigationClient::didFailProvisionalLoadInSubframeWithError):
        * UIProcess/Cocoa/SOAuthorization/SOAuthorizationCoordinator.mm:
        (WebKit::SOAuthorizationCoordinator::tryAuthorize):
        * UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm:
        (WebKit::SOAuthorizationSession::continueStartAfterDecidePolicy):
        * UIProcess/Cocoa/UIDelegate.h:
        * UIProcess/Cocoa/UIDelegate.mm:
        (WebKit::UIDelegate::UIClient::runJavaScriptAlert):
        (WebKit::UIDelegate::UIClient::runJavaScriptConfirm):
        (WebKit::UIDelegate::UIClient::runJavaScriptPrompt):
        (WebKit::UIDelegate::UIClient::decidePolicyForGeolocationPermissionRequest):
        (WebKit::UIDelegate::UIClient::runBeforeUnloadConfirmPanel):
        (WebKit::UIDelegate::UIClient::runOpenPanel):
        (WebKit::UIDelegate::UIClient::runWebAuthenticationPanel):
        * UIProcess/PageClient.h:
        * UIProcess/ProvisionalPageProxy.cpp:
        (WebKit::ProvisionalPageProxy::didFailProvisionalLoadForFrame):
        (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionAsync):
        (WebKit::ProvisionalPageProxy::decidePolicyForResponse):
        (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionSync):
        * UIProcess/ProvisionalPageProxy.h:
        * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
        (WebKit::AuthenticatorManager::runPanel):
        * UIProcess/WebAuthentication/WebAuthenticationRequestData.h:
        * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp:
        (WebKit::WebAuthenticatorCoordinatorProxy::makeCredential):
        (WebKit::WebAuthenticatorCoordinatorProxy::getAssertion):
        * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.h:
        * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.messages.in:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::getAllFrames):
        (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
        (WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared):
        (WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
        (WebKit::WebPageProxy::decidePolicyForNavigationActionAsyncShared):
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
        (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
        (WebKit::WebPageProxy::decidePolicyForNavigationActionSyncShared):
        (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
        (WebKit::WebPageProxy::decidePolicyForResponse):
        (WebKit::WebPageProxy::decidePolicyForResponseShared):
        (WebKit::WebPageProxy::runJavaScriptAlert):
        (WebKit::WebPageProxy::runJavaScriptConfirm):
        (WebKit::WebPageProxy::runJavaScriptPrompt):
        (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel):
        (WebKit::WebPageProxy::runOpenPanel):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/ios/PageClientImplIOS.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::decidePolicyForGeolocationPermissionRequest):
        * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp:
        (WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation):
        * WebProcess/WebAuthentication/WebAuthenticatorCoordinator.cpp:
        (WebKit::WebAuthenticatorCoordinator::makeCredential):
        (WebKit::WebAuthenticatorCoordinator::getAssertion):
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::runBeforeUnloadConfirmPanel):
        (WebKit::WebChromeClient::runJavaScriptAlert):
        (WebKit::WebChromeClient::runJavaScriptConfirm):
        (WebKit::WebChromeClient::runJavaScriptPrompt):
        (WebKit::WebChromeClient::runOpenPanel):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDidFailProvisionalLoad):
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
        * WebProcess/WebPage/WebFrame.cpp:
        (WebKit::WebFrame::childFrameIDs const):
        (WebKit::WebFrame::info const):
        * WebProcess/WebPage/WebFrame.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::getAllFrames):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2020-02-27  Jacob Uphoff  <jacob_uphoff@apple.com>

        Unreviewed, rolling out r257530.

        This commit seems to have broke the build internally for
        watchOS

        Reverted changeset:

        "Add SPI to query WKFrameInfos in a WKWebView"
        https://bugs.webkit.org/show_bug.cgi?id=208212
        https://trac.webkit.org/changeset/257530

2020-02-26  Brady Eidson  <beidson@apple.com>

        Annotate mediaType with an availability macro.
        https://bugs.webkit.org/show_bug.cgi?id=208284

        Reviewed by Alex Christensen.

        * UIProcess/API/Cocoa/WKWebView.h:

2020-02-26  Alex Christensen  <achristensen@webkit.org>

        Remove unused WebsiteDataStore::setSourceApplicationBundleIdentifier
        https://bugs.webkit.org/show_bug.cgi?id=206456

        Reviewed by Brady Eidson.

        The replacement on WebsiteDataStoreConfiguration has been adopted.

        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _sourceApplicationBundleIdentifier]):
        (-[WKWebsiteDataStore _setSourceApplicationBundleIdentifier:]):
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::setSourceApplicationBundleIdentifier): Deleted.
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        (WebKit::WebsiteDataStore::sourceApplicationBundleIdentifier const):

2020-02-26  Alex Christensen  <achristensen@webkit.org>

        _WKUserContentWorld should be a wrapper around WKContentWorld
        https://bugs.webkit.org/show_bug.cgi?id=208274

        Reviewed by Brady Eidson.

        Various SPIs were getting confused between the two.
        Updated API tests which expected pointer equality, which is no longer true or important.

        * Shared/API/APIObject.h:
        * Shared/Cocoa/APIObject.mm:
        (API::Object::newObject):
        * Sources.txt:
        * UIProcess/API/APIContentWorld.cpp:
        (API::ContentWorld::ContentWorld):
        (API::ContentWorldBase::ContentWorldBase): Deleted.
        * UIProcess/API/APIContentWorld.h:
        (API::ContentWorldBase::identifier const): Deleted.
        (API::ContentWorldBase::name const): Deleted.
        (API::ContentWorldBase::worldData const): Deleted.
        (API::ContentWorldBase::ContentWorldBase): Deleted.
        * UIProcess/API/APIUserContentWorld.cpp: Removed.
        * UIProcess/API/APIUserContentWorld.h: Removed.
        * UIProcess/API/APIUserScript.cpp:
        (API::UserScript::UserScript):
        * UIProcess/API/APIUserScript.h:
        * UIProcess/API/APIUserStyleSheet.cpp:
        (API::UserStyleSheet::UserStyleSheet):
        * UIProcess/API/APIUserStyleSheet.h:
        * UIProcess/API/C/WKPageGroup.cpp:
        (WKPageGroupAddUserStyleSheet):
        (WKPageGroupAddUserScript):
        * UIProcess/API/C/WKUserScriptRef.cpp:
        (WKUserScriptCreateWithSource):
        * UIProcess/API/Cocoa/WKContentWorld.mm:
        (-[WKContentWorld _userContentWorld]):
        * UIProcess/API/Cocoa/WKUserContentController.mm:
        (-[WKUserContentController addScriptMessageHandler:name:]):
        (-[WKUserContentController removeScriptMessageHandlerForName:]):
        (-[WKUserContentController _removeAllUserScriptsAssociatedWithUserContentWorld:]):
        (-[WKUserContentController _removeAllUserStyleSheetsAssociatedWithUserContentWorld:]):
        (-[WKUserContentController _addScriptMessageHandler:name:userContentWorld:]):
        (-[WKUserContentController _removeScriptMessageHandlerForName:userContentWorld:]):
        (-[WKUserContentController _removeAllScriptMessageHandlersAssociatedWithUserContentWorld:]):
        * UIProcess/API/Cocoa/WKUserScript.mm:
        (-[WKUserScript initWithSource:injectionTime:forMainFrameOnly:]):
        (-[WKUserScript _initWithSource:injectionTime:forMainFrameOnly:legacyWhitelist:legacyBlacklist:userContentWorld:]):
        (-[WKUserScript _initWithSource:injectionTime:forMainFrameOnly:legacyWhitelist:legacyBlacklist:associatedURL:userContentWorld:]):
        (-[WKUserScript _userContentWorld]):
        * UIProcess/API/Cocoa/_WKUserContentWorld.mm:
        (-[_WKUserContentWorld _initWithName:]):
        (-[_WKUserContentWorld _init]):
        (-[_WKUserContentWorld _initWithContentWorld:]):
        (+[_WKUserContentWorld worldWithName:]):
        (+[_WKUserContentWorld normalWorld]):
        (-[_WKUserContentWorld name]):
        (-[_WKUserContentWorld _apiObject]):
        (-[_WKUserContentWorld dealloc]): Deleted.
        * UIProcess/API/Cocoa/_WKUserContentWorldInternal.h:
        * UIProcess/API/Cocoa/_WKUserStyleSheet.mm:
        (-[_WKUserStyleSheet initWithSource:forMainFrameOnly:]):
        (-[_WKUserStyleSheet initWithSource:forMainFrameOnly:legacyWhitelist:legacyBlacklist:userContentWorld:]):
        (-[_WKUserStyleSheet initWithSource:forMainFrameOnly:legacyWhitelist:legacyBlacklist:baseURL:userContentWorld:]):
        * UIProcess/UserContent/WebScriptMessageHandler.cpp:
        (WebKit::WebScriptMessageHandler::create):
        (WebKit::WebScriptMessageHandler::WebScriptMessageHandler):
        * UIProcess/UserContent/WebScriptMessageHandler.h:
        (WebKit::WebScriptMessageHandler::world):
        * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
        (WebKit::WebUserContentControllerProxy::addProcess):
        (WebKit::WebUserContentControllerProxy::addContentWorldUse):
        (WebKit::WebUserContentControllerProxy::shouldSendRemoveContentWorldsMessage):
        (WebKit::WebUserContentControllerProxy::removeContentWorldUses):
        (WebKit::WebUserContentControllerProxy::addUserScript):
        (WebKit::WebUserContentControllerProxy::removeUserScript):
        (WebKit::WebUserContentControllerProxy::removeAllUserScripts):
        (WebKit::WebUserContentControllerProxy::addUserStyleSheet):
        (WebKit::WebUserContentControllerProxy::removeUserStyleSheet):
        (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets):
        (WebKit::WebUserContentControllerProxy::addUserScriptMessageHandler):
        (WebKit::WebUserContentControllerProxy::removeUserMessageHandlerForName):
        (WebKit::WebUserContentControllerProxy::removeAllUserMessageHandlers):
        (WebKit::WebUserContentControllerProxy::addUserContentWorldUse): Deleted.
        (WebKit::WebUserContentControllerProxy::shouldSendRemoveUserContentWorldsMessage): Deleted.
        (WebKit::WebUserContentControllerProxy::removeUserContentWorldUses): Deleted.
        * UIProcess/UserContent/WebUserContentControllerProxy.h:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/UserContent/WebUserContentController.cpp:
        (WebKit::WebUserContentController::addContentWorld):
        (WebKit::WebUserContentController::addContentWorlds):
        (WebKit::WebUserContentController::removeContentWorlds):
        (WebKit::WebUserContentController::addUserScripts):
        (WebKit::WebUserContentController::removeUserScript):
        (WebKit::WebUserContentController::removeAllUserScripts):
        (WebKit::WebUserContentController::addUserStyleSheets):
        (WebKit::WebUserContentController::removeUserStyleSheet):
        (WebKit::WebUserContentController::removeAllUserStyleSheets):
        (WebKit::WebUserContentController::addUserScriptMessageHandlers):
        (WebKit::WebUserContentController::removeUserScriptMessageHandler):
        (WebKit::WebUserContentController::removeAllUserScriptMessageHandlers):
        (WebKit::WebUserContentController::addUserContentWorld): Deleted.
        (WebKit::WebUserContentController::addUserContentWorlds): Deleted.
        (WebKit::WebUserContentController::removeUserContentWorlds): Deleted.
        * WebProcess/UserContent/WebUserContentController.h:
        * WebProcess/UserContent/WebUserContentController.messages.in:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_processDisplayName):
        (WebKit::WebPage::runJavaScriptInMainFrameScriptWorld):

2020-02-26  Ryosuke Niwa  <rniwa@webkit.org>

        Create AudioDestination in the GPU process
        https://bugs.webkit.org/show_bug.cgi?id=208179

        Reviewed by Jer Noble.

        Create AudioDestination in the GPU process instead of the WebContent process for WebAudio API when
        the Media-in-GPU-process feature is enabled.

        To do this, WebMediaStrategy, a concrete implementation of MediaStrategy, in the WebContent process gets
        a boolean flag indicating whether the GPU process should be used for AudioDestination or not. When the flag
        is set, we create RemoteAudioDestinationProxy instead of AudioDestination in WebContent process.

        Each RemoteAudioDestinationProxy talks to RemoteAudioDestinationManager in the GPU process and creates
        a corresponding RemoteAudioDestination which in turn creates WebCore's AudioDestination in the GPU process.

        RemoteAudioDestination is itself an AudioIOCallback for AudioDestination it creates, and delegates
        its callback to WebContent process' RemoteAudioDestinationProxy as needed.

        In this initial patch, we send RemoteAudioDestinationProxy::RenderBuffer IPC call to the WebContent process
        for each render call we get from CoreAudio for simplicity using newly introduced RemoteAudioBusData,
        which holds a SharedMemory for each channel in the audio bus.

        We will eliminate this IPC overhead in a follow up patch using CARingBuffer.

        * DerivedSources-input.xcfilelist:
        * DerivedSources-output.xcfilelist:
        * DerivedSources.make:
        * GPUProcess/GPUConnectionToWebProcess.cpp:
        (WebKit::GPUConnectionToWebProcess::remoteAudioDestinationManager): Added.
        (WebKit::GPUConnectionToWebProcess::didReceiveMessage): Added the code to dispatch messages to
        RemoteAudioDestinationManager.
        (WebKit::GPUConnectionToWebProcess::didReceiveSyncMessage): Ditto.
        * GPUProcess/GPUConnectionToWebProcess.h:
        * GPUProcess/media/RemoteAudioDestinationManager.cpp: Added.
        (WebKit::RemoteAudioDestination): Added. This class is the backing object which creates WebCore's
        AudioDestination and actually talks to CoreAudio in GPU process.
        (WebKit::RemoteAudioDestination::create): Added.

        (WebKit::RemoteAudioDestination::~RemoteAudioDestination): Added.
        (WebKit::RemoteAudioDestination::scheduleGracefulShutdownIfNeeded): Delays the deletion of this object
        until the audio threads stops running.
        (WebKit::RemoteAudioDestination::start): Added.
        (WebKit::RemoteAudioDestination::stop): Added.
        (WebKit::RemoteAudioDestination::isPlaying): Added.
        (WebKit::RemoteAudioDestination::RemoteAudioDestination): Added.
        (WebKit::RemoteAudioDestination::render): Sends a sync IPC to the WebContent process'
        RemoteAudioDestinationProxy to fill the audio buffer. Note that this function gets called in audio thread.
        (WebKit::RemoteAudioDestination::isPlayingDidChange): Added.
        (WebKit::RemoteAudioDestinationManager): Added. This class manages all RemoteAudioDestination objects owned
        by a single WebContent process.
        (WebKit::RemoteAudioDestinationManager::RemoteAudioDestinationManager): Added.
        (WebKit::RemoteAudioDestinationManager::~RemoteAudioDestinationManager): Added.
        (WebKit::RemoteAudioDestinationManager::createAudioDestination): Added.
        (WebKit::RemoteAudioDestinationManager::deleteAudioDestination): Added.
        (WebKit::RemoteAudioDestinationManager::startAudioDestination): Added.
        (WebKit::RemoteAudioDestinationManager::stopAudioDestination): Added.
        * GPUProcess/media/RemoteAudioDestinationManager.h: Added.
        (WebKit::RemoteAudioDestinationManager): Added.
        (WebKit::RemoteAudioDestinationManager::didReceiveSyncMessageFromWebProcess): Added.
        (WebKit::RemoteAudioDestinationManager::didReceiveMessageFromWebProcess): Added.
        * GPUProcess/media/RemoteAudioDestinationManager.messages.in: Added.
        * NetworkProcess/NetworkProcessPlatformStrategies.cpp:
        (WebKit::NetworkProcessPlatformStrategies::createMediaStrategy): Added. Returns nullptr since Networking
        process has no business running AudioDestination.
        * NetworkProcess/NetworkProcessPlatformStrategies.h:
        (WebKit::NetworkProcessPlatformStrategies):
        * PlatformMac.cmake:
        * Scripts/webkit/messages.py:
        * Shared/RemoteAudioDestinationIdentifier.h: Added.
        (WebKit::RemoteAudioDestinationIdentifierType): Added.
        (WebKit::RemoteAudioDestinationIdentifier): Added. The identifier for each RemoteAudioDestination
        and RemoteAudioDestinationProxy (corresponding objects of each class use the same ID to communicate).
        * Sources.txt:
        * SourcesCocoa.txt:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/GPU/media/RemoteAudioBusData.h: Added.
        (WebKit::RemoteAudioBusData): Added. Encodes the information about each render call.
        (WebKit::RemoteAudioBusData::encode const): Added.
        (WebKit::RemoteAudioBusData::decode): Added.
        * WebProcess/GPU/media/RemoteAudioDestinationProxy.cpp: Added.
        (WebKit::RemoteAudioDestinationProxy): Added.
        (WebKit::RemoteAudioDestinationProxy::create): Added.
        (WebKit::RemoteAudioDestinationProxy::RemoteAudioDestinationProxy): Added.
        (WebKit::RemoteAudioDestinationProxy::~RemoteAudioDestinationProxy): Added.
        (WebKit::RemoteAudioDestinationProxy::start): Added.
        (WebKit::RemoteAudioDestinationProxy::stop): Added.
        (WebKit::RemoteAudioDestinationProxy::renderBuffer): Added. Calls WebCore's AudioIOCallback to fill
        the audio buffer given by the GPU process.
        (WebKit::RemoteAudioDestinationProxy::didChangeIsPlaying):
        * WebProcess/GPU/media/RemoteAudioDestinationProxy.h: Added.
        (WebKit::RemoteAudioDestinationProxy::didReceiveMessageFromGPUProcess): Added.
        (WebKit::RemoteAudioDestinationProxy::isPlaying): Added.
        (WebKit::RemoteAudioDestinationProxy::sampleRate): Added.
        * WebProcess/GPU/media/RemoteAudioDestinationProxy.messages.in: Added.
        * WebProcess/GPU/media/TextTrackPrivateRemote.cpp: Fixed the unified builds.
        * WebProcess/GPU/media/TextTrackPrivateRemote.h: Ditto.
        * WebProcess/GPU/media/WebMediaStrategy.cpp: Added.
        (WebKit::WebMediaStrategy::createAudioDestination): Added.
        * WebProcess/GPU/media/WebMediaStrategy.h: Added.
        (WebKit::WebMediaStrategy): Added.
        (WebKit::WebMediaStrategy::setUseGPUProcess): Added.
        * WebProcess/GPU/webrtc/SampleBufferDisplayLayer.cpp: Fixed the unified builds.
        * WebProcess/GPU/webrtc/SampleBufferDisplayLayerManager.cpp: Fixed the unified builds.
        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
        (WebKit::WebPlatformStrategies::createMediaStrategy): Added.
        * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::updatePreferences): Sets WebMediaStrategy's flag to use GPU process.

2020-02-26  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Implement the remote RenderingBackend
        https://bugs.webkit.org/show_bug.cgi?id=207198

        Reviewed by Simon Fraser.

        RemoteRenderingBackend and RemoteRenderingBackendProxy will be responsible
        for  creating the two parts of the ImageBuffer: RemoteImageBuffer and
        RemoteImageBufferProxy. They will also be responsible for sending and
        receiving the messages for the remote the ImageBuffers.

        * CMakeLists.txt:
        * DerivedSources-input.xcfilelist:
        * DerivedSources-output.xcfilelist:
        * DerivedSources.make:

        * GPUProcess/GPUConnectionToWebProcess.cpp:
        (WebKit::GPUConnectionToWebProcess::createRenderingBackend):
        (WebKit::GPUConnectionToWebProcess::releaseRenderingBackend):
        (WebKit::GPUConnectionToWebProcess::dispatchMessage):
        (WebKit::GPUConnectionToWebProcess::dispatchSyncMessage):
        (WebKit::GPUConnectionToWebProcess::didReceiveMessage): Deleted.
        (WebKit::GPUConnectionToWebProcess::didReceiveSyncMessage): Deleted.
        * GPUProcess/GPUConnectionToWebProcess.h:
        (WebKit::GPUConnectionToWebProcess::messageReceiverMap):
        (WebKit::GPUConnectionToWebProcess::webProcessIdentifier const):
        GPUConnectionToWebProcess dispatches messages to RemoteRenderingBackendProxy.

        * GPUProcess/GPUConnectionToWebProcess.messages.in:
        Adding the 'WantsDispatchMessage' attribute will force the messages.py
        to generate code which calls dispatchMessage() and didReceiveSyncMessage()
        when messages are received.

        * GPUProcess/graphics: Added.
        * GPUProcess/graphics/RemoteRenderingBackendProxy.cpp: Added.
        (WebKit::RemoteRenderingBackendProxy::create):
        (WebKit::RemoteRenderingBackendProxy::RemoteRenderingBackendProxy):
        (WebKit::RemoteRenderingBackendProxy::~RemoteRenderingBackendProxy):
        (WebKit::RemoteRenderingBackendProxy::messageSenderConnection const):
        (WebKit::RemoteRenderingBackendProxy::messageSenderDestinationID const):
        (WebKit::RemoteRenderingBackendProxy::createImageBuffer):
        (WebKit::RemoteRenderingBackendProxy::releaseImageBuffer):
        * GPUProcess/graphics/RemoteRenderingBackendProxy.h: Added.
        * GPUProcess/graphics/RemoteRenderingBackendProxy.messages.in: Added.
        RemoteRenderingBackendProxy is responsible for creating the remote
        ImageBuffer proxy in the GPUProcess side. It holds it in a HashMap of
        std::unique_ptr<ImageBuffer> indexed by the ImageBufferIdentifier.

        * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRenderer.cpp:
        * GPUProcess/webrtc/RemoteMediaRecorder.cpp:
        * GPUProcess/webrtc/RemoteMediaRecorderManager.cpp:
        * GPUProcess/webrtc/RemoteSampleBufferDisplayLayer.cpp:
        Unified sources gardening.

        * Scripts/webkit/messages.py:
        Handle 'WantsDispatchMessage' attribute.

        * Shared/WebCoreArgumentCoders.h:
        * Sources.txt:
        * SourcesCocoa.txt:
        * WebKit.xcodeproj/project.pbxproj:

        * WebProcess/GPU/GPUProcessConnection.cpp:
        (WebKit::GPUProcessConnection::dispatchMessage):
        (WebKit::GPUProcessConnection::dispatchSyncMessage):
        (WebKit::GPUProcessConnection::didReceiveMessage): Deleted.
        * WebProcess/GPU/GPUProcessConnection.h:
        (WebKit::GPUProcessConnection::messageReceiverMap):
        * WebProcess/GPU/GPUProcessConnection.messages.in:
        GPUConnection dispatches messages to RemoteRenderingBackend.

        * WebProcess/GPU/graphics: Added.
        * WebProcess/GPU/graphics/ImageBufferIdentifier.h: Added.
        * WebProcess/GPU/graphics/RemoteRenderingBackend.cpp: Added.
        (WebKit::RemoteRenderingBackend::create):
        (WebKit::RemoteRenderingBackend::RemoteRenderingBackend):
        (WebKit::RemoteRenderingBackend::~RemoteRenderingBackend):
        (WebKit::RemoteRenderingBackend::messageSenderConnection const):
        (WebKit::RemoteRenderingBackend::messageSenderDestinationID const):
        (WebKit::RemoteRenderingBackend::createImageBuffer):
        (WebKit::RemoteRenderingBackend::releaseImageBuffer):
        * WebProcess/GPU/graphics/RemoteRenderingBackend.h: Added.
        * WebProcess/GPU/graphics/RemoteRenderingBackend.messages.in: Added.
        * WebProcess/GPU/graphics/RenderingBackendIdentifier.h: Added.
        RemoteRenderingBackend is responsible for creating the remote ImageBuffer
        in the WebProcess side. It holds it in a HashMap of ImageBuffer* indexed
        by the ImageBufferIdentifier.

        * WebProcess/GPU/media/TextTrackPrivateRemote.cpp:
        * WebProcess/GPU/media/TextTrackPrivateRemote.h:
        * WebProcess/GPU/webrtc/MediaRecorderPrivate.cpp:
        * WebProcess/GPU/webrtc/MediaRecorderProvider.cpp:
        * WebProcess/GPU/webrtc/SampleBufferDisplayLayer.cpp:
        * WebProcess/GPU/webrtc/SampleBufferDisplayLayerManager.cpp:
        Unified sources gardening.

        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::createDisplayRefreshMonitor const):
        (WebKit::WebChromeClient::createImageBuffer const):
        * WebProcess/WebCoreSupport/WebChromeClient.h:
        Create the remote ImageBuffer.

2020-02-26  Alex Christensen  <achristensen@webkit.org>

        Remove WebsiteDataStore::setSourceApplicationSecondaryIdentifier
        https://bugs.webkit.org/show_bug.cgi?id=206452

        Reviewed by Chris Dumez.

        Its replacement on WebsiteDataStoreConfiguration was adopted in rdar://problem/58671704

        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _sourceApplicationSecondaryIdentifier]):
        (-[WKWebsiteDataStore _setSourceApplicationSecondaryIdentifier:]):
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::setSourceApplicationSecondaryIdentifier): Deleted.
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        (WebKit::WebsiteDataStore::sourceApplicationSecondaryIdentifier const):

2020-02-26  Alex Christensen  <achristensen@webkit.org>

        Remove WebsiteDataStore setters for allowsCellularAccess, proxyConfiguration, and boundInterfaceIdentifier
        https://bugs.webkit.org/show_bug.cgi?id=206390

        Reviewed by Chris Dumez.

        The WKWebsiteDataStore SPI was deprecated with replacement on _WKWebsiteDataStoreConfiguration,
        and the replacements were adopted in rdar://problem/58359766

        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _setBoundInterfaceIdentifier:]):
        (-[WKWebsiteDataStore _boundInterfaceIdentifier]):
        (-[WKWebsiteDataStore _setAllowsCellularAccess:]):
        (-[WKWebsiteDataStore _allowsCellularAccess]):
        (-[WKWebsiteDataStore _setProxyConfiguration:]):
        (-[WKWebsiteDataStore _proxyConfiguration]):
        * UIProcess/Cocoa/WebPageProxyCocoa.mm:
        (WebKit::WebPageProxy::paymentCoordinatorBoundInterfaceIdentifier):
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::parameters):
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        (WebKit::WebsiteDataStore::networkingHasBegun):
        (WebKit::WebsiteDataStore::setBoundInterfaceIdentifier): Deleted.
        (WebKit::WebsiteDataStore::boundInterfaceIdentifier): Deleted.
        (WebKit::WebsiteDataStore::setAllowsCellularAccess): Deleted.
        (WebKit::WebsiteDataStore::allowsCellularAccess): Deleted.
        (WebKit::WebsiteDataStore::setProxyConfiguration): Deleted.
        (WebKit::WebsiteDataStore::proxyConfiguration): Deleted.

2020-02-27  Simon Fraser  <simon.fraser@apple.com>

        Add ENABLE(SCROLLING_THREAD) and use it to turn off some code we don't need for iOS
        https://bugs.webkit.org/show_bug.cgi?id=208282

        Reviewed by Tim Horton.

        Protect scrolling-thread related code in EventDispatcher with ENABLE(SCROLLING_THREAD),
        and don't register pages with EventDispatcher unless ENABLE(SCROLLING_THREAD) is true.

        * WebProcess/WebPage/EventDispatcher.cpp:
        (WebKit::EventDispatcher::wheelEvent):
        * WebProcess/WebPage/EventDispatcher.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::WebPage):
        (WebKit::WebPage::close):

2020-02-26  Fujii Hironori  <Hironori.Fujii@sony.com>

        Unreviewed unified source builds fix.

        > NetworkProcess\WebStorage\LocalStorageDatabase.cpp(59): error C2653: 'RunLoop': is not a class or namespace name

        * NetworkProcess/WebStorage/LocalStorageDatabase.cpp:

2020-02-26  Jacob Uphoff  <jacob_uphoff@apple.com>

        Unreviewed, rolling out r257508.

        This commit broke the watchos build

        Reverted changeset:

        "[iOS] Issue mach sandbox extensions to the WebContent process
        for a set of specific services"
        https://bugs.webkit.org/show_bug.cgi?id=208146
        https://trac.webkit.org/changeset/257508

2020-02-26  Alex Christensen  <achristensen@webkit.org>

        Add SPI to query WKFrameInfos in a WKWebView
        https://bugs.webkit.org/show_bug.cgi?id=208212

        Reviewed by Brady Eidson.

        This adds WKWebView._allFrames and SPI on WKFrameInfo to look at parent and child frames.
        This will help with rdar://problem/59783184 and other similar tasks.
        In order to do this, I needed to make API::FrameInfo::create take a WebKit::FrameInfoData,
        which I pass from the WebProcess.  Where we used to pass only a SecurityOriginData,
        we now pass a FrameInfoData which contains a SecurityOriginData and more information.
        I needed to deprecate WKFrameCreateFrameInfo which had its last use removed in rdar://problem/59768710
        because there was not enough information in its parameters to create a WKFrameInfo with this new data.
        I also replaced the test-only SPI WKFrameInfoGetFrameHandleRef with WKFrameInfoCreateFrameHandleRef
        so we don't need to keep a strong reference to the handle and other new members in API::FrameInfo.

        New functionality covered by API tests and I removed the last tests' use of now-deprecated WKFrameCreateFrameInfo.

        * Shared/FrameInfoData.cpp:
        (WebKit::FrameInfoData::encode const):
        (WebKit::FrameInfoData::decode):
        * Shared/FrameInfoData.h:
        * UIProcess/API/APIFrameInfo.cpp:
        (API::FrameInfo::FrameInfo):
        (API::FrameInfo::handle const):
        (API::FrameInfo::parentFrameHandle const):
        (API::FrameInfo::childFrameHandles const):
        (): Deleted.
        * UIProcess/API/APIFrameInfo.h:
        * UIProcess/API/APINavigationClient.h:
        (API::NavigationClient::didFailProvisionalLoadInSubframeWithError):
        * UIProcess/API/APIUIClient.h:
        (API::UIClient::runJavaScriptAlert):
        (API::UIClient::runJavaScriptConfirm):
        (API::UIClient::runJavaScriptPrompt):
        (API::UIClient::runBeforeUnloadConfirmPanel):
        (API::UIClient::runOpenPanel):
        (API::UIClient::decidePolicyForGeolocationPermissionRequest):
        (API::UIClient::runWebAuthenticationPanel):
        * UIProcess/API/C/WKFrame.cpp:
        (WKFrameCreateFrameInfo):
        * UIProcess/API/C/WKFrame.h:
        * UIProcess/API/C/WKFrameInfoRef.cpp:
        (WKFrameInfoCreateFrameHandleRef):
        (WKFrameInfoGetFrameHandleRef): Deleted.
        * UIProcess/API/C/WKFrameInfoRef.h:
        * UIProcess/API/C/WKPage.cpp:
        (WKPageSetPageUIClient):
        (WKPageSetPageNavigationClient):
        * UIProcess/API/Cocoa/WKFrameInfo.mm:
        (-[WKFrameInfo securityOrigin]):
        (-[WKFrameInfo _handle]):
        (-[WKFrameInfo _parentFrameHandle]):
        (-[WKFrameInfo _childFrameHandles]):
        * UIProcess/API/Cocoa/WKFrameInfoPrivate.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _allFrames:]):
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/Cocoa/NavigationState.h:
        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::NavigationClient::didFailProvisionalLoadInSubframeWithError):
        * UIProcess/Cocoa/SOAuthorization/SOAuthorizationCoordinator.mm:
        (WebKit::SOAuthorizationCoordinator::tryAuthorize):
        * UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm:
        (WebKit::SOAuthorizationSession::continueStartAfterDecidePolicy):
        * UIProcess/Cocoa/UIDelegate.h:
        * UIProcess/Cocoa/UIDelegate.mm:
        (WebKit::UIDelegate::UIClient::runJavaScriptAlert):
        (WebKit::UIDelegate::UIClient::runJavaScriptConfirm):
        (WebKit::UIDelegate::UIClient::runJavaScriptPrompt):
        (WebKit::UIDelegate::UIClient::decidePolicyForGeolocationPermissionRequest):
        (WebKit::UIDelegate::UIClient::runBeforeUnloadConfirmPanel):
        (WebKit::UIDelegate::UIClient::runOpenPanel):
        (WebKit::UIDelegate::UIClient::runWebAuthenticationPanel):
        * UIProcess/PageClient.h:
        * UIProcess/ProvisionalPageProxy.cpp:
        (WebKit::ProvisionalPageProxy::didFailProvisionalLoadForFrame):
        (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionAsync):
        (WebKit::ProvisionalPageProxy::decidePolicyForResponse):
        (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionSync):
        * UIProcess/ProvisionalPageProxy.h:
        * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
        (WebKit::AuthenticatorManager::runPanel):
        * UIProcess/WebAuthentication/WebAuthenticationRequestData.h:
        * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp:
        (WebKit::WebAuthenticatorCoordinatorProxy::makeCredential):
        (WebKit::WebAuthenticatorCoordinatorProxy::getAssertion):
        * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.h:
        * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.messages.in:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::getAllFrames):
        (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
        (WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared):
        (WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
        (WebKit::WebPageProxy::decidePolicyForNavigationActionAsyncShared):
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
        (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
        (WebKit::WebPageProxy::decidePolicyForNavigationActionSyncShared):
        (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
        (WebKit::WebPageProxy::decidePolicyForResponse):
        (WebKit::WebPageProxy::decidePolicyForResponseShared):
        (WebKit::WebPageProxy::runJavaScriptAlert):
        (WebKit::WebPageProxy::runJavaScriptConfirm):
        (WebKit::WebPageProxy::runJavaScriptPrompt):
        (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel):
        (WebKit::WebPageProxy::runOpenPanel):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/ios/PageClientImplIOS.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::decidePolicyForGeolocationPermissionRequest):
        * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp:
        (WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation):
        * WebProcess/WebAuthentication/WebAuthenticatorCoordinator.cpp:
        (WebKit::WebAuthenticatorCoordinator::makeCredential):
        (WebKit::WebAuthenticatorCoordinator::getAssertion):
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::runBeforeUnloadConfirmPanel):
        (WebKit::WebChromeClient::runJavaScriptAlert):
        (WebKit::WebChromeClient::runJavaScriptConfirm):
        (WebKit::WebChromeClient::runJavaScriptPrompt):
        (WebKit::WebChromeClient::runOpenPanel):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDidFailProvisionalLoad):
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
        * WebProcess/WebPage/WebFrame.cpp:
        (WebKit::WebFrame::childFrameIDs const):
        (WebKit::WebFrame::info const):
        * WebProcess/WebPage/WebFrame.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::getAllFrames):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2020-02-26  Don Olmstead  <don.olmstead@sony.com>

        Allow setting of stack sizes for threads
        https://bugs.webkit.org/show_bug.cgi?id=208223

        Reviewed by Yusuke Suzuki.

        Specify ThreadType at the Thread::create callsite.

        * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
        (WebKit::createRunLoop):

2020-02-26  Kate Cheney  <katherine_cheney@apple.com>

        Tests should each use a unique ResourceLoadStatistics file path for its database store
        https://bugs.webkit.org/show_bug.cgi?id=208206
        <rdar://problem/59690272>

        Reviewed by Brady Eidson.

        The ResourceLoadStatistics directory was being set to a non-unique
        default value before being created at the temporary path generated by
        WebKitTestRunner. This was causing crashes and concurrency issues in tests 
        when multiple database stores at the same path are accessed
        simultaneously.

        This patch updates WebProcessPool.cpp to treat the
        resourceLoadStatisticsDirectory parameter like it does with IndexedDB
        to avoid initializing multiple databases at the same file path.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        (WebKit::ResourceLoadStatisticsDatabaseStore::openAndDropOldDatabaseIfNecessary):
        We should use SQLiteFileSystem::deleteDatabaseFile because it takes
        care of additional SQLite files automatically.

        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
        (WebKit::WebResourceLoadStatisticsStore::populateMemoryStoreFromDisk):
        Checks if the path is empty because we no longer
        guarantee that the resourceLoadStatisticsDirectory is set. Also checks
        if m_statisticsStore is initialized before trying to grandfather
        statistics.

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):
        Checks if a default WebsiteDataStore exists before setting the
        parameter to the default value. This way, the parameter is empty if
        WebKitTestRunner hasn't yet set the temporary directory and we won't
        create a new database.

2020-02-26  Christopher Reid  <chris.reid@sony.com>

        [Win] Implement NetworkCache::Data by using FileSystem::MappedFileData
        https://bugs.webkit.org/show_bug.cgi?id=197684
        <rdar://problem/59467397>

        Reviewed by Yusuke Suzuki.

        * NetworkProcess/NetworkProcess.cpp:
        Ensure that the CacheStorage directory is actually being created.

        * NetworkProcess/cache/NetworkCacheData.cpp:
        * NetworkProcess/cache/NetworkCacheData.h:
        * NetworkProcess/cache/NetworkCacheDataCocoa.mm:
        * NetworkProcess/cache/NetworkCacheDataSoup.cpp:
        * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
        Use more FileSystem functionality to share code across platforms.

        * NetworkProcess/cache/NetworkCacheDataCurl.cpp:
        Use Optional<Vector> for m_buffer since we need to differentiate isEmpty and isNull.

2020-02-26  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Issue mach sandbox extensions to the WebContent process for a set of specific services
        https://bugs.webkit.org/show_bug.cgi?id=208146

        Reviewed by Brent Fulgham.

        We are still seeing some accesses from the WebContent process to a small set of services. Since we do not currently have
        backtraces for these accesses, make a speculative patch, where we issue these extension for all apps except Safari.

        Test: fast/sandbox/ios/sandbox-mach-lookup-mail.html

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const):
        (WebKit::WebProcessCreationParameters::decode):
        * Shared/WebProcessCreationParameters.h:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):

2020-02-26  Keith Rollin  <krollin@apple.com>

        Add logging to help diagnose redirect issue
        https://bugs.webkit.org/show_bug.cgi?id=207916
        <rdar://problem/59567875>

        Reviewed by Chris Dumez.

        We're seeing an issue where communication between the WebContent
        process and the Network process seems to come to a stop between
        NetworkResourceLoader::continueWillSendRedirectedRequest and
        NetworkResourceLoader::continueWillSendRequest. We do see a
        WebResourceLoader::willSendRequest log line between those two
        NetworkResourceLoader logging lines, but nothing else. Add a bunch of
        logging in this area to help determine what's happening.

        * WebProcess/Network/WebResourceLoader.cpp:
        (WebKit::WebResourceLoader::willSendRequest):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):

2020-02-26  Chris Dumez  <cdumez@apple.com>

        Make sure a client cannot cause a whole DOM tree to get leaked by simply holding on to a WKBundleNodeHandle
        https://bugs.webkit.org/show_bug.cgi?id=208218

        Reviewed by Ryosuke Niwa.

        Make sure a client cannot cause a whole DOM tree to get leaked by simply holding on to a WKBundleNodeHandle.
        Previously, WKBundleNodeHandle would ref its node, which would keep the whole HTML document alive. To protect
        against this, InjectedBundleNodeHandle is now an ActiveDOMObject which nulls out its node RefPtr when the
        document is getting ready for destruction (i.e. ActiveDOMObject::stop() is called).

        * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
        (WebKit::InjectedBundleNodeHandle::InjectedBundleNodeHandle):
        (WebKit::InjectedBundleNodeHandle::~InjectedBundleNodeHandle):
        (WebKit::InjectedBundleNodeHandle::coreNode):
        (WebKit::InjectedBundleNodeHandle::document):
        (WebKit::InjectedBundleNodeHandle::elementBounds):
        (WebKit::InjectedBundleNodeHandle::renderRect):
        (WebKit::InjectedBundleNodeHandle::renderedImage):
        (WebKit::InjectedBundleNodeHandle::visibleRange):
        (WebKit::InjectedBundleNodeHandle::setHTMLInputElementValueForUser):
        (WebKit::InjectedBundleNodeHandle::setHTMLInputElementSpellcheckEnabled):
        (WebKit::InjectedBundleNodeHandle::isHTMLInputElementAutoFilled const):
        (WebKit::InjectedBundleNodeHandle::isHTMLInputElementAutoFilledAndViewable const):
        (WebKit::InjectedBundleNodeHandle::setHTMLInputElementAutoFilled):
        (WebKit::InjectedBundleNodeHandle::setHTMLInputElementAutoFilledAndViewable):
        (WebKit::InjectedBundleNodeHandle::isHTMLInputElementAutoFillButtonEnabled const):
        (WebKit::InjectedBundleNodeHandle::setHTMLInputElementAutoFillButtonEnabled):
        (WebKit::InjectedBundleNodeHandle::htmlInputElementAutoFillButtonType const):
        (WebKit::InjectedBundleNodeHandle::htmlInputElementLastAutoFillButtonType const):
        (WebKit::InjectedBundleNodeHandle::isAutoFillAvailable const):
        (WebKit::InjectedBundleNodeHandle::setAutoFillAvailable):
        (WebKit::InjectedBundleNodeHandle::htmlInputElementAutoFillButtonBounds):
        (WebKit::InjectedBundleNodeHandle::htmlInputElementLastChangeWasUserEdit):
        (WebKit::InjectedBundleNodeHandle::htmlTextAreaElementLastChangeWasUserEdit):
        (WebKit::InjectedBundleNodeHandle::isTextField const):
        (WebKit::InjectedBundleNodeHandle::htmlTableCellElementCellAbove):
        (WebKit::InjectedBundleNodeHandle::documentFrame):
        (WebKit::InjectedBundleNodeHandle::htmlFrameElementContentFrame):
        (WebKit::InjectedBundleNodeHandle::htmlIFrameElementContentFrame):
        (WebKit::InjectedBundleNodeHandle::stop):
        (WebKit::InjectedBundleNodeHandle::activeDOMObjectName const):
        * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:

2020-02-26  Daniel Bates  <dabates@apple.com>

        [iOS] Send focus update immediately on becoming or resigning first responder
        https://bugs.webkit.org/show_bug.cgi?id=208082
        <rdar://problem/59688413>

        Rubber-stamped by Jer Noble.

        Send an activity state change immediately to the web process when the WKWebView becomes first
        responder or resigns first responder.

        Currently -becomeFirstResponderForWebView and -resignFirstResponderForWebView schedule an activity
        state change message to be sent to the web process. This message will never be delivered within the
        same event loop iteration. As a result, performing operations that requires the page to be focused
        (e.g. selecting a position at a point) in the same event loop iteration as a call to -[WKWebView becomeFirstResponder])
        will not work.

        While I am in this area of the code simplify callers of activityStateDidChange() by changing its
        parameter order such that it takes a dispatch mode before wantsSynchronousReply. The latter is
        almost always defaulted to false to schedule an async message to the web process. Additionally,
        changed wantsSynchronousReply from a boolean to an enumeration, ActivityStateChangeReplyMode, and
        renamed the param to replyMode. The enumerators are self-documenting at the call site unlike the
        boolean.

        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::prepareForMoveToWindow):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::activityStateDidChange):
        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/WKApplicationStateTrackingView.mm:
        (-[WKApplicationStateTrackingView _applicationWillEnterForeground]):
        Update code for new parameter ordering and pass a ActivityStateChangeReplyMode enumerator.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView becomeFirstResponderForWebView]):
        (-[WKContentView resignFirstResponderForWebView]):
        Pass WebKit::WebPageProxy::ActivityStateChangeDispatchMode::Immediate to activityStateDidChange()
        to dispatch the update immediately to the web process.

2020-02-26  Chris Dumez  <cdumez@apple.com>

        Unreviewed, rolling out r257471.

        Causes crashes on the bots

        Reverted changeset:

        "Unreviewed, fix debug asserts on the bots after r257389."
        https://trac.webkit.org/changeset/257471

2020-02-26  Chris Dumez  <cdumez@apple.com>

        Unreviewed, rolling out r257389.

        Reverted changeset:

        "Make sure a client cannot cause a whole DOM tree to get
        leaked by simply holding on to a WKBundleNodeHandle"
        https://bugs.webkit.org/show_bug.cgi?id=208218
        https://trac.webkit.org/changeset/257389

2020-02-26  Jacob Uphoff  <jacob_uphoff@apple.com>

        Unreviewed, rolling out r257470.

        This broke the build for tvOS and watchOS

        Reverted changeset:

        "Conversion between MediaSample and RemoteVideoSample should
        preserve the rotation information"
        https://bugs.webkit.org/show_bug.cgi?id=208240
        https://trac.webkit.org/changeset/257470

2020-02-26  Youenn Fablet  <youenn@apple.com>

        GPUProcess should be made aware of device orientation for correct video capture frame rotation computation
        https://bugs.webkit.org/show_bug.cgi?id=208242

        Reviewed by Eric Carlson.

        Pipe orientation information to GPUProcess whenever a page has a user media capture manager proxy.
        This is used by AVVideoCaptureSource to compute the correct video sample rotation value.
        Manually tested.

        * GPUProcess/GPUConnectionToWebProcess.cpp:
        (WebKit::GPUConnectionToWebProcess::setOrientationForMediaCapture):
        * GPUProcess/GPUConnectionToWebProcess.h:
        * GPUProcess/GPUProcess.cpp:
        (WebKit::GPUProcess::setMockCaptureDevicesEnabled):
        (WebKit::GPUProcess::setOrientationForMediaCapture):
        * GPUProcess/GPUProcess.h:
        * GPUProcess/GPUProcess.messages.in:
        * UIProcess/GPU/GPUProcessProxy.cpp:
        (WebKit::GPUProcessProxy::setOrientationForMediaCapture):
        * UIProcess/GPU/GPUProcessProxy.h:
        * UIProcess/WebPageProxy.cpp:

2020-02-26  Youenn Fablet  <youenn@apple.com>

        Use WebPageProxy preferences for capture instead of WebProcessPool configuration parameters
        https://bugs.webkit.org/show_bug.cgi?id=208238

        Reviewed by Eric Carlson.

        We can use page preferences instead of pool preferences for audio/video capture.
        This allows removing code and is more up to date.
        Manually tested.

        * UIProcess/API/APIProcessPoolConfiguration.cpp:
        (API::ProcessPoolConfiguration::copy):
        * UIProcess/API/APIProcessPoolConfiguration.h:
        * UIProcess/API/C/WKContextConfigurationRef.cpp:
        * UIProcess/API/C/WKContextConfigurationRef.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        * UIProcess/WebPageProxy.cpp:
        * UIProcess/WebPreferences.cpp:
        (WebKit::WebPreferences::updateBoolValueForInternalDebugFeatureKey):
        (WebKit::WebPreferences::updateBoolValueForExperimentalFeatureKey):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::createWebPage):

2020-02-26  Chris Dumez  <cdumez@apple.com>

        Unreviewed, fix debug asserts on the bots after r257389.

        * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
        (WebKit::InjectedBundleNodeHandle::create):

2020-02-26  Youenn Fablet  <youenn@apple.com>

        Conversion between MediaSample and RemoteVideoSample should preserve the rotation information
        https://bugs.webkit.org/show_bug.cgi?id=208240

        Reviewed by Eric Carlson.

        Use new routine that preserves rotation.

        * GPUProcess/webrtc/RemoteMediaRecorder.cpp:
        (WebKit::RemoteMediaRecorder::videoSampleAvailable):
        * GPUProcess/webrtc/RemoteSampleBufferDisplayLayer.cpp:
        (WebKit::RemoteSampleBufferDisplayLayer::enqueueSample):
        * WebProcess/cocoa/UserMediaCaptureManager.cpp:
        (WebKit::UserMediaCaptureManager::Source::remoteVideoSampleAvailable):

2020-02-26  Antti Koivisto  <antti@apple.com>

        Remove throttling code from RenderLayerCompositor
        https://bugs.webkit.org/show_bug.cgi?id=208135
        <rdar://problem/59765410>

        Unreviewed partial revert.

        * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
        (WebKit::CompositingCoordinator::notifyFlushRequired):
        (WebKit::CompositingCoordinator::notifyRenderingUpdateRequired): Deleted.
        * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:

2020-02-26  Youenn Fablet  <youenn@apple.com>

        Call pending m_unregisterJobs completion handlers when WebSWServerConnection goes away
        https://bugs.webkit.org/show_bug.cgi?id=208208
        <rdar://problem/59747016>

        Reviewed by Alex Christensen.

        Covered by existing tests in debug.

        * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
        (WebKit::WebSWServerConnection::~WebSWServerConnection):
        Make sure to call pending completion handlers at destruction time.
        They will do nothing since their goal is to send back an IPC message
        on a dead IPC connection.

2020-02-25  Devin Rousso  <drousso@apple.com>

        Web Inspector: safari app extension isolated worlds and injected files use the extension's identifier instead of its name
        https://bugs.webkit.org/show_bug.cgi?id=206911
        <rdar://problem/58026635>

        Reviewed by Brian Burg.

        * UIProcess/Inspector/WebPageInspectorController.h:
        (WebKit::WebPageInspectorController::enabledInspectorBrowserAgent const): Added.
        (WebKit::WebPageInspectorController::setEnabledInspectorBrowserAgent): Added.
        * UIProcess/Inspector/WebPageInspectorController.cpp:
        (WebKit::WebPageInspectorController::WebPageInspectorController):
        (WebKit::WebPageInspectorController::connectFrontend):
        (WebKit::WebPageInspectorController::webPageAgentContext): Added.
        (WebKit::WebPageInspectorController::createLazyAgents): Added.
        * UIProcess/Inspector/WebPageInspectorAgentBase.h: Added.
        (WebKit::InspectorAgentBase::InspectorAgentBase):
        * UIProcess/Inspector/Agents/InspectorBrowserAgent.h: Added.
        * UIProcess/Inspector/Agents/InspectorBrowserAgent.cpp: Added.
        (WebKit::InspectorBrowserAgent::InspectorBrowserAgent):
        (WebKit::InspectorBrowserAgent::enabled):
        (WebKit::InspectorBrowserAgent::didCreateFrontendAndBackend):
        (WebKit::InspectorBrowserAgent::willDestroyFrontendAndBackend):
        (WebKit::InspectorBrowserAgent::enable):
        (WebKit::InspectorBrowserAgent::disable):
        (WebKit::InspectorBrowserAgent::extensionsEnabled):
        (WebKit::InspectorBrowserAgent::extensionsDisabled):
        Add a `Browser` agent that can communicate with the inspected page's containing browser. It
        lives in the UIProcess alongside the `Target` agent (meaning there should only be one per
        debuggable rather than one per target) and as such is not routed through the `Target` agent.

        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::inspectorClient): Added.
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::WebPageProxy):
        * UIProcess/API/Cocoa/WKWebViewInternal.h:
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]):
        (-[WKWebView _inspectorDelegate]): Added.
        (-[WKWebView _setInspectorDelegate:]): Added.
        (WebKit::WebPageProxy::setInspectorClient): Added.
        * UIProcess/Inspector/Cocoa/InspectorDelegate.h: Added.
        * UIProcess/Inspector/Cocoa/InspectorDelegate.mm: Added.
        (WebKit::InspectorDelegate::InspectorDelegate):
        (WebKit::InspectorDelegate::createInspectorClient):
        (WebKit::InspectorDelegate::delegate):
        (WebKit::InspectorDelegate::setDelegate):
        (WebKit::InspectorDelegate::InspectorClient):
        (WebKit::InspectorDelegate::InspectorClient::didAttachLocalInspector):
        (WebKit::InspectorDelegate::InspectorClient::browserDomainEnabled):
        (WebKit::InspectorDelegate::InspectorClient::browserDomainDisabled):
        * UIProcess/API/APIInspectorClient.h: Added.
        (API::InspectorClient::didAttachLocalInspector):
        (API::InspectorClient::browserDomainEnabled):
        (API::InspectorClient::browserDomainDisabled):
        * UIProcess/API/Cocoa/_WKInspectorDelegate.h: Added.
        Introduce an inspector delegate SPI for communicating information related to Web Inspector.

        * UIProcess/API/Cocoa/_WKInspectorPrivate.h:
        * UIProcess/API/Cocoa/_WKInspector.mm:
        (-[_WKInspector _browserExtensionsEnabled:]): Added.
        (-[_WKInspector _browserExtensionsDisabled:]): Added.
        * UIProcess/Inspector/WebInspectorProxy.h:
        * UIProcess/Inspector/WebInspectorProxy.cpp:
        (WebKit::WebInspectorProxy::openLocalInspectorFrontend):
        (WebKit::WebInspectorProxy::browserExtensionsEnabled): Added.
        (WebKit::WebInspectorProxy::browserExtensionsDisabled): Added.
        Add SPI for when extensions are enabled/disabled so that Web Inspector can update.

        * UIProcess/Cocoa/UIDelegate.h:
        * UIProcess/Cocoa/UIDelegate.mm:
        (WebKit::UIDelegate::setDelegate):
        (WebKit::UIDelegate::UIClient::didAttachInspector): Deleted.
        * UIProcess/API/APIUIClient.h:
        (API::UIClient::didAttachInspector): Deleted.
        * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
        Move `_webView:didAttachInspector:` from `WKUIDelegatePrivate` to `_WKInspectorDelegate`.

        * CMakeLists.txt:
        * DerivedSources.make:
        * PlatformMac.cmake:
        * Sources.txt:
        * SourcesCocoa.txt:
        * WebKit.xcodeproj/project.pbxproj:

        * UIProcess/WebAuthentication/Cocoa/LocalConnection.h:
        Drive-by: add missing include.

2020-02-25  Justin Michaud  <justin_michaud@apple.com>

        Inline Cache delete by id/val
        https://bugs.webkit.org/show_bug.cgi?id=207522

        Reviewed by Keith Miller and Filip Pizlo.

        * WebProcess/Plugins/Netscape/JSNPObject.cpp:
        (WebKit::JSNPObject::deleteProperty):
        * WebProcess/Plugins/Netscape/JSNPObject.h:
        * WebProcess/Plugins/Netscape/NPJSObject.cpp:
        (WebKit::NPJSObject::removeProperty):

2020-02-25  Ben Nham  <nham@apple.com>

        Remove render update throttling
        https://bugs.webkit.org/show_bug.cgi?id=208168

        Reviewed by Zalan Bujtas.

        Currently, we disable render updates after the first paint for 500 ms while the page is
        actively loading. However, oftentimes our first paint heuristic selects a first paint that
        isn't particularly interesting (mostly background colors) and this paint throttler just
        makes the user look at a nearly empty page for 500 ms. Antti and Simon both think we should
        remove the throttler to fix this so this patch does that.

        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::adjustRenderingUpdateThrottling): Deleted.
        (WebKit::WebChromeClient::renderingUpdateThrottlingIsActive const): Deleted.
        * WebProcess/WebCoreSupport/WebChromeClient.h:
        * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h:
        (WebKit::DrawingAreaCoordinatedGraphics::scheduleInitialDeferredPaint): Deleted.
        * WebProcess/WebPage/DrawingArea.h:
        (WebKit::DrawingArea::layerTreeStateIsFrozen const):
        (WebKit::DrawingArea::renderingUpdateThrottlingIsActive const): Deleted.
        (WebKit::DrawingArea::adjustRenderingUpdateThrottling): Deleted.
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
        (WebKit::RemoteLayerTreeDrawingArea::setLayerTreeStateIsFrozen):
        (WebKit::RemoteLayerTreeDrawingArea::scheduleRenderingUpdate):
        (WebKit::RemoteLayerTreeDrawingArea::updateRendering):
        (WebKit::RemoteLayerTreeDrawingArea::scheduleInitialDeferredPaint): Deleted.
        (WebKit::RemoteLayerTreeDrawingArea::adjustRenderingUpdateThrottling): Deleted.
        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
        (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
        (WebKit::TiledCoreAnimationDrawingArea::setLayerTreeStateIsFrozen):
        (WebKit::TiledCoreAnimationDrawingArea::scheduleRenderingUpdate):
        (WebKit::TiledCoreAnimationDrawingArea::updateRendering):
        (WebKit::TiledCoreAnimationDrawingArea::scheduleInitialDeferredPaint): Deleted.
        (WebKit::TiledCoreAnimationDrawingArea::adjustRenderingUpdateThrottling): Deleted.
        (WebKit::TiledCoreAnimationDrawingArea::renderingUpdateThrottlingIsActive const): Deleted.
        (WebKit::TiledCoreAnimationDrawingArea::startRenderThrottlingTimer): Deleted.
        (WebKit::TiledCoreAnimationDrawingArea::renderThrottlingTimerFired): Deleted.

2020-02-25  Tim Horton  <timothy_horton@apple.com>

        PDFPlugin: 'Open in Preview' and 'Save' don't work for blobs
        https://bugs.webkit.org/show_bug.cgi?id=208221
        <rdar://problem/22676176>

        Reviewed by Alex Christensen.

        * WebProcess/Plugins/PDF/PDFPlugin.h:
        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit::PDFPlugin::convertPostScriptDataIfNeeded):
        (WebKit::PDFPlugin::setSuggestedFilename):
        (WebKit::PDFPlugin::streamDidReceiveResponse):
        (WebKit::PDFPlugin::manualStreamDidReceiveResponse):
        Ensure that PDFPlugin's suggestedFilename always has a .pdf extension.
        The UI process already requires this, and enforces it, causing operations
        that use the suggestedFilename to fail if it does not have a .pdf extension.
        However, in the case of a blob-loaded PDF, we get just the name "Unknown".
        Slap the extension on there, and all is well!

2020-02-25  Chris Dumez  <cdumez@apple.com>

        Make sure a client cannot cause a whole DOM tree to get leaked by simply holding on to a WKBundleNodeHandle
        https://bugs.webkit.org/show_bug.cgi?id=208218

        Reviewed by Ryosuke Niwa.

        Make sure a client cannot cause a whole DOM tree to get leaked by simply holding on to a WKBundleNodeHandle.
        Previously, WKBundleNodeHandle would ref its node, which would keep the whole HTML document alive. To protect
        against this, InjectedBundleNodeHandle is now an ActiveDOMObject which nulls out its node RefPtr when the
        document is getting ready for destruction (i.e. ActiveDOMObject::stop() is called).

        * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
        (WebKit::InjectedBundleNodeHandle::InjectedBundleNodeHandle):
        (WebKit::InjectedBundleNodeHandle::~InjectedBundleNodeHandle):
        (WebKit::InjectedBundleNodeHandle::coreNode):
        (WebKit::InjectedBundleNodeHandle::document):
        (WebKit::InjectedBundleNodeHandle::elementBounds):
        (WebKit::InjectedBundleNodeHandle::renderRect):
        (WebKit::InjectedBundleNodeHandle::renderedImage):
        (WebKit::InjectedBundleNodeHandle::visibleRange):
        (WebKit::InjectedBundleNodeHandle::setHTMLInputElementValueForUser):
        (WebKit::InjectedBundleNodeHandle::setHTMLInputElementSpellcheckEnabled):
        (WebKit::InjectedBundleNodeHandle::isHTMLInputElementAutoFilled const):
        (WebKit::InjectedBundleNodeHandle::isHTMLInputElementAutoFilledAndViewable const):
        (WebKit::InjectedBundleNodeHandle::setHTMLInputElementAutoFilled):
        (WebKit::InjectedBundleNodeHandle::setHTMLInputElementAutoFilledAndViewable):
        (WebKit::InjectedBundleNodeHandle::isHTMLInputElementAutoFillButtonEnabled const):
        (WebKit::InjectedBundleNodeHandle::setHTMLInputElementAutoFillButtonEnabled):
        (WebKit::InjectedBundleNodeHandle::htmlInputElementAutoFillButtonType const):
        (WebKit::InjectedBundleNodeHandle::htmlInputElementLastAutoFillButtonType const):
        (WebKit::InjectedBundleNodeHandle::isAutoFillAvailable const):
        (WebKit::InjectedBundleNodeHandle::setAutoFillAvailable):
        (WebKit::InjectedBundleNodeHandle::htmlInputElementAutoFillButtonBounds):
        (WebKit::InjectedBundleNodeHandle::htmlInputElementLastChangeWasUserEdit):
        (WebKit::InjectedBundleNodeHandle::htmlTextAreaElementLastChangeWasUserEdit):
        (WebKit::InjectedBundleNodeHandle::isTextField const):
        (WebKit::InjectedBundleNodeHandle::htmlTableCellElementCellAbove):
        (WebKit::InjectedBundleNodeHandle::documentFrame):
        (WebKit::InjectedBundleNodeHandle::htmlFrameElementContentFrame):
        (WebKit::InjectedBundleNodeHandle::htmlIFrameElementContentFrame):
        (WebKit::InjectedBundleNodeHandle::stop):
        (WebKit::InjectedBundleNodeHandle::activeDOMObjectName const):
        * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:

2020-02-25  Youenn Fablet  <youenn@apple.com>

        Allow GPU Process to capture microphone in the background
        https://bugs.webkit.org/show_bug.cgi?id=208193

        Reviewed by Eric Carlson.

        Manually tested.

        * GPUProcess/EntryPoint/Cocoa/XPCService/GPUService/Info-iOS.plist:
        Add audio background mode and can inherit key, as done for WebProcess.
        * Scripts/process-entitlements.sh:
        Add entitlement to start audio capture in a background process.

2020-02-25  Youenn Fablet  <youenn@apple.com>

        Pass UIProcess PID to GPUProcess
        https://bugs.webkit.org/show_bug.cgi?id=208197

        Reviewed by Eric Carlson.

        Parent PID is needed for PID forwarding done in MediaSessionManageriOS::providePresentingApplicationPIDIfNecessary.
        Send it from UIProcess to GPUProcess and initialize it at creation time of GPUProcess singleton.

        * GPUProcess/GPUProcess.cpp:
        (WebKit::GPUProcess::initializeGPUProcess):
        * GPUProcess/GPUProcessCreationParameters.cpp:
        (WebKit::GPUProcessCreationParameters::encode const):
        (WebKit::GPUProcessCreationParameters::decode):
        * GPUProcess/GPUProcessCreationParameters.h:
        * UIProcess/GPU/GPUProcessProxy.cpp:
        (WebKit::GPUProcessProxy::singleton):

2020-02-25  Youenn Fablet  <youenn@apple.com>

        Change DTMF and mDNS candidates feature flags from experimental to internal
        https://bugs.webkit.org/show_bug.cgi?id=208131

        Reviewed by Eric Carlson.

        * Shared/WebPreferences.yaml:

2020-02-25  Jiewen Tan  <jiewen_tan@apple.com>

        Unreviewed, a build fix after r257269

        * Platform/spi/Cocoa/LocalAuthenticationSPI.h:

2020-02-25  Youenn Fablet  <youenn@apple.com>

        [iOS] Allow GPUProcess to set the AudioSession Category
        https://bugs.webkit.org/show_bug.cgi?id=208194

        Reviewed by Eric Carlson.

        Disable setting the audio session category in WebProcess when media is playing in GPUProcess.
        Always enable GPUProcess to set the audio session category.
        With https://bugs.webkit.org/show_bug.cgi?id=208193 and activating playing audio in GPUProcess,
        this allows running simple playing audio captured locally web pages.
        Manually tested.

        * GPUProcess/GPUProcess.cpp:
        (WebKit::GPUProcess::initializeGPUProcess):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_overriddenMediaType):
        * WebProcess/cocoa/UserMediaCaptureManager.cpp:
        (WebKit::UserMediaCaptureManager::AudioFactory::createAudioCaptureSource):

2020-02-25  Youenn Fablet  <youenn@apple.com>

        WebProcessPool does not need a map of service worker processes keyed by domain+session
        https://bugs.webkit.org/show_bug.cgi?id=208141

        Reviewed by Alex Christensen.

        It is not needed for the WebProcessPool to query the service worker process map in case of creation of a service worker process
        since Network Process has all the information needed to decide whether to create a new process or not.

        Network process is now telling UIProcess to terminate a service worker process based on its identifier instead of its domain+session.
        This allows replacing the WebProcessPool service worker process map with an HashSet, which is both safer and more efficient to use.

        No observable change.

        * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
        (WebKit::WebSWServerToContextConnection::syncTerminateWorker):
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::terminateUnresponsiveServiceWorkerProcesses):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/Network/NetworkProcessProxy.messages.in:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::networkProcessCrashed):
        (WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess):
        (WebKit::WebProcessPool::removeFromServiceWorkerProcesses):
        (WebKit::WebProcessPool::disconnectProcess):
        (WebKit::WebProcessPool::createWebPage):
        (WebKit::WebProcessPool::updateServiceWorkerUserAgent):
        (WebKit::WebProcessPool::terminateServiceWorkers):
        (WebKit::WebProcessPool::updateProcessAssertions):
        (WebKit::WebProcessPool::isServiceWorkerPageID const):
        (WebKit::WebProcessPool::setUseSeparateServiceWorkerProcess):
        (WebKit::WebProcessPool::hasServiceWorkerForegroundActivityForTesting const):
        (WebKit::WebProcessPool::hasServiceWorkerBackgroundActivityForTesting const):
        (WebKit::WebProcessPool::terminateServiceWorkerProcess): Deleted.
        * UIProcess/WebProcessPool.h:

2020-02-25  Chris Dumez  <cdumez@apple.com>

        REGRESSION (r256882): Can't drag an HTML file into a new (empty) Safari tab
        https://bugs.webkit.org/show_bug.cgi?id=208199
        <rdar://problem/59746887>

        Reviewed by Alex Christensen.

        Make sure we launch the initial WKWebView's WebProcess when a drag enters the view, so that the drag & drop
        logic still works on empty views.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::dragEntered):

2020-02-25  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Make HostWindow be the creator of the remote ImageBuffer
        https://bugs.webkit.org/show_bug.cgi?id=207134

        Reviewed by Darin Adler.

        WebChromeClient adds stubs for creating the remote ImageBuffers.

        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::createImageBuffer const):
        * WebProcess/WebCoreSupport/WebChromeClient.h:

2020-02-25  Kate Cheney  <katherine_cheney@apple.com>

        Add additions to NetworkDataTaskCocoa
        https://bugs.webkit.org/show_bug.cgi?id=208155
        <rdar://problem/59445723>

        Reviewed by Darin Adler.

        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):

2020-02-25  Chris Dumez  <cdumez@apple.com>

        Regression(CookieCache) Hang and very high CPU usage on nytimes.com
        https://bugs.webkit.org/show_bug.cgi?id=208166
        <rdar://problem/59739735>

        Reviewed by Alex Christensen.

        Re-enable the in-process cookie cache now that the bug on nytimes.com has been fixed.

        * Shared/WebPreferences.yaml:

2020-02-25  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Stop using gtk foreign drawing API to style form controls
        https://bugs.webkit.org/show_bug.cgi?id=208129

        Reviewed by Adrian Perez de Castro.

        * WebProcess/WebPage/gtk/WebPageGtk.cpp:
        (WebKit::WebPage::themeDidChange): Notify RenderTheme about the theme change to clear the colors cache.

2020-02-24  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthn] Implement SPI for the platform authenticator
        https://bugs.webkit.org/show_bug.cgi?id=208087
        <rdar://problem/59369305>

        Reviewed by Brent Fulgham.

        Here is the newly added SPI:
        typedef NS_ENUM(NSInteger, _WKWebAuthenticationPanelUpdate) {
            ...
            _WKWebAuthenticationPanelUpdateLAError,
            _WKWebAuthenticationPanelUpdateLADuplicateCredential,
            _WKWebAuthenticationPanelUpdateLANoCredential,
        };

        typedef NS_ENUM(NSInteger, _WKWebAuthenticationTransport) {
            ...
            _WKWebAuthenticationTransportInternal,
        };

        @protocol _WKWebAuthenticationPanelDelegate <NSObject>
        @optional
        ...
        - (void)panel:(_WKWebAuthenticationPanel *)panel verifyUserWithAccessControl:(SecAccessControlRef)accessControl completionHandler:(void (^)(LAContext *))completionHandler;
        @end

        Illustrations:
        1) _WKWebAuthenticationPanelUpdate: Three errors are added to help clients present meaningful error messages to users.
        a) WKWebAuthenticationPanelUpdateLAError: An internal error, clients should inform users and terminate the platform
        authentication process. This error can be returned at any time.
        b) _WKWebAuthenticationPanelUpdateLADuplicateCredential: It means a credential is found to match an entry in the
        excludeList. Clients should inform users and terminate the platform authentication process. This error will only be
        returned during makeCredential and before verifyUserWithAccessControl delegate.
        c) _WKWebAuthenticationPanelUpdateLANoCredential: It means no credentials are found. Clients should inform users and
        terminate the platform authentication process. This error will only be returned during getAssertion and before
        verifyUserWithAccessControl delegate.

        2) _WKWebAuthenticationTransport: _WKWebAuthenticationTransportInternal is added such that clients can learn platform
        authenticator will be used from _WKWebAuthenticationPanel.transports.

        3) verifyUserWithAccessControl: A delegate that will be called during makeCredential or getAssertion when the platform
        authenticator is involved. This delegate is used to obtain user verification from a LAContext. In addition, the LAContext
        should evaluate the passed accessControl, such that the SEP protected credential private key can be used. A typical
        example will be [LAContext evaluateAccessControl:accessControl operation:LAAccessControlOperationUseKeySign localizedReason:reply:].
        Noted, for getAssertion, selectAssertionResponse will be called before verifyUserWithAccessControl. So users need to be
        prompted to select a credential before the user verification.

        In the scenario when both the platform authenticator and external authenticators are requested. Clients are advised to
        wait until verifyUserWithAccessControl to show the combined UI. If any of the LAError states are received before
        verifyUserWithAccessControl, clients should then only show the external authenticator UI. Also, platform authenticator and
        external authenticators are being discovered at the same time, which means a user can plug in a security key at anytime.
        If a valid response is received from the security key, the whole ceremony will be terminated.

        Besides introducing the SPI, and all the necessary plumbing to make it happen. This patch also:
        1) adds LocalAuthenticationSPI, which is used to check whether a given LAContext is unlocked or not;
        2) improves MockLocalConnection such that mock testing can still be ran.

        * Platform/spi/Cocoa/LocalAuthenticationSPI.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalAuthenticationSoftLink.h.
        * UIProcess/API/APIWebAuthenticationPanel.cpp:
        (API::WebAuthenticationPanel::WebAuthenticationPanel):
        * UIProcess/API/APIWebAuthenticationPanelClient.h:
        (API::WebAuthenticationPanelClient::verifyUser const):
        * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.h:
        * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm:
        (wkWebAuthenticationTransport):
        * UIProcess/WebAuthentication/Authenticator.h:
        * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
        (WebKit::AuthenticatorManager::verifyUser):
        * UIProcess/WebAuthentication/AuthenticatorManager.h:
        * UIProcess/WebAuthentication/Cocoa/LocalAuthenticationSoftLink.h:
        * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.h:
        * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
        (WebKit::LocalAuthenticatorInternal::toNSData):
        (WebKit::LocalAuthenticatorInternal::toArrayBuffer):
        (WebKit::LocalAuthenticator::makeCredential):
        (WebKit::LocalAuthenticator::continueMakeCredentialAfterUserConsented):
        (WebKit::LocalAuthenticator::continueMakeCredentialAfterAttested):
        (WebKit::LocalAuthenticator::getAssertion):
        (WebKit::LocalAuthenticator::continueGetAssertionAfterResponseSelected):
        (WebKit::LocalAuthenticator::continueGetAssertionAfterUserConsented):
        (WebKit::LocalAuthenticator::receiveException const):
        * UIProcess/WebAuthentication/Cocoa/LocalConnection.h:
        (WebKit::LocalConnection::filterResponses const):
        * UIProcess/WebAuthentication/Cocoa/LocalConnection.mm:
        (WebKit::LocalConnection::isUnlocked const):
        (WebKit::LocalConnection::getUserConsent const): Deleted.
        (WebKit::LocalConnection::selectCredential const): Deleted.
        * UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.h:
        * UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.mm:
        (WebKit::WebAuthenticationPanelClient::WebAuthenticationPanelClient):
        (WebKit::wkWebAuthenticationPanelUpdate):
        (WebKit::WebAuthenticationPanelClient::selectAssertionResponse const):
        (WebKit::WebAuthenticationPanelClient::verifyUser const):
        * UIProcess/WebAuthentication/Mock/MockLocalConnection.h:
        * UIProcess/WebAuthentication/Mock/MockLocalConnection.mm:
        (WebKit::MockLocalConnection::isUnlocked const):
        (WebKit::MockLocalConnection::filterResponses const):
        (WebKit::MockLocalConnection::getUserConsent const): Deleted.
        (WebKit::MockLocalConnection::selectCredential const): Deleted.
        * UIProcess/WebAuthentication/WebAuthenticationFlags.h:
        * WebKit.xcodeproj/project.pbxproj:

2020-02-24  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Use one telemetry decoration for each sandbox rule
        https://bugs.webkit.org/show_bug.cgi?id=207897

        Reviewed by Brent Fulgham.

        Currently, we are using the decorations '(with telemetry)' and '(with telemetry-backtrace)' for some sandbox rules
        in the WebContent process' sandbox. Only one of the two decorations should be used.

        No new tests, no behavior change.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

2020-02-24  Chris Dumez  <cdumez@apple.com>

        Temporarily disable in-process cookie cache as it seems to be causing hangs on iOS
        https://bugs.webkit.org/show_bug.cgi?id=208152
        <rdar://problem/59706587>

        Reviewed by Alex Christensen.

        * Shared/WebPreferences.yaml:

2020-02-24  Tim Horton  <timothy_horton@apple.com>

        Context menu platter animation is wrong occasionally when invoking it repeatedly and rapidly
        https://bugs.webkit.org/show_bug.cgi?id=208147
        <rdar://problem/54436720>

        Reviewed by Wenson Hsieh.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView contextMenuInteraction:willEndForConfiguration:animator:]):
        If a new context menu interaction has started, don't remove the hint
        container view out from under it when the previous animation finishes,
        or the presentation animation will go crazy (in a variety of humorous
        and unpredictable ways), because UIKit can't do coordinate conversion
        through an unparented view.

        Eventually the final animation will complete and unparent the view.

2020-02-24  Youenn Fablet  <youenn@apple.com>

        Add a runtime flag dedicated to WebRTC codecs in GPUProcess
        https://bugs.webkit.org/show_bug.cgi?id=208136

        Reviewed by Alex Christensen.

        Add a runtime flag dedicated to enabling WebRTC codecs in GPUProcess.
        Use this flag instead of the media flag.

        * Shared/WebPreferences.yaml:
        * Shared/WebPreferencesDefaultValues.h:
        * WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
        (WebKit::LibWebRTCProvider::createDecoderFactory):

2020-02-24  Ellie Epskamp-Hunt  <eepskamphunt@apple.com>

        Provide alternate way to name Web Content process
        https://bugs.webkit.org/show_bug.cgi?id=205224
        rdar://57038084

        Reviewed by Alex Christensen.

        Test: TestWebKitAPI/Tests/WebKitCocoa/DisplayName.mm

        Add the ability to set _processDisplayName on WKWebViewConfiguration to allow the name of the web
        content process that appears in Activity Monitor to be set to a custom string.

        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:
        * UIProcess/API/APIPageConfiguration.cpp:
        (API::PageConfiguration::copy const):
        * UIProcess/API/APIPageConfiguration.h:
        (API::PageConfiguration::lsDisplayName const):
        (API::PageConfiguration::setlsDisplayName):
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _getDisplayNameWithCompletionHandler:]):
        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
        (-[WKWebViewConfiguration _lsDisplayName]):
        (-[WKWebViewConfiguration _setlsDisplayName:]):
        * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::creationParameters):
        (WebKit::WebPageProxy::getDisplayName):
        * UIProcess/WebPageProxy.h:
        * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
        (WebKit::WebPage::getDisplayName):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_lsDisplayName):
        (WebKit::WebPage::close):
        (WebKit::WebPage::didCommitLoad):
        (WebKit::m_overriddenMediaType): Deleted.
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::updateActivePages):
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::updateActivePages):

2020-02-24  Simon Fraser  <simon.fraser@apple.com>

        Remove geometry information from the scrolling tree
        https://bugs.webkit.org/show_bug.cgi?id=208085

        Reviewed by Sam Weinig.

        The scrolling tree doesn't have enough information to do hit-testing because it has
        no representation of layers that overlap scrollers. We'll have to do hit-testing another
        way, so remove hit-testing-geometry data from the scrolling tree.

        * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
        (ArgumentCoder<ScrollingStateFrameHostingNode>::encode):

2020-02-24  Youenn Fablet  <youenn@apple.com>

        Protect WebProcessPool from null weak pointers in m_serviceWorkerProcesses map
        https://bugs.webkit.org/show_bug.cgi?id=208143
        rdar://problem/58285589

        Reviewed by Alex Christensen.

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::createWebPage):
        (WebKit::WebProcessPool::updateServiceWorkerUserAgent):
        (WebKit::WebProcessPool::updateProcessAssertions):
        When iterating through the map, make sure it does not have a null entry.

2020-02-24  Wenson Hsieh  <wenson_hsieh@apple.com>

        [watchOS] Adopt UICollectionView-based SPI on PUICQuickboardListViewController
        https://bugs.webkit.org/show_bug.cgi?id=208137
        <rdar://problem/57756279>

        Reviewed by Tim Horton.

        Fixes deprecation warnings due to the main content area of PUICQuickboardListViewController becoming backed by a
        UICollectionView rather than a UITableView. See below for more details.

        * UIProcess/ios/forms/WKQuickboardListViewController.h:
        * UIProcess/ios/forms/WKQuickboardListViewController.mm:
        (-[WKQuickboardListCollectionViewItemCell topToLabelBaselineSpecValue]):
        (-[WKQuickboardListCollectionViewItemCell baselineToBottomSpecValue]):

        Add WKQuickboardListCollectionViewItemCell, a PUICQuickboardListCollectionViewItemCell subclass which will
        replace WKQuickboardListItemCell.

        * UIProcess/ios/forms/WKSelectMenuListViewController.mm:
        (-[WKSelectMenuCollectionViewItemCell initWithFrame:]):
        (-[WKSelectMenuCollectionViewItemCell imageView]):

        Similarly, add WKSelectMenuCollectionViewItemCell, a collection view cell which replaces WKSelectMenuItemCell.

        (-[WKSelectMenuListViewController didSelectListItem:]):
        (-[WKSelectMenuListViewController didSelectListItemAtIndexPath:]):

        Reimplement -didSelectListItem: using -didSelectListItemAtIndexPath:. The latter handles model updates when
        the user interacts with select options in the Quickboard view controller that is collection-view-backed.

        (-[WKSelectMenuListViewController listItemCellClass]):
        (-[WKSelectMenuListViewController listItemCellReuseIdentifier]):
        (-[WKSelectMenuListViewController itemCellForListItem:forIndexPath:]):
        (-[WKSelectMenuListViewController collectionViewSectionIsRadioSection:]):

2020-02-24  Wenson Hsieh  <wenson_hsieh@apple.com>

        REGRESSION (r248481): drag animation of a link starts from the incorrect location
        https://bugs.webkit.org/show_bug.cgi?id=208113
        <rdar://problem/59448696>

        Reviewed by Tim Horton.

        For both dragging and context menu interactions, UIKit asks us for targeted previews, which are hosted under
        container views provided by WebKit. These container views must be in the hierarchy (i.e. they must have a
        UIWindow); otherwise, UIKit incorrectly computes some geometry when animating the previews. Prior to the fix for
        <rdar://problem/57172514>, this caused targeted drag previews to animate in from a seemingly random location;
        however, UIKit worked around this by falling back to the same codepath used for remotely hosted views, which
        uses the last known touch location as an approximation of where to start the drag preview animation. This mostly
        makes the bug go away, but the delta between the touch location and the actual location of the dragged element
        in the page still causes some very minor visual differences.

        Due to r248481, a separate UIView (_contextMenuHintContainerView) under the content view is used when generating
        targeted previews for both drag and drop and context menu hints. This view is removed when the context menu
        interaction ends; however, when starting a drag, the context menu interaction ends right before the drag session
        actually begins, which means that when UIKit actually starts to animate the drag preview, the container view has
        already been unparented.

        To address this, introduce a separate _dragPreviewContainerView alongside _contextMenuHintContainerView, and use
        this new view when generating targeted previews for dragging. This view is generated lazily and cleaned up
        (unparented and cleared out) when the drag interaction has ended, in -cleanUpDragSourceSessionState.

        * UIProcess/ios/WKContentViewInteraction.h:

        Add _dragPreviewContainerView.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _didCommitLoadForMainFrame]):
        (-[WKContentView dataDetectionContextForPositionInformation:]):
        (-[WKContentView containerForDragPreviews]):
        (-[WKContentView containerForContextMenuHintPreviews]):

        Split -containerViewForTargetedPreviews into -containerForDragPreviews and -containerForContextMenuHintPreviews,
        and use them as appropriate.

        (-[WKContentView _hideTargetedPreviewContainerViews]):

        Renamed from _hideContextMenuHintContainer, since it hides both types of targeted preview containers now.

        (-[WKContentView cleanUpDragSourceSessionState]):

        Clear out and remove _dragPreviewContainerView here.

        (-[WKContentView _deliverDelayedDropPreviewIfPossible:]):
        (-[WKContentView dragInteraction:previewForLiftingItem:session:]):

        Use -containerForDragPreviews when creating previews for dragging.

        (-[WKContentView _createTargetedContextMenuHintPreviewIfPossible]):
        (-[WKContentView contextMenuInteraction:previewForHighlightingMenuWithConfiguration:]):

        Use -containerForContextMenuHintPreviews when creating previews for the context menu hint.

        (-[WKContentView containerViewForTargetedPreviews]): Deleted.
        (-[WKContentView _hideContextMenuHintContainer]): Deleted.
        (-[WKContentView _createTargetedPreviewIfPossible]): Deleted.

2020-02-24  Rob Buis  <rbuis@igalia.com>

        Verify Prefetch and credential behavior
        https://bugs.webkit.org/show_bug.cgi?id=200000

        Reviewed by Youenn Fablet.

        Cancel cross-origin prefetches for Vary: Cookie.

        Test: http/wpt/prefetch/link-prefetch-cross-origin-vary-cookie.html

        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::retrieveCacheEntry):
        (WebKit::NetworkResourceLoader::didReceiveResponse):
        * NetworkProcess/cache/PrefetchCache.cpp:
        (WebKit::PrefetchCache::take):

2020-02-24  Youenn Fablet  <youenn@apple.com>

        Protect from null session in NetworkDataTaskCocoa::restrictRequestReferrerToOriginIfNeeded
        https://bugs.webkit.org/show_bug.cgi?id=208127
        rdar://problem/57937917

        Reviewed by Chris Dumez.

        In case of a data task whose session is destroyed, do not follow redirection early on.

        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):

2020-02-24  Rob Buis  <rbuis@igalia.com>

        Handle page closure for stale-while-revalidate revalidations
        https://bugs.webkit.org/show_bug.cgi?id=204147

        Reviewed by Youenn Fablet.

        Add a message for browsing context removal. When the message happens,
        pass it down to the network cache to remove any pending
        async revalidations for that page.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::browsingContextRemoved):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * NetworkProcess/NetworkProcess.cpp:
        * NetworkProcess/cache/AsyncRevalidation.cpp:
        (WebKit::NetworkCache::AsyncRevalidation::cancel):
        * NetworkProcess/cache/AsyncRevalidation.h:
        * NetworkProcess/cache/NetworkCache.cpp:
        (WebKit::NetworkCache::Cache::startAsyncRevalidationIfNeeded):
        (WebKit::NetworkCache::Cache::browsingContextRemoved):
        * NetworkProcess/cache/NetworkCache.h:
        (WebKit::NetworkCache::GlobalFrameID::hash const):
        (WebKit::NetworkCache::operator==):
        (WTF::GlobalFrameIDHash::hash):
        (WTF::GlobalFrameIDHash::equal):
        (WTF::HashTraits<WebKit::NetworkCache::GlobalFrameID>::emptyValue):
        (WTF::HashTraits<WebKit::NetworkCache::GlobalFrameID>::constructDeletedValue):
        (WTF::HashTraits<WebKit::NetworkCache::GlobalFrameID>::isDeletedValue):
        * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
        (WebKit::NetworkCache::SpeculativeLoad::cancel):
        * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::browsingContextRemoved):
        * WebProcess/Network/WebLoaderStrategy.h:

2020-02-23  Adrian Perez de Castro  <aperez@igalia.com>

        Non-unified build fixes late February 2020 edition
        https://bugs.webkit.org/show_bug.cgi?id=208111

        Unreviewed build fix.

        * NetworkProcess/NetworkSocketChannel.cpp: Add missing include.
        * WebProcess/FullScreen/WebFullScreenManager.cpp:
        (WebKit::screenRectOfContents): Add missing namespace to usage of WebCore::IntRect.
        (WebKit::WebFullScreenManager::didExitFullScreen): Add missing namespace to usage of
        WebCore::FloatBoxExtent.

2020-02-22  Darin Adler  <darin@apple.com>

        Fix some include mistakes and make some coding style tweaks to WebKit and WebKitTestRunner
        https://bugs.webkit.org/show_bug.cgi?id=208099

        Reviewed by Antti Koivisto.

        * WebProcess/FullScreen/WebFullScreenManager.cpp: Removed some unneeded includes.

        * WebProcess/WebCoreSupport/WebChromeClient.cpp: Removed some unneeded includes.
        (WebKit::WebChromeClient::createDataListSuggestionPicker): Pass references.

        * WebProcess/WebCoreSupport/WebDataListSuggestionPicker.cpp:
        (WebKit::WebDataListSuggestionPicker::WebDataListSuggestionPicker): Take references
        instead of pointers, since they must both be non-null.
        (WebKit::WebDataListSuggestionPicker::handleKeydownWithIdentifier): Updated
        to use reference.
        (WebKit::WebDataListSuggestionPicker::didSelectOption): Ditto.
        (WebKit::WebDataListSuggestionPicker::didCloseSuggestions): Ditto.
        (WebKit::WebDataListSuggestionPicker::close): Ditto.
        (WebKit::WebDataListSuggestionPicker::displayWithActivationType): Ditto.

        * WebProcess/WebCoreSupport/WebDataListSuggestionPicker.h: Marked the class
        final, made more functions private, use references instead of pointers,
        renamed m_dataListSuggestionsClient to m_client since there is only one
        client we are dealing with in this class.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::setActiveDataListSuggestionPicker): Take reference.
        * WebProcess/WebPage/WebPage.h: Updated for the above.

2020-02-22  Jer Noble  <jer.noble@apple.com>

        Stop using QTKit for rendering WK1 video fullscreen controls
        https://bugs.webkit.org/show_bug.cgi?id=207795
        <rdar://problem/48894915>

        Reviewed by Jon Lee.

        Use NSWindowSPI.h rather than declaring SPI in the source file.

        * UIProcess/mac/WKFullScreenWindowController.mm:

2020-02-22  Darin Adler  <darin@apple.com>

        Use DOM element iterators more, and more consistently
        https://bugs.webkit.org/show_bug.cgi?id=208097

        Reviewed by Antti Koivisto.

        * WebProcess/Automation/WebAutomationSessionProxy.cpp:
        (WebKit::containerElementForElement): Use ancestorsOfType to find the
        HTMLDataListElement rather than an ownerDataListElement function.
        While this behavior is correct as specified, the idea of an "owner"
        data list element doesn't make sense since technically the same option
        can be used for multiple nested data lists.

        * WebProcess/WebPage/WebFrame.cpp:
        (WebKit::WebFrame::containsAnyFormElements const): Use childrenOfType
        instead of NodeTraversal.
        (WebKit::WebFrame::containsAnyFormControls const): Ditto.

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::containingLinkAnchorElement): Renamed to add the word "anchor"
        since this won't return link elements that aren't HTMLAnchorElement
        instances. Use lineageOfType<HTMLAnchorElement> instead of elementLineage
        with a separate type check.
        (WebKit::elementPositionInformation): Updated for new name.
        (WebKit::WebPage::performActionOnElement): Ditto.

2020-02-21  Kate Cheney  <katherine_cheney@apple.com>

        App-bound domains should have separate Network Sessions
        https://bugs.webkit.org/show_bug.cgi?id=208026
        <rdar://problem/59434006>

        Reviewed by Brent Fulgham.

        Tests: http/tests/in-app-browser-privacy/app-bound-domain.html
               http/tests/in-app-browser-privacy/switch-session-on-navigation-to-app-bound-domain.html

        Supports network session switching for navigations to app-bound
        domains. This requires updating the WebPage when a navigation occurs
        to check whether it is to an app-bound destination. In case of a
        process swap, this has to be done both in PolicyDecisionSender and
        in the ProvisionalPageProxy::loadData and ProvisionalPageProxy::loadRequest
        functions.

        This patch also must send the In-App Browser privacy flag to the
        Network process.

        * NetworkProcess/NetworkDataTask.cpp:
        (WebKit::NetworkDataTask::create):
        * NetworkProcess/NetworkLoadParameters.h:
        * NetworkProcess/NetworkResourceLoadParameters.cpp:
        (WebKit::NetworkResourceLoadParameters::encode const):
        (WebKit::NetworkResourceLoadParameters::decode):
        * NetworkProcess/NetworkResourceLoadParameters.h:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::startNetworkLoad):
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
        Passes the isNavigatingToAppBoundDomain flag to the NetworkSession.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::hasAppBoundSession const):
        (WebKit::NetworkProcess::setInAppBrowserPrivacyEnabled):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * NetworkProcess/NetworkSession.h:
        (WebKit::NetworkSession::hasAppBoundSession const):
        (WebKit::NetworkSession::setInAppBrowserPrivacyEnabled):
        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreHasAppBoundSession):
        (WKWebsiteDataStoreSetInAppBrowserPrivacyEnabled):
        * UIProcess/API/C/WKWebsiteDataStoreRef.h:
        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _getWebViewCategoryFor:completionHandler:]):
        * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::hasAppBoundSession):
        (WebKit::NetworkProcessProxy::setInAppBrowserPrivacyEnabled):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::hasAppBoundSession const):
        (WebKit::WebsiteDataStore::setInAppBrowserPrivacyEnabled):
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        A large portion of this patch is three functions for testing, one sets 
        the in-app browser privacy flag for the test case, one checks for an app-bound session, and one
        checks to make sure the category was correctly set to app-bound domain.

        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::parameters):
        * NetworkProcess/NetworkSessionCreationParameters.cpp:
        (WebKit::NetworkSessionCreationParameters::encode const):
        (WebKit::NetworkSessionCreationParameters::decode):
        * NetworkProcess/NetworkSessionCreationParameters.h:
        Passes the In-app browser privacy flag value from NSUserDefaults to the network session.

        * NetworkProcess/cocoa/NetworkSessionCocoa.h:
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
        (WebKit::NetworkSessionCocoa::sessionWrapperForTask):
        (WebKit::NetworkSessionCocoa::appBoundSession):
        (WebKit::NetworkSessionCocoa::hasAppBoundSession const):
        (WebKit::NetworkSessionCocoa::invalidateAndCancel):
        (WebKit::NetworkSessionCocoa::clearCredentials):
        Creates a new session (or returns the existing app-bound session) if
        the navigation is app-bound. This is the main change in this patch.

        * Shared/LoadParameters.cpp:
        (WebKit::LoadParameters::encode const):
        (WebKit::LoadParameters::decode):
        * Shared/LoadParameters.h:
        * UIProcess/ProvisionalPageProxy.cpp:
        (WebKit::ProvisionalPageProxy::loadData):
        (WebKit::ProvisionalPageProxy::loadRequest):
        (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionSync):
        * UIProcess/ProvisionalPageProxy.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::loadRequest):
        (WebKit::WebPageProxy::loadRequestWithNavigationShared):
        (WebKit::WebPageProxy::loadData):
        (WebKit::WebPageProxy::loadDataWithNavigationShared):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::loadRequest):
        (WebKit::WebPage::loadDataImpl):
        (WebKit::WebPage::loadData):
        (WebKit::WebPage::loadAlternateHTML):
        In the case of a process swap, we must add the
        isNavigatingToAppBoundDomain boolean in LoadParameters to ensure it gets sent to
        the new WebPage via the ProvisionalPageProxy.

        (WebKit::WebPageProxy::PolicyDecisionSender::send):
        Fixes a capitalization error.

        (WebKit::WebPageProxy::isAppBoundDomain):
        (WebKit::WebPageProxy::setIsNavigatingToAppBoundDomain):
        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::isNavigatingToAppBoundDomain):
        These functions determine if the category is app-bound and update the
        isNavigatingToAppBoundDomain boolean accordingly.

        * Shared/PolicyDecision.h:
        (WebKit::PolicyDecision::encode const):
        (WebKit::PolicyDecision::decode):
        (WebKit::WebPageProxy::receivedPolicyDecision):
        (WebKit::WebPageProxy::continueNavigationInNewProcess):
        (WebKit::WebPageProxy::decidePolicyForNavigationActionAsyncShared):
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
        (WebKit::WebPageProxy::decidePolicyForNavigationActionSyncShared):
        (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
        (WebKit::WebPageProxy::decidePolicyForResponseShared):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
        For a non-process swap case, we can send the
        isNavigatingToAppBoundDomain value in the
        PolicyDecision struct.

        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
        Sends the isNavigatingToAppBoundDomain boolean to the NetworkProcess
        with the NetworkResourceLoadParameters.

        (WebKit::WebPage::didReceivePolicyDecision):
        (WebKit::WebPage::setIsNavigatingToAppBoundDomain):
        * WebProcess/WebPage/WebPage.h:
        (WebKit::WebPage::isNavigatingToAppBoundDomain):
        The boolean value for isNavigatingToAppBoundDomain is stored
        in the webPage so WebLoaderStrategy can access it to send to the
        NetworkProcess.

2020-02-21  Brent Fulgham  <bfulgham@apple.com>

        Remove telemetry from sandbox rules needed for basic WebKit logging
        https://bugs.webkit.org/show_bug.cgi?id=208073
        <rdar://problem/59658551>

        Reviewed by Per Arne Vollan.

        Now that we see the specific uses for the 'kern.osversion' sysctl and the need
        for network-outbound connections for syslog, we can remove the telemetry.

        * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
        * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:

2020-02-21  Chris Dumez  <cdumez@apple.com>

        REGRESSION (r255533) Null Deref of _sessionWrapper under [WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]
        https://bugs.webkit.org/show_bug.cgi?id=208029
        <rdar://problem/59404381>

        Reviewed by Tim Horton.

        r255533 started dereferencing _sessionWrapper without null check in didReceiveChallenge. All other delegates in this file null check
        _sessionWrapper before using it because it is a weak pointer. Add a null check to avoid crashing.

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (-[WKNetworkSessionDelegate sessionFromTask:]):

2020-02-21  Wenson Hsieh  <wenson_hsieh@apple.com>

        Address post-review feedback in webkit.org/b/207352
        https://bugs.webkit.org/show_bug.cgi?id=207352

        Reviewed by Brian Weinstein.

        Use m_mainFrame instead of going through Page, and also append the string "\n\n" instead of appending the
        newline character twice.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::getContentsAsString):

2020-02-21  Peng Liu  <peng.liu6@apple.com>

        [Media in GPU process] Synchronize the properties of video layers in the GPU process with the hosting layer in the web process
        https://bugs.webkit.org/show_bug.cgi?id=206132

        Reviewed by Eric Carlson.

        A follow-up patch to fix Catalyst/watchOS/tvOS build failures related to unified build.

        * WebProcess/GPU/media/cocoa/VideoLayerRemoteCocoa.h:

2020-02-21  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Issue extension of CoreMedia service to the WebContent process
        https://bugs.webkit.org/show_bug.cgi?id=208066
        <rdar://problem/35864528>

        Reviewed by Geoffrey Garen.

        This service should also be added to the sandbox of the GPU process.

        No new tests, covered by existing tests.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb:
        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::mediaRelatedMachServices):

2020-02-21  Wenson Hsieh  <wenson_hsieh@apple.com>

        [macOS] Large form controls are rendered at the wrong NSControlSize
        https://bugs.webkit.org/show_bug.cgi?id=208043
        <rdar://problem/59659134>

        Reviewed by Tim Horton.

        See WebCore ChangeLog for more details.

        * UIProcess/mac/WebPopupMenuProxyMac.mm:
        (WebKit::WebPopupMenuProxyMac::showPopupMenu):

2020-02-21  Chris Dumez  <cdumez@apple.com>

        Remove WebPageProxy::machSendRightCallback as it is dead code
        https://bugs.webkit.org/show_bug.cgi?id=208057
        <rdar://problem/59658805>

        Reviewed by Geoffrey Garen.

        * UIProcess/WebPageProxy.cpp:
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:

2020-02-21  Chris Dumez  <cdumez@apple.com>

        Remove WebPasteBoardProxy::PasteboardCopy as it is dead code
        https://bugs.webkit.org/show_bug.cgi?id=208058
        <rdar://problem/59658727>

        Reviewed by Geoffrey Garen.

        * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
        * UIProcess/WebPasteboardProxy.h:
        * UIProcess/WebPasteboardProxy.messages.in:

2020-02-21  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Fix media related sandbox issues in the GPU process
        https://bugs.webkit.org/show_bug.cgi?id=208033

        Reviewed by Eric Carlson.

        The mach lookup sandbox extension to 'com.apple.tccd' needs to be created with the method SandboxExtension::createHandleForMachLookup.
        The file read-write sandbox extension to the media cache directory needs to be created with the parent folder of the actual cache folder,
        since the media frameworks also seem to access files there.

        No new tests, covered by existing tests.

        * UIProcess/GPU/GPUProcessProxy.cpp:
        (WebKit::GPUProcessProxy::singleton):
        (WebKit::gpuProcessSessionParameters):

2020-02-20  Peng Liu  <peng.liu6@apple.com>

        [Media in GPU process] Synchronize the properties of video layers in the GPU process with the hosting layer in the web process
        https://bugs.webkit.org/show_bug.cgi?id=206132

        Reviewed by Jer Noble.

        MediaPlayerPrivateRemote creates WKVideoLayerRemote whose sublayer is created by LayerHostingContext::createPlatformLayerForHostingContext().
        The WKVideoLayerRemote will be used by the renderer to manage the video element in the Web process. When its size is changed by the renderer,
        it applies a transform without changing its actual size, and sends a message to MediaPlayerPrivateProxy in the GPU process
        to change the size of the container layer. After that, WKVideoLayerRemote will set its size to the correct one in the Web process side.
        We need to use a MachSendRight to synchronize the transactions in the Web process and the GPU process.

        We have to use such a process to change the appearance of WKVideoLayerRemote in order to guarantee the smoothness when a user
        change the size of a video element.

        * GPUProcess/media/RemoteMediaPlayerProxy.cpp:
        (WebKit::RemoteMediaPlayerProxy::load):
        (WebKit::RemoteMediaPlayerProxy::prepareForPlayback):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerFirstVideoFrameAvailable):
        (WebKit::RemoteMediaPlayerProxy::setVideoInlineSizeFenced):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerContentBoxRect const): Deleted.
        * GPUProcess/media/RemoteMediaPlayerProxy.h:
        * GPUProcess/media/RemoteMediaPlayerProxy.messages.in:
        * SourcesCocoa.txt:
        * UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
        (WebKit::MediaPlayerPrivateRemote::prepareForPlayback):
        (WebKit::MediaPlayerPrivateRemote::firstVideoFrameAvailable):
        (WebKit::MediaPlayerPrivateRemote::platformLayer const):
        (WebKit::MediaPlayerPrivateRemote::setVideoInlineSizeFenced):
        (WebKit::MediaPlayerPrivateRemote::paint):
        (WebKit::MediaPlayerPrivateRemote::paintCurrentFrameInContext):
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.h:
        * WebProcess/GPU/media/VideoLayerRemote.h: Added.
        * WebProcess/GPU/media/cocoa/VideoLayerRemoteCocoa.h: Added.
        * WebProcess/GPU/media/cocoa/VideoLayerRemoteCocoa.mm: Added.
        (-[WKVideoLayerRemote init]):
        (-[WKVideoLayerRemote dealloc]):
        (-[WKVideoLayerRemote mediaPlayerPrivateRemote]):
        (-[WKVideoLayerRemote setMediaPlayerPrivateRemote:]):
        (-[WKVideoLayerRemote videoSublayer]):
        (-[WKVideoLayerRemote setVideoSublayer:]):
        (-[WKVideoLayerRemote layoutSublayers]):
        (-[WKVideoLayerRemote resolveBounds]):
        (WebKit::createVideoLayerRemote):
        * WebProcess/WebPage/ios/WebPageIOS.mm: Fixed a unified build failure.

2020-02-20  Eric Carlson  <eric.carlson@apple.com>

        Support in-band metadata cues when loading media in the GPU Process
        https://bugs.webkit.org/show_bug.cgi?id=207904
        <rdar://problem/59561647>

        Reviewed by Dean Jackson.

        * GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in:
        * GPUProcess/media/RemoteTextTrackProxy.cpp:
        (WebKit::RemoteTextTrackProxy::addDataCue):
        (WebKit::RemoteTextTrackProxy::updateDataCue):
        (WebKit::RemoteTextTrackProxy::removeDataCue):
        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<WebCore::SerializedPlatformDataCueValue>::encode):
        (IPC::ArgumentCoder<WebCore::SerializedPlatformDataCueValue>::decode):
        * Shared/WebCoreArgumentCoders.h:
        * Shared/mac/WebCoreArgumentCodersMac.mm:
        (IPC::ArgumentCoder<WebCore::SerializedPlatformDataCueValue>::encodePlatformData):
        (IPC::ArgumentCoder<WebCore::SerializedPlatformDataCueValue>::decodePlatformData):
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
        (WebKit::MediaPlayerPrivateRemote::MediaPlayerPrivateRemote):
        (WebKit::MediaPlayerPrivateRemote::setConfiguration):
        (WebKit::MediaPlayerPrivateRemote::addDataCue):
        (WebKit::MediaPlayerPrivateRemote::addDataCueWithType):
        (WebKit::MediaPlayerPrivateRemote::updateDataCue):
        (WebKit::MediaPlayerPrivateRemote::removeDataCue):
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.h:
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.messages.in:
        * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp:
        (WebKit::RemoteMediaPlayerManager::createRemoteMediaPlayer):
        * WebProcess/GPU/media/RemoteMediaPlayerManager.h:
        * WebProcess/GPU/media/TextTrackPrivateRemote.cpp:
        (WebKit::TextTrackPrivateRemote::addGenericCue):
        (WebKit::TextTrackPrivateRemote::updateGenericCue):
        (WebKit::TextTrackPrivateRemote::removeGenericCue):
        (WebKit::TextTrackPrivateRemote::parseWebVTTFileHeader):
        (WebKit::TextTrackPrivateRemote::parseWebVTTCueData):
        (WebKit::TextTrackPrivateRemote::parseWebVTTCueDataStruct):
        (WebKit::TextTrackPrivateRemote::addDataCue):
        (WebKit::TextTrackPrivateRemote::addDataCueWithType):
        (WebKit::TextTrackPrivateRemote::updateDataCue):
        (WebKit::TextTrackPrivateRemote::removeDataCue):
        * WebProcess/GPU/media/TextTrackPrivateRemote.h:

2020-02-20  John Wilander  <wilander@apple.com>

        Add fidelity.com to the desktop class quirks list
        https://bugs.webkit.org/show_bug.cgi?id=208037
        <rdar://problem/59480381>

        Reviewed by Brent Fulgham.

        No new tests. This patch just adds a domain name to a quirks function.

        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::desktopClassBrowsingRecommendedForRequest):
            fidelity.com and its subdomains now return false.

2020-02-20  Sihui Liu  <sihui_liu@apple.com>

        WebIDBServer resume should return early if suspend does not happen
        https://bugs.webkit.org/show_bug.cgi?id=208027
        <rdar://problem/59617654>

        Reviewed by Geoffrey Garen.

        We should not try releasing a lock that is not held.

        * NetworkProcess/IndexedDB/WebIDBServer.cpp:
        (WebKit::WebIDBServer::resume):

2020-02-20  Yusuke Suzuki  <ysuzuki@apple.com>

        NetworkCache should use 4KB threshold for mmap-ed files instead of 16KB
        https://bugs.webkit.org/show_bug.cgi?id=207882

        Reviewed by Alex Christensen.

        We found that a lot of Vectors in Membuster is holding resource content. This is because we have 16KB threshold for mmap-ed files.
        If a file is smaller than 16KB, it is copied to Vector instead. But this is costly in terms of memory. If we use mmap-ed files,
        it becomes named-pages instead of anonymous-pages. File-backed non-dirty named-pages have a lot of benefit.

        1. The application is offering a hint that pages are file-backed. This means that OS can purge them at any time since the content can be recovered
           from the disk. This is cheaper than swapping / compressing anonymous pages since just discarding works.
        2. The application is offering a hint that pages have spatial locality. Purging pages in one named-pages region is better compared to purging
           the same # of anonymous pages randomly. Anonymous pages are split by malloc implementation and access pattern of pages in one VA is random. On
           the other hand, named-pages are accessed together because it is file, and file typically has sequential locality. And recovery of named pages are
           also cheap compared to anonymous pages since OS can prefetch pages once access happens because of sequential locality of files. This tendency makes
           OS like purging named pages instead of anonymous pages. In WebKit use case, this works perfectly. CachedResource typically has decoded content. So
           typically WebProcess does not access SharedBuffer after the content is decoded.

        This patch reduces the threshold from 16KB to page size (4KB in macOS, 16KB in iOS). This is pre-2015 behavior.
        This offers 2.56% progression with 98% probability in Membuster.

        * NetworkProcess/cache/NetworkCacheStorage.cpp:
        (WebKit::NetworkCache::maximumInlineBodySize):
        (WebKit::NetworkCache::estimateRecordsSize):
        (WebKit::NetworkCache::Storage::shouldStoreBodyAsBlob):

2020-02-20  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthn] Replace DeviceIdentity.framework
        https://bugs.webkit.org/show_bug.cgi?id=207985
        <rdar://problem/59369223>

        Reviewed by Brent Fulgham.

        This patch replaces the DeviceIdentity.framework with a new framework that better suits our needs.
        The new experimental authentication logic is handled by WebKtAdditions. Please refer to the radar
        for detailed information.

        Besides the replacement, this patch also:
        1) changes how user consent is obtained to avoid multiple prompts for biometric input.
        2) removes keychain workarounds for DeviceIdentity given the credential private key is now under our possession.
        3) removes everything that is related to DeviceIdentity.

        Covered by new tests within existing test files.

        * Configurations/WebKit.xcconfig:
        * Platform/spi/Cocoa/DeviceIdentitySPI.h: Removed.
        * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.h:
        * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
        (WebKit::LocalAuthenticatorInternal::toNSData):
        (WebKit::LocalAuthenticator::makeCredential):
        (WebKit::LocalAuthenticator::continueMakeCredentialAfterUserConsented):
        (WebKit::LocalAuthenticator::continueMakeCredentialAfterAttested):
        (WebKit::LocalAuthenticator::getAssertion):
        (WebKit::LocalAuthenticator::continueGetAssertionAfterUserConsented):
        * UIProcess/WebAuthentication/Cocoa/LocalConnection.h:
        * UIProcess/WebAuthentication/Cocoa/LocalConnection.mm:
        (WebKit::LocalConnection::createCredentialPrivateKey const):
        (WebKit::LocalConnection::getAttestation const):
        * UIProcess/WebAuthentication/Cocoa/LocalService.mm:
        (WebKit::LocalService::isAvailable):
        * UIProcess/WebAuthentication/Mock/MockLocalConnection.h:
        * UIProcess/WebAuthentication/Mock/MockLocalConnection.mm:
        (WebKit::MockLocalConnection::createCredentialPrivateKey const):
        (WebKit::MockLocalConnection::getAttestation const):
        * WebKit.xcodeproj/project.pbxproj:

2020-02-20  Eric Liang  <ericliang@apple.com>

        AX: Adopt _AXSCopyPathForAccessibilityBundle for WebKit
        https://bugs.webkit.org/show_bug.cgi?id=207828

        Use the new SPI _AXSCopyPathForAccessibilityBundle.

        Reviewed by Darin Adler.

        Covered by checkAccessibilityWebProcessLoaderBundleIsLoaded

        * Platform/spi/ios/AccessibilitySupportSPI.h:
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::webProcessLoaderAccessibilityBundlePath):

2020-02-20  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r257045.
        https://bugs.webkit.org/show_bug.cgi?id=208024

        Membuster ~16% regression (Requested by yusukesuzuki on
        #webkit).

        Reverted changeset:

        "Regression(r246188) WebProcess is launched too eagerly when
        [WKWebView _restoreSessionState] is called"
        https://bugs.webkit.org/show_bug.cgi?id=207908
        https://trac.webkit.org/changeset/257045

2020-02-20  Takashi Komori  <Takashi.Komori@sony.com>

        [Curl] Simplify Cookie class.
        https://bugs.webkit.org/show_bug.cgi?id=207930

        Reviewed by Don Olmstead.

        Removed redundant CookieJarCurl.cpp and made NetworkDataTaskCurl access CookieJarDB directly.
        CookieJarCurl was used for supporting file based cookie database but now it is no longer used.

        No new tests. Covered by existing tests.

        * NetworkProcess/Cookies/curl/WebCookieManagerCurl.cpp:
        (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
        * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
        (WebKit::NetworkDataTaskCurl::appendCookieHeader):
        (WebKit::NetworkDataTaskCurl::handleCookieHeaders):

2020-02-20  Chris Dumez  <cdumez@apple.com>

        REGRESSION (r255677): Reloading tab with beforeunload prompt closes tab when asking to stay on page
        https://bugs.webkit.org/show_bug.cgi?id=208015
        <rdar://problem/59591630>

        Reviewed by Geoffrey Garen.

        Make sure we only restart the tryClose timer after the beforeunload prompt if the timer was actually
        active before the prompt (i.e. tryClose was actually called). On Reload, tryClose is not called
        but beforeunload prompt may still happen.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel):

2020-02-20  Antti Koivisto  <antti@apple.com>

        [macOS] Disable RunLoop function dispatch when there is a pending rendering update
        https://bugs.webkit.org/show_bug.cgi?id=207931

        Reviewed by Geoffrey Garen.

        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
        (WebKit::TiledCoreAnimationDrawingArea::scheduleRenderingUpdateRunLoopObserver):

        Don't do anything if the runloop is already scheduled. This frequently happens
        from inside updateRendering.

2020-02-20  Youenn Fablet  <youenn@apple.com>

        [iOS] GPUProcess needs to provide the parent PID before starting camera capture
        https://bugs.webkit.org/show_bug.cgi?id=208009

        Reviewed by Eric Carlson.

        Like we do when capturing in WebProcess, we need to provide the parent PID before starting camera capture.
        Implement this in GPU process whenever creating a camera source.

        * GPUProcess/GPUConnectionToWebProcess.cpp:
        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
        (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
        (WebKit::UserMediaCaptureManagerProxy::ConnectionProxy::willStartCameraCapture):

2020-02-20  Tim Horton  <timothy_horton@apple.com>

        WKWebView with non-zero origin has the wrong top content inset with NSWindowStyleMaskFullSizeContentView
        https://bugs.webkit.org/show_bug.cgi?id=207998
        <rdar://problem/40942425>

        Reviewed by Sam Weinig.

        New API tests: TopContentInset.{AutomaticAdjustment, AutomaticAdjustmentDisabled, AutomaticAdjustmentDoesNotAffectInsetViews}

        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::updateContentInsetsIfAutomatic):
        Previously, a WKWebView with frame.origin anywhere other than {0, 0}
        would end up with the same top content inset as if it overlapped the
        titlebar.

        It's not clear what the original code was going for; we can determine
        the overlapping portion of the contentLayoutRect by simply converting
        it from window coordinates to WKWebView coordinates and looking at the
        origin (ensuring we don't let it go negative).

2020-02-20  Jason Lawrence  <lawrence.j@apple.com>

        Unreviewed, rolling out r257025.

        This commit broke a test on Mac wk2.

        Reverted changeset:

        "NetworkCache should use 4KB threshold for mmap-ed files
        instead of 16KB"
        https://bugs.webkit.org/show_bug.cgi?id=207882
        https://trac.webkit.org/changeset/257025

2020-02-20  Don Olmstead  <don.olmstead@sony.com>

        [CMake] Add WPE::libwpe target
        https://bugs.webkit.org/show_bug.cgi?id=207970

        Reviewed by Adrian Perez de Castro.

        Use the WPE::libwpe target.

        * PlatformGTK.cmake:
        * PlatformWPE.cmake:

2020-02-19  Chris Dumez  <cdumez@apple.com>

        Regression(r246188) WebProcess is launched too eagerly when [WKWebView _restoreSessionState] is called
        https://bugs.webkit.org/show_bug.cgi?id=207908

        Reviewed by Darin Adler.

        Since r246188, the WebProcess is launched eagerly when [WKWebView _restoreSessionState] is called. This is bad
        for performance because we are unable to leverage the process cache at this point (since we don't know which
        domain will be loaded).

        This patch thus reverts r246188 and fixes what r246188 was trying to address in a different way. If the process
        was not launched yet when restoreSessionState() is called, the session state properly gets sent to the WebProcess
        after launch, via the WebPageCreationParameters. What was missing at that point was that the session state was
        restore by an API Request. To fix this, we now pass an extra itemStatesWereRestoredByAPIRequest flag in
        WebPageCreationParameters.

        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::restoreFromSessionState):
        * UIProcess/WebPageProxy.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_overriddenMediaType):

2020-02-19  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r257029.
        https://bugs.webkit.org/show_bug.cgi?id=207996

        Doesn't fix the issue (Requested by ap on #webkit).

        Reverted changeset:

        "[iOS] Rename NSUserDefaultsSPI.h"
        https://bugs.webkit.org/show_bug.cgi?id=207977
        https://trac.webkit.org/changeset/257029

2020-02-19  Brian Burg  <bburg@apple.com>

        Web Automation: Automation.setWindowFrameOfBrowsingContext should accept negative x and y-origin values
        https://bugs.webkit.org/show_bug.cgi?id=207974
        <rdar://problem/59606705>

        Reviewed by Darin Adler.

        According to the spec, negative origin values are supported:

            https://w3c.github.io/webdriver/#set-window-rect

        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::setWindowFrameOfBrowsingContext):

2020-02-19  Chris Dumez  <cdumez@apple.com>

        Resources larger than 10MB are not stored in the disk cache
        https://bugs.webkit.org/show_bug.cgi?id=207967
        <rdar://problem/59572084>

        Reviewed by Darin Adler.

        This patch makes two policy changes to our disk cache:
        1. The capacity of the disk cache is now doubled. Based on available disk space, it could
           previously use up to 500MB of disk space. The limit is now 1GB.
        2. The per cache-entry limit is raised from 10MB to 1/8 of the disk cache capacity (so
           up to 128MB based on new maximum capacity).

        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::didReceiveBuffer):
        * Shared/CacheModel.cpp:
        (WebKit::calculateURLCacheSizes):

2020-02-19  Maciej Stachowiak  <mjs@apple.com>

        Use consistent capitalization and spacing in process-related feature names
        https://bugs.webkit.org/show_bug.cgi?id=207989

        Reviewed by Zalan Bujtas.

        No new tests, we don't test feature flag names.

        * Shared/WebPreferences.yaml: Adjust some feature names and descriptions.

2020-02-19  Youenn Fablet  <youenn@apple.com>

        Add support for AudioSession handling in GPUProcess for capture
        https://bugs.webkit.org/show_bug.cgi?id=207950

        Reviewed by Eric Carlson.

        Create a session manager for the GPUConnectionToWebProcess.
        Pass it to any audio capture source proxy.
        For UIProcesss audio capture, we still use the shared manager.

        * GPUProcess/GPUConnectionToWebProcess.cpp:
        (WebKit::GPUConnectionToWebProcess::sessionManager):
        * GPUProcess/GPUConnectionToWebProcess.h:
        * GPUProcess/GPUProcess.cpp:
        (WebKit::GPUProcess::setMockCaptureDevicesEnabled):
        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
        (WebKit::UserMediaCaptureManagerProxy::SourceProxy::SourceProxy):
        (WebKit::UserMediaCaptureManagerProxy::SourceProxy::~SourceProxy):
        (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
        (WebKit::UserMediaCaptureManagerProxy::clone):
        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
        * UIProcess/WebProcessProxy.cpp:

2020-02-19  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Rename NSUserDefaultsSPI.h
        https://bugs.webkit.org/show_bug.cgi?id=207977
        <rdar://problem/59609174>
        
        Reviewed by Brent Fulgham.

        No new tests, no behavior change.

        * UIProcess/Cocoa/PreferenceObserver.h:

2020-02-19  Yusuke Suzuki  <ysuzuki@apple.com>

        NetworkCache should use 4KB threshold for mmap-ed files instead of 16KB
        https://bugs.webkit.org/show_bug.cgi?id=207882

        Reviewed by Alex Christensen.

        We found that a lot of Vectors in Membuster is holding resource content. This is because we have 16KB threshold for mmap-ed files.
        If a file is smaller than 16KB, it is copied to Vector instead. But this is costly in terms of memory. If we use mmap-ed files,
        it becomes named-pages instead of anonymous-pages. File-backed non-dirty named-pages have a lot of benefit.

        1. The application is offering a hint that pages are file-backed. This means that OS can purge them at any time since the content can be recovered
           from the disk. This is cheaper than swapping / compressing anonymous pages since just discarding works.
        2. The application is offering a hint that pages have spatial locality. Purging pages in one named-pages region is better compared to purging
           the same # of anonymous pages randomly. Anonymous pages are split by malloc implementation and access pattern of pages in one VA is random. On
           the other hand, named-pages are accessed together because it is file, and file typically has sequential locality. And recovery of named pages are
           also cheap compared to anonymous pages since OS can prefetch pages once access happens because of sequential locality of files. This tendency makes
           OS like purging named pages instead of anonymous pages. In WebKit use case, this works perfectly. CachedResource typically has decoded content. So
           typically WebProcess does not access SharedBuffer after the content is decoded.

        This patch reduces the threshold from 16KB to page size (4KB in macOS, 16KB in iOS). This is pre-2015 behavior.
        This offers 2.56% progression with 98% probability in Membuster.

        * NetworkProcess/cache/NetworkCacheStorage.cpp:
        (WebKit::NetworkCache::maximumInlineBodySize):
        (WebKit::NetworkCache::estimateRecordsSize):
        (WebKit::NetworkCache::Storage::shouldStoreBodyAsBlob):

2020-02-19  Ryosuke Niwa  <rniwa@webkit.org>

        Crash in WebPageProxy::didStartProvisionalLoadForFrameShared
        https://bugs.webkit.org/show_bug.cgi?id=207973

        Reviewed by Chris Dumez.

        Use RefPtr to store Frame*.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):

2020-02-19  Ben Nham  <nham@apple.com>

        Avoid preconnecting to custom URL schemes
        https://bugs.webkit.org/show_bug.cgi?id=207964

        Reviewed by Ryosuke Niwa.

        This makes NetworkProcess::preconnectTo not preconnect to custom URL schemes. This matches
        the existing behavior in NetworkConnectionToWebProcess::preconnectTo.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::preconnectTo):

2020-02-19  Chris Dumez  <cdumez@apple.com>

        Regression(r247567) HTTP Disk cache capacity is no longer set
        https://bugs.webkit.org/show_bug.cgi?id=207959
        <rdar://problem/59603972>

        Reviewed by Alex Christensen.

        NetworkProcess::initializeNetworkProcess() was setting the cache model, which
        would iterate over all network sessions to update their network cache capacity.
        The issue was that network sessions were not constructed yet at this point.
        When the network session(s) would get created later on, they would construct
        their NetworkCache and it would use the default capacity (i.e.
        std::numeric_limits<size_t>::max()).

        To make this safer, I have moved the capacity computation to the Cache::open()
        method and now pass the capacity when constructing the network cache storage.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::initializeNetworkProcess):
        (WebKit::NetworkProcess::setCacheModelSynchronouslyForTesting):
        (WebKit::NetworkProcess::setCacheModel):
        * NetworkProcess/NetworkProcess.h:
        (WebKit::NetworkProcess::cacheModel const):
        * NetworkProcess/NetworkProcess.messages.in:
        * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
        (WebKit::CacheStorage::Caches::initialize):
        * NetworkProcess/cache/NetworkCache.cpp:
        (WebKit::NetworkCache::computeCapacity):
        (WebKit::NetworkCache::Cache::open):
        (WebKit::NetworkCache::Cache::capacity const):
        (WebKit::NetworkCache::Cache::updateCapacity):
        (WebKit::NetworkCache::Cache::setCapacity): Deleted.
        * NetworkProcess/cache/NetworkCache.h:
        * NetworkProcess/cache/NetworkCacheStorage.cpp:
        (WebKit::NetworkCache::Storage::open):
        (WebKit::NetworkCache::Storage::Storage):
        (WebKit::NetworkCache::Storage::setCapacity):
        * NetworkProcess/cache/NetworkCacheStorage.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::setCacheModel):

2020-02-19  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] fast/dom/focus-shift-crash.html and editing/selection/selection-change-in-disconnected-frame-crash.html crash after r256864
        https://bugs.webkit.org/show_bug.cgi?id=207939

        Reviewed by Tim Horton.

        Fix two layout tests that began to crash after r256864 due to a missing null check for EditorClient.
        To make this conditional a bit easier to read, pull out each case where we should avoid calling
        didChangeSelection() into a separate early return. The EditorClient may be null on iOS in the case where the
        Frame has been detached from its Page.

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::updateSelectionAppearance):

2020-02-19  Kate Cheney  <katherine_cheney@apple.com>

        WebPageProxy::PolicyDecisionSender should send a struct instead of many parameters
        https://bugs.webkit.org/show_bug.cgi?id=207936
        <rdar://problem/59590676>

        Reviewed by Alex Christensen.

        * Shared/PolicyDecision.h: Added.
        (WebKit::PolicyDecision::encode const):
        (WebKit::PolicyDecision::decode):
        * UIProcess/ProvisionalPageProxy.cpp:
        (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionSync):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::PolicyDecisionSender::send):
        (WebKit::WebPageProxy::PolicyDecisionSender::identifier):
        (WebKit::WebPageProxy::receivedPolicyDecision):
        (WebKit::WebPageProxy::decidePolicyForNavigationActionAsyncShared):
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
        (WebKit::WebPageProxy::decidePolicyForNavigationActionSyncShared):
        (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
        (WebKit::WebPageProxy::decidePolicyForResponseShared):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
        * WebProcess/WebPage/WebFrame.cpp:
        (WebKit::WebFrame::didReceivePolicyDecision):
        * WebProcess/WebPage/WebFrame.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::didReceivePolicyDecision):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2020-02-18  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] Safari sometimes crashes under ViewGestureController::beginSwipeGesture
        https://bugs.webkit.org/show_bug.cgi?id=207929
        <rdar://problem/59493326>

        Reviewed by Tim Horton.

        Make ViewGestureController::beginSwipeGesture robust in the case where the target back/forward item no longer
        exists. This means that a back/forward target item existed when UIKit called into us in canSwipeInDirection, but
        this item was removed by the time beginSwipeGesture is called.

        A couple of conditions could make this possible, such as handling incoming synchronous IPC in the UI process
        that could change the back/forward list before sending outgoing IPC to the web process; alternately, an SPI
        client could be overriding -_webViewDidBeginNavigationGesture: to run some logic that removes the would-be
        target back/forward item.

        To protect against these scenarios, null-check targetItem before attempting to dereference it; if it is null,
        then reset some state that might've been set as a result of beginning the swipe (that is, m_activeGestureType
        and m_currentGestureID) and then immediately bail before attempting to install the snapshot view and proceed
        with the swipe.

        * UIProcess/ios/ViewGestureControllerIOS.mm:
        (WebKit::ViewGestureController::beginSwipeGesture):

2020-02-19  Chris Dumez  <cdumez@apple.com>

        Disable the process cache when process-per-tab is disabled in the debug menu
        https://bugs.webkit.org/show_bug.cgi?id=207949
        <rdar://problem/57094837>

        Reviewed by Geoffrey Garen.

        Disable the process cache when process-per-tab is disabled in the debug menu. The process cache is a
        process-swap-on-navigation optimization and process-swap-on-navigation is already disabled when
        process-per-tab is disabled. The process cache is not useful with such configuration and actually
        leads to crashes too.

        * UIProcess/WebProcessCache.cpp:
        (WebKit::WebProcessCache::updateCapacity):

2020-02-19  Brent Fulgham  <bfulgham@apple.com>

        Re-disable top-level data URL navigations
        https://bugs.webkit.org/show_bug.cgi?id=207917
        <rdar://problem/59568037>

        Reviewed by Darin Adler.

        In Bug 207719 we allowed top-level navigations to data URLs by default. This
        patch updates client loading API calls so that we can go back to a default
        block of these loads without breaking WebKit clients.

        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
        (-[WKWebViewConfiguration init]):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::loadDataImpl): Recognize direct data loads started from client API.
        * WebProcess/WebPage/WebPage.h:

2020-02-19  Megan Gardner  <megan_gardner@apple.com>

        Ensure that contenteditable carets on macCatalyst are the right color, especially in Dark Mode
        https://bugs.webkit.org/show_bug.cgi?id=207789
        <rdar://problem/59429715>

        Reviewed by Tim Horton.

        Because UIKit only uses label color for the caret in macCatalyst, 
        we need skip text input traits and send the correctly calculated color 
        to UIKit.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView insertionPointColor]):
        (-[WKContentView getInteractionTintColor]):
        (-[WKContentView _updateInteractionTintColor]):
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::platformEditorState const):

2020-02-19  Cathie Chen  <cathiechen@igalia.com>

        Enable AspectRatioOfImgFromWidthAndHeightEnabled by default
        https://bugs.webkit.org/show_bug.cgi?id=207880

        Reviewed by Frédéric Wang.

        * Shared/WebPreferences.yaml:

2020-02-18  Zan Dobersek  <zdobersek@igalia.com>

        [WPE] Support 2D axis, smooth-motion events
        https://bugs.webkit.org/show_bug.cgi?id=207881

        Reviewed by Carlos Garcia Campos.

        WPE's WebEventFactory should also handle axis events that are capable
        of providing information about axis change in both dimensions. In case
        of smooth motion, the delta values should be preserved and not
        transformed into line-steps.

        Similarly, the ScrollGestureController should also adopt the 2D axis
        event type, producing smooth-motion events when dispatching handling
        a scroll gesture.

        The changes are guarded and only enabled when building against at least
        libwpe 1.5.0 since that's when the new API was added.

        * Shared/libwpe/WebEventFactory.cpp:
        (WebKit::WebEventFactory::createWebWheelEvent):
        * UIProcess/API/wpe/ScrollGestureController.cpp:
        (WebKit::ScrollGestureController::handleEvent):
        * UIProcess/API/wpe/ScrollGestureController.h:
        (WebKit::ScrollGestureController::axisEvent):

2020-02-18  Ben Nham  <nham@apple.com>

        Set User-Agent in preconnect requests
        https://bugs.webkit.org/show_bug.cgi?id=207777

        Reviewed by Chris Dumez.

        When using an HTTPS proxy, CFNetwork will not reuse a preconnected socket if the User-Agent
        on the preconnect request doesn't match the User-Agent of the actual request
        (<rdar://problem/59434166>). To work around this, this sets the User-Agent on preconnect
        requests.

        In addition, this patch moves the preconnect request from WebPage::loadRequest in the
        WebProcess to WebPageProxy::loadRequest in the UIProcess. This is because there can be
        long sync IPCs that last >100 ms that occur before WebProcess::loadRequest even starts,
        e.g. https://bugs.webkit.org/show_bug.cgi?id=203165.

        By making both changes, we see a ~2% improvement in PLT5 times.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::preconnectTo):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::preconnectTo):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::loadRequestWithNavigationShared):
        (WebKit::WebPageProxy::preconnectTo):
        * UIProcess/WebPageProxy.h:
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::preconnectTo):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::loadRequest):

2020-02-18  Lauro Moura  <lmoura@igalia.com>

        [WebKit] Avoid segfault if editor client is null
        https://bugs.webkit.org/show_bug.cgi?id=207925

        Reviewed by Darin Adler.

        Missing check was causing crashes running
        editing/selection/selection-change-in-disconnected-frame-crash.html in
        Mojave, iOS and GTK bots.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::editorState const):

2020-02-18  Youenn Fablet  <youenn@apple.com>

        SWServer::claim should check for the service worker to be active
        https://bugs.webkit.org/show_bug.cgi?id=207739
        <rdar://problem/45441129>

        Reviewed by Alex Christensen.

        Use Async Reply to remove the need for a map and passing integers around.

        * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
        (WebKit::WebSWServerToContextConnection::claimCompleted): Deleted.
        * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
        * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        (WebKit::WebSWContextManagerConnection::claim):
        (WebKit::WebSWContextManagerConnection::claimCompleted): Deleted.
        * WebProcess/Storage/WebSWContextManagerConnection.h:
        * WebProcess/Storage/WebSWContextManagerConnection.messages.in:

2020-02-18  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Allow different back-ends for ImageBuffer
        https://bugs.webkit.org/show_bug.cgi?id=207048

        Reviewed by Tim Horton.

        * WebProcess/WebPage/WebFrame.cpp:
        (WebKit::WebFrame::createSelectionSnapshot const):

2020-02-18  Youenn Fablet  <youenn@apple.com>

        Add support for WebInspector WebSocket handshake in the new WebSocket code path
        https://bugs.webkit.org/show_bug.cgi?id=207913

        Reviewed by Alex Christensen.

        Whenever creating the WebSocketTask, pass the request actually used for handshake to the WebProcess.
        Whenever being connected, pass the request actually used for handshake to the WebProcess.
        In case of failure before the web socket is connected, we send the response if we can get a non null from the task.

        * NetworkProcess/NetworkSocketChannel.cpp:
        (WebKit::NetworkSocketChannel::didSendHandshakeRequest):
        (WebKit::NetworkSocketChannel::didReceiveHandshakeResponse):
        * NetworkProcess/NetworkSocketChannel.h:
        * NetworkProcess/cocoa/WebSocketTaskCocoa.mm:
        (WebKit::WebSocketTask::WebSocketTask):
        (WebKit::WebSocketTask::didConnect):
        * WebProcess/Network/WebSocketChannel.cpp:
        (WebKit::WebSocketChannel::connect):
        (WebKit::WebSocketChannel::didConnect):
        (WebKit::WebSocketChannel::didSendHandshakeRequest):
        (WebKit::WebSocketChannel::didReceiveHandshakeResponse):
        * WebProcess/Network/WebSocketChannel.h:
        * WebProcess/Network/WebSocketChannel.messages.in:

2020-02-18  Chris Dumez  <cdumez@apple.com>

        Do not eagerly launch WebProcess when WKPagePostMessageToInjectedBundle() is called
        https://bugs.webkit.org/show_bug.cgi?id=207905

        Reviewed by Alex Christensen.

        Do not eagerly launch WebProcess when WKPagePostMessageToInjectedBundle() is called. It is bad for
        performance as we cannot leverage the process cache if we don't know the domain of the site that
        will be loaded.

        Instead we now queue those injected bundle messages until we really need to launch the process.

        No new tests, WebKitTestRunner extensively relies on this private API already, and was the
        reason we did the eager process launch in the first place (https://trac.webkit.org/changeset/243156).

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::launchProcess):
        * UIProcess/WebPageProxy.h:

2020-02-18  Chris Dumez  <cdumez@apple.com>

        Drop getSandboxExtensionsForBlobFiles() as it is dead code
        https://bugs.webkit.org/show_bug.cgi?id=207909
        <rdar://problem/59562180>

        Reviewed by Per Arne Vollan.

        * NetworkProcess/NetworkProcess.cpp:
        * NetworkProcess/NetworkProcess.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/Network/NetworkProcessProxy.messages.in:

2020-02-18  Alex Christensen  <achristensen@webkit.org>

        Expand WKRemoteObjectCoder supported POD types to encode NSURLResponse types
        https://bugs.webkit.org/show_bug.cgi?id=207912
        <rdar://problem/59556922>

        Reviewed by Brian Weinstein.

        This expands on r158806.  There's no reason not to support all NSNumber types, so I did.
        Covered by API tests.

        * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
        (encodeInvocationArguments):
        (-[WKRemoteObjectEncoder encodeValueOfObjCType:at:]):
        (-[WKRemoteObjectDecoder decodeValueOfObjCType:at:]):
        (decodeInvocationArguments):

2020-02-18  Daniel Bates  <dabates@apple.com>

        Ask the EditorClient whether to reveal the current selection after insertion
        https://bugs.webkit.org/show_bug.cgi?id=207866
        <rdar://problem/59553028>

        Reviewed by Wenson Hsieh.

        On iOS, adds a new WebPage message SetShouldRevealCurrentSelectionAfterInsertion that the
        UI process can send to toggle whether the current selection should be revealed after a
        text insertion.

        * UIProcess/WebPageProxy.cpp:
        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::setWaitingForPostLayoutEditorStateUpdateAfterFocusingElement):
        * UIProcess/ios/WKContentViewInteraction.h:
        Add some declarations for some functions that I need to make the corresponding Apple Internal fix in <rdar://problem/57608794>.
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:activityStateChanges:userObject:]):
        If we are not going to zoom to reveal the focused element immediately then call WebPage::setWaitingForPostLayoutEditorStateUpdateAfterFocusingElement(true)
        so that we schedule a -_didUpdateEditorState callback on the next editor state update so that we can call
        -_zoomToRevealFocusedElement.
        (-[WKContentView _elementDidBlur]): Call WebPage::setWaitingForPostLayoutEditorStateUpdateAfterFocusingElement(false)
        to unschedule an existing -_didUpdateEditorState callback.

        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::elementDidFocus):
        (WebKit::WebPageProxy::elementDidBlur):
        Move the setting of m_waitingForPostLayoutEditorStateUpdateAfterFocusingElement from here to
        -_elementDidFocus and _elementDidBlur when an element is focused or blurred, respectively.

        (WebKit::WebPageProxy::setShouldRevealCurrentSelectionAfterInsertion): Added.
        * WebProcess/WebCoreSupport/WebEditorClient.h:
        * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
        (WebKit::WebEditorClient::shouldRevealCurrentSelectionAfterInsertion const): Added.
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::editorState const): Mark the editor state as ignoring selection changes if EditorClient::shouldRevealCurrentSelectionAfterInsertion()
        returns false.
        (WebKit::WebPage::didCommitLoad): Reset state.
        * WebProcess/WebPage/WebPage.h:
        (WebKit::WebPage::shouldRevealCurrentSelectionAfterInsertion const):
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::updateSelectionAppearance): Do not send an update if EditorClient::shouldRevealCurrentSelectionAfterInsertion()
        returns false.
        (WebKit::WebPage::setShouldRevealCurrentSelectionAfterInsertion): Added. Update state, if needed. If passed
        false, then reveal the current selection just as we would have done after an insertion and schedule a full
        editor state update (i.e. an update after layout is performed). The latter will trigger the UI process on iOS
        to zoom to reveal the newly focused element.

2020-02-18  Wenson Hsieh  <wenson_hsieh@apple.com>

        [macOS] Web process may crash under ServicesOverlayController::buildPotentialHighlightsIfNeeded
        https://bugs.webkit.org/show_bug.cgi?id=207899
        <rdar://problem/55658207>

        Reviewed by Tim Horton and Simon Fraser.

        Add another missing null check on iOS, for the case where FrameView is null.

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::platformEditorState const):

2020-02-18  Youenn Fablet  <youenn@apple.com>

        NetworkDataTask should not expect its session wrapper to be always live
        https://bugs.webkit.org/show_bug.cgi?id=207903
        rdar://problem/59291486

        Reviewed by Alex Christensen.

        NetworkDataTaskCocoa should take a weak pointer to its session wrapper.
        If the session wrapper is still valid, then we can remove the task from the session wrapper map.
        We cannot guarantee session wrapper is valid since NetworkDataTask is ref counted.

        * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
        (WebKit::NetworkDataTaskCocoa::~NetworkDataTaskCocoa):

2020-02-18  Antti Koivisto  <antti@apple.com>

        [macOS] Don't fire timers when there is a pending rendering update
        https://bugs.webkit.org/show_bug.cgi?id=207889

        Reviewed by Simon Fraser.

        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
        (WebKit::TiledCoreAnimationDrawingArea::scheduleRenderingUpdateRunLoopObserver):

        Ensure the event loop cycles to reach the runloop observer as fast as possible.

2020-02-18  Alex Christensen  <achristensen@webkit.org>

        Unreviewed, rolling out r254873.
        https://bugs.webkit.org/show_bug.cgi?id=205751

        This is reverting r254081 which is effectively re-landing part of r254873 that was reverted
        supposing that would be related to the fix for rdar://problem/59136037 but it was not.
        Re-landing this is a step towards rdar://problem/56027111

        Reverted changeset:

        "Revert suppressesConnectionTerminationOnSystemChange part of
        r254081"
        https://bugs.webkit.org/show_bug.cgi?id=205751
        https://trac.webkit.org/changeset/254873

2020-02-18  Per Arne Vollan  <pvollan@apple.com>

        Move [UIDevice currentDevice] calls to UI process
        https://bugs.webkit.org/show_bug.cgi?id=204320

        Reviewed by Darin Adler.

        Get the localized device name in the UI process, and send it to the WebContent process as part of the
        process creation parameters.

        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const):
        (WebKit::WebProcessCreationParameters::decode):
        * Shared/WebProcessCreationParameters.h:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):

2020-02-18  Youenn Fablet  <youenn@apple.com>

        Use more ObjectIdentifier in WebRTC MDNS register
        https://bugs.webkit.org/show_bug.cgi?id=207548

        Reviewed by Eric Carlson.

        Use ObjectIdentifier for MDNSRegister for more type and IPC safety.
        Update MDNSRegister to also use DocumentIdentifier where more appropriate.

        * NetworkProcess/webrtc/NetworkMDNSRegister.cpp:
        (WebKit::PendingRegistrationRequest::PendingRegistrationRequest):
        (WebKit::NetworkMDNSRegister::registerMDNSName):
        (): Deleted.
        * NetworkProcess/webrtc/NetworkMDNSRegister.h:
        * NetworkProcess/webrtc/NetworkMDNSRegister.messages.in:
        * Scripts/webkit/messages.py:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
        (WebKit::LibWebRTCProvider::unregisterMDNSNames):
        (WebKit::LibWebRTCProvider::registerMDNSName):
        * WebProcess/Network/webrtc/LibWebRTCProvider.h:
        * WebProcess/Network/webrtc/WebMDNSRegister.cpp:
        (WebKit::WebMDNSRegister::finishedRegisteringMDNSName):
        (WebKit::WebMDNSRegister::unregisterMDNSNames):
        (WebKit::WebMDNSRegister::registerMDNSName):
        * WebProcess/Network/webrtc/WebMDNSRegister.h:
        (): Deleted.
        * WebProcess/Network/webrtc/WebMDNSRegister.messages.in:

2020-02-18  Simon Fraser  <simon.fraser@apple.com>

        Move from "layer flush" terminology to "rendering update"
        https://bugs.webkit.org/show_bug.cgi?id=207870

        Reviewed by Tim Horton.
        
        Rename various functions and member variables to move away from the legacy "layer flush"
        terminology and instead use "rendering update", matching Page::updateRendering(). The fact
        that we have layers is an implementation detail.
        
        Change LayerFlushThrottlingState to be an OptionSet<>.

        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::scheduleRenderingUpdate):
        (WebKit::WebChromeClient::adjustRenderUpdateThrottling):
        (WebKit::WebChromeClient::renderingUpdateThrottlingIsActive const):
        (WebKit::WebChromeClient::scheduleCompositingLayerFlush): Deleted.
        (WebKit::WebChromeClient::adjustLayerFlushThrottling): Deleted.
        (WebKit::WebChromeClient::layerFlushThrottlingIsActive const): Deleted.
        * WebProcess/WebCoreSupport/WebChromeClient.h:
        * WebProcess/WebPage/DrawingArea.h:
        (WebKit::DrawingArea::renderingUpdateThrottlingIsActive const):
        (WebKit::DrawingArea::adjustRenderUpdateThrottling):
        (WebKit::DrawingArea::layerFlushThrottlingIsActive const): Deleted.
        (WebKit::DrawingArea::adjustLayerFlushThrottling): Deleted.
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h:
        (WebKit::RemoteLayerTreeContext::setNextFlushIsForImmediatePaint):
        (WebKit::RemoteLayerTreeContext::nextFlushIsForImmediatePaint const):
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm:
        (WebKit::RemoteLayerTreeDisplayRefreshMonitor::requestRefreshCallback):
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
        (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
        (WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
        (WebKit::RemoteLayerTreeDrawingArea::updateGeometry):
        (WebKit::RemoteLayerTreeDrawingArea::setLayerTreeStateIsFrozen):
        (WebKit::RemoteLayerTreeDrawingArea::forceRepaint):
        (WebKit::RemoteLayerTreeDrawingArea::setExposedContentRect):
        (WebKit::RemoteLayerTreeDrawingArea::scheduleImmediateRenderingUpdate):
        (WebKit::RemoteLayerTreeDrawingArea::scheduleInitialDeferredPaint):
        (WebKit::RemoteLayerTreeDrawingArea::scheduleRenderingUpdate):
        (WebKit::RemoteLayerTreeDrawingArea::adjustRenderUpdateThrottling):
        (WebKit::RemoteLayerTreeDrawingArea::updateRendering):
        (WebKit::RemoteLayerTreeDrawingArea::didUpdate):
        (WebKit::RemoteLayerTreeDrawingArea::activityStateDidChange):
        (WebKit::RemoteLayerTreeDrawingArea::addTransactionCallbackID):
        (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlushImmediately): Deleted.
        (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlush): Deleted.
        (WebKit::RemoteLayerTreeDrawingArea::adjustLayerFlushThrottling): Deleted.
        (WebKit::RemoteLayerTreeDrawingArea::flushLayers): Deleted.
        * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm:
        (WebKit::RemoteScrollingCoordinator::scheduleTreeStateCommit):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::scheduleFullEditorStateUpdate):
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::dynamicViewportSizeUpdate):
        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
        (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
        (WebKit::TiledCoreAnimationDrawingArea::~TiledCoreAnimationDrawingArea):
        (WebKit::TiledCoreAnimationDrawingArea::forceRepaint):
        (WebKit::TiledCoreAnimationDrawingArea::setLayerTreeStateIsFrozen):
        (WebKit::TiledCoreAnimationDrawingArea::scheduleRenderingUpdate):
        (WebKit::TiledCoreAnimationDrawingArea::scheduleImmediateRenderingUpdate):
        (WebKit::TiledCoreAnimationDrawingArea::attachViewOverlayGraphicsLayer):
        (WebKit::TiledCoreAnimationDrawingArea::setShouldScaleViewToFitDocument):
        (WebKit::TiledCoreAnimationDrawingArea::dispatchAfterEnsuringUpdatedScrollPosition):
        (WebKit::TiledCoreAnimationDrawingArea::addTransactionCallbackID):
        (WebKit::TiledCoreAnimationDrawingArea::updateRendering):
        (WebKit::TiledCoreAnimationDrawingArea::suspendPainting):
        (WebKit::TiledCoreAnimationDrawingArea::updateGeometry):
        (WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToPage):
        (WebKit::TiledCoreAnimationDrawingArea::updateRenderingRunLoopCallback):
        (WebKit::TiledCoreAnimationDrawingArea::invalidateRenderingUpdateRunLoopObserver):
        (WebKit::TiledCoreAnimationDrawingArea::scheduleRenderingUpdateRunLoopObserver):
        (WebKit::TiledCoreAnimationDrawingArea::adjustRenderUpdateThrottling):
        (WebKit::TiledCoreAnimationDrawingArea::renderingUpdateThrottlingIsActive const):
        (WebKit::TiledCoreAnimationDrawingArea::startRenderThrottlingTimer):
        (WebKit::TiledCoreAnimationDrawingArea::renderThrottlingTimerFired):
        (WebKit::TiledCoreAnimationDrawingArea::scheduleCompositingLayerFlush): Deleted.
        (WebKit::TiledCoreAnimationDrawingArea::scheduleCompositingLayerFlushImmediately): Deleted.
        (WebKit::TiledCoreAnimationDrawingArea::flushLayers): Deleted.
        (WebKit::TiledCoreAnimationDrawingArea::layerFlushRunLoopCallback): Deleted.
        (WebKit::TiledCoreAnimationDrawingArea::invalidateLayerFlushRunLoopObserver): Deleted.
        (WebKit::TiledCoreAnimationDrawingArea::scheduleLayerFlushRunLoopObserver): Deleted.
        (WebKit::TiledCoreAnimationDrawingArea::adjustLayerFlushThrottling): Deleted.
        (WebKit::TiledCoreAnimationDrawingArea::layerFlushThrottlingIsActive const): Deleted.
        (WebKit::TiledCoreAnimationDrawingArea::startLayerFlushThrottlingTimer): Deleted.
        (WebKit::TiledCoreAnimationDrawingArea::layerFlushThrottlingTimerFired): Deleted.

2020-02-18  Daniel Bates  <dabates@apple.com>

        Rename dispatchDidReceiveEditorStateAfterFocus() to dispatchDidUpdateEditorState() to better describe its purpose
        https://bugs.webkit.org/show_bug.cgi?id=207865

        Reviewed by Wenson Hsieh.

        Although the iOS implementation bails out unless it was called after WebPageProxy::elementDidFocus()
        this platform-independent function is actually invoked whenever the UI process receives either
        an editor state update or a layer tree commit. Renaming this function to better describe its multi-
        function purpose, which is to allow the UI process a chance to run post-editor update logic.

        * UIProcess/PageClient.h:
        * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
        (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
        * UIProcess/WebPageProxy.cpp:
        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/PageClientImplIOS.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::didUpdateEditorState):
        (WebKit::PageClientImpl::didReceiveEditorStateUpdateAfterFocus): Deleted.
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _didUpdateEditorState]):
        (-[WKContentView _didReceiveEditorStateUpdateAfterFocus]): Deleted.
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::dispatchDidUpdateEditorState):
        (WebKit::WebPageProxy::dispatchDidReceiveEditorStateAfterFocus): Deleted.

2020-02-17  Wenson Hsieh  <wenson_hsieh@apple.com>

        Selection cannot be modified via text interaction in some areas of the compose body field in Gmail
        https://bugs.webkit.org/show_bug.cgi?id=207854
        <rdar://problem/59218824>

        Reviewed by Tim Horton.

        Adjusts more call sites in WebKit to ignore child frames that are hidden when hit-testing. See WebCore/ChangeLog
        for more details.

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::rectForElementAtInteractionLocation const):
        (WebKit::WebPage::handleStylusSingleTapAtPoint):
        (WebKit::rangeForPointInRootViewCoordinates):
        (WebKit::WebPage::setFocusedFrameBeforeSelectingTextAtLocation):
        (WebKit::selectionPositionInformation):
        (WebKit::textInteractionPositionInformation):
        (WebKit::WebPage::positionInformation):

2020-02-17  Chris Dumez  <cdumez@apple.com>

        [WK2][Cocoa] Implement in-WebProcess cookie cache to avoid sync IPC for document.cookie in most cases
        https://bugs.webkit.org/show_bug.cgi?id=207593
        <rdar://problem/56027027>

        Reviewed by Antti Koivisto.

        See WebCore ChangeLog.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::~NetworkConnectionToWebProcess):
        (WebKit::NetworkConnectionToWebProcess::domCookiesForHost):
        (WebKit::NetworkConnectionToWebProcess::unsubscribeFromCookieChangeNotifications):
        (WebKit::NetworkConnectionToWebProcess::cookiesAdded):
        (WebKit::NetworkConnectionToWebProcess::cookiesDeleted):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * Scripts/webkit/messages.py:
        * Shared/WebPreferences.yaml:
        * Sources.txt:
        * SourcesCocoa.txt:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/Network/NetworkProcessConnection.cpp:
        (WebKit::NetworkProcessConnection::cookiesAdded):
        (WebKit::NetworkProcessConnection::cookiesDeleted):
        * WebProcess/Network/NetworkProcessConnection.h:
        * WebProcess/Network/NetworkProcessConnection.messages.in:
        * WebProcess/WebPage/Cocoa/WebCookieCacheCocoa.mm: Copied from Source/WebKit/WebProcess/WebPage/WebCookieJar.h.
        (WebKit::WebCookieCache::inMemoryStorageSession):
        * WebProcess/WebPage/WebCookieCache.cpp: Added.
        (WebKit::WebCookieCache::isFunctional):
        (WebKit::WebCookieCache::cookiesForDOM):
        (WebKit::WebCookieCache::setCookiesFromDOM):
        (WebKit::WebCookieCache::cookiesAdded):
        (WebKit::WebCookieCache::cookiesDeleted):
        (WebKit::WebCookieCache::clear):
        (WebKit::WebCookieCache::clearForHost):
        (WebKit::WebCookieCache::pruneCacheIfNecessary):
        * WebProcess/WebPage/WebCookieCache.h: Copied from Source/WebKit/WebProcess/WebPage/WebCookieJar.h.
        * WebProcess/WebPage/WebCookieJar.cpp:
        (WebKit::WebCookieJar::isEligibleForCache const):
        (WebKit::WebCookieJar::cookies const):
        (WebKit::WebCookieJar::setCookies):
        (WebKit::WebCookieJar::cookiesAdded):
        (WebKit::WebCookieJar::cookiesDeleted):
        (WebKit::WebCookieJar::clearCache):
        (WebKit::WebCookieJar::clearCacheForHost):
        * WebProcess/WebPage/WebCookieJar.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_overriddenMediaType):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::WebProcess):
        * WebProcess/WebProcess.h:
        (WebKit::WebProcess::cookieJar):

2020-02-17  Chris Dumez  <cdumez@apple.com>

        Defer execution of async scripts until until the document is loaded
        https://bugs.webkit.org/show_bug.cgi?id=207698
        <rdar://problem/57625747>

        Reviewed by Antti Koivisto.

        Defer execution of async scripts until until the document is loaded by default to reduce time
        to first paint.

        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
        (-[WKWebViewConfiguration init]):

2020-02-17  Tim Horton  <timothy_horton@apple.com>

        Add and adopt HAVE(LOOKUP_GESTURE_RECOGNIZER)
        https://bugs.webkit.org/show_bug.cgi?id=207876

        Reviewed by Wenson Hsieh.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView setupInteraction]):
        (-[WKContentView cleanupInteraction]):
        (-[WKContentView _removeDefaultGestureRecognizers]):
        (-[WKContentView _addDefaultGestureRecognizers]):
        (-[WKContentView gestureRecognizer:shouldReceiveTouch:]):
        For symmetry's sake, introduce a HAVE for this gesture.

2020-02-17  Youenn Fablet  <youenn@apple.com>

        Do not call whenReady callbacks in case of network process crash
        https://bugs.webkit.org/show_bug.cgi?id=207661

        Reviewed by Chris Dumez.

        * WebProcess/Storage/WebSWClientConnection.cpp:
        (WebKit::WebSWClientConnection::clear):
        The callback is a Function so it is fine not calling it and calling it with a default value is not safe.

2020-02-17  Alex Christensen  <achristensen@webkit.org> and Pavel Feldman <pavel.feldman@gmail.com>

        Ephemeral session data leaks between processes
        https://bugs.webkit.org/show_bug.cgi?id=207404

        Reviewed by Darin Adler.

        If two processes with the same bundle identifier create an ephemeral WKWebsiteDataStore, we were calling
        _CFURLStorageSessionCreate with the same string, which caused our cookies to be shared.  To prevent this,
        add a UUID to the identifier to make them truly unique.

        We don't have test infrastructure for multiple UI processes at the same time, but I manually verified
        that this fixes the bug.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::ensureSession):

2020-02-17  Megan Gardner  <megan_gardner@apple.com>

        Data detectors do not trigger on macCatalyst
        https://bugs.webkit.org/show_bug.cgi?id=207860
        <rdar://problem/59038913>

        Reviewed by Tim Horton.

        The lookup gesture which run data detection needs touch information to function. Allow touches to be sent to the gesture. 

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView gestureRecognizer:shouldReceiveTouch:]):

2020-02-17  Tim Horton  <timothy_horton@apple.com>

        macCatalyst: I-beam is still too aggressive in non-editable content, shows up beyond the end of text
        https://bugs.webkit.org/show_bug.cgi?id=207867
        <rdar://problem/59528927>

        Reviewed by Wenson Hsieh.

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::populateCaretContext):
        Only expand the I-beam region to the end of the line in editable text.
        This better matches the macOS behavior.

2020-02-17  Youenn Fablet  <youenn@apple.com>

        Fix regression in NSURLSessionWebSocketTask WSS support
        https://bugs.webkit.org/show_bug.cgi?id=207855

        Reviewed by Alex Christensen.

        Covered by http/tests/websocket/tests/hybi/simple-wss.html passing with NSURLSessionWebSocketTask code path.
        When having an authentication challenge, we need to get the session from the task.
        This was not working for websocket tasks.
        Fix this by retrieving the session from the web socket data task, which is retrieved from the task identifier.

        * NetworkProcess/Downloads/DownloadID.h:
        (WebKit::DownloadID::operator bool const):
        Add operator bool for convenience.
        * NetworkProcess/NetworkSocketChannel.cpp:
        (WebKit::NetworkSocketChannel::session):
        * NetworkProcess/NetworkSocketChannel.h:
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (-[WKNetworkSessionDelegate sessionFromTask:]):
        (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
        * NetworkProcess/cocoa/WebSocketTaskCocoa.h:
        * NetworkProcess/cocoa/WebSocketTaskCocoa.mm:
        (WebKit::WebSocketTask::networkSession):

2020-02-17  Alex Christensen  <achristensen@webkit.org>

        Allow suffixes on com.apple.WebKit.WebContent XPC service name
        https://bugs.webkit.org/show_bug.cgi?id=207856
        <rdar://problem/59455881>

        Reviewed by Chris Dumez.

        * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
        (WebKit::XPCServiceEventHandler):

2020-02-17  Youenn Fablet  <youenn@apple.com>

        Add WebInspector support to WebKit::WebSocketChannel
        https://bugs.webkit.org/show_bug.cgi?id=207794

        Reviewed by Darin Adler.

        Call WebInspector hooks wherever needed.
        We do not have access to frames so we make as if a message is part of one frame.
        We do not have yet a response so provide an empty one as well.

        * WebProcess/Network/WebSocketChannel.cpp:
        (WebKit::WebSocketChannel::notifySendFrame):
        (WebKit::WebSocketChannel::createMessageQueue):
        (WebKit::WebSocketChannel::WebSocketChannel):
        (WebKit::WebSocketChannel::connect):
        (WebKit::WebSocketChannel::sendMessage):
        (WebKit::WebSocketChannel::disconnect):
        (WebKit::WebSocketChannel::didConnect):
        (WebKit::createWebSocketFrameForWebInspector):
        (WebKit::WebSocketChannel::didReceiveText):
        (WebKit::WebSocketChannel::didReceiveBinaryData):
        (WebKit::WebSocketChannel::didClose):
        (WebKit::WebSocketChannel::didReceiveMessageError):
        * WebProcess/Network/WebSocketChannel.h:

2020-02-17  Per Arne Vollan  <pvollan@apple.com>

        Use CF prefs direct mode in the WebContent process
        https://bugs.webkit.org/show_bug.cgi?id=203420

        Reviewed by Brent Fulgham.

        Enable CF prefs direct mode, in order to avoid connecting to the CF prefs daemon in the WebContent process.
        In direct mode, the prefs files will be accessed directly, and not through the CF prefs daemon. A preference
        observer is added in the UI process, which will notify the WebContent process about preferences changes to a
        domain. After a preference change, the WebContent process will set the new preference value for the changed
        key/domain.

        API tests: Tests added in PreferenceChanges.mm.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
        * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
        (WebKit::XPCServiceMain):
        * UIProcess/Cocoa/PreferenceObserver.h: Added.
        (__attribute__):
        * UIProcess/Cocoa/PreferenceObserver.mm: Added.
        (-[WKUserDefaults _notifyObserversOfChangeFromValuesForKeys:toValuesForKeys:]):
        (-[WKUserDefaults observeValueForKeyPath:ofObject:change:context:]):
        (-[WKUserDefaults initWithSuiteName:]):
        (+[WKPreferenceObserver sharedInstance]):
        (-[WKPreferenceObserver init]):
        (-[WKPreferenceObserver preferenceDidChange:key:encodedValue:]):
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        (WebKit::WebProcessPool::notifyPreferencesChanged):
        * UIProcess/WebProcessPool.h:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::notifyPreferencesChanged):
        * WebProcess/com.apple.WebProcess.sb.in:

2020-02-17  Youenn Fablet  <youenn@apple.com>

        Do not send the client URL to network process
        https://bugs.webkit.org/show_bug.cgi?id=207803

        Reviewed by Darin Adler.

        * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
        (WebKit::WebSWServerConnection::scheduleUnregisterJobInServer):
        * NetworkProcess/ServiceWorker/WebSWServerConnection.h:
        * NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in:
        * WebProcess/Storage/WebSWClientConnection.cpp:
        (WebKit::WebSWClientConnection::scheduleUnregisterJobInServer):
        * WebProcess/Storage/WebSWClientConnection.h:

2020-02-17  Víctor Manuel Jáquez Leal  <vjaquez@igalia.com>

        a lot gcc warnings because of %{public}s format specifier
        https://bugs.webkit.org/show_bug.cgi?id=207478

        Reviewed by Darin Adler.

        Add PUBLIC_LOG_STRING macro which is defined depending on if
        os_log()[1] is used or rather old printf().

        OS Logging processes format specifiers for privacy matters, for
        example dynamic strings, which demands %{public}s. But these
        specifiers are not valid for printf().

        Calls to logging with this specifier, if they are not Mac/Darwing
        exclusive, use this new macro to avoid gcc warnings.

        1. https://developer.apple.com/documentation/os/logging?language=objc

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        (WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore):
        (WebKit::ResourceLoadStatisticsDatabaseStore::openITPDatabase):
        (WebKit::ResourceLoadStatisticsDatabaseStore::isCorrectTableSchema):
        (WebKit::ResourceLoadStatisticsDatabaseStore::createUniqueIndices):
        (WebKit::ResourceLoadStatisticsDatabaseStore::prepareStatements):
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
        (WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccess):
        (WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccessUnderOpener):
        (WebKit::ResourceLoadStatisticsMemoryStore::ensurePrevalentResourcesForDebugMode):
        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
        (WebKit::ResourceLoadStatisticsStore::removeDataRecords):
        (WebKit::ResourceLoadStatisticsStore::debugLogDomainsInBatches):
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::start):
        (WebKit::NetworkResourceLoader::startNetworkLoad):
        (WebKit::NetworkResourceLoader::didReceiveResponse):
        * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp:
        (WebKit::ServiceWorkerFetchTask::didReceiveResponse):
        (WebKit::ServiceWorkerFetchTask::didFail):
        * UIProcess/AuxiliaryProcessProxy.cpp:
        (WebKit::AuxiliaryProcessProxy::logInvalidMessage):
        * UIProcess/ProcessThrottler.h:
        (WebKit::ProcessThrottler::Activity::Activity):
        (WebKit::ProcessThrottler::Activity::invalidate):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::receivedNavigationPolicyDecision):

2020-02-17  Per Arne Vollan  <pvollan@apple.com>

        Mach lookup to com.apple.webinspector should not be allowed in WebKit's WebContent process
        https://bugs.webkit.org/show_bug.cgi?id=203214

        Reviewed by Brent Fulgham.

        If the Web inspector is enabled when the WebContent process is started, a sandbox extension is created
        for 'com.apple.webinspector' and a message is sent to the WebContent process, where the extension will
        be consumed, and the remote Web inspector will be started. The same happens if Web inspector is enabled
        by the user while Safari is running. When RemoteInspector::singleton() is called in the UI process there
        is no need for an extension, since access to the Web inspector daemon is already allowed.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::backlightLevelDidChangeCallback):
        (WebKit::WebProcessPool::remoteWebInspectorEnabledCallback):
        (WebKit::WebProcessPool::registerNotificationObservers):
        (WebKit::WebProcessPool::unregisterNotificationObservers):
        * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
        (WebKit::WebProcessProxy::enableRemoteInspectorIfNeeded):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::initializeNewWebProcess):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::mayBecomeUnresponsive):
        * UIProcess/WebProcessProxy.h:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::initializeWebProcess):
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::enableRemoteWebInspector):
        * WebProcess/com.apple.WebProcess.sb.in:

2020-02-17  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Add telemetry with backtrace for specific rules
        https://bugs.webkit.org/show_bug.cgi?id=207494

        Reviewed by Brent Fulgham.

        For specific sandbox mach lookup rules in the WebContent process, add telemetry with backtrace.

        No new tests, no behavior change.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

2020-02-17  Antti Koivisto  <antti@apple.com>

        [macOS] Add trace points for layer flush runloop observer
        https://bugs.webkit.org/show_bug.cgi?id=207837

        Reviewed by Sam Weinig.

        Add trace points to see how much scheduled layer flushes get delayed by timers and other runloop activities.

        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
        (WebKit::RemoteLayerTreeDrawingArea::setLayerTreeStateIsFrozen):
        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
        (WebKit::TiledCoreAnimationDrawingArea::setLayerTreeStateIsFrozen):

        Also add trace points for layer tree freezing (iOS too).

        (WebKit::TiledCoreAnimationDrawingArea::layerFlushRunLoopCallback):
        (WebKit::TiledCoreAnimationDrawingArea::invalidateLayerFlushRunLoopObserver):
        (WebKit::TiledCoreAnimationDrawingArea::scheduleLayerFlushRunLoopObserver):

2020-02-17  Don Olmstead  <don.olmstead@sony.com>

        [CMake] Use builtin targets
        https://bugs.webkit.org/show_bug.cgi?id=205166

        Reviewed by Darin Adler.

        * PlatformFTW.cmake:
        * PlatformWPE.cmake:
        * PlatformWin.cmake:

2020-02-17  Alberto Garcia  <berto@igalia.com>

        [WPE] Change the QML plugin install path
        https://bugs.webkit.org/show_bug.cgi?id=207761

        Reviewed by Philippe Normand.

        This way there's no need to set QML2_IMPORT_PATH manually.

        * PlatformWPE.cmake:

2020-02-16  Fujii Hironori  <Hironori.Fujii@sony.com>

        Remove remaining WTF_EXPORT and WTF_IMPORT by replacing them with WTF_EXPORT_DECLARATION and WTF_IMPORT_DECLARATION
        https://bugs.webkit.org/show_bug.cgi?id=207746

        Reviewed by Don Olmstead.

        * WebProcess/win/WebProcessWin.cpp:
        (loadResourceIntoBuffer): Removed WTF_EXPORT. loadResourceIntoBuffer is used from WebCore which is in same DLL.

2020-02-16  Youenn Fablet  <youenn@apple.com>

        Log WebSocket failure in case of network crash
        https://bugs.webkit.org/show_bug.cgi?id=207801

        Reviewed by Darin Adler.

        Covered by http/tests/websocket/tests/hybi/network-process-crash-error.html.

        * WebProcess/Network/WebSocketChannel.cpp:
        (WebKit::WebSocketChannel::didReceiveMessageError):
        (WebKit::WebSocketChannel::networkProcessCrashed):
        Add a console log message in case of error coming from network process.

2020-02-16  Brady Eidson  <beidson@apple.com>

        Expose "allowsContentJavaScript" on WKWebpagePreferences
        <rdar://problem/51534967> and https://bugs.webkit.org/show_bug.cgi?id=207427

        Reviewed by Darin Adler.

        This utiizes the pre-existing WebCore::Settings::setScriptMarkupEnabled() mechanism.
        
        This also deprecates the global "disable JavaScript" WKPreference as it doesn't make much sense anymore.

        * Shared/WebsitePoliciesData.cpp:
        (WebKit::WebsitePoliciesData::encode const):
        (WebKit::WebsitePoliciesData::decode):
        * Shared/WebsitePoliciesData.h:

        * UIProcess/API/APIWebsitePolicies.cpp:
        (API::WebsitePolicies::data):
        * UIProcess/API/APIWebsitePolicies.h:

        * UIProcess/API/Cocoa/WKPreferences.h:
        * UIProcess/API/Cocoa/WKPreferences.mm:
        (-[WKPreferences encodeWithCoder:]):
        (-[WKPreferences initWithCoder:]):
        (-[WKPreferences javaScriptEnabled]):
        (-[WKPreferences setJavaScriptEnabled:]):

        * UIProcess/API/Cocoa/WKWebpagePreferences.h:
        * UIProcess/API/Cocoa/WKWebpagePreferences.mm:
        (-[WKWebpagePreferences setAllowsContentJavaScript:]):
        (-[WKWebpagePreferences allowsContentJavaScript]):

        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::allowsContentJavaScriptFromMostRecentNavigation const):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:

        * WebProcess/WebPage/WebFrame.cpp:
        (WebKit::WebFrame::didReceivePolicyDecision):

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::updateWebsitePolicies):
        (WebKit::WebPage::createDocumentLoader):
        * WebProcess/WebPage/WebPage.h:
        (WebKit::WebPage::allowsContentJavaScriptFromMostRecentNavigation const):
        (WebKit::WebPage::setAllowsContentJavaScriptFromMostRecentNavigation):

2020-02-15  Pavel Feldman  <pavel.feldman@gmail.com>

        [Geoclue] Avoid usage of provider in callbacks after it has been destroyed
        https://bugs.webkit.org/show_bug.cgi?id=207420

        GeoclueGeolocationProvider was making non-cancelable g_dbus_proxy_call(s) with
        bare |this| pointer.

        Reviewed by Carlos Garcia Campos.

        * UIProcess/geoclue/GeoclueGeolocationProvider.cpp:
        (WebKit::GeoclueGeolocationProvider::start):
        (WebKit::GeoclueGeolocationProvider::stop):
        (WebKit::GeoclueGeolocationProvider::setupManager):
        (WebKit::GeoclueGeolocationProvider::createClient):
        (WebKit::GeoclueGeolocationProvider::startClient):
        (WebKit::GeoclueGeolocationProvider::didFail):
        * UIProcess/geoclue/GeoclueGeolocationProvider.h:

2020-02-14  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r256633.
        https://bugs.webkit.org/show_bug.cgi?id=207807

        4% memory regression in new Membuster, possibly some leaking
        in WebKit Malloc? (Requested by yusukesuzuki on #webkit).

        Reverted changeset:

        "[Win] Implement NetworkCache::Data by using
        FileSystem::MappedFileData"
        https://bugs.webkit.org/show_bug.cgi?id=197684
        https://trac.webkit.org/changeset/256633

2020-02-14  Jon Lee  <jonlee@apple.com>

        Mask WebGL strings
        https://bugs.webkit.org/show_bug.cgi?id=207608

        Reviewed by Dean Jackson.

        Test: platform/mac/webgl/fingerprinting-strings.html

        * Shared/WebPreferences.yaml: Add new experimental feature.

2020-02-14  Youenn Fablet  <youenn@apple.com>

        Simplify WebProcess handling of unregistering of service workers
        https://bugs.webkit.org/show_bug.cgi?id=207669

        Reviewed by Chris Dumez.

        Use Async Reply IPC for scheduling an unregister job.

        Make WebSWServerConnection own a map of CompletionHandler keyed by unregister job identifiers.
        WebSWServerConnection then asks SWServer to schedule the unregister job.
        When job is run, WebSWServerConnection will call the corresponding completion handler.
        The completion handler will trigger an IPC response that will trigger the unregister promise to be resolved.

        * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
        (WebKit::WebSWServerConnection::resolveUnregistrationJobInClient):
        (WebKit::WebSWServerConnection::scheduleUnregisterJobInServer):
        * NetworkProcess/ServiceWorker/WebSWServerConnection.h:
        * NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in:
        * Scripts/webkit/messages.py:
        * WebProcess/Storage/WebSWClientConnection.cpp:
        (WebKit::WebSWClientConnection::scheduleUnregisterJobInServer):
        * WebProcess/Storage/WebSWClientConnection.h:
        * WebProcess/Storage/WebSWClientConnection.messages.in:

2020-02-14  Youenn Fablet  <youenn@apple.com>

        Improve NSURLSession WebSocket message handling in case of error
        https://bugs.webkit.org/show_bug.cgi?id=207799

        Reviewed by Alex Christensen.

        Tested by running layout tests with NSURLSession WebSocket code path enabled..

        * NetworkProcess/cocoa/WebSocketTaskCocoa.mm:
        (WebKit::WebSocketTask::readNextMessage):
        readNextMessage completion handler may be called when the connection is closed or in case of real error.
        We discriminate this case by checking closeCode and if not null, we do nothing since the connection is being closed.
        Otherwise, we communicate the error to WebProcess and close the connection.
        (WebKit::WebSocketTask::sendString):
        Add workaround until this gets fixed underneath.
        (WebKit::WebSocketTask::sendData):
        Add workaround until this gets fixed underneath.

2020-02-14  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthn] Make Local Authenticator appear as an experimental feature
        https://bugs.webkit.org/show_bug.cgi?id=207797
        <rdar://problem/59475709>

        Reviewed by Brent Fulgham.

        * Shared/WebPreferences.yaml:

2020-02-14  Brent Fulgham  <bfulgham@apple.com>

        Dynamically generate media-related mach connections when not using the GPU Process
        https://bugs.webkit.org/show_bug.cgi?id=207743
        <rdar://problem/59449750>

        Reviewed by Per Arne Vollan.

        Stop using permanent sandbox permissions to connect to media-related XPC services. Instead,
        create them dynamically in the UIProcess and vend them to the relevant WebContent process
        as needed. If all media features are active in the GPU process, do not emit extensions since
        they should not be needed in the WebContent process at that point.

        Tested by existing media and GPU process tests.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: Remove permanet rules in
        preference for dynamic extensions.
        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const): Serialize new service connections.
        (WebKit::WebProcessCreationParameters::decode): Ditto.
        * Shared/WebProcessCreationParameters.h:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::mediaRelatedMachServices): Helper function listing needed services.
        (WebKit::WebProcessPool::platformInitializeWebProcess): Create service connections when
        needed.
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess): Consume media-related connections
        when needed.
        * WebProcess/com.apple.WebProcess.sb.in: Remove permanet rules in preference for
        dynamic extensions.

2020-02-14  Youenn Fablet  <youenn@apple.com>

        Introduce MediaStreamPrivate::forEachTrack
        https://bugs.webkit.org/show_bug.cgi?id=207773

        Reviewed by Eric Carlson.

        * WebProcess/GPU/webrtc/MediaRecorderPrivate.cpp:
        (WebKit::MediaRecorderPrivate::MediaRecorderPrivate):
        Use helper routine instead of MediaStreamPrviate::streamTracks().

2020-02-14  Alex Christensen  <achristensen@webkit.org>

        WKWebView._setResourceLoadDelegate should clear the WebPageProxy's ResourceLoadClient
        https://bugs.webkit.org/show_bug.cgi?id=205887

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _setResourceLoadDelegate:]):
        WebPageProxy::setResourceLoadClient has some special logic to possibly clear a bit in the web process that will reduce IPCs.
        This is a small oversight in my original implementation.

2020-02-14  Wenson Hsieh  <wenson_hsieh@apple.com>

        Unreviewed, fix the iOS 13.1 build after r256520

        These two methods are not in the internal iOS 13.1 SDK.

        * Platform/spi/ios/UIKitSPI.h:

2020-02-14  Christopher Reid  <chris.reid@sony.com>

        [Win] Implement NetworkCache::Data by using FileSystem::MappedFileData
        https://bugs.webkit.org/show_bug.cgi?id=197684

        Reviewed by Fujii Hironori.

        * NetworkProcess/NetworkProcess.cpp:
        Ensure that the CacheStorage directory is actually being created.

        * NetworkProcess/cache/NetworkCacheData.cpp:
        * NetworkProcess/cache/NetworkCacheData.h:
        * NetworkProcess/cache/NetworkCacheDataCocoa.mm:
        * NetworkProcess/cache/NetworkCacheDataSoup.cpp:
        * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
        Use more FileSystem functionality to share code across platforms.

        * NetworkProcess/cache/NetworkCacheDataCurl.cpp:
        Use Optional<Vector> for m_buffer since we need to differentiate isEmpty and isNull.

2020-02-14  Yusuke Suzuki  <ysuzuki@apple.com>

        NetworkLoadMetrics should be shared by multiple ResourceResponse instances
        https://bugs.webkit.org/show_bug.cgi?id=207747

        Reviewed by Keith Miller.

        Add ArgumentCoder support for Box<T>.

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
        * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
        (WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse):
        * Platform/IPC/ArgumentCoders.h:
        (IPC::ArgumentCoder<Box<T>>::encode):
        (IPC::ArgumentCoder<Box<T>>::decode):

2020-02-14  Alberto Garcia  <berto@igalia.com>

        [WPE] WPEQtView.h includes the uninstalled WPEQtViewBackend.h
        https://bugs.webkit.org/show_bug.cgi?id=207765

        Reviewed by Philippe Normand.

        Do a forward declaration instead of including the header.

        * UIProcess/API/wpe/qt/WPEQtView.cpp:
        * UIProcess/API/wpe/qt/WPEQtView.h:

2020-02-13  Kate Cheney  <katherine_cheney@apple.com>

        Expose prevalent domains on a per-page basis
        https://bugs.webkit.org/show_bug.cgi?id=207523
        <rdar://problem/59270758>

        Reviewed by Chris Dumez.

        Tests: http/tests/resourceLoadStatistics/prevalent-domains-per-page-database.html
               http/tests/resourceLoadStatistics/prevalent-domains-per-page.html

        Added an API to report prevalent domains. The Web Process sends all
        new loads to the Network Process, which determines if the resources are
        prevalent. When the API is queried, the Web Process reports these
        domains to the UI Process.

        The WebPage keeps a hash set of previously loaded domains to avoid
        spamming IPC with repeat domains.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::requestStorageAccessUnderOpener):
        (WebKit::NetworkConnectionToWebProcess::reportSubresourceLoadToDomain):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _getPrevalentDomainsFor:completionHandler:]):
        (-[WKWebsiteDataStore _clearPrevalentDomainsFor:]):
        * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::didCommitLoadForFrame):
        * UIProcess/WebPageProxy.h:
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::addLoadedRegistrableDomain):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::setIsSuspended):
        (WebKit::WebPage::addLoadedRegistrableDomain):
        (WebKit::WebPage::getPrevalentDomains):
        (WebKit::WebPage::clearPrevalentDomains):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2020-02-13  Youenn Fablet  <youenn@apple.com>

        Protect WebSWServerConnection::scheduleJobInServer from bad scopeURL
        https://bugs.webkit.org/show_bug.cgi?id=207722

        Reviewed by Chris Dumez.

        * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
        (WebKit::WebSWServerConnection::scheduleJobInServer):
        In case of bad scope, fail the job early on.
        * WebProcess/Storage/WebSWClientConnection.cpp:
        (WebKit::WebSWClientConnection::scheduleJobInServer):
        Remove the RELEASE_ASSERT from now since we defend in Network process.
        We will add it back in ServiceWorkerRegistration::getOrCreate as a follow-up.

2020-02-13  Ben Nham  <nham@apple.com>

        Flash of white can occur if JS forces an early layout
        https://bugs.webkit.org/show_bug.cgi?id=207516

        This causes us to wait for the first non-empty layout before we paint on Mac, which we
        already do on all other platforms.

        Reviewed by Antti Koivisto.

        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDidReachLayoutMilestone):

2020-02-13  Brent Fulgham  <bfulgham@apple.com>

        REGRESSION (r255961): Default state for data URL handling is incorrect
        https://bugs.webkit.org/show_bug.cgi?id=207719
        <rdar://problem/59334011>

        Reviewed by Chris Dumez.

        The default selected in r255961 breaks too many WebKit framework users. Switch from opt-out to opt-in
        while we work through compatibility issues.

        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
        (-[WKWebViewConfiguration init]):

2020-02-13  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r254557.
        https://bugs.webkit.org/show_bug.cgi?id=207725

        The assert is correct, but unfortunately it will alwasy fail
        since there is an existing bug in
        HTMLTextFormControlElement::indexForPosition(). See bug
        #207724 for more details. (Requested by dydz on #webkit).

        Reverted changeset:

        "Enable the offset assertion in
        HTMLTextFormControlElement::indexForPosition"
        https://bugs.webkit.org/show_bug.cgi?id=205706
        https://trac.webkit.org/changeset/254557

2020-02-13  Alex Christensen  <achristensen@webkit.org>

        _WKResourceLoadInfo should conform to NSSecureCoding
        https://bugs.webkit.org/show_bug.cgi?id=207667

        Reviewed by Brady Eidson.

        This makes rdar://problem/57132290 nicer.
        Covered by API tests.

        * UIProcess/API/Cocoa/_WKResourceLoadInfo.h:
        * UIProcess/API/Cocoa/_WKResourceLoadInfo.mm:
        (+[_WKResourceLoadInfo supportsSecureCoding]):
        (-[_WKResourceLoadInfo initWithCoder:]):
        (-[_WKResourceLoadInfo encodeWithCoder:]):

2020-02-13  Alex Christensen  <achristensen@webkit.org>

        Deprecate _WKUserContentWorld replaced by WKContentWorld
        https://bugs.webkit.org/show_bug.cgi?id=207514

        Reviewed by Brady Eidson.

        _WKUserContentWorld.contentWorld is not needed,
        but WKContentWorld._userContentWorld needs to return an autoreleased object.

        * UIProcess/API/APIContentWorld.cpp:
        (API::ContentWorld::fromUserContentWorld): Deleted.
        * UIProcess/API/APIContentWorld.h:
        * UIProcess/API/Cocoa/WKContentWorld.mm:
        (-[WKContentWorld _userContentWorld]):
        * UIProcess/API/Cocoa/_WKUserContentWorld.h:
        * UIProcess/API/Cocoa/_WKUserContentWorld.mm:
        (-[_WKUserContentWorld contentWorld]): Deleted.

2020-02-13  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Check if PIP is supported in the UI process
        https://bugs.webkit.org/show_bug.cgi?id=207406

        Reviewed by Brent Fulgham.

        When starting a new WebContent process, check if PIP is supported, and pass the results to the newly created
        WebContent process.

        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const):
        (WebKit::WebProcessCreationParameters::decode):
        * Shared/WebProcessCreationParameters.h:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):

2020-02-13  Benjamin Nham  <nham@apple.com>

        Allow use of proxies in MiniBrowser
        https://bugs.webkit.org/show_bug.cgi?id=207598

        For testing purposes, we allow Safari to use a custom HTTP/HTTPS proxy passed through
        command line arguments. This gives MiniBrowser the same ability. Example invocation:

        $ run-minibrowser --release -WebKit2HTTPProxy "http://127.0.0.1:8080" \
                                    -WebKit2HTTPSProxy "http://127.0.0.1:8080"

        Reviewed by Antti Koivisto.

        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeNetworkProcess):
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::parameters):

2020-02-13  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] -updateSelectionWithExtentPoint:completionHandler: should work without requiring floating cursor
        https://bugs.webkit.org/show_bug.cgi?id=207680
        <rdar://problem/59340940>

        Reviewed by Tim Horton.

        Currently, WebPage::updateSelectionWithExtentPoint consults the value of m_selectionAnchor to determine whether
        it should attempt to modify the current selection using the hit-tested visible position. m_selectionAnchor is
        only set under WebPage::beginSelectionInDirection, which is only invoked when the user begins a floating cursor
        gesture. When attempting to perform an out-of-band selection update (i.e. without calling
        beginSelectionInDirection beforehand), we will end up consulting an arbitrary value for m_selectionAnchor
        (::Start by default; otherwise, the last value set by beginSelectionInDirection if it was previously called).
        This means that the selection can often only be extended in one direction (typically forwards) when an API
        client attempts to use -updateSelectionWithExtentPoint:completionHandler: to extend the current selection.

        To fix this, make it so that we only respect the selection anchor (m_selectionAnchor) in the case where the user
        is currently using the floating cursor; otherwise, allow the SPI to expand the selection, such that it contains
        the visible position for the given location.

        Test: UIWKInteractionViewProtocol.UpdateSelectionWithExtentPoint

        * Platform/spi/ios/UIKitSPI.h:
        * Scripts/webkit/messages.py:
        * Shared/ios/GestureTypes.h:

        Add a new flag to tell the web process whether it should limit selection extent updates to the current selection
        anchor. Also, remove an existing enum type, SelectionHandlePosition, that is unused (since we no longer support
        block text selection).

        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[UITextInteractionAssistant _wk_hasFloatingCursor]):

        Add a helper method to determine (using the text interaction assistant) whether there's an active floating
        cursor gesture. In the case where floating cursor is active, the text interaction assistant will be in an active
        gesture but its UITextInteraction will not, since the gesture recognizer belongs to the keyboard or input view
        rather than the first responder (in this case, WKContentView).

        (-[WKContentView updateSelectionWithExtentPoint:completionHandler:]):

        Only respect the selection anchor if we're in floating cursor mode; otherwise, allow selection updates with an
        extent point to extend the current selection to include the new position.

        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::updateSelectionWithExtentPoint):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

        Plumb the RespectsSelectionAnchor flag over to the web process.

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::updateSelectionWithExtentPoint):

2020-02-13  Said Abou-Hallawa  <said@apple.com>

        Unreviewed, rolling out r255158, 255405 and r255486

        Caused test flakiness and PLT regression.

        * Shared/WebPreferences.yaml:
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetRenderingUpdateThrottlingEnabled): Deleted.
        (WKPreferencesGetRenderingUpdateThrottlingEnabled): Deleted.
        * UIProcess/API/C/WKPreferencesRefPrivate.h:
        * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h:
        * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.messages.in:
        * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
        (-[WKOneShotDisplayLinkHandler setPreferredFramesPerSecond:]): Deleted.
        (WebKit::RemoteLayerTreeDrawingAreaProxy::setPreferredFramesPerSecond): Deleted.
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.h:
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm:
        (WebKit::RemoteLayerTreeDisplayRefreshMonitor::setPreferredFramesPerSecond): Deleted.
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
        (WebKit::RemoteLayerTreeDrawingArea::setPreferredFramesPerSecond): Deleted.

2020-02-12  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r256010.

        Introduced ASan crashes

        Reverted changeset:

        "[Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder"
        https://bugs.webkit.org/show_bug.cgi?id=206582
        https://trac.webkit.org/changeset/r256010

2020-02-12  Wenson Hsieh  <wenson_hsieh@apple.com>

        Composition highlight rects should be rounded and inset
        https://bugs.webkit.org/show_bug.cgi?id=207655
        <rdar://problem/59362474>

        Reviewed by Tim Horton.

        Stitch adjacent highlight rects together if they have the same highlight color; this minimizes the number of
        composition highlight rects we hand to the web process when changing the marked text.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (compositionHighlights):

2020-02-12  Truitt Savell  <tsavell@apple.com>

        Unreviewed, rolling out r256463.

        Caused major flakiness on Mac wk2

        Reverted changeset:

        "REGRESSION (r255158): http/tests/frame-throttling/raf-
        throttle-in-cross-origin-subframe.html is a flaky failure"
        https://bugs.webkit.org/show_bug.cgi?id=206839
        https://trac.webkit.org/changeset/256463

2020-02-12  Simon Fraser  <simon.fraser@apple.com>

        Remove CSS_DEVICE_ADAPTATION
        https://bugs.webkit.org/show_bug.cgi?id=203479

        Reviewed by Tim Horton.

        CSS Working Group resolved to remove @viewport <https://github.com/w3c/csswg-drafts/issues/4766>,
        so remove the code.

        * Configurations/FeatureDefines.xcconfig:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::sendViewportAttributesChanged):

2020-02-12  Brent Fulgham  <bfulgham@apple.com>

        [macOS] Remove irrelevant global-name rule in WebContent sandbox
        https://bugs.webkit.org/show_bug.cgi?id=207659
        <rdar://problem/52289544>

        Reviewed by Per Arne Vollan.

        We have been allowing access to a non-existance global-name. We should remove this rule.

        * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in:
        * WebProcess/com.apple.WebProcess.sb.in:

2020-02-12  Brent Fulgham  <bfulgham@apple.com>

        [iOS] Remove access to AppleKeyStoreUserClient from the WebContent process
        https://bugs.webkit.org/show_bug.cgi?id=207654
        <rdar://problem/58804060>

        Reviewed by Per Arne Vollan.

        Testing and telemetry show that we no longer need access to the AppleKeyStoreUserClient
        IOKit class in the WebContent or GPU processes. We should remove this access.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb:
        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

2020-02-12  Said Abou-Hallawa  <said@apple.com>

        REGRESSION (r255158): http/tests/frame-throttling/raf-throttle-in-cross-origin-subframe.html is a flaky failure
        https://bugs.webkit.org/show_bug.cgi?id=206839

        Reviewed by Simon Fraser.

        Remove the WKPreference key 'RenderingUpdateThrottlingEnabled'.

        * Shared/WebPreferences.yaml:
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetRenderingUpdateThrottlingEnabled): Deleted.
        (WKPreferencesGetRenderingUpdateThrottlingEnabled): Deleted.
        * UIProcess/API/C/WKPreferencesRefPrivate.h:

2020-02-12  Simon Fraser  <simon.fraser@apple.com>

        Pages that trigger a redirect will sometimes be left blank
        https://bugs.webkit.org/show_bug.cgi?id=207614
        rdar://problem/59077740

        Reviewed by Tim Horton.

        TiledCoreAnimationDrawingArea::setRootCompositingGraphicsLayer() can be called when the layer tree
        is frozen, in which case we stash away the layer in m_pendingRootLayer to be parented later at flush
        time. However, this sequence of calls had a bug:

        setRootCompositingGraphicsLayer() when frozen
            -> stash in m_pendingRootLayer
        setRootCompositingGraphicsLayer() when not frozen
            -> set the root layer
        flushLayers()
            -> set the root layer to the (old) m_pendingRootLayer

        So we need to clear m_pendingRootLayer at step 2.

        Very timing dependent, hard to test.

        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
        (WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):

2020-02-12  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Deny mach lookup access to analytics service in the WebContent process
        https://bugs.webkit.org/show_bug.cgi?id=207482

        Reviewed by Darin Adler.

        As part of sandbox hardening work, this service should be denied in the WebContent process' sandbox.

        Test: fast/sandbox/ios/sandbox-mach-lookup.html

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

2020-02-12  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Deny mach lookup access to view service in the WebContent process
        https://bugs.webkit.org/show_bug.cgi?id=207487
        <rdar://problem/56995704>
        
        Reviewed by Darin Adler.

        As part of sandbox hardening, mach lookup access to com.apple.uikit.viewservice should be denied.

        Test: fast/sandbox/ios/sandbox-mach-lookup.html

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

2020-02-12  Alex Christensen  <achristensen@webkit.org>

        Make _WKResourceLoadDelegate.h able to be included before other headers
        https://bugs.webkit.org/show_bug.cgi?id=206037

        * UIProcess/API/Cocoa/_WKResourceLoadDelegate.h:
        Add missing "@class WKWebView;"

2020-02-12  Brent Fulgham  <bfulgham@apple.com>

        Expand WebContent process sandbox with additional syscall
        https://bugs.webkit.org/show_bug.cgi?id=206260
        <rdar://problem/58580997>

        Reviewed by Per Arne Vollan.

        Testing shows that we will improve performance on some platforms by supporting an additional Syscall.

        This patch revises our sandboxes so that WebKit can use this fast path if available.

        No new tests. No change in test result behavior.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
        * WebProcess/com.apple.WebProcess.sb.in:

2020-02-12  Wenson Hsieh  <wenson_hsieh@apple.com>

        macCatalyst: Unable to grab scrollbar on editable text field
        https://bugs.webkit.org/show_bug.cgi?id=207615
        <rdar://problem/59212993>

        Reviewed by Tim Horton.

        In macCatalyst, hovering over the scrollbar (an instance of the internal UIKit class
        `_UIScrollViewScrollIndicator`) is required in order for a click and drag with the mouse to actually move the
        scrollbar. This is because UIKit depends on the cursor interaction added to this view to recognize and call its
        delegate methods.

        However, we override hit-testing in WebKit to skip over all children of scroll views, and instead force hit-
        testing to find the scroll view instead. This means that UIKit can never hit-test to the scroll indicator views
        embedded directly beneath each WKChildScrollView, so the cursor interactions described earlier will not
        recognize. To work around this, special case these scroll indicator views, such that we will allow
        -hitTest:withEvent: to find these views.

        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
        (WebKit::scrollViewScrollIndicatorClass):
        (-[UIView _web_findDescendantViewAtPoint:withEvent:]):

2020-02-12  Youenn Fablet  <youenn@apple.com>

        WebSWServerConnection::registerServiceWorkerClient is not sending IPC message to UIProcess when it should
        https://bugs.webkit.org/show_bug.cgi?id=207537

        Reviewed by Chris Dumez.

        Covered by added API test.

        * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
        (WebKit::WebSWServerConnection::registerServiceWorkerClient):
        Fix use after move so that we can get the context connection and send the IPC message to UIProcess as expected.

2020-02-11  Youenn Fablet  <youenn@apple.com>

        [ Mac Debug wk2 ] ASSERTION FAILED: m_wasConstructedOnMainThread == isMainThread()
        https://bugs.webkit.org/show_bug.cgi?id=207509
        <rdar://problem/59325466>

        Reviewed by Chris Dumez.

        Covered by existing tests.

        * NetworkProcess/cache/CacheStorageEngine.cpp:
        (WebKit::CacheStorage::Engine::writeSizeFile):
        Make sure completion handler is always called on the main thread.
        Minor refactoring to make things more efficient.

2020-02-11  Fujii Hironori  <Hironori.Fujii@sony.com>

        Fix declarations marked by wrong export macros (WEBCORE_EXPORT and WTF_EXPORT)
        https://bugs.webkit.org/show_bug.cgi?id=207453

        Reviewed by Ross Kirsling.

        * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.h:
        * UIProcess/RemoteLayerTree/mac/ScrollingTreeOverflowScrollingNodeRemoteMac.h:

2020-02-11  Wenson Hsieh  <wenson_hsieh@apple.com>

        WebPage::getFocusedElementInformation should be robust when the focused element changes during layout
        https://bugs.webkit.org/show_bug.cgi?id=207582
        <rdar://problem/47634344>

        Reviewed by Tim Horton.

        This is a speculative fix for <rdar://problem/47634344>, wherein the initial layout update in WebPage::
        getFocusedElementInformation may cause the currently focused element to disappear (or change). In the case where
        m_focusedElement becomes nil, we end up crashing with a null pointer deref, since the rest of the method assumes
        that m_focusedElement exists.

        To patch this crash, bail early (after the first layout update) if m_focusedElement changed during the layout
        pass. Since the rest of the function my trigger even more layout updates that could nuke m_focusedElement, I
        also changed the rest of the function to use the locally stored `focusedElement` variable instead of
        m_focusedElement, on WebPage.

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::getFocusedElementInformation):

2020-02-11  Brent Fulgham  <bfulgham@apple.com>

        [iOS] Deny access to unused tcp service from NetworkProcess
        https://bugs.webkit.org/show_bug.cgi?id=207590
        <rdar://problem/57895351>

        Reviewed by Darin Adler.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:

2020-02-11  Chris Dumez  <cdumez@apple.com>

        Unreviewed, revert r255662 as it seems to cause blank views in SVC.
        https://bugs.webkit.org/show_bug.cgi?id=207144
        <rdar://problem/59334011>

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::initializeNewWebProcess):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::initializeWebProcess):
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:

2020-02-11  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r256314.
        https://bugs.webkit.org/show_bug.cgi?id=207594

        It is breaking an API test (Requested by youenn on #webkit).

        Reverted changeset:

        "WebSWServerConnection::registerServiceWorkerClient is not
        sending IPC message to UIProcess when it should"
        https://bugs.webkit.org/show_bug.cgi?id=207537
        https://trac.webkit.org/changeset/256314

2020-02-11  Daniel Bates  <dabates@apple.com>

        Should not allow zooming to reveal focused element when suppressing selection assistant
        https://bugs.webkit.org/show_bug.cgi?id=207575

        Reviewed by Wenson Hsieh.

        Do not tell the UIScrollView to scroll and zoom to reveal the focused element when the
        selection assistant is being suppressed as it does not make sense to do so: the primary
        motivation for zooming to reveal the focused (aka the editable) element is make it easier
        to edit it.

        This fixes a bug where previewing a partially offscreen link inside an editable element
        would cause the page content to scroll and zoom to reveal the editable element. Previewing
        a link is not considered an editing operation and selection assistance is prevented, but
        "zoom to reveal" was inadvertently allowed. Now it is not.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _zoomToRevealFocusedElement]): Bail out if selection is being suppressed
        for any reason. Note that pre-r245882 there was reason SuppressSelectionAssistantReason::DropAnimationIsRunning
        that was used to suppress selection assistance AND allow "zoom to reveal". But this
        reason was removed and there are no suppression reasons as of the time of writing where
        it makes sense to have behavior like SuppressSelectionAssistantReason::DropAnimationIsRunning.

2020-02-11  Alex Christensen  <achristensen@webkit.org>

        Deprecate _WKUserContentWorld replaced by WKContentWorld
        https://bugs.webkit.org/show_bug.cgi?id=207514
 
        Add the rest of the SPI to convert between the two.

        * UIProcess/API/Cocoa/_WKUserContentWorld.h:
        * UIProcess/API/Cocoa/_WKUserContentWorld.mm:
        (-[_WKUserContentWorld contentWorld]):

2020-02-11  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r256345.

        Broke iOS builds.

        Reverted changeset:

        "Deprecate _WKUserContentWorld replaced by WKContentWorld"
        https://bugs.webkit.org/show_bug.cgi?id=207514
        https://trac.webkit.org/changeset/256345

2020-02-11  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Deny mach lookup access to the tccd service in the WebContent process
        https://bugs.webkit.org/show_bug.cgi?id=207488

        Reviewed by Darin Adler.

        As part of sandbox hardening, deny mach lookup access to the tccd service.

        Test: fast/sandbox/ios/sandbox-mach-lookup.html

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

2020-02-11  Eric Carlson  <eric.carlson@apple.com>

        Support in-band VTT captions when loading media in the GPU Process
        https://bugs.webkit.org/show_bug.cgi?id=207467
        <rdar://problem/59312749>

        Reviewed by Jer Noble.

        * DerivedSources-input.xcfilelist:
        * DerivedSources-output.xcfilelist:
        * DerivedSources.make:
        * GPUProcess/media/RemoteAudioTrackProxy.h:
        * GPUProcess/media/RemoteMediaPlayerProxy.cpp:
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerDidAddAudioTrack):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerDidAddVideoTrack):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerDidAddTextTrack):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerDidRemoveTextTrack):
        (WebKit::RemoteMediaPlayerProxy::textTrackRepresentationBoundsChanged):
        (WebKit::RemoteMediaPlayerProxy::textTrackSetMode):
        * GPUProcess/media/RemoteMediaPlayerProxy.h:
        * GPUProcess/media/RemoteMediaPlayerProxy.messages.in:
        * GPUProcess/media/RemoteTextTrackProxy.cpp: Added.
        (WebKit::RemoteTextTrackProxy::RemoteTextTrackProxy):
        (WebKit::RemoteTextTrackProxy::configuration):
        (WebKit::RemoteTextTrackProxy::configurationChanged):
        (WebKit::RemoteTextTrackProxy::willRemove):
        (WebKit::RemoteTextTrackProxy::idChanged):
        (WebKit::RemoteTextTrackProxy::labelChanged):
        (WebKit::RemoteTextTrackProxy::languageChanged):
        (WebKit::RemoteTextTrackProxy::addDataCue):
        (WebKit::RemoteTextTrackProxy::updateDataCue):
        (WebKit::RemoteTextTrackProxy::removeDataCue):
        (WebKit::RemoteTextTrackProxy::addGenericCue):
        (WebKit::RemoteTextTrackProxy::updateGenericCue):
        (WebKit::RemoteTextTrackProxy::removeGenericCue):
        (WebKit::RemoteTextTrackProxy::parseWebVTTFileHeader):
        (WebKit::RemoteTextTrackProxy::parseWebVTTCueData):
        * GPUProcess/media/RemoteTextTrackProxy.h: Copied from Source/WebKit/GPUProcess/media/RemoteVideoTrackProxy.h.
        * GPUProcess/media/RemoteVideoTrackProxy.h:
        * GPUProcess/media/TextTrackPrivateRemoteConfiguration.h: Added.
        (WebKit::TextTrackPrivateRemoteConfiguration::encode const):
        (WebKit::TextTrackPrivateRemoteConfiguration::decode):
        * GPUProcess/webrtc/RemoteSampleBufferDisplayLayer.h:
        * GPUProcess/webrtc/RemoteSampleBufferDisplayLayerManager.cpp:
        (WebKit::RemoteSampleBufferDisplayLayerManager::createLayer):
        * GPUProcess/webrtc/RemoteSampleBufferDisplayLayerManager.h:
        * Scripts/webkit/messages.py:
        * Sources.txt:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
        (WebKit::MediaPlayerPrivateRemote::removeRemoteAudioTrack):
        (WebKit::MediaPlayerPrivateRemote::remoteAudioTrackConfigurationChanged):
        (WebKit::MediaPlayerPrivateRemote::addRemoteTextTrack):
        (WebKit::MediaPlayerPrivateRemote::removeRemoteTextTrack):
        (WebKit::MediaPlayerPrivateRemote::remoteTextTrackConfigurationChanged):
        (WebKit::MediaPlayerPrivateRemote::parseWebVTTFileHeader):
        (WebKit::MediaPlayerPrivateRemote::parseWebVTTCueData):
        (WebKit::MediaPlayerPrivateRemote::parseWebVTTCueDataStruct):
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.h:
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.messages.in:
        * WebProcess/GPU/media/TextTrackPrivateRemote.cpp: Added.
        (WebKit::TextTrackPrivateRemote::TextTrackPrivateRemote):
        (WebKit::TextTrackPrivateRemote::setMode):
        (WebKit::TextTrackPrivateRemote::updateConfiguration):
        (WebKit::TextTrackPrivateRemote::addDataCue):
        (WebKit::TextTrackPrivateRemote::updateDataCue):
        (WebKit::TextTrackPrivateRemote::removeDataCue):
        (WebKit::TextTrackPrivateRemote::addGenericCue):
        (WebKit::TextTrackPrivateRemote::updateGenericCue):
        (WebKit::TextTrackPrivateRemote::removeGenericCue):
        (WebKit::TextTrackPrivateRemote::parseWebVTTFileHeader):
        (WebKit::TextTrackPrivateRemote::parseWebVTTCueData):
        (WebKit::TextTrackPrivateRemote::parseWebVTTCueDataStruct):
        * WebProcess/GPU/media/TextTrackPrivateRemote.h: Added.
        * WebProcess/GPU/media/TextTrackPrivateRemote.messages.in: Added.

2020-02-11  Eric Carlson  <eric.carlson@apple.com>

        video.currentTime is not being updated in iOS 13.4 Beta
        https://bugs.webkit.org/show_bug.cgi?id=207489
        <rdar://problem/59322640>

        Reviewed by Youenn Fablet.

        Allow the Web process and the GPU process to communicate with
        'com.apple.coremedia.audiodeviceclock.xpc' because it is necessary to use a 
        CMTimeBase, which is used by MediaPlayerPrivateMediaStreamAVFObjC for currentTime.

        Test: fast/mediastream/media-element-current-time.html

        * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb:
        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

2020-02-11  Alex Christensen  <achristensen@webkit.org>

        Deprecate _WKUserContentWorld replaced by WKContentWorld
        https://bugs.webkit.org/show_bug.cgi?id=207514

        Add the rest of the SPI to convert between the two.

        * UIProcess/API/Cocoa/_WKUserContentWorld.h:
        * UIProcess/API/Cocoa/_WKUserContentWorld.mm:
        (-[_WKUserContentWorld contentWorld]):

2020-02-11  Alex Christensen  <achristensen@webkit.org>

        Deprecate _WKUserContentWorld replaced by WKContentWorld
        https://bugs.webkit.org/show_bug.cgi?id=207514

        Reviewed by Brady Eidson.

        I also add SPI to convert between the two to aid a smooth transition.

        * Shared/Cocoa/APIObject.mm:
        (API::Object::newObject):
        * UIProcess/API/APIContentWorld.cpp:
        (API::ContentWorld::fromUserContentWorld):
        (API::ContentWorld::ContentWorld):
        * UIProcess/API/APIContentWorld.h:
        (API::ContentWorldBase::ContentWorldBase):
        * UIProcess/API/APIUserContentWorld.cpp:
        (API::UserContentWorld::fromContentWorld):
        (API::UserContentWorld::UserContentWorld):
        * UIProcess/API/APIUserContentWorld.h:
        * UIProcess/API/Cocoa/WKContentWorld.mm:
        (-[WKContentWorld _userContentWorld]):
        * UIProcess/API/Cocoa/WKContentWorldInternal.h:
        * UIProcess/API/Cocoa/WKContentWorldPrivate.h: Added.
        * UIProcess/API/Cocoa/WKUserContentController.mm:
        * UIProcess/API/Cocoa/WKUserScript.mm:
        * UIProcess/API/Cocoa/_WKUserContentWorld.h:
        * UIProcess/API/Cocoa/_WKUserContentWorld.mm:
        * UIProcess/API/Cocoa/_WKUserContentWorldInternal.h:
        * UIProcess/API/Cocoa/_WKUserStyleSheet.h:
        * UIProcess/API/Cocoa/_WKUserStyleSheet.mm:
        * WebKit.xcodeproj/project.pbxproj:

2020-02-11  Youenn Fablet  <youenn@apple.com>

        REGRESSION (r256009): [ Mojave wk2 Debug ] ASSERTION FAILED: Completion handler should always be called under WebKit::WebMDNSRegister::PendingRegistration
        https://bugs.webkit.org/show_bug.cgi?id=207521
        <rdar://problem/59331313>

        Reviewed by Eric Carlson.

        Covered by debug assertion not hit in layout tests.

        * WebProcess/Network/webrtc/WebMDNSRegister.cpp:
        (WebKit::WebMDNSRegister::finishedRegisteringMDNSName):
        Call completion handler even if the document entry has been cleared, which can happen in suspend/destruction case.
        If the entry is not there, all MDNS names for the document have been unregistered. We then report a registration error.

2020-02-11  Alex Christensen  <achristensen@webkit.org>

        Add WKHTTPCookieStore._getCookiesForURL SPI
        https://bugs.webkit.org/show_bug.cgi?id=207527

        Reviewed by Brady Eidson.

        This is needed to implement rdar://problem/57193106 without re-implementing the cookie/URL matching logic that exists in CFNetwork.
        Covered by an API test with a great pun in it.

        * UIProcess/API/APIHTTPCookieStore.cpp:
        (API::HTTPCookieStore::cookiesForURL):
        * UIProcess/API/APIHTTPCookieStore.h:
        * UIProcess/API/Cocoa/WKHTTPCookieStore.mm:
        (-[WKHTTPCookieStore _getCookiesForURL:completionHandler:]):
        * UIProcess/API/Cocoa/WKHTTPCookieStorePrivate.h: Added.
        * WebKit.xcodeproj/project.pbxproj:

2020-02-11  Youenn Fablet  <youenn@apple.com>

        WebSWServerConnection::registerServiceWorkerClient is not sending IPC message to UIProcess when it should
        https://bugs.webkit.org/show_bug.cgi?id=207537

        Reviewed by Chris Dumez.

        Covered by added API test.

        * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
        (WebKit::WebSWServerConnection::registerServiceWorkerClient):
        Fix use after move so that we can get the context connection and send the IPC message to UIProcess as expected.

2020-02-11  Brady Eidson  <beidson@apple.com>

        Add WKContentWorld.h to WebKit.h
        https://bugs.webkit.org/show_bug.cgi?id=207351

        Suggested by Alex Christensen.

        * Shared/API/Cocoa/WebKit.h:

2020-02-11  Youenn Fablet  <youenn@apple.com>

        Use ObjectIdentifier for WebSocketStream/WebSocketChannel
        https://bugs.webkit.org/show_bug.cgi?id=207507

        Reviewed by Alex Christensen.

        Replace uint64_t by ObjectIdentifier.
        This adds type safety and ensures we get valid identifiers from IPC.
        We still need to check for destinationID being not null in a few places.
        No observable change of behavior.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
        (WebKit::NetworkConnectionToWebProcess::createSocketStream):
        (WebKit::NetworkConnectionToWebProcess::createSocketChannel):
        (WebKit::NetworkConnectionToWebProcess::removeSocketChannel):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * NetworkProcess/NetworkSocketChannel.cpp:
        (WebKit::NetworkSocketChannel::create):
        (WebKit::NetworkSocketChannel::NetworkSocketChannel):
        * NetworkProcess/NetworkSocketChannel.h:
        * NetworkProcess/NetworkSocketStream.cpp:
        (WebKit::NetworkSocketStream::create):
        (WebKit::NetworkSocketStream::NetworkSocketStream):
        (WebKit::NetworkSocketStream::messageSenderDestinationID const):
        * NetworkProcess/NetworkSocketStream.h:
        * Scripts/webkit/messages.py:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/Network/NetworkProcessConnection.cpp:
        (WebKit::NetworkProcessConnection::didReceiveMessage):
        * WebProcess/Network/WebSocketChannel.cpp:
        (WebKit::WebSocketChannel::WebSocketChannel):
        (WebKit::WebSocketChannel::messageSenderDestinationID const):
        (WebKit::WebSocketChannel::connect):
        * WebProcess/Network/WebSocketChannel.h:
        (WebKit::WebSocketChannel::identifier const):
        * WebProcess/Network/WebSocketChannelManager.cpp:
        (WebKit::WebSocketChannelManager::didReceiveMessage):
        * WebProcess/Network/WebSocketChannelManager.h:
        * WebProcess/Network/WebSocketIdentifier.h: Added.
        * WebProcess/Network/WebSocketStream.cpp:
        (WebKit::WebSocketStream::streamWithIdentifier):
        (WebKit::WebSocketStream::WebSocketStream):
        (WebKit::WebSocketStream::~WebSocketStream):
        (WebKit::WebSocketStream::messageSenderDestinationID const):
        * WebProcess/Network/WebSocketStream.h:

2020-02-11  chris fleizach  <cfleizach@apple.com>

        AX: Unable to build webkit open source - build errors related to AXClientType
        https://bugs.webkit.org/show_bug.cgi?id=207524
        <rdar://problem/59279722>

        Reviewed by Mark Lam.

        * Platform/spi/mac/ApplicationServicesSPI.h:

2020-02-10  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthn] Move the async code from WebAuthenticationPanelClient to AuthenticatorManager
        https://bugs.webkit.org/show_bug.cgi?id=206248

        Reviewed by Alex Christensen.

        No change of behaviors.

        * UIProcess/API/APIWebAuthenticationPanelClient.h:
        (API::WebAuthenticationPanelClient::selectAssertionResponse const):
        * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
        (WebKit::AuthenticatorManager::serviceStatusUpdated):
        (WebKit::AuthenticatorManager::authenticatorStatusUpdated):
        (WebKit::AuthenticatorManager::requestPin):
        (WebKit::AuthenticatorManager::selectAssertionResponse):
        (WebKit::AuthenticatorManager::runPanel):
        (WebKit::AuthenticatorManager::invokePendingCompletionHandler):
        (WebKit::AuthenticatorManager::dispatchPanelClientCall const):
        * UIProcess/WebAuthentication/AuthenticatorManager.h:
        * UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.h:
        * UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.mm:
        (WebKit::WebAuthenticationPanelClient::updatePanel const):
        (WebKit::WebAuthenticationPanelClient::dismissPanel const):
        (WebKit::WebAuthenticationPanelClient::requestPin const):
        (WebKit::WebAuthenticationPanelClient::selectAssertionResponse const):

2020-02-10  Alan Sien Wei Hshieh  <hshieh@apple.com>

        Add a variant of -[WKWebViewPrivate _getContentsAsStringWithCompletionHandler:] that includes contents from subframes
        https://bugs.webkit.org/show_bug.cgi?id=207352
        <rdar://problem/59115798>

        Reviewed by Alex Christensen.

        A number of intelligence features like Spotlight rely on -_getContentsAsStringWithCompletionHandler:. However, this
        method does not return content strings for subframes. This means that Spotlight and others are not able to get
        text for things like AMP pages, that live in subframes. -_getContentsAsStringWithCompletionHandler: has clients outside
        of just intelligence features, and we don't want to wholesale change their behavior. As a result, introduce a new
        -_getContentsAsStringInAllFrames:withCompletionHandler: which clients can adopt as necessary. Providing NO for the first
        parameter allows clients to get the same contents as -_getContentsAsStringWithCompletionHandler:. Otherwise, we enumerate
        all subframes and extract text from there. Finally, append a test for getting stuff out of frames.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _getContentsAsStringWithCompletionHandler:]): 
        (-[WKWebView _getContentsOfAllFramesAsStringWithCompletionHandler:]): Call the new function to extract contents from all
        frames.

        * UIProcess/API/Cocoa/WKWebViewPrivate.h: Expose a new SPI for clients.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::getContentsAsStringInAllFrames): Piping. This emulates what getContentsAsString() does.

        * UIProcess/WebPageProxy.h: Expose new method.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::getContentsAsString): Augment to take a flag saying whether or not we want to extract
        from all frames. If we do, iterate over all the frames and get their content strings, appending two
        new lines in the middle.
 
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in: Piping.

        * Shared/ContentAsStringIncludesChildFrames.h: Add a new header to expose an enum.

2020-02-10  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Crash when granting access to asset services
        https://bugs.webkit.org/show_bug.cgi?id=207520
        <rdar://problem/59321848>

        Reviewed by Brent Fulgham.

        Pass correct handle when calling SandboxExtension::createHandleForMachLookup.

        API test: WebKit.GrantAccessToMobileAssetsCrash

        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::grantAccessToAssetServices):

2020-02-10  David Kilzer  <ddkilzer@apple.com>

        WebKit::WebProcessPool::initializeClassesForParameterCoding() should keep a copy of CString
        <https://webkit.org/b/207519>
        <rdar://problem/59043436>

        Reviewed by Brent Fulgham.

        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::initializeClassesForParameterCoding):
        - Change `className` to keep a copy of the CString object.

2020-02-10  Per Arne Vollan  <pvollan@apple.com>

        [watchOS] Notification listener is never unregistered
        https://bugs.webkit.org/show_bug.cgi?id=207459
        <rdar://problem/58923393>

        Reviewed by Maciej Stachowiak.

        On watchOS, the backlight changed notification is registered in WebProcessPool::registerNotificationObservers(),
        but not unregistered in WebProcessPool::unregisterNotificationObservers().

        API test: WebKit.BacklightLevelNotificationCrash

        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::unregisterNotificationObservers):

2020-02-10  James Howard  <jameshoward@mac.com>

        Standard gamepad mapping for GameControllerGamepads
        https://bugs.webkit.org/show_bug.cgi?id=206033

        Reviewed by Dean Jackson.
        
        Make the mapping as provided by PlatformGamepad
        available in UIGamepad, and pass it along to
        GamepadData so it can be correctly reflected
        in the Gamepad API.

        * Shared/Gamepad/GamepadData.cpp:
        (WebKit::GamepadData::GamepadData):
        (WebKit::GamepadData::encode const):
        (WebKit::GamepadData::decode):
        * Shared/Gamepad/GamepadData.h:
        (WebKit::GamepadData::mapping const):
        * UIProcess/Gamepad/UIGamepad.cpp:
        (WebKit::UIGamepad::UIGamepad):
        (WebKit::UIGamepad::fullGamepadData const):
        * UIProcess/Gamepad/UIGamepad.h:
        * WebProcess/Gamepad/WebGamepad.cpp:
        (WebKit::WebGamepad::WebGamepad):

2020-02-10  Daniel Bates  <dabates@apple.com>

        Disallow setting base URL to a data or JavaScript URL
        https://bugs.webkit.org/show_bug.cgi?id=207136

        Reviewed by Brent Fulgham.

        Apply base URL restrictions to apps linked to a future WebKit to avoid breaking existing apps.

        * Shared/WebPreferences.yaml:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (shouldRestrictBaseURLSchemes): Added.
        (-[WKWebView _setupPageConfiguration:]): Update settings.
        * UIProcess/Cocoa/VersionChecks.h:

2020-02-10  Chris Dumez  <cdumez@apple.com>

        Crash under WebProcessProxy::shouldSendPendingMessage()
        https://bugs.webkit.org/show_bug.cgi?id=207464
        <rdar://problem/59293825>

        Reviewed by Alex Christensen.

        I suspect the WebProcessProxy object is getting destroyed as we are iterating over the
        pending messages in AuxiliaryProcessProxy::didFinishLaunching(), thus crashing when
        calling WebProcessProxy::shouldSendPendingMessage() inside the loop. As a speculative
        fix, protect |this| at the beginning of WebProcessProxy::didFinishLaunching().

        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::didFinishLaunching):

2020-02-10  youenn fablet  <youenn@apple.com>

        Use ObjectIdentifier for WebRTC resolvers
        https://bugs.webkit.org/show_bug.cgi?id=207381

        Reviewed by Eric Carlson.

        Use ObjectIdentifier instead of uint64_t which gives type safety and ensures we do not receive wrong identifiers from IPC.
        No change of behavior.

        * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
        (WebKit::NetworkRTCProvider::close):
        (WebKit::NetworkRTCProvider::createResolver):
        Remove empty string check case since DNS resolver should be robust to null/empty strings.
        (WebKit::NetworkRTCProvider::stopResolver):
        * NetworkProcess/webrtc/NetworkRTCProvider.h:
        * NetworkProcess/webrtc/NetworkRTCProvider.messages.in:
        * NetworkProcess/webrtc/NetworkRTCResolver.cpp:
        (WebKit::NetworkRTCResolver::create):
        (WebKit::NetworkRTCResolver::NetworkRTCResolver):
        (WebKit::NetworkRTCResolver::start):
        (WebKit::NetworkRTCResolver::stop):
        * NetworkProcess/webrtc/NetworkRTCResolver.h:
        * NetworkProcess/webrtc/NetworkRTCResolverCocoa.cpp:
        (WebKit::NetworkRTCResolver::create):
        (WebKit::NetworkRTCResolverCocoa::NetworkRTCResolverCocoa):
        * NetworkProcess/webrtc/NetworkRTCResolverCocoa.h:
        * Scripts/webkit/messages.py:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/Network/NetworkProcessConnection.cpp:
        (WebKit::NetworkProcessConnection::didReceiveMessage):
        * WebProcess/Network/webrtc/LibWebRTCNetwork.h:
        (WebKit::LibWebRTCNetwork::resolver):
        * WebProcess/Network/webrtc/LibWebRTCResolver.cpp:
        (WebKit::LibWebRTCResolver::Start):
        (WebKit::LibWebRTCResolver::Destroy):
        * WebProcess/Network/webrtc/LibWebRTCResolver.h:
        * WebProcess/Network/webrtc/LibWebRTCResolverIdentifier.h: Copied from Source/WebKit/WebProcess/Network/webrtc/WebRTCResolver.h.
        * WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp:
        (WebKit::LibWebRTCSocketFactory::createAsyncResolver):
        * WebProcess/Network/webrtc/LibWebRTCSocketFactory.h:
        (WebKit::LibWebRTCSocketFactory::resolver):
        (WebKit::LibWebRTCSocketFactory::takeResolver):
        * WebProcess/Network/webrtc/WebRTCResolver.cpp:
        (WebKit::WebRTCResolver::WebRTCResolver):
        * WebProcess/Network/webrtc/WebRTCResolver.h:

2020-02-10  Truitt Savell  <tsavell@apple.com>

        Unreviewed, rolling out r256091.

        Broke internal builds

        Reverted changeset:

        "Move trivial definitions from FeatureDefines.xcconfig to
        PlatformEnableCocoa.h"
        https://bugs.webkit.org/show_bug.cgi?id=207155
        https://trac.webkit.org/changeset/256091

2020-02-10  Truitt Savell  <tsavell@apple.com>

        Unreviewed, rolling out r256103.

        This patch is blocking the rollout of r256091

        Reverted changeset:

        "Move JavaScriptCore related feature defines from
        FeatureDefines.xcconfig to PlatformEnableCocoa.h"
        https://bugs.webkit.org/show_bug.cgi?id=207436
        https://trac.webkit.org/changeset/256103

2020-02-10  Adrian Perez de Castro  <aperez@igalia.com>

        [geolocation] Fix non-unified build issues
        https://bugs.webkit.org/show_bug.cgi?id=207457

        Unreviewed build fix.

        No new tests needed.

        * UIProcess/GeolocationPermissionRequestManagerProxy.h: Add missing includes.
        * UIProcess/WebGeolocationManagerProxy.cpp: Ditto.

2020-02-10  Adrian Perez de Castro  <aperez@igalia.com>

        [GTK][WebInspector] Do not make Web Inspector windows transient
        https://bugs.webkit.org/show_bug.cgi?id=207455

        Reviewed by Carlos Garcia Campos.

        Stop setting Web Inspector windows as transient for the window
        containing the web view being inspected, to allow changing their
        relative stacking order. No changes are needed for inspector windows
        to continue being destroyed correctly when the corresponding web view
        is destroyed because code for handling that was already present in
        WebInspectorProxyGtk.cpp.

        No new tests needed.

        * UIProcess/Inspector/gtk/RemoteWebInspectorProxyGtk.cpp:
        (WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow):
        Do not pass a parent window parameter to webkitInspectorWindowNew().
        * UIProcess/Inspector/gtk/WebInspectorProxyGtk.cpp:
        (WebKit::WebInspectorProxy::platformCreateFrontendWindow): Remove code
        to obtain the top level window of the WebKitWebView, which no longer
        needs being passed to webkitInspectorWindowNew().
        * UIProcess/Inspector/gtk/WebKitInspectorWindow.cpp:
        (webkitInspectorWindowNew): Do not set the GtkWindow.transient-for
        property for the Web Inspector window. Remove the parent window
        parameter.
        * UIProcess/Inspector/gtk/WebKitInspectorWindow.h: Remove the parent
        window parameter for webkitInspectorWindowNew().

2020-02-10  Enrique Ocaña González  <eocanha@igalia.com>

        [GTK] Mouse pointer no longer hidden during fullscreen video playback
        https://bugs.webkit.org/show_bug.cgi?id=197346

        Reviewed by Adrian Perez de Castro.

        Covered by existing tests.

        * UIProcess/API/gtk/PageClientImpl.cpp:
        (WebKit::PageClientImpl::setCursorHiddenUntilMouseMoves): Added implementation.

2020-02-10  Adrian Perez de Castro  <aperez@igalia.com>

        [GTK][WebInspector] Always allow data:// URIs for inspector views
        https://bugs.webkit.org/show_bug.cgi?id=207454

        Reviewed by Carlos Garcia Campos.

        No new tests needed.

        * UIProcess/Inspector/gtk/WebInspectorProxyGtk.cpp:
        (WebKit::WebInspectorProxy::platformCreateFrontendPage): The Web
        Inspector may use navigation to data:// URLs, so always allow it.

2020-02-09  Lauro Moura  <lmoura@igalia.com>

        [GTK][WPE] Expose allowTopNavigationToDataURL
        https://bugs.webkit.org/show_bug.cgi?id=207384

        Reviewed by Adrian Perez de Castro.

        This patch exposes the new property "allow-top-navigation-to-data-urls"
        from r255961 to the glib-based APIs.

        * UIProcess/API/glib/WebKitSettings.cpp:
        (webKitSettingsSetProperty): Set new property.
        (webKitSettingsGetProperty): Get new property.
        (webkit_settings_class_init): Register new property.
        (webkit_settings_get_allow_top_navigation_to_data_urls): Added.
        (webkit_settings_set_allow_top_navigation_to_data_urls): Added.
        * UIProcess/API/gtk/WebKitSettings.h:
        * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
        * UIProcess/API/wpe/WebKitSettings.h:
        * UIProcess/API/wpe/docs/wpe-1.0-sections.txt:

2020-02-09  Keith Rollin  <krollin@apple.com>

        Re-enable LTO for ARM builds
        https://bugs.webkit.org/show_bug.cgi?id=207402
        <rdar://problem/49190767>

        Reviewed by Sam Weinig.

        Bug 190758 re-enabled LTO for Production builds for x86-family CPUs.
        Enabling it for ARM was left out due to a compiler issue. That issue
        has been fixed, and so now we can re-enable LTO for ARM.

        * Configurations/Base.xcconfig:

2020-02-09  Wenson Hsieh  <wenson_hsieh@apple.com>

        Fix the watchOS build after <rdar://problem/56134081>
        https://bugs.webkit.org/show_bug.cgi?id=207443
        <rdar://problem/59295173>

        Reviewed by Maciej Stachowiak.

        Use the version of the SPI that's guaranteed to be available across all platforms.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (gestureRecognizerModifierFlags):

2020-02-09  Kate Cheney  <katherine_cheney@apple.com>

        [ Mac wk2 ] http/tests/resourceLoadStatistics/log-cross-site-load-with-link-decoration.html is a flaky failure
        https://bugs.webkit.org/show_bug.cgi?id=207271
        <rdar://problem/59190346>

        Reviewed by Maciej Stachowiak.

        This patch adds a check to make sure a test is expecting a statistics
        processing call before proceeding. Otherwise, this can cause
        flakiness in ITP tests if data is removed/changed during the test.

        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
        (WebKit::ResourceLoadStatisticsStore::processStatisticsAndDataRecords):

2020-02-08  Sam Weinig  <weinig@apple.com>

        Move JavaScriptCore related feature defines from FeatureDefines.xcconfig to PlatformEnableCocoa.h
        https://bugs.webkit.org/show_bug.cgi?id=207436

        Reviewed by Tim Horton.

        * Configurations/FeatureDefines.xcconfig:
        Remove ENABLE_FAST_JIT_PERMISSIONS and ENABLE_FTL_JIT.

2020-02-08  Wenson Hsieh  <wenson_hsieh@apple.com>

        REGRESSION (r256072): ScrollViewScrollabilityTests.ScrollableWithOverflowHiddenAndInputView fails
        https://bugs.webkit.org/show_bug.cgi?id=207425
        Followup to <rdar://problem/56960774>

        Reviewed by Tim Horton.

        The failing test ScrollViewScrollabilityTests.ScrollableWithOverflowHiddenAndInputView relies on -[WKWebView
        _zoomToFocusRect:...:] to modify the zoom scale of WKScrollView in order for the next layer tree transaction to
        have a zoom scale not equal to the initial scale, which in turn ensures that we make the UIScrollView scrollable
        after the next remote layer tree update.

        The change in r256072 caused us to bail early in -_zoomToFocusRect: and -_zoomToPoint: in the case where the
        scroll view is not scrollable (i.e. the page has `overflow: hidden`); this means that if all the following
        conditions are met, we now avoid zooming into focused elements, whereas we would've zoomed before the change:

        1.  The user is focusing an element on an iPhone.
        2.  The document body has `overflow: hidden;`, or the WebKit client has called `-setScrollEnabled:NO`.
        3.  Either an SPI client has vended an empty input view and input accessory view, or the focused element has
            inputmode="none".

        To fix the test and restore zooming behavior, we partially revert the change in r256072, such that we no longer
        bail from WKWebView's zooming codepaths if the scrollEnabled property is NO.

        * UIProcess/API/ios/WKWebViewIOS.mm:
        (-[WKWebView _zoomToPoint:atScale:animated:]):
        (-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):

2020-02-08  Sam Weinig  <weinig@apple.com>

        Move trivial definitions from FeatureDefines.xcconfig to PlatformEnableCocoa.h
        https://bugs.webkit.org/show_bug.cgi?id=207155

        Reviewed by Tim Horton.

        Move all trivial definitions (just ENABLE_FOO = ENABLE_FOO; or ENABLE_BAR = ;)
        from the FeatureDefines.xcconfigs to PlatformEnableCocoa.h, ensuring each one
        also has a default value in PlatformEnable.h

        To support the move, DerivedSources.make and generate-unified-sources.sh have been 
        updated to generate the list of ENABLE_* features by directly from preprocessing 
        Platform.h, rather than just getting the partial list from the xcconfig file.

        * Configurations/FeatureDefines.xcconfig:
        * DerivedSources.make:
        * Scripts/generate-unified-sources.sh:

2020-02-08  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Hold off non-cookie website data deletion until an hour after user interaction
        https://bugs.webkit.org/show_bug.cgi?id=207418
        <rdar://problem/58550164>

        Reviewed by Chris Dumez.

        This change makes sure there is at least a one-hour or older timestamp
        for user interaction for some website before activating deletion of
        non-cookie website data for sites the user has not interacted with.
        This ensures that a fresh start such as after a reset or on a new
        device doesn't interpret the lack of data as lack of user interaction.

        No new tests. Existing tests make sure we don't regress the functionality.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        (WebKit::ResourceLoadStatisticsDatabaseStore::registrableDomainsToRemoveWebsiteDataFor):
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
        (WebKit::ResourceLoadStatisticsMemoryStore::registrableDomainsToRemoveWebsiteDataFor):

2020-02-07  Jon Lee  <jonlee@apple.com>

        Web Inspector: Revert slim toolbar
        https://bugs.webkit.org/show_bug.cgi?id=207422

        Reviewed by Timothy Hatcher.

        The slim toolbar needs a little more work before landing.

        This patch reverts r255547, r255557, r255890, r255892, r255893, r255901, r255980.

        * UIProcess/Inspector/RemoteWebInspectorProxy.cpp:
        * UIProcess/Inspector/RemoteWebInspectorProxy.h:
        * UIProcess/Inspector/RemoteWebInspectorProxy.messages.in:
        * UIProcess/Inspector/WebInspectorProxy.cpp:
        * UIProcess/Inspector/WebInspectorProxy.h:
        * UIProcess/Inspector/WebInspectorProxy.messages.in:
        * UIProcess/Inspector/gtk/RemoteWebInspectorProxyGtk.cpp:
        * UIProcess/Inspector/gtk/WebInspectorProxyGtk.cpp:
        * UIProcess/Inspector/mac/RemoteWebInspectorProxyMac.mm:
        * UIProcess/Inspector/mac/WebInspectorProxyMac.mm:
        * UIProcess/Inspector/win/RemoteWebInspectorProxyWin.cpp:
        * UIProcess/Inspector/win/WebInspectorProxyWin.cpp:
        * WebProcess/Inspector/RemoteWebInspectorUI.cpp:
        * WebProcess/Inspector/RemoteWebInspectorUI.h:
        * WebProcess/Inspector/WebInspectorUI.cpp:
        * WebProcess/Inspector/WebInspectorUI.h:

2020-02-07  Kate Cheney  <katherine_cheney@apple.com>

        REGRESSION: ASSERTION FAILED: resetResult == 0 on regression tests in ITP code, resetting SQLite statement
        https://bugs.webkit.org/show_bug.cgi?id=207269
        <rdar://problem/59188891>

        Reviewed by Brady Eidson.

        Adds logging if ITP telemetry calculations fail to step and makes sure
        not to reset the statement in this case as it will result in an error.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:

2020-02-07  Chris Dumez  <cdumez@apple.com>

        [IPC Hardening] Protect against bad parameters in WebProcessProxy::getPluginProcessConnection()
        https://bugs.webkit.org/show_bug.cgi?id=207416
        <rdar://problem/58617244>

        Reviewed by David Kilzer.

        * UIProcess/Plugins/PluginProcessManager.cpp:
        (WebKit::PluginProcessManager::getPluginProcessConnection):
        * UIProcess/Plugins/PluginProcessManager.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::getPluginProcessConnection):

2020-02-07  Chris Dumez  <cdumez@apple.com>

        [IPC Hardening] Convert some debug assertions into MESSAGE_CHECKs in WebPaymentCoordinatorProxy
        https://bugs.webkit.org/show_bug.cgi?id=207414
        <rdar://problem/58507177>

        Reviewed by Andy Estes.

        * Shared/ApplePay/WebPaymentCoordinatorProxy.cpp:
        (WebKit::WebPaymentCoordinatorProxy::canMakePaymentsWithActiveCard):
        (WebKit::WebPaymentCoordinatorProxy::openPaymentSetup):
        (WebKit::WebPaymentCoordinatorProxy::showPaymentUI):
        (WebKit::WebPaymentCoordinatorProxy::completeMerchantValidation):
        (WebKit::WebPaymentCoordinatorProxy::completeShippingMethodSelection):
        (WebKit::WebPaymentCoordinatorProxy::completeShippingContactSelection):
        (WebKit::WebPaymentCoordinatorProxy::completePaymentMethodSelection):

2020-02-07  Alex Christensen  <achristensen@webkit.org>

        Harden HashTable IPC decoders
        https://bugs.webkit.org/show_bug.cgi?id=207415

        Reviewed by Chris Dumez.

        * Platform/IPC/ArgumentCoders.h:

2020-02-07  Chris Dumez  <cdumez@apple.com>

        [Hardening] Validate Geolocation access permission on UIProcess side
        https://bugs.webkit.org/show_bug.cgi?id=207393
        <rdar://problem/56816051>

        Reviewed by Brent Fulgham.

        * UIProcess/GeolocationPermissionRequestManagerProxy.cpp:
        (WebKit::GeolocationPermissionRequestManagerProxy::didReceiveGeolocationPermissionDecision):
        (WebKit::GeolocationPermissionRequestManagerProxy::isValidAuthorizationToken const):
        (WebKit::GeolocationPermissionRequestManagerProxy::revokeAuthorizationToken):
        * UIProcess/GeolocationPermissionRequestManagerProxy.h:
        * UIProcess/WebGeolocationManagerProxy.cpp:
        (WebKit::WebGeolocationManagerProxy::startUpdating):
        * UIProcess/WebGeolocationManagerProxy.h:
        * UIProcess/WebGeolocationManagerProxy.messages.in:
        * UIProcess/WebPageProxy.cpp:
        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::geolocationPermissionRequestManager):
        * UIProcess/WebPageProxy.messages.in:
        * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp:
        (WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation):
        (WebKit::GeolocationPermissionRequestManager::revokeAuthorizationToken):
        (WebKit::GeolocationPermissionRequestManager::didReceiveGeolocationPermissionDecision):
        * WebProcess/Geolocation/GeolocationPermissionRequestManager.h:
        * WebProcess/Geolocation/WebGeolocationManager.cpp:
        (WebKit::WebGeolocationManager::registerWebPage):
        * WebProcess/Geolocation/WebGeolocationManager.h:
        * WebProcess/WebCoreSupport/WebGeolocationClient.cpp:
        (WebKit::WebGeolocationClient::startUpdating):
        (WebKit::WebGeolocationClient::revokeAuthorizationToken):
        * WebProcess/WebCoreSupport/WebGeolocationClient.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::didReceiveGeolocationPermissionDecision):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2020-02-07  Alex Christensen  <achristensen@apple.com>

        Remember if we used legacy TLS in the back/forward cache like we remember if we have only secure content
        https://bugs.webkit.org/show_bug.cgi?id=207409
        rdar://problem/59275641

        Reviewed by Chris Dumez.

        * Scripts/webkit/messages.py:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::hasInsecureContent):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):
        (WebKit::WebFrameLoaderClient::savePlatformDataToCachedFrame):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:

2020-02-07  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] Double tapping shouldn't scroll the page when the body has `overflow: hidden`
        https://bugs.webkit.org/show_bug.cgi?id=207390
        <rdar://problem/56960774>

        Reviewed by Tim Horton and Simon Fraser.

        Bail out of several codepaths that zoom and scroll WKScrollView as a result of smart magnification gestures
        (e.g. one-finger double taps), in the case where scrolling has been disabled on WKScrollView. This may occur
        if the page has `overflow: hidden` on the body or root, but may also happen due to a WebKit client disabling
        scrolling via native API, such as `webView.scrollView.scrollingEnabled = NO;`.

        Test: fast/scrolling/ios/double-tap-to-scroll-with-scrolling-disabled.html

        * UIProcess/API/ios/WKWebViewIOS.mm:
        (-[WKWebView _zoomToPoint:atScale:animated:]):
        (-[WKWebView _scrollToRect:origin:minimumScrollDistance:]):

        Drive-by fix: change some `false`s to `NO`s, and `true`s to `YES`s.

        (-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):

2020-02-07  Timothy Hatcher  <timothy@apple.com>

        Crash under WKBundleFrameForJavaScriptContext dereferencing a NULL WebCore::Frame.
        https://bugs.webkit.org/show_bug.cgi?id=207407
        rdar://problem/59206599

        Reviewed by Tim Horton.

        * WebProcess/WebPage/WebFrame.cpp:
        (WebKit::WebFrame::frameForContext): Add a null check for the coreFrame.

2020-02-07  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r256051.

        Broke internal builds.

        Reverted changeset:

        "Move trivial definitions from FeatureDefines.xcconfig to
        PlatformEnableCocoa.h"
        https://bugs.webkit.org/show_bug.cgi?id=207155
        https://trac.webkit.org/changeset/256051

2020-02-07  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthn] Report CTAP Client Pin Error to clients
        https://bugs.webkit.org/show_bug.cgi?id=205837
        <rdar://problem/58356872>

        Reviewed by Brent Fulgham.

        Authenticators could return four different errors { kCtap2ErrPinInvalid, kCtap2ErrPinBlocked, kCtap2ErrPinAuthInvalid, kCtap2ErrPinAuthBlocked }
        during 1) GetPinToken or 2) MakeCredential/GetAssertion with PinAuth.

        All errors should be reported to the client so that appropriate UI can be displayed to users.
        For kCtap2ErrPinAuthInvalid and kCtap2ErrPinInvalid, we will restart the whole Pin process to get
        another Pin from the user.

        Covered by API tests.

        * UIProcess/API/APIWebAuthenticationPanelClient.h:
        * UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.mm:
        (WebKit::wkWebAuthenticationPanelUpdate):
        * UIProcess/WebAuthentication/WebAuthenticationFlags.h:
        * UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp:
        (WebKit::fido::toStatus):
        (WebKit::fido::isPinError):
        (WebKit::CtapAuthenticator::continueMakeCredentialAfterResponseReceived):
        (WebKit::CtapAuthenticator::continueGetAssertionAfterResponseReceived):
        (WebKit::CtapAuthenticator::continueRequestAfterGetPinToken):
        (WebKit::CtapAuthenticator::tryRestartPin):
        * UIProcess/WebAuthentication/fido/CtapAuthenticator.h:

2020-02-07  Jonathan Bedard  <jbedard@apple.com>

        Handle deprecated APIs in WKImagePreviewViewController
        https://bugs.webkit.org/show_bug.cgi?id=207398

        Reviewed by Tim Horton.

        No new tests, build fix.

        * UIProcess/WKImagePreviewViewController.mm:
        (-[WKImagePreviewViewController previewActionItems]): Add deprecation macros.

2020-02-07  Kate Cheney  <katherine_cheney@apple.com>

       Regression (r256011): http/tests/resourceLoadStatistics/aggregate-sorted-data-no-storage-access.html is consistently failing
       https://bugs.webkit.org/show_bug.cgi?id=207382
       <rdar://problem/59259844>

       Sort the resource load statistics dumping results so they consistently
       print in the same order.

        Reviewed by Yusuke Suzuki.

        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
        (WebKit::ResourceLoadStatisticsMemoryStore::dumpResourceLoadStatistics):

2020-02-07  Sam Weinig  <weinig@apple.com>

        Move trivial definitions from FeatureDefines.xcconfig to PlatformEnableCocoa.h
        https://bugs.webkit.org/show_bug.cgi?id=207155

        Reviewed by Tim Horton.

        Move all trivial definitions (just ENABLE_FOO = ENABLE_FOO; or ENABLE_BAR = ;)
        from the FeatureDefines.xcconfigs to PlatformEnableCocoa.h, ensuring each one
        also has a default value in PlatformEnable.h

        To support the move, DerivedSources.make and generate-unified-sources.sh have been 
        updated to generate the list of ENABLE_* features by directly from preprocessing 
        Platform.h, rather than just getting the partial list from the xcconfig file.

        * Configurations/FeatureDefines.xcconfig:
        * DerivedSources.make:
        * Scripts/generate-unified-sources.sh:

2020-02-07  Kate Cheney  <katherine_cheney@apple.com>

        Update WebView category name to be more accurate
        https://bugs.webkit.org/show_bug.cgi?id=207334
        <rdar://problem/59224855>

        Reviewed by Brent Fulgham.

        * Shared/WebViewCategory.h:
        * UIProcess/API/APIPageConfiguration.h:
        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
        (toWebKitWebViewCategory):
        (toWKWebViewCategory):
        * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:

2020-02-07  youenn fablet  <youenn@apple.com>

        BackgroundProcessResponsivenessTimer should not be active if running active pages and service workers
        https://bugs.webkit.org/show_bug.cgi?id=207264

        Reviewed by Chris Dumez.

        In case a service worker is running, the process might still be foreground if a page is running in the same process.
        Not observable.

        * UIProcess/BackgroundProcessResponsivenessTimer.cpp:
        (WebKit::BackgroundProcessResponsivenessTimer::shouldBeActive const):

2020-02-07  Chris Dumez  <cdumez@apple.com>

        Address post-landing review comments from Darin on r255989.

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::terminateServiceWorkerProcess):

2020-02-07  Chris Dumez  <cdumez@apple.com>

        [IPC hardening] Update WebPasteboardProxy methods to validate their parameters
        https://bugs.webkit.org/show_bug.cgi?id=207308
        <rdar://problem/58632938>

        Reviewed by Brent Fulgham.

        * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
        (WebKit::WebPasteboardProxy::getPasteboardPathnamesForType):
        (WebKit::WebPasteboardProxy::getPasteboardStringForType):
        (WebKit::WebPasteboardProxy::getPasteboardStringsForType):
        (WebKit::WebPasteboardProxy::getPasteboardBufferForType):
        (WebKit::WebPasteboardProxy::setPasteboardStringForType):
        (WebKit::WebPasteboardProxy::setPasteboardBufferForType):
        (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite):
        (WebKit::WebPasteboardProxy::readStringFromPasteboard):
        (WebKit::WebPasteboardProxy::readBufferFromPasteboard):

2020-02-07  youenn fablet  <youenn@apple.com>

        Mandate UUID version 4 for mDNS ICE candidates
        https://bugs.webkit.org/show_bug.cgi?id=207329

        Reviewed by Alex Christensen.

        * NetworkProcess/webrtc/NetworkMDNSRegister.cpp:
        (WebKit::NetworkMDNSRegister::registerMDNSName):
        Remove the count at the end of the mDNS name to make it a fully version 4 UUID.

2020-02-07  Patrick Griffis  <pgriffis@igalia.com>

        [GTK][WPE] Add same-site cookie support
        https://bugs.webkit.org/show_bug.cgi?id=204137

        Reviewed by Carlos Garcia Campos.

        Implements same-site cookie support in the soup backend.

        * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
        (WebKit::NetworkDataTaskSoup::continueHTTPRedirection):

2020-02-07  youenn fablet  <youenn@apple.com>

        [Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder
        https://bugs.webkit.org/show_bug.cgi?id=206582
        <rdar://problem/58985368>

        Reviewed by Eric Carlson.

        Enable RemoteMediaRecorder only for systems supporting AVAssetWriterDelegate.

        * GPUProcess/GPUConnectionToWebProcess.cpp:
        (WebKit::GPUConnectionToWebProcess::didReceiveMessage):
        * GPUProcess/GPUConnectionToWebProcess.h:
        * GPUProcess/webrtc/RemoteMediaRecorder.cpp:
        * GPUProcess/webrtc/RemoteMediaRecorder.h:
        * GPUProcess/webrtc/RemoteMediaRecorder.messages.in:
        * GPUProcess/webrtc/RemoteMediaRecorderManager.cpp:
        * GPUProcess/webrtc/RemoteMediaRecorderManager.h:
        * GPUProcess/webrtc/RemoteMediaRecorderManager.messages.in:
        * GPUProcess/webrtc/RemoteSampleBufferDisplayLayerManager.h:
        * WebProcess/GPU/webrtc/MediaRecorderPrivate.cpp:
        * WebProcess/GPU/webrtc/MediaRecorderPrivate.h:
        * WebProcess/GPU/webrtc/MediaRecorderProvider.cpp:
        (WebKit::MediaRecorderProvider::createMediaRecorderPrivate):

2020-02-06  Tim Horton  <timothy_horton@apple.com>

        macCatalyst: Unnecessary I-beam over images in editable areas
        https://bugs.webkit.org/show_bug.cgi?id=207370
        <rdar://problem/59235429>

        Reviewed by Wenson Hsieh.

        * Shared/ios/InteractionInformationAtPosition.h:
        * Shared/ios/InteractionInformationAtPosition.mm:
        (WebKit::InteractionInformationAtPosition::encode const):
        (WebKit::InteractionInformationAtPosition::decode):
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::populateCaretContext):
        Add a bit indicating whether the forced I-beam for editable contexts
        should be used or not, based on whether it is adjacent to (or immediately
        over) a replaced element.

2020-02-06  Brent Fulgham  <bfulgham@apple.com>

        Build entitlements into GPU Process
        https://bugs.webkit.org/show_bug.cgi?id=207367
        <rdar://problem/59208411>

        Reviewed by Geoffrey Garen.

        When the new GPU process was added, we did not update the build system to add
        necessary entitlements, or to encode the sandbox name for process startup.
        This patch corrects these issues.

        * Scripts/process-entitlements.sh:

2020-02-06  Yusuke Suzuki  <ysuzuki@apple.com>

        ResourceLoadStatisticsDatabaseStore::dumpResourceLoadStatistics relies on the order of m_getAllDomainsStatement, which can be changed by HashTable's implementation
        https://bugs.webkit.org/show_bug.cgi?id=207348

        Reviewed by Mark Lam.

        It turns out that ResourceLoadStatisticsDatabaseStore::dumpResourceLoadStatistics's output
        is relying on HashTable's particular iteration order which is not guaranteed.
        This patch fixes this assumption by sorting domains before dumping.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        (WebKit::CompletionHandler<void):

2020-02-06  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthn] authenticatorGetAssertion should be sent without pinAuth if UV = "discouraged"
        https://bugs.webkit.org/show_bug.cgi?id=206547
        <rdar://problem/58768032>

        Reviewed by Brent Fulgham.

        Covered by new tests within existing files.

        * UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp:
        (WebKit::CtapAuthenticator::makeCredential):
        (WebKit::CtapAuthenticator::getAssertion):

2020-02-06  Wenson Hsieh  <wenson_hsieh@apple.com>

        WebPage::rangeForGranularityAtPoint always returns null in the case of CharacterGranularity
        https://bugs.webkit.org/show_bug.cgi?id=207350
        <rdar://problem/59239914>

        Reviewed by Tim Horton.

        Handle the character granularity case in `WebPage::rangeForGranularityAtPoint` by just returning a collapsed
        Range. Certain internal clients will have a need to place and update the text selection using character
        granularity; see radar for more details.

        Test: UIWKInteractionViewProtocol.SelectTextWithCharacterGranularity

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView supportsTextSelectionWithCharacterGranularity]):
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::rangeForGranularityAtPoint):

2020-02-06  Jiewen Tan  <jiewen_tan@apple.com>

        Adopt new SOAuthorizationOption constants
        https://bugs.webkit.org/show_bug.cgi?id=207186
        <rdar://problem/48909336>

        Reviewed by Brent Fulgham.

        No change of behaviors.

        * UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm:
        (WebKit::SOAuthorizationSession::continueStartAfterDecidePolicy):

2020-02-06  Brady Eidson  <beidson@apple.com>

        Cleanup and promote WKContentWorld and its clients in WKWebView.
        https://bugs.webkit.org/show_bug.cgi?id=207351

        Reviewed by Alex Christensen.

        Renames and updated comments.
        
        API tests updated.

        * Shared/Cocoa/APIObject.mm:
        (API::Object::newObject):

        * SourcesCocoa.txt:

        * UIProcess/API/Cocoa/WKContentWorld.h: Renamed from Source/WebKit/UIProcess/API/Cocoa/_WKContentWorld.h.
        * UIProcess/API/Cocoa/WKContentWorld.mm: Renamed from Source/WebKit/UIProcess/API/Cocoa/_WKContentWorld.mm.
        (+[WKContentWorld pageWorld]):
        (+[WKContentWorld defaultClientWorld]):
        (+[WKContentWorld worldWithName:]):
        (-[WKContentWorld dealloc]):
        (-[WKContentWorld name]):
        (-[WKContentWorld _apiObject]):
        * UIProcess/API/Cocoa/WKContentWorldInternal.h: Renamed from Source/WebKit/UIProcess/API/Cocoa/_WKContentWorldInternal.h.

        * UIProcess/API/Cocoa/WKWebView.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView evaluateJavaScript:completionHandler:]):
        (-[WKWebView evaluateJavaScript:inContentWorld:completionHandler:]):
        (-[WKWebView callAsyncJavaScript:arguments:inContentWorld:completionHandler:]):
        (-[WKWebView _evaluateJavaScript:asAsyncFunction:withArguments:forceUserGesture:completionHandler:inWorld:]):
        (-[WKWebView _evaluateJavaScriptWithoutUserGesture:completionHandler:]):
        (-[WKWebView _callAsyncJavaScriptFunction:withArguments:inWorld:completionHandler:]): Deleted.
        (-[WKWebView _evaluateJavaScript:inWorld:completionHandler:]): Deleted.
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:

        * WebKit.xcodeproj/project.pbxproj:

2020-02-06  Fujii Hironori  <Hironori.Fujii@sony.com>

        [Win][MiniBrowser] Accelerator keys don't work unless the main window is focused
        https://bugs.webkit.org/show_bug.cgi?id=207250

        Reviewed by Alex Christensen.

        * UIProcess/win/WebView.cpp:
        (WebKit::WebView::wndProc): Bubble up unhandled WM_COMMAND to the
        parent window.

2020-02-06  Chris Dumez  <cdumez@apple.com>

        [WK2][iOS] Add WKWebviewConfiguration SPI to run client navigations at foreground priority, even if the view is background
        https://bugs.webkit.org/show_bug.cgi?id=207341
        <rdar://problem/59227077>

        Reviewed by Geoff Garen.

        Add WKWebviewConfiguration SPI to run client navigations at foreground priority, even if the view is background,
        as long as the application itself is foreground. The new SPI is:
        WKWebViewConfiguration._clientNavigationsRunAtForegroundPriority

        The use case is that the client may choose to load something in an offscreen view and only show the view once the
        load is complete (to avoid flashing for e.g.). In such cases, it makes sense to use foreground priority for the
        load since it needs to complete as fast as possible, even though the view is technically background.

        * UIProcess/API/APINavigation.h:
        (API::Navigation::setForegroundActivity):
        * UIProcess/API/APIPageConfiguration.cpp:
        (API::PageConfiguration::copy const):
        * UIProcess/API/APIPageConfiguration.h:
        (API::PageConfiguration::clientNavigationsRunAtForegroundPriority const):
        (API::PageConfiguration::setClientNavigationsRunAtForegroundPriority):
        (API::PageConfiguration::alwaysRunsAtForegroundPriority const):
        (API::PageConfiguration::alwaysRunsAtForegroundPriority): Deleted.
        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
        (-[WKWebViewConfiguration _clientNavigationsRunAtForegroundPriority]):
        (-[WKWebViewConfiguration _setClientNavigationsRunAtForegroundPriority:]):
        * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
        * UIProcess/PageClient.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::loadRequest):
        (WebKit::WebPageProxy::loadFile):
        (WebKit::WebPageProxy::loadData):
        (WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared):
        (WebKit::WebPageProxy::didFinishLoadForFrame):
        (WebKit::WebPageProxy::didFailLoadForFrame):
        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/PageClientImplIOS.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::isApplicationVisible):
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::shouldUseForegroundPriorityForClientNavigation const):

2020-02-06  Chris Dumez  <cdumez@apple.com>

        REGRESSION (r254706): Crash under WebProcessPool::terminateServiceWorkerProcess()
        https://bugs.webkit.org/show_bug.cgi?id=207354
        <rdar://problem/59184818>

        Reviewed by Geoffrey Garen.

        No new tests, not easily testable AFAIK since this happens on failure to send sync IPC to
        the service worker when terminating it.

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::terminateServiceWorkerProcess):
        'auto' resolved to 'WeakPtr<WebProcessProxy>' in this method and the call to
        disableServiceWorkers() could cause the process to get destroyed. We would then
        do a null dereference on the next line.

2020-02-06  Chris Dumez  <cdumez@apple.com>

        Unreviewed, rolling out r255955.

        Caused API test failures on iOS

        Reverted changeset:

        "[IPC hardening] Update WebPasteboardProxy methods to validate
        their parameters"
        https://bugs.webkit.org/show_bug.cgi?id=207308
        https://trac.webkit.org/changeset/255955

2020-02-06  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r255910, r255970, and r255972.
        https://bugs.webkit.org/show_bug.cgi?id=207345

        Broke internal builds (Requested by ryanhaddad on #webkit).

        Reverted changesets:

        "[Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder"
        https://bugs.webkit.org/show_bug.cgi?id=206582
        https://trac.webkit.org/changeset/255910

        "[Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder"
        https://bugs.webkit.org/show_bug.cgi?id=206582
        https://trac.webkit.org/changeset/255970

        "[Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder"
        https://bugs.webkit.org/show_bug.cgi?id=206582
        https://trac.webkit.org/changeset/255972

2020-02-06  Patrick Griffis  <pgriffis@igalia.com>

        [GTK][WPE] Re-add flatpak sandbox support
        https://bugs.webkit.org/show_bug.cgi?id=204732

        Reviewed by Michael Catanzaro.

        This brings back the Flatpak based sandbox now that upstream has added
        features to their spawn portal to accomodate our needs.

        * SourcesGTK.txt:
        * SourcesWPE.txt:
        * UIProcess/Launcher/glib/FlatpakLauncher.cpp: Added.
        (WebKit::flatpakSpawn):
        * UIProcess/Launcher/glib/FlatpakLauncher.h: Added.
        * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
        (WebKit::isFlatpakSpawnUsable):
        (WebKit::isInsideFlatpak):
        (WebKit::ProcessLauncher::launchProcess):

2020-02-06  Brent Fulgham  <bfulgham@apple.com>

        Prevent navigating top level frames to Data URLs
        https://bugs.webkit.org/show_bug.cgi?id=206962
        <rdar://problem/56770676>

        Reviewed by Youenn Fablet.

        Expose a new off-by-default preference to allow top-level navigation to Data URIs.

        Tests:  fast/loader/data-url-frame-allowed.html, fast/loader/data-url-load-denied.html

        * Shared/WebPreferences.yaml:
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetTopNavigationToDataURLsAllowed):
        (WKPreferencesGetTopNavigationToDataURLsAllowed):
        * UIProcess/API/C/WKPreferencesRefPrivate.h:
        * UIProcess/API/Cocoa/WKPreferences.mm:
        (-[WKPreferences _setTopNavigationToDataURLsAllowed:]):
        (-[WKPreferences _topNavigationToDataURLsAllowed]):
        * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _setupPageConfiguration:]):
        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
        (-[WKWebViewConfiguration init]):
        (-[WKWebViewConfiguration copyWithZone:]):
        (-[WKWebViewConfiguration _allowTopNavigationToDataURLs]):
        (-[WKWebViewConfiguration _setAllowTopNavigationToDataURLs:]):
        * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
        * UIProcess/Inspector/mac/WKInspectorViewController.mm:
        (-[WKInspectorViewController configuration]):

2020-02-06  Alex Christensen  <achristensen@webkit.org>

        Remove unused SPI WKWebViewConfiguration._treatsSHA1SignedCertificatesAsInsecure
        https://bugs.webkit.org/show_bug.cgi?id=207314

        Reviewed by Youenn Fablet.

        The transition period is over.  SHA1 certificates are insecure.

        * UIProcess/API/APIPageConfiguration.cpp:
        (API::PageConfiguration::copy const):
        * UIProcess/API/APIPageConfiguration.h:
        (API::PageConfiguration::treatsSHA1SignedCertificatesAsInsecure): Deleted.
        (API::PageConfiguration::setTreatsSHA1SignedCertificatesAsInsecure): Deleted.
        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
        (-[WKWebViewConfiguration _treatsSHA1SignedCertificatesAsInsecure]): Deleted.
        (-[WKWebViewConfiguration _setTreatsSHA1SignedCertificatesAsInsecure:]): Deleted.
        * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::WebPageProxy):
        (WebKit::WebPageProxy::didCommitLoadForFrame):
        * UIProcess/WebPageProxy.h:

2020-02-06  Chris Dumez  <cdumez@apple.com>

        [IPC hardening] Update WebPasteboardProxy methods to validate their parameters
        https://bugs.webkit.org/show_bug.cgi?id=207308
        <rdar://problem/58632938>

        Reviewed by Alex Christensen.

        * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
        (WebKit::WebPasteboardProxy::getPasteboardTypes):
        (WebKit::WebPasteboardProxy::getPasteboardPathnamesForType):
        (WebKit::WebPasteboardProxy::getPasteboardStringForType):
        (WebKit::WebPasteboardProxy::getPasteboardStringsForType):
        (WebKit::WebPasteboardProxy::getPasteboardBufferForType):
        (WebKit::WebPasteboardProxy::pasteboardCopy):
        (WebKit::WebPasteboardProxy::getPasteboardChangeCount):
        (WebKit::WebPasteboardProxy::getPasteboardColor):
        (WebKit::WebPasteboardProxy::getPasteboardURL):
        (WebKit::WebPasteboardProxy::addPasteboardTypes):
        (WebKit::WebPasteboardProxy::setPasteboardTypes):
        (WebKit::WebPasteboardProxy::setPasteboardURL):
        (WebKit::WebPasteboardProxy::setPasteboardColor):
        (WebKit::WebPasteboardProxy::setPasteboardStringForType):
        (WebKit::WebPasteboardProxy::setPasteboardBufferForType):
        (WebKit::WebPasteboardProxy::getNumberOfFiles):
        (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite):
        (WebKit::WebPasteboardProxy::writeCustomData):
        (WebKit::WebPasteboardProxy::allPasteboardItemInfo):
        (WebKit::WebPasteboardProxy::informationForItemAtIndex):
        (WebKit::WebPasteboardProxy::getPasteboardItemsCount):
        (WebKit::WebPasteboardProxy::readStringFromPasteboard):
        (WebKit::WebPasteboardProxy::readURLFromPasteboard):
        (WebKit::WebPasteboardProxy::readBufferFromPasteboard):
        (WebKit::WebPasteboardProxy::writeURLToPasteboard):
        (WebKit::WebPasteboardProxy::writeWebContentToPasteboard):
        (WebKit::WebPasteboardProxy::writeImageToPasteboard):
        (WebKit::WebPasteboardProxy::writeStringToPasteboard):
        (WebKit::WebPasteboardProxy::updateSupportedTypeIdentifiers):

2020-02-06  Chris Dumez  <cdumez@apple.com>

        [IPC Hardening] Protect against bad identifier in WebPageProxy::DidInsertAttachmentWithIdentifier()
        https://bugs.webkit.org/show_bug.cgi?id=207311
        <rdar://problem/58632517>

        Reviewed by Alex Christensen.

        * UIProcess/WebPageProxy.cpp:

2020-02-06  youenn fablet  <youenn@apple.com>

        [Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder
        https://bugs.webkit.org/show_bug.cgi?id=206582
        <rdar://problem/58985368>

        Reviewed by Eric Carlson.

        Enable RemoteMediaRecorder only for systems supporting AVAssetWriterDelegate.

        * GPUProcess/GPUConnectionToWebProcess.cpp:
        (WebKit::GPUConnectionToWebProcess::didReceiveMessage):
        * GPUProcess/GPUConnectionToWebProcess.h:
        * GPUProcess/webrtc/RemoteMediaRecorder.cpp:
        * GPUProcess/webrtc/RemoteMediaRecorder.h:
        * GPUProcess/webrtc/RemoteMediaRecorder.messages.in:
        * GPUProcess/webrtc/RemoteMediaRecorderManager.cpp:
        * GPUProcess/webrtc/RemoteMediaRecorderManager.h:
        * GPUProcess/webrtc/RemoteMediaRecorderManager.messages.in:
        * GPUProcess/webrtc/RemoteSampleBufferDisplayLayerManager.h:
        * WebProcess/GPU/webrtc/MediaRecorderPrivate.cpp:
        * WebProcess/GPU/webrtc/MediaRecorderPrivate.h:
        * WebProcess/GPU/webrtc/MediaRecorderProvider.cpp:
        (WebKit::MediaRecorderProvider::createMediaRecorderPrivate):

2020-02-06  youenn fablet  <youenn@apple.com>

        ServiceWorkerProvider::registerServiceWorkerClients is no longer needed
        https://bugs.webkit.org/show_bug.cgi?id=207193

        Reviewed by Chris Dumez.

        Remove the request from WebProcessPool to register all service worker clients at launch of the first service worker process.
        This is no longer needed and does not scale since our service workers are launched in different processes nowadays.

        In case network process crashes, WebProcess will need to reregister their service worker clients.
        This is lazily done when WebProcess tries to reconnect to the Network Process.

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::ensureNetworkProcessConnection):
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:

2020-02-05  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] Provide a way to suppress software keyboards on WKWebView's WKContentView
        https://bugs.webkit.org/show_bug.cgi?id=207272
        <rdar://problem/59190828>

        Reviewed by Tim Horton.

        Allow SPI clients to suppress the software keyboard using -_setSuppressSoftwareKeyboard: on WKWebView by
        propagating the call to the WKContentView, which is the view that actually becomes first responder when an
        element (e.g. a form control) is focused.

        Test: KeyboardInputTests.SuppressSoftwareKeyboard

        * Platform/spi/ios/UIKitSPI.h:
        * UIProcess/API/ios/WKWebViewIOS.mm:
        (-[WKWebView _setSuppressSoftwareKeyboard:]):

2020-02-05  Don Olmstead  <don.olmstead@sony.com>

        [PlayStation] Miscellaneous build fixes February 2020 edition
        https://bugs.webkit.org/show_bug.cgi?id=207312

        Unreviewed build fix.

        * NetworkProcess/NetworkDataTaskBlob.cpp: Add missing include.
        * UIProcess/Downloads/DownloadProxyMap.h: Add missing forward declaration.

2020-02-05  Jer Noble  <jer.noble@apple.com>

        Adopt MTOverrideShouldPlayHDRVideo()
        https://bugs.webkit.org/show_bug.cgi?id=207275
        <rdar://problem/58837093>

        Reviewed by Eric Carlson.

        The WebProcess sandbox can block access to the services necessary for MediaToolbox to determine whether
        the current display is capable of displaying HDR. Rather than opening up the sandbox, provide the information
        gathered by the UIProcess by way of MTOverrideShouldPlayHDRVideo().

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::windowScreenDidChange):
        (WebKit::WebPage::displayID const):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::setScreenProperties): Deleted.
        * WebProcess/WebProcess.h:
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::setScreenProperties):
        (WebKit::WebProcess::updatePageScreenProperties):

2020-02-05  Wenson Hsieh  <wenson_hsieh@apple.com>

        [macCatalyst] Incorrect IBeam cursor when selecting text on Wikipedia
        https://bugs.webkit.org/show_bug.cgi?id=207299
        <rdar://problem/59200545>

        Reviewed by Tim Horton.

        After r255827, if EventHandler selects an IBeam cursor at the position information request location, we will
        always attempt to show a caret at that location, whose height is the height of the editing caret for that
        visible position. However, this means that:

        -   It's possible for the caret to be incorrectly sized if the caret is before a large replaced element, such as
            a table. Since the request location is also outside of any line rect, it doesn't make sense to use the caret
            height for the height of the cursor. Instead, fall back to computed line height. This fixes an issue on
            en.wikipedia.org where the line rect would sometimes update to an enormous size when selecting text, since
            the caret would temporarily hover over an editing position that is before a large table.

        -   This fallback path completely negates certain cursor behaviors; partially restore this behavior by making it
            so that in the case where the cursor is in editable content and the line caret first line from the top of
            the hit-tested node already contains the request point, don't bother trying to recenter the line rect to be
            right over the request point.

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::populateCaretContext):

2020-02-05  Chris Dumez  <cdumez@apple.com>

        Regression(r248734) StorageAreaMap objects are getting leaked
        https://bugs.webkit.org/show_bug.cgi?id=207073
        <rdar://problem/59168065>

        Reviewed by Darin Adler.

        Make sure that StorageAreaMap objects are getting removed from the HashMap
        in StorageNamespaceImpl, once they no longer have any users.

        * WebProcess/WebStorage/StorageAreaImpl.cpp:
        (WebKit::StorageAreaImpl::StorageAreaImpl):
        (WebKit::StorageAreaImpl::~StorageAreaImpl):
        * WebProcess/WebStorage/StorageAreaMap.cpp:
        (WebKit::StorageAreaMap::incrementUseCount):
        (WebKit::StorageAreaMap::decrementUseCount):
        * WebProcess/WebStorage/StorageAreaMap.h:
        * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
        (WebKit::StorageNamespaceImpl::destroyStorageAreaMap):
        (WebKit::StorageNamespaceImpl::didDestroyStorageAreaMap): Deleted.
        * WebProcess/WebStorage/StorageNamespaceImpl.h:
        (WebKit::StorageNamespaceImpl::storageType const): Deleted.
        (WebKit::StorageNamespaceImpl::storageNamespaceID const): Deleted.
        (WebKit::StorageNamespaceImpl::topLevelOrigin const): Deleted.
        (WebKit::StorageNamespaceImpl::quotaInBytes const): Deleted.

2020-02-05  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Do not create sandbox reports when the UI process cannot issue extensions to diagnostics service
        https://bugs.webkit.org/show_bug.cgi?id=207279
        <rdar://problem/59030957>
        
        Reviewed by Brent Fulgham.

        Do not create sandbox reports when the UI process cannot issue mach extensions to the diagnostics service.
        The majority of clients are capable of doing this.

        No new tests, since it is not trivial to test if no sandbox reports are generated for a violation.

        * Shared/Cocoa/SandboxExtensionCocoa.mm:
        (WebKit::SandboxExtensionImpl::create):
        (WebKit::SandboxExtensionImpl::sandboxExtensionForType):
        (WebKit::SandboxExtensionImpl::SandboxExtensionImpl):
        (WebKit::SandboxExtension::createHandleForMachLookup):
        * Shared/SandboxExtension.h:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):

2020-02-05  Chris Dumez  <cdumez@apple.com>

        [IPC hardening] Protect against bad identifier in CacheStorageEngineConnection::reference() / dereference()
        https://bugs.webkit.org/show_bug.cgi?id=207302
        <rdar://problem/59016099>

        Reviewed by Alex Christensen.

        * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
        (WebKit::CacheStorageEngineConnection::reference):
        (WebKit::CacheStorageEngineConnection::dereference):

2020-02-05  Chris Dumez  <cdumez@apple.com>

        [IPC hardening] Protect against bad parameters in NetworkRTCProvider::createResolver()
        https://bugs.webkit.org/show_bug.cgi?id=207301
        <rdar://problem/59011449>

        Reviewed by Alex Christensen.

        * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
        (WebKit::NetworkRTCProvider::createResolver):

2020-02-05  Patrick Griffis  <pgriffis@igalia.com>

        [GTK][WPE] Add more fontconfig paths into the sandbox
        https://bugs.webkit.org/show_bug.cgi?id=207293

        Reviewed by Michael Catanzaro.

        These paths were reported to be used on Debian.

        * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
        (WebKit::bindFonts):

2020-02-05  Chris Dumez  <cdumez@apple.com>

        [IPC hardening] Protect against bad originIdentifier String in WebPageProxy::reachedApplicationCacheOriginQuota() / requestGeolocationPermissionForFrame()
        https://bugs.webkit.org/show_bug.cgi?id=207292
        <rdar://problem/58345601>

        Reviewed by David Kilzer.

        * UIProcess/WebPageProxy.cpp:

2020-02-05  Jiewen Tan  <jiewen_tan@apple.com>

        Defer ending AppSSO sheets til NSWindowDidDeminiaturize or NSApplicationDidUnhide
        https://bugs.webkit.org/show_bug.cgi?id=207173
        <rdar://problem/55669065>

        Reviewed by Brent Fulgham.

        AppKit has a bug that [m_sheetWindow sheetParent] is null if the parent is minimized or the host app is hidden.
        SheetParent is used to endSheet. Therefore, WebKit cannot dismiss AppSSO UIs in the above two cases if asked
        by extensions.

        This patch implements a workaround to detect those two cases and defer the endSheet til NSWindowDidDeminiaturize
        or NSApplicationDidUnhide is received.

        Covered by API tests.

        * UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.h:
        * UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm:
        (WebKit::SOAuthorizationSession::dismissViewController):
        * UIProcess/Cocoa/SOAuthorization/SubFrameSOAuthorizationSession.mm:
        (WebKit::SubFrameSOAuthorizationSession::abortInternal):
        Treat abort like falling back to the web path for sub frame case given displaying an empty
        iframe after aborting seems bad.

2020-02-05  Chris Dumez  <cdumez@apple.com>

        [IPC Hardening] Protect against targetId String being invalid in WebPageProxy::createInspectorTarget() / destroyInspectorTarget()
        https://bugs.webkit.org/show_bug.cgi?id=207288
        <rdar://problem/57645953>

        Reviewed by Geoffrey Garen.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::createInspectorTarget):
        (WebKit::WebPageProxy::destroyInspectorTarget):

2020-02-05  Chris Dumez  <cdumez@apple.com>

        [IPC hardening] Protect against m_inspectorPage being null inWebInspectorProxy::attach()
        https://bugs.webkit.org/show_bug.cgi?id=207289
        <rdar://problem/58419789>

        Reviewed by David Kilzer.

        * UIProcess/Inspector/WebInspectorProxy.cpp:
        (WebKit::WebInspectorProxy::attach):

2020-02-05  Chris Dumez  <cdumez@apple.com>

        [IPC Hardening] Protect against m_inspectorPage being null in WebInspectorProxy::detach()
        https://bugs.webkit.org/show_bug.cgi?id=207286
        <rdar://problem/55422296>

        Reviewed by David Kilzer.

        * UIProcess/Inspector/WebInspectorProxy.cpp:
        (WebKit::WebInspectorProxy::detach):

2020-02-05  Brent Fulgham  <bfulgham@apple.com>

        Update sandbox to allow communication with dnssd service
        https://bugs.webkit.org/show_bug.cgi?id=207276
        <rdar://problem/59158405>

        Reviewed by Per Arne Vollan.

        Testing and telemetry indicates that we need access to the DNSSD mach service in our Network Process

        * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
        * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:

2020-02-05  Chris Dumez  <cdumez@apple.com>

        [IPC Hardening] Protect against null String under WebInspectorProxy::save() / WebInspectorProxy::append()
        https://bugs.webkit.org/show_bug.cgi?id=207284
        <rdar://problem/55271616>

        Reviewed by David Kilzer.

        * UIProcess/Inspector/WebInspectorProxy.cpp:
        (WebKit::WebInspectorProxy::save):
        (WebKit::WebInspectorProxy::append):

2020-02-05  Chris Dumez  <cdumez@apple.com>

        [IPC Hardening] Protect against m_inspectorPage being null in WebInspectorProxy::setAttachedWindowHeight() / setAttachedWindowWidth()
        https://bugs.webkit.org/show_bug.cgi?id=207287
        <rdar://problem/55422919>

        Reviewed by Geoffrey Garen.

        * UIProcess/Inspector/WebInspectorProxy.cpp:
        (WebKit::WebInspectorProxy::setAttachedWindowHeight):
        (WebKit::WebInspectorProxy::setAttachedWindowWidth):

2020-02-05  Chris Dumez  <cdumez@apple.com>

        [IPC Hardening] Protect against m_inspectedPage / m_inspectorPage being null in WebInspectorProxy::resetState()
        https://bugs.webkit.org/show_bug.cgi?id=207285
        <rdar://problem/55420035>

        Reviewed by David Kilzer.

        * UIProcess/Inspector/WebInspectorProxy.cpp:
        (WebKit::WebInspectorProxy::resetState):

2020-02-05  Chris Dumez  <cdumez@apple.com>

        [IPC Hardening] Protect against bad RegistrableDomain under WebProcessProxy::didCollectPrewarmInformation()
        https://bugs.webkit.org/show_bug.cgi?id=207281
        <rdar://problem/55318108>

        Reviewed by Geoffrey Garen.

        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::didCollectPrewarmInformation):

2020-02-05  Chris Dumez  <cdumez@apple.com>

        [IPC Hardening] Protect against bad ClientOrigin under Engine::readCachesFromDisk()
        https://bugs.webkit.org/show_bug.cgi?id=207280
        <rdar://problem/59013832>

        Reviewed by Geoffrey Garen.

        Protect against bad ClientOrigin under Engine::readCachesFromDisk(), as it is coming from
        IPC from the WebContent process.

        * NetworkProcess/cache/CacheStorageEngine.cpp:
        (WebKit::CacheStorage::Engine::readCachesFromDisk):

2020-02-05  Alex Christensen  <achristensen@webkit.org>

        Make WKWebView._negotiatedLegacyTLS accurate when loading main resouorce from network or cache
        https://bugs.webkit.org/show_bug.cgi?id=207207

        Reviewed by Chris Dumez.

        In PageLoadState::didCommitLoad, I was resetting the value of _negotiatedLegacyTLS to false.
        That created a race condition when loading the main resource because the NetworkProcess would
        message the UIProcess setting _negotiatedLegacyTLS to false, while the NetworkProcess would
        message the WebProcess which would message the UIProcess to call PageLoadState::didCommitLoad
        which would reset it to false.  Now it resets it to the correct value, whatever it is.

        Updating the ResourceResponseBase serialization code has the desirable side effect that the disk
        cache will remember whether legacy TLS was used to fetch each resource.  This will make it so
        _negotiatedLegacyTLS is true if we read content from the disk cache that was originally fetched
        using legacy TLS.

        In order to not increase the memory footprint of ResourceResponse, I changed m_httpStatusCode from
        an int to a short.  It just needs to be able to cover the values 0-600 or so, which really only needs 10 bits.

        Covered by new API tests.

        * NetworkProcess/NetworkCORSPreflightChecker.cpp:
        (WebKit::NetworkCORSPreflightChecker::didReceiveResponse):
        * NetworkProcess/NetworkCORSPreflightChecker.h:
        * NetworkProcess/NetworkDataTask.cpp:
        (WebKit::NetworkDataTask::didReceiveResponse):
        (WebKit::NetworkDataTask::negotiatedLegacyTLS const): Deleted.
        * NetworkProcess/NetworkDataTask.h:
        (WebKit::NetworkDataTaskClient::negotiatedLegacyTLS const): Deleted.
        * NetworkProcess/NetworkDataTaskBlob.cpp:
        (WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse):
        * NetworkProcess/NetworkLoad.cpp:
        (WebKit::NetworkLoad::didReceiveResponse):
        (WebKit::NetworkLoad::notifyDidReceiveResponse):
        (WebKit::NetworkLoad::throttleDelayCompleted):
        (WebKit::NetworkLoad::negotiatedLegacyTLS const): Deleted.
        * NetworkProcess/NetworkLoad.h:
        * NetworkProcess/NetworkResourceLoader.h:
        * NetworkProcess/PingLoad.cpp:
        (WebKit::PingLoad::didReceiveResponse):
        * NetworkProcess/PingLoad.h:
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        (WebKit::NetworkDataTaskCocoa::didReceiveResponse):
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
        * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
        (WebKit::NetworkDataTaskCurl::invokeDidReceiveResponse):
        * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
        (WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse):
        * UIProcess/PageLoadState.cpp:
        (WebKit::PageLoadState::didCommitLoad):
        * UIProcess/PageLoadState.h:
        * UIProcess/ProvisionalPageProxy.cpp:
        (WebKit::ProvisionalPageProxy::didCommitLoadForFrame):
        * UIProcess/ProvisionalPageProxy.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::commitProvisionalPage):
        (WebKit::WebPageProxy::didCommitLoadForFrame):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):

2020-02-05  Brady Eidson  <beidson@apple.com>

        _WKDownload should expose the originating FrameInfo.
        <rdar://problem/58022576> and https://bugs.webkit.org/show_bug.cgi?id=207185

        Reviewed by Geoff Garen.

        Covered by new API test.
        
        For the cases wh