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 where a navigation is converted into a download, include the relevant
        WKFrameInfo on the _WKDownload object.

        * UIProcess/API/APIFrameInfo.h:
        * UIProcess/API/Cocoa/_WKDownload.h:
        * UIProcess/API/Cocoa/_WKDownload.mm:
        (-[_WKDownload originatingFrameInfo]):
        * UIProcess/Downloads/DownloadProxy.cpp:
        (WebKit::generateDownloadID):
        (WebKit::DownloadProxy::DownloadProxy):
        (WebKit::DownloadProxy::create): Deleted.
        (WebKit::DownloadProxy::setOriginatingPage): Deleted.
        * UIProcess/Downloads/DownloadProxy.h:
        (WebKit::DownloadProxy::create):
        (WebKit::DownloadProxy::frameInfo):
        * UIProcess/Downloads/DownloadProxyMap.cpp:
        (WebKit::DownloadProxyMap::createDownloadProxy):
        * UIProcess/Downloads/DownloadProxyMap.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::createDownloadProxy):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::receivedPolicyDecision):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::download):
        (WebKit::WebProcessPool::resumeDownload):
        (WebKit::WebProcessPool::createDownloadProxy):
        * UIProcess/WebProcessPool.h:

2020-02-05  Wenson Hsieh  <wenson_hsieh@apple.com>

        [macCatalyst] IBeam cursor doesn't show up when hovering over text form controls prior to editing
        https://bugs.webkit.org/show_bug.cgi?id=207268
        <rdar://problem/59188152>

        Reviewed by Tim Horton.

        On macCatalyst, when hovering over textareas and input fields that have not been edited yet, the cursor fails to
        change to an IBeam and instead falls back to the default style. Even though `EventHandler::selectCursor()`
        returns `IBeam`, we end up not actually using an IBeam because the position information's `lineCaretExtent` is
        an empty rect, which means the caret height is 0 and, more importantly, the line rect will not contain the
        request point.

        The line rect is empty in text fields that have not been edited yet because the form control's inner plaintext
        contenteditable div (embedded in the shadow root) does not contain any child renderers with a non-zero height.
        Even if it did, however, the element may still be much taller than the combined height of the inner div's
        children, so the line rect may still not contain the position information request point (this is most easily
        noticeable when focusing a textarea, typing a few letters, and then moving the cursor to near the bottom of the
        textarea element).

        To fix this, add a fallback path for the scenario where we want to show an IBeam, but fail to find line rects
        that contain the request point. Instead, we still show an IBeam, but simply fake the lineCaretExtent to be an
        element-wide rect that is the height of the caret, and is also vertically centered about the request point.

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

2020-02-05  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r255818.
        https://bugs.webkit.org/show_bug.cgi?id=207270

        It is breaking some Mac builds (Requested by youenn on
        #webkit).

        Reverted changeset:

        "[Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder"
        https://bugs.webkit.org/show_bug.cgi?id=206582
        https://trac.webkit.org/changeset/255818

2020-02-05  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-05  Chris Dumez  <cdumez@apple.com>

        Unreviewed, rolling out r255706.

        Caused assertions in API tests

        Reverted changeset:

        "Partial revert of r248734 to fix leak of StorageAreaMaps"
        https://bugs.webkit.org/show_bug.cgi?id=207073
        https://trac.webkit.org/changeset/255706

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

        Unreviewed, follow-up assertion fix after r255662.

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

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

        REGRESSION (r251320): Can't double tap to select word in Notes on iCloud.com
        https://bugs.webkit.org/show_bug.cgi?id=207239
        <rdar://problem/58686015>

        Reviewed by Tim Horton.

        Following r251320, all synthetic mouse events on iOS additionally dispatched corresponding pointer events. This
        led to duplicate "pointerdown"/"pointerup" events dispatched with every tap. r253878 fixed this by avoiding
        pointer event dispatch for synthetically generated mouse events (and made this determination by consulting
        `syntheticClickType()`).

        However, in the case where we're synthesizing a mouse event for a "dblclick" event handler (after a double-
        tap), we currently pass `NoTap` as the synthetic click event type when creating the mouse event. This causes
        additional pointer events to be synthesized and dispatched during a double tap, which creates three pairs of
        "pointerdown"/"pointerup" events upon double-tap. This subsequently confuses iCloud Notes' web app when double
        tapping to select a word.

        Fix this by passing in `OneFingerTap` as the synthetic click type instead (since two-finger double taps should
        already be handled by the two-finger double-tap magnification gesture).

        Test: pointerevents/ios/pointer-events-for-double-tap.html

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

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

        Replace RGBA32 typedef with a class to improve type safety
        https://bugs.webkit.org/show_bug.cgi?id=206862

        Reviewed by Sam Weinig.

        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<Color>::encode): Use uint32_t explicitly to convert
        the color value into a SimpleColor.
        (IPC::ArgumentCoder<Color>::decode): Same thing, only the other direction.

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

        Remove NSKeyedArchiverSPI.h now that WebKit only uses API
        https://bugs.webkit.org/show_bug.cgi?id=207203

        Reviewed by Anders Carlsson.

        * Platform/ios/AccessibilityIOS.mm:
        (WebKit::newAccessibilityRemoteToken): Removed include of NSKeyedArchiverSPI.h;
        use NSKeyedArchiver methods directly.
        * Shared/Cocoa/ArgumentCodersCocoa.mm:
        (IPC::encodeSecureCodingInternal): Ditto.
        (IPC::decodeSecureCodingInternal): Ditto.

        * Shared/Cocoa/DataDetectionResult.mm: Removed include of NSKeyedArchiverSPI.h.
        * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: Ditto.
        * Shared/ios/InteractionInformationAtPosition.mm: Ditto.

        * Shared/mac/WebCoreArgumentCodersMac.mm:
        (IPC::ArgumentCoder<WebCore::ContentFilterUnblockHandler>::encode): Removed
        include of NSKeyedArchiverSPI.h; use NSKeyedArchiver methods directly.
        (IPC::ArgumentCoder<WebCore::ContentFilterUnblockHandler>::decode): Ditto.

        * Shared/mac/WebHitTestResultData.mm: Removed include of NSKeyedArchiverSPI.h.

        * UIProcess/API/Cocoa/APIAttachmentCocoa.mm:
        (API::Attachment::createSerializedRepresentation const): Removed
        include of NSKeyedArchiverSPI.h; use NSKeyedArchiver methods directly. Also
        refactored so the !CAN_SECURELY_ARCHIVE_FILE_WRAPPER path shares more code
        with the modern code path. I think we can remove it entirely once we bump
        the minimum version of macOS a bit more.
        (API::Attachment::updateFromSerializedRepresentation): Ditto.
        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _setObject:forBundleParameter:]): Ditto.
        (-[WKProcessPool _setObjectsForBundleParametersWithDictionary:]): Ditto.
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView initWithCoder:]): Ditto.
        (-[WKWebView _setInputDelegate:]): Ditto.
        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
        (-[WKWebViewConfiguration initWithCoder:]): Ditto.
        * UIProcess/API/Cocoa/_WKApplicationManifest.mm:
        (-[_WKApplicationManifest initWithCoder:]): Ditto.
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess): Ditto.
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::elementDidFocus): Ditto.
        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
        (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): Ditto.
        * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm: Removed include of NSKeyedArchiverSPI.h
        (WebKit::createUnarchiver): Added helper function to make the code below less repetitive.
        (WebKit::InjectedBundle::initialize): Use the createUnarchiver function above and the
        NSKeyedArchiver methods directly.
        (WebKit::InjectedBundle::classesForCoder): Ditto.
        (WebKit::InjectedBundle::setBundleParameter): Ditto.
        (WebKit::InjectedBundle::setBundleParameters): Ditto.

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

        macCatalyst: Shouldn't get text cursor on checkboxes
        https://bugs.webkit.org/show_bug.cgi?id=207234
        <rdar://problem/59155917>

        Reviewed by Wenson Hsieh.

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::canForceCaretForPosition):
        (WebKit::populateCaretContext):
        (WebKit::lineCaretExtent): Deleted.
        The I-beam forcing code was a bit too aggressive; it should consider
        the style of the node that it ends up finding after searching, not just
        assume it wants an I-beam because it's "texty".

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

        Fix Mac CMake build
        https://bugs.webkit.org/show_bug.cgi?id=207231

        * PlatformMac.cmake:
        * WebProcess/WebPage/mac/WebPageMac.mm:
        (WebKit::WebPage::updateVisibleContentRects):

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

        Partial revert of r248734 to fix leak of StorageAreaMaps
        https://bugs.webkit.org/show_bug.cgi?id=207073

        Reviewed by Alex Christensen.

        Do a partial revert of r248734 so that the StorageNamespaceImpl no longer holds a strong
        reference to its StorageAreaMap objects. The code for removing entries from 
        StorageNamespaceImpl::m_storageAreaMaps (StorageNamespaceImpl::didDestroyStorageAreaMap())
        was dead code after r248734 and thus StorageAreaMap were never destroyed.

        * WebProcess/WebStorage/StorageAreaImpl.cpp:
        (WebKit::StorageAreaImpl::create):
        (WebKit::StorageAreaImpl::StorageAreaImpl):
        (WebKit::StorageAreaImpl::length):
        (WebKit::StorageAreaImpl::key):
        (WebKit::StorageAreaImpl::item):
        (WebKit::StorageAreaImpl::setItem):
        (WebKit::StorageAreaImpl::removeItem):
        (WebKit::StorageAreaImpl::clear):
        (WebKit::StorageAreaImpl::contains):
        (WebKit::StorageAreaImpl::storageType const):
        * WebProcess/WebStorage/StorageAreaImpl.h:
        * WebProcess/WebStorage/StorageAreaMap.cpp:
        (WebKit::StorageAreaMap::create):
        (WebKit::StorageAreaMap::~StorageAreaMap):
        * WebProcess/WebStorage/StorageAreaMap.h:
        * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
        (WebKit::StorageNamespaceImpl::storageArea):
        * WebProcess/WebStorage/StorageNamespaceImpl.h:

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

        Unreviewed, follow-up assertion fix after r255662.

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

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

        [macCatalyst] Missing custom cursors in subframes that are offset from the origin of the root view
        https://bugs.webkit.org/show_bug.cgi?id=207215
        <rdar://problem/59157625>

        Reviewed by Tim Horton.

        <https://trac.webkit.org/r255046> added support for custom cursor styles when hovering over subframes. However,
        we currently try to hit-test content in the subframe using the interaction information request's point, which is
        in root view coordinates; as such, we only get the correct custom cursor styles when hovering over elements in a
        subframe, if the subframe is also at the origin of the root view.

        To fix this, simply convert from root view coordinates to frame coordinates when performing the hit-test.
        Unfortunately, this change is currently untestable; see <rdar://problem/59158410>.

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

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

        Fixed Deprecated API
        https://bugs.webkit.org/show_bug.cgi?id=207179

        Reviewed by Tim Horton.

        Fixing deprecated API for MacCatalyst.

        No new tests - build fix.

        * Shared/UserInterfaceIdiom.mm:
        (WebKit::userInterfaceIdiomIsPad):

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

        [PlayStation] Add WebKit API files
        https://bugs.webkit.org/show_bug.cgi?id=207168

        Reviewed by Darin Adler.

        Add PlayStation WebKit API files and expose them in the root header. Fix up the
        build to copy them over. Also make sure that the playstation directory is listed
        as a platform in the forwarding headers script.

        * PlatformPlayStation.cmake:
        * Scripts/generate-forwarding-headers.pl:
        * Shared/API/c/WKBase.h:
        * Shared/API/c/playstation/WKBasePlayStation.h: Added.
        * UIProcess/API/C/WKAPICast.h:
        * UIProcess/API/C/playstation/WKAPICastPlayStation.h: Added.
        * UIProcess/API/C/playstation/WKView.h: Added.

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

        NetworkProcess should be notified by UIProcess when its service worker process connection should be on
        https://bugs.webkit.org/show_bug.cgi?id=207122
        <rdar://problem/59089780>

        Reviewed by Chris Dumez.

        Add completion handlers to the messaging from NetworkProcess -> UIProcess -> WebProcess -> NetworkProcess
        used to create a service worker context connection.

        This allows NetworkProcess to ask again for a connection if the connection is still needed but NetworkProcess did not find the context connection.

        This is difficult to test since we would need for the process selected to host service workers to exit between the
        time it is selected and the time it sends the message to Networking process.

        To ensure that the context connection is created by WebProcess, WebProcessProxy takes a background assertion until WebProcess finishes
        creating the context connection to Network process.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::establishSWContextConnection):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::swServerForSession):
        * NetworkProcess/NetworkProcess.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::establishWorkerContextConnectionToNetworkProcess):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/Network/NetworkProcessProxy.messages.in:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::establishServiceWorkerContext):
        * UIProcess/WebProcessProxy.h:
        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        (WebKit::m_userAgent):
        (WebKit::WebSWContextManagerConnection::establishConnection):
        * WebProcess/Storage/WebSWContextManagerConnection.h:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::establishWorkerContextConnectionToNetworkProcess):
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:

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

        Unreviewed, follow-up assertion fix after r255662.

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

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

        REGRESSION(r255595): page not closed after beforeunload handler returns true
        https://bugs.webkit.org/show_bug.cgi?id=207189

        Reviewed by Chris Dumez.

        We are assuming the try close did timeout in that case, because the timer is stopped before running the
        beforeunload dialog.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel): Start the try close timer again when the beforeunload
        dialog replies.

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

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

        Reviewed by Konstantin Tokarev.

        * PlatformGTK.cmake:
        * PlatformWPE.cmake:
        * PlatformWin.cmake:

2020-02-04  Fujii Hironori  <Hironori.Fujii@sony.com>

        [Win][Clang] WebProcessMain.h(28,14): error: token is not a valid binary operator in a preprocessor subexpression
        https://bugs.webkit.org/show_bug.cgi?id=207188

        Unreviewed build fix for WinCairo port.

        * NetworkProcess/EntryPoint/win/NetworkProcessMain.cpp:
        * WebProcess/EntryPoint/win/WebProcessMain.cpp:
        Added #include "config.h".

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

        Add a WebKitAdditions hook to provide additional customizations to UIDragInteraction
        https://bugs.webkit.org/show_bug.cgi?id=207177
        <rdar://problem/59121266>

        Reviewed by Tim Horton.

        Add a WebKitAdditions extension point that runs immediately after setting up UIDragInteraction and
        UIDropInteraction.

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

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

        Stop relying on ResponsivenessTimer to keep the WebProcess from suspending during initialization
        https://bugs.webkit.org/show_bug.cgi?id=207144

        Reviewed by Brady Eidson.

        Stop relying on ResponsivenessTimer to keep the WebProcess from suspending during initialization. Instead, make the
        WebProcess::InitializeWebProcess IPC async with a reply and take a process assertion on behalf of the WebContent
        process until we get a response back.

        This avoids sending an extra WebProcess::MainThreadPing IPC to the WebProcess for no reason (since we're already
        sending the WebProcess::InitializeWebProcess IPC) and this is also more reliable since the ResponsivenessTimer can
        actually time out and cause the process to get suspended during initialization still.

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::initializeNewWebProcess):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::initializeWebProcess):
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:

2020-02-03  Jiewen Tan  <jiewen_tan@apple.com>

        Pass a hint from the extension to decidePolicyForSOAuthorizationLoadWithCurrentPolicy
        https://bugs.webkit.org/show_bug.cgi?id=207079
        <rdar://problem/48290464>

        Reviewed by Brent Fulgham.

        Pass a localized human readable hint from the extension to decidePolicyForSOAuthorizationLoadWithCurrentPolicy,
        such that clients can display it to tell users what the extension is trying to do. Hints could be something
        like "Sign In With Apple".

        Covered new test contents within existing tests.

        * UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.h:
        * UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm:
        (WebKit::SOAuthorizationSession::start):
        (WebKit::SOAuthorizationSession::continueStartAfterGetAuthorizationHints):
        (WebKit::SOAuthorizationSession::continueStartAfterDecidePolicy):

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

        Unreviewed, fix the internal build after <rdar://problem/59132944>

        * UIProcess/ios/WKContentViewInteraction.h: Declare this helper in the header, now that it's consulted by some
        WebKitAdditions code.

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

        Add a WebKitAdditions hook to override the behavior of -[WKContentView gestureRecognizer:shouldReceiveTouch:]
        https://bugs.webkit.org/show_bug.cgi?id=207162
        <rdar://problem/59129739>

        Reviewed by Tim Horton.

        Allow an internal implementation of `-_allowGestureRecognizer:toReceiveTouch:` to prevent touches from being
        routed to certain gesture recognizers, if necessary.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView gestureRecognizer:shouldReceiveTouch:]):

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

        [WK2] Use per-UIProcess default cookie storage for Mac Catalyst apps
        https://bugs.webkit.org/show_bug.cgi?id=207139
        <rdar://problem/59047014>

        Reviewed by Brent Fulgham.

        Use per-UIProcess default cookie storage for Mac Catalyst apps, similarly to what
        we do for regular macOS apps.

        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
        (WebKit::NetworkProcessCreationParameters::decode):
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeNetworkProcess):

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

        [iOS 13] Dragging on-screen volume control on a YouTube video selects text around the panel
        https://bugs.webkit.org/show_bug.cgi?id=207140
        <rdar://problem/58852938>

        Reviewed by Tim Horton.

        This bug occurs on iPadOS when long pressing the volume controls on the desktop version of YouTube, and then
        performing a pan gesture; this activates the highlight text selection gesture recognizer added in iOS 13,
        causing text to be selected while adjusting the volume using these custom controls. On macOS, we avoid this
        because `Node::canStartSelection()` returns `false`, due to a container node having both `user-drag: element`
        and `user-select: none`; in this scenario, we allow dragging to take precendence over text selection, so the
        volume slider can be moved using a mouse without simultaneously selecting text.

        This logic is currently absent on iOS, where UIKit text interaction gesture recognizers ask us for information
        about the DOM at given locations, and we determine whether to allow text interaction gestures (such as long
        pressing) to begin in `-textInteractionGesture:shouldBeginAtPoint:` and `-hasSelectablePositionAtPoint:`.
        Ideally, we'd want to eventually unify these two codepaths for triggering text selection (and preferably just
        have both go through EventHandler); in lieu of this, simply make the iOS codepath behave a little more like
        macOS by adding a bit to allow text interaction gestures to bail in the case where at least one container of the
        hit-tested element is both draggable and unselectable.

        Test: editing/selection/ios/prefer-drag-over-text-selection.html

        * Shared/ios/InteractionInformationAtPosition.h:
        * Shared/ios/InteractionInformationAtPosition.mm:
        (WebKit::InteractionInformationAtPosition::encode const):
        (WebKit::InteractionInformationAtPosition::decode):

        Add the new bit to InteractionInformationAtPosition.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):

        Avoid beginning text selection if the bit is set.

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

        Move a comment about the ">= 97% of the document's visible area" heuristic next to the relevant code, and also
        leave a FIXME mentioning that we should reconsider whether this is really needed; it seems that this was
        originally intended to avoid ending up with an excessively large block selection, but block selection has been
        removed entirely since iOS 12. That said, this logic may still be helping avoid situations where the text
        selection is too aggressive on iOS and ends up selecting too much text.

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

        Regression(r253224) WKUIDelegate.webViewDidClose may get called twice after calling _tryClose on the WKWebView
        https://bugs.webkit.org/show_bug.cgi?id=207121
        <rdar://problem/58880177>

        Reviewed by Alex Christensen.

        WKUIDelegate.webViewDidClose may get called twice after calling _tryClose on the WKWebView, in case we time out
        while waiting for an answer from the WebProcess but the WebProcess eventually responds.

        Change is covered by new API test.

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

2020-02-03  Eric Carlson  <eric.carlson@apple.com>

        [macOS] AirPlay sometimes stops after 60 minutes of playback
        https://bugs.webkit.org/show_bug.cgi?id=207056

        Reviewed by Jer Noble.

        * UIProcess/WebPageProxy.cpp:
        * UIProcess/WebPageProxy.h:

2020-02-03  Sam Weinig  <weinig@apple.com>

        Start splitting platform specific overrides of default enable behavior into their own files
        https://bugs.webkit.org/show_bug.cgi?id=207105

        Reviewed by Dean Jackson.

        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::shouldPlugInAutoStartFromOrigin):
        Switch to using the ENABLE() helper macro to correctly guard against the case that
        ENABLE_PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC is defined and equal to 0.

2020-02-03  Keith Rollin  <krollin@apple.com>

        Unreviewed watchOS build fix after r255559- add missing semi-colon.

        * UIProcess/ios/forms/WKFocusedFormControlView.mm:
        (-[WKFocusedFormControlView scrollOffsetForCrownInputOffset:]):

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

        Use std::hypot() where possible
        https://bugs.webkit.org/show_bug.cgi?id=198483

        Reviewed by Carlos Garcia Campos.

        Use std::hypot() where possible, allowing for a possibly more precise
        calculation of square roots of sums of two or three square values.

        * Platform/classifier/ResourceLoadStatisticsClassifier.cpp:
        (WebKit::vectorLength):
        * UIProcess/ios/forms/WKFocusedFormControlView.mm:
        (-[WKFocusedFormControlView scrollOffsetForCrownInputOffset:]):

2020-02-01  Michael Catanzaro  <mcatanzaro@gnome.org>

        Silence compiler warnings
        https://bugs.webkit.org/show_bug.cgi?id=207015

        Reviewed by Darin Adler.

        Use UNUSED_VARIABLE() for variable that is only used inside RELEASE_LOG(), which is
        Apple-specific.

        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::didFailLoading):

2020-02-01  Devin Rousso  <drousso@apple.com>

        Web Inspector: move the items in the toolbar into the tab bar to save vertical space
        https://bugs.webkit.org/show_bug.cgi?id=204627

        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-01-31  David Quesada  <david_quesada@apple.com>

        REGRESSION(r252185): NetworkSessionCocoa cancels downloads that receive authentication challenges
        https://bugs.webkit.org/show_bug.cgi?id=206984
        rdar://problem/58999654

        Reviewed by Brady Eidson.

        r252185 changed the early return in WKNetworkSessionDelegate's -...task:didReceiveChallenge:... method
        from "cancel the task and return early if self has no _session" to "cancel the task and return early
        if we can't determine the network session for the given data task". When this method is called for
        an NSURLSessionDownloadTask, this early return is hit because there is no NetworkDataTaskCocoa
        for an active download. As a result, the download is canceled when it might have otherwise been able
        to proceed.

        Fix this by adding a code path to fetch the NetworkSession associated with the Download when an
        NSURLSessionDownloadTask receives an authentication challenge. This ensures we can actually handle
        the challenge appropriately and not just cancel the task.

        * NetworkProcess/Downloads/Download.h:
        (WebKit::Download::sessionID const):
            Expose the session ID so we can use it to look up the NetworkSession for a Download.
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
            Remove an unnecessary redeclaration of networkDataTask, and also an unneeded assertion that
            networkDataTask != nullptr. Even if this is the case, the code that eventually handles this
            task will null check it and handle the challenge as a websocket task or download task
            based on the taskIdentifier.

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

        Add support for specifying background colors when setting marked text
        https://bugs.webkit.org/show_bug.cgi?id=207065
        <rdar://problem/57876140>

        Reviewed by Tim Horton.

        Implement -setAttributedMarkedText:selectedRange: on WKContentView, and have it extract highlight color
        information from the given attributed string. Plumb this through to the web process by serializing and
        deserializing `WebCore::CompositionHighlight`s.

        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::setMarkedText):
        * UIProcess/WebPageProxy.cpp:
        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (compositionHighlights):

        For each marked text clause, grab the specified background color (defaulting to Color::compositionFill) and use
        it to create a list of CompositionHighlights.

        (-[WKContentView setAttributedMarkedText:selectedRange:]):
        (-[WKContentView setMarkedText:selectedRange:]):
        (-[WKContentView _setMarkedText:highlights:selectedRange:]):
        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
        (WKBundlePageSetComposition):

        Add testing support for specifying highlight ranges when setting marked text.

        * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
        * WebProcess/WebCoreSupport/glib/WebEditorClientGLib.cpp:
        (WebKit::WebEditorClient::didDispatchInputMethodKeydown):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::setCompositionForTesting):
        (WebKit::WebPage::setCompositionAsync):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2020-01-31  Andy Estes  <aestes@apple.com>

        Unreviewed build fix after r255522.

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
        Switched to a C-style cast.

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

        Add KVO SPI WKWebView._negotiatedLegacyTLS
        https://bugs.webkit.org/show_bug.cgi?id=207067

        Reviewed by Andy Estes.

        Covered by API tests.

        * NetworkProcess/NetworkDataTask.cpp:
        (WebKit::NetworkDataTask::negotiatedLegacyTLS const):
        * NetworkProcess/NetworkDataTask.h:
        (WebKit::NetworkDataTaskClient::negotiatedLegacyTLS const):
        * NetworkProcess/NetworkLoad.cpp:
        (WebKit::NetworkLoad::negotiatedLegacyTLS const):
        * NetworkProcess/NetworkLoad.h:
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
        * Shared/Authentication/AuthenticationManager.cpp:
        (WebKit::AuthenticationManager::negotiatedLegacyTLS const):
        * Shared/Authentication/AuthenticationManager.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _negotiatedLegacyTLS]):
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/Cocoa/NavigationState.h:
        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::willChangeNegotiatedLegacyTLS):
        (WebKit::NavigationState::didChangeNegotiatedLegacyTLS):
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::negotiatedLegacyTLS):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/Network/NetworkProcessProxy.messages.in:
        * UIProcess/PageLoadState.cpp:
        (WebKit::PageLoadState::commitChanges):
        (WebKit::PageLoadState::hasNegotiatedLegacyTLS const):
        (WebKit::PageLoadState::negotiatedLegacyTLS):
        (WebKit::PageLoadState::didCommitLoad):
        * UIProcess/PageLoadState.h:
        (WebKit::PageLoadState::Observer::willChangeNegotiatedLegacyTLS):
        (WebKit::PageLoadState::Observer::didChangeNegotiatedLegacyTLS):
        (WebKit::PageLoadState::Data::Data): Deleted.
        * UIProcess/WebPageProxy.cpp:
        * UIProcess/WebPageProxy.h:

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

        Unreviewed macOS build fix after r255518

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

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

        [ iOS ] imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes-cursors.any.serviceworker.html is flaky failing.
        https://bugs.webkit.org/show_bug.cgi?id=206934
        <rdar://problem/58991581>

        Reviewed by Brady Eidson.

        Flakiness would happen when the service worker would take too long to launch and the responsiveness timer would fire and
        report the process as unresponsive while still launching or very shortly after. When a service worker is reported as
        unresponsive, we would kill it.

        To address the issue, several changes were made:
        - Responsiveness checks are now disabled for slow builds (Debug, ASAN, GuardMalloc)
        - We only start the ResponsivenessTimer after the process has finished launching since the responsiveness
          check relies on IPC to the process and we cannot send the IPC until after the process has launched.

        * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp:
        (WebKit::DrawingAreaProxyCoordinatedGraphics::sendUpdateBackingStoreState):
        * UIProcess/ProvisionalPageProxy.cpp:
        (WebKit::ProvisionalPageProxy::goToBackForwardItem):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::launchProcessForReload):
        (WebKit::WebPageProxy::launchProcessWithItem):
        (WebKit::WebPageProxy::loadRequestWithNavigationShared):
        (WebKit::WebPageProxy::loadFile):
        (WebKit::WebPageProxy::loadDataWithNavigationShared):
        (WebKit::WebPageProxy::loadAlternateHTML):
        (WebKit::WebPageProxy::loadWebArchiveData):
        (WebKit::WebPageProxy::navigateToPDFLinkWithSimulatedClick):
        (WebKit::WebPageProxy::stopLoading):
        (WebKit::WebPageProxy::reload):
        (WebKit::WebPageProxy::goToBackForwardItem):
        (WebKit::WebPageProxy::dispatchActivityStateChange):
        (WebKit::WebPageProxy::processNextQueuedMouseEvent):
        (WebKit::WebPageProxy::handleKeyboardEvent):
        (WebKit::WebPageProxy::handleGestureEvent):
        (WebKit::WebPageProxy::handlePreventableTouchEvent):
        (WebKit::WebPageProxy::handleTouchEvent):
        (WebKit::WebPageProxy::runJavaScriptAlert):
        (WebKit::WebPageProxy::runJavaScriptConfirm):
        (WebKit::WebPageProxy::runJavaScriptPrompt):
        (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel):
        (WebKit::WebPageProxy::runOpenPanel):
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::mayBecomeUnresponsive):
        (WebKit::WebProcessProxy::didFinishLaunching):
        (WebKit::WebProcessProxy::startResponsivenessTimer):
        (WebKit::WebProcessProxy::isResponsive):
        * UIProcess/WebProcessProxy.h:
        (WebKit::WebProcessProxy::responsivenessTimer):

2020-01-31  Kate Cheney  <katherine_cheney@apple.com>

        Add page configuration additions to APIPageConfiguration
        https://bugs.webkit.org/show_bug.cgi?id=206090
        <rdar://problem/58489766>

        Reviewed by Andy Estes.

        * UIProcess/API/APIPageConfiguration.cpp:

2020-01-31  David Kilzer  <ddkilzer@apple.com>

        REGRESSION: [ iPadOS ] imported/w3c/web-platform-tests/dom/events/Event-dispatch-on-disabled-elements.html always fails
        <https://webkit.org/b/206759>
        <rdar://problem/58872607>

        Reviewed by Brent Fulgham.

        Test: imported/w3c/web-platform-tests/dom/events/Event-dispatch-on-disabled-elements.html

        * Platform/spi/ios/UIKitSPI.h:
        (-[UIViewController isPerformingModalTransition]): Add SPI
        declaration.

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

        REGRESSION (r251511): [iOS] HDR Playback broken
        https://bugs.webkit.org/show_bug.cgi?id=207052
        <rdar://problem/58975614>

        Reviewed by Maciej Stachowiak.

        I missed an XPC service in Bug 203318 when I stopped importing the 'common.sb' sandbox. This broke some
        aspects of HDR playback for certain clients.

        This patch returns the XPC service, and unblocks access to a network preference file that AVFoundation
        needs to read to support some media playback features.

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

2020-01-31  Alejandro G. Castro  <alex@igalia.com>

        Compilation broken without service workers
        https://bugs.webkit.org/show_bug.cgi?id=207037

        Reviewed by Chris Dumez.

        Protect the use of m_swServers, check if the SERVICE_WORKER is
        enabled.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::lowMemoryHandler):

2020-01-31  David Quesada  <david_quesada@apple.com>

        Remove unused WKProcessPool downloads SPI
        https://bugs.webkit.org/show_bug.cgi?id=207029
        rdar://problem/59052066

        Reviewed by Anders Carlsson.

        Remove two unused SPI for starting/resuming downloads from a process pool. These methods were
        deprecated in favor of variants that also require a WKWebsiteDataStore, and all clients of these
        methods have switched to the new versions.

        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _downloadURLRequest:originatingWebView:]): Deleted.
        (-[WKProcessPool _resumeDownloadFromData:path:originatingWebView:]): Deleted.
        * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:

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

        [CMake] Add _PRIVATE_LIBRARIES to framework
        https://bugs.webkit.org/show_bug.cgi?id=207004

        Reviewed by Konstantin Tokarev.

        Move uses of PRIVATE within _LIBRARIES to _PRIVATE_LIBRARIES. Any _LIBRARIES appended
        afterwards will have that visibility set erroneously.

        * CMakeLists.txt:
        * PlatformFTW.cmake:
        * PlatformGTK.cmake:
        * PlatformWin.cmake:

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

        [WPE] Touch-based scrolling roundtrips through the WebProcess
        https://bugs.webkit.org/show_bug.cgi?id=206922

        Reviewed by Adrian Perez de Castro.

        Short-cut the touch events through the ScrollGestureCotroller while it
        is actively handling the processed touch events, avoiding roundtrip
        through the WebProcess. This effectively means that when the scroll
        gesture is in action, any touch events that would affect that gesture
        are piped into the controller, producing a corresponding axis event
        or ending the gesture.

        The ScrollGestureCotroller ownership is moved into the WKWPE::View class
        in order to make accessing into that object easier from where the touch
        events are handled.

        * UIProcess/API/wpe/PageClientImpl.cpp:
        (WebKit::PageClientImpl::PageClientImpl):
        (WebKit::PageClientImpl::doneWithTouchEvent):
        * UIProcess/API/wpe/PageClientImpl.h:
        * UIProcess/API/wpe/ScrollGestureController.h:
        (WebKit::ScrollGestureController::isHandling const):
        * UIProcess/API/wpe/WPEView.cpp:
        (WKWPE::View::View):
        (WKWPE::m_backend):
        * UIProcess/API/wpe/WPEView.h:
        (WKWPE::View::scrollGestureController const):

2020-01-30  Jiewen Tan  <jiewen_tan@apple.com>

        Add logging to show the flow of AppSSO
        https://bugs.webkit.org/show_bug.cgi?id=206778
        <rdar://problem/58626835>

        Reviewed by Brent Fulgham.

        * Platform/Logging.h:
        * UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm:
        (WebKit::SOAuthorizationSession::shouldStart):
        (WebKit::SOAuthorizationSession::start):
        (WebKit::SOAuthorizationSession::fallBackToWebPath):
        (WebKit::SOAuthorizationSession::abort):
        (WebKit::SOAuthorizationSession::complete):
        (WebKit::SOAuthorizationSession::presentViewController):
        (WebKit::SOAuthorizationSession::dismissViewController):

2020-01-30  Jiewen Tan  <jiewen_tan@apple.com>

        Unreviewed, another speculative test fix after r255041

        * UIProcess/WebAuthentication/Mock/MockLocalConnection.mm:
        (WebKit::MockLocalConnection::getAttestation const):
        Adds kSecAttrAccessible: kSecAttrAccessibleAfterFirstUnlock to secItem to bypass
        potential error due to screen locks.

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

        Add WKNavigationDelegate SPI to disable TLS 1.0 and 1.1
        https://bugs.webkit.org/show_bug.cgi?id=206979

        Reviewed by Brady Eidson.

        * NetworkProcess/NetworkCORSPreflightChecker.cpp:
        (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
        * NetworkProcess/NetworkCORSPreflightChecker.h:
        * NetworkProcess/NetworkDataTask.h:
        * NetworkProcess/NetworkLoad.cpp:
        (WebKit::NetworkLoad::didReceiveChallenge):
        * NetworkProcess/NetworkLoad.h:
        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
        (WebKit::NetworkProcessCreationParameters::decode):
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * NetworkProcess/NetworkSessionCreationParameters.cpp:
        (WebKit::NetworkSessionCreationParameters::encode const):
        (WebKit::NetworkSessionCreationParameters::decode):
        * NetworkProcess/NetworkSessionCreationParameters.h:
        * NetworkProcess/PingLoad.cpp:
        (WebKit::PingLoad::didReceiveChallenge):
        * NetworkProcess/PingLoad.h:
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
        (WebKit::NetworkDataTaskCocoa::didReceiveChallenge):
        (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
        * NetworkProcess/cocoa/NetworkSessionCocoa.h:
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (processServerTrustEvaluation):
        (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
        (WebKit::NetworkSessionCocoa::continueDidReceiveChallenge):
        * Shared/Authentication/AuthenticationManager.cpp:
        (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
        * Shared/Authentication/AuthenticationManager.h:
        * UIProcess/API/APINavigationClient.h:
        (API::NavigationClient::shouldAllowLegacyTLS):
        * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
        * UIProcess/Cocoa/NavigationState.h:
        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::setNavigationDelegate):
        (WebKit::systemAllowsLegacyTLSFor):
        (WebKit::NavigationState::NavigationClient::shouldAllowLegacyTLS):
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeNetworkProcess):
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/Network/NetworkProcessProxy.messages.in:
        * UIProcess/WebPageProxy.cpp:
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::parameters):
        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:

2020-01-30  Tim Horton  <timothy_horton@apple.com>

        Can still get stuck after swipe backwards with a slow server, even after r254552
        https://bugs.webkit.org/show_bug.cgi?id=207017
        <rdar://problem/59016256>

        Reviewed by Chris Dumez.

        * UIProcess/ProvisionalPageProxy.cpp:
        (WebKit::ProvisionalPageProxy::unfreezeLayerTreeDueToSwipeAnimation):
        * UIProcess/ProvisionalPageProxy.h:
        * UIProcess/WebPageProxy.cpp:
        There's a second case where you can get stuck with the "swipe gesture"
        layer tree freeze reason in the web process: when doing a cross-origin
        navigation where the load takes more than 3 seconds (the swipe
        snapshot timeout) to commit, the provisional page will have mirrored
        the original page's frozen state upon creation, but will not ever
        receive the unfreeze, because it is sent while still provisional.

        To fix this, just forward the unfreeze message to the provisional page.

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

        [iOS] Issue mach sandbox extension to the frontboard and icon service when the attachment element is enabled
        https://bugs.webkit.org/show_bug.cgi?id=205443
        <rdar://problem/58074291>

        Reviewed by Brent Fulgham.

        When support for the html attachment element is enabled, issue a mach lookup extension to the frontboard and icon service
        for the WebContent process, since these daemons are being contacted when icons for attachments are being queried. Also,
        retrieve the focus ring color in the UI process, since getting this color requires access to the frontboard daemon.

        Test: fast/sandbox/ios/sandbox-mach-lookup-attachment-element.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-01-30  Tim Horton  <timothy_horton@apple.com>

        REGRESSION (r253267): Swipe from edge on Twitter images no longer goes back
        https://bugs.webkit.org/show_bug.cgi?id=207011
        <rdar://problem/58966044>

        Reviewed by Wenson Hsieh.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView deferringGestureRecognizer:shouldDeferOtherGestureRecognizer:]):
        The new touch-event async deferring gesture recognizer was erroneously deferring
        edge swipes, which are not allowed to be blocked by touch events.
        Opt them out of the new gesture gate mechanism.

2020-01-30  Jonathan Bedard  <jbedard@apple.com>

        PAL: Remove old iOS version macros
        https://bugs.webkit.org/show_bug.cgi?id=206905

        Reviewed by Darin Adler.

        * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm: Remove USE(NSPROGRESS_PUBLISHING_SPI)
        * NetworkProcess/Downloads/cocoa/WKDownloadProgress.mm: Ditto.

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

        Disable Service Workers before terminating an unresponsive service worker process
        https://bugs.webkit.org/show_bug.cgi?id=206994

        Reviewed by Chris Dumez.

        In case a process becomes unresponsive, we terminate it in case it is a service worker process.
        In that case, we should make sure not to call the service worker process crash callback.
        To do so, disable service workers before terminating the IPC connection.

        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::didBecomeUnresponsive):

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

        [iOS] Remove report rule for 'com.apple.runningboard' from the Network and GPU process sandboxes
        https://bugs.webkit.org/show_bug.cgi?id=206980
        <rdar://problem/58900030>

        Reviewed by Maciej Stachowiak.

        Remove the logging now that we have useful backtraces.

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

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

        [Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder
        https://bugs.webkit.org/show_bug.cgi?id=206582

        Reviewed by Eric Carlson.

        * GPUProcess/webrtc/RemoteMediaRecorder.cpp:
        (WebKit::RemoteMediaRecorder::create):
        Use new constructor.

2020-01-30  Carlos Garcia Campos  <cgarcia@igalia.com>

        REGRESSION(r253636): [GTK] Mouse cursor changes using onMouseXYZ are erratic
        https://bugs.webkit.org/show_bug.cgi?id=206454

        Reviewed by Tim Horton.

        Since r253636 only platforms defining HAVE_NSCURSOR claim to support setting the cursor.

        * WebProcess/WebCoreSupport/WebChromeClient.h: Do not implement supportsSettingCursor() for GTK port either.

2020-01-29  Tim Horton  <timothy_horton@apple.com>

        REGRESSION (r255322): macCatalyst: Tapping in an input field doesn't change the selection location
        https://bugs.webkit.org/show_bug.cgi?id=206978

        Reviewed by Wenson Hsieh.

        * WebProcess/WebCoreSupport/WebChromeClient.h:
        * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
        (WebKit::WebChromeClient::shouldUseMouseEventForSelection):
        (WebKit::WebChromeClient::shouldUseMouseEventsForSelection): Deleted.
        Allow single-click events to change the selection; this is required
        in order to allow WebCore to set the selection in the case that
        the UITextInteraction gestures haven't yet been installed. Continue
        to not allow multi-click events to change the selection, because
        these are the ones that conflict with UIKit's behaviors.

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

        Unreviewed, rolling out r254379.
        https://bugs.webkit.org/show_bug.cgi?id=206969

        Introduced media regressions (Requested by perarne on
        #webkit).

        Reverted changeset:

        "[iOS] Remove used media-related mach services from the
        WebContent process sandbox"
        https://bugs.webkit.org/show_bug.cgi?id=206089
        https://trac.webkit.org/changeset/254379

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

        [iOS] Deny mach lookup access to aggregate service
        https://bugs.webkit.org/show_bug.cgi?id=206710
        <rdar://problem/57914492>

        Reviewed by Darin Adler.

        Tighten sandbox by denying access to this service.

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

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

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

        [iPadOS] Select popovers on amazon.com sometimes dismiss immediately after appearing
        https://bugs.webkit.org/show_bug.cgi?id=206948
        <rdar://problem/58954516>

        Reviewed by Tim Horton.

        Amazon adds active touchstart event listeners to their select elements, where they call preventDefault() and
        programmatically focus the select element. Doing so prevents clicks from being dispatched by allowing the web
        touch event gesture to recognize instead of the synthetic click gesture, which (inside -_singleTapRecognized:)
        would otherwise dismiss any currently presented popover.

        After making touchstart events dispatch asynchronously, preventing touchstart no longer causes other native
        gestures (such as the synthetic click gesture) to fail in the case where there is a sync touchmove or touchend
        event listener, and the touch gesture has ended before the touchstart handler has finished executing and told
        the UI process whether or not the touch was handled. This is because the touchend or touchmove is dispatched
        synchronously while the touchstart is still being processed; while the web page sees the correct order of
        events, the UI process will end up learning that the synchronous touch was handled before the response to the
        asynchronously dispatched touchstart event has arrived.

        Our current logic in the sync touch event dispatch case then unconditionally ends gesture deferral by calling
        `doneDeferringNativeGestures` with `handled` equal to whether or not the touch event (a "touchend", in this
        case) had been handled. However, in the case where touchstart event is prevented but the touchend event is not,
        this will cause us to prematurely stop deferring gestures even though the page called `preventDefault()` in the
        touchstart event handler, and allow the synthetic click gesture to recognize when it shouldn't.

        To fix this, keep deferring native gestures after handling a sync touch in the case where a touchstart event is
        still being handled; instead, remember whether the touch event was handled using a new member variable
        (`m_handledSynchronousTouchEventWhileDispatchingPreventableTouchStart`), and consult this when the response to
        the touchstart has been received in the UI process to determine whether platform gestures should be allowed to
        recognize. This variable is reset once we're done handling the touchstart.

        Test: fast/events/touch/ios/prevent-default-with-slow-touchstart-handler.html

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::handlePreventableTouchEvent):
        * UIProcess/WebPageProxy.h:

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

        [iOS] Make sure unused service worker processes exit promptly on low memory warning
        https://bugs.webkit.org/show_bug.cgi?id=206939
        <rdar://problem/58972717>

        Reviewed by Alex Christensen.

        Make sure unused service worker processes exit promptly on low memory warning. They normally take 10 seconds to exit
        for performance reasons. However, in case of memory pressure, keeping those processes around that long is not the
        right thing to do.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::lowMemoryHandler):

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

        Unreviewed, fix Catalyst build after r255366

        * Shared/WebPreferencesDefaultValues.cpp:
        (WebKit::defaultDisallowSyncXHRDuringPageDismissalEnabled):
        * Shared/WebPreferencesDefaultValues.h:
        * Shared/ios/WebPreferencesDefaultValuesIOS.mm:

2020-01-29  Sihui Liu  <sihui_liu@apple.com>

        Crash under com.apple.WebKit.Networking at WebKit: WebKit::WebIDBServer::suspend
        https://bugs.webkit.org/show_bug.cgi?id=206904
        <rdar://problem/58791603>

        Reviewed by Maciej Stachowiak.

        Wait until m_server is set in constructor of WebIDBServer to make sure m_server can be accessed in 
        WebIDBServer::suspend.

        * NetworkProcess/IndexedDB/WebIDBServer.cpp:
        (WebKit::WebIDBServer::WebIDBServer):

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

        Unreviewed, rolling out r255217 and r255217.

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

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

        [iOS] Add managed preference to allow legacy sync XHRs during page dismissal
        https://bugs.webkit.org/show_bug.cgi?id=206944
        <rdar://problem/58440111>

        Reviewed by Alex Christensen.

        Add managed preference for iOS to allow enterprise customers to keep using legacy sync XHRs
        during page dismissal.

        * Shared/WebPreferencesDefaultValues.cpp:
        (WebKit::defaultDisallowSyncXHRDuringPageDismissalEnabled):
        * Shared/WebPreferencesDefaultValues.h:
        * Shared/ios/WebPreferencesDefaultValuesIOS.mm:
        (WebKit::allowsDeprecatedSynchronousXMLHttpRequestDuringUnload):

2020-01-29  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Move unsetenv to WebProcessMain.cpp after r255342

        I forgot to do that before landing the patch.

        * WebProcess/EntryPoint/unix/WebProcessMain.cpp:
        (main):
        * WebProcess/gtk/WebProcessMainGtk.cpp:

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

        Send WebsiteDataStore media parameters to GPUProcess when needed
        https://bugs.webkit.org/show_bug.cgi?id=206870

        Reviewed by Eric Carlson.

        Whenever opening a new WebProcess/GPUProcess connection, make sure GPUProcess knows WebProcess session parameters.
        Make sure to remove session parameters when data store is destroyed.
        Update media code to no longer send the corresponding parameters for each media load.

        Covered by existing tests no longer triggering sandbox violations.

        * GPUProcess/GPUConnectionToWebProcess.cpp:
        (WebKit::GPUConnectionToWebProcess::mediaCacheDirectory const):
        (WebKit::GPUConnectionToWebProcess::mediaKeysStorageDirectory const):
        * GPUProcess/GPUConnectionToWebProcess.h:
        * GPUProcess/GPUProcess.cpp:
        (WebKit::GPUProcess::addSession):
        (WebKit::GPUProcess::removeSession):
        (WebKit::GPUProcess::mediaCacheDirectory const):
        (WebKit::GPUProcess::mediaKeysStorageDirectory const):
        * GPUProcess/GPUProcess.h:
        * GPUProcess/GPUProcess.messages.in:
        * GPUProcess/media/RemoteMediaPlayerProxy.cpp:
        (WebKit::RemoteMediaPlayerProxy::load):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerMediaKeysStorageDirectory const):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerMediaCacheDirectory const):
        * GPUProcess/media/RemoteMediaPlayerProxy.h:
        * GPUProcess/media/RemoteMediaPlayerProxyConfiguration.h:
        (WebKit::RemoteMediaPlayerProxyConfiguration::encode const):
        (WebKit::RemoteMediaPlayerProxyConfiguration::decode):
        * UIProcess/GPU/GPUProcessProxy.cpp:
        (WebKit::GPUProcessProxy::singleton):
        (WebKit::GPUProcessProxy::openGPUProcessConnection):
        (WebKit::gpuProcessSessionParameters):
        (WebKit::GPUProcessProxy::addSession):
        (WebKit::GPUProcessProxy::removeSession):
        * UIProcess/GPU/GPUProcessProxy.h:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::~WebsiteDataStore):
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp:
        (WebKit::RemoteMediaPlayerManager::createRemoteMediaPlayer):

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

        [Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder
        https://bugs.webkit.org/show_bug.cgi?id=206582

        Reviewed by Eric Carlson.

        * GPUProcess/webrtc/RemoteMediaRecorder.cpp:
        (WebKit::RemoteMediaRecorder::create):
        Use new constructor.

2020-01-29  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] WebDriver: screenshot ignores CSS transformations or WebGL content.
        https://bugs.webkit.org/show_bug.cgi?id=206514

        Reviewed by Carlos Alberto Lopez Perez.

        WebPage::scaledSnapshotWithOptions() doesn't work when accelerated compositing is enabled. To fix this, we
        need to take the screenshot from the UI process, like we do for the layout tests.

        * UIProcess/API/gtk/PageClientImpl.cpp:
        (WebKit::PageClientImpl::takeViewSnapshot): Pass clip rectangle to webkitWebViewBaseTakeViewSnapshot.
        * UIProcess/API/gtk/PageClientImpl.h:
        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (webkitWebViewBaseTakeViewSnapshot): Use the given clip rectangle if not nullopt.
        * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::takeScreenshot): In case of full web view snapshot just call
        WebPageProxy::takeViewSnapshot() with a nullopt clip rectangle. In case of element snapshot, send
        SnapshotRectForScreenshot message to the web process to get the clip rectangle and then call
        WebPageProxy::takeViewSnapshot().
        (WebKit::WebAutomationSession::platformGetBase64EncodedPNGData): Empty implementation for other ports.
        * UIProcess/Automation/WebAutomationSession.h: Make platformGetBase64EncodedPNGData() static.
        * UIProcess/Automation/cairo/WebAutomationSessionCairo.cpp:
        (WebKit::base64EncodedPNGData): Moved common code to this new function.
        (WebKit::WebAutomationSession::platformGetBase64EncodedPNGData): New function to get the encoded PNG from a ViewSnapshot.
        * UIProcess/PageClient.h: Add optional clip rectangle parameter to takeViewSnapshot().
        * UIProcess/ViewSnapshotStore.cpp:
        (WebKit::ViewSnapshotStore::recordSnapshot): Pass nullopt to takeViewSnapshot().
        * UIProcess/WebPageProxy.cpp:
        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/PageClientImplIOS.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::takeViewSnapshot):
        * UIProcess/mac/PageClientImplMac.h:
        * UIProcess/mac/PageClientImplMac.mm:
        (WebKit::PageClientImpl::takeViewSnapshot):
        * WebProcess/Automation/WebAutomationSessionProxy.cpp:
        (WebKit::snapshotElementRectForScreenshot): Renamed to avoid conflict with new IPC message handler.
        (WebKit::WebAutomationSessionProxy::takeScreenshot): Call snapshotRectForScreenshot() to get the snapshot
        rectangle and convert it to document coords.
        (WebKit::WebAutomationSessionProxy::snapshotRectForScreenshot): Get the snapshot rectangle in client coords.
        (WebKit::snapshotRectForScreenshot): Deleted.
        * WebProcess/Automation/WebAutomationSessionProxy.h:
        * WebProcess/Automation/WebAutomationSessionProxy.messages.in: Add SnapshotRectForScreenshot message.

2020-01-28  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Should use light theme unless website declares support for dark themes in color-schemes property
        https://bugs.webkit.org/show_bug.cgi?id=197947

        Reviewed by Michael Catanzaro.

        Handle the theme changes in the UI process, converting dark variant to the light one before sending the theme
        name to the web process. The web process is still notified when a dark theme is in use, so that if website
        prefers a dark color scheme it will be used, but the gtk theme that will be used for controls styling will
        always be light.

        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const): Encode themeName.
        (WebKit::WebPageCreationParameters::decode): Decode themeName.
        * Shared/WebPageCreationParameters.h:
        * UIProcess/API/gtk/PageClientImpl.cpp:
        (WebKit::PageClientImpl::themeName const): Get the theme name that should be used by the web process.
        * UIProcess/API/gtk/PageClientImpl.h:
        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (themeChanged): Call WebPageProxy::themeDidChange().
        (applicationPreferDarkThemeChanged):
        (webkitWebViewBaseSetToplevelOnScreenWindow): Use a different callback for the theme name change.
        * UIProcess/PageClient.h:
        * UIProcess/WebPageProxy.cpp:
        * UIProcess/WebPageProxy.h:
        * UIProcess/gtk/WebPageProxyGtk.cpp:
        (WebKit::WebPageProxy::themeDidChange): Send ThemeDidChange message to the web process with the theme name to use.
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::WebPage): Initialize the theme name.
        (WebKit::WebPage::effectiveAppearanceDidChange): Use this now for GTK port too.
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in: Add ThemeDidChange message.
        * WebProcess/WebPage/gtk/WebPageGtk.cpp:
        (WebKit::WebPage::themeDidChange): Set the theme given name in gtk settings.
        * WebProcess/gtk/WebProcessMainGtk.cpp:

2020-01-28  Timothy Horton  <timothy_horton@apple.com>

        Fix the build

        * UIProcess/ios/WKMouseGestureRecognizer.mm:
        (-[WKMouseGestureRecognizer touchesEnded:withEvent:]):

2020-01-28  Tim Horton  <timothy_horton@apple.com>

        macCatalyst: Right clicking on a link follows it immediately
        https://bugs.webkit.org/show_bug.cgi?id=206919
        <rdar://problem/58936679>

        Reviewed by Wenson Hsieh.

        * UIProcess/ios/WKMouseGestureRecognizer.mm:
        (-[WKMouseGestureRecognizer createMouseEventWithType:forEvent:]):
        (-[WKMouseGestureRecognizer touchesBegan:withEvent:]):
        (-[WKMouseGestureRecognizer touchesEnded:withEvent:]):
        UIKit's _buttonMask does not include the currently-released button,
        so in order to correctly identify the released button in touchesEnded,
        store the mask for the length of the click.

2020-01-28  Tim Horton  <timothy_horton@apple.com>

        macCatalyst: Triple clicking to select a sentence results in an empty selection
        https://bugs.webkit.org/show_bug.cgi?id=206863
        <rdar://problem/58776993>

        Reviewed by Wenson Hsieh.

        * UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h:
        * UIProcess/API/Cocoa/WKWebViewTesting.mm:
        (-[WKWebView _doAfterProcessingAllPendingMouseEvents:]):
        * UIProcess/API/mac/WKWebViewPrivateForTestingMac.h:
        * UIProcess/API/mac/WKWebViewTestingMac.mm:
        (-[WKWebView _doAfterProcessingAllPendingMouseEvents:]): Deleted.
        * UIProcess/Cocoa/WebViewImpl.h:
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::handleProcessSwapOrExit):
        (WebKit::WebViewImpl::doAfterProcessingAllPendingMouseEvents): Deleted.
        (WebKit::WebViewImpl::didFinishProcessingAllPendingMouseEvents): Deleted.
        (WebKit::WebViewImpl::flushPendingMouseEventCallbacks): Deleted.
        * UIProcess/PageClient.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::doAfterProcessingAllPendingMouseEvents):
        (WebKit::WebPageProxy::didFinishProcessingAllPendingMouseEvents):
        (WebKit::WebPageProxy::flushPendingMouseEventCallbacks):
        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/PageClientImplIOS.h:
        * UIProcess/mac/PageClientImplMac.h:
        * UIProcess/mac/PageClientImplMac.mm:
        (WebKit::PageClientImpl::didFinishProcessingAllPendingMouseEvents): Deleted.
        Move "doAfterProcessingAllPendingMouseEvents" to WebPage instead of WebViewImpl,
        so it can be used on all platforms. Expose it via WKWebView.

        * WebProcess/WebCoreSupport/WebChromeClient.h:
        * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
        (WebKit::WebChromeClient::shouldUseMouseEventsForSelection):

2020-01-28  Andres Gonzalez  <andresg_22@apple.com>

        Fix for crash in AppKit accessibility.
        https://bugs.webkit.org/show_bug.cgi?id=206902

        Reviewed by Chris Fleizach.

        Accessibility methods invoked in the secondary thread that Return id
        values retrieved from the main thread, need to retain/autoRelease the returned ids.

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

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

        Unreviewed test fix after r255217

        Re-activate SecurityServer mach port access in Catalina and older.

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

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

        Reset the application bundle identifier between test runs
        https://bugs.webkit.org/show_bug.cgi?id=206858
        <rdar://problem/58844002>

        Reviewed by Per Arne Vollan.

        Clear the application bundle identifier set during testing when resetting the test system
        to a known state in preparation for the next run.

        Tests: fast/sandbox/ios/sandbox-mach-lookup.html, fast/sandbox/ios/sandbox-mach-lookup-mail.html

        * UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h:
        * UIProcess/API/Cocoa/WKWebViewTesting.mm:
        (+[WKWebView _clearApplicationBundleIdentifierTestingOverride]): Added.

2020-01-24  Sergio Villar Senin  <svillar@igalia.com>

        Remove WebVR from the tree
        https://bugs.webkit.org/show_bug.cgi?id=206739

        Reviewed by Darin Adler.

        * Shared/WebPreferences.yaml: removed WebVR preference.

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

        Remove unneeded message checks in GPUProcess code
        https://bugs.webkit.org/show_bug.cgi?id=206866

        Reviewed by Eric Carlson.

        Remove message check macros and checks since they are not needed due to the use of ObjectIdentifier.
        No change of behavior.

        * GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp:
        (WebKit::RemoteMediaPlayerManagerProxy::createMediaPlayer):
        * GPUProcess/media/RemoteMediaPlayerProxy.cpp:

2020-01-27  Antoine Quint  <graouts@apple.com>

        [Web Animations] Make Animation.timeline read-write only if a runtime flag is enabled
        https://bugs.webkit.org/show_bug.cgi?id=206173
        <rdar://problem/58527432>

        Reviewed by Dean Jackson.

        Add a new WebAnimationsMutableTimelines runtime flag.

        * Shared/WebPreferences.yaml:

2020-01-28  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] QR code not loaded in web.whatsapp.com
        https://bugs.webkit.org/show_bug.cgi?id=203404

        Reviewed by Michael Catanzaro.

        This is a regression of the switch to use libsoup API for the WebSockets implementation. The QR code is loaded
        using a WebSocket connection, but the server is always replying with a 400 Bad Request to the Upgrade requests
        coming from an existing HTTP connection. We need to ensure a new dedicated connection is used for WebSockets.

        * NetworkProcess/soup/WebSocketTaskSoup.cpp:
        (WebKit::WebSocketTask::WebSocketTask): Set the SOUP_MESSAGE_NEW_CONNECTION flag to the SoupMessage before
        starting the connection.

2020-01-27  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Remote Inspector: add support for service workers targets
        https://bugs.webkit.org/show_bug.cgi?id=206821

        Reviewed by Žan Doberšek.

        Add support for debugging service workers.

        * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
        (WebKit::RemoteInspectorProtocolHandler::handleRequest): Pass target type to message handler too.
        (WebKit::RemoteInspectorProtocolHandler::inspect): Pass the received target type to the client.
        * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.h:
        * UIProcess/glib/RemoteInspectorClient.cpp:
        (WebKit::RemoteInspectorProxy::load): It now receives the debuggable type that is set to the API::DebuggableInfo.
        (WebKit::RemoteInspectorClient::messageHandlers): Handle service worker targets too.
        (WebKit::debuggableType): Helper to convert the target type to debuggable type.
        (WebKit::RemoteInspectorClient::inspect): Pass the debuggable tupe to RemoteInspectorProxy::load().
        * UIProcess/glib/RemoteInspectorClient.h:
        * UIProcess/gtk/WebInspectorProxyGtk.cpp:
        (WebKit::WebInspectorProxy::infoForLocalDebuggable): Use WebPage as debuggable type instead of the default.

2020-01-27  Simon Fraser  <simon.fraser@apple.com>

        REGRESSION (r253634): cricbuzz.com media controls vanish depending on page scale
        https://bugs.webkit.org/show_bug.cgi?id=206788
        rdar://problem/58780584

        Reviewed by Tim Horton.

        r253634 changed "delegatesPageScaling"'" to a flag on ScrollView. However, this changed behavior
        for subframes; Settings are propagated down, but only the main ScrollView had delegatesPageScaling
        set on it.
        
        "delegatesPageScaling" is a page-level thing (subframes don't independently zoom), so it
        should live on Page. Move it there.
        
        The bug was triggered by incorrectly taking page scale into account for rects in the compositing
        overlap map (see RenderLayerCompositor::addToOverlapMap()) in subframes, and those rects
        changing on zoom.

        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
        * WebProcess/WebPage/ios/FindControllerIOS.mm:
        (WebKit::FindIndicatorOverlayClientIOS::drawRect):

2020-01-27  Fujii Hironori  <Hironori.Fujii@sony.com>

        [WinCairo][curl] ASSERTION FAILED: sessionID != PAL::SessionID::defaultSessionID() in WebKit::CacheStorage::Engine::destroyEngine since r255137
        https://bugs.webkit.org/show_bug.cgi?id=206859

        Reviewed by Don Olmstead.

        After r255137, WinCairo debug WK2 is still failing an assertion
        while shutdown, which is ensuring the destructing session isn't
        the default session.

        * NetworkProcess/cache/CacheStorageEngine.cpp:
        (WebKit::CacheStorage::Engine::destroyEngine): Conditioned out the
        assertion for curl port as well as Soup port does.

2020-01-27  David Quesada  <david_quesada@apple.com>

        Support observing a different set of view service state notifications in ApplicationStateTracker
        https://bugs.webkit.org/show_bug.cgi?id=201737
        rdar://problem/54786414

        Reviewed by Chris Dumez.

        * UIProcess/ApplicationStateTracker.mm:
        Make ApplicationStateTracker conditionally (based on a flag to be defined in WebKitAdditions)
        use a different pair of notifications when it is in a view service or extension. These
        notifications report state changes of the individual scene that hosts the web view, rather
        than the state of the overall host application. This allows for more accurate state tracking
        for web views in extensions or view services hosted by apps with multiple open scenes.

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

        Add WKWebView SPI equivalent of WKView.shouldClipToVisibleRect
        https://bugs.webkit.org/show_bug.cgi?id=206849
        <rdar://problem/58887004>

        Reviewed by Simon Fraser.

        Books currently uses WKView.setShouldClipToVisibleRect and needs to migrate to WKWebView, but it needs to do
        so without modifying the other properties in _setMinimumLayoutWidth, which is currently the only other caller
        of WebViewImpl::setClipsToVisibleRect.  Expose an SPI that only calls WebViewImpl::setClipsToVisibleRect.

        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/API/mac/WKWebViewMac.mm:
        (-[WKWebView _clipsToVisibleRect]):
        (-[WKWebView _setClipsToVisibleRect:]):

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

        Remove SecurityServer from WebContent sandboxes
        https://bugs.webkit.org/show_bug.cgi?id=206832
        <rdar://problem/46235370>

        Reviewed by Per Arne Vollan.

        We no longer need access to 'com.apple.SecurityServer' and
        'com.apple.ocspd' on recent macaOS systems.

        Tested by existing test suite.

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

2020-01-27  Devin Rousso  <drousso@apple.com>

        Web Inspector: consolidate UIProcess/WebProcess files into Inspector folders
        https://bugs.webkit.org/show_bug.cgi?id=206721

        Reviewed by Alex Christensen and Don Olmstead.

        * CMakeLists.txt:
        * DerivedSources-input.xcfilelist:
        * DerivedSources.make:
        * PlatformGTK.cmake:
        * PlatformMac.cmake:
        * PlatformFTW.cmake:
        * PlatformWin.cmake:
        * Sources.txt:
        * SourcesCocoa.txt:
        * SourcesGTK.txt:
        * WebKit.xcodeproj/project.pbxproj:

        * UIProcess/Inspector/InspectorTargetProxy.h: Renamed from Source/WebKit/UIProcess/InspectorTargetProxy.h.
        * UIProcess/Inspector/InspectorTargetProxy.cpp: Renamed from Source/WebKit/UIProcess/InspectorTargetProxy.cpp.
        * UIProcess/Inspector/RemoteWebInspectorProxy.messages.in: Renamed from Source/WebKit/UIProcess/RemoteWebInspectorProxy.messages.in.
        * UIProcess/Inspector/RemoteWebInspectorProxy.h: Renamed from Source/WebKit/UIProcess/RemoteWebInspectorProxy.h.
        * UIProcess/Inspector/RemoteWebInspectorProxy.cpp: Renamed from Source/WebKit/UIProcess/RemoteWebInspectorProxy.cpp.
        * UIProcess/Inspector/WebInspectorProxy.messages.in: Renamed from Source/WebKit/UIProcess/WebInspectorProxy.messages.in.
        * UIProcess/Inspector/WebInspectorProxy.h: Renamed from Source/WebKit/UIProcess/WebInspectorProxy.h.
        * UIProcess/Inspector/WebInspectorProxy.cpp: Renamed from Source/WebKit/UIProcess/WebInspectorProxy.cpp.
        * UIProcess/Inspector/WebInspectorUtilities.h: Renamed from Source/WebKit/UIProcess/WebInspectorUtilities.h.
        * UIProcess/Inspector/WebInspectorUtilities.cpp: Renamed from Source/WebKit/UIProcess/WebInspectorUtilities.cpp.
        * UIProcess/Inspector/WebPageDebuggable.h: Renamed from Source/WebKit/UIProcess/WebPageDebuggable.h.
        * UIProcess/Inspector/WebPageDebuggable.cpp: Renamed from Source/WebKit/UIProcess/WebPageDebuggable.cpp.
        * UIProcess/Inspector/WebPageInspectorController.h: Renamed from Source/WebKit/UIProcess/WebPageInspectorController.h.
        * UIProcess/Inspector/WebPageInspectorController.cpp: Renamed from Source/WebKit/UIProcess/WebPageInspectorController.cpp.
        * UIProcess/Inspector/glib/RemoteInspectorClient.h: Renamed from Source/WebKit/UIProcess/glib/RemoteInspectorClient.h.
        * UIProcess/Inspector/glib/RemoteInspectorClient.cpp: Renamed from Source/WebKit/UIProcess/glib/RemoteInspectorClient.cpp.
        * UIProcess/Inspector/gtk/RemoteWebInspectorProxyGtk.cpp: Renamed from Source/WebKit/UIProcess/gtk/RemoteWebInspectorProxyGtk.cpp.
        * UIProcess/Inspector/gtk/WebInspectorProxyGtk.cpp: Renamed from Source/WebKit/UIProcess/gtk/WebInspectorProxyGtk.cpp.
        * UIProcess/Inspector/gtk/WebInspectorProxyClient.h: Renamed from Source/WebKit/UIProcess/gtk/WebInspectorProxyClient.h.
        * UIProcess/Inspector/gtk/WebKitInspectorWindow.h: Renamed from Source/WebKit/UIProcess/gtk/WebKitInspectorWindow.h.
        * UIProcess/Inspector/gtk/WebKitInspectorWindow.cpp: Renamed from Source/WebKit/UIProcess/gtk/WebKitInspectorWindow.cpp.
        * UIProcess/Inspector/ios/WKInspectorHighlightView.h: Renamed from Source/WebKit/UIProcess/WKInspectorHighlightView.h.
        * UIProcess/Inspector/ios/WKInspectorHighlightView.mm: Renamed from Source/WebKit/UIProcess/WKInspectorHighlightView.mm.
        * UIProcess/Inspector/ios/WKInspectorNodeSearchGestureRecognizer.h: Renamed from Source/WebKit/UIProcess/ios/WKInspectorNodeSearchGestureRecognizer.h.
        * UIProcess/Inspector/ios/WKInspectorNodeSearchGestureRecognizer.mm: Renamed from Source/WebKit/UIProcess/ios/WKInspectorNodeSearchGestureRecognizer.mm.
        * UIProcess/Inspector/mac/RemoteWebInspectorProxyMac.mm: Renamed from Source/WebKit/UIProcess/mac/RemoteWebInspectorProxyMac.mm.
        * UIProcess/Inspector/mac/WKInspectorViewController.h: Renamed from Source/WebKit/UIProcess/mac/WKInspectorViewController.h.
        * UIProcess/Inspector/mac/WKInspectorViewController.mm: Renamed from Source/WebKit/UIProcess/mac/WKInspectorViewController.mm.
        * UIProcess/Inspector/mac/WKInspectorWKWebView.h: Renamed from Source/WebKit/UIProcess/mac/WKInspectorWKWebView.h.
        * UIProcess/Inspector/mac/WKInspectorWKWebView.mm: Renamed from Source/WebKit/UIProcess/mac/WKInspectorWKWebView.mm.
        * UIProcess/Inspector/mac/WebInspectorProxyMac.mm: Renamed from Source/WebKit/UIProcess/mac/WebInspectorProxyMac.mm.
        * UIProcess/Inspector/socket/RemoteInspectorClient.h: Renamed from Source/WebKit/UIProcess/socket/RemoteInspectorClient.h.
        * UIProcess/Inspector/socket/RemoteInspectorClient.cpp: Renamed from Source/WebKit/UIProcess/socket/RemoteInspectorClient.cpp.
        * UIProcess/Inspector/socket/RemoteInspectorProtocolHandler.h: Renamed from Source/WebKit/UIProcess/socket/RemoteInspectorProtocolHandler.h.
        * UIProcess/Inspector/socket/RemoteInspectorProtocolHandler.cpp: Renamed from Source/WebKit/UIProcess/socket/RemoteInspectorProtocolHandler.cpp.
        * UIProcess/Inspector/win/RemoteWebInspectorProxyWin.cpp: Renamed from Source/WebKit/UIProcess/win/RemoteWebInspectorProxyWin.cpp.
        * UIProcess/Inspector/win/WebInspectorProxyWin.cpp: Renamed from Source/WebKit/UIProcess/win/WebInspectorProxyWin.cpp.

        * WebProcess/Inspector/RemoteWebInspectorUI.messages.in: Renamed from Source/WebKit/WebProcess/WebPage/RemoteWebInspectorUI.messages.in.
        * WebProcess/Inspector/RemoteWebInspectorUI.h: Renamed from Source/WebKit/WebProcess/WebPage/RemoteWebInspectorUI.h.
        * WebProcess/Inspector/RemoteWebInspectorUI.cpp: Renamed from Source/WebKit/WebProcess/WebPage/RemoteWebInspectorUI.cpp.
        * WebProcess/Inspector/WebInspector.messages.in: Renamed from Source/WebKit/WebProcess/WebPage/WebInspector.messages.in.
        * WebProcess/Inspector/WebInspector.h: Renamed from Source/WebKit/WebProcess/WebPage/WebInspector.h.
        * WebProcess/Inspector/WebInspector.cpp: Renamed from Source/WebKit/WebProcess/WebPage/WebInspector.cpp.
        * WebProcess/Inspector/WebInspectorClient.h: Renamed from Source/WebKit/WebProcess/WebCoreSupport/WebInspectorClient.h.
        * WebProcess/Inspector/WebInspectorClient.cpp: Renamed from Source/WebKit/WebProcess/WebCoreSupport/WebInspectorClient.cpp.
        * WebProcess/Inspector/WebInspectorFrontendAPIDispatcher.h: Renamed from Source/WebKit/WebProcess/WebPage/WebInspectorFrontendAPIDispatcher.h.
        * WebProcess/Inspector/WebInspectorFrontendAPIDispatcher.cpp: Renamed from Source/WebKit/WebProcess/WebPage/WebInspectorFrontendAPIDispatcher.cpp.
        * WebProcess/Inspector/WebInspectorInterruptDispatcher.messages.in: Renamed from Source/WebKit/WebProcess/WebPage/WebInspectorInterruptDispatcher.messages.in.
        * WebProcess/Inspector/WebInspectorInterruptDispatcher.h: Renamed from Source/WebKit/WebProcess/WebPage/WebInspectorInterruptDispatcher.h.
        * WebProcess/Inspector/WebInspectorInterruptDispatcher.cpp: Renamed from Source/WebKit/WebProcess/WebPage/WebInspectorInterruptDispatcher.cpp.
        * WebProcess/Inspector/WebInspectorUI.messages.in: Renamed from Source/WebKit/WebProcess/WebPage/WebInspectorUI.messages.in.
        * WebProcess/Inspector/WebInspectorUI.h: Renamed from Source/WebKit/WebProcess/WebPage/WebInspectorUI.h.
        * WebProcess/Inspector/WebInspectorUI.cpp: Renamed from Source/WebKit/WebProcess/WebPage/WebInspectorUI.cpp.
        * WebProcess/Inspector/WebPageInspectorTarget.h: Renamed from Source/WebKit/WebProcess/WebPage/WebPageInspectorTarget.h.
        * WebProcess/Inspector/WebPageInspectorTarget.cpp: Renamed from Source/WebKit/WebProcess/WebPage/WebPageInspectorTarget.cpp.
        * WebProcess/Inspector/WebPageInspectorTargetController.h: Renamed from Source/WebKit/WebProcess/WebPage/WebPageInspectorTargetController.h.
        * WebProcess/Inspector/WebPageInspectorTargetController.cpp: Renamed from Source/WebKit/WebProcess/WebPage/WebPageInspectorTargetController.cpp.
        * WebProcess/Inspector/WebPageInspectorTargetFrontendChannel.h: Renamed from Source/WebKit/WebProcess/WebPage/WebPageInspectorTargetFrontendChannel.h.
        * WebProcess/Inspector/WebPageInspectorTargetFrontendChannel.cpp: Renamed from Source/WebKit/WebProcess/WebPage/WebPageInspectorTargetFrontendChannel.cpp.
        * WebProcess/Inspector/gtk/WebInspectorUIGtk.cpp: Renamed from Source/WebKit/WebProcess/WebPage/gtk/WebInspectorUIGtk.cpp.
        * WebProcess/Inspector/mac/WebInspectorUIMac.mm: Renamed from Source/WebKit/WebProcess/WebPage/mac/WebInspectorUIMac.mm.
        * WebProcess/Inspector/win/WebInspectorUIWin.mm: Renamed from Source/WebKit/WebProcess/WebPage/win/WebInspectorUIWin.mm.

        * UIProcess/API/APIAttachment.h:
        * UIProcess/API/Cocoa/WKWebViewTesting.mm:
        Add some missing includes.

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

        Unreviewed, drop unused MESSAGE_CHECK_CONTEXTID() macro in UserMediaCaptureManagerProxy.cpp.

        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:

2020-01-27  Devin Rousso  <drousso@apple.com>

        Web Inspector: unable to evaluate in the isolated world of content scripts injected by safari app extensions
        https://bugs.webkit.org/show_bug.cgi?id=206110
        <rdar://problem/16945643>

        Reviewed by Timothy Hatcher, Joseph Pecoraro, and Brian Burg.

        In addition to evaluating in subframe execution contexts, add the ability for Web Inspector
        to evaluate in non-normal isolated worlds.

        * WebProcess/InjectedBundle/InjectedBundleScriptWorld.h:
        * WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp:
        (WebKit::InjectedBundleScriptWorld::create):

        * WebProcess/UserContent/WebUserContentController.cpp:
        (WebKit::WebUserContentController::addUserContentWorlds):
        * WebProcess/InjectedBundle/API/glib/WebKitScriptWorld.cpp:
        (webkit_script_world_new):
        (webkit_script_world_new_with_name):
        Treat isolated worlds created by API calls as `User` worlds.

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

        Unreviewed, revert r253984 as it appears to be causing assertion leaks.
        https://bugs.webkit.org/show_bug.cgi?id=205687

        * Configurations/WebKit.xcconfig:
        * Platform/spi/ios/RunningBoardServicesSPI.h: Removed.
        * Scripts/process-entitlements.sh:
        * Shared/DependencyProcessAssertion.cpp: Removed.
        * Shared/DependencyProcessAssertion.h: Removed.
        * Shared/NativeWebTouchEvent.h:
        * Shared/ios/DependencyProcessAssertionIOS.mm: Removed.
        * Sources.txt:
        * SourcesCocoa.txt:
        * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
        (WebKit::WebProcessProxy::processWasResumed):
        * UIProcess/WebProcessProxy.h:
        * UIProcess/WebProcessProxy.messages.in:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::initializeConnection):
        * WebProcess/WebProcess.h:
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::processTaskStateDidChange):
        (WebKit::WebProcess::releaseProcessWasResumedAssertions):

2020-01-27  Jiewen Tan  <jiewen_tan@apple.com>

        Unreviewed, a build fix after r255111

        * UIProcess/WebAuthentication/Mock/MockLocalConnection.mm:
        Adding some missing headers.

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

        Unreviewed, revert r254210 as it seems to be causing process assertion leaks.
        https://bugs.webkit.org/show_bug.cgi?id=205836

        * Shared/AuxiliaryProcess.cpp:
        (WebKit::AuxiliaryProcess::initializeConnection):
        * Shared/AuxiliaryProcess.h:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::initializeConnection):
        * WebProcess/WebProcess.h:

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

        Remove last bits of location services rules
        https://bugs.webkit.org/show_bug.cgi?id=206023
        <rdar://problem/58452505>

        Reviewed by Per Arne Vollan.

        Remove the user preferences that were allowed by the sandbox back when location services
        were used in the process.

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

2020-01-27  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Throttling requestAnimationFrame should be controlled by RenderingUpdateScheduler
        https://bugs.webkit.org/show_bug.cgi?id=204713

        Reviewed by Simon Fraser.

        Create an IPC message on the DrawingArea to send a message from the
        WebProcess to the UIProcess to setPreferredFramesPerSecond of the
        DisplayRefreshMonitor.

        * Shared/WebPreferences.yaml:
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetRenderingUpdateThrottlingEnabled):
        (WKPreferencesGetRenderingUpdateThrottlingEnabled):
        * UIProcess/API/C/WKPreferencesRefPrivate.h:
        Add a WKPreference key for RenderingUpdateThrottlingEnabled.

        * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h:
        * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.messages.in:

        * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
        (-[WKOneShotDisplayLinkHandler setPreferredFramesPerSecond:]):
        (WebKit::RemoteLayerTreeDrawingAreaProxy::setPreferredFramesPerSecond):
        Set the preferredFramesPerSecond of the CADisplayLink.

        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.h:
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm:
        (WebKit::RemoteLayerTreeDisplayRefreshMonitor::setPreferredFramesPerSecond):
        Delegate the call to RemoteLayerTreeDrawingArea.

        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
        (WebKit::RemoteLayerTreeDrawingArea::setPreferredFramesPerSecond):
        Send the IPC message from the WebProcess to the UIProcess.

2020-01-27  Kate Cheney  <katherine_cheney@apple.com>

        Delete the ITP storage file that is not being used (plist or database file) when switching to a new storage type
        https://bugs.webkit.org/show_bug.cgi?id=206601
        <rdar://problem/58696521>

        Reviewed by Alex Christensen.

        This patch also deletes the temporary files SQLite creates when
        constructing a new database.

        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):

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

        Remove locationd entitlements from the WebContent process
        https://bugs.webkit.org/show_bug.cgi?id=206022
        <rdar://problem/58452443>

        Reviewed by Per Arne Vollan.

        Now that we have removed mach connections related to 'com.apple.locationd', we should also
        remove the process entitlements.
        
        No new tests. There are no changes to behavior.

        * Scripts/process-entitlements.sh:

2020-01-27  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r255131.

        Caused assertion failures on iOS debug bots.

        Reverted changeset:

        "Throttling requestAnimationFrame should be controlled by
        RenderingUpdateScheduler"
        https://bugs.webkit.org/show_bug.cgi?id=204713
        https://trac.webkit.org/changeset/255131

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

        NetworkProcessProxy: MESSAGE_CHECK identifiers sent over IPC
        https://bugs.webkit.org/show_bug.cgi?id=206814
        <rdar://problem/58783422>

        Reviewed by David Kilzer.

        MESSAGE_CHECK identifiers sent over IPC in NetworkProcessProxy class.

        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::didFetchWebsiteData):
        (WebKit::NetworkProcessProxy::didDeleteWebsiteData):
        (WebKit::NetworkProcessProxy::didDeleteWebsiteDataForOrigins):

2020-01-26  Fujii Hironori  <Hironori.Fujii@sony.com>

        [WinCairo][curl] ASSERTION FAILED: sessionID != PAL::SessionID::defaultSessionID() in NetworkProcess since r255067
        https://bugs.webkit.org/show_bug.cgi?id=206817

        Reviewed by Darin Adler.

        Since r255067 (Bug 206700), the assertion is failing in
        NetworkProcess::destroySession while shutdown, which is ensuring
        the destructing session isn't the default session.

        Covered by existing tests.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::destroySession): Conditioned out the
        assertion for curl port as well as Soup port does.

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

        Frequent sync BackForwardBackListCount/BackForwardForwardListCount IPC on reddit.com
        https://bugs.webkit.org/show_bug.cgi?id=206438

        Reviewed by Darin Adler.

        Frequent sync BackForwardBackListCount/BackForwardForwardListCount IPC on reddit.com. When scrolling on reddit.com,
        you frequently see 2 consecutive sync IPCs (WebPageProxy::BackForwardBackListCount then WebPageProxy::BackForwardForwardListCount)
        from the WebContent process to the UIProcess. Those are bad for performance. This happens every time the script on the page accesses
        history.length, which is unfortunate, since this history length rarely changes.

        To address the issue, the following changes were made:
        1. Merge BackForwardBackListCount / BackForwardForwardListCount IPCs into a single BackForwardListCounts IPC which returns both
           the back & forward counts, since we often need both (e.g. when accessing history.length) and since gettings those counts is
           very cheap compared to the cost of a sync IPC.
        2. Cache those counts in WebBackForwardListProxy and blow away the cached counts whenever the back/forward list changes. In the
           common case (where the back/forward list rarely changes), we now see a single sync IPC instead of many (verified on reddit.com).

        No new tests, merely a performance improvement.

        * UIProcess/WebPageProxy.cpp:
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * WebProcess/WebPage/WebBackForwardListProxy.cpp:
        (WebKit::WebBackForwardListProxy::addItemFromUIProcess):
        (WebKit::WebBackForwardListProxy::addItem):
        (WebKit::WebBackForwardListProxy::goToItem):
        (WebKit::WebBackForwardListProxy::backListCount const):
        (WebKit::WebBackForwardListProxy::forwardListCount const):
        (WebKit::WebBackForwardListProxy::cacheListCountsIfNecessary const):
        (WebKit::WebBackForwardListProxy::clearCachedListCounts):
        (WebKit::WebBackForwardListProxy::close):
        (WebKit::WebBackForwardListProxy::clear):
        * WebProcess/WebPage/WebBackForwardListProxy.h:

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

        Use ObjectIdentifier for remote RealtimeMediaSource
        https://bugs.webkit.org/show_bug.cgi?id=206808
        <rdar://problem/58705405>

        Reviewed by Eric Carlson.

        Use ObjectIdentifier instead of uint64_t.
        This is clearer and prevents receiving identifier of value zero from IPC.
        Remove related message checks.

        * Scripts/webkit/messages.py:
        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
        (WebKit::UserMediaCaptureManagerProxy::SourceProxy::SourceProxy):
        (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
        (WebKit::UserMediaCaptureManagerProxy::startProducingData):
        (WebKit::UserMediaCaptureManagerProxy::stopProducingData):
        (WebKit::UserMediaCaptureManagerProxy::end):
        (WebKit::UserMediaCaptureManagerProxy::capabilities):
        (WebKit::UserMediaCaptureManagerProxy::setMuted):
        (WebKit::UserMediaCaptureManagerProxy::applyConstraints):
        (WebKit::UserMediaCaptureManagerProxy::clone):
        (WebKit::UserMediaCaptureManagerProxy::requestToEnd):
        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
        * WebProcess/cocoa/UserMediaCaptureManager.cpp:
        (WebKit::UserMediaCaptureManager::Source::Source):
        (WebKit::UserMediaCaptureManager::Source::sourceID const):
        (WebKit::UserMediaCaptureManager::createCaptureSource):
        (WebKit::UserMediaCaptureManager::sourceStopped):
        (WebKit::UserMediaCaptureManager::captureFailed):
        (WebKit::UserMediaCaptureManager::sourceMutedChanged):
        (WebKit::UserMediaCaptureManager::sourceSettingsChanged):
        (WebKit::UserMediaCaptureManager::storageChanged):
        (WebKit::UserMediaCaptureManager::ringBufferFrameBoundsChanged):
        (WebKit::UserMediaCaptureManager::audioSamplesAvailable):
        (WebKit::UserMediaCaptureManager::remoteVideoSampleAvailable):
        (WebKit::UserMediaCaptureManager::sourceEnded):
        (WebKit::UserMediaCaptureManager::applyConstraintsSucceeded):
        (WebKit::UserMediaCaptureManager::applyConstraintsFailed):
        (WebKit::UserMediaCaptureManager::cloneVideoSource):
        * WebProcess/cocoa/UserMediaCaptureManager.h:
        * WebProcess/cocoa/UserMediaCaptureManager.messages.in:

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

        Protect against crashes during WKWebView init function when methods are called before the view is fully initialized
        https://bugs.webkit.org/show_bug.cgi?id=206799
        rdar://problem/58871371

        Reviewed by Sam Weinig.

        Part way through creating WKWebView, some methods can be called and they need to be careful
        not to use anything that may not be initialized yet.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView dealloc]): Check _page for null, since this might happen if the superclass's
        init method returned nil.

        * UIProcess/API/ios/WKWebViewIOS.mm:
        (-[WKWebView _frameOrBoundsChanged]): Check _page for null, since this might be called
        before object initialization is complete.
        (-[WKWebView setSemanticContentAttribute:]): Ditto.

        * UIProcess/API/mac/WKWebViewMac.mm:
        (-[WKWebView setFrameSize:]): Check _impl for null since this might be called before
        oject initialization is complete.
        (-[WKWebView setUserInterfaceLayoutDirection:]): Ditto.
        (-[WKWebView renewGState]): Ditto.

2020-01-26  Said Abou-Hallawa  <said@apple.com>

        Throttling requestAnimationFrame should be controlled by RenderingUpdateScheduler
        https://bugs.webkit.org/show_bug.cgi?id=204713

        Reviewed by Simon Fraser.

        Create an IPC message on the DrawingArea to send a message from the
        WebProcess to the UIProcess to setPreferredFramesPerSecond of the
        DisplayRefreshMonitor.

        * Shared/WebPreferences.yaml:
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetRenderingUpdateThrottlingEnabled):
        (WKPreferencesGetRenderingUpdateThrottlingEnabled):
        * UIProcess/API/C/WKPreferencesRefPrivate.h:
        Add a WKPreference key for RenderingUpdateThrottlingEnabled.

        * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h:
        * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.messages.in:

        * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
        (-[WKOneShotDisplayLinkHandler setPreferredFramesPerSecond:]):
        (WebKit::RemoteLayerTreeDrawingAreaProxy::setPreferredFramesPerSecond):
        Set the preferredFramesPerSecond of the CADisplayLink.

        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.h:
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm:
        (WebKit::RemoteLayerTreeDisplayRefreshMonitor::setPreferredFramesPerSecond):
        Delegate the call to RemoteLayerTreeDrawingArea.

        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
        (WebKit::RemoteLayerTreeDrawingArea::setPreferredFramesPerSecond):
        Send the IPC message from the WebProcess to the UIProcess.

2020-01-25  Brady Eidson  <beidson@apple.com>

        Make ContentWorlds be identified by an ObjectIdentifier instead of a uint64_t
        https://bugs.webkit.org/show_bug.cgi?id=206784

        Reviewed by Alex Christensen.

        Refactor: No behavior change.

        * Scripts/webkit/messages.py:

        * Shared/AuxiliaryProcess.cpp:
        (WebKit::AuxiliaryProcess::initialize):

        * Shared/ContentWorldShared.h:
        (WebKit::pageContentWorldIdentifier):

        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:

        * Shared/WebUserContentControllerDataTypes.cpp:
        (WebKit::WebUserScriptData::decode):
        (WebKit::WebUserStyleSheetData::decode):
        (WebKit::WebScriptMessageHandlerData::decode):
        * Shared/WebUserContentControllerDataTypes.h:

        * UIProcess/API/APIContentWorld.cpp:
        (API::ContentWorld::pageContentWorld):
        (API::ContentWorld::defaultClientWorld):
        (API::ContentWorld::ContentWorld):
        (API::ContentWorldBase::generateIdentifier): Deleted.

        * UIProcess/API/APIContentWorld.h:
        (API::ContentWorldBase::identifier const):
        (API::ContentWorldBase::worldData const):
        (API::ContentWorldBase::ContentWorldBase):
        * UIProcess/API/APIUserContentWorld.cpp:
        (API::UserContentWorld::UserContentWorld):

        * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
        (WebKit::WebUserContentControllerProxy::removeUserContentWorldUses):
        (WebKit::WebUserContentControllerProxy::removeAllUserScripts):
        (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets):

        * WebProcess/UserContent/WebUserContentController.cpp:
        (WebKit::worldMap):
        (WebKit::WebUserContentController::worldForIdentifier):
        (WebKit::WebUserContentController::addUserContentWorld):
        (WebKit::WebUserContentController::addUserContentWorlds):
        (WebKit::WebUserContentController::removeUserContentWorlds):
        (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):
        * WebProcess/UserContent/WebUserContentController.h:
        * WebProcess/UserContent/WebUserContentController.messages.in:

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::runJavaScript):
        (WebKit::WebPage::runJavaScriptInMainFrameScriptWorld):
        (WebKit::WebPage::runJavaScriptInFrame):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

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

        [Cocoa] Media mime types map should be created in the UI process
        https://bugs.webkit.org/show_bug.cgi?id=206478

        Reviewed by Darin Adler.

        Send the mime type map from the UI process to the WebContent process as part of the
        WebProcess 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-01-25  Antti Koivisto  <antti@apple.com>

        [LFC][Integration] Re-enable line layout integration
        https://bugs.webkit.org/show_bug.cgi?id=206795
        <rdar://problem/58853907>

        Reviewed by Zalan Bujtas.

        * Shared/WebPreferences.yaml:

2020-01-24  Tim Horton  <timothy_horton@apple.com>

        macCatalyst: Don't get any custom cursors in subframes
        https://bugs.webkit.org/show_bug.cgi?id=206781
        <rdar://problem/58698374>

        Reviewed by Simon Fraser.

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::positionInformation):
        Adjust the hit test to allow child frame content, and reorganize the
        rest of the code to use the hit frame instead of the main frame.

2020-01-24  Jiewen Tan  <jiewen_tan@apple.com>

        Unreviewed, a speculative test fix after r255041

        * UIProcess/WebAuthentication/Mock/MockLocalConnection.mm:
        (WebKit::MockLocalConnection::getAttestation const):

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

        [iOS] Long pressing text inside a selection should update the selection
        https://bugs.webkit.org/show_bug.cgi?id=206769
        <rdar://problem/58704316>

        Reviewed by Tim Horton.

        Makes it possible to update the selection using text interaction gestures inside an existing text selection. To
        do this, we remove code that was previously required in order to disambiguate text selection and drag gestures.
        However, since adopting asynchronous drag interaction SPI, this check has not been necessary.

        The only other purpose of this check was to avoid triggering text selection gestures after canceling a drag
        that did not begin (i.e. the touch location did not move). Instead of bailing in -textInteractionGestures:
        shouldBeginAtPoint: and -hasSelectablePositionAtPoint:, we can achieve the same effect by simply resetting the
        text interaction gestures when the drag lift begins (at which point we know the drag interaction is starting).
        This also ensures that on iPad, in the case where the drag was cancelled by the page, long pressing may still
        trigger text selection.

        Test: editing/selection/ios/select-text-in-existing-selection.html

        * Shared/ios/InteractionInformationAtPosition.h:
        * Shared/ios/InteractionInformationAtPosition.mm:
        (WebKit::InteractionInformationAtPosition::encode const):
        (WebKit::InteractionInformationAtPosition::decode):

        Remove the hasSelectionAtPosition flag from position information, since we no longer need it.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[UIGestureRecognizer _wk_cancel]):

        Drive-by fix: just ignore the gesture if it is already disabled. This prevents us from causing a gesture
        recognizer that was previously disabled to become enabled as a result of calling -_wk_cancel.

        (-[WKContentView hasSelectablePositionAtPoint:]):
        (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
        (-[WKContentView cancelActiveTextInteractionGestures]):

        Instead of making the text interaction gestures return NO from -gestureRecognizerShouldBegin:, explicitly cancel
        the text interaction gestures that may select text.

        (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]):
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::positionInformation):

        Remove the hasSelectionAtPosition flag from position information, since we no longer need it.

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

        Update EditorState from WebProcess when requesting context menu
        https://bugs.webkit.org/show_bug.cgi?id=206775
        <rdar://problem/56305573>

        Reviewed by Wenson Hsieh.

        When generating a context menu, AppKit calls -validRequestorForSendType:returnType:
        which queries the editor state in WebViewImpl::validRequestorForSendAndReturnTypes.
        Without updating the editor state, the first time you right click on a link,
        the Services menu item did not appear because we were looking at a stale editor state.
        Verified manually this fixes the bug.

        * WebProcess/WebPage/WebContextMenu.cpp:
        (WebKit::WebContextMenu::show):
        * WebProcess/WebPage/mac/WebPageMac.mm:
        (WebKit::WebPage::handleSelectionServiceClick):

2020-01-24  Tim Horton  <timothy_horton@apple.com>

        macCatalyst: Right clicking on links follows the link, but shouldn't
        https://bugs.webkit.org/show_bug.cgi?id=206777
        <rdar://problem/56586280>

        Reviewed by Wenson Hsieh.

        * UIProcess/ios/WKMouseGestureRecognizer.mm:
        (-[WKMouseGestureRecognizer createMouseEventWithType:forEvent:]):
        (-[WKMouseGestureRecognizer touchesEnded:withEvent:]):
        I got 'button' and 'buttons' backwards.

        'button' indicates which button the event is about, so in MouseUp,
        it should still be 2.

        'buttons' indicate which buttons are still down, so in MouseUp,
        it should not include 2. Since we don't currently track mouse button
        chording here, we'll just say "none". Leave a FIXME about that.

        This makes WebCore's behavior correct, and now it doesn't follow the link.

2020-01-24  Jiewen Tan  <jiewen_tan@apple.com>

        Unreviewed, a build fix after r255056

        * UIProcess/WebAuthentication/Mock/MockLocalConnection.mm:
        (WebKit::MockLocalConnection::getAttestation const):

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

        Unreviewed, rolling out r255050.

        Introduced crashes on bots

        Reverted changeset:

        "[Cocoa] Media mime types map should be created in the UI
        process"
        https://bugs.webkit.org/show_bug.cgi?id=206478
        https://trac.webkit.org/changeset/255050

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

        [iOS] Add missing sysctl-read permission (already available in macOS sandbox)
        https://bugs.webkit.org/show_bug.cgi?id=206713
        <rdar://problem/57665153>

        Reviewed by Per Arne Vollan.

        Correct a sandbox violation encountered when attempting to log the system hostname.
        This was already handled properly on macOS, but the rule was not added to the iOS sandbox.

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

2020-01-24  Adrian Perez de Castro  <aperez@igalia.com>

        Fix various non-unified build issues introduced since r254751
        https://bugs.webkit.org/show_bug.cgi?id=206736

        Reviewed by Carlos Garcia Campos.

        * WebProcess/WebPage/WebURLSchemeHandlerProxy.cpp: Add missing WebFrame.h inclusion.

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

        Centralize AuxiliaryProcessMainBase implementations
        https://bugs.webkit.org/show_bug.cgi?id=206700

        Reviewed by Carlos Garcia Campos.

        Non-Cocoa ports share a common usage of AuxiliaryProcessMainBase but the implementations
        don't share a lot of code. This patch centralizes the code and the naming used.

        * NetworkProcess/EntryPoint/unix/NetworkProcessMain.cpp:
        (main):
        * NetworkProcess/EntryPoint/win/NetworkProcessMain.cpp:
        (main):
        * NetworkProcess/NetworkProcessMain.h: Renamed from Source/WebKit/NetworkProcess/win/NetworkProcessMainWin.h.
        * NetworkProcess/curl/NetworkProcessMainCurl.cpp: Renamed from Source/WebKit/NetworkProcess/win/NetworkProcessMainWin.cpp.
        (WebKit::initializeAuxiliaryProcess<NetworkProcess>):
        (WebKit::NetworkProcessMain):
        * NetworkProcess/soup/NetworkProcessMainSoup.cpp:
        (WebKit::NetworkProcessMain):
        (WebKit::NetworkProcessMainUnix): Deleted.
        * NetworkProcess/unix/NetworkProcessMainUnix.h: Removed.
        * PlatformFTW.cmake:
        * PlatformGTK.cmake:
        * PlatformWPE.cmake:
        * PlatformWin.cmake:
        * PluginProcess/EntryPoint/unix/PluginProcessMain.cpp:
        (main):
        * PluginProcess/PluginProcessMain.h: Renamed from Source/WebKit/PluginProcess/unix/PluginProcessMainUnix.h.
        * PluginProcess/unix/PluginProcessMainUnix.cpp:
        (WebKit::PluginProcessMain):
        (WebKit::PluginProcessMainUnix): Deleted.
        * Shared/AuxiliaryProcessMain.h: Renamed from Source/WebKit/Shared/unix/AuxiliaryProcessMain.h.
        * WebProcess/EntryPoint/unix/WebProcessMain.cpp:
        (main):
        * WebProcess/EntryPoint/win/WebProcessMain.cpp:
        (main):
        * WebProcess/WebProcessMain.h: Renamed from Source/WebKit/WebProcess/win/WebProcessMainWin.h.
        * WebProcess/gtk/WebProcessMainGtk.cpp:
        (WebKit::WebProcessMain):
        (WebKit::WebProcessMainUnix): Deleted.
        * WebProcess/playstation/WebProcessMainPlayStation.cpp: Renamed from Source/WebKit/WebProcess/unix/WebProcessMainUnix.h.
        (WebKit::WebProcessMain):
        * WebProcess/win/WebProcessMainWin.cpp:
        (WebKit::WebProcessMain):
        (WebKit::WebProcessMainWin): Deleted.
        * WebProcess/wpe/WebProcessMainWPE.cpp:
        (WebKit::WebProcessMain):
        (WebKit::WebProcessMainUnix): Deleted.
        * webkitglib-symbols.map:

2020-01-24  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Reduce the maximum time we wait for draw events in DrawingMonitor
        https://bugs.webkit.org/show_bug.cgi?id=206662

        Reviewed by Carlos Alberto Lopez Perez.

        1 second is too much, we can wait up to 100_ms instead and wait for the next frame after 16_ms. We should also
        ensure there's a draw event since this is called from dispatchAfterEnsuringDrawing().

        * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp:
        (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::start):
        (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::didDraw):

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

        Make sure fetch tasks go to network if service worker never gets to activated
        https://bugs.webkit.org/show_bug.cgi?id=206648

        Reviewed by Chris Dumez.

        In case activating completion handlers are not called, the fetch task timeout should kick in and make the load go to network process.
        The issue is that our code was using the context connection to do so.
        If the fetch task is waiting for the worker activation, the context connection might not be set and the timeout will be a no-op.

        To fix this, the fetch task will do as if its context is closed when the timeout fires.
        The fetck task now has a weak pointer to the WebSWServerConnection and will use to terminate the service worker as done previously.

        We no longer handle all ongoing fetch tasks of the ongoing service worker.
        Each individual fetch task timeout provides the same level of protection.
        The service worker will anyway get terminated which will race to finalize the service worker fetch tasks with each of their timeout.

        * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp:
        (WebKit::ServiceWorkerFetchTask::ServiceWorkerFetchTask):
        (WebKit::ServiceWorkerFetchTask::timeoutTimerFired):
        * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h:
        * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
        (WebKit::WebSWServerConnection::createFetchTask):
        (WebKit::WebSWServerConnection::fetchTaskTimedOut):
        * NetworkProcess/ServiceWorker/WebSWServerConnection.h:
        * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
        (WebKit::WebSWServerToContextConnection::fetchTaskTimedOut):

2020-01-23  Jiewen Tan  <jiewen_tan@apple.com>

        Unreviewed, a follow up on r254894

        * UIProcess/WebAuthentication/Mock/MockLocalConnection.mm:
        (WebKit::MockLocalConnection::getAttestation const):
        Includes the status code in the message.

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

        [iOS] Support setting minimum effective device width during dynamic viewport size updates
        https://bugs.webkit.org/show_bug.cgi?id=206709
        <rdar://problem/58713872>

        Reviewed by Tim Horton.

        Changes to minimum effective device width are currently always propagated to the web process via out-of-band
        updates to the web process. During animated resize, Safari currently changes the minimum effective device width
        prior to updating the view size; this causes the viewport configuration to temporarily be in a state where the
        new value for minimum effective device width is used, but the old viewport width and height are still used.

        This subsequently breaks existing logic in WebPage::dynamicViewportSizeUpdate that attempts to keep the portion
        of the unobscured content width that is visible consistent before and after rotation (see
        visibleHorizontalFraction), since that code will be mislead into believing that the wrong fraction of content
        width is visible.

        To fix this, we roll minimum effective device width changes along with view size (and other attributes) in
        dynamic viewport size updates.

        Test: WebKit.ChangeFrameAndMinimumEffectiveDeviceWidthDuringAnimatedResize

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

        During animated resize, just set m_minimumEffectiveDeviceWidth without notifying the web process; if the value
        changed during the update block, we send the new minimum effective device width to the web page as a part of
        the dynamic viewport size update.

        Also, make a drive-by adjustment to use `_page->viewLayoutSize()` instead of recomputing the active layout
        bounds when we know that only the minimum effective device width is changing. We also apply the same adjustment
        above, in -_setViewScale:.

        * UIProcess/API/ios/WKWebViewIOS.mm:
        (-[WKWebView _beginAnimatedResizeWithUpdates:]):
        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::viewLayoutSize const):
        (WebKit::WebPageProxy::setMinimumEffectiveDeviceWidthWithoutViewportConfigurationUpdate):

        Add a helper method to update the minimum effective device width without updating the viewport configuration in
        the web process. This is only used when the minimum effective device width is specified in the middle of a
        dynamic viewport size update (i.e. animated resize).

        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::dynamicViewportSizeUpdate):

        Plumb the new minimum effective device width over to the web process as a part of the dynamic viewport size
        update, and update both the new view size and minimum effective device width on the viewport configuration at
        the same time.

        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::dynamicViewportSizeUpdate):

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

        [Cocoa] Media mime types map should be created in the UI process
        https://bugs.webkit.org/show_bug.cgi?id=206478

        Reviewed by Darin Adler.

        Send the mime type map from the UI process to the WebContent process as part of the
        WebProcess 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-01-22  Darin Adler  <darin@apple.com>

        Remove some unneeded definitions from Platform.h family headers
        https://bugs.webkit.org/show_bug.cgi?id=206642

        Reviewed by Eric Carlson.

        * Platform/cocoa/PaymentAuthorizationViewController.mm:
        (-[WKPaymentAuthorizationViewControllerDelegate _getPaymentServicesMerchantURL:]):
        Removed HAVE(PASSKIT_API_TYPE) because it's always 1 on Cocoa platforms and this
        is Cocoa-only code.
        * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
        (WebKit::toAPIType): Ditto.
        (WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest): Ditto.

2020-01-23  Tim Horton  <timothy_horton@apple.com>

        macCatalyst: I-Beam is too conservative, doesn't show up in editable areas with no text
        https://bugs.webkit.org/show_bug.cgi?id=206716
        <rdar://problem/58359523>

        Reviewed by Simon Fraser.

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::lineCaretExtent):
        (WebKit::populateCaretContext):
        (WebKit::WebPage::positionInformation):
        Instead of uniting the caret position for the first and last position
        on the line to find the I-Beam region, use the bounds of the selection
        rect for the line, which extends beyond existing text, matching our
        traditional behavior of showing the I-Beam over blank regions.

2020-01-23  Tomoki Imai  <Tomoki.Imai@sony.com>

        Set proper TextureMapperLayer::m_contentsLayer in updateImageBacking
        https://bugs.webkit.org/show_bug.cgi?id=206212

        Reviewed by Žan Doberšek.

        There is a chance to set a wrong TextureMapperLayer::m_contentsLayer.
        It occurs when
        - The previous content layer is removed, and it doesn't have the next content layer. (layerState.contentLayer == nullptr)
        - It has an image backing, which is not visible. (layerState.imageBacking != nullptr, entry.update.isVisible == false)
        In that case, it didn't call TextureMapperLayer::setContentsLayer(nullptr) even if it doesn't have a new content layer.

        This patch set TextureMapperLayer::m_contentsLayer in updateImageBacking regardless of the visibility.
        setBackingStore is not needed in updateImageBacking, as it should be handle only by layerState.backingStore.

        Should be covered by the existing testcases.

        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
        (WebKit::updateImageBacking): Call TextureMapperLayer::setContentsLayer(nullptr) instead of TextureMapperLayer::setBackingStore(nullptr) when it's not visible.

2020-01-23  Daniel Bates  <dabates@apple.com>

        Add a variant of -selectPositionAtPoint that can select an arbitrary point
        https://bugs.webkit.org/show_bug.cgi?id=206712

        Reviewed by Wenson Hsieh.

        Adds a variant of -selectPositionAtPoint, called _selectPositionAtPoint, that takes a boolean
        as to whether to constrain the specified point to stay within the focused element. I will
        make use of this functionality in a subsequent patch.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView selectPositionAtPoint:completionHandler:]): Moved implementation to -_selectPositionAtPoint
        and write this function in terms of it.
        (-[WKContentView _selectPositionAtPoint:stayingWithinFocusedElement:completionHandler:]): Added.

2020-01-23  Kate Cheney  <katherine_cheney@apple.com>

        Background thread with ITP Database should lock when the network process is suspended
        https://bugs.webkit.org/show_bug.cgi?id=206593
        rdar://problem/58713379

        Reviewed by Chris Dumez.

        This patch adds a function to hang the background queue when the
        NetworkProcess is preparing to suspend.

        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::suspend):
        (WebKit::WebResourceLoadStatisticsStore::resume):
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::prepareToSuspend):
        (WebKit::NetworkProcess::resume):

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

        [iOS] Make it possible for WebKit clients to enable connections to asset services in the WebContent process
        https://bugs.webkit.org/show_bug.cgi?id=206551

        Reviewed by Brent Fulgham.

        Add SPI to grant and revoke access to asset services in the WebContent process.

        No new tests, since this should have an API test, but API tests are not running on iOS devices. We could
        create an API test for simulator, but the simulator has no sandbox.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/API/ios/WKWebViewIOS.mm:
        (-[WKWebView _grantAccessToAssetServices]):
        (-[WKWebView _revokeAccessToAssetServices]):
        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::grantAccessToAssetServices):
        (WebKit::WebPageProxy::revokeAccessToAssetServices):
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::grantAccessToAssetServices):
        (WebKit::WebProcess::revokeAccessToAssetServices):

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

        [iOS] Remove access to 'awd' directories
        https://bugs.webkit.org/show_bug.cgi?id=206098
        <rdar://problem/58491816>

        Reviewed by Per Arne Vollan.

        Now that we have removed 'awd' features from the WebContent process, and have blocked access to the
        mach service, we should remove the ability to interact with the 'awd' directories on device.

        No new tests. No change in behavior.

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

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

        [Cocoa] Broker access to the PowerManagement API
        https://bugs.webkit.org/show_bug.cgi?id=206373
        <rdar://problem/34722450>

        Reviewed by Darin Adler.

        Send flag indicating whether device has battery to the WebContent process as part of the
        WebProcess 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-01-23  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r254990.

        Breaks watchOS / tvOS builds.

        Reverted changeset:

        "[iOS] Make it possible for WebKit clients to enable
        connections to asset services in the WebContent process"
        https://bugs.webkit.org/show_bug.cgi?id=206551
        https://trac.webkit.org/changeset/254990

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

        [iOS] Unreviewed follow-up sandbox fix.
        https://bugs.webkit.org/show_bug.cgi?id=206562
        <rdar://problem/58778970>

        I missed a couple of rules that are being overly chatty in the logs in r254982.
        This adds appropriate commands to silence them.

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

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

        [iOS] Make it possible for WebKit clients to enable connections to asset services in the WebContent process
        https://bugs.webkit.org/show_bug.cgi?id=206551

        Reviewed by Brent Fulgham.

        Add SPI to grant and revoke access to asset services in the WebContent process.

        No new tests, since this should have an API test, but API tests are not running on iOS devices. We could
        create an API test for simulator, but the simulator has no sandbox.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/API/ios/WKWebViewIOS.mm:
        (-[WKWebView _grantAccessToAssetServices]):
        (-[WKWebView _revokeAccessToAssetServices]):
        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::grantAccessToAssetServices):
        (WebKit::WebPageProxy::revokeAccessToAssetServices):
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::grantAccessToAssetServices):
        (WebKit::WebProcess::revokeAccessToAssetServices):

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

        [iOS] Camera is lost during WebRTC demo
        https://bugs.webkit.org/show_bug.cgi?id=206613
        <rdar://problem/58764572>

        Reviewed by Brent Fulgham.

        Fix observed sandbox violations in the Networking process.

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

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

        Stop capturing telemetry for well-understood sandbox rules (206562)
        https://bugs.webkit.org/show_bug.cgi?id=206562
        <rdar://problem/58778970>

        Reviewed by Per Arne Vollan.

        Remove logging of sandbox rules that are now understood, and either confirmed to be needed for proper WebKit operation
        or identified for removal through a future update.

        No new tests. No change in behavior.

        * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
        * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

2020-01-23  Alexander Mikhaylenko  <alexm@gnome.org>

        [GTK] Navigation gesture creates CSS nodes and doesn't remove them
        https://bugs.webkit.org/show_bug.cgi?id=206591

        Reviewed by Carlos Garcia Campos.

        Even though foreign drawing uses a temporary GtkStyleContext, calling
        gtk_style_context_set_parent() adds all its CSS nodes to the global
        hierarchy, and then they aren't cleaned up. This shouldn't happen.

        * UIProcess/gtk/ViewGestureControllerGtk.cpp:
        (WebKit::ViewGestureController::createStyleContext):Stop setting GtkStyleContext parent.

2020-01-22  Jon Lee  <jonlee@apple.com>

        [Media in GPU process] Pipe more MediaPlayerPrivate and client methods
        https://bugs.webkit.org/show_bug.cgi?id=206468

        Reviewed by Eric Carlson.

        Pipe more of the media player and client functions. Generally, these are void functions
        that require no parameters.

        Also, the client *changed() functions, when implemented, tend to call the accessor of the property
        that just changed. This seems rather circuitous. The client methods ought to just also pass along
        the value of the new changed value. This patch refactors mediaPlayerCurrentPlaybackTargetIsWirelessChanged
        to do exactly that.

        * GPUProcess/media/RemoteMediaPlayerProxy.cpp:
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerResourceNotSupported):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerEngineUpdated):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerActiveSourceBuffersChanged):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerWaitingForKeyChanged):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerCurrentPlaybackTargetIsWirelessChanged):
        (WebKit::RemoteMediaPlayerProxy::setWirelessVideoPlaybackDisabled):
        (WebKit::RemoteMediaPlayerProxy::setShouldPlayToPlaybackTarget):
        (WebKit::RemoteMediaPlayerProxy::keyAdded):
        (WebKit::RemoteMediaPlayerProxy::beginSimulatedHDCPError):
        (WebKit::RemoteMediaPlayerProxy::endSimulatedHDCPError):
        (WebKit::RemoteMediaPlayerProxy::notifyActiveSourceBuffersChanged):
        (WebKit::RemoteMediaPlayerProxy::applicationWillResignActive):
        (WebKit::RemoteMediaPlayerProxy::applicationDidBecomeActive):
        * GPUProcess/media/RemoteMediaPlayerProxy.h:
        * GPUProcess/media/RemoteMediaPlayerProxy.messages.in:
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
        (WebKit::MediaPlayerPrivateRemote::setWirelessVideoPlaybackDisabled):
        (WebKit::MediaPlayerPrivateRemote::currentPlaybackTargetIsWirelessChanged): Cache value in new member variable.
        (WebKit::MediaPlayerPrivateRemote::isCurrentPlaybackTargetWireless const): Return value.
        (WebKit::MediaPlayerPrivateRemote::setShouldPlayToPlaybackTarget):
        (WebKit::MediaPlayerPrivateRemote::keyAdded):
        (WebKit::MediaPlayerPrivateRemote::waitingForKeyChanged):
        (WebKit::MediaPlayerPrivateRemote::beginSimulatedHDCPError):
        (WebKit::MediaPlayerPrivateRemote::endSimulatedHDCPError):
        (WebKit::MediaPlayerPrivateRemote::notifyActiveSourceBuffersChanged):
        (WebKit::MediaPlayerPrivateRemote::applicationWillResignActive):
        (WebKit::MediaPlayerPrivateRemote::applicationDidBecomeActive):
        (WebKit::MediaPlayerPrivateRemote::resourceNotSupported):
        (WebKit::MediaPlayerPrivateRemote::engineUpdated):
        (WebKit::MediaPlayerPrivateRemote::activeSourceBuffersChanged):
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.h:
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.messages.in:

2020-01-22  Keith Rollin  <krollin@apple.com>

        Fix SDK availability macros
        https://bugs.webkit.org/show_bug.cgi?id=206463
        <rdar://problem/58581906>

        Reviewed by Timothy Hatcher.

        Bug 197841 updated WebKit.xcconfig with regards to when it runs a
        header post-processing script. This post-processing script grovels
        over our exported headers, changing macros like WK_API_AVAILABLE to
        the standard API_AVAILABLE. Because of the change in Bug 197841, the
        script was no longer being run when preparing macOS 10.15 SDKs, which
        was breaking those SDKs. Fix this by reverting the change, allowing
        the macros to be replaced for macOS 10.15.

        We also need to touch WKFoundation.h in order to support incremental
        builds. If we don't, then the version of WKFoundation.h that was
        exported in the previous build and that was incorrectly post-processed
        would remain incorrectly post-processed. Touch the file so that it
        will get re-exported and re-post-processed.

        No new tests - no added or changed functionality.

        * Configurations/WebKit.xcconfig:
        * Shared/API/Cocoa/WKFoundation.h:

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

        Frequent NetworkConnectionToWebProcess::CookiesEnabled sync IPC when browsing reddit.com
        https://bugs.webkit.org/show_bug.cgi?id=206450

        Reviewed by Darin Adler.

        Frequent NetworkConnectionToWebProcess::CookiesEnabled sync IPC when browsing reddit.com. This
        happens every time the page script calls navigator.cookieEnabled. To address the issue, we now
        store the "cookie accept policy" on the WebContent process side. This allows us to know
        synchronously on the WebContent process if cookies are enabled or not and without any IPC to
        the network process. To achieve this, I added a new cookieAcceptPolicy member to
        NetworkProcessConnectionInfo so that the WebContent process is aware of the initial policy when
        it connects to the network process. The policy on the WebContent process side is then kept up
        to date via IPCs from the network process to the WebContent processes whenever the cookie
        accept policy changes.

        * NetworkProcess/Cookies/WebCookieManager.cpp:
        (WebKit::WebCookieManager::setHTTPCookieAcceptPolicy):
        (WebKit::WebCookieManager::getHTTPCookieAcceptPolicy):
        * NetworkProcess/Cookies/WebCookieManager.h:
        * NetworkProcess/Cookies/WebCookieManager.messages.in:
        * NetworkProcess/Cookies/curl/WebCookieManagerCurl.cpp:
        * NetworkProcess/Cookies/mac/WebCookieManagerMac.mm:
        * NetworkProcess/Cookies/soup/WebCookieManagerSoup.cpp:
        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::cookieAcceptPolicyChanged):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
        (WebKit::NetworkProcess::cookieAcceptPolicyChanged):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * Shared/WebProcessCreationParameters.h:
        * UIProcess/API/APIHTTPCookieStore.cpp:
        (API::HTTPCookieStore::setHTTPCookieAcceptPolicy):
        (API::HTTPCookieStore::setHTTPCookieAcceptPolicyInDefaultUIProcessCookieStore):
        * UIProcess/API/APIHTTPCookieStore.h:
        * UIProcess/API/C/WKAPICast.h:
        (WebKit::toHTTPCookieAcceptPolicy):
        (WebKit::toAPI):
        * UIProcess/API/Cocoa/APIHTTPCookieStoreCocoa.mm:
        (API::toNSHTTPCookieAcceptPolicy):
        (API::HTTPCookieStore::setHTTPCookieAcceptPolicyInDefaultUIProcessCookieStore):
        * UIProcess/API/Cocoa/WKHTTPCookieStore.mm:
        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (toHTTPCookieAcceptPolicy):
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::openNetworkProcessConnection):
        * UIProcess/WebCookieManagerProxy.h:
        * UIProcess/WebProcessPool.h:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/Network/NetworkProcessConnection.cpp:
        (WebKit::NetworkProcessConnection::NetworkProcessConnection):
        (WebKit::NetworkProcessConnection::writeBlobsToTemporaryFiles):
        (WebKit::NetworkProcessConnection::cookiesEnabled):
        (WebKit::NetworkProcessConnection::cookieAcceptPolicyChanged):
        * WebProcess/Network/NetworkProcessConnection.h:
        (WebKit::NetworkProcessConnection::create):
        * WebProcess/Network/NetworkProcessConnection.messages.in:
        * WebProcess/Network/NetworkProcessConnectionInfo.h:
        (WebKit::NetworkProcessConnectionInfo::encode const):
        (WebKit::NetworkProcessConnectionInfo::decode):
        * WebProcess/WebPage/WebCookieJar.cpp:
        (WebKit::WebCookieJar::cookiesEnabled const):
        - Return false early if the document has no frame / page (cookie-averse as per spec)
        - Return false early if ITP is enabled and it is a third-party iframe without storage
          access. This bypasses the sync IPC call completely for such iframes.

        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::ensureNetworkProcessConnection):

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

        [IPC Hardening] Only process Messages::NetworkProcess messages when sent by the UIProcess
        https://bugs.webkit.org/show_bug.cgi?id=206558

        Unreviewed post-landing review comments from Darin Adler after r254892.

        * Platform/IPC/StringReference.h:
        (IPC::operator==):
        (IPC::operator!=):
        (IPC::StringReference::Hash::equal):
        (IPC::StringReference::operator==): Deleted.
        (IPC::StringReference::operator!=): Deleted.

2020-01-22  Antti Koivisto  <antti@apple.com>

        [LFC][Integration] Disable integration to see performance impact
        https://bugs.webkit.org/show_bug.cgi?id=206576
        <rdar://problem/58562185>

        Reviewed by Zalan Bujtas.

        * Shared/WebPreferences.yaml:

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

        Add logging of the source of a response used to respond a fetch event
        https://bugs.webkit.org/show_bug.cgi?id=206426

        Reviewed by Darin Adler.

        * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp:
        (WebKit::ServiceWorkerFetchTask::didReceiveResponse):
        Log the source of the response.
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::havePerformedSecurityChecks const):
        Add case of DOMCache, similar to ServiceWorker.

2020-01-21  Fujii Hironori  <Hironori.Fujii@sony.com>

        [Win][WK2] Pressing space key on text input form scrolls the page
        https://bugs.webkit.org/show_bug.cgi?id=201632

        Reviewed by Ross Kirsling.

        r223262 was add WebPage::performDefaultBehaviorForKeyEvent for
        Windows port by copying GTK port's implementation. But, Windows
        port is using unique key event processing. It dispatches
        WebEvent::RawKeyDown and WebEvent::Char separately even though
        other ports dispatch only WebEvent::KeyDown by unifying them.

        Because WebPage::performDefaultBehaviorForKeyEvent handled
        WebEvent::RawKeyDown of space key to scroll page, and consumed the
        event, the keypress event of space key wasn't dispatched.

        The keypress event of a space key is handled in
        EventHandler::defaultSpaceEventHandler.
        performDefaultBehaviorForKeyEvent don't need to do it.

        Tests: Coverted by fast/events/space-scroll-event.html

        * WebProcess/WebPage/win/WebPageWin.cpp:
        (WebKit::WebPage::performDefaultBehaviorForKeyEvent): Don't handle VK_SPACE.

2020-01-21  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthn] Incorporate more detailed UnknownError messages for LocalAuthenticator
        https://bugs.webkit.org/show_bug.cgi?id=191530

        Reviewed by Brent Fulgham.

        This patch replaces UnknownError messages within LocalAuthenticator with the LOG_ERROR
        messages. At the meantime, it enhances MockLocalConnection::getAttestation to return
        errors instead of assertions.

        * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
        (WebKit::LocalAuthenticator::makeCredential):
        (WebKit::LocalAuthenticator::continueMakeCredentialAfterUserConsented):
        (WebKit::LocalAuthenticator::continueMakeCredentialAfterAttested):
        (WebKit::LocalAuthenticator::getAssertion):
        (WebKit::LocalAuthenticator::continueGetAssertionAfterUserConsented):
        * UIProcess/WebAuthentication/Mock/MockLocalConnection.mm:
        (WebKit::MockLocalConnection::getAttestation const):

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

        [IPC Hardening] Only process Messages::NetworkProcess messages when sent by the UIProcess
        https://bugs.webkit.org/show_bug.cgi?id=206558
        <rdar://problem/58733679>

        Reviewed by Alex Christensen.

        Port UpdateQuotaBasedOnSpaceUsageForTesting IPC from the NetworkProcess to the NetworkConnectionToWebProcess
        since it is sent by the WebContent process. As a result, we can now stop forwarding all Messages::NetworkProcess
        IPC messages from the WebContent process to the NetworkProcess class.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
        (WebKit::NetworkConnectionToWebProcess::didReceiveSyncMessage):
        (WebKit::NetworkConnectionToWebProcess::updateQuotaBasedOnSpaceUsageForTesting):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::didReceiveMessage):
        (WebKit::NetworkProcess::didReceiveSyncMessage):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * Platform/IPC/StringReference.h:
        (IPC::StringReference::operator!=):
        * WebProcess/Cache/WebCacheStorageConnection.cpp:
        (WebKit::WebCacheStorageConnection::updateQuotaBasedOnSpaceUsage):

2020-01-22  Simon Fraser  <simon.fraser@apple.com>

        Fixed elements no longer stay fixed with elastic overscroll
        https://bugs.webkit.org/show_bug.cgi?id=206227
        rdar://problem/58707084

        Reviewed by Antti Koivisto.

        Intended behavior on iOS and macOS is for position:fixed and sticky elements to maintain
        their position relative to the view bounds when rubber-banding ("overscrolling"). This broke
        some time back. This change restores the correct behavior with the call to layoutViewportRespectingRubberBanding()
        in ScrollingTreeFixedNode::applyLayerPositions() and ScrollingTreeStickyNode::computeLayerPosition().
        layoutViewportRespectingRubberBanding() computes a layout viewport without clamping.

        The rest of the changes are to support testing. internals.unconstrainedScrollTo()
        didn't work for main frame scrolling because of scroll position clamping in various places,
        so propagate ScrollClamping in more places (and replace the redundant ScrollPositionClamp with ScrollClamping).

        "requested scroll position" updates now carry along both clamping and "is programmatic" data, wrapped in a struct
        which is passed around the scrolling tree. This allows us to not clamp the scroll position (for testing) in more places.

        * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
        (ArgumentCoder<ScrollingStateScrollingNode>::encode):
        (ArgumentCoder<ScrollingStateScrollingNode>::decode):
        (ArgumentCoder<RequestedScrollData>::encode):
        (ArgumentCoder<RequestedScrollData>::decode):
        (WebKit::dump):
        * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
        (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeRequestsScroll):
        * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
        * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
        (WebKit::RemoteScrollingTree::scrollingTreeNodeRequestsScroll):
        * UIProcess/RemoteLayerTree/RemoteScrollingTree.h:
        * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
        (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateAfterChildren):
        * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
        (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren):

2020-01-21  Daniel Bates  <dabates@apple.com>

        Add Legacy WebKit SPI and WebKit IPI to show and hide placeholder
        https://bugs.webkit.org/show_bug.cgi?id=206459
        <rdar://problem/58700534>

        Reviewed by Wenson Hsieh.

        Add Modern WebKit IPI to control whether the placeholder can be shown or not when a form
        control is empty. This is for aesthetics.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::setCanShowPlaceholder): Added.
        * UIProcess/WebPageProxy.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::setCanShowPlaceholder): Added. Maps the input text to its element. If it's
        a HTML text form control element then calls through to HTMLTextFormControlElement::setCanShowPlaceholder().
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        Added new message.

2020-01-21  Jiewen Tan  <jiewen_tan@apple.com>

        ProvisionalPageProxy::loadData should pass last navigation's shouldOpenExternalURLsPolicy flag to WebPageProxy
        https://bugs.webkit.org/show_bug.cgi?id=206462
        <rdar://problem/57468718>

        Reviewed by Chris Dumez.

        Covered by API tests.

        This patch also does it for ProvisionalPageProxy::loadRequest.

        * UIProcess/ProvisionalPageProxy.cpp:
        (WebKit::ProvisionalPageProxy::loadData):
        (WebKit::ProvisionalPageProxy::loadRequest):
        * UIProcess/ProvisionalPageProxy.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::continueNavigationInNewProcess):

2020-01-21  Rob Buis  <rbuis@igalia.com>

        Add build flag for stale-while-revalidate
        https://bugs.webkit.org/show_bug.cgi?id=204169

        Reviewed by Youenn Fablet.

        * Configurations/FeatureDefines.xcconfig:
        * NetworkProcess/cache/AsyncRevalidation.cpp:
        * NetworkProcess/cache/AsyncRevalidation.h:
        * NetworkProcess/cache/NetworkCache.cpp:
        (WebKit::NetworkCache::responseNeedsRevalidation):
        (WebKit::NetworkCache::makeStoreDecision):
        (WebKit::NetworkCache::Cache::retrieve):
        * NetworkProcess/cache/NetworkCache.h:
        * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
        * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:

2020-01-21  David Kilzer  <ddkilzer@apple.com>

        IPC::Decoder should use nullptr as invalid value
        <https://webkit.org/b/203880>
        <rdar://problem/53159906>

        Follow-up fix noticed by Chris Dumez.

        * Platform/IPC/Decoder.cpp:
        (IPC::alignedBufferIsLargeEnoughToContain): Fix typo in comment.

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

        [macOS] Add managed preference to allow synchronous XHR during page dismissal
        https://bugs.webkit.org/show_bug.cgi?id=206540
        <rdar://problem/58644447>

        Reviewed by Alex Christensen.

        Add managed preference to allow synchronous XHR during page dismissal. This is temporarily needed by some
        enterprise products until they can update their code.

        * Shared/WebPreferences.yaml:
        * Shared/WebPreferencesDefaultValues.cpp:
        (WebKit::defaultDisallowSyncXHRDuringPageDismissalEnabled):
        * Shared/WebPreferencesDefaultValues.h:

2020-01-21  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r254876.

        Broke Catalina builds.

        Reverted changeset:

        "Fix SDK availability macros"
        https://bugs.webkit.org/show_bug.cgi?id=206463
        https://trac.webkit.org/changeset/254876

2020-01-21  Jer Noble  <jer.noble@apple.com>

        [iPad] YouTube does not automatically AirPlay when a route is selected from Control Center
        https://bugs.webkit.org/show_bug.cgi?id=206539
        <rdar://problem/54173689>

        Reviewed by Eric Carlson.

        * WebProcess/WebPage/mac/WebPageMac.mm:
        (WebKit::WebPage::playbackTargetSelected const):

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

        Add SPI on WKURLSchemeTask to access WKFrameInfo of originating frame
        https://bugs.webkit.org/show_bug.cgi?id=204265
        <rdar://57193883>

        Reviewed by Brady Eidson.

        Covered by API tests.

        * Shared/URLSchemeTaskParameters.cpp:
        (WebKit::URLSchemeTaskParameters::encode const):
        (WebKit::URLSchemeTaskParameters::decode):
        * Shared/URLSchemeTaskParameters.h:
        * UIProcess/API/Cocoa/WKURLSchemeTask.mm:
        (-[WKURLSchemeTaskImpl _frame]):
        * UIProcess/API/Cocoa/WKURLSchemeTaskPrivate.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::startURLSchemeTaskShared):
        (WebKit::WebPageProxy::loadSynchronousURLSchemeTask):
        * UIProcess/WebURLSchemeHandler.cpp:
        (WebKit::WebURLSchemeHandler::startTask):
        * UIProcess/WebURLSchemeHandler.h:
        * UIProcess/WebURLSchemeTask.cpp:
        (WebKit::WebURLSchemeTask::create):
        (WebKit::WebURLSchemeTask::WebURLSchemeTask):
        * UIProcess/WebURLSchemeTask.h:
        (WebKit::WebURLSchemeTask::frameInfo const):
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::tryLoadingUsingURLSchemeHandler):
        * WebProcess/WebPage/WebURLSchemeHandlerProxy.cpp:
        (WebKit::WebURLSchemeHandlerProxy::startNewTask):
        * WebProcess/WebPage/WebURLSchemeHandlerProxy.h:
        * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp:
        (WebKit::WebURLSchemeTaskProxy::WebURLSchemeTaskProxy):
        (WebKit::WebURLSchemeTaskProxy::startLoading):
        (WebKit::WebURLSchemeTaskProxy::stopLoading):
        (WebKit::WebURLSchemeTaskProxy::didComplete):
        (WebKit::WebURLSchemeTaskProxy::hasLoader):
        * WebProcess/WebPage/WebURLSchemeTaskProxy.h:
        (WebKit::WebURLSchemeTaskProxy::create):

2020-01-21  Keith Rollin  <krollin@apple.com>

        Fix SDK availability macros
        https://bugs.webkit.org/show_bug.cgi?id=206463
        <rdar://problem/58581906>

        Reviewed by Timothy Hatcher.

        Bug 197841 updated WebKit.xcconfig with regards to when it runs a
        header post-processing script. This post-processing script grovels
        over our exported headers, changing macros like WK_API_AVAILABLE to
        the standard API_AVAILABLE. Because of the change in Bug 197841, the
        script was no longer being run when preparing macOS 10.15 SDKs, which
        was breaking those SDKs. Fix this by reverting the change, allowing
        the macros to be replaced for macOS 10.15.

        No new tests - no added or changed functionality.

        * Configurations/WebKit.xcconfig:

2020-01-21  Tim Horton  <timothy_horton@apple.com>

        macCatalyst: Two-finger click is dispatched to DOM as left click
        https://bugs.webkit.org/show_bug.cgi?id=206549

        Reviewed by Simon Fraser.

        * UIProcess/ios/WKMouseGestureRecognizer.mm:
        (-[WKMouseGestureRecognizer createMouseEventWithType:forEvent:]):
        (-[WKMouseGestureRecognizer touchesBegan:withEvent:]):
        (-[WKMouseGestureRecognizer touchesMoved:withEvent:]):
        (-[WKMouseGestureRecognizer touchesEnded:withEvent:]):
        (-[WKMouseGestureRecognizer _hoverEntered:withEvent:]):
        (-[WKMouseGestureRecognizer _hoverMoved:withEvent:]):
        (-[WKMouseGestureRecognizer _hoverExited:withEvent:]):
        (-[WKMouseGestureRecognizer createMouseEventWithType:]): Deleted.
        We correctly say button=2 for ctrl-click, but not for secondary-button click.

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

        Revert suppressesConnectionTerminationOnSystemChange part of r254081
        https://bugs.webkit.org/show_bug.cgi?id=205751
        <rdar://problem/58725096>

        There was an API client that still hadn't migrated to the replacement SPI.

        * NetworkProcess/NetworkProcess.h:
        (WebKit::NetworkProcess::suppressesConnectionTerminationOnSystemChange const):
        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
        (WebKit::NetworkProcessCreationParameters::decode):
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
        * UIProcess/API/APIProcessPoolConfiguration.cpp:
        (API::ProcessPoolConfiguration::copy):
        * UIProcess/API/APIProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
        (-[_WKProcessPoolConfiguration suppressesConnectionTerminationOnSystemChange]):
        (-[_WKProcessPoolConfiguration setSuppressesConnectionTerminationOnSystemChange:]):
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeNetworkProcess):

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

        Performance tests fail if stderr logging is encountered
        https://bugs.webkit.org/show_bug.cgi?id=206544
        <rdar://problem/58714766>

        Reviewed by Per Arne Vollan.

        Switch to LOG_ERROR, rather than WTFLogAlways, to avoid confusing the PerformanceTests system.

        * Shared/Cocoa/SandboxExtensionCocoa.mm:
        (WebKit::SandboxExtension::createHandleForReadByAuditToken):

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

        Provide camera/microphone sandbox extensions to GPUProcess
        https://bugs.webkit.org/show_bug.cgi?id=206531

        Reviewed by Eric Carlson.

        Send at creation of GPUProcess sandbox extensions to camera and microphone.
        This is currently gated by the UIProcess application being Safari.
        This should be changed to checks based on camera/microphone entitlements.

        Extensions are provided at creation of the GPUProcess as it is as trusted as the UIProcess.
        We do not make it conditional to getUserMedia being enabled as GPUProcess may be created for more than one configuration.

        Relax the GPUProcess sandbox on MacOS to allow microphone access until we can use microphone sandbox extension for that purpose.

        Manually tested by capturing audio/video with real devices.

        * GPUProcess/GPUProcess.cpp:
        (WebKit::GPUProcess::initializeGPUProcess):
        * GPUProcess/GPUProcessCreationParameters.cpp:
        (WebKit::GPUProcessCreationParameters::encode const):
        (WebKit::GPUProcessCreationParameters::decode):
        * GPUProcess/GPUProcessCreationParameters.h:
        * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in:
        * UIProcess/GPU/GPUProcessProxy.cpp:
        (WebKit::isSafari):
        (WebKit::shouldCreateCameraSandboxExtension):
        (WebKit::shouldCreateMicrophoneSandboxExtension):
        (WebKit::GPUProcessProxy::singleton):

2020-01-21  Brady Eidson  <beidson@apple.com>

        API::(User)ContentWorld cleanup
        https://bugs.webkit.org/show_bug.cgi?id=206509

        Reviewed by Darin Adler.

        No behavior change.
        
        - Give (User)ContentWorld a shared base class for upcoming work.
        - Reference them by identifier instead of object instance whenever possible.
        - Other shared class cleanup.

        * UIProcess/API/APIContentWorld.cpp:
        (API::ContentWorldBase::generateIdentifier):
        (API::ContentWorld::ContentWorld):
        (API::ContentWorld::~ContentWorld):
        * UIProcess/API/APIContentWorld.h:
        (API::ContentWorldBase::identifier const):
        (API::ContentWorldBase::name const):
        (API::ContentWorldBase::worldData const):
        (API::ContentWorldBase::ContentWorldBase):
        * UIProcess/API/APIUserContentWorld.cpp:
        (API::UserContentWorld::UserContentWorld):
        (API::UserContentWorld::generateIdentifier): Deleted.
        * UIProcess/API/APIUserContentWorld.h:
        * UIProcess/UserContent/WebScriptMessageHandler.h:
        (WebKit::WebScriptMessageHandler::world):
        (WebKit::WebScriptMessageHandler::userContentWorld const): Deleted.
        (WebKit::WebScriptMessageHandler::userContentWorld): Deleted.
        * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
        (WebKit::WebUserContentControllerProxy::addProcess):
        (WebKit::WebUserContentControllerProxy::addUserContentWorldUse):
        (WebKit::WebUserContentControllerProxy::shouldSendRemoveUserContentWorldsMessage):
        (WebKit::WebUserContentControllerProxy::addUserScriptMessageHandler):
        (WebKit::WebUserContentControllerProxy::removeUserMessageHandlerForName):
        (WebKit::WebUserContentControllerProxy::removeAllUserMessageHandlers):
        * UIProcess/UserContent/WebUserContentControllerProxy.h:

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

        Minor improvements to StorageAreaMap
        https://bugs.webkit.org/show_bug.cgi?id=206433

        Reviewed by Darin Adler.

        Minor improvements to StorageAreaMap:
        1. The class does not need to be RefCounted, as it is solely owned by StorageNamespaceImpl. Having it
           RefCounted was actually dangerous because StorageAreaMap had a raw pointer data member to its owner:
           m_storageNamespace. This raw pointer could become stale if you extend the lifetime of the StorageAreaMap
           object to outlive its StorageNamespaceImpl.
        2. Make StorageAreaMap::connect() private as it is never called from outside the class
        3. Reorder data members for better packing
        4. Use modern loops in the implementation
        5. Rename loadValuesIfNeeded() to ensureStorageMap() and have it return the StorageMap object. This makes
           calls site more concise and it makes it clearer when this method needs to be called.
        6. Mark class as final
        7. Replace LOG_ERROR() with RELEASE_LOG_ERROR() so that we can see error logging in sysdiagnoses
        8. Use more references instead of raw pointers to make it clear when null checks are not needed

        * WebProcess/WebStorage/StorageAreaImpl.cpp:
        (WebKit::StorageAreaImpl::create):
        (WebKit::StorageAreaImpl::StorageAreaImpl):
        * WebProcess/WebStorage/StorageAreaImpl.h:
        * WebProcess/WebStorage/StorageAreaMap.cpp:
        (WebKit::StorageAreaMap::StorageAreaMap):
        (WebKit::StorageAreaMap::length):
        (WebKit::StorageAreaMap::key):
        (WebKit::StorageAreaMap::item):
        (WebKit::StorageAreaMap::setItem):
        (WebKit::StorageAreaMap::removeItem):
        (WebKit::StorageAreaMap::clear):
        (WebKit::StorageAreaMap::contains):
        (WebKit::StorageAreaMap::resetValues):
        (WebKit::StorageAreaMap::ensureStorageMap):
        (WebKit::StorageAreaMap::applyChange):
        (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
        (WebKit::StorageAreaMap::dispatchLocalStorageEvent):
        (WebKit::StorageAreaMap::connect):
        (WebKit::StorageAreaMap::disconnect):
        * WebProcess/WebStorage/StorageAreaMap.h:
        * WebProcess/WebStorage/StorageAreaMap.messages.in:
        * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
        (WebKit::StorageNamespaceImpl::storageArea):
        * WebProcess/WebStorage/StorageNamespaceImpl.h:

2020-01-21  Alejandro G. Castro  <alex@igalia.com>

        [GTK][WPE] TestWebKitUserContentFilterStore is crashing
        https://bugs.webkit.org/show_bug.cgi?id=206527

        Reviewed by Adrian Perez de Castro.

        We are asserting looking for a category of error when converting
        in the toGError function, but depending on the function called the
        category can be different.

        * UIProcess/API/glib/WebKitUserContentFilterStore.cpp:
        (toGError):
        (webkitUserContentFilterStoreSaveBytes): Moved the ASSERT to the
        function that uses this category, the other functions calling
        toGError were already ASSERTing the correct category.

2020-01-21  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] Enable WebGL by default
        https://bugs.webkit.org/show_bug.cgi?id=205335

        Reviewed by Adrian Perez de Castro.

        * UIProcess/API/glib/WebKitSettings.cpp:
        (webkit_settings_class_init):

2020-01-21  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] Enable WebAudio by default
        https://bugs.webkit.org/show_bug.cgi?id=205334

        Reviewed by Adrian Perez de Castro.

        * UIProcess/API/glib/WebKitSettings.cpp:
        (webkit_settings_class_init):

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

        Log the destination of a load when hitting network process
        https://bugs.webkit.org/show_bug.cgi?id=206422

        Reviewed by Darin Adler.

        * NetworkProcess/NetworkResourceLoader.cpp:
        No change of behavior, adding more precise logging.

2020-01-20  David Kilzer  <ddkilzer@apple.com>

        Fix missing header guards and clean up empty files in WebCore, WebKitLegacy, WebKit, Tools
        <https://webkit.org/b/206505>

        Reviewed by Eric Carlson.

        * Platform/IPC/Attachment.h:
        - Fix "# pragma" formatting. (It functioned, but WebKit style
          doesn't indent macros like this.)

        * Platform/ios/AccessibilityIOS.h:
        * Shared/ShareSheetCallbackID.h:
        * Shared/mac/SecItemShim.h:
        * UIProcess/API/C/WKPageRenderingProgressEventsInternal.h:
        * UIProcess/API/Cocoa/WKNavigationData.h:
        * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
        * UIProcess/API/Cocoa/WKWebArchive.h:
        - Add #pragma once statement.

2020-01-20  Adrian Perez de Castro  <aperez@igalia.com>

        Unreviewed. Update OptionsWPE.cmake and NEWS for the 2.27.4 release

        * wpe/NEWS: Add release notes for 2.27.4

2020-01-20  Zan Dobersek  <zdobersek@igalia.com>

        [WPE] Add WebKitRectangle, use it for WebKitWebView's SHOW_MENU signal
        https://bugs.webkit.org/show_bug.cgi?id=206495

        Reviewed by Carlos Garcia Campos.

        Add WebKitRectangle, a new boxed-type API containing information about
        a simple rectangle consisting of integer coordinates. This would
        correspond to types like GdkRectangle or cairo_rectangle_int_t.

        Objects of this type are for now needed to inform the position and size
        of the option menu. The `show-menu` signal signature is adjusted
        accordingly.

        No new tests -- the relevant test was updated.

        * PlatformWPE.cmake:
        * SourcesWPE.txt:
        * UIProcess/API/glib/WebKitWebView.cpp:
        (WebKitWebViewClient::showOptionMenu):
        (webkit_web_view_class_init):
        (webkitWebViewShowOptionMenu):
        * UIProcess/API/glib/WebKitWebViewPrivate.h:
        * UIProcess/API/wpe/WebKitPopupMenu.cpp:
        (WebKit::WebKitPopupMenu::showPopupMenu):
        * UIProcess/API/wpe/WebKitRectangle.cpp: Added.
        (webkit_rectangle_copy):
        (webkit_rectangle_free):
        * UIProcess/API/wpe/WebKitRectangle.h: Added.
        * UIProcess/API/wpe/WebKitWebView.h:
        * UIProcess/API/wpe/WebKitWebViewClient.h:
        * UIProcess/API/wpe/docs/wpe-1.0-sections.txt:
        * UIProcess/API/wpe/docs/wpe-docs.sgml:

2020-01-20  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] InputMethodFilter: do not notify about focus in when only content type changed
        https://bugs.webkit.org/show_bug.cgi?id=206502

        Reviewed by Adrian Perez de Castro.

        That's unbalancing the focus in/out notifications.

        * UIProcess/API/glib/InputMethodFilter.cpp:
        (WebKit::InputMethodFilter::setContext): Always call notifyContentType().
        (WebKit::InputMethodFilter::setState): Only call notifyFocusedIn() and notifyFocusedOut when there's a focus change.
        (WebKit::InputMethodFilter::notifyContentType): Notify content type if changed.
        (WebKit::InputMethodFilter::notifyFocusedIn): Move the content type notification to its own function.
        * UIProcess/API/glib/InputMethodFilter.h:

2020-01-20  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] Also include the selection index in webkit_input_method_context_notify_surrounding()
        https://bugs.webkit.org/show_bug.cgi?id=206497

        Reviewed by Adrian Perez de Castro.

        Input methods also want to know the selection.

        * Shared/EditorState.cpp:
        (WebKit::EditorState::PostLayoutData::encode const): Encode paragraphContextSelectionPosition.
        (WebKit::EditorState::PostLayoutData::decode): Decode paragraphContextSelectionPosition.
        * Shared/EditorState.h: Add paragraphContextSelectionPosition.
        * UIProcess/API/glib/InputMethodFilter.cpp:
        (WebKit::InputMethodFilter::notifySurrounding): Also include the selection index.
        * UIProcess/API/glib/InputMethodFilter.h:
        * UIProcess/API/glib/WebKitInputMethodContext.cpp:
        (webkit_input_method_context_notify_surrounding):
        * UIProcess/API/gtk/WebKitInputMethodContext.h:
        * UIProcess/API/gtk/WebKitInputMethodContextImplGtk.cpp:
        (webkitInputMethodContextImplGtkNotifySurrounding): Ignore the selection index, since GtkIMContext doesn't
        support it.
        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (webkitWebViewBaseUpdateTextInputState): Pass paragraphContextSelectionPosition to InputMethodFilter::notifySurrounding().
        * UIProcess/API/wpe/WPEView.cpp:
        (WKWPE::View::selectionDidChange): Ditto.
        * UIProcess/API/wpe/WebKitInputMethodContext.h:
        * WebProcess/WebPage/glib/WebPageGLib.cpp:
        (WebKit::WebPage::platformEditorState const): Get the selection index too.

2020-01-20  Zan Dobersek  <zdobersek@igalia.com>

        [WPE] Expose the WebKitOptionMenu APIs
        https://bugs.webkit.org/show_bug.cgi?id=206287

        Reviewed by Carlos Garcia Campos.

        Enable the GLib-based API covering option menu functionality for WPE.

        Most of this can be shared with the GTK port. The only difference is in
        the two additional parameters emitted on the WebKitWebView's "show-menu"
        signal (GdkEvent and GdkRectangle) that WPE doesn't support at the
        moment. The rectangle information will be possible to emit in the near
        future once a usable API type is available for this information.

        The WebKitPopupMenu implementation for WPE would only work with the
        GLib-based API. To avoid using it with other APIs, this is implemented
        only on the WebKitWebViewClient interface (renamed from 'WebViewClient'
        and its declaration moved into a separate header file) inheriting from
        API::ViewClient.

        The relevant API test is enabled for WPE.

        * PlatformWPE.cmake:
        * SourcesWPE.txt:
        * UIProcess/API/glib/WebKitWebView.cpp:
        (WebKitWebViewClient::WebKitWebViewClient):
        (WebKitWebViewClient::showOptionMenu):
        (WebKitWebViewClient::handleDownloadRequest):
        (WebKitWebViewClient::frameDisplayed):
        (WebKitWebViewClient::willStartLoad):
        (WebKitWebViewClient::didChangePageID):
        (WebKitWebViewClient::didReceiveUserMessage):
        (webkitWebViewConstructed):
        (webkit_web_view_class_init):
        (webkitWebViewShowOptionMenu):
        * UIProcess/API/glib/WebKitWebViewPrivate.h:
        * UIProcess/API/wpe/APIViewClient.h:
        (API::ViewClient::isGLibBasedAPI):
        * UIProcess/API/wpe/PageClientImpl.cpp:
        (WebKit::PageClientImpl::createPopupMenuProxy):
        * UIProcess/API/wpe/WPEView.h:
        (WKWPE::View::client const):
        * UIProcess/API/wpe/WebKitOptionMenu.h: Added.
        * UIProcess/API/wpe/WebKitOptionMenuItem.h: Added.
        * UIProcess/API/wpe/WebKitPopupMenu.cpp: Added.
        (WebKit::WebKitPopupMenu::create):
        (WebKit::WebKitPopupMenu::WebKitPopupMenu):
        (WebKit::menuCloseCallback):
        (WebKit::WebKitPopupMenu::showPopupMenu):
        (WebKit::WebKitPopupMenu::hidePopupMenu):
        (WebKit::WebKitPopupMenu::cancelTracking):
        (WebKit::WebKitPopupMenu::selectItem):
        (WebKit::WebKitPopupMenu::activateItem):
        * UIProcess/API/wpe/WebKitPopupMenu.h: Added.
        * UIProcess/API/wpe/WebKitWebView.h:
        * UIProcess/API/wpe/WebKitWebViewClient.h: Added.
        * UIProcess/API/wpe/docs/wpe-1.0-sections.txt:
        * UIProcess/API/wpe/webkit.h:

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

        Add support for MediaStream video track rendering in GPUProcess
        https://bugs.webkit.org/show_bug.cgi?id=206286

        Reviewed by Eric Carlson.

        Implement WebProcess SampleBufferDisplayLayer and GPUProcess RemoteSampleBufferDisplayLayer.
        RemoteSampleBufferDisplayLayer is a wrapper around LocalSampleBufferDisplayLayer.

        A synchronous IPC is used at creation time of the layer to make sure we have a shared layer synchronously.
        Future refactoring should allow to remove that constraint as done in regular video playing.

        Override SampleBufferDisplayLayer create function pointer when rendering is to be done in GPUProcess.

        * DerivedSources-input.xcfilelist:
        * DerivedSources-output.xcfilelist:
        * DerivedSources.make:
        * GPUProcess/GPUConnectionToWebProcess.cpp:
        (WebKit::GPUConnectionToWebProcess::sampleBufferDisplayLayerManager):
        (WebKit::GPUConnectionToWebProcess::didReceiveMessage):
        (WebKit::GPUConnectionToWebProcess::didReceiveSyncMessage):
        * GPUProcess/GPUConnectionToWebProcess.h:
        * GPUProcess/webrtc/RemoteSampleBufferDisplayLayer.cpp: Added.
        (WebKit::RemoteSampleBufferDisplayLayer::create):
        (WebKit::RemoteSampleBufferDisplayLayer::RemoteSampleBufferDisplayLayer):
        (WebKit::RemoteSampleBufferDisplayLayer::~RemoteSampleBufferDisplayLayer):
        (WebKit::RemoteSampleBufferDisplayLayer::contextID):
        (WebKit::RemoteSampleBufferDisplayLayer::bounds const):
        (WebKit::RemoteSampleBufferDisplayLayer::updateDisplayMode):
        (WebKit::RemoteSampleBufferDisplayLayer::updateAffineTransform):
        (WebKit::RemoteSampleBufferDisplayLayer::updateBoundsAndPosition):
        (WebKit::RemoteSampleBufferDisplayLayer::flush):
        (WebKit::RemoteSampleBufferDisplayLayer::flushAndRemoveImage):
        (WebKit::RemoteSampleBufferDisplayLayer::enqueueSample):
        (WebKit::RemoteSampleBufferDisplayLayer::clearEnqueuedSamples):
        (WebKit::RemoteSampleBufferDisplayLayer::messageSenderConnection const):
        (WebKit::RemoteSampleBufferDisplayLayer::sampleBufferDisplayLayerStatusDidChange):
        (WebKit::RemoteSampleBufferDisplayLayer::streamTime const):
        * GPUProcess/webrtc/RemoteSampleBufferDisplayLayer.h: Added.
        * GPUProcess/webrtc/RemoteSampleBufferDisplayLayer.messages.in: Added.
        * GPUProcess/webrtc/RemoteSampleBufferDisplayLayerManager.cpp: Added.
        (WebKit::RemoteSampleBufferDisplayLayerManager::RemoteSampleBufferDisplayLayerManager):
        (WebKit::RemoteSampleBufferDisplayLayerManager::didReceiveLayerMessage):
        (WebKit::RemoteSampleBufferDisplayLayerManager::createLayer):
        (WebKit::RemoteSampleBufferDisplayLayerManager::releaseLayer):
        * GPUProcess/webrtc/RemoteSampleBufferDisplayLayerManager.h: Added.
        * GPUProcess/webrtc/RemoteSampleBufferDisplayLayerManager.messages.in: Added.
        * Scripts/webkit/messages.py:
        * Shared/WebCoreArgumentCoders.h:
        * Shared/mac/WebCoreArgumentCodersMac.mm:
        (IPC::ArgumentCoder<CGRect>::encode):
        (IPC::ArgumentCoder<CGRect>::decode):
        (IPC::ArgumentCoder<CGSize>::encode):
        (IPC::ArgumentCoder<CGSize>::decode):
        (IPC::ArgumentCoder<CGPoint>::encode):
        (IPC::ArgumentCoder<CGPoint>::decode):
        (IPC::ArgumentCoder<CGAffineTransform>::encode):
        (IPC::ArgumentCoder<CGAffineTransform>::decode):
        * Sources.txt:
        * SourcesCocoa.txt:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/GPU/GPUProcessConnection.cpp:
        (WebKit::GPUProcessConnection::sampleBufferDisplayLayerManager):
        (WebKit::GPUProcessConnection::didReceiveMessage):
        * WebProcess/GPU/GPUProcessConnection.h:
        * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp:
        (WebKit::RemoteMediaPlayerManager::updatePreferences):
        * WebProcess/GPU/webrtc/SampleBufferDisplayLayer.cpp: Added.
        (WebKit::SampleBufferDisplayLayer::create):
        (WebKit::SampleBufferDisplayLayer::SampleBufferDisplayLayer):
        (WebKit::SampleBufferDisplayLayer::~SampleBufferDisplayLayer):
        (WebKit::SampleBufferDisplayLayer::didFail const):
        (WebKit::SampleBufferDisplayLayer::updateDisplayMode):
        (WebKit::SampleBufferDisplayLayer::bounds const):
        (WebKit::SampleBufferDisplayLayer::updateAffineTransform):
        (WebKit::SampleBufferDisplayLayer::updateBoundsAndPosition):
        (WebKit::SampleBufferDisplayLayer::flush):
        (WebKit::SampleBufferDisplayLayer::flushAndRemoveImage):
        (WebKit::SampleBufferDisplayLayer::enqueueSample):
        (WebKit::SampleBufferDisplayLayer::clearEnqueuedSamples):
        (WebKit::SampleBufferDisplayLayer::rootLayer):
        (WebKit::SampleBufferDisplayLayer::setDidFail):
        (WebKit::SampleBufferDisplayLayer::boundsChanged):
        * WebProcess/GPU/webrtc/SampleBufferDisplayLayer.h: Added.
        * WebProcess/GPU/webrtc/SampleBufferDisplayLayer.messages.in: Added.
        * WebProcess/GPU/webrtc/SampleBufferDisplayLayerIdentifier.h: Added.
        * WebProcess/GPU/webrtc/SampleBufferDisplayLayerManager.cpp: Added.
        (WebKit::SampleBufferDisplayLayerManager::didReceiveLayerMessage):
        (WebKit::SampleBufferDisplayLayerManager::createLayer):
        (WebKit::SampleBufferDisplayLayerManager::addLayer):
        (WebKit::SampleBufferDisplayLayerManager::removeLayer):
        * WebProcess/GPU/webrtc/SampleBufferDisplayLayerManager.h: Added.
        * WebProcess/WebProcess.h:

2020-01-19  Eric Carlson  <eric.carlson@apple.com>

        Make MediaPlayerPrivateRemote a message receiver
        https://bugs.webkit.org/show_bug.cgi?id=206487
        <rdar://problem/58721559>

        Reviewed by Dean Jackson.

        Make MediaPlayerPrivateRemote a message receiver so we don't need a trampoline
        for every method in the MediaPlayerPrivateRemoteManager.
        
        No new tests, no change of behavior.

        * DerivedSources-input.xcfilelist:
        * DerivedSources-output.xcfilelist:
        * DerivedSources.make:
        * GPUProcess/media/RemoteAudioTrackProxy.cpp:
        (WebKit::RemoteAudioTrackProxy::RemoteAudioTrackProxy):
        (WebKit::RemoteAudioTrackProxy::configurationChanged):
        (WebKit::RemoteAudioTrackProxy::willRemove):
        * GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp:
        * GPUProcess/media/RemoteMediaPlayerProxy.cpp:
        (WebKit::RemoteMediaPlayerProxy::requestResource):
        (WebKit::RemoteMediaPlayerProxy::removeResource):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerNetworkStateChanged):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerReadyStateChanged):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerVolumeChanged):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerMuteChanged):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerTimeChanged):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerDurationChanged):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerRateChanged):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerEngineFailedToLoad const):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerPlaybackStateChanged):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerCharacteristicChanged):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerFirstVideoFrameAvailable):
        (WebKit::RemoteMediaPlayerProxy::sendCachedState):
        * GPUProcess/media/RemoteMediaResourceManager.cpp:
        * GPUProcess/media/RemoteVideoTrackProxy.cpp:
        (WebKit::RemoteVideoTrackProxy::RemoteVideoTrackProxy):
        (WebKit::RemoteVideoTrackProxy::configurationChanged):
        (WebKit::RemoteVideoTrackProxy::willRemove):
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/GPU/GPUProcessConnection.cpp:
        (WebKit::GPUProcessConnection::didReceiveMessage):
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
        (WebKit::MediaPlayerPrivateRemote::requestResource):
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.h:
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.messages.in: Added.
        * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp:
        (WebKit::RemoteMediaPlayerManager::didReceivePlayerMessage):
        (WebKit::RemoteMediaPlayerManager::networkStateChanged): Deleted.
        (WebKit::RemoteMediaPlayerManager::readyStateChanged): Deleted.
        (WebKit::RemoteMediaPlayerManager::volumeChanged): Deleted.
        (WebKit::RemoteMediaPlayerManager::muteChanged): Deleted.
        (WebKit::RemoteMediaPlayerManager::timeChanged): Deleted.
        (WebKit::RemoteMediaPlayerManager::durationChanged): Deleted.
        (WebKit::RemoteMediaPlayerManager::rateChanged): Deleted.
        (WebKit::RemoteMediaPlayerManager::playbackStateChanged): Deleted.
        (WebKit::RemoteMediaPlayerManager::engineFailedToLoad): Deleted.
        (WebKit::RemoteMediaPlayerManager::characteristicChanged): Deleted.
        (WebKit::RemoteMediaPlayerManager::sizeChanged): Deleted.
        (WebKit::RemoteMediaPlayerManager::addRemoteAudioTrack): Deleted.
        (WebKit::RemoteMediaPlayerManager::removeRemoteAudioTrack): Deleted.
        (WebKit::RemoteMediaPlayerManager::remoteAudioTrackConfigurationChanged): Deleted.
        (WebKit::RemoteMediaPlayerManager::addRemoteVideoTrack): Deleted.
        (WebKit::RemoteMediaPlayerManager::removeRemoteVideoTrack): Deleted.
        (WebKit::RemoteMediaPlayerManager::remoteVideoTrackConfigurationChanged): Deleted.
        (WebKit::RemoteMediaPlayerManager::firstVideoFrameAvailable): Deleted.
        (WebKit::RemoteMediaPlayerManager::requestResource): Deleted.
        (WebKit::RemoteMediaPlayerManager::removeResource): Deleted.
        (WebKit::RemoteMediaPlayerManager::updateCachedState): Deleted.
        * WebProcess/GPU/media/RemoteMediaPlayerManager.h:
        (WebKit::RemoteMediaPlayerManager::didReceiveMessageFromGPUProcess): Deleted.
        * WebProcess/GPU/media/RemoteMediaPlayerManager.messages.in:

2020-01-19  Claudio Saavedra  <csaavedra@igalia.com>

        [GTK] Remove usage of deprecated GTimeVal
        https://bugs.webkit.org/show_bug.cgi?id=206358

        Reviewed by Žan Doberšek.

        Use g_get_monotonic_time() for counting clicks instead of
        deprecated and unsafe API.

        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (ClickCounter::currentClickCountForGdkButtonEvent):

2020-01-17  Cathie Chen  <cathiechen@igalia.com>

        Add support for scroll behavior parsing
        https://bugs.webkit.org/show_bug.cgi?id=205009

        Reviewed by Frédéric Wang.

        Based on the patch by Frédéric Wang.

        Add CSSOM smooth scrolling as an experimental feature.

        * Shared/WebPreferences.yaml:

2020-01-17  Peng Liu  <peng.liu6@apple.com>

        Fix a build failure related to the feature flag (GPU_PROCESS)
        https://bugs.webkit.org/show_bug.cgi?id=206453

        Reviewed by Eric Carlson.

        No new tests - no added or changed functionality.

        * GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in:
        * GPUProcess/media/RemoteMediaPlayerProxy.messages.in:

2020-01-17  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r254688.

        This caused internal test crashes.

        Reverted changeset:

        "Add support for MediaStream video track rendering in
        GPUProcess"
        https://bugs.webkit.org/show_bug.cgi?id=206286
        https://trac.webkit.org/changeset/254688

2020-01-17  Daniel Bates  <dabates@apple.com>

        [iOS] ASSERTION FAILED: ASSERT_NOT_REACHED() in selectionChangedWithTouch(WKContentView*, WebCore::IntPoint const&, unsigned int, unsigned int, WebKit::CallbackBase::Error)
        https://bugs.webkit.org/show_bug.cgi?id=206427

        Reviewed by Wenson Hsieh.

        Remove ASSERT_NOT_REACHED() usage in callbacks selectionChangedWithTouch() and selectionChangedWithGesture().
        These callbacks can handle being- and should expect to sometimes be- invoked with a non-None error value.
        In particular, if the WebProcess crashes then these callbacks will be invoked with error CallbackBase::Error::ProcessExited.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (selectionChangedWithGesture): Remove ASSERT_NOT_REACHED() when an error occurs. This
        function is capable of handling this error.
        (selectionChangedWithTouch): Ditto.

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

        [iOS] Remove the IOHIDEventServiceFastPathUserClient IOKit class
        https://bugs.webkit.org/show_bug.cgi?id=206387
        <rdar://problem/58663849>

        Reviewed by Per Arne Vollan.

        After Bug 204770, we no longer interact with the device motion or geolocation systems inside
        the WebContent process. Testing and telemetry shows that we no longer access the
        IOHIDEventServiceFastPathUserClient, and so should remove access to it.

        No new tests because there is no change in behavior.

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

2020-01-17  Brady Eidson  <beidson@apple.com>

        TestWebKitAPI.AsyncFunction.Promise times out on slower machines in debug builds.
        <rdar://problem/58445164> and https://bugs.webkit.org/show_bug.cgi?id=206012

        Reviewed by Keith Miller.

        For existing API test.

        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _garbageCollectJavaScriptObjectsForTesting]):
        * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:

2020-01-17  Daniel Bates  <dabates@apple.com>

        [iOS] Focusing editable element with WebPage::selectPositionAtPoint() does not bring up keyboard
        https://bugs.webkit.org/show_bug.cgi?id=206385
        <rdar://problem/57414380>

        Reviewed by Wenson Hsieh.

        Update the view's state to indicate that the user is performing an interaction for the scope of
        WebPage::selectPositionAtPoint(). This permits WebKit to show the keyboard if selecting the
        position causes a change in focus (say, the point is inside an unfocused text field).

        We likely should do a similar change for all other WebKit IPIs that perform a WebCore::EUserTriggered::UserTriggered
        tagged selection change though the callers should be audited to ensure they weren't accidentally
        depending on the existing behavior that prevents such selections from bringing up the keyboard.
        For now, I only fix WebPage::selectPositionAtPoint() as I've audited that all callers expect it
        to bring up the keyboard, if needed.

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

2020-01-17  Adrian Perez de Castro  <aperez@igalia.com>

        Fix various non-unified build issues introduced since r254327
        https://bugs.webkit.org/show_bug.cgi?id=206356

        Reviewed by Chris Dumez.

        * WebProcess/WebCoreSupport/gtk/WebContextMenuClientGtk.cpp:
        (WebKit::WebContextMenuClient::insertEmoji): Add missing namespace to WebCore::Frame parameter.

2020-01-17  Fujii Hironori  <Hironori.Fujii@sony.com>

        [WinCairo][WK2] ASSERT(isUIThread()) is failing since r254723
        https://bugs.webkit.org/show_bug.cgi?id=206394

        Reviewed by Carlos Alberto Lopez Perez.

        AtomString::init() should be called after
        WTF::initializeThreading() is called on Windows because it has
        ASSERT(isUIThread()) and Windows doesn't have a API to get main
        thread handle like pthread_main_np.

        * Shared/WebKit2Initialize.cpp:
        (WebKit::InitializeWebKit2): Call AtomString::init() after JSC::initializeThreading().

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

        IPC hardening for WebPasteboardProxy::SetPasteboardBufferForType message
        https://bugs.webkit.org/show_bug.cgi?id=206381

        Reviewed by Anders Carlsson.

        IPC hardening for WebPasteboardProxy::SetPasteboardBufferForType message. Make sure that the Strings passed over IPC are not
        null and that the SharedBuffer returned by SharedBuffer::map() is not null.

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

2020-01-17  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] Composition underline color is not applied
        https://bugs.webkit.org/show_bug.cgi?id=206353

        Reviewed by Sergio Villar Senin.

        CompositionUnderline::compositionUnderlineColor is not encoded/decoded in IPC messages, so the web process
        always uses CompositionUnderlineColor::TextColor ignoring the given color.

        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<CompositionUnderline>::encode): Encode compositionUnderlineColor.
        (IPC::ArgumentCoder<CompositionUnderline>::decode): Decode compositionUnderlineColor.

2020-01-16  Zan Dobersek  <zdobersek@igalia.com>

        Unreviewed. Move the common WebKitOptionMenu GLib API implementation
        parts out from the GTK-specific directory and under UIProcess/API/glib/.

        * SourcesGTK.txt:
        * UIProcess/API/glib/WebKitOptionMenu.cpp: Copied from Source/WebKit/UIProcess/API/gtk/WebKitOptionMenu.cpp.
        * UIProcess/API/glib/WebKitOptionMenuItem.cpp: Copied from Source/WebKit/UIProcess/API/gtk/WebKitOptionMenuItem.cpp.
        * UIProcess/API/glib/WebKitOptionMenuItemPrivate.h: Copied from Source/WebKit/UIProcess/API/gtk/WebKitOptionMenuItemPrivate.h.
        * UIProcess/API/glib/WebKitOptionMenuPrivate.h: Copied from Source/WebKit/UIProcess/API/gtk/WebKitOptionMenuPrivate.h.
        * UIProcess/API/gtk/WebKitOptionMenu.cpp: Removed.
        * UIProcess/API/gtk/WebKitOptionMenuItem.cpp: Removed.
        * UIProcess/API/gtk/WebKitOptionMenuItemPrivate.h: Removed.
        * UIProcess/API/gtk/WebKitOptionMenuPrivate.h: Removed.

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

        [iOS] Add telemetry for IOKIt classes not seen in test runs
        https://bugs.webkit.org/show_bug.cgi?id=206386
        <rdar://problem/58663519>

        Reviewed by Per Arne Vollan.

        Capture telemetry to show which IOKit classes are acitvely used in WebKit.

        No new tests because this does not change behavior.

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

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

        IPC hardening for WebPageProxy::SetPromisedDataForImage message
        https://bugs.webkit.org/show_bug.cgi?id=206380
        <rdar://problem/58625196>

        Reviewed by Geoffrey Garen.

        IPC hardening for WebPageProxy::SetPromisedDataForImage message. Make sure the shared memory handle sent over IPC is not null
        and null check the SharedMemory object after calling SharedMemory::map().

        * UIProcess/mac/WebPageProxyMac.mm:
        (WebKit::WebPageProxy::setPromisedDataForImage):

2020-01-16  Daniel Chen  <thedanielchen@apple.com>

        Call AtomString::init in WebKit2Initialize.
        <https://webkit.org/b/206375>
        <rdar://problem/58646578>

        Reviewed by Timothy Hatcher.

        * Shared/Cocoa/WebKit2InitializeCocoa.mm:
        (WebKit::runInitializationCode):
        * Shared/WebKit2Initialize.cpp:
        (WebKit::InitializeWebKit2):

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

        IPC hardening for WebPageProxy::savePDFToTemporaryFolder* / WebPageProxy::openPDFFromTemporaryFolder* messages
        https://bugs.webkit.org/show_bug.cgi?id=206378
        <rdar://problem/58622919>

        Reviewed by Geoffrey Garen.

        IPC hardening for WebPageProxy::savePDFToTemporaryFolder* / WebPageProxy::openPDFFromTemporaryFolder* messages.
        Make sure the UUID passed over IPC is a valid HashMap key.

        * UIProcess/WebPageProxy.h:
        * UIProcess/mac/WebPageProxyMac.mm:
        (WebKit::WebPageProxy::savePDFToTemporaryFolderAndOpenWithNativeApplication):
        (WebKit::WebPageProxy::openPDFFromTemporaryFolderWithNativeApplication):

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

        IPC hardening for WebPageProxy::RegisterAttachmentIdentifier*
        https://bugs.webkit.org/show_bug.cgi?id=206376
        <rdar://problem/58622645>

        Reviewed by David Kilzer.

        IPC hardening for WebPageProxy::RegisterAttachmentIdentifier*, validate identifiers sent over
        IPC to make sure they are valid keys in our HashMap.

        * UIProcess/WebPageProxy.cpp:
        * UIProcess/WebPageProxy.h:

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

        [PlayStation] Enable WebKit
        https://bugs.webkit.org/show_bug.cgi?id=205965

        Reviewed by Ross Kirsling.

        Add the CMake platform for PlayStation. Add stubs for platform specific bits.
        This gets us to linking through WebKit.

        * Platform/unix/ModuleUnix.cpp: Added.
        (WebKit::Module::load):
        (WebKit::Module::unload):
        (WebKit::Module::platformFunctionPointer const):
        * PlatformPlayStation.cmake: Added.
        * UIProcess/Launcher/playstation/ProcessLauncherPlayStation.cpp: Added.
        (WebKit::ProcessLauncher::launchProcess):
        (WebKit::ProcessLauncher::terminateProcess):
        (WebKit::ProcessLauncher::platformInvalidate):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebsiteData/playstation/WebsiteDataStorePlayStation.cpp: Added.
        (WebKit::WebsiteDataStore::platformInitialize):
        (WebKit::WebsiteDataStore::platformDestroy):
        (WebKit::WebsiteDataStore::platformRemoveRecentSearches):
        (WebKit::WebsiteDataStore::defaultApplicationCacheDirectory):
        (WebKit::WebsiteDataStore::defaultCacheStorageDirectory):
        (WebKit::WebsiteDataStore::defaultNetworkCacheDirectory):
        (WebKit::WebsiteDataStore::defaultIndexedDBDatabaseDirectory):
        (WebKit::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory):
        (WebKit::WebsiteDataStore::defaultLocalStorageDirectory):
        (WebKit::WebsiteDataStore::defaultMediaKeysStorageDirectory):
        (WebKit::WebsiteDataStore::defaultWebSQLDatabaseDirectory):
        (WebKit::WebsiteDataStore::defaultResourceLoadStatisticsDirectory):
        (WebKit::WebsiteDataStore::cacheDirectoryFileSystemRepresentation):
        (WebKit::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation):
        * UIProcess/playstation/WebPageProxyPlayStation.cpp: Added.
        (WebKit::WebPageProxy::platformInitialize):
        (WebKit::WebPageProxy::viewBackend):
        (WebKit::WebPageProxy::standardUserAgent):
        (WebKit::WebPageProxy::saveRecentSearches):
        (WebKit::WebPageProxy::loadRecentSearches):
        (WebKit::WebPageProxy::updateEditorState):
        * UIProcess/playstation/WebProcessPoolPlayStation.cpp: Added.
        (WebKit::WebProcessPool::platformInitialize):
        (WebKit::WebProcessPool::platformInitializeNetworkProcess):
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        (WebKit::WebProcessPool::platformInvalidateContext):
        (WebKit::WebProcessPool::platformResolvePathsForSandboxExtensions):
        * WebProcess/InjectedBundle/playstation/InjectedBundlePlayStation.cpp: Added.
        (WebKit::InjectedBundle::initialize):
        (WebKit::InjectedBundle::setBundleParameter):
        (WebKit::InjectedBundle::setBundleParameters):
        * WebProcess/WebPage/playstation/WebPagePlayStation.cpp: Added.
        (WebKit::WebPage::platformInitialize):
        (WebKit::WebPage::platformReinitialize):
        (WebKit::WebPage::platformDetach):
        (WebKit::WebPage::performDefaultBehaviorForKeyEvent):
        (WebKit::WebPage::platformCanHandleRequest):
        (WebKit::WebPage::platformUserAgent const):
        (WebKit::WebPage::handleEditingKeyboardEvent):
        (WebKit::WebPage::platformEditorState const):
        * WebProcess/playstation/WebProcessPlayStation.cpp: Added.
        (WebKit::WebProcess::platformInitializeWebProcess):
        (WebKit::WebProcess::platformSetWebsiteDataStoreParameters):
        (WebKit::WebProcess::platformTerminate):
        (WebKit::WebProcess::platformSetCacheModel):

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

        Regression(r253224) No longer able to prevent a tab from closing via the beforeunload prompt
        https://bugs.webkit.org/show_bug.cgi?id=206366
        <rdar://problem/58537467>

        Reviewed by Geoffrey Garen.

        Change is covered by new API test.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _tryClose]):
        (-[WKWebView _isClosed]):
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        Add new _tryClose / _isClosed SPI on WKWebView in order to write an API test to cover
        the change.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel):
        In WebPageProxy::tryClose(), we start a timer before sending the TryClose async IPC to the
        WebProcess. We would then stop the timer when receiving the response to the TryClose IPC.
        If the timer fires, we would forcefully close the page. The issue was that before answering
        the TryClose IPC, the WebContent process would send a sync RunBeforeUnloadConfirmPanel IPC
        to the UIProcess to show the confirmation prompt, and this would fail to stop the timer.
        WebPageProxy::runBeforeUnloadConfirmPanel() would spin a nested run loop to show the prompt
        and we would time out while showing the prompt.

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

        Add finite timeout when synchronously terminating a service worker
        https://bugs.webkit.org/show_bug.cgi?id=206325
        <rdar://problem/58183380>

        Reviewed by Youenn Fablet.

        When this message reply is never received, it hangs everything.
        If we haven't received verification that a service worker was terminated in 10 seconds, unhang everything
        and tell the UI process to terminate the hanging service worker process. Continue handling messages during
        these 10 seconds to hopefully turn a bad hang into no perceptible hang.

        * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
        (WebKit::WebSWServerToContextConnection::syncTerminateWorker):

2020-01-16  Brady Eidson  <beidson@apple.com>

        Make the callAsyncJavaScriptFunction function actually be async (so await works).
        <rdar://problem/58571682> and https://bugs.webkit.org/show_bug.cgi?id=206364

        Reviewed by Geoffrey Garen.

        * UIProcess/API/Cocoa/WKWebViewPrivate.h: Update callAsyncJavaScriptFunction: header docs.

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

        Non-unified build fixes mid January 2020 edition
        https://bugs.webkit.org/show_bug.cgi?id=206363

        Unreviewed build fix.

        * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
        * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
        * PlatformFTW.cmake:
        * PlatformWin.cmake:
        * UIProcess/API/APIContentWorld.cpp:
        * UIProcess/Automation/WebAutomationSession.cpp:
        * WebProcess/WebCoreSupport/WebResourceLoadObserver.cpp:
        * WebProcess/WebCoreSupport/win/WebContextMenuClientWin.cpp: Removed.

2020-01-16  Brady Eidson  <beidson@apple.com>

        REGRESSION: (r254668) [Mac Debug wk2] 21 http/tests/navigation/* tests are crashing with ASSERTION FAILED: world.first != 1.
        https://bugs.webkit.org/show_bug.cgi?id=206357

        Unreviewed followup to r254668 to fix tests.

        ASSERT is no longer valid.
        Also, having the magic constant "1" in code is mysterious. Make it properly named everywhere.
        
        * Shared/ContentWorldShared.h: Copied from Source/WebKit/UIProcess/API/APIUserContentWorld.cpp.
        * UIProcess/API/APIContentWorld.cpp:
        (API::ContentWorld::pageContentWorld):
        * UIProcess/API/APIUserContentWorld.cpp:
        (API::UserContentWorld::generateIdentifier):
        (API::UserContentWorld::UserContentWorld):
        * UIProcess/API/APIUserContentWorld.h:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/UserContent/WebUserContentController.cpp:
        (WebKit::WebUserContentController::addUserContentWorld):

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

        Add support for MediaStream video track rendering in GPUProcess
        https://bugs.webkit.org/show_bug.cgi?id=206286

        Reviewed by Eric Carlson.

        Implement WebProcess SampleBufferDisplayLayer and GPUProcess RemoteSampleBufferDisplayLayer.
        RemoteSampleBufferDisplayLayer is a wrapper around LocalSampleBufferDisplayLayer.

        A synchronous IPC is used at creation time of the layer to make sure we have a shared layer synchronously.
        Future refactoring should allow to remove that constraint as done in regular video playing.

        Override SampleBufferDisplayLayer create function pointer when rendering is to be done in GPUProcess.

        * DerivedSources-input.xcfilelist:
        * DerivedSources-output.xcfilelist:
        * DerivedSources.make:
        * GPUProcess/GPUConnectionToWebProcess.cpp:
        (WebKit::GPUConnectionToWebProcess::sampleBufferDisplayLayerManager):
        (WebKit::GPUConnectionToWebProcess::didReceiveMessage):
        (WebKit::GPUConnectionToWebProcess::didReceiveSyncMessage):
        * GPUProcess/GPUConnectionToWebProcess.h:
        * GPUProcess/webrtc/RemoteSampleBufferDisplayLayer.cpp: Added.
        (WebKit::RemoteSampleBufferDisplayLayer::create):
        (WebKit::RemoteSampleBufferDisplayLayer::RemoteSampleBufferDisplayLayer):
        (WebKit::RemoteSampleBufferDisplayLayer::~RemoteSampleBufferDisplayLayer):
        (WebKit::RemoteSampleBufferDisplayLayer::contextID):
        (WebKit::RemoteSampleBufferDisplayLayer::bounds const):
        (WebKit::RemoteSampleBufferDisplayLayer::updateDisplayMode):
        (WebKit::RemoteSampleBufferDisplayLayer::updateAffineTransform):
        (WebKit::RemoteSampleBufferDisplayLayer::updateBoundsAndPosition):
        (WebKit::RemoteSampleBufferDisplayLayer::flush):
        (WebKit::RemoteSampleBufferDisplayLayer::flushAndRemoveImage):
        (WebKit::RemoteSampleBufferDisplayLayer::enqueueSample):
        (WebKit::RemoteSampleBufferDisplayLayer::clearEnqueuedSamples):
        (WebKit::RemoteSampleBufferDisplayLayer::messageSenderConnection const):
        (WebKit::RemoteSampleBufferDisplayLayer::sampleBufferDisplayLayerStatusDidChange):
        (WebKit::RemoteSampleBufferDisplayLayer::streamTime const):
        * GPUProcess/webrtc/RemoteSampleBufferDisplayLayer.h: Added.
        * GPUProcess/webrtc/RemoteSampleBufferDisplayLayer.messages.in: Added.
        * GPUProcess/webrtc/RemoteSampleBufferDisplayLayerManager.cpp: Added.
        (WebKit::RemoteSampleBufferDisplayLayerManager::RemoteSampleBufferDisplayLayerManager):
        (WebKit::RemoteSampleBufferDisplayLayerManager::didReceiveLayerMessage):
        (WebKit::RemoteSampleBufferDisplayLayerManager::createLayer):
        (WebKit::RemoteSampleBufferDisplayLayerManager::releaseLayer):
        * GPUProcess/webrtc/RemoteSampleBufferDisplayLayerManager.h: Added.
        * GPUProcess/webrtc/RemoteSampleBufferDisplayLayerManager.messages.in: Added.
        * Scripts/webkit/messages.py:
        * Shared/WebCoreArgumentCoders.h:
        * Shared/mac/WebCoreArgumentCodersMac.mm:
        (IPC::ArgumentCoder<CGRect>::encode):
        (IPC::ArgumentCoder<CGRect>::decode):
        (IPC::ArgumentCoder<CGSize>::encode):
        (IPC::ArgumentCoder<CGSize>::decode):
        (IPC::ArgumentCoder<CGPoint>::encode):
        (IPC::ArgumentCoder<CGPoint>::decode):
        (IPC::ArgumentCoder<CGAffineTransform>::encode):
        (IPC::ArgumentCoder<CGAffineTransform>::decode):
        * Sources.txt:
        * SourcesCocoa.txt:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/GPU/GPUProcessConnection.cpp:
        (WebKit::GPUProcessConnection::sampleBufferDisplayLayerManager):
        (WebKit::GPUProcessConnection::didReceiveMessage):
        * WebProcess/GPU/GPUProcessConnection.h:
        * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp:
        (WebKit::RemoteMediaPlayerManager::updatePreferences):
        * WebProcess/GPU/webrtc/SampleBufferDisplayLayer.cpp: Added.
        (WebKit::SampleBufferDisplayLayer::create):
        (WebKit::SampleBufferDisplayLayer::SampleBufferDisplayLayer):
        (WebKit::SampleBufferDisplayLayer::~SampleBufferDisplayLayer):
        (WebKit::SampleBufferDisplayLayer::didFail const):
        (WebKit::SampleBufferDisplayLayer::updateDisplayMode):
        (WebKit::SampleBufferDisplayLayer::bounds const):
        (WebKit::SampleBufferDisplayLayer::updateAffineTransform):
        (WebKit::SampleBufferDisplayLayer::updateBoundsAndPosition):
        (WebKit::SampleBufferDisplayLayer::flush):
        (WebKit::SampleBufferDisplayLayer::flushAndRemoveImage):
        (WebKit::SampleBufferDisplayLayer::enqueueSample):
        (WebKit::SampleBufferDisplayLayer::clearEnqueuedSamples):
        (WebKit::SampleBufferDisplayLayer::rootLayer):
        (WebKit::SampleBufferDisplayLayer::setDidFail):
        (WebKit::SampleBufferDisplayLayer::boundsChanged):
        * WebProcess/GPU/webrtc/SampleBufferDisplayLayer.h: Added.
        * WebProcess/GPU/webrtc/SampleBufferDisplayLayer.messages.in: Added.
        * WebProcess/GPU/webrtc/SampleBufferDisplayLayerIdentifier.h: Added.
        * WebProcess/GPU/webrtc/SampleBufferDisplayLayerManager.cpp: Added.
        (WebKit::SampleBufferDisplayLayerManager::didReceiveLayerMessage):
        (WebKit::SampleBufferDisplayLayerManager::createLayer):
        (WebKit::SampleBufferDisplayLayerManager::addLayer):
        (WebKit::SampleBufferDisplayLayerManager::removeLayer):
        * WebProcess/GPU/webrtc/SampleBufferDisplayLayerManager.h: Added.
        * WebProcess/WebProcess.h:

2020-01-16  David Kilzer  <ddkilzer@apple.com>

        Enable -Wconditional-uninitialized in WebInspectorUI, WebKitLegacy, WebKit projects
        <https://webkit.org/b/206270>
        <rdar://problem/58589767>

        Reviewed by Tim Horton.

        * Configurations/Base.xcconfig:
        (WARNING_CFLAGS): Add -Wconditional-uninitialized switch.
        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::performInteractionSequence):
        Initialize `x`, `y` stack variables since the compiler can't
        reason about the behavior of JSON::Object::getInteger().
        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit::getAllScriptsInPDFDocument): Initialize `length` stack
        variable.  Also add check that `length` is non-zero.

2020-01-16  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] Web process crash when IM tries to delete surrounding text
        https://bugs.webkit.org/show_bug.cgi?id=206352

        Reviewed by Adrian Perez de Castro.

        TextIterator::rangeFromLocationAndLength() can return nullptr when the start of the range can't be found.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::deleteSurrounding): Return early if selectionRange is nullptr.

2020-01-16  Cathie Chen  <cathiechen@igalia.com>

        Mapping HTML attributes width/height to the default aspect ratio of <img>
        https://bugs.webkit.org/show_bug.cgi?id=201641

        Reviewed by Frédéric Wang

        Add experimental flag: AspectRatioOfImgFromWidthAndHeightEnabled.

        * Shared/WebPreferences.yaml:

2020-01-15  Brady Eidson  <beidson@apple.com>

        Add WKContentWorld SPI, and use it in JavaScript execution.
        https://bugs.webkit.org/show_bug.cgi?id=206310

        Reviewed by Alex Christensen.

        Covered by API tests.
        
        _WKContentWorld is a UI Process wrapper for an InjectedBundleScriptWorld.
        Much like _WKUserContentWorld is. But different in that:
        - Its APIs are named different things
        - Only one unique instance per string name
        - It is used with evaluateJavascript: and callAsyncJavaScriptFunction: instead of WKUserContentController.
        
        But _WKContentWorld and _WKUserContentWorld do have to work together a little bit to avoid conflicts in the WebProcess.
        
        The new versions of evaluateJavascript: and callAsyncJavaScriptFunction: are also included, as well as API tests for all the new stuff.

        * Shared/API/APIObject.h:
        * Shared/Cocoa/APIObject.mm:
        (API::Object::newObject):

        * UIProcess/API/APIContentWorld.cpp: Copied from Source/WebKit/UIProcess/API/APIUserContentWorld.cpp.
        (API::ContentWorld::sharedWorldWithName):
        (API::ContentWorld::pageContentWorld):
        (API::ContentWorld::defaultClientWorld):
        (API::ContentWorld::ContentWorld):
        (API::ContentWorld::~ContentWorld):
        * UIProcess/API/APIContentWorld.h: Copied from Source/WebKit/UIProcess/API/APIUserContentWorld.h.

        * UIProcess/API/APIUserContentWorld.cpp:
        (API::UserContentWorld::generateIdentifier):
        (API::UserContentWorld::UserContentWorld):
        (API::generateIdentifier): Deleted.
        * UIProcess/API/APIUserContentWorld.h:

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView evaluateJavaScript:completionHandler:]):
        (-[WKWebView _evaluateJavaScript:asAsyncFunction:withArguments:forceUserGesture:completionHandler:inWorld:]):
        (-[WKWebView _callAsyncJavaScriptFunction:withArguments:inWorld:completionHandler:]):
        (-[WKWebView _evaluateJavaScript:inWorld:completionHandler:]):
        (-[WKWebView _evaluateJavaScriptWithoutUserGesture:completionHandler:]):
        (-[WKWebView _evaluateJavaScript:asAsyncFunction:withArguments:forceUserGesture:completionHandler:]): Deleted.
        (-[WKWebView _callAsyncFunction:withArguments:completionHandler:]): Deleted.
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:

        * UIProcess/API/Cocoa/_WKContentWorld.h: Added.
        * UIProcess/API/Cocoa/_WKContentWorld.mm: Copied from Source/WebKit/UIProcess/API/APIUserContentWorld.h.
        (+[_WKContentWorld pageContentWorld]):
        (+[_WKContentWorld defaultClientWorld]):
        (+[_WKContentWorld worldWithName:]):
        (-[_WKContentWorld dealloc]):
        (-[_WKContentWorld name]):
        (-[_WKContentWorld _apiObject]):
        * UIProcess/API/Cocoa/_WKContentWorldInternal.h: Copied from Source/WebKit/UIProcess/API/APIUserContentWorld.h.

        * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
        * UIProcess/UserContent/WebUserContentControllerProxy.h:

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::runJavaScriptInMainFrame):
        (WebKit::WebPageProxy::runJavaScriptInMainFrameScriptWorld):
        * UIProcess/WebPageProxy.h:

        * WebProcess/UserContent/WebUserContentController.cpp:
        (WebKit::worldMap):
        (WebKit::WebUserContentController::worldForIdentifier):
        (WebKit::WebUserContentController::addUserContentWorld):
        (WebKit::WebUserContentController::addUserContentWorlds):
        * WebProcess/UserContent/WebUserContentController.h:

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::runJavaScript):
        (WebKit::WebPage::runJavaScriptInMainFrameScriptWorld):
        (WebKit::WebPage::runJavaScriptInFrame):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

        * Sources.txt:
        * WebKit.xcodeproj/project.pbxproj:

2020-01-15  Ross Kirsling  <ross.kirsling@sony.com>

        [PlayStation] Add stubs for WebContextMenuClient
        https://bugs.webkit.org/show_bug.cgi?id=206324

        Reviewed by Don Olmstead.

        * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
        (WebKit::WebContextMenuClient::lookUpInDictionary):
        (WebKit::WebContextMenuClient::isSpeaking):
        (WebKit::WebContextMenuClient::speak):
        (WebKit::WebContextMenuClient::stopSpeaking):
        * WebProcess/WebCoreSupport/gtk/WebContextMenuClientGtk.cpp:
        (WebKit::WebContextMenuClient::lookUpInDictionary): Deleted.
        (WebKit::WebContextMenuClient::isSpeaking): Deleted.
        (WebKit::WebContextMenuClient::speak): Deleted.
        (WebKit::WebContextMenuClient::stopSpeaking): Deleted.
        Bring GTK/WPE stubs down for broader use.

2020-01-15  Ross Kirsling  <ross.kirsling@sony.com>

        [PlayStation] Add stub for WebPopupMenu::setUpPlatformData
        https://bugs.webkit.org/show_bug.cgi?id=206323

        Reviewed by Don Olmstead.

        * SourcesGTK.txt:
        * SourcesWPE.txt:
        * WebProcess/WebCoreSupport/WebPopupMenu.cpp:
        (WebKit::WebPopupMenu::setUpPlatformData):
        * WebProcess/WebCoreSupport/gtk/WebPopupMenuGtk.cpp: Removed.
        * WebProcess/WebCoreSupport/wpe/WebPopupMenuWPE.cpp: Removed.
        Bring GTK/WPE stub down for broader use.

2020-01-15  Ross Kirsling  <ross.kirsling@sony.com>

        [PlayStation] Add stubs for WebEditorClient
        https://bugs.webkit.org/show_bug.cgi?id=206320

        Reviewed by Don Olmstead.

        * WebProcess/WebCoreSupport/WebEditorClient.cpp:

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

        Share WebInspector stubs for ports without local inspection
        https://bugs.webkit.org/show_bug.cgi?id=206267

        Reviewed by Alex Christensen.

        No new tests. No change in behavior.

        Ports that do no allow local inspection of a web page can share a number of stubs
        around the Web Inspector. This is the case for iOS, WPE and the PlayStation port.
        Make the platform guards specific to actual implementations.

        * SourcesWPE.txt:
        * UIProcess/RemoteWebInspectorProxy.cpp:
        * UIProcess/WebInspectorProxy.cpp:
        * UIProcess/mac/RemoteWebInspectorProxyMac.mm:
        * UIProcess/wpe/WebInspectorProxyWPE.cpp: Removed.
        * WebProcess/WebPage/RemoteWebInspectorUI.cpp:
        (WebKit::RemoteWebInspectorUI::localizedStringsURL const):
        * WebProcess/WebPage/WebInspectorUI.cpp:
        (WebKit::WebInspectorUI::canSave):
        (WebKit::WebInspectorUI::localizedStringsURL const):
        * WebProcess/WebPage/mac/WebInspectorUIMac.mm:
        * WebProcess/WebPage/wpe/WebInspectorUIWPE.cpp: Removed.
        * WebProcess/WebPage/wpe/WebInspectorWPE.cpp: Removed.

2020-01-15  David Kilzer  <ddkilzer@apple.com>

        [Cocoa] Create a simulated crash log when the UI Process receives an invalid CoreIPC message
        <https://webkit.org/b/205368>
        <rdar://problem/58024593>

        Reviewed by Chris Dumez.

        * UIProcess/AuxiliaryProcessProxy.cpp:
        (WebKit::AuxiliaryProcessProxy::logInvalidMessage):
        - Extract common logging code to new method that calls
          RELEASE_LOG_FAULT().
        * UIProcess/AuxiliaryProcessProxy.h:
        (WebKit::AuxiliaryProcessProxy::logInvalidMessage):
        (WebKit::AuxiliaryProcessProxy::processName):
        - Add method declarations.

        * UIProcess/GPU/GPUProcessProxy.cpp:
        (WebKit::GPUProcessProxy::didReceiveInvalidMessage):
        - Use new AuxiliaryProcessProxy::logInvalidMessage().
        * UIProcess/GPU/GPUProcessProxy.h:
        (WebKit::GPUProcessProxy::processName const):
        - Add implementation.

        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::didReceiveInvalidMessage):
        - Use new AuxiliaryProcessProxy::logInvalidMessage().
        * UIProcess/Network/NetworkProcessProxy.h:
        (WebKit::NetworkProcessProxy::processName const):
        - Add implementation.

        * UIProcess/Plugins/PluginProcessProxy.cpp:
        (WebKit::PluginProcessProxy::didReceiveInvalidMessage):
        - Use new AuxiliaryProcessProxy::logInvalidMessage().
        * UIProcess/Plugins/PluginProcessProxy.h:
        (WebKit::PluginProcessProxy::processName const):
        - Add implementation.

        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::didReceiveInvalidMessage):
        - Use new AuxiliaryProcessProxy::logInvalidMessage().
        * UIProcess/WebProcessProxy.h:
        (WebKit::WebProcessProxy::processName const):
        - Add implementation.

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

        Add support for MediaStream audio track rendering in GPUProcess
        https://bugs.webkit.org/show_bug.cgi?id=206175

        Reviewed by Eric Carlson.

        Implement an AudioMediaStreamTrackRenderer at WebKit level by creating a remote renderer in GPUProcess and sending IPC to pass
        audio data as well as orders (start/stop/setMuted).

        Implement the remote renderer using WebCore audio track renderer.

        Enable WebKit remote renderer F GPU process for media is enabled.

        * DerivedSources-input.xcfilelist:
        * DerivedSources-output.xcfilelist:
        * DerivedSources.make:
        * GPUProcess/GPUConnectionToWebProcess.cpp:
        (WebKit::GPUConnectionToWebProcess::audioTrackRendererManager):
        (WebKit::GPUConnectionToWebProcess::didReceiveMessage):
        * GPUProcess/GPUConnectionToWebProcess.h:
        * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRenderer.cpp: Added.
        (WebKit::nextLogIdentifier):
        (WebKit::nullLogger):
        (WebKit::RemoteAudioMediaStreamTrackRenderer::RemoteAudioMediaStreamTrackRenderer):
        (WebKit::RemoteAudioMediaStreamTrackRenderer::~RemoteAudioMediaStreamTrackRenderer):
        (WebKit::RemoteAudioMediaStreamTrackRenderer::storage):
        (WebKit::RemoteAudioMediaStreamTrackRenderer::start):
        (WebKit::RemoteAudioMediaStreamTrackRenderer::stop):
        (WebKit::RemoteAudioMediaStreamTrackRenderer::clear):
        (WebKit::RemoteAudioMediaStreamTrackRenderer::setMuted):
        (WebKit::RemoteAudioMediaStreamTrackRenderer::setVolume):
        (WebKit::RemoteAudioMediaStreamTrackRenderer::audioSamplesStorageChanged):
        (WebKit::RemoteAudioMediaStreamTrackRenderer::audioSamplesAvailable):
        * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRenderer.h: Added.
        * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRenderer.messages.in: Added.
        * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRendererManager.cpp: Added.
        (WebKit::RemoteAudioMediaStreamTrackRendererManager::didReceiveRendererMessage):
        (WebKit::RemoteAudioMediaStreamTrackRendererManager::createRenderer):
        (WebKit::RemoteAudioMediaStreamTrackRendererManager::releaseRenderer):
        * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRendererManager.h: Added.
        (WebKit::RemoteAudioMediaStreamTrackRendererManager::didReceiveMessageFromWebProcess):
        * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRendererManager.messages.in: Added.
        * Scripts/webkit/messages.py:
        * Sources.txt:
        * SourcesCocoa.txt:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp:
        (WebKit::RemoteMediaPlayerManager::updatePreferences):
        * WebProcess/GPU/webrtc/AudioMediaStreamTrackRenderer.cpp: Added.
        (WebKit::AudioMediaStreamTrackRenderer::create):
        (WebKit::AudioMediaStreamTrackRenderer::AudioMediaStreamTrackRenderer):
        (WebKit::AudioMediaStreamTrackRenderer::~AudioMediaStreamTrackRenderer):
        (WebKit::AudioMediaStreamTrackRenderer::start):
        (WebKit::AudioMediaStreamTrackRenderer::stop):
        (WebKit::AudioMediaStreamTrackRenderer::clear):
        (WebKit::AudioMediaStreamTrackRenderer::setMuted):
        (WebKit::AudioMediaStreamTrackRenderer::setVolume):
        (WebKit::AudioMediaStreamTrackRenderer::pushSamples):
        (WebKit::AudioMediaStreamTrackRenderer::storageChanged):
        * WebProcess/GPU/webrtc/AudioMediaStreamTrackRenderer.h: Added.
        (WebKit::AudioMediaStreamTrackRenderer::identifier const):
        * WebProcess/GPU/webrtc/AudioMediaStreamTrackRendererIdentifier.h: Added.

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

        Unreviewed, rolling out r254548.
        https://bugs.webkit.org/show_bug.cgi?id=206279

        Broke launching WebContent (Requested by ap_ on #webkit).

        Reverted changeset:

        "Expand WebContent process sandbox with additional syscall"
        https://bugs.webkit.org/show_bug.cgi?id=206260
        https://trac.webkit.org/changeset/254548

2020-01-14  Ryosuke Niwa  <rniwa@webkit.org>

        Enable the offset assertion in HTMLTextFormControlElement::indexForPosition
        https://bugs.webkit.org/show_bug.cgi?id=205706

        Reviewed by Darin Adler.

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

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

        document.cookie should not do a sync IPC to the network process for iframes that do not have storage access
        https://bugs.webkit.org/show_bug.cgi?id=206108

        Reviewed by Geoff Garen and John Wilander.

        When ITP is enabled and ThirdPartyCookieBlockingMode::All mode is used (default in Safari), we can now detect
        that a third-party iframe does not have cookie access completely on the WebContent process side, instead of
        doing the check on the Network process side. The benefit is that this avoids doing a synchronous IPC every
        time a third-party iframe which does not have storage access tries to access document.cookie in JavaScript.
        Given that this should apply to a lot of iframes, this change is very beneficial to performance.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
        (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
        (WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue):
        (WebKit::NetworkConnectionToWebProcess::getRawCookies):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::logCookieInformationInternal):
        * NetworkProcess/NetworkSessionCreationParameters.cpp:
        (WebKit::NetworkSessionCreationParameters::encode const):
        (WebKit::NetworkSessionCreationParameters::decode):
        * NetworkProcess/NetworkSessionCreationParameters.h:
        * Scripts/webkit/messages.py:
        * Shared/WebProcessDataStoreParameters.h:
        (WebKit::WebProcessDataStoreParameters::encode const):
        (WebKit::WebProcessDataStoreParameters::decode):
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::setShouldBlockThirdPartyCookiesForTesting):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):
        (WebKit::WebProcessPool::webProcessDataStoreParameters):
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::setShouldBlockThirdPartyCookiesForTesting):
        * UIProcess/WebProcessProxy.h:
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::thirdPartyCookieBlockingMode const):
        (WebKit::WebsiteDataStore::parameters):
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::thirdPartyCookieBlockingMode const):
        (WebKit::WebsiteDataStore::setResourceLoadStatisticsShouldBlockThirdPartyCookiesForTesting):
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        * WebProcess/WebCoreSupport/WebResourceLoadObserver.cpp:
        (WebKit::WebResourceLoadObserver::requestStorageAccessUnderOpener):
        (WebKit::WebResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
        * WebProcess/WebCoreSupport/WebResourceLoadObserver.h:
        * WebProcess/WebPage/WebCookieJar.cpp:
        (WebKit::shouldBlockCookies):
        (WebKit::WebCookieJar::cookies const):
        (WebKit::WebCookieJar::setCookies):
        (WebKit::WebCookieJar::cookieRequestHeaderFieldValue const):
        (WebKit::WebCookieJar::getRawCookies const):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::addDomainWithPageLevelStorageAccess):
        (WebKit::WebPage::hasPageLevelStorageAccess const):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::setWebsiteDataStoreParameters):
        (WebKit::WebProcess::setShouldBlockThirdPartyCookiesForTesting):
        * WebProcess/WebProcess.h:
        (WebKit::WebProcess::thirdPartyCookieBlockingMode const):
        * WebProcess/WebProcess.messages.in:

2020-01-14  Peng Liu  <peng.liu6@apple.com>

        [Media in GPU process] Implement the remote video layer support
        https://bugs.webkit.org/show_bug.cgi?id=206043

        Reviewed by Youenn Fablet.

        RemoteMediaPlayerProxy in the GPU process creates a LayerHostingContext with createForExternalHostingProcess()
        and share the context ID with the MediaPlayerPrivateRemote in the Web process.
        Then the MediaPlayerPrivateRemote creates a hosting layer with the context ID for rendering.

        This patch updates RemoteMediaPlayerProxy::PrepareForPlayback to provide the initial video content box and scale
        for the VideoFullscreenLayerManagerObjC on the GPU process to create WebVideoContainerLayer.
        It adds XPC message RemoteMediaPlayerManager::FirstVideoFrameAvailable to notify the renderer on the Web process that the video layer is ready.
        RemoteMediaPlayerManagerProxy::SetSize message is removed to avoid the unnecessary XPC message
        because MediaPlayerPrivateAVFoundationObjC::setSize() does nothing.

        * GPUProcess/media/RemoteMediaPlayerProxy.cpp:
        (WebKit::RemoteMediaPlayerProxy::prepareForPlayback):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerFirstVideoFrameAvailable):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerRenderingModeChanged):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerContentBoxRect const):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerContentsScale const):
        (WebKit::RemoteMediaPlayerProxy::setSize): Deleted.
        * GPUProcess/media/RemoteMediaPlayerProxy.h:
        * GPUProcess/media/RemoteMediaPlayerProxy.messages.in:
        * Platform/cocoa/LayerHostingContext.h: Renamed from Source/WebKit/Platform/mac/LayerHostingContext.h.
        * Platform/cocoa/LayerHostingContext.mm: Renamed from Source/WebKit/Platform/mac/LayerHostingContext.mm.
        (WebKit::LayerHostingContext::createPlatformLayerForHostingContext):
        * Platform/ios/PaymentAuthorizationController.mm:
        * PluginProcess/mac/PluginControllerProxyMac.mm:
        * SourcesCocoa.txt:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
        (WebKit::MediaPlayerPrivateRemote::prepareForPlayback):
        (WebKit::MediaPlayerPrivateRemote::MediaPlayerPrivateRemote::load):
        (WebKit::MediaPlayerPrivateRemote::firstVideoFrameAvailable):
        (WebKit::MediaPlayerPrivateRemote::platformLayer const):
        (WebKit::MediaPlayerPrivateRemote::setSize): Deleted.
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.h:
        * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp:
        (WebKit::RemoteMediaPlayerManager::characteristicChanged):
        (WebKit::RemoteMediaPlayerManager::sizeChanged):
        (WebKit::RemoteMediaPlayerManager::addRemoteVideoTrack):
        (WebKit::RemoteMediaPlayerManager::removeRemoteVideoTrack):
        (WebKit::RemoteMediaPlayerManager::remoteVideoTrackConfigurationChanged):
        (WebKit::RemoteMediaPlayerManager::firstVideoFrameAvailable):
        * WebProcess/GPU/media/RemoteMediaPlayerManager.h:
        * WebProcess/GPU/media/RemoteMediaPlayerManager.messages.in:
        * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:

2020-01-10  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthn] Implement SPI to tell UI clients to select assertion responses
        https://bugs.webkit.org/show_bug.cgi?id=206112
        <rdar://problem/58495733>

        Reviewed by Alex Christensen.

        Covered by API tests.

        This patch adds a new delegate method in _WKWebAuthenticationPanelDelegate to tell UI clients to
        select an assertion response when multiple are returned from an authenticator. Here is the SPI:
        @protocol _WKWebAuthenticationPanelDelegate <NSObject>
        @optional
        ...
        - (void)panel:(_WKWebAuthenticationPanel *)panel selectAssertionResponse:(NSArray < _WKWebAuthenticationAssertionResponse *> *)responses completionHandler:(void (^)(_WKWebAuthenticationAssertionResponse *))completionHandler;
        ...
        @end

        A new interface is introduced to represent an authenticator assertion response:
        @interface _WKWebAuthenticationAssertionResponse : NSObject
        @property (nonatomic, readonly, copy) NSString *name;
        @property (nonatomic, readonly, copy) NSString *displayName;
        @property (nonatomic, readonly, copy) NSData *userHandle;
        @end
        Only members that can assist users to make a decision are exposed to UI clients.

        * Shared/API/APIObject.h:
        * Shared/Cocoa/APIObject.mm:
        (API::Object::newObject):
        * Sources.txt:
        * SourcesCocoa.txt:
        * UIProcess/API/APIWebAuthenticationAssertionResponse.cpp: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.h.
        (API::WebAuthenticationAssertionResponse::create):
        (API::WebAuthenticationAssertionResponse::WebAuthenticationAssertionResponse):
        * UIProcess/API/APIWebAuthenticationAssertionResponse.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.h.
        * UIProcess/API/Cocoa/_WKWebAuthenticationAssertionResponse.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.h.
        * UIProcess/API/Cocoa/_WKWebAuthenticationAssertionResponse.mm: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.h.
        (-[_WKWebAuthenticationAssertionResponse dealloc]):
        (-[_WKWebAuthenticationAssertionResponse name]):
        (-[_WKWebAuthenticationAssertionResponse displayName]):
        (-[_WKWebAuthenticationAssertionResponse userHandle]):
        (-[_WKWebAuthenticationAssertionResponse _apiObject]):
        * UIProcess/API/Cocoa/_WKWebAuthenticationAssertionResponseInternal.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.h.
        * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.h:
        * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm:
        * UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.h:
        * UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.mm:
        (WebKit::WebAuthenticationPanelClient::WebAuthenticationPanelClient):
        (WebKit::WebAuthenticationPanelClient::selectAssertionResponses const):
        * WebKit.xcodeproj/project.pbxproj:

2020-01-14  Luming Yin  <luming_yin@apple.com>

        Update API availability for autoplay event
        https://bugs.webkit.org/show_bug.cgi?id=202214
        <rdar://problem/55710395>

        Reviewed by Tim Horton.

        * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
        Make enums and WKUIDelegate method related to autoplay event available on iOS.

        * UIProcess/Cocoa/UIDelegate.h:
        * UIProcess/Cocoa/UIDelegate.mm:
        (WebKit::UIDelegate::setDelegate):
        (WebKit::toWKAutoplayEventFlags):
        (WebKit::toWKAutoplayEvent):
        (WebKit::UIDelegate::UIClient::handleAutoplayEvent):
        Make delegate methods related to autoplay events available on iOS.

2020-01-14  Tim Horton  <timothy_horton@apple.com>

        REGRESSION (r253394): After swiping back during a navigation, WKWebView gets stuck with the forward content, stops repainting
        https://bugs.webkit.org/show_bug.cgi?id=206268
        <rdar://problem/58536702>

        Reviewed by Simon Fraser.

        * UIProcess/ViewGestureController.cpp:
        (WebKit::ViewGestureController::endSwipeGesture):
        * UIProcess/ViewGestureController.h:
        * UIProcess/ios/ViewGestureControllerIOS.mm:
        (WebKit::ViewGestureController::beginSwipeGesture):
        (WebKit::ViewGestureController::endSwipeGesture):
        (WebKit::ViewGestureController::removeSwipeSnapshot):
        * UIProcess/mac/ViewGestureControllerMac.mm:
        (WebKit::ViewGestureController::beginSwipeGesture):
        (WebKit::ViewGestureController::removeSwipeSnapshot):
        After r253394, we start loading the destination page in willEndSwipeGesture,
        when we know the gesture will complete, instead of in endSwipeGesture,
        when it is actually done.

        This means that if we decide that we should tear down the snapshot immediately,
        this can now happen in the window between willEndSwipeGesture and endSwipeGesture.

        However, removeSwipeSnapshot has numerous dependencies on endSwipeGesture
        (especially on iOS, where there are /also/ dependencies in the other direction - 
        endSwipeGesture will never be called after removeSwipeSnapshot because
        of the gestureID mismatch).

        Regardless, it does not make sense to remove the snapshot while the animation
        is still running. So, if something causes removeSwipeSnapshot to be called
        before endSwipeGesture, we just set a bit and call it inside endSwipeGesture instead.

        This ends up putting the snapshot removal ordering back as it was before r253394.

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

        REGRESSION(iOS 13): createMediaElementSource not working
        https://bugs.webkit.org/show_bug.cgi?id=203435

        Reviewed by David Kilzer.

        The WebContent process is missing an entitlement according to logs.

        * Scripts/process-entitlements.sh:

2020-01-14  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-01-14  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r254533 and r254535.
        https://bugs.webkit.org/show_bug.cgi?id=206263

        Breaks iOS and macOS builds (Requested by ryanhaddad on
        #webkit).

        Reverted changesets:

        "[WebAuthn] Implement SPI to tell UI clients to select
        assertion responses"
        https://bugs.webkit.org/show_bug.cgi?id=206112
        https://trac.webkit.org/changeset/254533

        "Unreviewed, a build fix after r254533"
        https://trac.webkit.org/changeset/254535

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

        [iOS] Keyboard input is severely delayed after switching away from unresponsive tab
        https://bugs.webkit.org/show_bug.cgi?id=206242
        <rdar://problem/57132891>

        Reviewed by Tim Horton.

        UIKit delivers key events to WKWebView using asynchronous SPI (-handleKeyWebEvent:withCompletionHandler:). The
        completion handler is invoked when the web page has processed the event, and determines whether to proceed with
        default behavior via the `BOOL handled` argument. Using UIKeyboardImpl's UIKeyboardTaskQueue, UIKit appends
        subsequent key events to a queue, to be processed by the current first responder after the current key event
        has been handled.

        In the scenario where the web page is completely unresponsive, this means key events that come after an event
        that has been dispatched to the unresponsive page will be stuck in the task queue; this manifests in behaviors
        similar to the one in this bug:

        - Using a hardware keyboard, press any key in an unresponsive page in Safari.
        - Press CMD+T (to create a new tab and focus the unified field) or CMT+L (to just focus the unified field).
        - Try to type in the unified field.

        The result is that no characters are inserted in the unified field, because the hardware key events are stuck in
        UIKeyboardTaskQueue waiting for the unresponsive page to finish handling the current key event. To fix this, we
        introduce a mechanism for invoking the key event handler on WKContentView before the web page has actually
        finished processing the event, but only in the case where the web view has resigned first responder (and
        therefore won't receive subsequent key events anyways).

        Tests:  KeyboardInputTests.ResigningFirstResponderCancelsKeyEvents
                KeyboardInputTests.WaitForKeyEventHandlerInFirstResponder

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::hasQueuedKeyEvent const):
        (WebKit::WebPageProxy::firstQueuedKeyEvent const):
        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView resignFirstResponderForWebView]):

        After the content view has resigned first responder with a pending key event handler (and if it did not
        immediately become first responder again in the same runloop), then invoke the key event handler early, passing
        in `YES` for `handled` to prevent any default actions such as text insertion from being dispatched to the view.

2020-01-14  Jiewen Tan  <jiewen_tan@apple.com>

        Unreviewed, a build fix after r254533

        * UIProcess/WebAuthentication/fido/FidoAuthenticator.cpp:

2020-01-10  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthn] Implement SPI to tell UI clients to select assertion responses
        https://bugs.webkit.org/show_bug.cgi?id=206112
        <rdar://problem/58495733>

        Reviewed by Alex Christensen.

        Covered by API tests.

        This patch adds a new delegate method in _WKWebAuthenticationPanelDelegate to tell UI clients to
        select an assertion response when multiple are returned from an authenticator. Here is the SPI:
        @protocol _WKWebAuthenticationPanelDelegate <NSObject>
        @optional
        ...
        - (void)panel:(_WKWebAuthenticationPanel *)panel selectAssertionResponse:(NSArray < _WKWebAuthenticationAssertionResponse *> *)responses completionHandler:(void (^)(_WKWebAuthenticationAssertionResponse *))completionHandler;
        ...
        @end

        A new interface is introduced to represent an authenticator assertion response:
        @interface _WKWebAuthenticationAssertionResponse : NSObject
        @property (nonatomic, readonly, copy) NSString *name;
        @property (nonatomic, readonly, copy) NSString *displayName;
        @property (nonatomic, readonly, copy) NSData *userHandle;
        @end
        Only members that can assist users to make a decision are exposed to UI clients.

        * Shared/API/APIObject.h:
        * Shared/Cocoa/APIObject.mm:
        (API::Object::newObject):
        * Sources.txt:
        * SourcesCocoa.txt:
        * UIProcess/API/APIWebAuthenticationAssertionResponse.cpp: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.h.
        (API::WebAuthenticationAssertionResponse::create):
        (API::WebAuthenticationAssertionResponse::WebAuthenticationAssertionResponse):
        * UIProcess/API/APIWebAuthenticationAssertionResponse.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.h.
        * UIProcess/API/Cocoa/_WKWebAuthenticationAssertionResponse.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.h.
        * UIProcess/API/Cocoa/_WKWebAuthenticationAssertionResponse.mm: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.h.
        (-[_WKWebAuthenticationAssertionResponse dealloc]):
        (-[_WKWebAuthenticationAssertionResponse name]):
        (-[_WKWebAuthenticationAssertionResponse displayName]):
        (-[_WKWebAuthenticationAssertionResponse userHandle]):
        (-[_WKWebAuthenticationAssertionResponse _apiObject]):
        * UIProcess/API/Cocoa/_WKWebAuthenticationAssertionResponseInternal.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.h.
        * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.h:
        * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm:
        * UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.h:
        * UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.mm:
        (WebKit::WebAuthenticationPanelClient::WebAuthenticationPanelClient):
        (WebKit::WebAuthenticationPanelClient::selectAssertionResponses const):
        * WebKit.xcodeproj/project.pbxproj:

2020-01-14  Ross Kirsling  <ross.kirsling@sony.com>

        WebPasteboardProxyWPE should be WebPasteboardProxyLibWPE
        https://bugs.webkit.org/show_bug.cgi?id=206243

        Reviewed by Adrian Perez de Castro.

        WebPasteboardProxy.h already has USE(LIBWPE) so we basically just need to move the file.

        * SourcesWPE.txt:
        * UIProcess/WebPasteboardProxy.cpp:
        * UIProcess/libwpe/WebPasteboardProxyLibWPE.cpp: Renamed from Source/WebKit/UIProcess/wpe/WebPasteboardProxyWPE.cpp.

2020-01-14  Eric Carlson  <eric.carlson@apple.com>

        Make MediaPlayerPrivateRemoteProxy a message receiver
        https://bugs.webkit.org/show_bug.cgi?id=206237
        <rdar://problem/58569057>

        Reviewed by Youenn Fablet.

        No new tests, no functional change.

        Make MediaPlayerPrivateRemoteProxy a message receiver so we don't need a trampoline
        for every method in the MediaPlayerPrivateRemoteManagerProxy.

        * DerivedSources-input.xcfilelist:
        * DerivedSources-output.xcfilelist:
        * DerivedSources.make:
        * GPUProcess/GPUConnectionToWebProcess.cpp:
        (WebKit::GPUConnectionToWebProcess::didReceiveMessage):
        * GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp:
        (WebKit::RemoteMediaPlayerManagerProxy::didReceivePlayerMessage):
        (WebKit::RemoteMediaPlayerManagerProxy::prepareForPlayback): Deleted.
        (WebKit::RemoteMediaPlayerManagerProxy::load): Deleted.
        (WebKit::RemoteMediaPlayerManagerProxy::cancelLoad): Deleted.
        (WebKit::RemoteMediaPlayerManagerProxy::prepareToPlay): Deleted.
        (WebKit::RemoteMediaPlayerManagerProxy::play): Deleted.
        (WebKit::RemoteMediaPlayerManagerProxy::pause): Deleted.
        (WebKit::RemoteMediaPlayerManagerProxy::seek): Deleted.
        (WebKit::RemoteMediaPlayerManagerProxy::seekWithTolerance): Deleted.
        (WebKit::RemoteMediaPlayerManagerProxy::setVolume): Deleted.
        (WebKit::RemoteMediaPlayerManagerProxy::setMuted): Deleted.
        (WebKit::RemoteMediaPlayerManagerProxy::setPreload): Deleted.
        (WebKit::RemoteMediaPlayerManagerProxy::setPrivateBrowsingMode): Deleted.
        (WebKit::RemoteMediaPlayerManagerProxy::setPreservesPitch): Deleted.
        (WebKit::RemoteMediaPlayerManagerProxy::prepareForRendering): Deleted.
        (WebKit::RemoteMediaPlayerManagerProxy::setSize): Deleted.
        (WebKit::RemoteMediaPlayerManagerProxy::setVisible): Deleted.
        (WebKit::RemoteMediaPlayerManagerProxy::setShouldMaintainAspectRatio): Deleted.
        (WebKit::RemoteMediaPlayerManagerProxy::setVideoFullscreenFrame): Deleted.
        (WebKit::RemoteMediaPlayerManagerProxy::setVideoFullscreenGravity): Deleted.
        (WebKit::RemoteMediaPlayerManagerProxy::acceleratedRenderingStateChanged): Deleted.
        (WebKit::RemoteMediaPlayerManagerProxy::setShouldDisableSleep): Deleted.
        (WebKit::RemoteMediaPlayerManagerProxy::setRate): Deleted.
        (WebKit::RemoteMediaPlayerManagerProxy::audioTrackSetEnabled): Deleted.
        (WebKit::RemoteMediaPlayerManagerProxy::videoTrackSetSelected): Deleted.
        * GPUProcess/media/RemoteMediaPlayerManagerProxy.h:
        * GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in:
        * GPUProcess/media/RemoteMediaPlayerProxy.h:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/GPU/media/AudioTrackPrivateRemote.cpp:
        (WebKit::AudioTrackPrivateRemote::setEnabled):
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
        (WebKit::MediaPlayerPrivateRemote::prepareForPlayback):
        (WebKit::MediaPlayerPrivateRemote::MediaPlayerPrivateRemote::load):
        (WebKit::MediaPlayerPrivateRemote::cancelLoad):
        (WebKit::MediaPlayerPrivateRemote::prepareToPlay):
        (WebKit::MediaPlayerPrivateRemote::play):
        (WebKit::MediaPlayerPrivateRemote::pause):
        (WebKit::MediaPlayerPrivateRemote::setPreservesPitch):
        (WebKit::MediaPlayerPrivateRemote::setVolumeDouble):
        (WebKit::MediaPlayerPrivateRemote::setMuted):
        (WebKit::MediaPlayerPrivateRemote::setPreload):
        (WebKit::MediaPlayerPrivateRemote::setPrivateBrowsingMode):
        (WebKit::MediaPlayerPrivateRemote::seek):
        (WebKit::MediaPlayerPrivateRemote::seekWithTolerance):
        (WebKit::MediaPlayerPrivateRemote::prepareForRendering):
        (WebKit::MediaPlayerPrivateRemote::setSize):
        (WebKit::MediaPlayerPrivateRemote::setVisible):
        (WebKit::MediaPlayerPrivateRemote::setShouldMaintainAspectRatio):
        (WebKit::MediaPlayerPrivateRemote::setVideoFullscreenFrame):
        (WebKit::MediaPlayerPrivateRemote::setVideoFullscreenGravity):
        (WebKit::MediaPlayerPrivateRemote::acceleratedRenderingStateChanged):
        (WebKit::MediaPlayerPrivateRemote::setShouldDisableSleep):
        * WebProcess/GPU/media/VideoTrackPrivateRemote.cpp:
        (WebKit::VideoTrackPrivateRemote::setSelected):

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

        Share TextChecker stub for ports without text checking
        https://bugs.webkit.org/show_bug.cgi?id=205964

        Reviewed by Ross Kirsling.

        No new tests. No change in behavior.

        The Windows and WPE ports have the same stub for text checking. Combine those
        two for non-Cocoa and non-GTK ports.

        * PlatformFTW.cmake:
        * PlatformWin.cmake:
        * Sources.txt:
        * SourcesWPE.txt:
        * UIProcess/TextChecker.cpp: Renamed from Source/WebKit/UIProcess/wpe/TextCheckerWPE.cpp.
        (WebKit::checkerState):
        (WebKit::TextChecker::state):
        (WebKit::TextChecker::checkTextOfParagraph):
        * UIProcess/win/TextCheckerWin.cpp: Removed.
        * WebKit.xcodeproj/project.pbxproj:

2020-01-14  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r254505.

        Breaks watchOS/tvOS/Catalyst builds.

        Reverted changeset:

        "Add support for MediaStream audio track rendering in
        GPUProcess"
        https://bugs.webkit.org/show_bug.cgi?id=206175
        https://trac.webkit.org/changeset/254505

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

        Suppress compiler warnings
        https://bugs.webkit.org/show_bug.cgi?id=206235

        Reviewed by Youenn Fablet.

        Use PRIu64 formatter for uint64_t instead of %llu.

        No functional changes.

        * UIProcess/WebPageProxy.cpp:

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

        Use even more "shortest form" formatting, and less "fixed precision" and "fixed width"
        https://bugs.webkit.org/show_bug.cgi?id=198918

        Reviewed by Sam Weinig.

        * NetworkProcess/cache/NetworkCache.cpp:
        (WebKit::NetworkCache::Cache::dumpContentsToFile): Use shortest instead of fixed.
        Also use makeString instead of StringBuilder.

        * NetworkProcess/cache/NetworkCacheEntry.cpp:
        (WebKit::NetworkCache::Entry::asJSON const): Use shortest instead of fixed.
        Also use multiple-argument append on StringBuilder to make the function shorter
        and easier to read.
        * Shared/Gamepad/GamepadData.cpp:
        (WebKit::GamepadData::loggingString const): Ditto.

        * UIProcess/ViewGestureController.cpp:
        (WebKit::ViewGestureController::SnapshotRemovalTracker::startWatchdog):
        Use shortest instead of fixed.

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

        [GLib] Remove unused private variable
        https://bugs.webkit.org/show_bug.cgi?id=206232

        Reviewed by Carlos Garcia Campos.

        Remove m_context which is not used.

        No functional changes.

        * UIProcess/API/glib/WebKitProtocolHandler.cpp:
        (WebKit::WebKitProtocolHandler::WebKitProtocolHandler):
        * UIProcess/API/glib/WebKitProtocolHandler.h:

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

        Add support for MediaStream audio track rendering in GPUProcess
        https://bugs.webkit.org/show_bug.cgi?id=206175

        Reviewed by Eric Carlson.

        Implement an AudioMediaStreamTrackRenderer at WebKit level by creating a remote renderer in GPUProcess and sending IPC to pass
        audio data as well as orders (start/stop/setMuted).

        Implement the remote renderer using WebCore audio track renderer.

        Enable WebKit remote renderer F GPU process for media is enabled.

        * DerivedSources-input.xcfilelist:
        * DerivedSources-output.xcfilelist:
        * DerivedSources.make:
        * GPUProcess/GPUConnectionToWebProcess.cpp:
        (WebKit::GPUConnectionToWebProcess::audioTrackRendererManager):
        (WebKit::GPUConnectionToWebProcess::didReceiveMessage):
        * GPUProcess/GPUConnectionToWebProcess.h:
        * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRenderer.cpp: Added.
        (WebKit::nextLogIdentifier):
        (WebKit::nullLogger):
        (WebKit::RemoteAudioMediaStreamTrackRenderer::RemoteAudioMediaStreamTrackRenderer):
        (WebKit::RemoteAudioMediaStreamTrackRenderer::~RemoteAudioMediaStreamTrackRenderer):
        (WebKit::RemoteAudioMediaStreamTrackRenderer::storage):
        (WebKit::RemoteAudioMediaStreamTrackRenderer::start):
        (WebKit::RemoteAudioMediaStreamTrackRenderer::stop):
        (WebKit::RemoteAudioMediaStreamTrackRenderer::clear):
        (WebKit::RemoteAudioMediaStreamTrackRenderer::setMuted):
        (WebKit::RemoteAudioMediaStreamTrackRenderer::setVolume):
        (WebKit::RemoteAudioMediaStreamTrackRenderer::audioSamplesStorageChanged):
        (WebKit::RemoteAudioMediaStreamTrackRenderer::audioSamplesAvailable):
        * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRenderer.h: Added.
        * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRenderer.messages.in: Added.
        * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRendererManager.cpp: Added.
        (WebKit::RemoteAudioMediaStreamTrackRendererManager::didReceiveRendererMessage):
        (WebKit::RemoteAudioMediaStreamTrackRendererManager::createRenderer):
        (WebKit::RemoteAudioMediaStreamTrackRendererManager::releaseRenderer):
        * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRendererManager.h: Added.
        (WebKit::RemoteAudioMediaStreamTrackRendererManager::didReceiveMessageFromWebProcess):
        * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRendererManager.messages.in: Added.
        * Scripts/webkit/messages.py:
        * Sources.txt:
        * SourcesCocoa.txt:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp:
        (WebKit::RemoteMediaPlayerManager::updatePreferences):
        * WebProcess/GPU/webrtc/AudioMediaStreamTrackRenderer.cpp: Added.
        (WebKit::AudioMediaStreamTrackRenderer::create):
        (WebKit::AudioMediaStreamTrackRenderer::AudioMediaStreamTrackRenderer):
        (WebKit::AudioMediaStreamTrackRenderer::~AudioMediaStreamTrackRenderer):
        (WebKit::AudioMediaStreamTrackRenderer::start):
        (WebKit::AudioMediaStreamTrackRenderer::stop):
        (WebKit::AudioMediaStreamTrackRenderer::clear):
        (WebKit::AudioMediaStreamTrackRenderer::setMuted):
        (WebKit::AudioMediaStreamTrackRenderer::setVolume):
        (WebKit::AudioMediaStreamTrackRenderer::pushSamples):
        (WebKit::AudioMediaStreamTrackRenderer::storageChanged):
        * WebProcess/GPU/webrtc/AudioMediaStreamTrackRenderer.h: Added.
        (WebKit::AudioMediaStreamTrackRenderer::identifier const):
        * WebProcess/GPU/webrtc/AudioMediaStreamTrackRendererIdentifier.h: Added.

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

        CacheStorage::Engine::clearCachesForOriginFromDisk ASSERT is buggy
        https://bugs.webkit.org/show_bug.cgi?id=206057
        <rdar://problem/57762994>

        Reviewed by John Wilander.

        The ASSERT is only valid if the engine is initialized.
        It is not needed to initialize it if the plan is to remove all disk files.
        Instead, update ASSERT to check that either m_salt is not there or the salt is there and the path is as expected.

        * NetworkProcess/cache/CacheStorageEngine.cpp:
        (WebKit::CacheStorage::Engine::clearCachesForOriginFromDirectories):

2020-01-14  Eric Carlson  <eric.carlson@apple.com>

        Expose video tracks for media files in the GPUProcess
        https://bugs.webkit.org/show_bug.cgi?id=206209
        <rdar://problem/58553026>

        Reviewed by Jer Noble.

        * GPUProcess/media/RemoteAudioTrackProxy.cpp:
        (WebKit::RemoteAudioTrackProxy::configuration):
        * GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp:
        (WebKit::RemoteMediaPlayerManagerProxy::videoTrackSetSelected):
        * GPUProcess/media/RemoteMediaPlayerManagerProxy.h:
        * GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in:
        * GPUProcess/media/RemoteMediaPlayerProxy.cpp:
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerDidAddVideoTrack):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerDidRemoveVideoTrack):
        (WebKit::RemoteMediaPlayerProxy::videoTrackSetSelected):
        * GPUProcess/media/RemoteMediaPlayerProxy.h:
        * GPUProcess/media/RemoteVideoTrackProxy.cpp: Copied from Source/WebKit/GPUProcess/media/RemoteAudioTrackProxy.cpp.
        (WebKit::RemoteVideoTrackProxy::RemoteVideoTrackProxy):
        (WebKit::RemoteVideoTrackProxy::configuration):
        (WebKit::RemoteVideoTrackProxy::configurationChanged):
        (WebKit::RemoteVideoTrackProxy::willRemove):
        (WebKit::RemoteVideoTrackProxy::selectedChanged):
        (WebKit::RemoteVideoTrackProxy::idChanged):
        (WebKit::RemoteVideoTrackProxy::labelChanged):
        (WebKit::RemoteVideoTrackProxy::languageChanged):
        * GPUProcess/media/RemoteVideoTrackProxy.h: Added.
        * GPUProcess/media/TrackPrivateRemoteConfiguration.h:
        (WebKit::TrackPrivateRemoteConfiguration::encode const):
        (WebKit::TrackPrivateRemoteConfiguration::decode):
        * NetworkProcess/cache/CacheStorageEngine.cpp:
        (WebKit::CacheStorage::Engine::clearCachesForOriginFromDirectories):
        * Sources.txt:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/GPU/media/AudioTrackPrivateRemote.cpp:
        (WebKit::AudioTrackPrivateRemote::updateConfiguration):
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
        (WebKit::MediaPlayerPrivateRemote::addRemoteVideoTrack):
        (WebKit::MediaPlayerPrivateRemote::removeRemoteVideoTrack):
        (WebKit::MediaPlayerPrivateRemote::remoteVideoTrackConfigurationChanged):
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.h:
        * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp:
        (WebKit::RemoteMediaPlayerManager::addRemoteVideoTrack):
        (WebKit::RemoteMediaPlayerManager::removeRemoteVideoTrack):
        (WebKit::RemoteMediaPlayerManager::remoteVideoTrackConfigurationChanged):
        * WebProcess/GPU/media/RemoteMediaPlayerManager.h:
        * WebProcess/GPU/media/RemoteMediaPlayerManager.messages.in:
        * WebProcess/GPU/media/RemoteVideoTrackProxy.cpp: Copied from Source/WebKit/GPUProcess/media/RemoteAudioTrackProxy.cpp.
        (WebKit::RemoteVideoTrackProxy::RemoteVideoTrackProxy):
        (WebKit::RemoteVideoTrackProxy::configuration):
        (WebKit::RemoteVideoTrackProxy::configurationChanged):
        (WebKit::RemoteVideoTrackProxy::willRemove):
        (WebKit::RemoteVideoTrackProxy::selectedChanged):
        (WebKit::RemoteVideoTrackProxy::idChanged):
        (WebKit::RemoteVideoTrackProxy::labelChanged):
        (WebKit::RemoteVideoTrackProxy::languageChanged):
        * WebProcess/GPU/media/RemoteVideoTrackProxy.h: Added.
        * WebProcess/GPU/media/VideoTrackPrivateRemote.cpp: Copied from Source/WebKit/WebProcess/GPU/media/AudioTrackPrivateRemote.cpp.
        (WebKit::VideoTrackPrivateRemote::VideoTrackPrivateRemote):
        (WebKit::VideoTrackPrivateRemote::setSelected):
        (WebKit::VideoTrackPrivateRemote::updateConfiguration):
        * WebProcess/GPU/media/VideoTrackPrivateRemote.h: Added.
        (WebKit::VideoTrackPrivateRemote::create):

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

        [WebAuthn] Support CTAP Client Pin
        https://bugs.webkit.org/show_bug.cgi?id=191516
        <rdar://problem/56558558>

        Unreviewed build fix after r254439.

        CryptoKeyEC was forward declared into WebCore but the namespace was not used in
        continueGetPinTokenAfterRequestPin. Looks like something in the unified sources
        was covering this issue.

        * UIProcess/WebAuthentication/fido/CtapAuthenticator.h:

2020-01-13  Ross Kirsling  <ross.kirsling@sony.com>

        Expose Phase on all WebWheelEvent implementations
        https://bugs.webkit.org/show_bug.cgi?id=206195

        Reviewed by Don Olmstead.

        No change to behavior; just unhide what needn't be hidden.

        * Shared/WebEvent.h:
        (WebKit::WebWheelEvent::directionInvertedFromDevice const):
        (WebKit::WebWheelEvent::momentumPhase const):
        * Shared/WebWheelEvent.cpp:
        (WebKit::WebWheelEvent::WebWheelEvent):

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

        Share WebPreferences stub for ports without an implementation
        https://bugs.webkit.org/show_bug.cgi?id=206186

        Reviewed by Alex Christensen.

        No new tests. No change in behavior.

        Moved the platform agnostic stubs that were common in the GTK, WPE and Windows ports
        into WebPreferences.cpp. Only Cocoa ports are implementing the platform specific parts
        of WebPreferences.

        Also moving WebPreferencesMac.mm to WebPreferencesCocoa.mm. There were no platform guards
        for iOS family code and there was no iOS specific implementation.

        * PlatformFTW.cmake:
        * PlatformWin.cmake:
        * SourcesCocoa.txt:
        * SourcesWPE.txt:
        * UIProcess/Cocoa/WebPreferencesCocoa.mm: Renamed from Source/WebKit/UIProcess/mac/WebPreferencesMac.mm.
        * UIProcess/WebPreferences.cpp:
        (WebKit::WebPreferences::platformInitializeStore):
        (WebKit::WebPreferences::platformUpdateStringValueForKey):
        (WebKit::WebPreferences::platformUpdateBoolValueForKey):
        (WebKit::WebPreferences::platformUpdateUInt32ValueForKey):
        (WebKit::WebPreferences::platformUpdateDoubleValueForKey):
        (WebKit::WebPreferences::platformUpdateFloatValueForKey):
        (WebKit::WebPreferences::platformDeleteKey):
        (WebKit::WebPreferences::platformGetStringUserValueForKey):
        (WebKit::WebPreferences::platformGetBoolUserValueForKey):
        (WebKit::WebPreferences::platformGetUInt32UserValueForKey):
        (WebKit::WebPreferences::platformGetDoubleUserValueForKey):
        * UIProcess/gtk/WebPreferencesGtk.cpp:
        (WebKit::WebPreferences::platformUpdateStringValueForKey): Deleted.
        (WebKit::WebPreferences::platformUpdateBoolValueForKey): Deleted.
        (WebKit::WebPreferences::platformUpdateUInt32ValueForKey): Deleted.
        (WebKit::WebPreferences::platformUpdateDoubleValueForKey): Deleted.
        (WebKit::WebPreferences::platformUpdateFloatValueForKey): Deleted.
        (WebKit::WebPreferences::platformDeleteKey): Deleted.
        (WebKit::WebPreferences::platformGetStringUserValueForKey): Deleted.
        (WebKit::WebPreferences::platformGetBoolUserValueForKey): Deleted.
        (WebKit::WebPreferences::platformGetUInt32UserValueForKey): Deleted.
        (WebKit::WebPreferences::platformGetDoubleUserValueForKey): Deleted.
        * UIProcess/win/WebPreferencesWin.cpp: Removed.
        * UIProcess/wpe/WebPreferencesWPE.cpp: Removed.
        * WebKit.xcodeproj/project.pbxproj:

2020-01-13  Keith Rollin  <krollin@apple.com>

        Reformat WebProcessPool logging
        https://bugs.webkit.org/show_bug.cgi?id=205882
        <rdar://problem/58384349>

        Reviewed by Brent Fulgham.

        Update the format used by WebProcessPool in its RELEASE_LOG logging.
        Use the format used by WebPageProxy and NetworkResourceLoader, which
        is generally of the form:

            <object-address> - [<values that help thread together operations>] <class>::<method>: <message and other useful values>

        So, for example:

            Using prewarmed process 0

        becomes:

            0x7f81e8804008 - WebProcessPool::processForRegistrableDomain: Using prewarmed process (process=0x1471c2a00, PID=64197)

        No new tests - no added or changed functionality.

        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::applicationIsAboutToSuspend):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess):
        (WebKit::WebProcessPool::tryTakePrewarmedProcess):
        (WebKit::WebProcessPool::prewarmProcess):
        (WebKit::WebProcessPool::processForRegistrableDomain):
        (WebKit::WebProcessPool::didReachGoodTimeToPrewarm):
        (WebKit::WebProcessPool::handleMemoryPressureWarning):
        (WebKit::WebProcessPool::processForNavigation):
        (WebKit::WebProcessPool::processForNavigationInternal):
        (WebKit::WebProcessPool::setWebProcessHasUploads):
        (WebKit::WebProcessPool::clearWebProcessHasUploads):
        (WebKit::WebProcessPool::setWebProcessIsPlayingAudibleMedia):
        (WebKit::WebProcessPool::clearWebProcessIsPlayingAudibleMedia):
        (WebKit::WebProcessPool::setUseSeparateServiceWorkerProcess):

2020-01-13  Kate Cheney  <katherine_cheney@apple.com>

        _WKResourceLoadStatisticsFirstParty should be forward declared not imported in _WKResourceLoadStatisticsThirdParty
        https://bugs.webkit.org/show_bug.cgi?id=206183
        <rdar://problem/58535245>

        Reviewed by Alex Christensen.

        * UIProcess/API/Cocoa/_WKResourceLoadStatisticsFirstParty.h:
        * UIProcess/API/Cocoa/_WKResourceLoadStatisticsThirdParty.h:
        * UIProcess/API/Cocoa/_WKResourceLoadStatisticsThirdParty.mm:
        The additional import statement here was unnecessary because
        this file imports _WKResourceLoadStatisticsThirdPartyInternal.h
        which forward declares the _WKResourceLoadStatisticsFirstParty class.

2020-01-13  Kate Cheney  <katherine_cheney@apple.com>

        Unreviewed followup fix to: https://bugs.webkit.org/show_bug.cgi?id=205288.
        This flag should be off-by-default.

        * Shared/WebPreferences.yaml:

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

        Propogate UIEdgeInsets from WKWebView to WKSafeBrowsingWarning on iOS
        https://bugs.webkit.org/show_bug.cgi?id=206201
        <rdar://problem/57135847>

        Reviewed by Tim Horton.

        Manually verified this fixes the radar.

        * UIProcess/API/ios/WKWebViewIOS.mm:
        (-[WKWebView _computedObscuredInsetForSafeBrowsingWarning]):
        (-[WKWebView safeAreaInsetsDidChange]):
        (-[WKWebView _setObscuredInsets:]):

2020-01-13  Eric Carlson  <eric.carlson@apple.com>

        Expose audio tracks for media files in the GPUProcess
        https://bugs.webkit.org/show_bug.cgi?id=206152
        <rdar://problem/58513227>

        Reviewed by youenn fablet.

        * GPUProcess/media/RemoteAudioTrackProxy.cpp: Added.
        (WebKit::RemoteAudioTrackProxy::RemoteAudioTrackProxy):
        (WebKit::RemoteAudioTrackProxy::configuration):
        (WebKit::RemoteAudioTrackProxy::configurationChanged):
        (WebKit::RemoteAudioTrackProxy::willRemove):
        (WebKit::RemoteAudioTrackProxy::enabledChanged):
        (WebKit::RemoteAudioTrackProxy::idChanged):
        (WebKit::RemoteAudioTrackProxy::labelChanged):
        (WebKit::RemoteAudioTrackProxy::languageChanged):
        * GPUProcess/media/RemoteAudioTrackProxy.h: Added.
        * GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp:
        (WebKit::RemoteMediaPlayerManagerProxy::setRate):
        (WebKit::RemoteMediaPlayerManagerProxy::audioTrackSetEnabled):
        * GPUProcess/media/RemoteMediaPlayerManagerProxy.h:
        * GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in:
        * GPUProcess/media/RemoteMediaPlayerProxy.cpp:
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerDidAddAudioTrack):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerDidRemoveAudioTrack):
        (WebKit::RemoteMediaPlayerProxy::audioTrackSetEnabled):
        * GPUProcess/media/RemoteMediaPlayerProxy.h:
        * GPUProcess/media/TrackPrivateRemoteConfiguration.h: Added.
        (WebKit::TrackPrivateRemoteConfiguration::encode const):
        (WebKit::TrackPrivateRemoteConfiguration::decode):
        * GPUProcess/media/TrackPrivateRemoteIdentifier.h: Added.
        * Scripts/webkit/messages.py:
        * Sources.txt:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/GPU/media/AudioTrackPrivateRemote.cpp: Added.
        (WebKit::AudioTrackPrivateRemote::AudioTrackPrivateRemote):
        (WebKit::AudioTrackPrivateRemote::setEnabled):
        (WebKit::AudioTrackPrivateRemote::updateConfiguration):
        * WebProcess/GPU/media/AudioTrackPrivateRemote.h: Added.
        (WebKit::AudioTrackPrivateRemote::create):
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
        (WebKit::MediaPlayerPrivateRemote::addRemoteAudioTrack):
        (WebKit::MediaPlayerPrivateRemote::removeRemoteAudioTrack):
        (WebKit::MediaPlayerPrivateRemote::remoteAudioTrackConfigurationChanged):
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.h:
        * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp:
        (WebKit::RemoteMediaPlayerManager::timeChanged):
        (WebKit::RemoteMediaPlayerManager::durationChanged):
        (WebKit::RemoteMediaPlayerManager::engineFailedToLoad):
        (WebKit::RemoteMediaPlayerManager::characteristicChanged):
        (WebKit::RemoteMediaPlayerManager::sizeChanged):
        (WebKit::RemoteMediaPlayerManager::addRemoteAudioTrack):
        (WebKit::RemoteMediaPlayerManager::removeRemoteAudioTrack):
        (WebKit::RemoteMediaPlayerManager::remoteAudioTrackConfigurationChanged):
        (WebKit::RemoteMediaPlayerManager::updateCachedState):
        * WebProcess/GPU/media/RemoteMediaPlayerManager.h:
        * WebProcess/GPU/media/RemoteMediaPlayerManager.messages.in:
        * WebProcess/GPU/webrtc/LibWebRTCCodecs.cpp:

2020-01-06  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthn] Support CTAP Client Pin
        https://bugs.webkit.org/show_bug.cgi?id=191516
        <rdar://problem/56558558>

        Reviewed by Brent Fulgham.

        This patch implements authenticatorClientPIN from the spec:
        https://fidoalliance.org/specs/fido-v2.0-ps-20190130/fido-client-to-authenticator-protocol-v2.0-ps-20190130.html#authenticatorClientPIN
        Specifically, it implements section 5.5.1, 5.5.3, 5.5.4, 5.5.7, and 5.5.8.

        Here is the flow how makeCredential/getAssertion works with a PIN in our implementation:
        1. Determine if the connected authenticator has a PIN;
        2. If yes, send the makeCredential/getAssertion request to the authenticator with an empty pinAuth
        such that the authenticator will wink for user gestures. This step intends to confirm the authenticator
        is the one the user wants to use. Otherwise, we don't know which authenticator to send the PIN
        if multiple are connected;
        3. Once the user confirms the authetnicator, it will return either CTAP2_ERR_PIN_INVALID or
        CTAP2_ERR_PIN_AUTH_INVALID. Some authenticators return CTAP2_ERR_PIN_AUTH_INVALID even though
        it is not suggested by the spec;
        4. Get retries from the authenticator;
        5. Get key agreement from the authenticator;
        6. Ask the UI client for the PIN and at the meantime inform it the retries;
        7. Get pin token from the authenticator;
        8. Resend the makeCredential/getAssertion request with the desired pinAuth.

        Besides implementating the above flow, this patch also fixes some bugs within the PIN commands encoder:
        1. pinAuth/pinProtocol are wrongly encoded for makeCredential/getAssertion;
        2. AES CBC should be called without any padding. Therefore, CryptoAlgorithmAES_CBC adds a no padding mode;
        3. The sharedSecret is the SHA256 digest of the ECDH key agreement instead of the raw key agreement.

        * UIProcess/API/APIWebAuthenticationPanelClient.h:
        (API::WebAuthenticationPanelClient::requestPin const):
        * UIProcess/WebAuthentication/Authenticator.h:
        * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
        (WebKit::AuthenticatorManager::requestPin):
        * UIProcess/WebAuthentication/AuthenticatorManager.h:
        * UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.h:
        * UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.mm:
        (WebKit::WebAuthenticationPanelClient::WebAuthenticationPanelClient):
        (WebKit::WebAuthenticationPanelClient::requestPin const):
        * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
        (WebKit::MockHidConnection::feedReports):
        * UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp:
        (WebKit::CtapAuthenticator::makeCredential):
        (WebKit::CtapAuthenticator::continueMakeCredentialAfterResponseReceived):
        (WebKit::CtapAuthenticator::getAssertion):
        (WebKit::CtapAuthenticator::continueGetAssertionAfterResponseReceived):
        (WebKit::CtapAuthenticator::getRetries):
        (WebKit::CtapAuthenticator::continueGetKeyAgreementAfterGetRetries):
        (WebKit::CtapAuthenticator::continueRequestPinAfterGetKeyAgreement):
        (WebKit::CtapAuthenticator::continueGetPinTokenAfterRequestPin):
        (WebKit::CtapAuthenticator::continueRequestAfterGetPinToken):
        (WebKit::CtapAuthenticator::continueMakeCredentialAfterResponseReceived const): Deleted.
        * UIProcess/WebAuthentication/fido/CtapAuthenticator.h:

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

        [iOS] Remove 'com.apple.diagnosticd' from WebContent process sandbox
        https://bugs.webkit.org/show_bug.cgi?id=206114
        <rdar://problem/58496791>

        Reviewed by Per Arne Vollan.

        In Bug 205292 we began dynamically adding a sandbox extension for 'com.apple.diagnosticd' when needed.
        We should remove the blanket permission from the sandbox.

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

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

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

        [macCatalyst] UI process crashes on launch after r254101
        https://bugs.webkit.org/show_bug.cgi?id=206156
        <rdar://problem/58514942>

        Reviewed by Brent Fulgham.

        Fixes the crash by not soft-linking BackBoardServices in an attempt to invoke BKSDisplayBrightnessGetCurrent on
        macCatalyst. Prior to r254101, this was only defined on iOS and not watchOS or tvOS; after this change, it
        should be defined only on iOS, watchOS and tvOS.

        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::registerNotificationObservers):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::initializeNewWebProcess):
        * UIProcess/WebProcessPool.h:
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:
        * WebProcess/cocoa/WebProcessCocoa.mm:

2020-01-13  Antti Koivisto  <antti@apple.com>

        [LFC][Integration] Enable LFC integration
        https://bugs.webkit.org/show_bug.cgi?id=206128

        Reviewed by Zalan Bujtas.

        * Shared/WebPreferences.yaml:

2020-01-13  Carlos Garcia Campos  <cgarcia@igalia.com>

        WebDriver: pressed virtual keys not correctly handled in action sequences
        https://bugs.webkit.org/show_bug.cgi?id=205997

        Reviewed by Brian Burg.

        When modifiers are present we need to translate the keys that might be affected by the modifiers.

        * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
        (WebKit::doKeyStrokeEvent):

2020-01-13  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. [GTK][WPE] Add missing autocleanup definition for WebKitInputMethodContext

        I forgot to add it in r253749.

        * UIProcess/API/gtk/WebKitAutocleanups.h:
        * UIProcess/API/wpe/WebKitAutocleanups.h:

2020-01-12  Tim Horton  <timothy_horton@apple.com>

        Remove CorePDF linkage in WebKit
        https://bugs.webkit.org/show_bug.cgi?id=206103
        <rdar://problem/58490563>

        Reviewed by Wenson Hsieh.

        * Configurations/WebKit.xcconfig:

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

        Expose frame information on _WKResourceLoadInfo
        https://bugs.webkit.org/show_bug.cgi?id=206104
        <rdar://problem/57132290>

        Reviewed by Dean Jackson.

        * NetworkProcess/NetworkResourceLoadParameters.cpp:
        (WebKit::NetworkResourceLoadParameters::encode const):
        (WebKit::NetworkResourceLoadParameters::decode):
        * NetworkProcess/NetworkResourceLoadParameters.h:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::resourceLoadInfo):
        * Shared/API/Cocoa/_WKFrameHandle.h:
        * Shared/API/Cocoa/_WKFrameHandle.mm:
        (-[_WKFrameHandle frameID]):
        (-[_WKFrameHandle initWithCoder:]):
        (-[_WKFrameHandle encodeWithCoder:]):
        (-[_WKFrameHandle _frameID]): Deleted.
        * Shared/API/Cocoa/_WKFrameHandleInternal.h:
        * Shared/ResourceLoadInfo.h:
        (WebKit::ResourceLoadInfo::encode const):
        (WebKit::ResourceLoadInfo::decode):
        * UIProcess/API/APIResourceLoadInfo.h:
        * UIProcess/API/Cocoa/_WKInspector.mm:
        (-[_WKInspector showMainResourceForFrame:]):
        * UIProcess/API/Cocoa/_WKResourceLoadInfo.h:
        * UIProcess/API/Cocoa/_WKResourceLoadInfo.mm:
        (-[_WKResourceLoadInfo frame]):
        (-[_WKResourceLoadInfo parentFrame]):
        * UIProcess/API/mac/WKWebViewMac.mm:
        (-[WKWebView _canChangeFrameLayout:]):
        (-[WKWebView _printOperationWithPrintInfo:forFrame:]):
        * UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.mm:
        (-[WKReloadFrameErrorRecoveryAttempter attemptRecovery]):
        * UIProcess/ios/WKContentView.mm:
        (-[WKContentView _wk_pageCountForPrintFormatter:]):
        * WebProcess/Automation/WebAutomationSessionProxy.cpp:
        (WebKit::evaluateJavaScriptCallback):
        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
        (+[WKWebProcessPlugInFrame lookUpFrameFromHandle:]):
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::addParametersFromFrame):
        (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
        (WebKit::WebLoaderStrategy::loadResourceSynchronously):
        (WebKit::WebLoaderStrategy::startPingLoad):
        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        (WebKit::WebSWContextManagerConnection::installServiceWorker):

2020-01-11  Kate Cheney  <katherine_cheney@apple.com>

        Add correct grandfathering functionality to the ITP database backend
        https://bugs.webkit.org/show_bug.cgi?id=205844
        <rdar://problem/58360450>

        Reviewed by John Wilander.

        This patch adds functionality for grandfathering statistics upon
        creation of a new ITP database file. The memory store relies on
        the presence of the ITP plist to indicate whether the data should
        be grandfathered. Since the database does not use a plist, this patch
        adds a boolean variable to track whether the database file previously
        existed or not to indicate when to grandfather.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        (WebKit::ResourceLoadStatisticsDatabaseStore::openITPDatabase):
        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
        The boolean variable m_isNewResourceLoadStatisticDatabaseFile is set 
        to true if the database file did not previously exist, indicating ITP
        is being used for the first time and data should be grandfathered.

        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::populateMemoryStoreFromDisk):
        This is where the grandfathering happens. The call to logTestingEvent
        is for API testing purposes only.

        (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
        If a scheduleClearInMemoryAndPersistent is called, the plist is
        deleted, and data will be grandfathered upon recreation. To mimic
        this, the ITP database store is cleared and becomes "new" again, so
        the boolean is set to true.

        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetIsITPDatabaseEnabled):
        (WKPreferencesGetIsITPDatabaseEnabled):
        * UIProcess/API/C/WKPreferencesRef.h:
        * UIProcess/API/Cocoa/WKPreferences.mm:
        (-[WKPreferences _isITPDatabaseEnabled]):
        * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
        In order to properly run the grandfathering
        API tests, the 'isITPDatabaseEnabled' boolean needs to be exposed from
        Web Preferences.

        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        The API tests rely on the ITP database flag being set correctly. Since
        being on-by-default, the ITP database flag does not show up in the
        user defaults menu if enabled. This patch fixes this by first checking 
        to see if the value is in the defaults menu, otherwise returning the 
        default preferences value. This ensures the preferences value matches 
        the actual store being initialized.

2020-01-10  Eric Carlson  <eric.carlson@apple.com>

        [Media in GPU process] Extend the GPU process sandbox to allow access to local files when necessary
        https://bugs.webkit.org/show_bug.cgi?id=205967
        <rdar://problem/58425020>

        Reviewed by youenn fablet.

        No new tests, un-skipped existing tests that pass because of this change.
        
        The GPU process sandbox does not allow access to local files so extend it before 
        attempting to open a file:// url, and revoke the extension when the file is closed.

        * GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp:
        (WebKit::RemoteMediaPlayerManagerProxy::load):
        * GPUProcess/media/RemoteMediaPlayerManagerProxy.h:
        * GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in:
        * GPUProcess/media/RemoteMediaPlayerProxy.cpp:
        (WebKit::RemoteMediaPlayerProxy::invalidate):
        (WebKit::RemoteMediaPlayerProxy::load):
        * GPUProcess/media/RemoteMediaPlayerProxy.h:
        * UIProcess/GPU/GPUProcessProxy.cpp:
        (WebKit::GPUProcessProxy::openGPUProcessConnection):
        * UIProcess/GPU/GPUProcessProxy.h:
        * UIProcess/WebProcessProxy.cpp:
        * UIProcess/WebProcessProxy.h:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/GPU/GPUProcessConnection.h:
        (WebKit::GPUProcessConnection::setAuditToken):
        (WebKit::GPUProcessConnection::auditToken const):
        * WebProcess/GPU/GPUProcessConnectionInfo.h:
        (WebKit::GPUProcessConnectionInfo::encode const):
        (WebKit::GPUProcessConnectionInfo::decode):
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
        (WebKit::MediaPlayerPrivateRemote::prepareForPlayback):
        (WebKit::MediaPlayerPrivateRemote::MediaPlayerPrivateRemote::load):
        (WebKit::MediaPlayerPrivateRemote::cancelLoad):
        (WebKit::MediaPlayerPrivateRemote::prepareToPlay):
        (WebKit::MediaPlayerPrivateRemote::play):
        (WebKit::MediaPlayerPrivateRemote::pause):
        (WebKit::MediaPlayerPrivateRemote::setPreservesPitch):
        (WebKit::MediaPlayerPrivateRemote::setVolumeDouble):
        (WebKit::MediaPlayerPrivateRemote::setMuted):
        (WebKit::MediaPlayerPrivateRemote::setPreload):
        (WebKit::MediaPlayerPrivateRemote::setPrivateBrowsingMode):
        (WebKit::MediaPlayerPrivateRemote::seek):
        (WebKit::MediaPlayerPrivateRemote::seekWithTolerance):
        (WebKit::MediaPlayerPrivateRemote::prepareForRendering):
        (WebKit::MediaPlayerPrivateRemote::setSize):
        (WebKit::MediaPlayerPrivateRemote::setVisible):
        (WebKit::MediaPlayerPrivateRemote::setShouldMaintainAspectRatio):
        (WebKit::MediaPlayerPrivateRemote::setVideoFullscreenFrame):
        (WebKit::MediaPlayerPrivateRemote::setVideoFullscreenGravity):
        (WebKit::MediaPlayerPrivateRemote::acceleratedRenderingStateChanged):
        (WebKit::MediaPlayerPrivateRemote::setShouldDisableSleep):
        (WebKit::MediaPlayerPrivateRemote::requestResource):
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.h:
        * WebProcess/GPU/media/RemoteMediaPlayerMIMETypeCache.cpp:
        (WebKit::RemoteMediaPlayerMIMETypeCache::canDecodeExtendedType):
        (WebKit::RemoteMediaPlayerMIMETypeCache::supportsTypeAndCodecs):
        (WebKit::RemoteMediaPlayerMIMETypeCache::initializeCache):
        * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp:
        (WebKit::RemoteMediaPlayerManager::createRemoteMediaPlayer):
        (WebKit::RemoteMediaPlayerManager::deleteRemoteMediaPlayer):
        (WebKit::RemoteMediaPlayerManager::getSupportedTypes):
        (WebKit::RemoteMediaPlayerManager::originsInMediaCache):
        (WebKit::RemoteMediaPlayerManager::clearMediaCache):
        (WebKit::RemoteMediaPlayerManager::clearMediaCacheForOrigins):
        (WebKit::RemoteMediaPlayerManager::gpuProcessConnection const):
        * WebProcess/GPU/media/RemoteMediaPlayerManager.h:
        (WebKit::RemoteMediaPlayerManager::parentProcess const):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::ensureGPUProcessConnection):

2020-01-10  Jer Noble  <jer.noble@apple.com>

        [iOS] Audio from non-frontmost tab continues when app is backgrounded
        https://bugs.webkit.org/show_bug.cgi?id=206101
        <rdar://problem/58089916>

        Reviewed by Eric Carlson.

        Tests: WKWebViewPausePlayingAudioTests.InWindow
               WKWebViewPausePlayingAudioTests.OutOfWindow

        The ApplicationStateTracker will only send notifications about application state to 
        WebPageProxies when those proxies' views are actually in-window. Add a separate application
        state observer strictly for media which fires only when application state notifications are
        received while the view is not in-window.

        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/WKContentView.mm:
        (-[WKContentView _commonInitializationWithProcessPool:configuration:]):
        (-[WKContentView _applicationDidEnterBackground:]):
        (-[WKContentView _applicationWillEnterForeground:]):
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::applicationDidEnterBackgroundForMedia):
        (WebKit::WebPageProxy::applicationWillEnterForegroundForMedia):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::applicationDidEnterBackgroundForMedia):
        (WebKit::WebPage::applicationWillEnterForegroundForMedia):

2020-01-10  Simon Fraser  <simon.fraser@apple.com>

        Introduce ENABLE_META_VIEWPORT and use it in some WK2 code
        https://bugs.webkit.org/show_bug.cgi?id=206091

        Reviewed by Tim Horton.
        
        Use ENABLE(META_VIEWPORT) rather than PLATFORM(IOS_FAMILY) to enable various
        bits of viewport-related code.

        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<ViewportArguments>::decode):
        (IPC::ArgumentCoder<ViewportAttributes>::encode):
        (IPC::ArgumentCoder<ViewportAttributes>::decode):
        * Shared/WebCoreArgumentCoders.h:
        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:
        * UIProcess/API/C/WKPage.cpp:
        (WKPageSetIgnoresViewportScaleLimits):
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]):
        * UIProcess/WebPageProxy.cpp:
        * UIProcess/WebPageProxy.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::didCommitLoad):
        * WebProcess/WebPage/WebPage.h:
        (WebKit::WebPage::viewportConfiguration const):

2020-01-10  Jonathan Bedard  <jbedard@apple.com>

        Python3: Support Source/WebKit/Scripts/webkit
        https://bugs.webkit.org/show_bug.cgi?id=206078

        Reviewed by Stephanie Lewis.

        Covered by existing unit tests.

        * Scripts/webkit/LegacyMessages-expected.h: Sort forward declarations.
        * Scripts/webkit/Messages-expected.h: Ditto.
        * Scripts/webkit/messages.py: Sort printed outputs.

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

        [iOS] Remove reporting for some well-understood sandbox rules
        https://bugs.webkit.org/show_bug.cgi?id=206111

        Reviewed by Per Arne Vollan.

        Remove sandbox rules designed to generate reporting about resource use for some well-understood
        items that are frequently hit in WebKit use.

        No new tests. No change in behavior.

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

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

        [iOS] Remove used media-related mach services from the WebContent process sandbox
        https://bugs.webkit.org/show_bug.cgi?id=206089
        <rdar://problem/58489478>

        Reviewed by Per Arne Vollan.

        After conducting multiple test passes and large-scale living-on testing with telemetry, we have
        confirmed that the following XPC services are not used by the media logic in WebKit, and can be
        removed:

            com.apple.coremedia.cpeprotector.xpc
            com.apple.coremedia.figcontentkeysession.xpc
            com.apple.coremedia.routingsessionmanager.xpc
            com.apple.coremedia.sts

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

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

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

        [iOS] Remove 'com.apple.awdd' from the WebContent process sandbox
        https://bugs.webkit.org/show_bug.cgi?id=206095
        <rdar://problem/56871147>

        Reviewed by Per Arne Vollan.

        We no longer need access to 'com.apple.awdd' in the iOS WebContent sandbox. We should remove
        it from the sandbox.

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

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

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

        Map CSS value ID to system color in the UI process
        https://bugs.webkit.org/show_bug.cgi?id=204314

        Reviewed by Dean Jackson.

        Create mapping between CSS value IDs and system colors in the UI process and send to the WebContent process
        on process startup.

        * 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-01-10  Mark Lam  <mark.lam@apple.com>

        Gardening: simple build fix after r254119.

        Not reviewed.

        We should be using ASSERT_ENABLED instead of ASSERT_DSIABLED.

        * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
        (WebKit::NetworkDataTaskSoup::sendRequestCallback):

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

        [iOS] Remove 'com.apple.powerlog.plxpclogger.xpc' from the WebContent process sandbox
        https://bugs.webkit.org/show_bug.cgi?id=206086
        <rdar://problem/57195681>

        Reviewed by Per Arne Vollan.

        Telemetry and testing have confirmed that we no longer need a mach connection to the
        'com.apple.powerlog.plxpclogger.xpc' service. We should remove it from the WebContent process sandbox.

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

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

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

        Remove 'com.apple.iohideventsystem' from the WebContent process sandbox
        https://bugs.webkit.org/show_bug.cgi?id=206085
        <rdar://problem/36085204>

        Reviewed by Alex Christensen.

        After r253357 we no longer need access to 'com.apple.iohideventsystem', and should remove it from
        the WebContent process sandbox.

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

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

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

        [iOS] Remove 'com.apple.cookied' from the WebContent process sandbox
        https://bugs.webkit.org/show_bug.cgi?id=206083
        <rdar://problem/56963865>

        Reviewed by Per Arne Vollan.

        Telemetry and testing have confirmed that we no longer use the 'com.apple.cookied' mach connection
        in the WebContent process on iOS. We should remove this from the WebContent process sandbox

        Tested by fast/sandbox/ios/sandbox-mach-lookup.html.

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

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

        Remove com.apple.locationd.registration from the WebContent sandbox
        https://bugs.webkit.org/show_bug.cgi?id=206021
        <rdar://problem/58451384>

        Reviewed by Per Arne Vollan.

        Now that we generate a dynamic extension for 'com.apple.locationd.registration', we should remove
        the blanket allow rule from the sandbox.

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

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

2020-01-10  Simon Fraser  <simon.fraser@apple.com>

        Clean up -[WKWebView _didCommitLayerTree:]
        https://bugs.webkit.org/show_bug.cgi?id=206049

        Reviewed by Tim Horton.

        In preparation for sharing more of this code with macOS, factors parts of -[WKWebView _didCommitLayerTree:]
        into new functions.
        
        Also pull out part of -[WKWebView _updateVisibleContentRects] into its own function.

        * UIProcess/API/ios/WKWebViewIOS.mm:
        (-[WKWebView _trackTransactionCommit:]):
        (-[WKWebView _updateScrollViewForTransaction:]):
        (-[WKWebView _restoreScrollAndZoomStateForTransaction:]):
        (-[WKWebView _didCommitLayerTree:]):
        (-[WKWebView _allowsDoubleTapGestures]):
        (-[WKWebView currentlyVisibleContentInsetsWithScale:obscuredInsets:]):
        (-[WKWebView _updateVisibleContentRects]):
        (areEssentiallyEqualAsFloat): Deleted.

2020-01-10  Simon Fraser  <simon.fraser@apple.com>

        [macOS UI-side compositing] Introduce WKScrollView and WKContentView for macOS
        https://bugs.webkit.org/show_bug.cgi?id=206042

        Reviewed by Tim Horton.

        Add WKScrollViewMac and WKWebViewMac, with bare-bones implementations. WKScrollViewMac
        has a WKScrollViewDelegate to make it more iOS-like, to avoid clients having to register
        boundsDidChange notifications, and WKWebView on macOS becomes the delegate.

        These views are only created when UI-side compositing is enabled.

        * SourcesCocoa.txt:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]):
        * UIProcess/API/Cocoa/WKWebViewInternal.h:
        * UIProcess/API/mac/WKContentViewMac.h: Added.
        * UIProcess/API/mac/WKContentViewMac.mm: Added.
        (-[WKContentView initWithFrame:page:]):
        (-[WKContentView isFlipped]):
        (-[WKContentView _setAcceleratedCompositingRootLayer:]):
        * UIProcess/API/mac/WKScrollViewMac.h: Added.
        * UIProcess/API/mac/WKScrollViewMac.mm: Added.
        (+[WKScrollView isCompatibleWithResponsiveScrolling]):
        (-[WKScrollView initWithFrame:]):
        (-[WKScrollView dealloc]):
        (-[WKScrollView delegate]):
        (-[WKScrollView setDelegate:]):
        (-[WKScrollView contentOffset]):
        (-[WKScrollView boundsDidChange:]):
        (-[WKScrollView setContentInsets:]):
        * UIProcess/API/mac/WKWebViewMac.h:
        * UIProcess/API/mac/WKWebViewMac.mm:
        (-[WKWebView scrollViewDidScroll:]):
        (-[WKWebView scrollViewContentInsetsDidChange:]):
        (-[WKWebView _setupScrollAndContentViews]):
        * UIProcess/ios/WebPageProxyIOS.mm:
        * WebKit.xcodeproj/project.pbxproj:

2020-01-10  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthn] Support authenticatorGetNextAssertion
        https://bugs.webkit.org/show_bug.cgi?id=203346
        <rdar://problem/56558488>

        Reviewed by Brent Fulgham.

        This patch implements authenticatorGetNextAssertion as suggested by the spec:
        https://fidoalliance.org/specs/fido-v2.0-ps-20190130/fido-client-to-authenticator-protocol-v2.0-ps-20190130.html#authenticatorGetNextAssertion

        The work flow is as follow:
        1) When a valid assertion response is received, check its numberOfCredentials member;
        2) When it is larger then 1, use authenticatorGetNextAssertion to get all remaining responses;
        3) Once all responses are gathered, ask UI clients to pick one to return.

        * UIProcess/API/APIWebAuthenticationPanelClient.h:
        (API::WebAuthenticationPanelClient::selectAssertionResponses const):
        * UIProcess/WebAuthentication/Authenticator.h:
        * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
        (WebKit::AuthenticatorManager::selectAssertionResponses):
        * UIProcess/WebAuthentication/AuthenticatorManager.h:
        * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
        (WebKit::MockHidConnection::parseRequest):
        * UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp:
        (WebKit::CtapAuthenticator::continueGetAssertionAfterResponseReceived):
        (WebKit::CtapAuthenticator::continueGetNextAssertionAfterResponseReceived):
        * UIProcess/WebAuthentication/fido/CtapAuthenticator.h:

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

        Remove 'com.apple.nehelper' from the WebContent sandbox.
        https://bugs.webkit.org/show_bug.cgi?id=206025
        <rdar://problem/58453508>

        Reviewed by Per Arne Vollan.

        Now that we generate a dynamic extension for 'com.apple.nehelper' and 'com.apple.nesessionmanager.content-filter',
        we should remove the blanket allow rules from the sandbox.

        Tests: fast/sandbox/ios/sandbox-mach-lookup.html, fast/sandbox/mac/sandbox-mach-lookup.html

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

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

        Silence compiler warning
        https://bugs.webkit.org/show_bug.cgi?id=206070

        Reviewed by Chris Dumez.

        Silence compiler by using the proper formatter for log out.

        No functional changes.

        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::didReceiveMessage):

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

        Expand _WKResourceLoadDelegate callbacks
        https://bugs.webkit.org/show_bug.cgi?id=206037
        <rdar://problem/57132290>

        Reviewed by Youenn Fablet.

        Add 5 informative delegate callbacks at these times during the loading process:
        1. When a request is sent.
        2. When a redirect happens.
        3. When a challenge happens.
        4. When a response is received.
        5. When loading completes or fails.

        As mentioned in r254183 these callbacks are only called when a _WKResourceLoadDelegate is given to a WKWebView.
        We add a new struct ResourceLoadInfo which will need to be expanded containing currently only the load identifier.
        Covered by new API tests which verify the validity of the sent information.

        * NetworkProcess/NetworkLoad.cpp:
        (WebKit::NetworkLoad::didReceiveChallenge):
        * NetworkProcess/NetworkLoadClient.h:
        (WebKit::NetworkLoadClient::didReceiveChallenge):
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::generateResourceLoadID):
        (WebKit::NetworkResourceLoader::startNetworkLoad):
        (WebKit::NetworkResourceLoader::resourceLoadInfo):
        (WebKit::NetworkResourceLoader::didReceiveResponse):
        (WebKit::NetworkResourceLoader::didFinishLoading):
        (WebKit::NetworkResourceLoader::didFailLoading):
        (WebKit::NetworkResourceLoader::didReceiveChallenge):
        Add a way to send a message informing that a challenge happened with information gathered from the NetworkResourceLoader,
        which previously was not informed of challenges because the challenges went directly from the NetworkLoad to the AuthenticationManager.
        (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
        (WebKit::NetworkResourceLoader::continueWillSendRequest):
        (WebKit::m_shouldCaptureExtraNetworkLoadMetrics): Deleted.
        * NetworkProcess/NetworkResourceLoader.h:
        * Shared/API/APIObject.h:
        * Shared/Cocoa/APIObject.mm:
        (API::Object::newObject):
        * Shared/ResourceLoadInfo.h: Added.
        (WebKit::ResourceLoadInfo::encode const):
        (WebKit::ResourceLoadInfo::decode):
        * SourcesCocoa.txt:
        * UIProcess/API/APIResourceLoadClient.h:
        * UIProcess/API/APIResourceLoadInfo.h: Added.
        * UIProcess/API/Cocoa/_WKResourceLoadDelegate.h:
        * UIProcess/API/Cocoa/_WKResourceLoadInfo.h: Added.
        * UIProcess/API/Cocoa/_WKResourceLoadInfo.mm: Added.
        (-[_WKResourceLoadInfo dealloc]):
        (-[_WKResourceLoadInfo resourceLoadID]):
        (-[_WKResourceLoadInfo _apiObject]):
        * UIProcess/API/Cocoa/_WKResourceLoadInfoInternal.h: Added.
        * UIProcess/Authentication/AuthenticationChallengeProxy.cpp:
        (WebKit::AuthenticationChallengeProxy::AuthenticationChallengeProxy):
        An AuthenticationChallengeProxy was only used for challenges that needed credentials, so they wrapped a CompletionHandler.
        This new type of informative-only challenge will be given a null CompletionHandler, which means no action can be taken.
        * UIProcess/Cocoa/ResourceLoadDelegate.h:
        * UIProcess/Cocoa/ResourceLoadDelegate.mm:
        (WebKit::ResourceLoadDelegate::setDelegate):
        (WebKit::ResourceLoadDelegate::ResourceLoadClient::didSendRequest const):
        (WebKit::ResourceLoadDelegate::ResourceLoadClient::didPerformHTTPRedirection const):
        (WebKit::ResourceLoadDelegate::ResourceLoadClient::didReceiveChallenge const):
        (WebKit::ResourceLoadDelegate::ResourceLoadClient::didReceiveResponse const):
        (WebKit::ResourceLoadDelegate::ResourceLoadClient::didCompleteWithError const):
        (WebKit::ResourceLoadDelegate::ResourceLoadClient::willSendRequest const): Deleted.
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::resourceLoadDidSendRequest):
        (WebKit::NetworkProcessProxy::resourceLoadDidPerformHTTPRedirection):
        (WebKit::NetworkProcessProxy::resourceLoadDidReceiveChallenge):
        (WebKit::NetworkProcessProxy::resourceLoadDidReceiveResponse):
        (WebKit::NetworkProcessProxy::resourceLoadDidCompleteWithError):
        (WebKit::NetworkProcessProxy::pageWillSendRequest): Deleted.
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/Network/NetworkProcessProxy.messages.in:
        * UIProcess/WebPageProxy.cpp:
        * UIProcess/WebPageProxy.h:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::loadResourceSynchronously):
        (WebKit::WebLoaderStrategy::startPingLoad):
        * WebProcess/Network/WebResourceLoader.cpp:
        (WebKit::WebResourceLoader::willSendRequest):

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

        Add SPI to enable TLS 1.0 and 1.1 in WKWebViews
        https://bugs.webkit.org/show_bug.cgi?id=206046

        Reviewed by Youenn Fablet.

        This is needed for <rdar://problem/58464912>
        Covered by API tests.

        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
        (-[_WKWebsiteDataStoreConfiguration legacyTLSEnabled]):
        (-[_WKWebsiteDataStoreConfiguration setLegacyTLSEnabled:]):
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::parameters):
        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
        (WebKit::WebsiteDataStoreConfiguration::copy const):
        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
        (WebKit::WebsiteDataStoreConfiguration::legacyTLSEnabled const):
        (WebKit::WebsiteDataStoreConfiguration::setLegacyTLSEnabled):

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

        [macOS] Issue sandbox extension to "com.apple.nesessionmanager" prior to 10.15 
        https://bugs.webkit.org/show_bug.cgi?id=206031
        <rdar://problem/58455467>

        Reviewed by Per Arne Vollan.

        The mach name of 'com.apple.nesessionmanager' changed between macOS 10.14 and 10.15.
        We should continue to issue the old name when building for older operating systems."

        Covered by existing tests.

        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):

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

        Remove WebsiteDataStore::setCacheStorageDirectory which has been replaced by WebsiteDataStoreConfiguration::setCacheStorageDirectory
        https://bugs.webkit.org/show_bug.cgi?id=205841

        Reviewed by Youenn Fablet.

        * UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.cpp:
        (WKWebsiteDataStoreConfigurationCopyCacheStorageDirectory):
        (WKWebsiteDataStoreConfigurationSetCacheStorageDirectory):
        * UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.h:
        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _cacheStorageDirectory]): Deleted.
        (-[WKWebsiteDataStore _setCacheStorageDirectory:]): Deleted.
        * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::retrieveCacheStorageParameters):
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        (WebKit::WebsiteDataStore::cacheStorageDirectory const):
        (WebKit::WebsiteDataStore::setCacheStorageDirectory): Deleted.

2020-01-10  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Update OptionsGTK.cmake and NEWS for 2.27.4 release

        * gtk/NEWS: Add release notes for 2.27.4.

2020-01-10  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Fix GTK and WPE API docs generation

        Fix the name of the new class. WebKitInputMethodFilter -> WebKitInputMethodContext.

        * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
        * UIProcess/API/wpe/docs/wpe-docs.sgml:

2020-01-10  Carlos Garcia Campos  <cgarcia@igalia.com>

        Automation: resolveChildFrameWithNodeHandle should return NodeNotFound when node doesn't exist
        https://bugs.webkit.org/show_bug.cgi?id=205993

        Reviewed by Brian Burg.

        According to the spec:

        "If element is stale, return error with error code stale element reference."
        https://w3c.github.io/webdriver/#switch-to-frame

        Fixes: imported/w3c/webdriver/tests/switch_to_frame/switch.py::test_frame_id_webelement_stale_reference

        * WebProcess/Automation/WebAutomationSessionProxy.cpp:
        (WebKit::WebAutomationSessionProxy::resolveChildFrameWithNodeHandle):

2020-01-10  Carlos Garcia Campos  <cgarcia@igalia.com>

        Automation: evaluateJavaScriptFunction should use Promises
        https://bugs.webkit.org/show_bug.cgi?id=204151

        Reviewed by Brian Burg.

        Make the function to run scripts async and handle the result as a promise. To implement the script timeout we
        use another promise that starts the timer and then we run a Promise.race() with both promises. To simplify the
        results reporting, all exceptions (including timeout errors that are now handled as exceptions) are now handled
        as errors passed to the resultCallback. The boolean parameter has been removed, we can simply check the type of
        the value received because results are always strings and errors are always exception objects.

        * WebProcess/Automation/WebAutomationSessionProxy.cpp:
        (WebKit::evaluateJavaScriptCallback): Handle the script result, including all possible errors now (not only timeouts).
        (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction): Any exception running the script should be an
        internal error now. The code to handle error has been moved to evaluateJavaScriptCallback().
        * WebProcess/Automation/WebAutomationSessionProxy.js:
        (WebKitAutomation.AutomationSessionProxy.prototype.evaluateJavaScriptFunction): Call _execute and handle the
        promise result to call resultCallback wityh either the result or the error.
        (WebKitAutomation.AutomationSessionProxy.prototype._execute): Make the function to run the script async and
        handle the result as a promise.

2020-01-10  Carlos Garcia Campos  <cgarcia@igalia.com>

        Automation: scripts are executed in the wrong js context after a history navigation
        https://bugs.webkit.org/show_bug.cgi?id=204880
        <rdar://problem/58413615>

        Reviewed by Brian Burg.

        After a history navigation we use the script object from the previous frame js context because
        didClearWindowObjectForFrame() is not called in that case. We are caching the script object for every frame ID,
        and after a history navigation the frame ID is the same, but the frame js context isn't. That also means we might
        be leaking the script objects in those cases, because we end up calling JSValueUnprotect with the wrong
        context. It would be easier to set the script object as a property of the global object and let JSC handle the
        lifetime. Instead of caching the script object and protect/unprotect it, we just check if the global object of
        the current js context has the property or not to get or create it. We use a private symbol as the key of the
        global object property to ensure it's not visible.

        * WebProcess/Automation/WebAutomationSessionProxy.cpp:
        (WebKit::WebAutomationSessionProxy::WebAutomationSessionProxy): Initialize m_scriptObjectIdentifier.
        (WebKit::WebAutomationSessionProxy::scriptObject): Helper function to get the script object for the given
        JavaScript context.
        (WebKit::WebAutomationSessionProxy::setScriptObject): Helper function to set the script object for the given
        JavaScript context.
        (WebKit::WebAutomationSessionProxy::scriptObjectForFrame): Get or create the script object.
        (WebKit::WebAutomationSessionProxy::elementForNodeHandle): Get the script object from global object.
        (WebKit::WebAutomationSessionProxy::didClearWindowObjectForFrame): Remove the code to unprotect script objects
        of the frame.
        * WebProcess/Automation/WebAutomationSessionProxy.h: Add m_scriptObjectIdentifier and remove m_webFrameScriptObjectMap.

2020-01-09  Ross Kirsling  <ross.kirsling@sony.com>

        REGRESSION(r253868): Socket-based remote inspector cannot inspect any target
        https://bugs.webkit.org/show_bug.cgi?id=206045

        Reviewed by Don Olmstead.

        Revert part of patch, ensuring Target struct stays consistent with socket inspector's messaging protocol.

        * UIProcess/socket/RemoteInspectorClient.cpp:
        (WebKit::RemoteInspectorClient::setTargetList):
        (WebKit::debuggableTypeToString): Deleted.
        * UIProcess/socket/RemoteInspectorClient.h:
        * UIProcess/socket/RemoteInspectorProtocolHandler.cpp:
        (WebKit::RemoteInspectorProtocolHandler::targetListChanged):
        (WebKit::debuggableTypeToString): Deleted.

2020-01-09  Tim Horton  <timothy_horton@apple.com>

        Adopt TARGET_OS_MACCATALYST in more places
        https://bugs.webkit.org/show_bug.cgi?id=206040
        <rdar://problem/57127108>

        Reviewed by Simon Fraser.

        * Shared/API/Cocoa/WebKit.h:

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

        Clean up -[WKWebView _initializeWithConfiguration:]
        https://bugs.webkit.org/show_bug.cgi?id=206039

        Reviewed by Tim Horton.

        -[WKWebView _initializeWithConfiguration:] is full of platform #ifdefs so needs
        cleaning up before adding more code. Factor out WKScrollView and view hookup,
        pageConfiguration setup, and notification registration.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]):
        (-[WKWebView _setupPageConfiguration:]):
        * UIProcess/API/ios/WKWebViewIOS.h:
        * UIProcess/API/ios/WKWebViewIOS.mm:
        (-[WKWebView _setupScrollAndContentViews]):
        (-[WKWebView _registerForNotifications]):

2020-01-09  John Wilander  <wilander@apple.com>

        Check the existence of the optional m_sessionID before using it in WebProcess::setResourceLoadStatisticsEnabled()
        https://bugs.webkit.org/show_bug.cgi?id=206035
        <rdar://problem/58455306>

        Reviewed by Brent Fulgham.

        No new tests.

        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::setResourceLoadStatisticsEnabled):
            Added a check that m_sessionID exists.

2020-01-09  Tim Horton  <timothy_horton@apple.com>

        Install WebKit framework symlink for more iOS-derived platforms
        https://bugs.webkit.org/show_bug.cgi?id=206030

        Reviewed by Andy Estes.

        * WebKit.xcodeproj/project.pbxproj:

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

        Remove AGXCompilerService access from the WebContent sandbox
        https://bugs.webkit.org/show_bug.cgi?id=206020
        <rdar://problem/58451395>

        Reviewed by Per Arne Vollan.

        Now that we generate a dynamic extension for 'com.apple.AGXCompilerService', we should remove the
        blanket allow rule from the sandbox.

        Covered by existing tests.

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

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

        Use HAVE(TOUCH_BAR) instead of PLATFORM(COCOA) in more places
        https://bugs.webkit.org/show_bug.cgi?id=205975

        Reviewed by Wenson Hsieh.

        Protect Touch Bar-related code with HAVE(TOUCH_BAR) instead of PLATFORM(COCOA).

        * Shared/TouchBarMenuData.cpp:
        * Shared/TouchBarMenuData.h:
        * Shared/TouchBarMenuItemData.cpp:
        * Shared/TouchBarMenuItemData.h:
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::forceRequestCandidatesForTesting):
        (WebKit::WebViewImpl::setEditableElementIsFocused):
        * UIProcess/WebPageProxy.cpp:
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::didStartPageTransition):
        (WebKit::WebPage::didChangeSelectionOrOverflowScrollPosition):
        (WebKit::WebPage::didInsertMenuElement):
        (WebKit::WebPage::didRemoveMenuElement):
        (WebKit::WebPage::didInsertMenuItemElement):
        (WebKit::WebPage::didRemoveMenuItemElement):
        * WebProcess/WebPage/WebPage.h:

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

        Add ENABLE_UI_SIDE_COMPOSITING and use it in a few places
        https://bugs.webkit.org/show_bug.cgi?id=205982

        Reviewed by Jon Lee.

        All Remote* things should get wrapped in ENABLE(UI_SIDE_COMPOSITING)
        if other platforms build the files, so do some of that. VisibleContentRect*
        and ViewUpdateDispatcher* stuff is also UI-side compositing only.

        * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
        * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.h:
        (WebKit::RemoteScrollingCoordinatorTransaction::scrollingStateTree):
        * Shared/VisibleContentRectUpdateInfo.cpp:
        * Shared/VisibleContentRectUpdateInfo.h:
        * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
        * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
        * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
        (WebKit::RemoteScrollingTree::handleMouseEvent):
        * UIProcess/RemoteLayerTree/RemoteScrollingTree.h:
        * UIProcess/WebPageProxy.h:
        * WebProcess/WebPage/ViewUpdateDispatcher.cpp:
        * WebProcess/WebPage/ViewUpdateDispatcher.h:
        * WebProcess/WebPage/WebPage.h:

2020-01-09  Tim Horton  <timothy_horton@apple.com>

        Fix a tiny logging mistake in launchProcess
        https://bugs.webkit.org/show_bug.cgi?id=206026

        Reviewed by Wenson Hsieh.

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

2020-01-09  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Add timing information to WebPageProxy::logFrameNavigation() to detect delayed client-side redirects
        https://bugs.webkit.org/show_bug.cgi?id=205522
        <rdar://problem/58125759>

        Reviewed by Chris Dumez.

        The purpose of this patch is to capture navigations that happen programmatically
        after the document has loaded. These are delayed redirects and should be counted
        as redirects in ITP.

        To achieve this, a timestamp is captured in
        WebPageProxy::didFinishDocumentLoadForFrame() to be able to calculate how much time
        has passed since that timestamp in the IPC sent from
        WebPageProxy::logFrameNavigation(). The IPC also gets information on whether
        userInitiatedActivity exists so that ITP can decide whether to treat the navigation
        as triggered by the user or not.

        A new test was added and existing test expectations were updated.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        (WebKit::ResourceLoadStatisticsDatabaseStore::logFrameNavigation):
            Now takes the extra parameters delayAfterMainFrameDocumentLoad
            and wasPotentiallyInitiatedByUser.
        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
        (WebKit::ResourceLoadStatisticsMemoryStore::logFrameNavigation):
            Now takes the extra parameters delayAfterMainFrameDocumentLoad
            and wasPotentiallyInitiatedByUser.
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::logFrameNavigation):
            Now takes the extra parameters delayAfterMainFrameDocumentLoad
            and wasPotentiallyInitiatedByUser.
            The deleted WebResourceLoadStatisticsStore::logFrameNavigation() was dead code.
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::logFrameNavigation):
            Now takes the extra parameters delayAfterMainFrameDocumentLoad
            and wasPotentiallyInitiatedByUser.
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldSubmitTelemetry:]): Deleted.
            Dead code.
        * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
            Now captures a timestamp.
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
            Removed dead code.
        (WebKit::WebPageProxy::logFrameNavigation):
            Now sends the diff between now and the timestamp captured in
            WebPageProxy::didFinishDocumentLoadForFrame().
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::platformInitialize):
            Removed dead code.
        (WebKit::WebsiteDataStore::platformDestroy):
            Removed dead code.
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        (WebKit::WebsiteDataStore::resourceLoadStatistics const): Deleted.
            Dead code.

2020-01-09  Andres Gonzalez  <andresg_22@apple.com>

        WKAccessibilityWebPageObject should use Accessibility::retrieveValueFromMainThread.
        https://bugs.webkit.org/show_bug.cgi?id=206009

        Reviewed by Chris Fleizach.

        - WKAccessibilityWebPageObject now uses Accessibility::retrieveValueFromMainThread,
        which is consistent with WebAccessibilityObjectWrapper.
        - It also uses a captured protectedSelf to ensure the object is alive
        when the lambda is invoked on the main thread.
        - Added nullity check for m_page in accessibilityAttributeSizeValue,
        which is a potential crasher in the multithreaded mode.

        * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
        (-[WKAccessibilityWebPageObject ALLOW_DEPRECATED_IMPLEMENTATIONS_END]):
        (-[WKAccessibilityWebPageObject convertScreenPointToRootView:]):
        (-[WKAccessibilityWebPageObject accessibilityAttributeSizeValue]):
        (-[WKAccessibilityWebPageObject accessibilityAttributePositionValue]):
        (-[WKAccessibilityWebPageObject accessibilityDataDetectorValue:point:]):
        (-[WKAccessibilityWebPageObject accessibilityHitTest:]):
        (retrieveAccessibilityValueFromMainThread): Not needed since it uses now the one in Accessibility nasespace.

2020-01-09  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Flip experimental website data removal setting from an enable to a disable
        https://bugs.webkit.org/show_bug.cgi?id=205966
        <rdar://problem/58425000>

        Reviewed by Brent Fulgham.

        To get default on behavior, experimental features in the network process need to be
        turned from enable flags to disable flags. This patch does that for the experimental
        website data removal flag.

        This change also aligns the init values of the setting to match the default.

        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
        * NetworkProcess/NetworkSession.h:
        * NetworkProcess/NetworkSessionCreationParameters.h:
        * Shared/WebPreferences.yaml:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::parameters):

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

        Set the title for images so it will be correctly displayed in UIContextMenus
        https://bugs.webkit.org/show_bug.cgi?id=205980
        <rdar://problem/57701988>

        Reviewed by Dean Jackson.

        Need to set the title text for images.

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

2020-01-09  Peng Liu  <peng.liu6@apple.com>

        Fullscreen videos do not enter PiP in first tap
        https://bugs.webkit.org/show_bug.cgi?id=205986

        Reviewed by Eric Carlson.

        This patch essentially reverts the fix for webkit.org/b/204461.
        The fix for webkit.org/b/204461 depends on a fix in AVKit along
        with a corresponding update in WebKit (webkit.org/b/204979).
        We will need to reapply the fix for webkit.org/b/204461 after they are landed.

        * WebProcess/cocoa/VideoFullscreenManager.mm:
        (WebKit::VideoFullscreenManager::enterVideoFullscreenForVideoElement):
        (WebKit::VideoFullscreenManager::exitVideoFullscreenForVideoElement):

2020-01-09  Kate Cheney  <katherine_cheney@apple.com>

        ITP API classes need WK_CLASS_AVAILABLE tags
        https://bugs.webkit.org/show_bug.cgi?id=205969
        <rdar://problem/58427147>

        Reviewed by Dean Jackson.

        * UIProcess/API/Cocoa/_WKResourceLoadStatisticsFirstParty.h:
        * UIProcess/API/Cocoa/_WKResourceLoadStatisticsThirdParty.h:
        * WebKit.xcodeproj/project.pbxproj:
        This updates the header file targets from Project to Private.

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

        REGRESSION: [ Mac wk2 ] fast/mediastream/captureInGPUProcess.html is a flaky failure
        https://bugs.webkit.org/show_bug.cgi?id=205873
        <rdar://problem/58380638>

        Reviewed by Eric Carlson.

        GPUProcess and UIProcess were sometimes getting out of sync with regards to using mock devices or real capture devices.
        This ended up in GPUProcess trying to find mock devices based on real device IDs.
        Fix this issue by storing this bool value in GPUProcessProxy and send IPC to GPUProcess whenver this value is changed.
        Update GPUProcessProxy value whenever UserMediaPermissionRequestManagerProxy is asked to sync this value.

        * UIProcess/GPU/GPUProcessProxy.cpp:
        (WebKit::GPUProcessProxy::singleton):
        (WebKit::GPUProcessProxy::GPUProcessProxy):
        (WebKit::GPUProcessProxy::setUseMockCaptureDevices):
        * UIProcess/GPU/GPUProcessProxy.h:
        * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
        (WebKit::UserMediaPermissionRequestManagerProxy::syncWithWebCorePrefs const):

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

        WebKitTestRunner leaks objects in a top-level autoreleasePool that's never cleared
        <https://webkit.org/b/205950>
        <rdar://problem/50987831>

        Reviewed by Joseph Pecoraro.

        * UIProcess/mac/WebPreferencesMac.mm:
        (WebKit::WebPreferences::platformInitializeStore):
        - Add an @autoreleasepool block around the contents of
          this method since it generates numerous autoreleased
          objects when run.

2020-01-08  Yusuke Suzuki  <ysuzuki@apple.com>

        Reduce binary size by purging C++ type information in Objective-C fields and parameters
        https://bugs.webkit.org/show_bug.cgi?id=205905

        Reviewed by Saam Barati.

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (-[WKNetworkSessionDelegate initWithNetworkSession:wrapper:withCredentials:]):
        * Shared/API/Cocoa/WKBrowsingContextHandle.mm:
        (-[WKBrowsingContextHandle _initWithPageProxy:]):
        (-[WKBrowsingContextHandle _initWithPage:]):
        * Shared/API/Cocoa/WKBrowsingContextHandleInternal.h:
        * Shared/API/Cocoa/_WKRemoteObjectRegistry.mm:
        (-[_WKRemoteObjectRegistry _initWithWebPage:]):
        (-[_WKRemoteObjectRegistry _initWithWebPageProxy:]):
        * Shared/API/Cocoa/_WKRemoteObjectRegistryInternal.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _page]):
        * UIProcess/API/Cocoa/WKWebViewInternal.h:
        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _getAllStorageAccessEntriesFor:completionHandler:]):
        * UIProcess/API/Cocoa/_WKThumbnailView.mm:
        * UIProcess/API/mac/WKView.mm:
        (-[WKView initWithFrame:processPool:configuration:]):
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::WebViewImpl):
        (WebKit::WebViewImpl::setLayoutMode):
        (WebKit::WebViewImpl::fullScreenWindowController):
        (WebKit::WebViewImpl::remoteObjectRegistry):
        * UIProcess/ios/WKApplicationStateTrackingView.mm:
        (-[WKApplicationStateTrackingView willMoveToWindow:]):
        (-[WKApplicationStateTrackingView didMoveToWindow]):
        * UIProcess/ios/WKContentView.h:
        * UIProcess/ios/WKContentView.mm:
        (-[WKContentView initWithFrame:processPool:configuration:webView:]):
        * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
        (-[WKFullScreenViewController videoControlsManagerDidChange]):
        (-[WKFullScreenViewController _manager]):
        (-[WKFullScreenViewController _togglePiPAction:]):
        (-[WKFullScreenViewController _showPhishingAlert]):
        * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
        (WebKit::WKWebViewState::applyTo):
        (WebKit::WKWebViewState::store):
        (-[WKFullScreenWindowController enterFullScreen]):
        (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
        (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
        (-[WKFullScreenWindowController _completedExitFullScreen]):
        (-[WKFullScreenWindowController _exitFullscreenImmediately]):
        (-[WKFullScreenWindowController _manager]):
        * UIProcess/mac/WKFullScreenWindowController.h:
        * UIProcess/mac/WKFullScreenWindowController.mm:
        (-[WKFullScreenWindowController initWithWindow:webView:page:]):
        * UIProcess/mac/WKImmediateActionController.h:
        * UIProcess/mac/WKImmediateActionController.mm:
        (-[WKImmediateActionController initWithPage:view:viewImpl:recognizer:]):
        (-[WKImmediateActionController _animationControllerForDataDetectedText]):
        (-[WKImmediateActionController _animationControllerForDataDetectedLink]):
        * UIProcess/mac/WKInspectorViewController.h:
        * UIProcess/mac/WKInspectorViewController.mm:
        (-[WKInspectorViewController initWithInspectedPage:]):
        * UIProcess/mac/WKTextFinderClient.h:
        * UIProcess/mac/WKTextFinderClient.mm:
        (-[WKTextFinderClient initWithPage:view:usePlatformFindUI:]):
        * UIProcess/mac/WKViewLayoutStrategy.h:
        * UIProcess/mac/WKViewLayoutStrategy.mm:
        (+[WKViewLayoutStrategy layoutStrategyWithPage:view:viewImpl:mode:]):
        (-[WKViewLayoutStrategy initWithPage:view:viewImpl:mode:]):
        (-[WKViewViewSizeLayoutStrategy initWithPage:view:viewImpl:mode:]):
        (-[WKViewFixedSizeLayoutStrategy initWithPage:view:viewImpl:mode:]):
        (-[WKViewDynamicSizeComputedFromViewScaleLayoutStrategy initWithPage:view:viewImpl:mode:]):
        (-[WKViewDynamicSizeComputedFromMinimumDocumentSizeLayoutStrategy initWithPage:view:viewImpl:mode:]):
        * WebProcess/InjectedBundle/API/mac/WKDOMDocument.mm:
        (-[WKDOMDocumentParserYieldToken initWithDocument:]):
        * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.h:
        * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
        (-[WKAccessibilityWebPageObjectBase axObjectCache]):
        (-[WKAccessibilityWebPageObjectBase setWebPage:]):

2020-01-08  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Flip experimental cookie blocking setting from an enable to a disable
        https://bugs.webkit.org/show_bug.cgi?id=205963
        <rdar://problem/58424136>

        Reviewed by Brent Fulgham.

        To get default on behavior, experimental features in the network process need to be
        turned from enable flags to disable flags. This patch does that for the experimental
        cookie blocking flag.

        This change also aligns the init values of the setting to match the default.

        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
        * NetworkProcess/NetworkSession.h:
        * NetworkProcess/NetworkSessionCreationParameters.h:
        * Shared/WebPreferences.yaml:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::parameters):

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

        Allow some sysctl-read calls needed by WebRTC
        https://bugs.webkit.org/show_bug.cgi?id=205946
        <rdar://problem/58416475>

        Reviewed by Per Arne Vollan.

        This patch allows some sysctl-read calls that are needed when running WebRTC tests.
        It also removes telemetry and logging from a UIKit class that was confirmed to be
        needed by Performance and PowerLogging code.

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

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

        Unreviewed, fix some IOS_FAMILY builds after r254210.

        * Shared/AuxiliaryProcess.h:

2020-01-08  Dean Jackson  <dino@apple.com>

        [WebGL] More GraphicsContext3D to GraphicsContextGL renaming
        https://bugs.webkit.org/show_bug.cgi?id=205949
        <rdar://problem/58416989>

        Reviewed by Antoine Quint.

        * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
        (WebKit::MediaPlayerPrivateRemote::copyVideoTextureToPlatformTexture):
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.h:

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

        Remove NATIVE_MOUSE_EVENT_HANDLER macros
        https://bugs.webkit.org/show_bug.cgi?id=205897

        Reviewed by Tim Horton.

        Remove the NATIVE_MOUSE_EVENT_HANDLER and NATIVE_MOUSE_EVENT_HANDLER_INTERNAL which are almost identical,
        calling a couple of shared functions instead. The only reason the eventName was used was for logging, so just
        log the -[NSEvent type] instead.

        * UIProcess/Cocoa/WebViewImpl.h:
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::operator<<):
        (WebKit::WebViewImpl::nativeMouseEventHandler):
        (WebKit::WebViewImpl::nativeMouseEventHandlerInternal):
        (WebKit::WebViewImpl::mouseEntered):
        (WebKit::WebViewImpl::mouseExited):
        (WebKit::WebViewImpl::otherMouseDown):
        (WebKit::WebViewImpl::otherMouseDragged):
        (WebKit::WebViewImpl::otherMouseUp):
        (WebKit::WebViewImpl::rightMouseDown):
        (WebKit::WebViewImpl::rightMouseDragged):
        (WebKit::WebViewImpl::rightMouseUp):
        (WebKit::WebViewImpl::mouseMovedInternal):
        (WebKit::WebViewImpl::mouseDownInternal):
        (WebKit::WebViewImpl::mouseUpInternal):
        (WebKit::WebViewImpl::mouseDraggedInternal):

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

        Remove an unused variable in WebCoreArgumentCodersCocoa.mm after r254202
        https://bugs.webkit.org/show_bug.cgi?id=205939

        Reviewed by Tim Horton.

        Remove an unused temporary variable that was only used for debugging.

        * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
        (IPC::ArgumentCoder<FontHandle>::decodePlatformData):

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

        Move UIProcess DependencyProcessAssertion from WebContent to AuxiliaryProcess
        https://bugs.webkit.org/show_bug.cgi?id=205836

        Reviewed by Alex Christensen.

        Move UIProcess DependencyProcessAssertion from WebContent to AuxiliaryProcess, so that other auxiliary
        processes (Network Process, GPU Process) also benefit from it.

        * Shared/AuxiliaryProcess.cpp:
        (WebKit::AuxiliaryProcess::initializeConnection):
        * Shared/AuxiliaryProcess.h:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::initializeConnection):
        * WebProcess/WebProcess.h:

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

        Network process sandboxes should not include 'common.sb' or 'system.sb'
        https://bugs.webkit.org/show_bug.cgi?id=205521
        <rdar://problem/58095870>

        Reviewed by Per Arne Vollan.

        This patch replaces the 'include' with a copy/paste of the contents of the relevant
        sandbox include file. I removed definitions that were not referenced in the existing
        Network sandbox, but did not otherwise edit the contents. There are duplicates and
        redundancies after this patch, which I will remove as a follow-up step once we confirm
        that this has no regressions.

        I also updated the sandbox to generate telemetry for some mach connections that we think
        are unneeded, or that should be targeted for removal.

        No new tests. There should be no change in behavior.

        * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
        * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:

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

        IPC::Connection::sendMessage() should use CRASH_WITH_INFO()
        <https://webkit.org/b/205419>
        <rdar://problem/58058661>

        Reviewed by Mark Lam.

        * Platform/IPC/cocoa/ConnectionCocoa.mm:
        (IPC::Connection::sendMessage):
        - Switch from CRASH() to CRASH_WITH_INFO().

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

        Unreviewed, rolling out r254174.

        Broke 80 tests on Catalina

        Reverted changeset:

        "Network process sandboxes should not include 'common.sb' or
        'system.sb'"
        https://bugs.webkit.org/show_bug.cgi?id=205521
        https://trac.webkit.org/changeset/254174

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

        Add support for encoding WebCore::Font over IPC for DisplayList::DrawGlyphs
        https://bugs.webkit.org/show_bug.cgi?id=205830
        <rdar://problem/57347719>

        Reviewed by Dean Jackson.

        Add basic support for encoding and decoding a FontHandle.

        * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
        (IPC::ArgumentCoder<FontHandle>::encodePlatformData):
        (IPC::ArgumentCoder<FontHandle>::decodePlatformData):
        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<FontHandle>::encode):
        (IPC::ArgumentCoder<FontHandle>::decode):

        When encoding a Font on Cocoa platforms, send across the font face data (if present); otherwise, fall back to
        sending the font descriptor for the UIFont or NSFont (as is the case for installed fonts).

        * Shared/WebCoreArgumentCoders.h:
        * Shared/curl/WebCoreArgumentCodersCurl.cpp:
        (IPC::ArgumentCoder<FontHandle>::encodePlatformData):
        (IPC::ArgumentCoder<FontHandle>::decodePlatformData):
        * Shared/soup/WebCoreArgumentCodersSoup.cpp:
        (IPC::ArgumentCoder<FontHandle>::encodePlatformData):
        (IPC::ArgumentCoder<FontHandle>::decodePlatformData):

2020-01-08  Milan Crha  <mcrha@redhat.com>

        [GTK] Editing: Allow line breaks in lists
        https://bugs.webkit.org/show_bug.cgi?id=205913

        Reviewed by Carlos Garcia Campos.

        * UIProcess/gtk/KeyBindingTranslator.cpp:
        Treat Shift+Enter as "InsertLineBreak", instead of "InsertNewLine".

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

        Implement MediaRecorder backend in GPUProcess
        https://bugs.webkit.org/show_bug.cgi?id=205802

        Reviewed by Eric Carlson.

        Add support for sending audio/video tracks to record from WebProcess to GPUProcess.
        Add a MediaRecorderPrivate implementation that supports sending one audio track and/or one video track to GPUProcess
        and stopping/fetching data from the remote recorder in GPUProcess.

        In GPUProcess, implement the remote recorder using the existing WebCore recorder writer.

        * CMakeLists.txt:
        * DerivedSources-input.xcfilelist:
        * DerivedSources-output.xcfilelist:
        * DerivedSources.make:
        * GPUProcess/GPUConnectionToWebProcess.cpp:
        (WebKit::GPUConnectionToWebProcess::userMediaCaptureManagerProxy):
        (WebKit::GPUConnectionToWebProcess::mediaRecorderManager):
        (WebKit::GPUConnectionToWebProcess::didReceiveMessage):
        * GPUProcess/GPUConnectionToWebProcess.h:
        * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in:
        * GPUProcess/webrtc/RemoteMediaRecorder.cpp: Added.
        (WebKit::RemoteMediaRecorder::create):
        (WebKit::RemoteMediaRecorder::RemoteMediaRecorder):
        (WebKit::RemoteMediaRecorder::~RemoteMediaRecorder):
        (WebKit::RemoteMediaRecorder::storage):
        (WebKit::RemoteMediaRecorder::audioSamplesStorageChanged):
        (WebKit::RemoteMediaRecorder::audioSamplesAvailable):
        (WebKit::RemoteMediaRecorder::videoSampleAvailable):
        (WebKit::RemoteMediaRecorder::fetchData):
        (WebKit::RemoteMediaRecorder::stopRecording):
        * GPUProcess/webrtc/RemoteMediaRecorder.h: Added.
        * GPUProcess/webrtc/RemoteMediaRecorder.messages.in: Added.
        * GPUProcess/webrtc/RemoteMediaRecorderManager.cpp: Added.
        (WebKit::RemoteMediaRecorderManager::RemoteMediaRecorderManager):
        (WebKit::RemoteMediaRecorderManager::~RemoteMediaRecorderManager):
        (WebKit::RemoteMediaRecorderManager::didReceiveRemoteMediaRecorderMessage):
        (WebKit::RemoteMediaRecorderManager::createRecorder):
        (WebKit::RemoteMediaRecorderManager::releaseRecorder):
        * GPUProcess/webrtc/RemoteMediaRecorderManager.h: Added.
        (WebKit::RemoteMediaRecorderManager::didReceiveMessageFromWebProcess):
        * GPUProcess/webrtc/RemoteMediaRecorderManager.messages.in: Added.
        * Scripts/webkit/messages.py:
        * Sources.txt:
        * SourcesCocoa.txt:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/GPU/media/MediaRecorderProvider.cpp: Added.
        (WebCore::MediaRecorderProvider::createMediaRecorderPrivate):
        * WebProcess/GPU/media/MediaRecorderProvider.h: Added.
        * WebProcess/GPU/webrtc/MediaRecorderIdentifier.h: Added.
        * WebProcess/GPU/webrtc/MediaRecorderPrivate.cpp: Added.
        (WebKit::MediaRecorderPrivate::MediaRecorderPrivate):
        (WebKit::MediaRecorderPrivate::~MediaRecorderPrivate):
        (WebKit::MediaRecorderPrivate::sampleBufferUpdated):
        (WebKit::MediaRecorderPrivate::audioSamplesAvailable):
        (WebKit::MediaRecorderPrivate::storageChanged):
        (WebKit::MediaRecorderPrivate::fetchData):
        (WebKit::MediaRecorderPrivate::stopRecording):
        * WebProcess/GPU/webrtc/MediaRecorderPrivate.h: Added.
        * WebProcess/GPU/webrtc/MediaRecorderProvider.cpp: Added.
        (WebKit::MediaRecorderProvider::createMediaRecorderPrivate):
        * WebProcess/GPU/webrtc/MediaRecorderProvider.h: Added.
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_overriddenMediaType):

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

        Improve logging of creating a service worker
        https://bugs.webkit.org/show_bug.cgi?id=205849

        Reviewed by Chris Dumez.

        Add some release logging to identify which service worker is created in which process.
        No change of observable behavior.

        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        (WebKit::WebSWContextManagerConnection::installServiceWorker):

2020-01-07  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Implement css3-images image-orientation
        https://bugs.webkit.org/show_bug.cgi?id=89052

        Reviewed by Simon Fraser.

        Remove the ENABLE_CSS_IMAGE_ORIENTATION feature flag.

        * Configurations/FeatureDefines.xcconfig:

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

        Introduce _WKResourceLoadDelegate
        https://bugs.webkit.org/show_bug.cgi?id=205887

        Reviewed by Dean Jackson.

        Add a new delegate that will be informed about main and subresource requests.
        This is distinct from the WKNavigationDelegate, which primarily receives callbacks about main resource requests.
        Because the IPC churn can be a significant performance reduction, only send the IPC messages if the page has such a client.
        This client will need to be expanded to implement <rdar://problem/57132290> but this is a minimal testable start.
        The simple case is covered by an API test.

        * NetworkProcess/NetworkResourceLoadParameters.cpp:
        (WebKit::NetworkResourceLoadParameters::encode const):
        (WebKit::NetworkResourceLoadParameters::decode):
        * NetworkProcess/NetworkResourceLoadParameters.h:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::startNetworkLoad):
        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:
        * SourcesCocoa.txt:
        * UIProcess/API/APIResourceLoadClient.h: Added.
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]):
        (-[WKWebView _resourceLoadDelegate]):
        (-[WKWebView _setResourceLoadDelegate:]):
        * UIProcess/API/Cocoa/WKWebViewInternal.h:
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/API/Cocoa/_WKResourceLoadDelegate.h: Added.
        * UIProcess/Cocoa/ResourceLoadDelegate.h: Added.
        * UIProcess/Cocoa/ResourceLoadDelegate.mm: Added.
        (WebKit::ResourceLoadDelegate::ResourceLoadDelegate):
        (WebKit::ResourceLoadDelegate::createResourceLoadClient):
        (WebKit::ResourceLoadDelegate::delegate):
        (WebKit::ResourceLoadDelegate::setDelegate):
        (WebKit::ResourceLoadDelegate::ResourceLoadClient::ResourceLoadClient):
        (WebKit::ResourceLoadDelegate::ResourceLoadClient::willSendRequest const):
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::pageWillSendRequest):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/Network/NetworkProcessProxy.messages.in:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::setResourceLoadClient):
        * UIProcess/WebPageProxy.h:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_overriddenMediaType):
        (WebKit::WebPage::setHasResourceLoadClient):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

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

        Create a mechanism for 'safe by default' web views
        https://bugs.webkit.org/show_bug.cgi?id=205407
        <rdar://problem/58053071>

        Reviewed by Alex Christensen.

        Adds common cases to be used as the basis for 'safe by default' web views.
        The cases are in the form of an NS_ENUM _WKWebViewCategory and
        its equivalent C++ enum WebViewCategory. The conversion between
        these happens in WKWebViewConfiguration.mm.

        * Shared/WebViewCategory.h: Added.
        * UIProcess/API/APIPageConfiguration.cpp:
        (API::PageConfiguration::copy const):
        * UIProcess/API/APIPageConfiguration.h:
        (API::PageConfiguration::webViewCategory const):
        (API::PageConfiguration::setWebViewCategory):
        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
        (convertToAPIWebViewCategory):
        (convertFromAPIWebViewCategory):
        (-[WKWebViewConfiguration _webViewCategory]):
        (-[WKWebViewConfiguration _setWebViewCategory:]):
        * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
        * WebKit.xcodeproj/project.pbxproj:

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

        Network process sandboxes should not include 'common.sb' or 'system.sb'
        https://bugs.webkit.org/show_bug.cgi?id=205521
        <rdar://problem/58095870>

        Reviewed by Per Arne Vollan.

        This patch replaces the 'include' with a copy/paste of the contents of the relevant
        sandbox include file. I removed definitions that were not referenced in the existing
        Network sandbox, but did not otherwise edit the contents. There are duplicates and
        redundancies after this patch, which I will remove as a follow-up step once we confirm
        that this has no regressions.

        I also updated the sandbox to generate telemetry for some mach connections that we think
        are unneeded, or that should be targeted for removal.

        No new tests. There should be no change in behavior.

        * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
        * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:

2020-01-07  Ross Kirsling  <ross.kirsling@sony.com>

        Unreviewed restabilization of non-unified build.

        * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
        * NetworkProcess/IndexedDB/WebIDBServer.cpp:
        (WebKit::WebIDBServer::create):
        (WebKit::WebIDBServer::WebIDBServer):
        (WebKit::WebIDBServer::closeAndDeleteDatabasesForOrigins):
        (WebKit::WebIDBServer::suspend):
        (WebKit::WebIDBServer::didFireVersionChangeEvent):
        * UIProcess/WebContextClient.h:

2020-01-07  Daniel Bates  <dabates@apple.com>

        First character in each word-wrapped line has incorrect character rect when requested range spans multiple lines
        https://bugs.webkit.org/show_bug.cgi?id=205842
        <rdar://problem/56884325>

        Reviewed by Zalan Bujtas.

        Pass BoundingRectBehavior::IgnoreEmptyTextSelections to Range::absoluteBoundingBox() to compute
        the glyph bounding box ignoring empty text selections that would typically occur if the start of
        the range coincide with the edge of a line box. This makes the behavior more consistent with
        the behavior of NSLayoutManager.

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

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

        Unreviewed, rolling out r254144.

        Broke the iOS build.

        Reverted changeset:

        "First character in each word-wrapped line has incorrect
        character rect when requested range spans multiple lines"
        https://bugs.webkit.org/show_bug.cgi?id=205842
        https://trac.webkit.org/changeset/254144

2020-01-07  Keith Rollin  <krollin@apple.com>

        Reformat WebFrameLoaderClient logging
        https://bugs.webkit.org/show_bug.cgi?id=205869
        <rdar://problem/58379240>

        Reviewed by Brent Fulgham.

        Update the format used by WebFrameLoaderClient in its RELEASE_LOG
        logging. Use the format used by WebPageProxy and
        NetworkResourceLoader, which is generally of the form:

            <object-address> - [<values that help thread together operations>] <class>::<method>: <message and other useful values>

        So, for example:

            0x4a1d7c310 - WebFrameLoaderClient::dispatchDidReachLayoutMilestone: dispatching didCompletePageTransition, page = 0x7f83ba009208

        becomes:

            0x4a1d7c310 - [webFrame=0x7ff703f03b68, webFrameID=3, webPage=0x7ff704831808, webPageID=15] WebFrameLoaderClient::dispatchDidReachLayoutMilestone: dispatching didCompletePageTransition

        No new tests - no added or changed functionality.

        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad):
        (WebKit::WebFrameLoaderClient::dispatchDidFailProvisionalLoad):
        (WebKit::WebFrameLoaderClient::dispatchDidFailLoad):
        (WebKit::WebFrameLoaderClient::dispatchDidReachLayoutMilestone):

2020-01-07  Daniel Bates  <dabates@apple.com>

        First character in each word-wrapped line has incorrect character rect when requested range spans multiple lines
        https://bugs.webkit.org/show_bug.cgi?id=205842
        <rdar://problem/56884325>

        Reviewed by Zalan Bujtas.

        Pass BoundingRectBehavior::IgnoreEmptyTextSelections to Range::absoluteBoundingBox() to compute
        the glyph bounding box ignoring empty text selections that would typically occur if the start of
        the range coincide with the edge of a line box. This makes the behavior more consistent with
        the behavior of NSLayoutManager.

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

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

        Unreviewed, rolling out r254132.
        https://bugs.webkit.org/show_bug.cgi?id=205868

        It is breaking WinCairo build and internal builds. (Requested
        by youenn on #webkit).

        Reverted changeset:

        "Implement MediaRecorder backend in GPUProcess"
        https://bugs.webkit.org/show_bug.cgi?id=205802
        https://trac.webkit.org/changeset/254132

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

        Implement MediaRecorder backend in GPUProcess
        https://bugs.webkit.org/show_bug.cgi?id=205802

        Reviewed by Eric Carlson.

        Add support for sending audio/video tracks to record from WebProcess to GPUProcess.
        Add a MediaRecorderPrivate implementation that supports sending one audio track and/or one video track to GPUProcess
        and stopping/fetching data from the remote recorder in GPUProcess.

        In GPUProcess, implement the remote recorder using the existing WebCore recorder writer.

        * CMakeLists.txt:
        * DerivedSources-input.xcfilelist:
        * DerivedSources-output.xcfilelist:
        * DerivedSources.make:
        * GPUProcess/GPUConnectionToWebProcess.cpp:
        (WebKit::GPUConnectionToWebProcess::userMediaCaptureManagerProxy):
        (WebKit::GPUConnectionToWebProcess::mediaRecorderManager):
        (WebKit::GPUConnectionToWebProcess::didReceiveMessage):
        * GPUProcess/GPUConnectionToWebProcess.h:
        * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in:
        * GPUProcess/webrtc/RemoteMediaRecorder.cpp: Added.
        (WebKit::RemoteMediaRecorder::create):
        (WebKit::RemoteMediaRecorder::RemoteMediaRecorder):
        (WebKit::RemoteMediaRecorder::~RemoteMediaRecorder):
        (WebKit::RemoteMediaRecorder::storage):
        (WebKit::RemoteMediaRecorder::audioSamplesStorageChanged):
        (WebKit::RemoteMediaRecorder::audioSamplesAvailable):
        (WebKit::RemoteMediaRecorder::videoSampleAvailable):
        (WebKit::RemoteMediaRecorder::fetchData):
        (WebKit::RemoteMediaRecorder::stopRecording):
        * GPUProcess/webrtc/RemoteMediaRecorder.h: Added.
        * GPUProcess/webrtc/RemoteMediaRecorder.messages.in: Added.
        * GPUProcess/webrtc/RemoteMediaRecorderManager.cpp: Added.
        (WebKit::RemoteMediaRecorderManager::RemoteMediaRecorderManager):
        (WebKit::RemoteMediaRecorderManager::~RemoteMediaRecorderManager):
        (WebKit::RemoteMediaRecorderManager::didReceiveRemoteMediaRecorderMessage):
        (WebKit::RemoteMediaRecorderManager::createRecorder):
        (WebKit::RemoteMediaRecorderManager::releaseRecorder):
        * GPUProcess/webrtc/RemoteMediaRecorderManager.h: Added.
        (WebKit::RemoteMediaRecorderManager::didReceiveMessageFromWebProcess):
        * GPUProcess/webrtc/RemoteMediaRecorderManager.messages.in: Added.
        * Scripts/webkit/messages.py:
        * Sources.txt:
        * SourcesCocoa.txt:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/GPU/media/MediaRecorderProvider.cpp: Added.
        (WebCore::MediaRecorderProvider::createMediaRecorderPrivate):
        * WebProcess/GPU/media/MediaRecorderProvider.h: Added.
        * WebProcess/GPU/webrtc/MediaRecorderIdentifier.h: Added.
        * WebProcess/GPU/webrtc/MediaRecorderPrivate.cpp: Added.
        (WebKit::MediaRecorderPrivate::MediaRecorderPrivate):
        (WebKit::MediaRecorderPrivate::~MediaRecorderPrivate):
        (WebKit::MediaRecorderPrivate::sampleBufferUpdated):
        (WebKit::MediaRecorderPrivate::audioSamplesAvailable):
        (WebKit::MediaRecorderPrivate::storageChanged):
        (WebKit::MediaRecorderPrivate::fetchData):
        (WebKit::MediaRecorderPrivate::stopRecording):
        * WebProcess/GPU/webrtc/MediaRecorderPrivate.h: Added.
        * WebProcess/GPU/webrtc/MediaRecorderProvider.cpp: Added.
        (WebKit::MediaRecorderProvider::createMediaRecorderPrivate):
        * WebProcess/GPU/webrtc/MediaRecorderProvider.h: Added.
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_overriddenMediaType):

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

        Add an option to make video capture in GPUProcess
        https://bugs.webkit.org/show_bug.cgi?id=205853

        Reviewed by Eric Carlson.

        Add an option to make video capture in GPU process.
        Pass this option at creation of the web page so that the process can be updated after launch time.
        Apply the same principle to other audio/video capture parameters.
        Add SPI to update this preference.
        Fix bug in the passing of preference to process pool for the video capture in UIProcess parameter, which is now an experimental flag and not an internal one.

        Test: fast/mediastream/captureInGPUProcess.html

        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:
        * Shared/WebPreferences.yaml:
        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const):
        (WebKit::WebProcessCreationParameters::decode):
        * Shared/WebProcessCreationParameters.h:
        * UIProcess/API/APIProcessPoolConfiguration.h:
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetCaptureVideoInGPUProcessEnabled):
        (WKPreferencesGetCaptureVideoInGPUProcessEnabled):
        * UIProcess/API/C/WKPreferencesRef.h:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        * UIProcess/WebPageProxy.cpp:
        * UIProcess/WebPreferences.cpp:
        (WebKit::WebPreferences::updateBoolValueForInternalDebugFeatureKey):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::initializeNewWebProcess):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_overriddenMediaType):
        * WebProcess/cocoa/UserMediaCaptureManager.cpp:
        (WebKit::UserMediaCaptureManager::setupCaptureProcesses):
        (WebKit::UserMediaCaptureManager::VideoFactory::createVideoCaptureSource):
        * WebProcess/cocoa/UserMediaCaptureManager.h:
        (WebKit::UserMediaCaptureManager::VideoFactory::setShouldCaptureInGPUProcess):

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

        Fix non GPUProcess build issue in UserMediaCaptureManager
        https://bugs.webkit.org/show_bug.cgi?id=205851

        Reviewed by Eric Carlson.

        Build fix, no change of behavior.

        * WebProcess/cocoa/UserMediaCaptureManager.cpp:
        (WebKit::UserMediaCaptureManager::Source::connection):

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

        [GTK][WPE] Add API to retrieve and delete surrounding text for input methods
        https://bugs.webkit.org/show_bug.cgi?id=205716

        Reviewed by Žan Doberšek.

        Extend WebKitInputMethodContext to be able to retrieve and delete surrounding text.

        * Shared/EditorState.cpp:
        (WebKit::EditorState::PostLayoutData::encode const): Encode paragraphContext and paragraphContextCursorPosition.
        (WebKit::EditorState::PostLayoutData::decode): Decode paragraphContext and paragraphContextCursorPosition.
        * Shared/EditorState.h: Add paragraphContext and paragraphContextCursorPosition.
        * UIProcess/API/glib/InputMethodFilter.cpp:
        (WebKit::InputMethodFilter::deleteSurroundingCallback): Callback to handle
        WebKitInputMethodContext::delete-surrounding signal.
        (WebKit::InputMethodFilter::setContext): Connect to WebKitInputMethodContext::delete-surrounding signal.
        (WebKit::InputMethodFilter::notifySurrounding): Save the new surrounding text and position and call
        webkit_input_method_context_notify_surrounding().
        (WebKit::InputMethodFilter::deleteSurrounding): Ask WebKitWebView to delete the surrounding text.
        * UIProcess/API/glib/InputMethodFilter.h:
        * UIProcess/API/glib/WebKitInputMethodContext.cpp:
        (webkit_input_method_context_class_init): Add delete-surrounding signal.
        (webkit_input_method_context_notify_surrounding): Call the virtual method notify_surrounding if implemented.
        * UIProcess/API/glib/WebKitWebView.cpp:
        (webkitWebViewDeleteSurrounding): Call WebPageProxy::deleteSurrounding().
        * UIProcess/API/glib/WebKitWebViewPrivate.h:
        * UIProcess/API/gtk/WebKitInputMethodContext.h:
        * UIProcess/API/gtk/WebKitInputMethodContextImplGtk.cpp:
        (contextRetrieveSurrounding): Call gtk_im_context_set_surrounding() with the current surrounding text and position.
        (webkitInputMethodContextImplGtkConstructed): Connect to GtkIMContext::retrieve-surrounding signal.
        (webkitInputMethodContextImplGtkNotifySurrounding): Save the new surrounding text and position.
        (webkit_input_method_context_impl_gtk_class_init): Add implementation for notify_surrounding vfunc.
        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (webkitWebViewBaseUpdateTextInputState): Also notify the context about surrounding text and position.
        * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
        * UIProcess/API/wpe/WPEView.cpp:
        (WKWPE::View::selectionDidChange): Ditto.
        * UIProcess/API/wpe/WebKitInputMethodContext.h:
        * UIProcess/API/wpe/docs/wpe-1.0-sections.txt:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::deleteSurrounding): Send DeleteSurrounding message to web process.
        * UIProcess/WebPageProxy.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::deleteSurrounding): Delete the given range.
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in: Add DeleteSurrounding message.
        * WebProcess/WebPage/glib/WebPageGLib.cpp:
        (WebKit::WebPage::platformEditorState const): Moved from GTK and WPE here and also added paragraphContext and
        paragraphContextCursorPosition initialization.
        * WebProcess/WebPage/gtk/WebPageGtk.cpp: Remove platformEditorState().
        * WebProcess/WebPage/wpe/WebPageWPE.cpp: Ditto.

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

        [GTK][WPE] Add API to set purpose and hints of active editable element to input methods
        https://bugs.webkit.org/show_bug.cgi?id=205605

        Reviewed by Žan Doberšek.

        Add input-purpose and input-hints properties to WebKitInputMethodContext. The message SetInputMethodState now
        receives an optional InputMethodState struct with information about the purpose and hints of the active editable
        element.

        * Scripts/webkit/messages.py: Only include InputMethodState.h for GTK and WPE.
        * Shared/glib/InputMethodState.cpp: Added.
        (WebKit::InputMethodState::setPurposeOrHintForInputMode):
        (WebKit::inputElementHasDigitsPattern):
        (WebKit::InputMethodState::setPurposeForInputElement):
        (WebKit::InputMethodState::addHintsForAutocapitalizeType):
        (WebKit::InputMethodState::encode const):
        (WebKit::InputMethodState::decode):
        * Shared/glib/InputMethodState.h: Added.
        (WebKit::operator==):
        * SourcesGTK.txt:
        * SourcesWPE.txt:
        * UIProcess/API/glib/InputMethodFilter.cpp:
        (WebKit::InputMethodFilter::setContext): Use isEnabled() instead of m_enabled.
        (WebKit::InputMethodFilter::setState): Now receives an optional InputMethodState struct.
        (WebKit::InputMethodFilter::filterKeyEvent): Use isEnabled() instead of m_enabled.
        (WebKit::InputMethodFilter::isViewFocused const): Ditto.
        (WebKit::toWebKitPurpose): Helper to convert InputMethodState::Purpose to WebKitInputPurpose.
        (WebKit::toWebKitHints): Helper to convert InputMethodState::Hint to WebKitInputHints.
        (WebKit::InputMethodFilter::notifyFocusedIn): Set the purpose and hints to the context.
        (WebKit::InputMethodFilter::notifyFocusedOut): Use isEnabled() instead of m_enabled.
        (WebKit::InputMethodFilter::notifyCursorRect): Ditto.
        (WebKit::InputMethodFilter::preeditStarted): Ditto.
        (WebKit::InputMethodFilter::preeditChanged): Ditto.
        (WebKit::InputMethodFilter::preeditFinished): Ditto.
        (WebKit::InputMethodFilter::committed): Ditto.
        * UIProcess/API/glib/InputMethodFilter.h:
        (WebKit::InputMethodFilter::isEnabled const): Return true if we have a state.
        * UIProcess/API/glib/WebKitInputMethodContext.cpp:
        (webkitInputMethodContextSetProperty): Properties setter.
        (webkitInputMethodContextGetProperty): Properties getter.
        (webkit_input_method_context_class_init): Add implementation for properties getter and setter.
        (webkit_input_method_context_get_input_purpose):
        (webkit_input_method_context_set_input_purpose):
        (webkit_input_method_context_get_input_hints):
        (webkit_input_method_context_set_input_hints):
        * UIProcess/API/gtk/WebKitInputMethodContext.h:
        * UIProcess/API/gtk/WebKitInputMethodContextImplGtk.cpp:
        (toGtkInputPurpose): Helper to convert WebKitInputPurpose to GtkInputPurpose.
        (toGtkInputHints): Helper to convert WebKitInputHints to GtkInputHints.
        (inputPurposeChangedCallback): Set the purpose on GtkIMContext.
        (inputHintsChangedCallback): Set the hints on GtkIMContext.
        (webkitInputMethodContextImplGtkConstructed): Connect to notify signal for input-purpose and input-hints
        properties of the context.
        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (webkitWebViewBaseSetInputMethodState):
        * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
        * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
        * UIProcess/API/wpe/PageClientImpl.cpp:
        (WebKit::PageClientImpl::setInputMethodState):
        * UIProcess/API/wpe/PageClientImpl.h:
        * UIProcess/API/wpe/WPEView.cpp:
        (WKWPE::View::setInputMethodState):
        * UIProcess/API/wpe/WPEView.h:
        * UIProcess/API/wpe/WebKitInputMethodContext.h:
        * UIProcess/API/wpe/docs/wpe-1.0-sections.txt:
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/gtk/WebPageProxyGtk.cpp:
        (WebKit::WebPageProxy::setInputMethodState):
        * UIProcess/wpe/WebPageProxyWPE.cpp:
        (WebKit::WebPageProxy::setInputMethodState):
        * WebProcess/WebCoreSupport/WebEditorClient.cpp:
        (WebKit::WebEditorClient::setInputMethodState):
        * WebProcess/WebCoreSupport/WebEditorClient.h:
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/glib/WebPageGLib.cpp:
        (WebKit::inputMethodSateForElement): Build an InputMethodState for the given element.
        (WebKit::WebPage::setInputMethodState):

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

        WebDriver: several w3c collections tests added in r230953 are failing
        https://bugs.webkit.org/show_bug.cgi?id=184966

        Reviewed by Brian Burg.

        This is because JSON.stringify() is not enough, we need to first clone the value using the internal JSON clone
        algorithm explained in the spec. See https://w3c.github.io/webdriver/#dfn-internal-json-clone-algorithm.

        Fixes: imported/w3c/webdriver/tests/execute_script/collections.py::test_arguments
               imported/w3c/webdriver/tests/execute_script/collections.py::test_file_list
               imported/w3c/webdriver/tests/execute_script/collections.py::test_html_all_collection
               imported/w3c/webdriver/tests/execute_async_script/collections.py::test_arguments
               imported/w3c/webdriver/tests/execute_async_script/collections.py::test_file_list
               imported/w3c/webdriver/tests/execute_async_script/collections.py::test_html_all_collection

        * WebProcess/Automation/WebAutomationSessionProxy.js:
        (WebKitAutomation.AutomationSessionProxy.prototype._jsonStringify): Call JSON.stringify(), but without the
        replacer and passing the result of _jsonClone().
        (WebKitAutomation.AutomationSessionProxy.prototype._isCollection): Helper to check if the value is a collection.
        (WebKitAutomation.AutomationSessionProxy.prototype._checkCyclic): Throw an error if the value is a cyclic structure.
        (WebKitAutomation.AutomationSessionProxy.prototype._jsonClone): Implement the internal JSON clone algorithm.
        (WebKitAutomation.AutomationSessionProxy.prototype._createNodeHandle): Trhow an error if the node is stale.

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

        [SOUP] HSTS Support causes page loading to fail with "Operation was cancelled"
        https://bugs.webkit.org/show_bug.cgi?id=203620

        Reviewed by Michael Catanzaro.

        The problem is that we are assuming that request cancellation happens synchronously, but it can happen that the
        async ready callback for the previous request is called after the new one has started.

        * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
        (WebKit::NetworkDataTaskSoup::sendRequestCallback): Return early if this is a previous request already cancelled.

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

        WebDriver: handle no such element errors
        https://bugs.webkit.org/show_bug.cgi?id=204684

        Reviewed by Brian Burg.

        Add InvalidNodeIdentifier to be generated when the elementID provided by WebDriver is not a valid node identifier.

        * UIProcess/Automation/Automation.json: Add InvalidNodeIdentifier error.
        * WebProcess/Automation/WebAutomationSessionProxy.cpp:
        (WebKit::isValidNodeHandle): Helper function to check the given node handle is valid.
        (WebKit::isValidNodeIdentifier): JavaScript callback function to check the node identifier is valid.
        (WebKit::WebAutomationSessionProxy::scriptObjectForFrame): Add isValidNodeIdentifier function.
        (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction): Handle InvalidNodeIdentifier errors.
        (WebKit::WebAutomationSessionProxy::resolveChildFrameWithNodeHandle): Call isValidNodeHandle() and generate
        InvalidNodeIdentifier error if it fails.
        (WebKit::WebAutomationSessionProxy::computeElementLayout): Ditto.
        (WebKit::WebAutomationSessionProxy::selectOptionElement): Ditto.
        (WebKit::WebAutomationSessionProxy::takeScreenshot): Ditto.
        * WebProcess/Automation/WebAutomationSessionProxy.js:
        (let.AutomationSessionProxy.prototype._nodeForIdentifier): Call isValidNodeIdentifier() and throw
        InvalidNodeIdentifier if it fails.

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

        WebDriver: several tests in imported/w3c/webdriver/tests/state/get_element_attribute.py are failing
        https://bugs.webkit.org/show_bug.cgi?id=180415

        Reviewed by Brian Burg.

        Update the ElementAttribute atom to properly handle boolean attributes, following what the selenium original
        atom does.

        * UIProcess/Automation/atoms/ElementAttribute.js:
        (getAttribute):
        (tagName.string_appeared_here.lowercaseAttributeName.string_appeared_here):
        (isBooleanAttribute):

2020-01-07  Chris Fleizach  <cfleizach@apple.com>

        AX: Enable ACCESSIBILITY_ISOLATED_TREE
        https://bugs.webkit.org/show_bug.cgi?id=205535
        <rdar://problem/58131075>

        Reviewed by Zalan Bujtas.

        * Configurations/FeatureDefines.xcconfig:
        * Shared/WebPreferences.yaml:
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetIsAccessibilityIsolatedTreeEnabled):
        (WKPreferencesGetIsAccessibilityIsolatedTreeEnabled):
        * UIProcess/API/C/WKPreferencesRefPrivate.h:

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

        [iOS] Get display level in the UI process for all iOS platforms
        https://bugs.webkit.org/show_bug.cgi?id=205835
        <rdar://problem/58116883>

        Reviewed by Brent Fulgham.

        This was previously only done for iOS, but should be done for all iOS platforms.

        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::registerNotificationObservers):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::initializeNewWebProcess):
        * UIProcess/WebProcessPool.h:
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:
        * WebProcess/cocoa/WebProcessCocoa.mm:

2020-01-06  Eric Carlson  <eric.carlson@apple.com>

        Add some of the remote media player messages needed for video playback
        https://bugs.webkit.org/show_bug.cgi?id=205812
        <rdar://problem/58346531>

        Reviewed by Jer Noble.

        No new tests, it isn't possible to play video yet.

        * GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp:
        (WebKit::RemoteMediaPlayerManagerProxy::prepareForRendering):
        (WebKit::RemoteMediaPlayerManagerProxy::setSize):
        (WebKit::RemoteMediaPlayerManagerProxy::setVisible):
        (WebKit::RemoteMediaPlayerManagerProxy::setShouldMaintainAspectRatio):
        (WebKit::RemoteMediaPlayerManagerProxy::setVideoFullscreenFrame):
        (WebKit::RemoteMediaPlayerManagerProxy::setVideoFullscreenGravity):
        (WebKit::RemoteMediaPlayerManagerProxy::acceleratedRenderingStateChanged):
        (WebKit::RemoteMediaPlayerManagerProxy::setShouldDisableSleep):
        (WebKit::RemoteMediaPlayerManagerProxy::setRate):
        * GPUProcess/media/RemoteMediaPlayerManagerProxy.h:
        * GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in:
        * GPUProcess/media/RemoteMediaPlayerProxy.cpp:
        (WebKit::RemoteMediaPlayerProxy::getConfiguration):
        (WebKit::RemoteMediaPlayerProxy::prepareForRendering):
        (WebKit::RemoteMediaPlayerProxy::setSize):
        (WebKit::RemoteMediaPlayerProxy::setVisible):
        (WebKit::RemoteMediaPlayerProxy::setShouldMaintainAspectRatio):
        (WebKit::RemoteMediaPlayerProxy::setVideoFullscreenFrame):
        (WebKit::RemoteMediaPlayerProxy::setVideoFullscreenGravity):
        (WebKit::RemoteMediaPlayerProxy::acceleratedRenderingStateChanged):
        (WebKit::RemoteMediaPlayerProxy::setShouldDisableSleep):
        (WebKit::RemoteMediaPlayerProxy::setRate):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerReadyStateChanged):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerRenderingCanBeAccelerated):
        * GPUProcess/media/RemoteMediaPlayerProxy.h:
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
        (WebKit::MediaPlayerPrivateRemote::sizeChanged):
        (WebKit::MediaPlayerPrivateRemote::updateCachedState):
        (WebKit::MediaPlayerPrivateRemote::shouldIgnoreIntrinsicSize):
        (WebKit::MediaPlayerPrivateRemote::prepareForRendering):
        (WebKit::MediaPlayerPrivateRemote::setSize):
        (WebKit::MediaPlayerPrivateRemote::setVisible):
        (WebKit::MediaPlayerPrivateRemote::setShouldMaintainAspectRatio):
        (WebKit::MediaPlayerPrivateRemote::setVideoFullscreenFrame):
        (WebKit::MediaPlayerPrivateRemote::setVideoFullscreenGravity):
        (WebKit::MediaPlayerPrivateRemote::acceleratedRenderingStateChanged):
        (WebKit::MediaPlayerPrivateRemote::setShouldDisableSleep):
        (WebKit::MediaPlayerPrivateRemote::naturalSize const):
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.h:
        * WebProcess/GPU/media/RemoteMediaPlayerConfiguration.h:
        (WebKit::RemoteMediaPlayerConfiguration::encode const):
        (WebKit::RemoteMediaPlayerConfiguration::decode):
        * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp:
        (WebKit::RemoteMediaPlayerManager::sizeChanged):
        * WebProcess/GPU/media/RemoteMediaPlayerManager.h:
        * WebProcess/GPU/media/RemoteMediaPlayerManager.messages.in:
        * WebProcess/GPU/media/RemoteMediaPlayerState.h:
        (WebKit::RemoteMediaPlayerState::encode const):
        (WebKit::RemoteMediaPlayerState::decode):

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

        Improve logging for when a synchronous IPC times out
        https://bugs.webkit.org/show_bug.cgi?id=205829

        Reviewed by Tim Horton.

        * Platform/IPC/Connection.cpp:
        (IPC::Connection::sendSyncMessage):
        (IPC::Connection::waitForSyncReply):
        * Platform/IPC/Connection.h:

2020-01-06  Peng Liu  <peng.liu6@apple.com>

        Build (unified) failure after adding source files to support media in GPU process
        https://bugs.webkit.org/show_bug.cgi?id=205616

        Reviewed by Darin Adler.

        No new tests, no functional change.

        * Sources.txt:
        * SourcesGTK.txt:
        * WebKit.xcodeproj/project.pbxproj:

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

        NetworkSessionCocoa::isolatedSession should not use iterator after mutating m_isolatedSessions
        https://bugs.webkit.org/show_bug.cgi?id=205824
        <rdar://problem/55107625>

        Reviewed by Chris Dumez.

        Classic iterator use after mutating iterated container was causing crashes by returning a null SessionWrapper&
        This was introduced in r252185 or r248640.

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::isolatedSession):

2020-01-06  Mark Lam  <mark.lam@apple.com>

        Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED.
        https://bugs.webkit.org/show_bug.cgi?id=205776

        Reviewed by Saam Barati.

        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::invalidateAndCancel):
        * NetworkProcess/NetworkSession.h:
        * NetworkProcess/cache/NetworkCacheStorage.cpp:
        (WebKit::NetworkCache::Storage::setCapacity):
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (toNSURLSessionResponseDisposition):
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
        * Platform/IPC/Connection.cpp:
        (IPC::Connection::waitForMessage):
        * Platform/IPC/MessageReceiver.h:
        (IPC::MessageReceiver::willBeAddedToMessageReceiverMap):
        (IPC::MessageReceiver::willBeRemovedFromMessageReceiverMap):
        * Platform/IPC/cocoa/ConnectionCocoa.mm:
        (IPC::readFromMachPort):
        * Platform/mac/MachUtilities.cpp:
        (setMachExceptionPort):
        * Shared/API/APIClient.h:
        (API::Client::Client):
        * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
        * Shared/Cocoa/ArgumentCodersCocoa.h:
        * Shared/SharedStringHashTableReadOnly.cpp:
        * UIProcess/BackingStore.cpp:
        (WebKit::BackingStore::incorporateUpdate):
        * UIProcess/GenericCallback.h:
        * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
        (WebKit::ProcessLauncher::launchProcess):
        * UIProcess/PageLoadState.h:
        (WebKit::PageLoadState::Transaction::Token::Token):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::~WebPageProxy):
        * WebProcess/Network/WebResourceLoader.cpp:
        (WebKit::WebResourceLoader::didReceiveResponse):
        * WebProcess/Network/WebResourceLoader.h:
        * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
        (WebKit::NetscapePluginStream::NetscapePluginStream):
        (WebKit::NetscapePluginStream::notifyAndDestroyStream):
        * WebProcess/Plugins/Netscape/NetscapePluginStream.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::runModal):
        * WebProcess/WebProcess.cpp:
        (WebKit::checkDocumentsCaptureStateConsistency):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::updateProcessName):

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

        Remove WebsiteDataStore::setServiceWorkerRegistrationDirectory
        https://bugs.webkit.org/show_bug.cgi?id=205754

        Reviewed by Youenn Fablet.

        The directory is now only set in the configuration, which will prevent misuse of the misplaced SPI.
        Updated API tests, which still work.

        * UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.cpp:
        (WKWebsiteDataStoreConfigurationCopyServiceWorkerRegistrationDirectory):
        (WKWebsiteDataStoreConfigurationSetServiceWorkerRegistrationDirectory):
        * UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.h:
        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreCopyServiceWorkerRegistrationDirectory): Deleted.
        (WKWebsiteDataStoreSetServiceWorkerRegistrationDirectory): Deleted.
        * UIProcess/API/C/WKWebsiteDataStoreRef.h:
        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _hasRegisteredServiceWorker]):
        (-[WKWebsiteDataStore _serviceWorkerRegistrationDirectory]): Deleted.
        (-[WKWebsiteDataStore _setServiceWorkerRegistrationDirectory:]): Deleted.
        * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        (WebKit::WebsiteDataStore::setCacheStorageDirectory):
        (WebKit::WebsiteDataStore::serviceWorkerRegistrationDirectory const): Deleted.
        (WebKit::WebsiteDataStore::setServiceWorkerRegistrationDirectory): Deleted.

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

        Remove _WKProcessPoolConfiguration.CTDataConnectionServiceType and suppressesConnectionTerminationOnSystemChange
        https://bugs.webkit.org/show_bug.cgi?id=205751

        Reviewed by Darin Adler.

        Their replacements on _WKWebViewConfiguration have been adopted.

        * NetworkProcess/NetworkProcess.h:
        (WebKit::NetworkProcess::suppressesConnectionTerminationOnSystemChange const): Deleted.
        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
        (WebKit::NetworkProcessCreationParameters::decode):
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
        * NetworkProcess/cocoa/NetworkSessionCocoa.h:
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::dataConnectionServiceType const):
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
        (WebKit::globalCTDataConnectionServiceType): Deleted.
        (WebKit::NetworkSessionCocoa::setCTDataConnectionServiceType): Deleted.
        * UIProcess/API/APIProcessPoolConfiguration.cpp:
        (API::ProcessPoolConfiguration::copy):
        * UIProcess/API/APIProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
        (-[_WKProcessPoolConfiguration suppressesConnectionTerminationOnSystemChange]): Deleted.
        (-[_WKProcessPoolConfiguration setSuppressesConnectionTerminationOnSystemChange:]): Deleted.
        (-[_WKProcessPoolConfiguration CTDataConnectionServiceType]): Deleted.
        (-[_WKProcessPoolConfiguration setCTDataConnectionServiceType:]): Deleted.
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeNetworkProcess):
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::paymentCoordinatorCTDataConnectionServiceType):

2020-01-06  Keith Rollin  <krollin@apple.com>

        Reformat WebPage logging
        https://bugs.webkit.org/show_bug.cgi?id=205709
        <rdar://problem/58290285>

        Reviewed by Brent Fulgham.

        Update the format used by WebPage in its RELEASE_LOG logging. Use the
        format used by WebPageProxy and NetworkResourceLoader, which is
        generally of the form:

            <object-address> - [<values that help thread together operations>] <class>::<method>: <message and other useful values>

        So, for example:

            0x4a1df5000 - WebLoaderStrategy::scheduleLoad: Resource is being scheduled with the NetworkProcess (frame=0x4a1db0220, priority=0, webPageID=15, frameID=3, resourceID=32)',

        becomes:

            0x4a1df5000 - [resourceLoader=0x1418b7200, frameLoader=0x1326d7340, frame=0x4a1db0220, webPageID=15, frameID=3, resourceID=32] WebLoaderStrategy::scheduleLoad: Resource is being scheduled with the NetworkProcess (priority=2)

        This new form is a lot more verbose, but it really helps in tracing
        activity from the top of our page/frame/resource load stack to the
        bottom.

        No new tests - no added or changed functionality.

        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::scheduleLoad):
        (WebKit::WebLoaderStrategy::tryLoadingUsingURLSchemeHandler):
        (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
        (WebKit::WebLoaderStrategy::networkProcessCrashed):
        (WebKit::WebLoaderStrategy::loadResourceSynchronously):
        * WebProcess/Network/WebLoaderStrategy.h:

2020-01-06  Luming Yin  <luming_yin@apple.com>

        Add WKWebView SPI to query _WKMediaMutedState
        https://bugs.webkit.org/show_bug.cgi?id=205789
        <rdar://problem/58335241>

        Reviewed by Eric Carlson.

        Add plumbing for clients to query the media muted state on WKWebView.

        * SourcesCocoa.txt:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _mediaMutedState]):
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/Cocoa/MediaUtilities.h: Renamed from Source/WebKit/UIProcess/Cocoa/MediaCaptureUtilities.h.
        * UIProcess/Cocoa/MediaUtilities.mm: Renamed from Source/WebKit/UIProcess/Cocoa/MediaCaptureUtilities.mm.
        (WebKit::toWKMediaCaptureState):
        (WebKit::toWKMediaMutedState):
        * UIProcess/Cocoa/UIDelegate.mm:
        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::mutedStateFlags const):
        * WebKit.xcodeproj/project.pbxproj:

2020-01-05  Dean Jackson  <dino@apple.com>

        Rename GraphicsContext3D to GraphicsContextGL
        https://bugs.webkit.org/show_bug.cgi?id=205778
        <rdar://problem/58327597>

        Reviewed by Sam Weinig.

        Rename all the GraphicsContext3D things to GraphicsContextGL
        (includes Extensions3D and GRAPHICS_CONTEXT_3D).

        GraphicsContext3DBase now becomes GraphicsContextGL.
        GraphicsContext3D is now GraphicsContextGLOpenGL (since it represents
        the OpenGL implementation of the API).

        * CMakeLists.txt:
        * UIProcess/gtk/WaylandCompositor.cpp:
        (WebKit::WaylandCompositor::initializeEGL):
        * UIProcess/mac/HighPerformanceGPUManager.cpp:
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
        (WebKit::MediaPlayerPrivateRemote::copyVideoTextureToPlatformTexture):
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.h:
        * WebProcess/WebPage/WebPage.cpp:
        * WebProcess/WebPage/mac/WebPageMac.mm:
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::displayConfigurationChanged):

2020-01-06  Rob Buis  <rbuis@igalia.com>

        Remove unused GlobalFrameID from NetworkCacheSpeculativeLoad
        https://bugs.webkit.org/show_bug.cgi?id=205796

        Reviewed by Chris Dumez.

        Remove unused GlobalFrameID from NetworkCacheSpeculativeLoad
        and NetworkCache::update.

        No change in behavior.

        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::didReceiveResponse):
        * NetworkProcess/cache/NetworkCache.cpp:
        (WebKit::NetworkCache::Cache::update):
        * NetworkProcess/cache/NetworkCache.h:
        * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
        (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
        (WebKit::NetworkCache::SpeculativeLoad::didReceiveResponse):
        * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:

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

        [iOS] Issue mach lookup extension to launch services daemon for Mail
        https://bugs.webkit.org/show_bug.cgi?id=205316

        Reviewed by Brent Fulgham.

        Issue mach lookup extension to "com.apple.lsd.open" for Mail, since this service will be removed from the WebContent sandbox.

        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/API/Cocoa/WKWebViewPrivateForTesting.h:
        * UIProcess/API/Cocoa/WKWebViewTesting.mm:
        (+[WKWebView _setApplicationBundleIdentifier:]):
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        (WebKit::WebProcessPool::platformInitializeNetworkProcess):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):

2020-01-06  Youenn Fablet  <youenn@apple.com>

        RemoteVideoSample::create does not need to take a MediaSample r value
        https://bugs.webkit.org/show_bug.cgi?id=205793

        Reviewed by Eric Carlson.

        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:

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

        Implement RTC VTB encoders in GPUProcess
        https://bugs.webkit.org/show_bug.cgi?id=205713

        Reviewed by Eric Carlson.

        Add support for remote video encoders in GPUProcess based on libwebrtc exposed routines.
        WebProcess sets callbacks in the webrtc backend to implement H264 encoding as a remote video encoder.
        In addition to video frames, we also need to send rate setting orders.

        * Configurations/WebKit.xcconfig:
        * GPUProcess/webrtc/LibWebRTCCodecsProxy.h:
        * GPUProcess/webrtc/LibWebRTCCodecsProxy.messages.in:
        * GPUProcess/webrtc/LibWebRTCCodecsProxy.mm:
        (WebKit::LibWebRTCCodecsProxy::~LibWebRTCCodecsProxy):
        (WebKit::LibWebRTCCodecsProxy::createEncoder):
        (WebKit::LibWebRTCCodecsProxy::releaseEncoder):
        (WebKit::LibWebRTCCodecsProxy::initializeEncoder):
        (WebKit::toWebRTCVideoRotation):
        (WebKit::LibWebRTCCodecsProxy::encodeFrame):
        (WebKit::LibWebRTCCodecsProxy::setEncodeRates):
        * Scripts/webkit/messages.py:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/GPU/webrtc/LibWebRTCCodecs.cpp:
        (WebKit::createVideoEncoder):
        (WebKit::releaseVideoEncoder):
        (WebKit::initializeVideoEncoder):
        (WebKit::toMediaSampleVideoRotation):
        (WebKit::encodeVideoFrame):
        (WebKit::registerEncodeCompleteCallback):
        (WebKit::setEncodeRatesCallback):
        (WebKit::LibWebRTCCodecs::setCallbacks):
        (WebKit::LibWebRTCCodecs::createDecoder):
        (WebKit::LibWebRTCCodecs::releaseDecoder):
        (WebKit::LibWebRTCCodecs::failedDecoding):
        (WebKit::LibWebRTCCodecs::completedDecoding):
        (WebKit::LibWebRTCCodecs::createEncoder):
        (WebKit::LibWebRTCCodecs::releaseEncoder):
        (WebKit::LibWebRTCCodecs::initializeEncoder):
        (WebKit::LibWebRTCCodecs::encodeFrame):
        (WebKit::LibWebRTCCodecs::registerEncodeFrameCallback):
        (WebKit::LibWebRTCCodecs::setEncodeRates):
        (WebKit::LibWebRTCCodecs::completedEncoding):
        (WebKit::LibWebRTCCodecs::pixelBufferPool):
        * WebProcess/GPU/webrtc/LibWebRTCCodecs.h:
        * WebProcess/GPU/webrtc/LibWebRTCCodecs.messages.in:
        * WebProcess/GPU/webrtc/RTCEncoderIdentifier.h: Added.
        * WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
        (WebKit::LibWebRTCProvider::createDecoderFactory):

2020-01-05  Eric Carlson  <eric.carlson@apple.com>

        [Media in GPU process] Add remote MIME type cache
        https://bugs.webkit.org/show_bug.cgi?id=205763
        <rdar://problem/58312152>

        Reviewed by Dean Jackson.

        * GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp:
        (WebKit::RemoteMediaPlayerManagerProxy::supportsTypeAndCodecs):
        (WebKit::RemoteMediaPlayerManagerProxy::canDecodeExtendedType):
        (WebKit::RemoteMediaPlayerManagerProxy::supportsType): Deleted.

        * GPUProcess/media/RemoteMediaPlayerManagerProxy.h:
        * GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in:
        * Sources.txt:
        * WebKit.xcodeproj/project.pbxproj:

        * WebProcess/GPU/media/RemoteMediaPlayerMIMETypeCache.cpp: Added.
        (WebKit::RemoteMediaPlayerMIMETypeCache::RemoteMediaPlayerMIMETypeCache):
        (WebKit::RemoteMediaPlayerMIMETypeCache::mimeCache const):
        (WebKit::RemoteMediaPlayerMIMETypeCache::isAvailable const):
        (WebKit::RemoteMediaPlayerMIMETypeCache::staticContainerTypeList):
        (WebKit::RemoteMediaPlayerMIMETypeCache::isUnsupportedContainerType):
        (WebKit::RemoteMediaPlayerMIMETypeCache::canDecodeExtendedType):
        (WebKit::RemoteMediaPlayerMIMETypeCache::supportsTypeAndCodecs):
        (WebKit::RemoteMediaPlayerMIMETypeCache::initializeCache):
        * WebProcess/GPU/media/RemoteMediaPlayerMIMETypeCache.h:  Added.

        * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp:
        (WebKit::mimeCaches):
        (WebKit::RemoteMediaPlayerManager::typeCache):
        (WebKit::RemoteMediaPlayerManager::initialize):
        (WebKit::RemoteMediaPlayerManager::getSupportedTypes):
        (WebKit::RemoteMediaPlayerManager::supportsTypeAndCodecs):

        * WebProcess/GPU/media/RemoteMediaPlayerManager.h:
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::setMediaMIMETypes):

2020-01-05  Sam Weinig  <weinig@apple.com>

        Further simplify StringBuilder usage by standardizing hex formating to a single hex() function
        https://bugs.webkit.org/show_bug.cgi?id=205759

        Reviewed by Dean Jackson.

        * UIProcess/DeviceIdHashSaltStorage.cpp:
        (WebKit::DeviceIdHashSaltStorage::completeDeviceIdHashSaltForOriginCall):
        * UIProcess/WebBackForwardList.cpp:
        (WebKit::WebBackForwardList::loggingString):
        Replace appendUnsignedAsHex() with append(hex()).

2020-01-05  Simon Fraser  <simon.fraser@apple.com>

        DumpRenderTree doesn't always call updateRendering() when a test completes
        https://bugs.webkit.org/show_bug.cgi?id=205761

        Reviewed by Darin Adler.

        Use the QuartzCore SPI header.

        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:

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

        Reformat WebPage logging
        https://bugs.webkit.org/show_bug.cgi?id=205705
        <rdar://problem/58288704>

        Reviewed by Alex Christensen.

        Update the format used by WebPage in its RELEASE_LOG logging. Use the
        format used by WebPageProxy and NetworkResourceLoader, which is
        generally of the form:

            <object-address> - [<values that help thread together operations>] <class>::<method>: <message and other useful values>

        So, for example:

            0x7f83ba009208 - WebPage (webPageID=15) - Adding a reason 1 to freeze layer tree (now 1); old reasons were 0

        becomes:

            0x7f83ba009208 - [webPageID=15] WebPage::freezeLayerTree: Adding a reason to freeze layer tree (reason=1, new=1, old=0)

        No new tests - no added or changed functionality.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_overriddenMediaType):
        (WebKit::WebPage::createPlugin):
        (WebKit::WebPage::freezeLayerTree):
        (WebKit::WebPage::unfreezeLayerTree):
        (WebKit::WebPage::markLayersVolatile):
        (WebKit::WebPage::cancelMarkLayersVolatile):
        (WebKit::WebPage::touchEventSync):

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

        Add support for DragEvent
        https://bugs.webkit.org/show_bug.cgi?id=205758

        Reviewed by Darin Adler.

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

2020-01-03  Garrett Davidson  <garrett_davidson@apple.com>

        IconLoadingClient::getLoadDecisionForIcon() leaks an Objective-C block
        https://bugs.webkit.org/show_bug.cgi?id=205750
        <rdar://problem/57981723>

        Reviewed by Wenson Hsieh.

        Replace a Block_copy with makeBlockPtr to prevent leaking the ObjC block.

        * UIProcess/Cocoa/IconLoadingDelegate.mm:
        (WebKit::IconLoadingDelegate::IconLoadingClient::getLoadDecisionForIcon):

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

        Crashes under -[WKWebView _addUpdateVisibleContentRectPreCommitHandler]_block_invoke
        https://bugs.webkit.org/show_bug.cgi?id=205749
        <rdar://problem/56433624>

        Reviewed by Simon Fraser.

        Implement a speculative fix for a common crash. We believe that this is due to
        a mechanism UIKit uses to bounce -dealloc (in our case, of WKWebView and/or WKContentView)
        to the main thread when the last reference is dropped on a background thread.
        At that point, deallocation has already begun, -retain cannot revive the object,
        but -dealloc has not yet been called (because of the nature of this mechanism).

        To avoid this, make PageClientImpl -> WKContentView and WKContentView -> WKWebView
        weak instead of raw references. This way, we won't even get to _addUpdateVisibleContentRectPreCommitHandler
        with a deallocating WKWebView, nor try (and fail) to retain it for later use in the block.

        * UIProcess/ios/PageClientImplIOS.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::viewSize):
        (WebKit::PageClientImpl::didPerformDictionaryLookup):
        (WebKit::PageClientImpl::createValidationBubble):
        (WebKit::PageClientImpl::createDataListSuggestionsDropdown):
        (WebKit::PageClientImpl::createDrawingView):
        * UIProcess/ios/WKContentView.h:
        * UIProcess/ios/WKContentView.mm:
        (-[WKContentView _commonInitializationWithProcessPool:configuration:]):
        (-[WKContentView webView]):
        (-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
        (-[WKContentView _didCommitLayerTree:]):
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView setupInteraction]):
        (-[WKContentView _updateLongPressAndHighlightLongPressGestures]):
        (-[WKContentView endEditingAndUpdateFocusAppearanceWithReason:]):
        (-[WKContentView gestureRecognizerMayPinchToZoomWebView:]):
        (-[WKContentView _showAttachmentSheet]):
        (-[WKContentView _actionForLongPressFromPositionInformation:]):
        (-[WKContentView gestureRecognizerShouldBegin:]):
        (-[WKContentView hasSelectablePositionAtPoint:]):
        (-[WKContentView pointIsNearMarkedText:]):
        (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
        (-[WKContentView _stylusSingleTapRecognized:]):
        (-[WKContentView _endPotentialTapAndEnableDoubleTapGesturesIfNecessary]):
        (-[WKContentView _updateInteractionTintColor]):
        (-[WKContentView canPerformActionForWebView:withSender:]):
        (-[WKContentView accessibilityRetrieveSpeakSelectionContent]):
        (-[WKContentView requestRectsToEvadeForSelectionCommandsWithCompletionHandler:]):
        (-[WKContentView accessoryAutoFill]):
        (-[WKContentView _updateAccessory]):
        (-[WKContentView _didChangeWebViewEditability]):
        (-[WKContentView insertTextSuggestion:]):
        (-[WKContentView isScrollableForKeyboardScrollViewAnimator:]):
        (-[WKContentView keyboardScrollViewAnimator:distanceForIncrement:inDirection:]):
        (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:activityStateChanges:userObject:]):
        (-[WKContentView addFocusedFormControlOverlay]):
        (-[WKContentView presentViewControllerForCurrentFocusedElement]):
        (-[WKContentView dismissAllInputViewControllers:]):
        (-[WKContentView _showShareSheet:inRect:completionHandler:]):
        (-[WKContentView actionSheetAssistant:shareElementWithURL:rect:]):
        (-[WKContentView actionSheetAssistant:showCustomSheetForElement:]):
        (-[WKContentView dataDetectionContextForPositionInformation:]):
        (-[WKContentView actionSheetAssistant:getAlternateURLForImage:completion:]):
        (-[WKContentView _didChangeDragInteractionPolicy]):
        (-[WKContentView dragLiftDelay]):
        (-[WKContentView setupDragAndDropInteractions]):
        (-[WKContentView _didPerformDragOperation:]):
        (-[WKContentView _dragDestinationActionForDropSession:]):
        (-[WKContentView _itemsForBeginningOrAddingToSessionWithRegistrationLists:stagedDragSource:]):
        (-[WKContentView _handleDropByInsertingImagePlaceholders:session:]):
        (-[WKContentView _dragInteraction:dataOwnerForSession:]):
        (-[WKContentView dragInteraction:previewForLiftingItem:session:]):
        (-[WKContentView dragInteraction:sessionWillBegin:]):
        (-[WKContentView dragInteraction:session:didEndWithOperation:]):
        (-[WKContentView dragInteraction:previewForCancellingItem:withDefault:]):
        (-[WKContentView _dropInteraction:dataOwnerForSession:]):
        (-[WKContentView dropInteraction:sessionDidUpdate:]):
        (-[WKContentView dropInteraction:performDrop:]):
        (-[WKContentView dismissQuickboardViewControllerAndRevealFocusedFormOverlayIfNecessary:]):
        (-[WKContentView viewController:inputContextViewHeightForSize:]):
        (-[WKContentView inputContextViewForViewController:]):
        (-[WKContentView _registerPreview]):
        (-[WKContentView assignLegacyDataForContextMenuInteraction]):
        (-[WKContentView _contextMenuInteraction:configurationForMenuAtLocation:completion:]):
        (-[WKContentView continueContextMenuInteraction:]):
        (-[WKContentView _createTargetedPreviewIfPossible]):
        (-[WKContentView contextMenuInteraction:willDisplayMenuForConfiguration:animator:]):
        (-[WKContentView contextMenuInteraction:willPerformPreviewActionForMenuWithConfiguration:animator:]):
        (-[WKContentView contextMenuInteraction:willEndForConfiguration:animator:]):
        (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
        (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
        (-[WKContentView _presentedViewControllerForPreviewItemController:]):
        (-[WKContentView _previewItemController:commitPreview:]):
        (-[WKContentView _previewItemController:didDismissPreview:committing:]):

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

        Update the RemoteMediaPlayerManagerProxy::Load XPC message to provide the updated RemoteMediaPlayerConfiguration to the web process
        https://bugs.webkit.org/show_bug.cgi?id=205740

        Reviewed by Eric Carlson.

        * GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp:
        (WebKit::RemoteMediaPlayerManagerProxy::load):
        * GPUProcess/media/RemoteMediaPlayerManagerProxy.h:
        * GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in:
        * GPUProcess/media/RemoteMediaPlayerProxy.cpp:
        (WebKit::RemoteMediaPlayerProxy::load):
        * GPUProcess/media/RemoteMediaPlayerProxy.h:
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
        (WebKit::MediaPlayerPrivateRemote::MediaPlayerPrivateRemote::load):

2020-01-03  Andy Estes  <aestes@apple.com>

        [Apple Pay] Provide a better error message when Apple Pay blocks user agent script evaluation
        https://bugs.webkit.org/show_bug.cgi?id=205730
        <rdar://problem/55573484>

        Reviewed by Brady Eidson.

        * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
        (WebKit::WebPaymentCoordinator::userAgentScriptsBlockedErrorMessage const):
        * WebProcess/ApplePay/WebPaymentCoordinator.h:

2020-01-03  Dean Jackson  <dino@apple.com>

        Provide pid to crashing service worker process and GPU process
        https://bugs.webkit.org/show_bug.cgi?id=205564
        <rdar://problem/58300321>

        Build fix for TestWebKitAPI.

        * UIProcess/API/C/WKContext.h:

2020-01-03  Yusuke Suzuki  <ysuzuki@apple.com>

        Put more WebCore/WebKit JS objects into IsoSubspace
        https://bugs.webkit.org/show_bug.cgi?id=205711

        Reviewed by Keith Miller.

        * WebProcess/Plugins/Netscape/JSNPMethod.h:
        * WebProcess/Plugins/Netscape/JSNPObject.h:

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

        Add some shared schemes to the WebKit.xcworkspace
        https://bugs.webkit.org/show_bug.cgi?id=205698

        Reviewed by Tim Horton.

        Make WebKit.xcworkspace show the following schemes by default:
            All Source
            All Tools
            WTF
            JavaScriptCore
            WebCore
            WebKit
            WebKitLegacy
            DumpRenderTree
            WebKitTestRunner
            TestWebKitAPI
            MiniBrowser
            MobileMiniBrowser.
            
        Also remove the MobileMiniBrowserUITests scheme.

        * WebKit.xcodeproj/xcshareddata/xcschemes/WebKit.xcscheme: Copied from Tools/MobileMiniBrowser/MobileMiniBrowser.xcodeproj/xcshareddata/xcschemes/MobileMiniBrowserUITests.xcscheme.

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

        Provide pid to crashing service worker process and GPU process
        https://bugs.webkit.org/show_bug.cgi?id=205564

        Reviewed by Alex Christensen.

        No change of behavior, we provide pids to the WKContext callbacks.

        * UIProcess/API/C/WKContext.h:
        * UIProcess/API/C/WKContextPrivate.h:
        * UIProcess/GPU/GPUProcessProxy.cpp:
        (WebKit::GPUProcessProxy::gpuProcessCrashed):
        * UIProcess/WebContextClient.cpp:
        (WebKit::WebContextClient::serviceWorkerProcessDidCrash):
        (WebKit::WebContextClient::gpuProcessDidCrash):
        * UIProcess/WebContextClient.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::serviceWorkerProcessCrashed):
        (WebKit::WebProcessPool::gpuProcessCrashed):
        * UIProcess/WebProcessPool.h:

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

        Deprecate _WKWebsitePolicies
        https://bugs.webkit.org/show_bug.cgi?id=205539

        Reviewed by Wenson Hsieh.

        Its last use was removed in rdar://problem/58064847
        but we need to keep it in WebKit until the next Safari release
        to keep Safari working with built versions of open source WebKit with run-safari.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _updateWebsitePolicies:]):
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
        * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):

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

        NetworkResourceLoader::didFinishWithRedirectResponse should not assume the load is coming from network
        https://bugs.webkit.org/show_bug.cgi?id=205715

        Reviewed by Alex Christensen.

        Covered by updated test.

        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::didFinishWithRedirectResponse):
        If redirection is coming from cache, the load is not null.
        We just need to use the request URL since the redirection mode is manual.

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

        Unreviewed, drop new assertion added in r253984 which hits on OpenSource bots

        * Shared/ios/DependencyProcessAssertionIOS.mm:
        (WebKit::DependencyProcessAssertion::DependencyProcessAssertion):

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

        Improve release logging in ServiceWorkerFetchTask
        https://bugs.webkit.org/show_bug.cgi?id=205692

        Reviewed by Youenn Fablet.

        Improve release logging in ServiceWorkerFetchTask to facilitate debugging.

        * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp:
        (WebKit::ServiceWorkerFetchTask::ServiceWorkerFetchTask):
        (WebKit::ServiceWorkerFetchTask::~ServiceWorkerFetchTask):
        (WebKit::ServiceWorkerFetchTask::start):
        (WebKit::ServiceWorkerFetchTask::contextClosed):
        (WebKit::ServiceWorkerFetchTask::startFetch):
        (WebKit::ServiceWorkerFetchTask::didReceiveRedirectResponse):
        (WebKit::ServiceWorkerFetchTask::didReceiveResponse):
        (WebKit::ServiceWorkerFetchTask::didFinish):
        (WebKit::ServiceWorkerFetchTask::didFail):
        (WebKit::ServiceWorkerFetchTask::didNotHandle):
        (WebKit::ServiceWorkerFetchTask::cannotHandle):
        (WebKit::ServiceWorkerFetchTask::cancelFromClient):
        (WebKit::ServiceWorkerFetchTask::continueDidReceiveFetchResponse):
        (WebKit::ServiceWorkerFetchTask::continueFetchTaskWith):
        (WebKit::ServiceWorkerFetchTask::timeoutTimerFired):
        (WebKit::ServiceWorkerFetchTask::softUpdateIfNeeded):

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

        Fix non-libwebrtc builds after r253957
        https://bugs.webkit.org/show_bug.cgi?id=205714

        Unreviewed.

        * GPUProcess/webrtc/LibWebRTCCodecsProxy.mm:
        Move the includes inside the compilation guard.

2020-01-02  Keith Rollin  <krollin@apple.com>

        Reformat WebProcess logging
        https://bugs.webkit.org/show_bug.cgi?id=205691
        <rdar://problem/58283294>

        Reviewed by Chris Dumez.

        Update the format used by WebProcess in its RELEASE_LOG logging. Use
        the format used by WebPageProxy and NetworkResourceLoader, which is
        generally of the form:

            <object-address> - [<values that help thread together operations>] <class>::<method>: <message and other useful values>

        So, for example:

            0x6f1df7000 - WebProcess::destroyRenderingResources() took 0.02ms

        becomes:

            0x6f1df7000 - [sessionID=2] WebProcess::destroyRenderingResources: took 0.02ms

        While we're at it, also convert over to the RELEASE_LOG_IF_ALLOWED
        style of logging macro. We didn't used to be able to do this since the
        decision on whether or not to allow logging is typically based on
        SessionID, which didn't used to be an attribute of WebProcess. Now
        WebProcesses do (or can) have a SessionID, so use that to support the
        hiding of logging in private sessions.

        No new tests - no added or changed functionality.

        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::initializeWebProcess):
        (WebKit::WebProcess::prepareToSuspend):
        (WebKit::WebProcess::markAllLayersVolatile):
        (WebKit::WebProcess::freezeAllLayerTrees):
        (WebKit::WebProcess::unfreezeAllLayerTrees):
        (WebKit::WebProcess::processDidResume):
        (WebKit::WebProcess::grantUserMediaDeviceSandboxExtensions):
        (WebKit::WebProcess::revokeUserMediaDeviceSandboxExtensions):
        * WebProcess/WebProcess.h:
        (WebKit::WebProcess::isAlwaysOnLoggingAllowed):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::updateProcessName):
        (WebKit::WebProcess::updateCPUMonitorState):
        (WebKit::WebProcess::destroyRenderingResources):
        (WebKit::WebProcess::updateFreezerStatus):

2020-01-02  Yusuke Suzuki  <ysuzuki@apple.com> and Simon Fraser  <simon.fraser@apple.com>

        Experiment: create lots of different malloc zones for easier accounting of memory use
        https://bugs.webkit.org/show_bug.cgi?id=186422

        Reviewed by Saam Barati.

        * Shared/ShareableBitmap.cpp:
        (WebKit::ShareableBitmap::create):
        (WebKit::ShareableBitmap::~ShareableBitmap):
        * UIProcess/mac/LegacySessionStateCoding.cpp:
        (WebKit::HistoryEntryDataEncoder::HistoryEntryDataEncoder):
        (WebKit::HistoryEntryDataEncoder::finishEncoding):
        (WebKit::encodeSessionHistoryEntryData):
        (WebKit::encodeLegacySessionState):

2020-01-02  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-01-02  Keith Rollin  <krollin@apple.com>

        Reformat WebProcessCache logging
        https://bugs.webkit.org/show_bug.cgi?id=205683
        <rdar://problem/58269352>

        Reviewed by Alex Christensen.

        Update the format used by WebProcessCache in its RELEASE_LOG logging.
        Use the format used by WebPageProxy and NetworkResourceLoader, which
        is generally of the form:

            <object-address> - [<values that help thread together operations>] <class>::<method>: <message and other useful values>

        So, for example:

            0x1145ed208 - WebProcessCache::canCacheProcess(): Not caching process 83671 because it does not have an associated registrable domain

        becomes:

            0x1145ed208 - [PID=83671] WebProcessCache::canCacheProcess: Not caching process because it does not have an associated registrable domain

        No new tests - no added or changed functionality.

        * UIProcess/WebProcessCache.cpp:
        (WebKit::WebProcessCache::canCacheProcess const):
        (WebKit::WebProcessCache::addProcessIfPossible):
        (WebKit::WebProcessCache::addProcess):
        (WebKit::WebProcessCache::takeProcess):
        (WebKit::WebProcessCache::updateCapacity):
        (WebKit::WebProcessCache::clear):
        (WebKit::WebProcessCache::clearAllProcessesForSession):
        (WebKit::WebProcessCache::setApplicationIsActive):
        (WebKit::WebProcessCache::removeProcess):

2020-01-02  Keith Rollin  <krollin@apple.com>

        Reformat ProcessThrottler logging
        https://bugs.webkit.org/show_bug.cgi?id=205679
        <rdar://problem/58265958>

        Reviewed by Alex Christensen.

        Update the format used by ProcessThrottler in its RELEASE_LOG logging.
        Use the format used by WebPageProxy and NetworkResourceLoader, which
        is generally of the form:

            <object-address> - [<values that help thread together operations>] <class>::<method>: <message and other useful values>

        So, for example:

            [PID: 0] 0x1145ce5e8 - ProcessThrottler::invalidateAllActivities() BEGIN

        becomes:

            0x1145ce5e8 - [PID: 0] ProcessThrottler::invalidateAllActivities: BEGIN

        No new tests - no added or changed functionality.

        * UIProcess/ProcessThrottler.cpp:
        (WebKit::ProcessThrottler::invalidateAllActivities):
        (WebKit::ProcessThrottler::setAssertionState):
        (WebKit::ProcessThrottler::updateAssertionIfNeeded):
        (WebKit::ProcessThrottler::didConnectToProcess):
        (WebKit::ProcessThrottler::prepareToSuspendTimeoutTimerFired):
        (WebKit::ProcessThrottler::processReadyToSuspend):
        (WebKit::ProcessThrottler::sendPrepareToSuspendIPC):
        (WebKit::ProcessThrottler::uiAssertionWillExpireImminently):
        * UIProcess/ProcessThrottler.h:
        (WebKit::ProcessThrottler::Activity::Activity):
        (WebKit::ProcessThrottler::Activity::invalidate):

2020-01-02  Keith Rollin  <krollin@apple.com>

        Reformat WebResourceLoader logging
        https://bugs.webkit.org/show_bug.cgi?id=205680
        <rdar://problem/58266105>

        Reviewed by Alex Christensen.

        Update the format used by WebResourceLoader in its RELEASE_LOG
        logging. Use the format used by WebPageProxy and
        NetworkResourceLoader, which is generally of the form:

            <object-address> - [<values that help thread together operations>] <class>::<method>: <message and other useful values>

        So, for example:

            0x4a1dbcb58 - WebResourceLoader::didFinishResourceLoad: (webPageID=15, frameID=3, resourceID=1, length=212132)

        becomes:

            0x4a1dbcb58 - [webPageID=15, frameID=3, resourceID=1] WebResourceLoader::didFinishResourceLoad: (length=212132)

        No new tests - no added or changed functionality.

        * WebProcess/Network/WebResourceLoader.cpp:
        (WebKit::WebResourceLoader::willSendRequest):
        (WebKit::WebResourceLoader::didReceiveResponse):
        (WebKit::WebResourceLoader::didReceiveData):
        (WebKit::WebResourceLoader::didFinishResourceLoad):
        (WebKit::WebResourceLoader::serviceWorkerDidNotHandle):
        (WebKit::WebResourceLoader::didFailResourceLoad):
        (WebKit::WebResourceLoader::didBlockAuthenticationChallenge):
        (WebKit::WebResourceLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied):
        (WebKit::WebResourceLoader::didReceiveResource):

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

        Add SPI to disable CORS on requests to URLs matching a pattern
        https://bugs.webkit.org/show_bug.cgi?id=205534
        <rdar://problem/58011337>

        Reviewed by Chris Dumez.

        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:
        * UIProcess/API/APIPageConfiguration.cpp:
        (API::PageConfiguration::copy const):
        (API::PageConfiguration::PageConfiguration): Deleted.
        (API::PageConfiguration::~PageConfiguration): Deleted.
        * UIProcess/API/APIPageConfiguration.h:
        (API::PageConfiguration::corsDisablingPatterns const):
        (API::PageConfiguration::setCORSDisablingPatterns):
        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
        (-[WKWebViewConfiguration _corsDisablingPatterns]):
        (-[WKWebViewConfiguration _setCORSDisablingPatterns:]):
        * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
        * UIProcess/WebPageProxy.cpp:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_overriddenMediaType):

2020-01-02  Sam Weinig  <weinig@apple.com>

        Simplify StringBuilder API/align with makeString by removing appendFixed* functions and using FormatNumber struct instead
        https://bugs.webkit.org/show_bug.cgi?id=205671

        Reviewed by Alex Christensen.

        * NetworkProcess/cache/NetworkCache.cpp:
        (WebKit::NetworkCache::Cache::dumpContentsToFile):
        * NetworkProcess/cache/NetworkCacheEntry.cpp:
        (WebKit::NetworkCache::Entry::asJSON const):
        * Shared/Gamepad/GamepadData.cpp:
        (WebKit::GamepadData::loggingString const):
        Replace all uses of builder.appendFixedPrecisionNumber(...) with builder.append(FormattedNumber::fixedPrecision(...)).

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

        [GTK] Make ondemand hardware acceleration policy never leave AC mode
        https://bugs.webkit.org/show_bug.cgi?id=205558

        Reviewed by Sergio Villar Senin.

        We still enter AC mode on demand but we never leave it for the same drawing area. This avoids scrolling
        performance problems with some websites that start small accelerated animation while scrolling (like WebKit
        bugzilla review tool), due to constant enter/leave AC mode.

        * UIProcess/API/glib/WebKitSettings.cpp:
        (webkit_settings_class_init): Update API documentation.
        * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
        (WebKit::DrawingAreaCoordinatedGraphics::enterAcceleratedCompositingMode): Force AC mode the first time we enter it.

2019-12-22  Jeff Miller  <jeffm@apple.com>

        Update user-visible copyright strings to include 2020
        https://bugs.webkit.org/show_bug.cgi?id=205552

        Reviewed by Darin Adler.

        * GPUProcess/EntryPoint/Cocoa/XPCService/GPUService/Info-OSX.plist:
        * GPUProcess/EntryPoint/Cocoa/XPCService/GPUService/Info-iOS.plist:
        * Info.plist:
        * NetworkProcess/EntryPoint/Cocoa/XPCService/NetworkService/Info-OSX.plist:
        * NetworkProcess/EntryPoint/Cocoa/XPCService/NetworkService/Info-iOS.plist:
        * PluginProcess/EntryPoint/Cocoa/XPCService/PluginService.64.Info.plist:
        * WebProcess/EntryPoint/Cocoa/XPCService/WebContentService/Info-OSX.plist:
        * WebProcess/EntryPoint/Cocoa/XPCService/WebContentService/Info-iOS.plist:

2019-12-31  Peng Liu  <peng.liu6@apple.com>

        Add remote media resource loader for the GPU process
        https://bugs.webkit.org/show_bug.cgi?id=205379

        Reviewed by Youenn Fablet.

        In the GPU process, the RemoteMediaResourceLoader creates RemoteMediaResource(s),
        which will notify the media resource clients (WebCoreNSURLSessionDataTaskClient).
        Then the data will be forwarded to AVFoundation.

        In the Web process, MeidaResourceLoader creates MediaResource(s), which take care of
        downloading media data through the network process. The received data will be forwarded to
        RemoteMediaResourceProxy, which will forward the data to the corresponding RemoteMediaResource
        through XPC messages.

        (WebKit::GPUConnectionToWebProcess::remoteMediaResourceManager):
        (WebKit::GPUConnectionToWebProcess::didReceiveMessage):
        * GPUProcess/GPUConnectionToWebProcess.h:
        * GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp:
        * GPUProcess/media/RemoteMediaPlayerManagerProxy.h:
        * GPUProcess/media/RemoteMediaPlayerProxy.cpp:
        (WebKit::RemoteMediaPlayerProxy::~RemoteMediaPlayerProxy):
        (WebKit::RemoteMediaPlayerProxy::requestResource):
        (WebKit::RemoteMediaPlayerProxy::removeResource):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerCreateResourceLoader):
        * GPUProcess/media/RemoteMediaPlayerProxy.h:
        (WebKit::RemoteMediaPlayerProxy::~RemoteMediaPlayerProxy): Deleted.
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerLogIdentifier): Deleted.
        * GPUProcess/media/RemoteMediaResource.cpp: Added.
        (WebKit::RemoteMediaResource::create):
        (WebKit::RemoteMediaResource::RemoteMediaResource):
        (WebKit::RemoteMediaResource::~RemoteMediaResource):
        (WebKit::RemoteMediaResource::stop):
        (WebKit::RemoteMediaResource::didPassAccessControlCheck const):
        (WebKit::RemoteMediaResource::responseReceived):
        (WebKit::RemoteMediaResource::redirectReceived):
        (WebKit::RemoteMediaResource::shouldCacheResponse):
        (WebKit::RemoteMediaResource::dataSent):
        (WebKit::RemoteMediaResource::dataReceived):
        (WebKit::RemoteMediaResource::accessControlCheckFailed):
        (WebKit::RemoteMediaResource::loadFailed):
        (WebKit::RemoteMediaResource::loadFinished):
        * GPUProcess/media/RemoteMediaResource.h: Added.
        (WebKit::RemoteMediaResource::ready const):
        (WebKit::RemoteMediaResource::setReady):
        * GPUProcess/media/RemoteMediaResourceIdentifier.h: Added.
        * GPUProcess/media/RemoteMediaResourceLoader.cpp: Added.
        (WebKit::RemoteMediaResourceLoader::RemoteMediaResourceLoader):
        (WebKit::RemoteMediaResourceLoader::~RemoteMediaResourceLoader):
        (WebKit::RemoteMediaResourceLoader::requestResource):
        * GPUProcess/media/RemoteMediaResourceLoader.h: Added.
        * GPUProcess/media/RemoteMediaResourceManager.cpp: Added.
        (WebKit::RemoteMediaResourceManager::RemoteMediaResourceManager):
        (WebKit::RemoteMediaResourceManager::~RemoteMediaResourceManager):
        (WebKit::RemoteMediaResourceManager::addMediaResource):
        (WebKit::RemoteMediaResourceManager::removeMediaResource):
        (WebKit::RemoteMediaResourceManager::responseReceived):
        (WebKit::RemoteMediaResourceManager::redirectReceived):
        (WebKit::RemoteMediaResourceManager::dataSent):
        (WebKit::RemoteMediaResourceManager::dataReceived):
        (WebKit::RemoteMediaResourceManager::accessControlCheckFailed):
        (WebKit::RemoteMediaResourceManager::loadFailed):
        (WebKit::RemoteMediaResourceManager::loadFinished):
        * GPUProcess/media/RemoteMediaResourceManager.h: Added.
        * GPUProcess/media/RemoteMediaResourceManager.messages.in: Added.
        * WebProcess/GPU/GPUProcessConnection.h:
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
        (WebKit::MediaPlayerPrivateRemote::MediaPlayerPrivateRemote):
        (WebKit::MediaPlayerPrivateRemote::requestResource):
        (WebKit::MediaPlayerPrivateRemote::removeResource):
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.h:
        * WebProcess/GPU/media/MediaPlayerPrivateRemoteIdentifier.h:
        * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp:
        (WebKit::RemoteMediaPlayerManager::supportsTypeAndCodecs):
        (WebKit::RemoteMediaPlayerManager::originsInMediaCache):
        (WebKit::RemoteMediaPlayerManager::clearMediaCacheForOrigins):
        (WebKit::RemoteMediaPlayerManager::networkStateChanged):
        (WebKit::RemoteMediaPlayerManager::readyStateChanged):
        (WebKit::RemoteMediaPlayerManager::volumeChanged):
        (WebKit::RemoteMediaPlayerManager::muteChanged):
        (WebKit::RemoteMediaPlayerManager::timeChanged):
        (WebKit::RemoteMediaPlayerManager::durationChanged):
        (WebKit::RemoteMediaPlayerManager::rateChanged):
        (WebKit::RemoteMediaPlayerManager::playbackStateChanged):
        (WebKit::RemoteMediaPlayerManager::engineFailedToLoad):
        (WebKit::RemoteMediaPlayerManager::requestResource):
        (WebKit::RemoteMediaPlayerManager::removeResource):
        * WebProcess/GPU/media/RemoteMediaPlayerManager.h:
        (WebKit::RemoteMediaPlayerManager::didReceiveMessageFromGPUProcess):
        (WebKit::RemoteMediaPlayerManager::didReceiveMessageFromWebProcess): Deleted.
        * WebProcess/GPU/media/RemoteMediaPlayerManager.messages.in:
        * WebProcess/GPU/media/RemoteMediaResourceProxy.cpp: Added.
        (WebKit::RemoteMediaResourceProxy::RemoteMediaResourceProxy):
        (WebKit::RemoteMediaResourceProxy::~RemoteMediaResourceProxy):
        (WebKit::RemoteMediaResourceProxy::responseReceived):
        (WebKit::RemoteMediaResourceProxy::redirectReceived):
        (WebKit::RemoteMediaResourceProxy::shouldCacheResponse):
        (WebKit::RemoteMediaResourceProxy::dataSent):
        (WebKit::RemoteMediaResourceProxy::dataReceived):
        (WebKit::RemoteMediaResourceProxy::accessControlCheckFailed):
        (WebKit::RemoteMediaResourceProxy::loadFailed):
        (WebKit::RemoteMediaResourceProxy::loadFinished):
        * WebProcess/GPU/media/RemoteMediaResourceProxy.h: Added.

2019-12-31  youenn fablet  <youenn@apple.com>

        Implement RTC VTB decoders in GPUProcess
        https://bugs.webkit.org/show_bug.cgi?id=205607

        Reviewed by Eric Carlson.

        Implement decoder factory callbacks.
        Implement WebProcess codecs by sending IPC for creating/releasing/decoding a frame.
        WebProcess receives IPC messages from GPU Process whenever a frame is decoded.

        * Configurations/WebKit.xcconfig:
        * DerivedSources-input.xcfilelist:
        * DerivedSources-output.xcfilelist:
        * DerivedSources.make:
        * GPUProcess/GPUConnectionToWebProcess.cpp:
        (WebKit::GPUConnectionToWebProcess::libWebRTCCodecsProxy):
        (WebKit::GPUConnectionToWebProcess::didReceiveMessage):
        * GPUProcess/GPUConnectionToWebProcess.h:
        * GPUProcess/webrtc/LibWebRTCCodecsProxy.h: Added.
        (WebKit::LibWebRTCCodecsProxy::didReceiveMessageFromWebProcess):
        * GPUProcess/webrtc/LibWebRTCCodecsProxy.messages.in: Added.
        * GPUProcess/webrtc/LibWebRTCCodecsProxy.mm: Added.
        (WebKit::LibWebRTCCodecsProxy::LibWebRTCCodecsProxy):
        (WebKit::LibWebRTCCodecsProxy::~LibWebRTCCodecsProxy):
        (WebKit::LibWebRTCCodecsProxy::createDecoder):
        (WebKit::LibWebRTCCodecsProxy::releaseDecoder):
        (WebKit::LibWebRTCCodecsProxy::decodeFrame):
        * Scripts/webkit/messages.py:
        * Sources.txt:
        * SourcesCocoa.txt:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/GPU/GPUProcessConnection.cpp:
        (WebKit::GPUProcessConnection::didReceiveMessage):
        * WebProcess/GPU/webrtc/LibWebRTCCodecs.cpp: Added.
        (WebKit::createVideoDecoder):
        (WebKit::releaseVideoDecoder):
        (WebKit::decodeVideoFrame):
        (WebKit::registerDecodeCompleteCallback):
        (WebKit::LibWebRTCCodecs::setVideoDecoderCallbacks):
        (WebKit::LibWebRTCCodecs::createDecoder):
        (WebKit::LibWebRTCCodecs::releaseDecoder):
        (WebKit::LibWebRTCCodecs::decodeFrame):
        (WebKit::LibWebRTCCodecs::registerDecodeFrameCallback):
        (WebKit::LibWebRTCCodecs::failedDecoding):
        (WebKit::LibWebRTCCodecs::completedDecoding):
        * WebProcess/GPU/webrtc/LibWebRTCCodecs.h: Added.
        * WebProcess/GPU/webrtc/LibWebRTCCodecs.messages.in: Added.
        * WebProcess/GPU/webrtc/RTCDecoderIdentifier.h: Added.
        * WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
        (WebKit::LibWebRTCProvider::createDecoderFactory):
        * WebProcess/Network/webrtc/LibWebRTCProvider.h:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::libWebRTCCodecs):
        * WebProcess/WebProcess.h:

2019-12-30  Brady Eidson  <beidson@apple.com>

        Add WKWebView SPI to evaluate a function with arguments
        https://bugs.webkit.org/show_bug.cgi?id=205239

        Reviewed by Alex Christensen.

        * Shared/API/APISerializedScriptValue.h:

        * UIProcess/API/C/WKPage.cpp:
        (WKPageRunJavaScriptInMainFrame):

        * UIProcess/API/Cocoa/APISerializedScriptValueCocoa.mm:
        (API::sharedContext):
        (API::SerializedScriptValue::deserialize):
        (API::SerializedScriptValue::wireBytesFromNSObject):

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView evaluateJavaScript:completionHandler:]):
        (validateArgument):
        (-[WKWebView _evaluateJavaScript:asAsyncFunction:withArguments:forceUserGesture:completionHandler:]):
        (-[WKWebView _callAsyncFunction:withArguments:completionHandler:]):
        (-[WKWebView _evaluateJavaScriptWithoutUserGesture:completionHandler:]):
        (-[WKWebView _evaluateJavaScript:forceUserGesture:completionHandler:]): Deleted.
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:

        * UIProcess/API/glib/WebKitWebView.cpp:
        (webkit_web_view_run_javascript):
        (webkit_web_view_run_javascript_in_world):
        (resourcesStreamReadCallback):

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::runJavaScriptInMainFrame):
        (WebKit::WebPageProxy::runJavaScriptInMainFrameScriptWorld):
        * UIProcess/WebPageProxy.h:

        * UIProcess/socket/RemoteInspectorProtocolHandler.cpp:
        (WebKit::RemoteInspectorProtocolHandler::runScript):

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::runJavaScript):
        (WebKit::WebPage::runJavaScriptInMainFrameScriptWorld):
        (WebKit::WebPage::runJavaScriptInFrame):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2019-12-29  Peng Liu  <peng.liu6@apple.com>

        Tweak the format and comment in the code to support media in GPU process
        https://bugs.webkit.org/show_bug.cgi?id=205631

        Reviewed by Eric Carlson.

        No new tests, no functional change.

        * GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp:
        (WebKit::RemoteMediaPlayerManagerProxy::logChannel const):
        * GPUProcess/media/RemoteMediaPlayerManagerProxy.h:
        * GPUProcess/media/RemoteMediaPlayerProxy.h:
        * GPUProcess/media/RemoteMediaPlayerProxyConfiguration.h:
        * WebProcess/GPU/GPUProcessConnectionInfo.h:
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
        * WebProcess/GPU/media/MediaPlayerPrivateRemoteIdentifier.h:
        * WebProcess/GPU/media/RemoteMediaPlayerConfiguration.h:
        * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp:
        * WebProcess/GPU/media/RemoteMediaPlayerManager.messages.in:
        * WebProcess/GPU/media/RemoteMediaPlayerState.h:

2019-12-29  Eric Carlson  <eric.carlson@apple.com>

        Cleanup media IPC encoders
        https://bugs.webkit.org/show_bug.cgi?id=205630
        <rdar://problem/58232173>

        Reviewed by Anders Carlsson.

        * GPUProcess/media/RemoteMediaPlayerProxyConfiguration.h:
        (WebKit::RemoteMediaPlayerProxyConfiguration::decode):
        * WebProcess/GPU/media/RemoteMediaPlayerConfiguration.h:
        (WebKit::RemoteMediaPlayerConfiguration::decode):

2019-12-28  Antti Koivisto  <antti@apple.com>

        Make simple line layout an internal feature
        https://bugs.webkit.org/show_bug.cgi?id=205615

        Reviewed by Zalan Bujtas.

        So it can be enabled/disabled from run-webkit-tests command line.

        This also adds it to the internal feature menus, allowing removal of hardcoded menu entries.

        * Shared/WebPreferences.yaml:

2019-12-23  Darin Adler  <darin@apple.com>

        Refactor to simplify broadcasting to all media elements
        https://bugs.webkit.org/show_bug.cgi?id=205567

        Reviewed by Eric Carlson.

        * WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp:
        (WebKit::InjectedBundleHitTestResult::mediaType const): Use is<HTMLMediaElement>.

2019-12-26  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] Remove duplicated code
        https://bugs.webkit.org/show_bug.cgi?id=205560

        Reviewed by Sergio Villar Senin.

        Remove duplicated code related to IME between GTK and WPE that can be shared.

        * SourcesGTK.txt:
        * SourcesWPE.txt:
        * WebProcess/WebCoreSupport/glib/WebEditorClientGLib.cpp: Added.
        (WebKit::WebEditorClient::handleInputMethodKeydown):
        (WebKit::WebEditorClient::didDispatchInputMethodKeydown):
        * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
        * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp:
        * WebProcess/WebPage/glib/WebPageGLib.cpp:
        (WebKit::WebPage::setInputMethodState):
        * WebProcess/WebPage/gtk/WebPageGtk.cpp:
        * WebProcess/WebPage/wpe/WebPageWPE.cpp:

2019-12-24  Eric Carlson  <eric.carlson@apple.com>

        [Media in GPU process] Enable media player proxy logging
        https://bugs.webkit.org/show_bug.cgi?id=205557
        <rdar://problem/58160932>

        Reviewed by Youenn Fablet.

        * GPUProcess/GPUConnectionToWebProcess.cpp:
        (WebKit::GPUConnectionToWebProcess::create):
        (WebKit::GPUConnectionToWebProcess::GPUConnectionToWebProcess):
        (WebKit::GPUConnectionToWebProcess::logger):
        * GPUProcess/GPUConnectionToWebProcess.h:
        * GPUProcess/GPUProcess.cpp:
        (WebKit::GPUProcess::createGPUConnectionToWebProcess):
        * GPUProcess/GPUProcess.h:
        * GPUProcess/GPUProcess.messages.in:
        * GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp:
        (WebKit::RemoteMediaPlayerManagerProxy::logger const):
        (WebKit::nullLogger): Deleted.
        * Platform/Logging.h:
        * UIProcess/GPU/GPUProcessProxy.cpp:
        (WebKit::GPUProcessProxy::openGPUProcessConnection):
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
        (WebKit::MediaPlayerPrivateRemote::logChannel const):

2019-12-24  youenn fablet  <youenn@apple.com>

        Service Worker doesn't terminate after a period of time when thread blocking
        https://bugs.webkit.org/show_bug.cgi?id=202992
        <rdar://problem/56298596>

        Reviewed by Chris Dumez.

        Add a preference to enable/disable service worker short timeouts.
        Add IPC handling for passing service worker heart beat failures and to get from WebProcess
        whether a given service worker is running or not.

        * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
        (WebKit::WebSWServerConnection::contextConnectionCreated):
        (WebKit::WebSWServerConnection::syncTerminateWorkerFromClient):
        (WebKit::WebSWServerConnection::isServiceWorkerRunning):
        * NetworkProcess/ServiceWorker/WebSWServerConnection.h:
        * NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in:
        * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
        * Shared/WebPreferences.yaml:
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesGetServiceWorkerTestMode):
        (WKPreferencesSetServiceWorkerTestMode):
        * UIProcess/API/C/WKPreferencesRef.h:
        * WebProcess/Storage/WebSWClientConnection.cpp:
        (WebKit::WebSWClientConnection::isServiceWorkerRunning):
        * WebProcess/Storage/WebSWClientConnection.h:
        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        (WebKit::WebSWContextManagerConnection::updatePreferencesStore):
        (WebKit::WebSWContextManagerConnection::didFailHeartBeatCheck):
        * WebProcess/Storage/WebSWContextManagerConnection.h:

2019-12-23  Alexey Proskuryakov  <ap@apple.com>

        watchOS build fix attempt

        Not sure what broke the build, seems like UserInterfaceIdiom.h used to be included
        via unified build, and no longer is. Added the include.
        
        While at it, removed an ancient __IPHONE_OS_VERSION_MIN_REQUIRED version check.

        * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:

2019-12-23  Wenson Hsieh  <wenson_hsieh@apple.com>

        Unreviewed, fix the macCatalyst build after r253866

        * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp:
        (WebKit::RemoteMediaPlayerManager::createRemoteMediaPlayer):

        MediaPlayer::mediaKeysStorageDirectory() is guarded by ENABLE(LEGACY_ENCRYPTED_MEDIA).

2019-12-23  Carlos Garcia Campos  <cgarcia@igalia.com>

        WebDriver: fix handling of session timeouts for values higher than MAX_INT
        https://bugs.webkit.org/show_bug.cgi?id=204114

        Reviewed by Brian Burg.

        Use number instead of integer for all optional timeout parameters. In the case of script timeout, not passing a
        value means a timeout should not be used, so use Optional<double> also for the IPC message and handle the
        optional value in the web process to not set any timeout in that case.

        * UIProcess/Automation/Automation.json:
        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::waitForNavigationToComplete):
        (WebKit::WebAutomationSession::navigateBrowsingContext):
        (WebKit::WebAutomationSession::goBackInBrowsingContext):
        (WebKit::WebAutomationSession::goForwardInBrowsingContext):
        (WebKit::WebAutomationSession::reloadBrowsingContext):
        (WebKit::WebAutomationSession::evaluateJavaScriptFunction):
        * UIProcess/Automation/WebAutomationSession.h:
        * WebProcess/Automation/WebAutomationSessionProxy.cpp:
        (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction):
        * WebProcess/Automation/WebAutomationSessionProxy.h:
        * WebProcess/Automation/WebAutomationSessionProxy.js:
        (let.AutomationSessionProxy.prototype.evaluateJavaScriptFunction):
        * WebProcess/Automation/WebAutomationSessionProxy.messages.in:

2019-12-23  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] InputMethod API unit tests don't work under X11
        https://bugs.webkit.org/show_bug.cgi?id=205497

        Reviewed by Žan Doberšek.

        Assume the web view is always focused when running tests under Xvfb, since there isn't a window manager to focus
        the toplevel window in that case.

        * UIProcess/API/glib/InputMethodFilter.cpp:
        (WebKit::InputMethodFilter::isViewFocused const):

2019-12-23  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] Special combination characters doesn't respect the keystroke order when high CPU load
        https://bugs.webkit.org/show_bug.cgi?id=185248

        Reviewed by Žan Doberšek.

        Key events are queued by the WebPageProxy so that the next event is not sent to the web process until the
        previous one has been handled by the web process already. However, the composition results generated by key
        events are sent to the web process using IPC messages when they happen. In case of high CPU load it can happen
        that the composition results are sent to the web process even before the associated keys, that are still in the
        queue waiting to be sent. We need to ensure that composition results are always processed right after its
        associated key press event. So, instead of sending the results independently, we now include them as part of the
        key event.

        * Shared/NativeWebKeyboardEvent.h: Add optional preeditUnderlines and preeditSelectionRange parameters to constructor.
        * Shared/WebEvent.h:
        (WebKit::WebKeyboardEvent::preeditUnderlines const): Return the optional preeditUnderlines.
        (WebKit::WebKeyboardEvent::preeditSelectionRange const): Return the optional preeditSelectionRange.
        * Shared/WebEventConversion.cpp:
        (WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent): Copy preeditUnderlines and
        preeditSelectionRange too.
        * Shared/WebKeyboardEvent.cpp:
        (WebKit::WebKeyboardEvent::WebKeyboardEvent): Add optional preeditUnderlines and preeditSelectionRange
        parameters and initialize them.
        (WebKit::WebKeyboardEvent::encode const): Encode preeditUnderlines and preeditSelectionRange.
        (WebKit::WebKeyboardEvent::decode): Decode preeditUnderlines and preeditSelectionRange.
        * Shared/gtk/NativeWebKeyboardEventGtk.cpp:
        (WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent): Add optional preeditUnderlines and
        preeditSelectionRange parameters and initialize them.
        * Shared/gtk/WebEventFactory.cpp:
        (WebKit::WebEventFactory::createWebKeyboardEvent): Add optional preeditUnderlines and preeditSelectionRange
        parameters and pass them to WebKeyboardEvent constructor.
        * Shared/gtk/WebEventFactory.h:
        * Shared/libwpe/NativeWebKeyboardEventLibWPE.cpp:
        (WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent): Add optional preeditUnderlines and
        preeditSelectionRange parameters and initialize them.
        * Shared/libwpe/WebEventFactory.cpp:
        (WebKit::WebEventFactory::createWebKeyboardEvent): Add optional preeditUnderlines and preeditSelectionRang
        parameters and pass them to WebKeyboardEvent constructor.
        * Shared/libwpe/WebEventFactory.h: Add optional preeditUnderlines and preeditSelectionRange parameters to constructor.
        * UIProcess/API/glib/WebKitWebView.cpp:
        (webkitWebViewSynthesizeCompositionKeyPress): Pass the preeditUnderlines and preeditSelectionRange to platform
        implementation.
        (webkitWebViewSetComposition): Remove the call to WebPageProxy::setComposition().
        (webkitWebViewConfirmComposition): Remove the call to WebPageProxy::confirmComposition().
        (webkitWebViewCancelComposition): Call WebPageProxy::cancelComposition();
        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (webkitWebViewBaseKeyPressEvent): Pass the preeditUnderlines and preeditSelectionRange to NativeWebKeyboardEvent constructor.
        (webkitWebViewBaseKeyReleaseEvent): Ditto.
        (webkitWebViewBaseSynthesizeCompositionKeyPress): Ditto.
        * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
        * UIProcess/API/wpe/WPEView.cpp:
        (WKWPE::View::handleKeyboardEvent): Ditto.
        (WKWPE::View::synthesizeCompositionKeyPress): Ditto.
        * UIProcess/API/wpe/WPEView.h:
        * UIProcess/WebPageProxy.cpp:
        * UIProcess/WebPageProxy.h:
        * WebProcess/WebCoreSupport/WebEditorClient.h:
        * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
        (WebKit::WebEditorClient::didDispatchInputMethodKeydown): Handle the composition results here, right after the
        associated key events has been dispatched.
        * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp:
        (WebKit::WebEditorClient::didDispatchInputMethodKeydown): Ditto.
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::cancelComposition): Confirm the given string to cancel the composition.
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in: Remove SetComposition message and rename ConfirmComposition as
        CancelComposition since it's now only used for canceling.

2019-12-22  Simon Fraser  <simon.fraser@apple.com>

        Make support for <dialog> an internal feature, off by default
        https://bugs.webkit.org/show_bug.cgi?id=205542

        Reviewed by Antti Koivisto.

        Make DialogElementEnabled an internal feature so it shows up in the menus and
        can be toggled on for experimentation.

        * Shared/WebPreferences.yaml:

2019-12-21  Simon Fraser  <simon.fraser@apple.com>

        Make support for <dialog> an experimental feature, off by default
        https://bugs.webkit.org/show_bug.cgi?id=205542

        Reviewed by Dean Jackson.

        Make DialogElementEnabled an experimental feature (off by default).

        * Shared/WebPreferences.yaml:

2019-12-21  Simon Fraser  <simon.fraser@apple.com>

        Make support for <dialog> an experimental feature, off by default
        https://bugs.webkit.org/show_bug.cgi?id=205542

        Reviewed by Dean Jackson.

        Make DialogElementEnabled an experimental feature (off by default).

        * Shared/WebPreferences.yaml:

2019-12-22  Eric Carlson  <eric.carlson@apple.com>

        [Media in GPU process] Add remote media player proxy configuration
        https://bugs.webkit.org/show_bug.cgi?id=205547
        <rdar://problem/58139762>

        Reviewed by Tim Horton.

        * GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp:
        (WebKit::RemoteMediaPlayerManagerProxy::createMediaPlayer):
        * GPUProcess/media/RemoteMediaPlayerManagerProxy.h:
        * GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in:
        * GPUProcess/media/RemoteMediaPlayerProxy.cpp:
        (WebKit::RemoteMediaPlayerProxy::RemoteMediaPlayerProxy):
        (WebKit::RemoteMediaPlayerProxy::getConfiguration):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerMediaKeysStorageDirectory const):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerReferrer const):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerUserAgent const):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerSourceApplicationIdentifier const):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerNetworkInterfaceName const):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerMediaCacheDirectory const):
        (WebKit::RemoteMediaPlayerProxy::mediaContentTypesRequiringHardwareSupport const):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerPreferredAudioCharacteristics const):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerShouldUsePersistentCache const):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerIsVideo const):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerKeyNeeded):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerGetRawCookies const):
        * GPUProcess/media/RemoteMediaPlayerProxy.h:
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerLogIdentifier):
        * GPUProcess/media/RemoteMediaPlayerProxyConfiguration.h: Added.
        (WebKit::RemoteMediaPlayerProxyConfiguration::encode const):
        (WebKit::RemoteMediaPlayerProxyConfiguration::decode):
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
        (WebKit::MediaPlayerPrivateRemote::MediaPlayerPrivateRemote):
        (WebKit::MediaPlayerPrivateRemote::engineDescription const):
        (WebKit::MediaPlayerPrivateRemote::supportsScanning const):
        (WebKit::MediaPlayerPrivateRemote::supportsPictureInPicture const):
        (WebKit::MediaPlayerPrivateRemote::supportsAcceleratedRendering const):
        (WebKit::MediaPlayerPrivateRemote::canPlayToWirelessPlaybackTarget const):
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.h:
        * WebProcess/GPU/media/RemoteMediaPlayerConfiguration.h: Added.
        (WebKit::RemoteMediaPlayerConfiguration::encode const):
        (WebKit::RemoteMediaPlayerConfiguration::decode):
        * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp:
        (WebKit::RemoteMediaPlayerManager::createRemoteMediaPlayer):

2019-12-21  Brian Burg  <bburg@apple.com>

        Web Inspector: add InspectedTargetTypes diagnostic event and related hooks
        https://bugs.webkit.org/show_bug.cgi?id=205174
        <rdar://problem/57887953>

        Reviewed by Devin Rousso.

        This change supplies Web Inspector with information about the debuggable that
        it is connected to. This is used for diagnostics and to customize the UI based
        on the target type being inspected.

        For remote Web Inspector, WebKit clients can populate an instance of 
        _WKInspectorDebuggableInfo and use it when calling into
        -[_WKRemoteWebInspectorViewController loadForDebuggable:backendCommandsURL:].

        For local Web Inspector, WebInspectorProxy fills in information for the local
        debuggable by consulting SystemVersion.plist (on Mac port).

        The new enum _WKInspectorDebuggableType replaces _WKRemoteWebInspectorDebuggableType.
        Its WebCore equivalent is Inspector::DebuggableType. The type and other information
        are carried around in a _WKInspectorDebuggableInfo class. The equivalents for this
        class are API::DebuggableInfo and DebuggableInfoData (for sending over IPC).

        The DebuggableInfoData is sent as part of the initial message from UIProcess
        to an Inspector WebProcess, similar to how a debuggableType string was sent before.

        * Sources.txt:
        * SourcesCocoa.txt:
        * WebKit.xcodeproj/project.pbxproj:
        Add new files.

        * Shared/API/APIObject.h:
        * Shared/Cocoa/APIObject.mm:
        (API::Object::newObject): Add new object type.
        * Shared/WebCoreArgumentCoders.h: Add EnumTraits for Inspector::DebuggableType.

        * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewControllerPrivate.h:
        * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm:
        (legacyDebuggableTypeToModernDebuggableType):
        (-[_WKRemoteWebInspectorViewController loadForDebuggableType:backendCommandsURL:]):
        (-[_WKRemoteWebInspectorViewController loadForDebuggable:backendCommandsURL:]):
        (debuggableTypeString): Deleted.
        Use the new enum in a new method that clients can switch over to. The old method
        can be removed when it is no longer being used.

        * UIProcess/RemoteWebInspectorProxy.h:
        * UIProcess/RemoteWebInspectorProxy.cpp:
        (WebKit::RemoteWebInspectorProxy::RemoteWebInspectorProxy):
        (WebKit::RemoteWebInspectorProxy::load):
        (WebKit::RemoteWebInspectorProxy::reopen):
        Send DebuggableInfoData struct to RemoteWebInspectorUI.

        * UIProcess/WebInspectorProxy.h:
        * UIProcess/WebInspectorProxy.cpp:
        (WebKit::WebInspectorProxy::openLocalInspectorFrontend):
        (WebKit::WebInspectorProxy::infoForLocalDebuggable):
        Send DebuggableInfoData struct to WebInspectorUI.

        * UIProcess/mac/WebInspectorProxyMac.mm:
        (WebKit::systemVersionPlist):
        (WebKit::WebInspectorProxy::infoForLocalDebuggable):
        Add Mac implementation for local debuggables.

        * UIProcess/gtk/WebInspectorProxyGtk.cpp:
        (WebKit::WebInspectorProxy::infoForLocalDebuggable):
        * UIProcess/win/WebInspectorProxyWin.cpp:
        (WebKit::WebInspectorProxy::infoForLocalDebuggable):
        * UIProcess/wpe/WebInspectorProxyWPE.cpp:
        (WebKit::WebInspectorProxy::infoForLocalDebuggable):
        Add stubs for other platforms.

        * UIProcess/glib/RemoteInspectorClient.cpp:
        * UIProcess/socket/RemoteInspectorClient.h:
        * UIProcess/socket/RemoteInspectorClient.cpp:
        (WebKit::RemoteInspectorClient::inspect):
        (WebKit::debuggableTypeToString):
        (WebKit::RemoteInspectorClient::setTargetList):
        Use Inspector::DebuggableType instead of String for debuggable type.

        * WebProcess/WebPage/RemoteWebInspectorUI.messages.in:
        * WebProcess/WebPage/RemoteWebInspectorUI.h:
        * WebProcess/WebPage/RemoteWebInspectorUI.cpp:
        (WebKit::RemoteWebInspectorUI::initialize):
        (WebKit::RemoteWebInspectorUI::debuggableType const):
        (WebKit::RemoteWebInspectorUI::targetPlatformName const):
        (WebKit::RemoteWebInspectorUI::targetBuildVersion const):
        (WebKit::RemoteWebInspectorUI::targetProductVersion const):
        (WebKit::RemoteWebInspectorUI::targetIsSimulator const):
        Implement new methods needed by InspectorFrontendClient / InspectorFrontendHost.

        * WebProcess/WebPage/WebInspectorUI.messages.in:
        * WebProcess/WebPage/WebInspectorUI.h:
        * WebProcess/WebPage/WebInspectorUI.cpp:
        (WebKit::WebInspectorUI::establishConnection):
        (WebKit::WebInspectorUI::targetPlatformName const):
        (WebKit::WebInspectorUI::targetBuildVersion const):
        (WebKit::WebInspectorUI::targetProductVersion const):
        Implement new methods needed by InspectorFrontendClient / InspectorFrontendHost. 

2019-12-21  Eric Carlson  <eric.carlson@apple.com>

        [Media in GPU process] Add remote media player configuration
        https://bugs.webkit.org/show_bug.cgi?id=205541
        <rdar://problem/58137418>

        Reviewed by Simon Fraser.

        * GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp:
        (WebKit::RemoteMediaPlayerManagerProxy::createMediaPlayer):
        * GPUProcess/media/RemoteMediaPlayerManagerProxy.h:
        * GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in:
        * GPUProcess/media/RemoteMediaPlayerProxy.cpp:
        (WebKit::RemoteMediaPlayerProxy::RemoteMediaPlayerProxy):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerMediaKeysStorageDirectory const):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerReferrer const):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerUserAgent const):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerSourceApplicationIdentifier const):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerNetworkInterfaceName const):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerMediaCacheDirectory const):
        (WebKit::RemoteMediaPlayerProxy::mediaContentTypesRequiringHardwareSupport const):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerPreferredAudioCharacteristics const):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerShouldUsePersistentCache const):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerIsVideo const):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerKeyNeeded):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerGetRawCookies const):
        * GPUProcess/media/RemoteMediaPlayerProxy.h:
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerLogIdentifier):
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp:
        (WebKit::RemoteMediaPlayerManager::createRemoteMediaPlayer):

2019-12-21  Kate Cheney  <katherine_cheney@apple.com>

        Add timeStamp to ITP database
        https://bugs.webkit.org/show_bug.cgi?id=205121
        <rdar://problem/57633021>

        Reviewed by John Wilander.

        This patch adds support for collecting most-recently-updated
        timestamps for third-party/first-party domain pairs in the ITP database.
        It updates the timestamp when new statistics are merged into the
        database. It then exposes the timestamp via the
        _getResourceLoadStatisticsDataSummary API.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        (WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore):
        (WebKit::ResourceLoadStatisticsDatabaseStore::prepareStatements):
        (WebKit::ResourceLoadStatisticsDatabaseStore::insertDomainRelationshipList):
        Changed INSERT OR IGNORE queries to be INSERT OR REPLACE so the timestamp
        will be replaced upon a new attempted insert into one of the
        third-party/first-party relationship tables.
        ResourceLoadStatisticsDatabaseStore::insertDomainRelationshipList now
        checks for the keyword "REPLACE" to know if another bind is needed
        to update the timestamp.

        (WebKit::ResourceLoadStatisticsDatabaseStore::getMostRecentlyUpdatedTimestamp):
        Queries the most recent time that the third party has appeared as a
        subframe or subresource under the first party or redirected to the first party.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
        (WebKit::ThirdPartyDataForSpecificFirstParty::toString const):
        Updated the toString to check if the timestamp occured in the last
        24 hours for testing purposes. It doesn't print the specific time
        because it would change for every run and could not be tested.

        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _setUseITPDatabase:completionHandler:]):
        Added new function that enables the ITP Database backend so the
        timestamp parameter can be tested in in TestWebKitAPI.

        * UIProcess/API/APIResourceLoadStatisticsFirstParty.h:
        * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
        * UIProcess/API/Cocoa/_WKResourceLoadStatisticsFirstParty.h:
        * UIProcess/API/Cocoa/_WKResourceLoadStatisticsFirstParty.mm:
        (-[_WKResourceLoadStatisticsFirstParty timeLastUpdated]):
        Added the new timestamp parameter to the _WKResourceLoadStatisticsFirstParty.mm
        class and its wrapper to be sent via API call.

2019-12-20  Eric Carlson  <eric.carlson@apple.com>

        [Media in GPU process] Get audio playing
        https://bugs.webkit.org/show_bug.cgi?id=205511
        <rdar://problem/58120354>

        Reviewed by Jer Noble.

        * GPUProcess/media/RemoteMediaPlayerManagerProxy.h:
        * GPUProcess/media/RemoteMediaPlayerProxy.h:
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
        (WebKit::MediaPlayerPrivateRemote::updateCachedState):
        (WebKit::MediaPlayerPrivateRemote::maximumDurationToCacheMediaTime const):
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.h:
        * WebProcess/GPU/media/RemoteMediaPlayerManager.h:

2019-12-20  Jer Noble  <jer.noble@apple.com>

        Enable HDR Media Capabilities by default
        https://bugs.webkit.org/show_bug.cgi?id=205518
        <rdar://problem/57674289>

        Reviewed by Eric Carlson.

        * Shared/WebPreferences.yaml:

2019-12-20  Tim Horton  <timothy_horton@apple.com>

        Clean up and generalize some interaction additions
        https://bugs.webkit.org/show_bug.cgi?id=205430

        Reviewed by Wenson Hsieh.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView setupInteraction]):
        (-[WKContentView cleanupInteraction]):

2019-12-20  Tim Horton  <timothy_horton@apple.com>

        Expose approximate caret extents for the hit line via InteractionInformationAtPosition
        https://bugs.webkit.org/show_bug.cgi?id=205526
        <rdar://problem/57983076>

        Reviewed by Dean Jackson.

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::positionInformation):
        Compute and expose the union of first and last caret rects on the line.

        * Shared/ios/InteractionInformationAtPosition.h:
        * Shared/ios/InteractionInformationAtPosition.mm:
        (WebKit::InteractionInformationAtPosition::encode const):
        (WebKit::InteractionInformationAtPosition::decode):
        * Shared/ios/InteractionInformationRequest.cpp:
        (WebKit::InteractionInformationRequest::encode const):
        (WebKit::InteractionInformationRequest::decode):
        (WebKit::InteractionInformationRequest::isValidForRequest):
        * Shared/ios/InteractionInformationRequest.h:
        Also, add a bit so that we can only fetch this data when needed.

2019-12-20  Brent Fulgham  <bfulgham@apple.com>

        Remove access to 'com.apple.cfprefsd.agent' from the macOS sandbox
        https://bugs.webkit.org/show_bug.cgi?id=205478
        <rdar://problem/57915066>

        Reviewed by Darin Adler.

        Telemetry and thorough testing has confirmed that we do not need access to this
        mach service, and so should remove it.

        Tested by fast/sandboxing/mac

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

2019-12-20  Brian Burg  <bburg@apple.com>

        Unreviewed, try to fix the non-unified sources build.

        * UIProcess/WebAuthentication/Mock/MockAuthenticatorManager.cpp:
        (WebKit::MockAuthenticatorManager::filterTransports const):
        The current chunking of unified source files seems to provide a
        'using namespace WebCore' for these references to AuthenticatorTransport.
        Add a namespace qualification so that this file compiles by itself.

2019-12-20  James Savage  <james.savage@apple.com>

        Include WKPDFConfiguration, WKFindConfiguration, and WKFindResult in umbrella header
        https://bugs.webkit.org/show_bug.cgi?id=205432
        <rdar://problem/58067946>

        Reviewed by Wenson Hsieh.

        * Shared/API/Cocoa/WebKit.h: Include new headers.

2019-12-20  Brian Burg  <bburg@apple.com>

        Web Inspector: convert some InspectorFrontendHost methods to getters
        https://bugs.webkit.org/show_bug.cgi?id=205475

        Reviewed by Devin Rousso.

        No reason for these to be method calls, so expose as getters / attributes instead.

        * WebProcess/WebPage/gtk/WebInspectorUIGtk.cpp:
        (WebKit::WebInspectorUI::localizedStringsURL const):
        (WebKit::RemoteWebInspectorUI::localizedStringsURL const):
        (WebKit::WebInspectorUI::localizedStringsURL): Deleted.
        (WebKit::RemoteWebInspectorUI::localizedStringsURL): Deleted.
        * WebProcess/WebPage/mac/WebInspectorUIMac.mm:
        (WebKit::WebInspectorUI::localizedStringsURL const):
        (WebKit::RemoteWebInspectorUI::localizedStringsURL const):
        (WebKit::WebInspectorUI::localizedStringsURL): Deleted.
        (WebKit::RemoteWebInspectorUI::localizedStringsURL): Deleted.
        * WebProcess/WebPage/win/WebInspectorUIWin.cpp:
        (WebKit::WebInspectorUI::localizedStringsURL const):
        (WebKit::RemoteWebInspectorUI::localizedStringsURL const):
        (WebKit::WebInspectorUI::localizedStringsURL): Deleted.
        (WebKit::RemoteWebInspectorUI::localizedStringsURL): Deleted.
        * WebProcess/WebPage/wpe/WebInspectorUIWPE.cpp:
        (WebKit::WebInspectorUI::localizedStringsURL const):
        (WebKit::RemoteWebInspectorUI::localizedStringsURL const):
        (WebKit::WebInspectorUI::localizedStringsURL): Deleted.
        (WebKit::RemoteWebInspectorUI::localizedStringsURL): Deleted.

2019-12-20  Alex Christensen  <achristensen@webkit.org>

        Allow a managed configuration to re-enable TLS 1.0 and 1.1
        https://bugs.webkit.org/show_bug.cgi?id=205479
        <rdar://problem/54493516>

        Reviewed by Geoffrey Garen.

        * Platform/spi/ios/ManagedConfigurationSPI.h: Removed.
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeNetworkProcess):
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::parameters):
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView canPerformActionForWebView:withSender:]):
        (-[WKContentView _defineForWebView:]):
        * WebKit.xcodeproj/project.pbxproj:

2019-12-20  youenn fablet  <youenn@apple.com>

        Set whether to use mock capture devices at GPUProcess creation time.
        https://bugs.webkit.org/show_bug.cgi?id=205492

        Reviewed by Eric Carlson.

        This ensures UIProcess remains always in sync with GPUProcess.
        Covered by fast/mediastream/captureAudioInGPUProcess.html.

        * GPUProcess/GPUProcess.cpp:
        (WebKit::GPUProcess::initializeGPUProcess):
        (WebKit::GPUProcess::setMockCaptureDevicesEnabled):
        * GPUProcess/GPUProcess.h:
        * GPUProcess/GPUProcessCreationParameters.cpp:
        (WebKit::GPUProcessCreationParameters::encode const):
        (WebKit::GPUProcessCreationParameters::decode):
        * GPUProcess/GPUProcessCreationParameters.h:
        * UIProcess/GPU/GPUProcessProxy.cpp:
        (WebKit::GPUProcessProxy::singleton):

2019-12-19  Brent Fulgham  <bfulgham@apple.com>

        Log telemetry for IOUserClient lookups
        https://bugs.webkit.org/show_bug.cgi?id=205463
        <rdar://problem/57987372>

        Reviewed by Per Arne Vollan.

        This patch adds some telemetry for IOKit classes.

        No new tests. No change in behavior.

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

2019-12-19  Chris Dumez  <cdumez@apple.com>

        Use a WeakHashSet for WKProcessAssertionBackgroundTaskManager._assertionsNeedingBackgroundTask
        https://bugs.webkit.org/show_bug.cgi?id=205471

        Reviewed by Ryosuke Niwa.

        Use a WeakHashSet for WKProcessAssertionBackgroundTaskManager._assertionsNeedingBackgroundTask, instead
        of a HashSet of raw pointers, for extra safety.

        * UIProcess/ios/ProcessAssertionIOS.mm:
        (-[WKProcessAssertionBackgroundTaskManager removeAssertionNeedingBackgroundTask:]):
        (-[WKProcessAssertionBackgroundTaskManager _notifyAssertionsOfImminentSuspension]):
        (-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]):

2019-12-19  Brent Fulgham  <bfulgham@apple.com>

        Unblock iokit-get-property needed for frame buffer initialization
        https://bugs.webkit.org/show_bug.cgi?id=205468
        <rdar://problem/57897684>

        Reviewed by Per Arne Vollan.

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

2019-12-19  Brent Fulgham  <bfulgham@apple.com>

        Add telemetry to macOS WebContent sandbox
        https://bugs.webkit.org/show_bug.cgi?id=205464
        <rdar://problem/58087833>

        Reviewed by Per Arne Vollan.

        Add telemetry to various mach lookups, like we did for iOS.

        No new tests. No change in behavior.

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

2019-12-19  Per Arne Vollan  <pvollan@apple.com>

        REGRESSION (r253530): Incorrect colors in Dark Mode
        https://bugs.webkit.org/show_bug.cgi?id=205457

        Unreviewed rollout of r253530.

        * 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):

2019-12-19  Alex Christensen  <achristensen@webkit.org>

        Deprecate _WKRemoteObjectInterface methods without ofReply:
        https://bugs.webkit.org/show_bug.cgi?id=205073

        Reviewed by Timothy Hatcher.

        Using them makes it hard to figure out how to add classes allowed for the reply,
        and there's a comment saying to deprecate them, so let's do it.

        * Shared/API/Cocoa/_WKRemoteObjectInterface.h:

2019-12-19  Brent Fulgham  <bfulgham@apple.com>

        WebContent process does not need access to 'com.apple.system.logger'
        https://bugs.webkit.org/show_bug.cgi?id=205411
        <rdar://problem/56966080>

        Reviewed by Per Arne Vollan.

        Telemetry and thorough testing has confirmed that we do not need access to this
        mach service, and so should remove it.

        Tested by fast/sandbox.

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

2019-12-19  Brent Fulgham  <bfulgham@apple.com>

        Deny mach lookup access to "com.apple.TextInput" in the WebContent process
        https://bugs.webkit.org/show_bug.cgi?id=205423
        <rdar://problem/56990842>

        Reviewed by Per Arne Vollan.

        Telemetry and thorough testing has confirmed that we do not need access to this
        mach service, and so should remove it.

        Tested by fast/sandbox/ios/sandbox-mach-lookup.html.

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

2019-12-19  youenn fablet  <youenn@apple.com>

        CacheStorageEngine should not clear caches memory representation for ephemeral sessions
        https://bugs.webkit.org/show_bug.cgi?id=205332

        Reviewed by Chris Dumez.

        * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
        (WebKit::CacheStorage::Caches::dispose):
        We cannot dispose an ephemeral cache memory representation
        since it can be reopened by a page with the same session.

2019-12-19  Brent Fulgham  <bfulgham@apple.com>

        Deny mach lookup access to "com.apple.pluginkit.pkd" in the WebContent process
        https://bugs.webkit.org/show_bug.cgi?id=205421
        <rdar://problem/56995585>

        Reviewed by Per Arne Vollan.

        Telemetry and thorough testing has confirmed that we do not need access to this
        mach service, and so should remove it.

        Tested by fast/sandbox/ios/sandbox-mach-lookup.html.

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

2019-12-19  Brent Fulgham  <bfulgham@apple.com>

        Remove syscall filtering from GPU Process sandbox 
        https://bugs.webkit.org/show_bug.cgi?id=205456
        <rdar://problem/58080834>

        Reviewed by Tim Horton.

        We don't have a fully built-out GPU Process yet. Let's not lock down the syscall filter set until
        we know which are actually needed by the process. The current set is just copied over from the
        WebContent process, and are not likely to be the correct set.

        * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in:
        * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb:

2019-12-19  Chris Dumez  <cdumez@apple.com>

        imported/w3c/web-platform-tests/service-workers/service-worker/skip-waiting-installed.https.html is flaky
        https://bugs.webkit.org/show_bug.cgi?id=205408

        Reviewed by Youenn Fablet.

        * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
        (WebKit::WebSWServerToContextConnection::didFinishSkipWaiting): Deleted.
        * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
        * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        (WebKit::WebSWContextManagerConnection::skipWaiting):
        (WebKit::WebSWContextManagerConnection::didFinishSkipWaiting): Deleted.
        * WebProcess/Storage/WebSWContextManagerConnection.h:
        * WebProcess/Storage/WebSWContextManagerConnection.messages.in:

2019-12-19  Chris Dumez  <cdumez@apple.com>

        Stop blocking the worker thread in WorkerMessagePortChannelProvider::postMessageToRemote()
        https://bugs.webkit.org/show_bug.cgi?id=205414

        Reviewed by Youenn Fablet.

        * WebProcess/WebCoreSupport/WebMessagePortChannelProvider.cpp:
        (WebKit::WebMessagePortChannelProvider::postMessageToRemote):
        * WebProcess/WebCoreSupport/WebMessagePortChannelProvider.h:

2019-12-19  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] Add initial API for input method
        https://bugs.webkit.org/show_bug.cgi?id=204679

        Reviewed by Žan Doberšek.

        In the case of GTK port, it allows to use a custom IM instead of GtkIMContext that it's still used by
        default. In the case of WPE it brings IM support, but there's no default implementation so applications need to
        provide their own.

        * PlatformGTK.cmake: Add new public header WebKitInputMethodContext.h.
        * PlatformWPE.cmake: Ditto.
        * Shared/EditorState.cpp:
        (WebKit::EditorState::PostLayoutData::encode const): Encode caretRectAtStart for WPE too.
        (WebKit::EditorState::PostLayoutData::decode): Decode caretRectAtStart for WPE too.
        (WebKit::operator<<): Dump caretRectAtStart for WPE too.
        * Shared/EditorState.h: Define caretRectAtStart for WPE too.
        * Shared/NativeWebKeyboardEvent.h:
        (WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent): Remove FakedForComposition parameter for GTK and add
        HandledByInputMethod to WPE.
        * Shared/WebEvent.h:
        * Shared/WebKeyboardEvent.cpp:
        (WebKit::WebKeyboardEvent::WebKeyboardEvent): Add handledByInputMethod parameter for WPE.
        (WebKit::WebKeyboardEvent::encode const): Encode m_handledByInputMethod in WPE too.
        (WebKit::WebKeyboardEvent::decode): Decode m_handledByInputMethod in WPE too.
        * Shared/gtk/NativeWebKeyboardEventGtk.cpp:
        (WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent): Remove FakedForComposition and the redundant members
        that are already in the bcase class or no longer needed.
        * Shared/libwpe/NativeWebKeyboardEventLibWPE.cpp:
        (WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent): Add text and handledByInputMethod parameters
        * Shared/libwpe/WebEventFactory.cpp:
        (WebKit::WebEventFactory::createWebKeyboardEvent): Use the given text if not null and pass handledByInputMethod,
        to WebKeyboardEvent.
        * Shared/libwpe/WebEventFactory.h:
        * SourcesGTK.txt: Add new files to compilation.
        * SourcesWPE.txt: Ditto.
        * UIProcess/API/glib/InputMethodFilter.cpp: Added.
        (WebKit::InputMethodFilter::~InputMethodFilter):
        (WebKit::InputMethodFilter::preeditStartedCallback):
        (WebKit::InputMethodFilter::preeditChangedCallback):
        (WebKit::InputMethodFilter::preeditFinishedCallback):
        (WebKit::InputMethodFilter::committedCallback):
        (WebKit::InputMethodFilter::setContext):
        (WebKit::InputMethodFilter::setEnabled):
        (WebKit::InputMethodFilter::filterKeyEvent):
        (WebKit::InputMethodFilter::isViewFocused const):
        (WebKit::InputMethodFilter::notifyFocusedIn):
        (WebKit::InputMethodFilter::notifyFocusedOut):
        (WebKit::InputMethodFilter::notifyCursorRect):
        (WebKit::InputMethodFilter::preeditStarted):
        (WebKit::InputMethodFilter::preeditChanged):
        (WebKit::InputMethodFilter::preeditFinished):
        (WebKit::InputMethodFilter::committed):
        (WebKit::InputMethodFilter::cancelComposition):
        * UIProcess/API/glib/InputMethodFilter.h: Added.
        (WebKit::InputMethodFilter::context const):
        * UIProcess/API/glib/WebKitInputMethodContext.cpp: Added.
        (webkitInputMethodUnderlineGetCompositionUnderline):
        (webkit_input_method_underline_new):
        (webkit_input_method_underline_copy):
        (webkit_input_method_underline_free):
        (webkitInputMethodContextSetWebView):
        (webkitInputMethodContextGetWebView):
        (webkit_input_method_context_set_enable_preedit):
        (webkit_input_method_context_get_preedit):
        (webkit_input_method_context_notify_focus_in):
        (webkit_input_method_context_notify_focus_out):
        (webkit_input_method_context_notify_cursor_area):
        (webkit_input_method_context_reset):
        * UIProcess/API/glib/WebKitInputMethodContextPrivate.h: Added.
        (_WebKitInputMethodUnderline::_WebKitInputMethodUnderline):
        * UIProcess/API/glib/WebKitWebView.cpp:
        (webkitWebViewConstructed):
        (webkitWebViewSynthesizeCompositionKeyPress):
        (webkitWebViewSetComposition):
        (webkitWebViewConfirmComposition):
        (webkitWebViewCancelComposition):
        (webkit_web_view_set_input_method_context):
        (webkit_web_view_get_input_method_context):
        * UIProcess/API/glib/WebKitWebViewPrivate.h:
        * UIProcess/API/gtk/InputMethodFilterGtk.cpp: Added.
        (WebKit::InputMethodFilter::platformTransformCursorRectToViewCoordinates):
        (WebKit::InputMethodFilter::platformEventKeyIsKeyPress const):
        * UIProcess/API/gtk/PageClientImpl.cpp:
        (WebKit::PageClientImpl::doneWithKeyEvent): Remove the early return in case of fake event, composition events
        are always handled by the web process.
        * UIProcess/API/gtk/WebKitInputMethodContext.h: Added.
        * UIProcess/API/gtk/WebKitInputMethodContextGtk.cpp: Added.
        (webkit_input_method_underline_set_color):
        (webkit_input_method_context_filter_key_event):
        * UIProcess/API/gtk/WebKitInputMethodContextImplGtk.cpp: Added.
        (contextPreeditStartCallback):
        (contextPreeditChangedCallback):
        (contextPreeditEndCallback):
        (contextCommitCallback):
        (webkitInputMethodContextImplGtkConstructed):
        (webkitInputMethodContextImplGtkSetEnablePreedit):
        (webkitInputMethodContextImplGtkGetPreedit):
        (webkitInputMethodContextImplGtkFilterKeyEvent):
        (webkitInputMethodContextImplGtkNotifyFocusIn):
        (webkitInputMethodContextImplGtkNotifyFocusOut):
        (webkitInputMethodContextImplGtkNotifyCursorArea):
        (webkitInputMethodContextImplGtkReset):
        (webkit_input_method_context_impl_gtk_class_init):
        (webkitInputMethodContextImplGtkNew):
        (webkitInputMethodContextImplGtkSetClientWindow):
        * UIProcess/API/gtk/WebKitInputMethodContextImplGtk.h: Added.
        * UIProcess/API/gtk/WebKitWebView.h:
        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (webkitWebViewBaseRealize): If current IM filter is the default one, call webkitInputMethodContextImplGtkSetClientWindow().
        (webkitWebViewBaseUnrealize): Ditto.
        (webkitWebViewBaseDispose): Set a nullptr context on IM filter.
        (webkitWebViewBaseKeyPressEvent): Use the new IM filter that simplifies the code.
        (webkitWebViewBaseKeyReleaseEvent): Ditto.
        (webkitWebViewBaseHandleMouseEvent): Cancel composition in case of click.
        (webkitWebViewBaseCreateWebPage): The new IM filter doesn't need to know the page.
        (webkitWebViewBaseUpdateTextInputState): Use new IM filter API.
        (webkitWebViewBaseSetInputMethodContext): Set the IM filter context.
        (webkitWebViewBaseGetInputMethodContext): Get the IM filter context.
        (webkitWebViewBaseSynthesizeCompositionKeyPress): Synthesize a key event for composition.
        * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
        * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
        * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
        * UIProcess/API/gtk/webkit2.h:
        * UIProcess/API/wpe/InputMethodFilterWPE.cpp: Added.
        (WebKit::InputMethodFilter::platformTransformCursorRectToViewCoordinates):
        (WebKit::InputMethodFilter::platformEventKeyIsKeyPress const):
        * UIProcess/API/wpe/PageClientImpl.cpp:
        (WebKit::PageClientImpl::setInputMethodState):
        (WebKit::PageClientImpl::selectionDidChange):
        * UIProcess/API/wpe/PageClientImpl.h:
        * UIProcess/API/wpe/WPEView.cpp:
        (WKWPE::View::setInputMethodContext): Set the IM filter context.
        (WKWPE::View::inputMethodContext const): Get the IM filter context.
        (WKWPE::View::setInputMethodState): Enable or disable input methods.
        (WKWPE::View::selectionDidChange): Notify the IM filter about the cursor position change.
        (WKWPE::View::setViewState): Notify the IM filter about the focus change.
        (WKWPE::View::handleKeyboardEvent): Allow the IM filter to handle the key event.
        (WKWPE::View::synthesizeCompositionKeyPress): Synthesize a key event for composition.
        * UIProcess/API/wpe/WPEView.h:
        * UIProcess/API/wpe/WebKitInputMethodContext.h: Added.
        * UIProcess/API/wpe/WebKitInputMethodContextWPE.cpp: Added.
        (webkit_input_method_underline_set_color):
        (webkit_input_method_context_filter_key_event):
        * UIProcess/API/wpe/WebKitWebView.h:
        * UIProcess/API/wpe/docs/wpe-1.0-sections.txt:
        * UIProcess/API/wpe/docs/wpe-docs.sgml:
        * UIProcess/API/wpe/webkit.h:
        * UIProcess/PageClient.h:
        * UIProcess/WebPageProxy.cpp:
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/gtk/InputMethodFilter.cpp: Removed.
        * UIProcess/gtk/InputMethodFilter.h: Removed.
        * UIProcess/wpe/WebPageProxyWPE.cpp:
        (WebKit::WebPageProxy::updateEditorState): Save the editor state and notify about selection change.
        (WebKit::WebPageProxy::setInputMethodState): Notify the page client about the input method state.
        * WebProcess/WebCoreSupport/WebEditorClient.cpp:
        (WebKit::WebEditorClient::setInputMethodState): Implement this for WPE too.
        * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp:
        (WebKit::WebEditorClient::handleInputMethodKeydown): Use handledByInputMethod() now.
        * WebProcess/WebPage/WebPage.cpp:
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/wpe/WebPageWPE.cpp:
        (WebKit::WebPage::platformEditorState const): Save the current caret cursor rectangle in post layout data struct.
        (WebKit::WebPage::setInputMethodState): Send SetInputMethodState message to the UI process if state changed.

2019-12-19  Carlos Garcia Campos  <cgarcia@igalia.com>

        [CoordinatedGraphics] ThreadedDisplayRefreshMonitor is never released
        https://bugs.webkit.org/show_bug.cgi?id=205387

        Reviewed by Žan Doberšek.

        Update the window screen ID after creating the layer tree host to ensure that the call to
        createDisplayRefreshMonitor will create the ThreadedDisplayRefrershMonitor instead of the default one.

        * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
        (WebKit::DrawingAreaCoordinatedGraphics::enterAcceleratedCompositingMode): Use the dispalyID of the layer tree host.
        * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
        (WebKit::LayerTreeHost::LayerTreeHost): Initialize the display ID.
        * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h:

2019-12-18  Sihui Liu  <sihui_liu@apple.com>

        IndexedDB: perform IDBServer work only on background thread
        https://bugs.webkit.org/show_bug.cgi?id=203690
        <rdar://problem/56908496>

        Reviewed by Alex Christensen.

        * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
        (WebKit::WebIDBConnectionToClient::~WebIDBConnectionToClient):
        * NetworkProcess/IndexedDB/WebIDBServer.cpp:
        (WebKit::WebIDBServer::create):
        (WebKit::WebIDBServer::WebIDBServer):
        (WebKit::WebIDBServer::closeAndDeleteDatabasesModifiedSince):
        (WebKit::WebIDBServer::closeAndDeleteDatabasesForOrigins):
        (WebKit::WebIDBServer::suspend):
        (WebKit::WebIDBServer::resume):
        (WebKit::WebIDBServer::openDatabase):
        (WebKit::WebIDBServer::deleteDatabase):
        (WebKit::WebIDBServer::abortTransaction):
        (WebKit::WebIDBServer::commitTransaction):
        (WebKit::WebIDBServer::didFinishHandlingVersionChangeTransaction):
        (WebKit::WebIDBServer::createObjectStore):
        (WebKit::WebIDBServer::deleteObjectStore):
        (WebKit::WebIDBServer::renameObjectStore):
        (WebKit::WebIDBServer::clearObjectStore):
        (WebKit::WebIDBServer::createIndex):
        (WebKit::WebIDBServer::deleteIndex):
        (WebKit::WebIDBServer::renameIndex):
        (WebKit::WebIDBServer::putOrAdd):
        (WebKit::WebIDBServer::getRecord):
        (WebKit::WebIDBServer::getAllRecords):
        (WebKit::WebIDBServer::getCount):
        (WebKit::WebIDBServer::deleteRecord):
        (WebKit::WebIDBServer::openCursor):
        (WebKit::WebIDBServer::iterateCursor):
        (WebKit::WebIDBServer::establishTransaction):
        (WebKit::WebIDBServer::databaseConnectionPendingClose):
        (WebKit::WebIDBServer::databaseConnectionClosed):
        (WebKit::WebIDBServer::abortOpenAndUpgradeNeeded):
        (WebKit::WebIDBServer::didFireVersionChangeEvent):
        (WebKit::WebIDBServer::openDBRequestCancelled):
        (WebKit::WebIDBServer::getAllDatabaseNames):
        (WebKit::WebIDBServer::addConnection):
        (WebKit::WebIDBServer::removeConnection):
        (WebKit::WebIDBServer::postTask):
        (WebKit::WebIDBServer::dispatchToThread):
        (WebKit::WebIDBServer::registerConnection): Deleted.
        (WebKit::WebIDBServer::unregisterConnection): Deleted.
        (WebKit::WebIDBServer::confirmDidCloseFromServer): Deleted.
        * NetworkProcess/IndexedDB/WebIDBServer.h:
        * NetworkProcess/IndexedDB/WebIDBServer.messages.in:
        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::prepareToSuspend):
        * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
        (WebKit::WebIDBConnectionToServer::confirmDidCloseFromServer): Deleted.
        * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:

2019-12-18  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r253646.
        https://bugs.webkit.org/show_bug.cgi?id=205433

        "We think this may have caused a membuster regression, so
        rolling it out." (Requested by nham on #webkit).

        Reverted changeset:

        "Navigation from empty page doesn't use cached web process"
        https://bugs.webkit.org/show_bug.cgi?id=205015
        https://trac.webkit.org/changeset/253646

2019-12-18  Alex Christensen  <achristensen@webkit.org>

        Add SPI WKWebView._updateWebpagePreferences to replace _updateWebsitePolicies
        https://bugs.webkit.org/show_bug.cgi?id=205427

        Reviewed by Wenson Hsieh.

        This blocks the removal of _WKWebsitePolicies.
        This change is verified by an API test.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _updateWebsitePolicies:]):
        (-[WKWebView _updateWebpagePreferences:]):
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:

2019-12-18  Tim Horton  <timothy_horton@apple.com>

        macCatalyst: Cursor should update when the platform deems it necessary
        https://bugs.webkit.org/show_bug.cgi?id=205429
        <rdar://problem/57983076>

        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::WebPage::positionInformation):
        Expose the current cursor and caret size on position information so
        that macCatalyst UIKit can retrieve it out-of-band (in addition to
        setting it when we do a hit-test, like in r253636.

2019-12-18  Alex Christensen  <achristensen@webkit.org>

        Add ObjC version of WKBundleFrameIsMainFrame
        https://bugs.webkit.org/show_bug.cgi?id=205415

        Reviewed by Brian Weinstein.

        I need this for rdar://problem/57132290
        Covered by API tests.

        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h:
        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
        (-[WKWebProcessPlugInFrame isMainFrame]):
        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h:

2019-12-18  Eric Carlson  <eric.carlson@apple.com>

        Remove more unused MediaPlayer methods
        https://bugs.webkit.org/show_bug.cgi?id=205405
        <rdar://problem/58049744>

        Reviewed by Jer Noble.

        * GPUProcess/media/RemoteMediaPlayerProxy.cpp:
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerHandlePlaybackCommand): Deleted.
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerIsInMediaDocument const): Deleted.
        * GPUProcess/media/RemoteMediaPlayerProxy.h:

2019-12-18  youenn fablet  <youenn@apple.com>

        Add support for Audio Capture in GPUProcess
        https://bugs.webkit.org/show_bug.cgi?id=205056

        Reviewed by Eric Carlson.

        Make UserMediaCaptureManager and Proxy able to work with GPU process.
        Add support for capturing audio in the GPU process, this is limited to mock audio sources for now
        as we do not support AudioSession in the GPU process.
        Covered by rebased test.

        * GPUProcess/GPUConnectionToWebProcess.cpp:
        (WebKit::GPUConnectionToWebProcess::GPUConnectionToWebProcess):
        (WebKit::GPUConnectionToWebProcess::didReceiveMessage):
        (WebKit::GPUConnectionToWebProcess::didReceiveSyncMessage):
        * GPUProcess/GPUConnectionToWebProcess.h:
        * GPUProcess/GPUProcess.cpp:
        (WebKit::GPUProcess::setMockCaptureDevicesEnabled):
        * GPUProcess/GPUProcess.h:
        * GPUProcess/GPUProcess.messages.in:
        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
        (WebKit::UserMediaCaptureManagerProxy::UserMediaCaptureManagerProxy):
        (WebKit::UserMediaCaptureManagerProxy::~UserMediaCaptureManagerProxy):
        (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
        (WebKit::UserMediaCaptureManagerProxy::applyConstraints):
        (WebKit::UserMediaCaptureManagerProxy::clone):
        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
        (WebKit::UserMediaCaptureManagerProxy::didReceiveMessageFromGPUProcess):
        (WebKit::UserMediaCaptureManagerProxy::didReceiveSyncMessageFromGPUProcess):
        * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
        (WebKit::UserMediaPermissionRequestManagerProxy::syncWithWebCorePrefs const):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebProcessProxy.cpp:
        * WebProcess/GPU/GPUProcessConnection.cpp:
        (WebKit::GPUProcessConnection::didReceiveMessage):
        * WebProcess/GPU/GPUProcessConnection.h:
        * WebProcess/cocoa/UserMediaCaptureManager.cpp:
        (WebKit::UserMediaCaptureManager::Source::setShouldCaptureInGPUProcess):
        (WebKit::UserMediaCaptureManager::Source::shouldCaptureInGPUProcess const):
        (WebKit::UserMediaCaptureManager::Source::requestToEnd):
        (WebKit::UserMediaCaptureManager::createCaptureSource):
        (WebKit::UserMediaCaptureManager::sourceStopped):
        (WebKit::UserMediaCaptureManager::captureFailed):
        (WebKit::UserMediaCaptureManager::Source::connection):
        (WebKit::UserMediaCaptureManager::Source::startProducingData):
        (WebKit::UserMediaCaptureManager::Source::stopProducingData):
        (WebKit::UserMediaCaptureManager::Source::capabilities):
        (WebKit::UserMediaCaptureManager::Source::applyConstraints):
        (WebKit::UserMediaCaptureManager::sourceEnded):
        (WebKit::UserMediaCaptureManager::Source::hasEnded):
        (WebKit::UserMediaCaptureManager::Source::stopBeingObserved):
        (WebKit::UserMediaCaptureManager::AudioFactory::createAudioCaptureSource):
        * WebProcess/cocoa/UserMediaCaptureManager.h:
        (WebKit::UserMediaCaptureManager::didReceiveMessageFromGPUProcess):

2019-12-18  Ben Nham  <nham@apple.com>

        Add network loading signposts
        https://bugs.webkit.org/show_bug.cgi?id=204822
        <rdar://problem/57608824>

        Reviewed by Alex Christensen.

        This adds os_signposts related to network loads to aid in debugging networking performance
        issues. Since URLs are logged in the signposts, this capability is only enabled on Apple
        internal builds when an environment variable is set.

        * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        (WebKit::signpostLogHandle):
        (WebKit::signpostsEnabled):
        (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):

2019-12-18  youenn fablet  <youenn@apple.com>

        Refine RTCMonitor logging
        https://bugs.webkit.org/show_bug.cgi?id=205384

        Reviewed by Eric Carlson.

        Catch the case where the rtc thread is blocked in WebProcess and NetworkProcess.
        Add logging of 'this' so as to disambiguate the case of several pages doing RTC in parallel.
        No change of behavior.

        * NetworkProcess/webrtc/NetworkRTCMonitor.cpp:
        (WebKit::NetworkRTCMonitor::startUpdatingIfNeeded):
        (WebKit::NetworkRTCMonitor::stopUpdating):
        (WebKit::NetworkRTCMonitor::onNetworksChanged):
        * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
        (WebKit::NetworkRTCProvider::NetworkRTCProvider):
        (WebKit::NetworkRTCProvider::close):
        (WebKit::NetworkRTCProvider::createSocket):
        * NetworkProcess/webrtc/NetworkRTCProvider.h:
        (WebKit::NetworkRTCProvider::canLog const):
        * WebProcess/Network/webrtc/WebRTCMonitor.cpp:
        (WebKit::WebRTCMonitor::StartUpdating):
        (WebKit::WebRTCMonitor::StopUpdating):
        (WebKit::WebRTCMonitor::networksChanged):

2019-12-18  Kate Cheney  <katherine_cheney@apple.com>

        Only report prevalent domains in the ResourceLoadStatistics data summary API
        https://bugs.webkit.org/show_bug.cgi?id=205281
        <rdar://problem/57975017>

        Reviewed by Brent Fulgham.

        ResourceLoadStatisticsStore::aggregatedThirdPartyData() should only
        return prevalent third party domains.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:

2019-12-18  Brent Fulgham  <bfulgham@apple.com>

        Add syscall to GPU Process sandbox
        https://bugs.webkit.org/show_bug.cgi?id=205400
        <rdar://problem/58046272>

        Reviewed by Simon Fraser.

        This patch temporarily adds a syscall to the sandbox to work around a bug in the
        system Sandbox framework. We will remove this in Bug 205400 once that issue is
        resolved.

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

2019-12-18  Eric Carlson  <eric.carlson@apple.com>

        Enable generic cue API
        https://bugs.webkit.org/show_bug.cgi?id=205398
        <rdar://problem/58044492>

        Reviewed by Jon Lee.

        No new tests, covered by existing tests.

        * Shared/WebPreferences.yaml:

2019-12-18  Eric Carlson  <eric.carlson@apple.com>

        Remove unused MediaPlayer methods
        https://bugs.webkit.org/show_bug.cgi?id=205341
        <rdar://problem/58006776>

        Reviewed by Jer Noble.

        * GPUProcess/media/RemoteMediaPlayerProxy.cpp:
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerSawUnsupportedTracks): Deleted.
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerRepaint): Deleted.
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerAcceleratedCompositingEnabled): Deleted.
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerSetSize): Deleted.
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerIsPaused const): Deleted.
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerIsLooping const): Deleted.
        * GPUProcess/media/RemoteMediaPlayerProxy.h:
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
        (WebKit::MediaPlayerPrivateRemote::canLoadPoster const): Deleted.
        (WebKit::MediaPlayerPrivateRemote::setPoster): Deleted.
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.h:

2019-12-18  Simon Fraser  <simon.fraser@apple.com>

        Move m_exposedContentRect into the DelegatedScrollingGeometry optional
        https://bugs.webkit.org/show_bug.cgi?id=205377

        Reviewed by Tim Horton.
        
        ScrollView's m_exposedContentRect is only set for delegated scrolling, so move it into
        DelegatedScrollingGeometry and remove the iOS #ifdefs around it. Move the WAK/NSView-related
        code into platformExposedContentRect() for iOS WK1. Stub out exposedContentRect() functions
        on TiledCoreAnimationDrawingArea.        

        * WebProcess/WebPage/DrawingArea.h:
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
        (WebKit::RemoteLayerTreeDrawingArea::setExposedContentRect):
        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
        (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
        (WebKit::TiledCoreAnimationDrawingArea::activityStateDidChange):
        (WebKit::TiledCoreAnimationDrawingArea::setViewExposedRect):
        (WebKit::TiledCoreAnimationDrawingArea::exposedContentRect const):
        (WebKit::TiledCoreAnimationDrawingArea::setExposedContentRect):
        (WebKit::TiledCoreAnimationDrawingArea::adjustLayerFlushThrottling):

2019-12-18  Wenson Hsieh  <wenson_hsieh@apple.com>

        Enable the async clipboard API by default on macOS and iOS
        https://bugs.webkit.org/show_bug.cgi?id=205322
        <rdar://problem/55861627>

        Reviewed by Tim Horton.

        Enables the asynchronous clipboard API by default on Cocoa platforms.

        * Shared/WebPreferences.yaml:
        * Shared/WebPreferencesDefaultValues.h:

2019-12-18  Philippe Normand  <pnormand@igalia.com>

        [GTK][WebInspector] Support for saving remote data
        https://bugs.webkit.org/show_bug.cgi?id=204618

        Reviewed by Carlos Garcia Campos.

        Similarly to what landed already in r251069, the Remote
        WebInspector GTK client can now save data coming from the
        inspector server.

        * UIProcess/gtk/RemoteWebInspectorProxyGtk.cpp:
        (WebKit::RemoteWebInspectorProxy::platformSave):

2019-12-17  Joonghun Park  <jh718.park@samsung.com>

        Unreviewed. Remove the build warning below since r253452.
        warning: unused variable ‘isNewEntry’ [-Wunused-variable]

        No new tests, no new behavioral changes.

        * NetworkProcess/IndexedDB/WebIDBServer.cpp:
        (WebKit::WebIDBServer::addConnection):

2019-12-17  Per Arne Vollan  <pvollan@apple.com>

        Unreviewed build fix after r253661.

        * UIProcess/ios/forms/WKFileUploadPanel.mm:

2019-12-17  Per Arne Vollan  <pvollan@apple.com>

        [iOS] The WebContent process should not use API to get the user interface idiom
        https://bugs.webkit.org/show_bug.cgi?id=205236

        Reviewed by Brent Fulgham.

        This should be done in the UI process, since using the API in the WebContent process will connect to daemons
        we intend to block access to. Add a flag to the process creation parameters which indicates whether the user
        interface idiom is iPad or not. This flag will be set on the UI process side, and on the WebContent process
        side, this flag will be read and cached for later use.

        No new tests, covered by existing tests.

        * Platform/spi/ios/UIKitSPI.h:
        (currentUserInterfaceIdiomIsPad): Deleted.
        * Shared/UserInterfaceIdiom.h: Added.
        * Shared/UserInterfaceIdiom.mm: Added.
        (WebKit::userInterfaceIdiomIsPad):
        (WebKit::currentUserInterfaceIdiomIsPad):
        (WebKit::setCurrentUserInterfaceIdiomIsPad):
        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const):
        (WebKit::WebProcessCreationParameters::decode):
        * Shared/WebProcessCreationParameters.h:
        * Shared/ios/WebPreferencesDefaultValuesIOS.mm:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        * UIProcess/ios/SmartMagnificationController.mm:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKFormInputSession setAccessoryViewCustomButtonTitle:]):
        (-[WKContentView endEditingAndUpdateFocusAppearanceWithReason:]):
        (-[WKContentView _shouldShowAutomaticKeyboardUIIgnoringInputMode]):
        (-[WKContentView _zoomToRevealFocusedElement]):
        (-[WKContentView requiresAccessoryView]):
        (-[WKContentView _updateAccessory]):
        (shouldShowKeyboardForElement):
        (-[WKContentView _shouldUseLegacySelectPopoverDismissalBehavior]):
        * UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm:
        * UIProcess/ios/WebPageProxyIOS.mm:
        * UIProcess/ios/forms/WKFormColorControl.mm:
        (-[WKFormColorControl initWithView:]):
        * UIProcess/ios/forms/WKFormColorPicker.mm:
        * UIProcess/ios/forms/WKFormInputControl.mm:
        * UIProcess/ios/forms/WKFormSelectControl.mm:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):

2019-12-17  Eric Carlson  <eric.carlson@apple.com>

        Add remote media player methods for prepareToPlay, preload, private browsing mode, preserves pitch, and failed to load
        https://bugs.webkit.org/show_bug.cgi?id=205351
        <rdar://problem/58018451>

        Reviewed by Jer Noble.

        * GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp:
        (WebKit::RemoteMediaPlayerManagerProxy::prepareToPlay):
        (WebKit::RemoteMediaPlayerManagerProxy::setPreload):
        (WebKit::RemoteMediaPlayerManagerProxy::setPrivateBrowsingMode):
        (WebKit::RemoteMediaPlayerManagerProxy::setPreservesPitch):
        * GPUProcess/media/RemoteMediaPlayerManagerProxy.h:
        * GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in:
        * GPUProcess/media/RemoteMediaPlayerProxy.cpp:
        (WebKit::RemoteMediaPlayerProxy::prepareToPlay):
        (WebKit::RemoteMediaPlayerProxy::setPreload):
        (WebKit::RemoteMediaPlayerProxy::setPrivateBrowsingMode):
        (WebKit::RemoteMediaPlayerProxy::setPreservesPitch):
        * GPUProcess/media/RemoteMediaPlayerProxy.h:
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
        (WebKit::MediaPlayerPrivateRemote::prepareToPlay):
        (WebKit::MediaPlayerPrivateRemote::setPreservesPitch):
        (WebKit::MediaPlayerPrivateRemote::setPreload):
        (WebKit::MediaPlayerPrivateRemote::setPrivateBrowsingMode):
        (WebKit::MediaPlayerPrivateRemote::engineFailedToLoad):
        (WebKit::MediaPlayerPrivateRemote::platformErrorCode const): Deleted.
        (WebKit::MediaPlayerPrivateRemote::requiresImmediateCompositing const): Deleted.
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.h:
        * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp:
        (WebKit::RemoteMediaPlayerManager::engineFailedToLoad):
        * WebProcess/GPU/media/RemoteMediaPlayerManager.h:
        * WebProcess/GPU/media/RemoteMediaPlayerManager.messages.in:

2019-12-17  Kate Cheney  <katherine_cheney@apple.com>

        Add run-time flag for in-app browser privacy
        https://bugs.webkit.org/show_bug.cgi?id=205288
        <rdar://problem/57569206>

        Reviewed by John Wilander.

        * Shared/WebPreferences.yaml:

2019-12-17  Ben Nham  <nham@apple.com>

        Navigation from empty page doesn't use cached web process
        https://bugs.webkit.org/show_bug.cgi?id=205015
        <rdar://problem/57703742>

        Reviewed by Chris Dumez.

        When navigating from an empty page to another domain foo.com, we always use the source
        WebProcess (which is basically uninitialized) rather than using an already-initialized
        cached WebProcess that has navigated to foo.com. The cached WebProcess should probably be
        preferred since it has more relevant cached resources available to it (e.g. memory cache, JS
        bytecode cache, prewarmed fonts, ...).

        Added an API test.

        * UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h:
        * UIProcess/API/Cocoa/WKWebViewTesting.mm:
        (-[WKWebView _ensureRunningProcessForTesting]):
        Allows tests to force WebProcess to launch to an empty document for testing purposes. This
        matches the behavior of how Safari uses WKWebView.

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::processForNavigationInternal): Prefer cached web process over
        source process if the source process hasn't committed any loads.

2019-12-17  Benjamin Nham  <nham@apple.com>

        Drop support for NSURLCache callbacks in NetworkProcess
        https://bugs.webkit.org/show_bug.cgi?id=203344

        Reviewed by Alex Christensen.

        Remove the NSURLSession caching policy callback in NetworkProcess. It's no longer necessary since
        we don't use NSURLCache in NetworkProcess (https://bugs.webkit.org/show_bug.cgi?id=185990).

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (-[WKNetworkSessionDelegate URLSession:dataTask:willCacheResponse:completionHandler:]): Deleted.

2019-12-17  David Kilzer  <ddkilzer@apple.com>

        Remove SafeBrowsingResult
        <https://webkit.org/b/205296>

        Reviewed by Anders Carlsson.

        * UIProcess/Cocoa/SafeBrowsingResultCocoa.mm: Remove.
        * UIProcess/SafeBrowsingResult.h: Remove.

2019-12-17  youenn fablet  <youenn@apple.com>

        WebKitTestRunner should report GPU process crashes
        https://bugs.webkit.org/show_bug.cgi?id=205338

        Reviewed by Tim Horton.

        Expose a callback to notify of GPU process crash.
        No change of behavior.

        * UIProcess/API/C/WKContext.h:
        * UIProcess/GPU/GPUProcessProxy.cpp:
        (WebKit::GPUProcessProxy::gpuProcessCrashed):
        * UIProcess/WebContextClient.cpp:
        (WebKit::WebContextClient::gpuProcessDidCrash):
        * UIProcess/WebContextClient.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::gpuProcessCrashed):
        * UIProcess/WebProcessPool.h:

2019-12-17  Tim Horton  <timothy_horton@apple.com>

        macCatalyst: Cursor should update on mouse movement and style change
        https://bugs.webkit.org/show_bug.cgi?id=205317
        <rdar://problem/46793696>

        Reviewed by Anders Carlsson.

        * Configurations/WebKit.xcconfig:
        Link AppKit for NSCursor.

        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<Cursor>::decode):
        Enable Cursor encoders.

        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::setCursor):
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        * WebProcess/WebCoreSupport/WebChromeClient.h:
        Unifdef various things.
        Implement setCursor().

2019-12-17  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] IndexedDB directory set in WebsiteDataManager is ignored
        https://bugs.webkit.org/show_bug.cgi?id=205330

        Reviewed by Youenn Fablet.

        There are two problems here:

          1- WebKitWebsiteDataManager is no longer setting the indexedDB directory to the WebsiteDatastore
             configuration. It seems the code was removed by mistake in r249778 when rolling out r249768.
          2- The WebProcessPool is not considering the primary WebsiteDataStore for indexedDB configuration.

        Fixes: /webkit/WebKitWebsiteData/databases
               /webkit/WebKitWebsiteData/configuration

        * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
        (webkitWebsiteDataManagerGetDataStore):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):

2019-12-17  youenn fablet  <youenn@apple.com>

        Bump the priority of CacheStorageEngine write operations
        https://bugs.webkit.org/show_bug.cgi?id=205329

        Reviewed by Antti Koivisto.

        Introduce an IOChannel extra optional parameter to set the QOS.
        Use this parameter for IOChannels created by CacheStorageEngine when writing files to increase the priority to default.
        Increase the priority of the CacheStorageEngine background queue to default.
        No observable change of behavior except potential speed increase.

        * NetworkProcess/cache/CacheStorageEngine.cpp:
        (WebKit::CacheStorage::Engine::Engine):
        (WebKit::CacheStorage::Engine::writeFile):
        * NetworkProcess/cache/NetworkCacheIOChannel.h:
        (WebKit::NetworkCache::IOChannel::open):
        * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
        (WebKit::NetworkCache::dispatchQueueFromPriority):
        (WebKit::NetworkCache::IOChannel::IOChannel):
        (WebKit::NetworkCache::IOChannel::open):
        * NetworkProcess/cache/NetworkCacheIOChannelCurl.cpp:
        (WebKit::NetworkCache::IOChannel::open):
        * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
        (WebKit::NetworkCache::IOChannel::open):

2019-12-17  youenn fablet  <youenn@apple.com>

        WebKitTestRunner should report service worker process crashes
        https://bugs.webkit.org/show_bug.cgi?id=205267

        Reviewed by Chris Dumez.

        Expose a way for WTR to be notified of service worker process crashes.

        * UIProcess/API/C/WKContext.h:
        * UIProcess/WebContextClient.cpp:
        (WebKit::WebContextClient::serviceWorkerProcessDidCrash):
        * UIProcess/WebContextClient.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::serviceWorkerProcessCrashed):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):

2019-12-17  Chris Dumez  <cdumez@apple.com>

        Improve release logging in NetworkResourceLoader
        https://bugs.webkit.org/show_bug.cgi?id=205295

        Reviewed by Youenn Fablet.

        Improve release logging in NetworkResourceLoader to facilitate debugging of loading-related issues.

        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::start):
        (WebKit::NetworkResourceLoader::retrieveCacheEntry):
        (WebKit::NetworkResourceLoader::retrieveCacheEntryInternal):
        (WebKit::NetworkResourceLoader::startNetworkLoad):
        (WebKit::NetworkResourceLoader::cleanup):
        (WebKit::NetworkResourceLoader::convertToDownload):
        (WebKit::NetworkResourceLoader::abort):
        (WebKit::NetworkResourceLoader::didReceiveResponse):
        (WebKit::NetworkResourceLoader::didReceiveBuffer):
        (WebKit::NetworkResourceLoader::didFinishLoading):
        (WebKit::NetworkResourceLoader::didFailLoading):
        (WebKit::NetworkResourceLoader::didBlockAuthenticationChallenge):
        (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
        (WebKit::NetworkResourceLoader::continueWillSendRedirectedRequest):
        (WebKit::NetworkResourceLoader::didFinishWithRedirectResponse):
        (WebKit::NetworkResourceLoader::restartNetworkLoad):
        (WebKit::NetworkResourceLoader::continueWillSendRequest):
        (WebKit::NetworkResourceLoader::continueDidReceiveResponse):
        (WebKit::NetworkResourceLoader::tryStoreAsCacheEntry):
        (WebKit::NetworkResourceLoader::didReceiveMainResourceResponse):
        (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
        (WebKit::NetworkResourceLoader::sendResultForCacheEntry):
        (WebKit::NetworkResourceLoader::validateCacheEntry):
        (WebKit::NetworkResourceLoader::dispatchWillSendRequestForCacheEntry):
        (WebKit::NetworkResourceLoader::startWithServiceWorker):
        (WebKit::NetworkResourceLoader::serviceWorkerDidNotHandle):

2019-12-16  Simon Fraser  <simon.fraser@apple.com>

        Change 'delegatesPageScaling' from a Setting to a flag on ScrollView
        https://bugs.webkit.org/show_bug.cgi?id=205319

        Reviewed by Tim Horton.

        delegatesPageScaling() is never toggled at runtime (even by tests), and it should
        be a flag on FrameView just like delegatesScrolling (maybe in future the flags can merge).

        So remove the Setting, and have DrawingArea control whether page scaling is delegated.
        
        In WebKit1, WebFrameLoaderClient::transitionToCommittedForNewPage() turns on delegated
        page scaling for iOS.

        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
        * WebProcess/WebPage/DrawingArea.h:
        (WebKit::DrawingArea::usesDelegatedPageScaling const):
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
        (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
        * WebProcess/WebPage/ios/FindControllerIOS.mm:
        (WebKit::FindIndicatorOverlayClientIOS::drawRect):

2019-12-16  Wenson Hsieh  <wenson_hsieh@apple.com>

        -[UIWKDocumentContext markedTextRange] is wrong when the caret is not at the start of marked text
        https://bugs.webkit.org/show_bug.cgi?id=205302

        Reviewed by Tim Horton.

        Makes a few minor adjustments around marked text handling in document editing context request code.

        1. In the case where markedTextRects are requested, automatically expand the context range (i.e. contextBefore
        and contextAfter) to encompass the marked text. This fixes UIWKDocumentContext's logic that computes the
        marked text range by subtracting `contextBefore` string's length from `selectedRangeInMarkedText`'s location.

        (Note that this still requires an adjustment in UIKit to actually respect `selectedRangeInMarkedText` when
        computing `markedTextRange`. This is tracked in <rdar://problem/57338528>).

        2. Stop clamping compositionStart and compositionEnd to the range of interest (in this case, the selection
        range, which is a collapsed caret selection). This makes the composition range seem as if it were empty, which
        prevents us from computing the marked text string (and importantly, its length).

        3. Flip the arguments to `distanceBetweenPositions`, such that we end up with a positive value for
        `selectedRangeInMarkedText` in the case where `compositionStart` is before `startOfRangeOfInterestInSelection`.

        Test: DocumentEditingContext.RequestMarkedTextRectsAndTextOnly

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

2019-12-16  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Issue mach lookup extension to diagnostics daemon
        https://bugs.webkit.org/show_bug.cgi?id=205292

        Reviewed by Brent Fulgham.

        For internal installs, issue a mach lookup extension to the diagnostics daemon.

        * 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::isInternalInstall):
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):

2019-12-16  Daniel Bates  <dabates@apple.com>

        Reproducible case of backwards nextParagraph returning a position ahead of the input position
        https://bugs.webkit.org/show_bug.cgi?id=196127
        <rdar://problem/49135890>

        Reviewed by Wenson Hsieh.

        Remove workaround now that WebCore::nextParagraphBoundaryInDirection() behaves correctly.

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

2019-12-16  youenn fablet  <youenn@apple.com>

        Make ServiceWorkerSoftUpdateLoader::loadWithCacheEntry more robust
        https://bugs.webkit.org/show_bug.cgi?id=205202
        rdar://problem/57852910

        Reviewed by Chris Dumez.

        In case loading an entry from the cache, we were calling didReceiveResponse,
        which may destroy the loader and then continue processing.
        Instead, add a processResponse method that checks the response and returns an error if needed.
        didReceiveResponse calls this method and returns early in case of error.
        So does the method loading data from the cache.

        Covered by existing tests.

        * NetworkProcess/ServiceWorker/ServiceWorkerSoftUpdateLoader.cpp:
        (WebKit::ServiceWorkerSoftUpdateLoader::loadWithCacheEntry):
        (WebKit::ServiceWorkerSoftUpdateLoader::didReceiveResponse):
        (WebKit::ServiceWorkerSoftUpdateLoader::processResponse):
        * NetworkProcess/ServiceWorker/ServiceWorkerSoftUpdateLoader.h:

2019-12-16  Antti Koivisto  <antti@apple.com>

        Remove display:contents feature flag
        https://bugs.webkit.org/show_bug.cgi?id=205276

        Reviewed by Ryosuke Niwa.

        * Shared/WebPreferences.yaml:
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetDisplayContentsEnabled): Deleted.
        (WKPreferencesGetDisplayContentsEnabled): Deleted.
        * UIProcess/API/C/WKPreferencesRefPrivate.h:

2019-12-16  Wenson Hsieh  <wenson_hsieh@apple.com>

        Fix API availability for -_getResourceLoadStatisticsDataSummary: after r253484
        https://bugs.webkit.org/show_bug.cgi?id=205256

        Reviewed by Alex Christensen.

        Replaces WK_API_AVAILABLE(macos(10.15), ios(13.0)) with WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA)),
        since this is new WebKit SPI that hasn't made its way into the SDK.

        * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:

2019-12-16  Daniel Bates  <dabates@apple.com>

        -requestDocumentContext always returns 1 text unit more granularity than requested
        https://bugs.webkit.org/show_bug.cgi?id=205142
        <rdar://problem/57858236>

        Reviewed by Darin Adler and Wenson Hsieh.

        Use WebCore::atBoundaryOfGranularity() to identify each boundary so that we return the position
        exactly granularityCount text units advanced from the specified position. When using sentence
        granularity we do not need to round the resulting position to the nearest word because it already
        falls before the next word (if there is one). For all other granularities we do what we do now
        and round to the nearest word, which may cross that granularity's boundary.

        Additionally, added assertions to ensure that we are passed a non-zero granularity count and a non-
        null initial position. The function takes advantage of these assumptions to 1) ensure correct results
        and 2) make use of a do-while loop.

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

2019-12-16  Simon Fraser  <simon.fraser@apple.com>

        Let the DrawingArea decide whether scrolling is delegated
        https://bugs.webkit.org/show_bug.cgi?id=205258

        Reviewed by Anders Carlsson.
        
        Delegated scrolling was hardcoded on for iOS WK2 (as it is for iOS WK1) and off for macOS,
        but if macOS is using RemoteLayerTreeDrawingArea that should also use delegated scrolling.
        
        Also make some DrawingArea functions const, and put m_frame->coreFrame()->view() into
        a local RefPtr in WebFrameLoaderClient::transitionToCommittedForNewPage().

        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
        * WebProcess/WebPage/DrawingArea.h:
        (WebKit::DrawingArea::supportsAsyncScrolling const):
        (WebKit::DrawingArea::usesDelegatedScrolling const):
        (WebKit::DrawingArea::shouldUseTiledBackingForFrameView const):
        (WebKit::DrawingArea::supportsAsyncScrolling): Deleted.
        (WebKit::DrawingArea::shouldUseTiledBackingForFrameView): Deleted.
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
        (WebKit::RemoteLayerTreeDrawingArea::shouldUseTiledBackingForFrameView const):
        (WebKit::RemoteLayerTreeDrawingArea::shouldUseTiledBackingForFrameView): Deleted.
        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
        (WebKit::TiledCoreAnimationDrawingArea::shouldUseTiledBackingForFrameView const):
        (WebKit::TiledCoreAnimationDrawingArea::shouldUseTiledBackingForFrameView): Deleted.

2019-12-16  Eric Carlson  <eric.carlson@apple.com>

        Log when unimplemented remote MediaPlayer methods are called
        https://bugs.webkit.org/show_bug.cgi?id=205269
        <rdar://problem/57967733>

        Reviewed by Youenn Fablet.

        * GPUProcess/media/RemoteMediaPlayerProxy.cpp:
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerPlaybackStateChanged):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerSawUnsupportedTracks):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerResourceNotSupported):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerRepaint):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerSizeChanged):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerEngineUpdated):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerFirstVideoFrameAvailable):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerCharacteristicChanged):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerRenderingCanBeAccelerated):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerRenderingModeChanged):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerAcceleratedCompositingEnabled):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerActiveSourceBuffersChanged):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerCachedKeyForKeyId const):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerKeyNeeded):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerMediaKeysStorageDirectory const):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerInitializationDataEncountered):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerWaitingForKeyChanged):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerCurrentPlaybackTargetIsWirelessChanged):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerReferrer const):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerUserAgent const):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerEnterFullscreen):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerExitFullscreen):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerIsFullscreen const):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerIsFullscreenPermitted const):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerIsVideo const):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerContentBoxRect const):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerContentsScale const):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerSetSize):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerPause):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerPlay):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerPlatformVolumeConfigurationRequired const):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerIsPaused const):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerIsLooping const):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerCachedResourceLoader):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerCreateResourceLoader):
        (WebKit::RemoteMediaPlayerProxy::doesHaveAttribute const):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerShouldUsePersistentCache const):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerMediaCacheDirectory const):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerDidAddAudioTrack):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerDidAddTextTrack):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerDidAddVideoTrack):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerDidRemoveAudioTrack):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerDidRemoveTextTrack):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerDidRemoveVideoTrack):
        (WebKit::RemoteMediaPlayerProxy::textTrackRepresentationBoundsChanged):
        (WebKit::RemoteMediaPlayerProxy::outOfBandTrackSources):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerNetworkInterfaceName const):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerGetRawCookies const):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerHandlePlaybackCommand):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerSourceApplicationIdentifier const):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerIsInMediaDocument const):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerEngineFailedToLoad const):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerRequestedPlaybackRate const):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerFullscreenMode const):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerIsVideoFullscreenStandby const):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerPreferredAudioCharacteristics const):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerShouldDisableSleep const):
        (WebKit::RemoteMediaPlayerProxy::mediaContentTypesRequiringHardwareSupport const):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerShouldCheckHardwareSupport const):
        * GPUProcess/media/RemoteMediaPlayerProxy.h:

2019-12-16  Kate Cheney  <katherine_cheney@apple.com>

        Add NS_UNAVAILABLE tags to prevent alloc inits for _WKResourceLoadStatistics* classes
        https://bugs.webkit.org/show_bug.cgi?id=205221

        Reviewed by Anders Carlsson.

        This patch ensures that no one tries to alloc init
        _WKResourceLoadStatisticsFirstParty or
        _WKResourceLoadStatisticsThirdParty. They should only be created via
        the API call to create().

        * UIProcess/API/Cocoa/_WKResourceLoadStatisticsFirstParty.h:
        * UIProcess/API/Cocoa/_WKResourceLoadStatisticsThirdParty.h:

2019-12-16  youenn fablet  <youenn@apple.com>

        http/wpt/service-workers/postMessage-fetch-order.https.html is a flaky failure after r253528
        https://bugs.webkit.org/show_bug.cgi?id=205261

        Reviewed by Chris Dumez.

        Instead of starting the fetch task asynchronously, start it synchronously but make sure that
        not handling the fetch is either coming from IPC or is done asynchronously.

        We add a boolean m_isDone that ensures that the loader will only be called once for didFail/didFinish/didNotHandle.
        This covers the potential case of a task for which cannotHandle is called synchronously at creation but the call to didNotHandle is not yet done.
        Before the call to didNotHandle is done, a timeout timer is firing and will call didNotHandle a first time.
        The second didNotHandle should be a no-op.

        Covered by existing tests and unflakes above test.

        * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp:
        (WebKit::ServiceWorkerFetchTask::contextClosed):
        (WebKit::ServiceWorkerFetchTask::didReceiveRedirectResponse):
        (WebKit::ServiceWorkerFetchTask::didReceiveResponse):
        (WebKit::ServiceWorkerFetchTask::didReceiveData):
        (WebKit::ServiceWorkerFetchTask::didReceiveFormData):
        (WebKit::ServiceWorkerFetchTask::didFinish):
        (WebKit::ServiceWorkerFetchTask::didFail):
        (WebKit::ServiceWorkerFetchTask::didNotHandle):
        Make sure to call didNotHandle only once based on m_isDone.
        (WebKit::ServiceWorkerFetchTask::cannotHandle):
        Do not expose didNotHandle as a public method.
        Instead expose cannotHandle that will call didNotHandle asynchronously.
        (WebKit::ServiceWorkerFetchTask::continueFetchTaskWith):
        No need to set a timer if we will not create a fetch event.
        * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h:
        (WebKit::ServiceWorkerFetchTask::takeRequest):
        * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
        (WebKit::WebSWServerConnection::startFetch):
        * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
        (WebKit::WebSWServerToContextConnection::fetchTaskTimedOut):
        Small refactoring to only use contextClosed and not expose whether the task is handled or not.
        This also potentially allows to call didNotHandle in case the service worker crashed before answering the fetch event.

2019-12-16  Emilio Cobos Álvarez  <emilio@crisal.io>

        [GTK] Build with USE_WPE_RENDERER=No fails with undefined EGL_WAYLAND_BUFFER_WL
        https://bugs.webkit.org/show_bug.cgi?id=205250

        Reviewed by Carlos Garcia Campos.

        Define the enum if not present.

        No new tests, just a build fix.

        * UIProcess/gtk/WaylandCompositor.cpp:

2019-12-16  youenn fablet  <youenn@apple.com>

        Reset cached getUserMedia queries when calling stopMediaCapture
        https://bugs.webkit.org/show_bug.cgi?id=205064

        Reviewed by Eric Carlson.

        Reset cached queries when calling stop media capture API allows to trigger again the prompt
        after the API call.
        Covered by updated API test.

        * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
        (WebKit::UserMediaPermissionRequestManagerProxy::resetAccess):
        * UIProcess/UserMediaPermissionRequestManagerProxy.h:
        (WebKit::UserMediaPermissionRequestManagerProxy::resetAccess):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::stopMediaCapture):

2019-12-15  Wenson Hsieh  <wenson_hsieh@apple.com>

        -[WKWebView _detectDataWithTypes:completionHandler:] crashes when there is no running process
        https://bugs.webkit.org/show_bug.cgi?id=205254

        Reviewed by Tim Horton.

        Bail early and call the completion handler in the case where we don't have a running web process, to avoid a
        null `Connection*` deref. Speculative fix for <rdar://problem/57463469>.

        * UIProcess/WebPageProxy.cpp:

2019-12-14  Adrian Perez de Castro  <aperez@igalia.com>

        [GTK][WPE] Fix various non-unified build issues introduced since r251698
        https://bugs.webkit.org/show_bug.cgi?id=204891

        Reviewed by Alex Christensen.

        * NetworkProcess/IndexedDB/WebIDBServer.cpp: Add missing WebCore namespace prefixes
        in function declarations.
        (WebKit::WebIDBServer::create):
        (WebKit::WebIDBServer::WebIDBServer):
        (WebKit::WebIDBServer::closeAndDeleteDatabasesForOrigins):
        (WebKit::WebIDBServer::suspend):
        (WebKit::WebIDBServer::idFireVersionChangeEvent):
        * NetworkProcess/cache/CacheStorageEngine.cpp:
        (WebKit::CacheStorage::Engine::requestSpace): Add missing namespace prefix for
        WebCore::ClientOrigin.
        * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp: Add missing inclusion of
        WebCore/RegistrableDomain.h
        (WebKit::NetworkCache::SubresourceInfo::isFirstParty const): Add missing namespace prefix
        for WebCore::RegistrableDomain.
        * WebProcess/Automation/WebAutomationSessionProxy.cpp:
        (WebKit::WebAutomationSessionProxy::setFilesForInputFileUpload): Add missing namespace
        prefix for WebCore::File::create() and WebCore::FileList::create() calls.

2019-12-14  Simon Fraser  <simon.fraser@apple.com>

        Rename "customFixedPositionRect" to "layoutViewportRect"
        https://bugs.webkit.org/show_bug.cgi?id=205241

        Reviewed by Dean Jackson.

        WK2 computes the rect used to layout out position:fixed elements in the UI process.
        For historical reasons this was called customFixedPositionRect, but rename it to
        layoutViewportRect since that what it really is.

        * Shared/VisibleContentRectUpdateInfo.cpp:
        (WebKit::VisibleContentRectUpdateInfo::encode const):
        (WebKit::VisibleContentRectUpdateInfo::decode):
        (WebKit::operator<<):
        * Shared/VisibleContentRectUpdateInfo.h:
        (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
        (WebKit::VisibleContentRectUpdateInfo::layoutViewportRect const):
        (WebKit::operator==):
        (WebKit::VisibleContentRectUpdateInfo::customFixedPositionRect const): Deleted.
        * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
        (WebKit::RemoteScrollingCoordinatorProxy::currentLayoutViewport const):
        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::layoutViewportRect const):
        (WebKit::WebPageProxy::customFixedPositionRect const): Deleted.
        * UIProcess/ios/WKContentView.mm:
        (-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
        (-[WKContentView _didCommitLayerTree:]):
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::computeLayoutViewportRect const):
        (WebKit::WebPageProxy::unconstrainedLayoutViewportRect const):
        (WebKit::WebPageProxy::computeCustomFixedPositionRect const): Deleted.
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::updateVisibleContentRects):

2019-12-14  Per Arne Vollan  <pvollan@apple.com>

        Map CSS value ID to system color in the UI process
        https://bugs.webkit.org/show_bug.cgi?id=204314
        <rdar://problem/57295392>
 
        Reviewed by Brent Fulgham.
 
        Create mapping between CSS value IDs and system colors in the UI process and send to the WebContent process
        on process startup.
 
        No new tests, covered by existing tests.
 
        * 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):

2019-12-14  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Deny mach lookup access to "*.viewservice" in the WebContent process
        https://bugs.webkit.org/show_bug.cgi?id=205240

        Reviewed by Brent Fulgham.

        As part of sandbox hardening in the WebContent process, mach lookup access to “*.viewservice” should be removed.

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

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

2019-12-14  Chris Dumez  <cdumez@apple.com>

        WebSWServerConnection::startFetch() should never fail synchronously
        https://bugs.webkit.org/show_bug.cgi?id=205225
        <rdar://problem/57490508>

        Reviewed by Geoffrey Garen.

        WebSWServerConnection::startFetch() should never fail synchronously. If it does, it will
        confuse the NetworkResourceLoader. NetworkResourceLoader::serviceWorkerDidNotHandle() will
        get called *before* NetworkResourceLoader::m_serviceWorkerFetchTask has been sent, which
        means that we would not properly deal with redirects. Worse, the call site which creates
        the ServiceWorkerFetchTask would then null out m_networkLoad, which would silently cancel
        the load that WebSWServerConnection::startFetch() started synchronously.

        No new tests, I am not sure how to test this. It would have to cause a redirect do a URL
        that has a service worker and then we would have to get WebSWServerConnection::startFetch()
        to fail synchronously. I think that to fail synchronously, we would have to not find a
        ServiceWorker with the given ID, or the ServiceWorker's hasTimedOutAnyFetchTasks would have
        to be set.

        I added a RELEASE_ASSERT() in NetworkResourceLoader::serviceWorkerDidNotHandle() that would
        have caught this.

        * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
        (WebKit::WebSWServerConnection::startFetch):

2019-12-14  Simon Fraser  <simon.fraser@apple.com>

        Move code out of WKWebView.mm into platform-specific files, for easier navigation
        https://bugs.webkit.org/show_bug.cgi?id=205233

        Reviewed by Tim Horton.

        Move as much platform-specific code out of WKWebView.mm as possible, moving it to WKWebViewMac/WKWebViewIOS.
        WKWebView (WKPrivate) is split into WKWebView (WKPrivateIOS) and WKWebView (WKPrivateMac) so the implementations
        of those functions can move.
        
        Code that remains in WKWebView.mm is either Cocoa-generic, or implements API.
        
        This is entirely cut/paste, other than the addition of -_takeFindStringFromSelectionInternal: for macOS
        to allow WKWebView.mm to call -takeFindStringFromSelection:.

        * SourcesCocoa.txt:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (hardwareKeyboardAvailabilityChangedCallback):
        (-[WKWebView setAllowsBackForwardNavigationGestures:]):
        (-[WKWebView allowsBackForwardNavigationGestures]):
        (-[WKWebView setPageZoom:]):
        (-[WKWebView pageZoom]):
        (toFindOptions):
        (-[WKWebView findString:withConfiguration:completionHandler:]):
        (+[WKWebView handlesURLScheme:]):
        (-[WKWebView setMediaType:]):
        (-[WKWebView mediaType]):
        (-[WKWebView scrollView]):
        (-[WKWebView setAllowsMagnification:]):
        (-[WKWebView allowsMagnification]):
        (-[WKWebView setMagnification:centeredAtPoint:]):
        (-[WKWebView setMagnification:]):
        (-[WKWebView magnification]):
        (-[WKWebView printOperationWithPrintInfo:]):
        (-[WKWebView _showSafeBrowsingWarning:completionHandler:]):
        (-[WKWebView _clearSafeBrowsingWarning]):
        (-[WKWebView _clearSafeBrowsingWarningIfForMainFrameNavigation]):
        (-[WKWebView _internalDoAfterNextPresentationUpdate:withoutWaitingForPainting:withoutWaitingForAnimatedResize:]):
        (dictionaryRepresentationForEditorState):
        (nsTextAlignment):
        (selectionAttributes):
        (-[WKWebView _didChangeEditorState]):
        (-[WKWebView _toggleStrikeThrough:]):
        (-[WKWebView _increaseListLevel:]):
        (-[WKWebView _decreaseListLevel:]):
        (-[WKWebView _changeListType:]):
        (-[WKWebView inputAccessoryView]):
        (-[WKWebView inputView]):
        (-[WKWebView inputAssistantItem]):
        (-[WKWebView _selectionAttributes]):
        (-[WKWebView _viewportSizeForCSSViewportUnits]):
        (-[WKWebView _setViewportSizeForCSSViewportUnits:]):
        (-[WKWebView _inspector]):
        (-[WKWebView _mainFrame]):
        (-[WKWebView _isEditable]):
        (-[WKWebView _setEditable:]):
        (-[WKWebView _executeEditCommand:argument:completion:]):
        (-[WKWebView _textManipulationDelegate]):
        (-[WKWebView _setTextManipulationDelegate:]):
        (-[WKWebView _startTextManipulationsWithConfiguration:completion:]):
        (-[WKWebView _completeTextManipulation:completion:]):
        (-[WKWebView _takeFindStringFromSelection:]):
        (+[WKWebView _stringForFind]):
        (+[WKWebView _setStringForFind:]):
        (-[WKWebView _remoteObjectRegistry]):
        (-[WKWebView _handle]):
        (-[WKWebView _observedRenderingProgressEvents]):
        (-[WKWebView _historyDelegate]):
        (-[WKWebView _setHistoryDelegate:]):
        (-[WKWebView _updateMediaPlaybackControlsManager]):
        (-[WKWebView _canTogglePictureInPicture]):
        (-[WKWebView _isPictureInPictureActive]):
        (-[WKWebView _togglePictureInPicture]):
        (-[WKWebView _closeAllMediaPresentations]):
        (-[WKWebView _stopMediaCapture]):
        (-[WKWebView _stopAllMediaPlayback]):
        (-[WKWebView _suspendAllMediaPlayback]):
        (-[WKWebView _resumeAllMediaPlayback]):
        (-[WKWebView _unreachableURL]):
        (-[WKWebView _mainFrameURL]):
        (-[WKWebView _loadAlternateHTMLString:baseURL:forUnreachableURL:]):
        (-[WKWebView _loadData:MIMEType:characterEncodingName:baseURL:userData:]):
        (-[WKWebView _loadRequest:shouldOpenExternalURLs:]):
        (-[WKWebView _certificateChain]):
        (-[WKWebView _committedURL]):
        (-[WKWebView _MIMEType]):
        (-[WKWebView _userAgent]):
        (-[WKWebView _applicationNameForUserAgent]):
        (-[WKWebView _setApplicationNameForUserAgent:]):
        (-[WKWebView _customUserAgent]):
        (-[WKWebView _setCustomUserAgent:]):
        (-[WKWebView _setUserContentExtensionsEnabled:]):
        (-[WKWebView _userContentExtensionsEnabled]):
        (-[WKWebView _webProcessIdentifier]):
        (-[WKWebView _provisionalWebProcessIdentifier]):
        (-[WKWebView _webProcessIsResponsive]):
        (-[WKWebView _killWebContentProcess]):
        (-[WKWebView _reloadWithoutContentBlockers]):
        (-[WKWebView _reloadExpiredOnly]):
        (-[WKWebView _killWebContentProcessAndResetState]):
        (-[WKWebView _convertRectFromRootViewCoordinates:]):
        (-[WKWebView _convertRectToRootViewCoordinates:]):
        (-[WKWebView _requestTextInputContextsInRect:completionHandler:]):
        (-[WKWebView _focusTextInputContext:completionHandler:]):
        (-[WKWebView _takePDFSnapshotWithConfiguration:completionHandler:]):
        (-[WKWebView _sessionStateData]):
        (-[WKWebView _sessionState]):
        (-[WKWebView _sessionStateWithFilter:]):
        (-[WKWebView _restoreFromSessionStateData:]):
        (-[WKWebView _restoreSessionState:andNavigate:]):
        (-[WKWebView _close]):
        (-[WKWebView _insertAttachmentWithFilename:contentType:data:options:completion:]):
        (-[WKWebView _insertAttachmentWithFileWrapper:contentType:options:completion:]):
        (-[WKWebView _insertAttachmentWithFileWrapper:contentType:completion:]):
        (-[WKWebView _attachmentForIdentifier:]):
        (-[WKWebView _simulateDeviceOrientationChangeWithAlpha:beta:gamma:]):
        (+[WKWebView _handlesSafeBrowsing]):
        (-[WKWebView _showSafeBrowsingWarningWithTitle:warning:details:completionHandler:]):
        (-[WKWebView _showSafeBrowsingWarningWithURL:title:warning:details:completionHandler:]):
        (+[WKWebView _confirmMalwareSentinel]):
        (+[WKWebView _visitUnsafeWebsiteSentinel]):
        (-[WKWebView _isJITEnabled:]):
        (-[WKWebView _evaluateJavaScriptWithoutUserGesture:completionHandler:]):
        (-[WKWebView _updateWebsitePolicies:]):
        (-[WKWebView _allowsRemoteInspection]):
        (-[WKWebView _setAllowsRemoteInspection:]):
        (-[WKWebView _remoteInspectionNameOverride]):
        (-[WKWebView _setRemoteInspectionNameOverride:]):
        (-[WKWebView _addsVisitedLinks]):
        (-[WKWebView _setAddsVisitedLinks:]):
        (-[WKWebView _networkRequestsInProgress]):
        (layoutMilestones):
        (-[WKWebView _setObservedRenderingProgressEvents:]):
        (-[WKWebView _getMainResourceDataWithCompletionHandler:]):
        (-[WKWebView _getWebArchiveDataWithCompletionHandler:]):
        (-[WKWebView _getContentsAsStringWithCompletionHandler:]):
        (-[WKWebView _getContentsAsAttributedStringWithCompletionHandler:]):
        (-[WKWebView _getApplicationManifestWithCompletionHandler:]):
        (-[WKWebView _paginationMode]):
        (-[WKWebView _setPaginationMode:]):
        (-[WKWebView _paginationBehavesLikeColumns]):
        (-[WKWebView _setPaginationBehavesLikeColumns:]):
        (-[WKWebView _pageLength]):
        (-[WKWebView _setPageLength:]):
        (-[WKWebView _gapBetweenPages]):
        (-[WKWebView _setGapBetweenPages:]):
        (-[WKWebView _paginationLineGridEnabled]):
        (-[WKWebView _setPaginationLineGridEnabled:]):
        (-[WKWebView _pageCount]):
        (-[WKWebView _supportsTextZoom]):
        (-[WKWebView _textZoomFactor]):
        (-[WKWebView _setTextZoomFactor:]):
        (-[WKWebView _pageZoomFactor]):
        (-[WKWebView _setPageZoomFactor:]):
        (-[WKWebView _diagnosticLoggingDelegate]):
        (-[WKWebView _setDiagnosticLoggingDelegate:]):
        (-[WKWebView _findDelegate]):
        (-[WKWebView _setFindDelegate:]):
        (-[WKWebView _countStringMatches:options:maxCount:]):
        (-[WKWebView _findString:options:maxCount:]):
        (-[WKWebView _hideFindUI]):
        (-[WKWebView _saveBackForwardSnapshotForItem:]):
        (-[WKWebView _inputDelegate]):
        (-[WKWebView _setInputDelegate:]):
        (-[WKWebView _isDisplayingStandaloneImageDocument]):
        (-[WKWebView _isDisplayingStandaloneMediaDocument]):
        (-[WKWebView _isPlayingAudio]):
        (-[WKWebView _isShowingNavigationGestureSnapshot]):
        (-[WKWebView _layoutMode]):
        (-[WKWebView _setLayoutMode:]):
        (-[WKWebView _fixedLayoutSize]):
        (-[WKWebView _setFixedLayoutSize:]):
        (-[WKWebView _setBackgroundExtendsBeyondPage:]):
        (-[WKWebView _backgroundExtendsBeyondPage]):
        (-[WKWebView _viewScale]):
        (-[WKWebView _setViewScale:]):
        (-[WKWebView _setMinimumEffectiveDeviceWidth:]):
        (-[WKWebView _minimumEffectiveDeviceWidth]):
        (-[WKWebView _setScrollPerformanceDataCollectionEnabled:]):
        (-[WKWebView _scrollPerformanceDataCollectionEnabled]):
        (-[WKWebView _scrollPerformanceData]):
        (-[WKWebView _allowsMediaDocumentInlinePlayback]):
        (-[WKWebView _setAllowsMediaDocumentInlinePlayback:]):
        (-[WKWebView _setFullscreenDelegate:]):
        (-[WKWebView _fullscreenDelegate]):
        (-[WKWebView _isInFullscreen]):
        (-[WKWebView _mediaCaptureState]):
        (-[WKWebView _setMediaCaptureEnabled:]):
        (-[WKWebView _mediaCaptureEnabled]):
        (-[WKWebView _setPageMuted:]):
        (-[WKWebView _removeDataDetectedLinks:]):
        (-[WKWebView _doAfterNextPresentationUpdate:]):
        (-[WKWebView _doAfterNextPresentationUpdateWithoutWaitingForPainting:]):
        (toAPIScrollbarStyle): Deleted.
        (toCoreScrollbarStyle): Deleted.
        (deviceOrientationForUIInterfaceOrientation): Deleted.
        (deviceOrientation): Deleted.
        (-[WKWebView setFrame:]): Deleted.
        (-[WKWebView setBounds:]): Deleted.
        (-[WKWebView layoutSubviews]): Deleted.
        (-[WKWebView _isShowingVideoPictureInPicture]): Deleted.
        (-[WKWebView _mayAutomaticallyShowVideoPictureInPicture]): Deleted.
        (-[WKWebView _incrementFocusPreservationCount]): Deleted.
        (-[WKWebView _decrementFocusPreservationCount]): Deleted.
        (-[WKWebView _resetFocusPreservationCount]): Deleted.
        (-[WKWebView _isRetainingActiveFocusedState]): Deleted.
        (-[WKWebView _effectiveAppearanceIsDark]): Deleted.
        (-[WKWebView _effectiveUserInterfaceLevelIsElevated]): Deleted.
        (-[WKWebView _shouldAvoidResizingWhenInputViewBoundsChange]): Deleted.
        (-[WKWebView _dragInteractionPolicy]): Deleted.
        (-[WKWebView _setDragInteractionPolicy:]): Deleted.
        (-[WKWebView _populateArchivedSubviews:]): Deleted.
        (-[WKWebView _isBackground]): Deleted.
        (-[WKWebView browsingContextController]): Deleted.
        (-[WKWebView becomeFirstResponder]): Deleted.
        (-[WKWebView canBecomeFirstResponder]): Deleted.
        (-[WKWebView resignFirstResponder]): Deleted.
        (-[WKWebView canPerformAction:withSender:]): Deleted.
        (-[WKWebView targetForAction:withSender:]): Deleted.
        (-[WKWebView willFinishIgnoringCalloutBarFadeAfterPerformingAction]): Deleted.
        (floorToDevicePixel): Deleted.
        (pointsEqualInDevicePixels): Deleted.
        (roundScrollViewContentSize): Deleted.
        (-[WKWebView _currentContentView]): Deleted.
        (-[WKWebView _contentProviderRegistry]): Deleted.
        (-[WKWebView _selectionGranularity]): Deleted.
        (-[WKWebView _setHasCustomContentView:loadedMIMEType:]): Deleted.
        (-[WKWebView _didFinishLoadingDataForCustomContentProviderWithSuggestedFilename:data:]): Deleted.
        (-[WKWebView _handleKeyUIEvent:]): Deleted.
        (-[WKWebView _willInvokeUIScrollViewDelegateCallback]): Deleted.
        (-[WKWebView _didInvokeUIScrollViewDelegateCallback]): Deleted.
        (contentZoomScale): Deleted.
        (baseScrollViewBackgroundColor): Deleted.
        (scrollViewBackgroundColor): Deleted.
        (-[WKWebView _updateScrollViewBackground]): Deleted.
        (-[WKWebView _videoControlsManagerDidChange]): Deleted.
        (-[WKWebView _initialContentOffsetForScrollView]): Deleted.
        (-[WKWebView _contentOffsetAdjustedForObscuredInset:]): Deleted.
        (-[WKWebView _effectiveObscuredInsetEdgesAffectedBySafeArea]): Deleted.
        (-[WKWebView _computedObscuredInset]): Deleted.
        (-[WKWebView _computedContentInset]): Deleted.
        (-[WKWebView _computedUnobscuredSafeAreaInset]): Deleted.
        (-[WKWebView _processWillSwapOrDidExit]): Deleted.
        (-[WKWebView _processWillSwap]): Deleted.
        (-[WKWebView _processDidExit]): Deleted.
        (-[WKWebView _didRelaunchProcess]): Deleted.
        (-[WKWebView _didCommitLoadForMainFrame]): Deleted.
        (contentOffsetBoundedInValidRange): Deleted.
        (changeContentOffsetBoundedInValidRange): Deleted.
        (-[WKWebView visibleRectInViewCoordinates]): Deleted.
        (areEssentiallyEqualAsFloat): Deleted.
        (-[WKWebView _didCommitLayerTreeDuringAnimatedResize:]): Deleted.
        (-[WKWebView _didCommitLayerTree:]): Deleted.
        (-[WKWebView _layerTreeCommitComplete]): Deleted.
        (-[WKWebView _couldNotRestorePageState]): Deleted.
        (-[WKWebView _restorePageScrollPosition:scrollOrigin:previousObscuredInset:scale:]): Deleted.
        (-[WKWebView _restorePageStateToUnobscuredCenter:scale:]): Deleted.
        (-[WKWebView _takeViewSnapshot]): Deleted.
        (-[WKWebView _zoomToPoint:atScale:animated:]): Deleted.
        (-[WKWebView _zoomToRect:atScale:origin:animated:]): Deleted.
        (constrainContentOffset): Deleted.
        (-[WKWebView _scrollToContentScrollPosition:scrollOrigin:]): Deleted.
        (-[WKWebView _scrollToRect:origin:minimumScrollDistance:]): Deleted.
        (-[WKWebView _zoomOutWithOrigin:animated:]): Deleted.
        (-[WKWebView _zoomToInitialScaleWithOrigin:animated:]): Deleted.
        (-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]): Deleted.
        (-[WKWebView _initialScaleFactor]): Deleted.
        (-[WKWebView _contentZoomScale]): Deleted.
        (-[WKWebView _targetContentZoomScaleForRect:currentScale:fitEntireRect:minimumScale:maximumScale:]): Deleted.
        (-[WKWebView _zoomToRect:withOrigin:fitEntireRect:minimumScale:maximumScale:minimumScrollDistance:]): Deleted.
        (-[WKWebView didMoveToWindow]): Deleted.
        (-[WKWebView _setOpaqueInternal:]): Deleted.
        (-[WKWebView setOpaque:]): Deleted.
        (-[WKWebView setBackgroundColor:]): Deleted.
        (-[WKWebView _allowsDoubleTapGestures]): Deleted.
        (-[WKWebView _stylusTapGestureShouldCreateEditableImage]): Deleted.
        (-[WKWebView usesStandardContentView]): Deleted.
        (-[WKWebView scrollView:contentSizeForZoomScale:withProposedSize:]): Deleted.
        (-[WKWebView viewForZoomingInScrollView:]): Deleted.
        (-[WKWebView scrollViewWillBeginZooming:withView:]): Deleted.
        (-[WKWebView scrollViewWillBeginDragging:]): Deleted.
        (-[WKWebView _didFinishScrolling]): Deleted.
        (-[WKWebView scrollViewWillEndDragging:withVelocity:targetContentOffset:]): Deleted.
        (-[WKWebView scrollViewDidEndDragging:willDecelerate:]): Deleted.
        (-[WKWebView scrollViewDidEndDecelerating:]): Deleted.
        (-[WKWebView scrollViewDidScrollToTop:]): Deleted.
        (-[WKWebView _scrollView:adjustedOffsetForOffset:translation:startPoint:locationInView:horizontalVelocity:verticalVelocity:]): Deleted.
        (-[WKWebView scrollViewDidScroll:]): Deleted.
        (-[WKWebView scrollViewDidZoom:]): Deleted.
        (-[WKWebView scrollViewDidEndZooming:withView:atScale:]): Deleted.
        (-[WKWebView scrollViewDidEndScrollingAnimation:]): Deleted.
        (-[WKWebView _scrollViewDidInterruptDecelerating:]): Deleted.
        (-[WKWebView _enclosingViewForExposedRectComputation]): Deleted.
        (-[WKWebView _visibleRectInEnclosingView:]): Deleted.
        (-[WKWebView _visibleContentRect]): Deleted.
        (-[WKWebView _didScroll]): Deleted.
        (-[WKWebView _enclosingScrollerScrollingEnded:]): Deleted.
        (-[WKWebView _scrollViewSystemContentInset]): Deleted.
        (-[WKWebView activeViewLayoutSize:]): Deleted.
        (-[WKWebView _dispatchSetViewLayoutSize:]): Deleted.
        (-[WKWebView _dispatchSetMaximumUnobscuredSize:]): Deleted.
        (-[WKWebView _dispatchSetDeviceOrientation:]): Deleted.
        (-[WKWebView _frameOrBoundsChanged]): Deleted.
        (-[WKWebView _contentRectForUserInteraction]): Deleted.
        (-[WKWebView _scrollViewIsRubberBanding]): Deleted.
        (-[WKWebView safeAreaInsetsDidChange]): Deleted.
        (-[WKWebView _scheduleVisibleContentRectUpdate]): Deleted.
        (-[WKWebView _scrollViewIsInStableState:]): Deleted.
        (-[WKWebView _addUpdateVisibleContentRectPreCommitHandler]): Deleted.
        (-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]): Deleted.
        (scrollViewCanScroll): Deleted.
        (-[WKWebView _contentBoundsExtendedForRubberbandingWithScale:]): Deleted.
        (-[WKWebView _updateVisibleContentRects]): Deleted.
        (-[WKWebView _didStartProvisionalLoadForMainFrame]): Deleted.
        (activeMaximumUnobscuredSize): Deleted.
        (activeOrientation): Deleted.
        (-[WKWebView _cancelAnimatedResize]): Deleted.
        (-[WKWebView _didCompleteAnimatedResize]): Deleted.
        (-[WKWebView _didFinishLoadForMainFrame]): Deleted.
        (-[WKWebView _didFailLoadForMainFrame]): Deleted.
        (-[WKWebView _didSameDocumentNavigationForMainFrame:]): Deleted.
        (-[WKWebView _keyboardChangedWithInfo:adjustScrollView:]): Deleted.
        (-[WKWebView _shouldUpdateKeyboardWithInfo:]): Deleted.
        (-[WKWebView _keyboardWillChangeFrame:]): Deleted.
        (-[WKWebView _keyboardDidChangeFrame:]): Deleted.
        (-[WKWebView _keyboardWillShow:]): Deleted.
        (-[WKWebView _keyboardDidShow:]): Deleted.
        (-[WKWebView _keyboardWillHide:]): Deleted.
        (-[WKWebView _windowDidRotate:]): Deleted.
        (-[WKWebView _contentSizeCategoryDidChange:]): Deleted.
        (-[WKWebView _contentSizeCategory]): Deleted.
        (-[WKWebView _accessibilitySettingsDidChange:]): Deleted.
        (-[WKWebView _isNavigationSwipeGestureRecognizer:]): Deleted.
        (-[WKWebView _navigationGestureDidBegin]): Deleted.
        (-[WKWebView _navigationGestureDidEnd]): Deleted.
        (-[WKWebView _showPasswordViewWithDocumentName:passwordHandler:]): Deleted.
        (-[WKWebView _hidePasswordView]): Deleted.
        (-[WKWebView _passwordView]): Deleted.
        (-[WKWebView _updateScrollViewInsetAdjustmentBehavior]): Deleted.
        (-[WKWebView _setAvoidsUnsafeArea:]): Deleted.
        (-[WKWebView _haveSetObscuredInsets]): Deleted.
        (-[WKWebView acceptsFirstResponder]): Deleted.
        (-[WKWebView viewWillStartLiveResize]): Deleted.
        (-[WKWebView viewDidEndLiveResize]): Deleted.
        (-[WKWebView isFlipped]): Deleted.
        (-[WKWebView intrinsicContentSize]): Deleted.
        (-[WKWebView prepareContentInRect:]): Deleted.
        (-[WKWebView setFrameSize:]): Deleted.
        (-[WKWebView _web_grantDOMPasteAccess]): Deleted.
        (-[WKWebView _prepareForImmediateActionAnimation]): Deleted.
        (-[WKWebView _cancelImmediateActionAnimation]): Deleted.
        (-[WKWebView _completeImmediateActionAnimation]): Deleted.
        (-[WKWebView ALLOW_DEPRECATED_IMPLEMENTATIONS_END]): Deleted.
        (-[WKWebView writeSelectionToPasteboard:types:]): Deleted.
        (-[WKWebView centerSelectionInVisibleArea:]): Deleted.
        (-[WKWebView validRequestorForSendType:returnType:]): Deleted.
        (-[WKWebView readSelectionFromPasteboard:]): Deleted.
        (-[WKWebView changeFont:]): Deleted.
        (-[WKWebView changeColor:]): Deleted.
        (-[WKWebView changeAttributes:]): Deleted.
        (-[WKWebView startSpeaking:]): Deleted.
        (-[WKWebView stopSpeaking:]): Deleted.
        (-[WKWebView showGuessPanel:]): Deleted.
        (-[WKWebView checkSpelling:]): Deleted.
        (-[WKWebView changeSpelling:]): Deleted.
        (-[WKWebView toggleContinuousSpellChecking:]): Deleted.
        (-[WKWebView isGrammarCheckingEnabled]): Deleted.
        (-[WKWebView setGrammarCheckingEnabled:]): Deleted.
        (-[WKWebView toggleGrammarChecking:]): Deleted.
        (-[WKWebView toggleAutomaticSpellingCorrection:]): Deleted.
        (-[WKWebView orderFrontSubstitutionsPanel:]): Deleted.
        (-[WKWebView toggleSmartInsertDelete:]): Deleted.
        (-[WKWebView isAutomaticQuoteSubstitutionEnabled]): Deleted.
        (-[WKWebView setAutomaticQuoteSubstitutionEnabled:]): Deleted.
        (-[WKWebView toggleAutomaticQuoteSubstitution:]): Deleted.
        (-[WKWebView isAutomaticDashSubstitutionEnabled]): Deleted.
        (-[WKWebView setAutomaticDashSubstitutionEnabled:]): Deleted.
        (-[WKWebView toggleAutomaticDashSubstitution:]): Deleted.
        (-[WKWebView isAutomaticLinkDetectionEnabled]): Deleted.
        (-[WKWebView setAutomaticLinkDetectionEnabled:]): Deleted.
        (-[WKWebView toggleAutomaticLinkDetection:]): Deleted.
        (-[WKWebView isAutomaticTextReplacementEnabled]): Deleted.
        (-[WKWebView setAutomaticTextReplacementEnabled:]): Deleted.
        (-[WKWebView toggleAutomaticTextReplacement:]): Deleted.
        (-[WKWebView uppercaseWord:]): Deleted.
        (-[WKWebView lowercaseWord:]): Deleted.
        (-[WKWebView capitalizeWord:]): Deleted.
        (-[WKWebView _wantsKeyDownForEvent:]): Deleted.
        (-[WKWebView scrollWheel:]): Deleted.
        (-[WKWebView swipeWithEvent:]): Deleted.
        (-[WKWebView mouseMoved:]): Deleted.
        (-[WKWebView mouseDown:]): Deleted.
        (-[WKWebView mouseUp:]): Deleted.
        (-[WKWebView mouseDragged:]): Deleted.
        (-[WKWebView mouseEntered:]): Deleted.
        (-[WKWebView mouseExited:]): Deleted.
        (-[WKWebView otherMouseDown:]): Deleted.
        (-[WKWebView otherMouseDragged:]): Deleted.
        (-[WKWebView otherMouseUp:]): Deleted.
        (-[WKWebView rightMouseDown:]): Deleted.
        (-[WKWebView rightMouseDragged:]): Deleted.
        (-[WKWebView rightMouseUp:]): Deleted.
        (-[WKWebView pressureChangeWithEvent:]): Deleted.
        (-[WKWebView acceptsFirstMouse:]): Deleted.
        (-[WKWebView shouldDelayWindowOrderingForEvent:]): Deleted.
        (-[WKWebView doCommandBySelector:]): Deleted.
        (-[WKWebView insertText:]): Deleted.
        (-[WKWebView insertText:replacementRange:]): Deleted.
        (-[WKWebView inputContext]): Deleted.
        (-[WKWebView performKeyEquivalent:]): Deleted.
        (-[WKWebView keyUp:]): Deleted.
        (-[WKWebView keyDown:]): Deleted.
        (-[WKWebView flagsChanged:]): Deleted.
        (-[WKWebView setMarkedText:selectedRange:replacementRange:]): Deleted.
        (-[WKWebView unmarkText]): Deleted.
        (-[WKWebView selectedRange]): Deleted.
        (-[WKWebView hasMarkedText]): Deleted.
        (-[WKWebView markedRange]): Deleted.
        (-[WKWebView attributedSubstringForProposedRange:actualRange:]): Deleted.
        (-[WKWebView characterIndexForPoint:]): Deleted.
        (-[WKWebView typingAttributesWithCompletionHandler:]): Deleted.
        (-[WKWebView firstRectForCharacterRange:actualRange:]): Deleted.
        (-[WKWebView selectedRangeWithCompletionHandler:]): Deleted.
        (-[WKWebView markedRangeWithCompletionHandler:]): Deleted.
        (-[WKWebView hasMarkedTextWithCompletionHandler:]): Deleted.
        (-[WKWebView attributedSubstringForProposedRange:completionHandler:]): Deleted.
        (-[WKWebView firstRectForCharacterRange:completionHandler:]): Deleted.
        (-[WKWebView characterIndexForPoint:completionHandler:]): Deleted.
        (-[WKWebView validAttributesForMarkedText]): Deleted.
        (-[WKWebView draggedImage:endedAt:operation:]): Deleted.
        (-[WKWebView draggingEntered:]): Deleted.
        (-[WKWebView draggingUpdated:]): Deleted.
        (-[WKWebView draggingExited:]): Deleted.
        (-[WKWebView prepareForDragOperation:]): Deleted.
        (-[WKWebView performDragOperation:]): Deleted.
        (-[WKWebView _hitTest:dragTypes:]): Deleted.
        (-[WKWebView _windowResizeMouseLocationIsInVisibleScrollerThumb:]): Deleted.
        (-[WKWebView viewWillMoveToWindow:]): Deleted.
        (-[WKWebView viewDidMoveToWindow]): Deleted.
        (-[WKWebView drawRect:]): Deleted.
        (-[WKWebView isOpaque]): Deleted.
        (-[WKWebView mouseDownCanMoveWindow]): Deleted.
        (-[WKWebView viewDidHide]): Deleted.
        (-[WKWebView viewDidUnhide]): Deleted.
        (-[WKWebView viewDidChangeBackingProperties]): Deleted.
        (-[WKWebView _activeSpaceDidChange:]): Deleted.
        (-[WKWebView accessibilityFocusedUIElement]): Deleted.
        (-[WKWebView accessibilityHitTest:]): Deleted.
        (-[WKWebView accessibilityAttributeValue:]): Deleted.
        (-[WKWebView accessibilityAttributeValue:forParameter:]): Deleted.
        (-[WKWebView hitTest:]): Deleted.
        (-[WKWebView conversationIdentifier]): Deleted.
        (-[WKWebView quickLookWithEvent:]): Deleted.
        (-[WKWebView addTrackingRect:owner:userData:assumeInside:]): Deleted.
        (-[WKWebView _addTrackingRect:owner:userData:assumeInside:useTrackingNum:]): Deleted.
        (-[WKWebView _addTrackingRects:owner:userDataList:assumeInsideList:trackingNums:count:]): Deleted.
        (-[WKWebView removeTrackingRect:]): Deleted.
        (-[WKWebView _removeTrackingRects:count:]): Deleted.
        (-[WKWebView view:stringForToolTip:point:userData:]): Deleted.
        (-[WKWebView pasteboardChangedOwner:]): Deleted.
        (-[WKWebView pasteboard:provideDataForType:]): Deleted.
        (-[WKWebView namesOfPromisedFilesDroppedAtDestination:]): Deleted.
        (-[WKWebView wantsUpdateLayer]): Deleted.
        (-[WKWebView updateLayer]): Deleted.
        (-[WKWebView smartMagnifyWithEvent:]): Deleted.
        (-[WKWebView magnifyWithEvent:]): Deleted.
        (-[WKWebView rotateWithEvent:]): Deleted.
        (-[WKWebView _usePlatformFindUI]): Deleted.
        (-[WKWebView _setUsePlatformFindUI:]): Deleted.
        (-[WKWebView _ensureTextFinderClient]): Deleted.
        (-[WKWebView findMatchesForString:relativeToMatch:findOptions:maxResults:resultCollector:]): Deleted.
        (-[WKWebView replaceMatches:withString:inSelectionOnly:resultCollector:]): Deleted.
        (-[WKWebView scrollFindMatchToVisible:]): Deleted.
        (-[WKWebView documentContainerView]): Deleted.
        (-[WKWebView getSelectedText:]): Deleted.
        (-[WKWebView selectFindMatch:completionHandler:]): Deleted.
        (-[WKWebView _web_superInputContext]): Deleted.
        (-[WKWebView _web_superQuickLookWithEvent:]): Deleted.
        (-[WKWebView _web_superSwipeWithEvent:]): Deleted.
        (-[WKWebView _web_superMagnifyWithEvent:]): Deleted.
        (-[WKWebView _web_superSmartMagnifyWithEvent:]): Deleted.
        (-[WKWebView _web_superRemoveTrackingRect:]): Deleted.
        (-[WKWebView _web_superAccessibilityAttributeValue:]): Deleted.
        (-[WKWebView _web_superDoCommandBySelector:]): Deleted.
        (-[WKWebView _web_superPerformKeyEquivalent:]): Deleted.
        (-[WKWebView _web_superKeyDown:]): Deleted.
        (-[WKWebView _web_superHitTest:]): Deleted.
        (-[WKWebView _web_immediateActionAnimationControllerForHitTestResultInternal:withType:userData:]): Deleted.
        (-[WKWebView _web_prepareForImmediateActionAnimation]): Deleted.
        (-[WKWebView _web_cancelImmediateActionAnimation]): Deleted.
        (-[WKWebView _web_completeImmediateActionAnimation]): Deleted.
        (-[WKWebView _web_didChangeContentSize:]): Deleted.
        (-[WKWebView _web_dragDestinationActionForDraggingInfo:]): Deleted.
        (-[WKWebView _web_didPerformDragOperation:]): Deleted.
        (-[WKWebView _web_dismissContentRelativeChildWindows]): Deleted.
        (-[WKWebView _web_dismissContentRelativeChildWindowsWithAnimation:]): Deleted.
        (-[WKWebView _web_editorStateDidChange]): Deleted.
        (-[WKWebView _web_gestureEventWasNotHandledByWebCore:]): Deleted.
        (-[WKWebView filePromiseProvider:fileNameForType:]): Deleted.
        (-[WKWebView filePromiseProvider:writePromiseToURL:completionHandler:]): Deleted.
        (-[WKWebView draggingSession:sourceOperationMaskForDraggingContext:]): Deleted.
        (-[WKWebView draggingSession:endedAtPoint:operation:]): Deleted.
        (-[WKWebView makeTouchBar]): Deleted.
        (-[WKWebView candidateListTouchBarItem]): Deleted.
        (-[WKWebView _web_didAddMediaControlsManager:]): Deleted.
        (-[WKWebView _web_didRemoveMediaControlsManager]): Deleted.
        (-[WKWebView _interactWithMediaControlsForTesting]): Deleted.
        (-[WKWebView _useSystemAppearance]): Deleted.
        (-[WKWebView _setUseSystemAppearance:]): Deleted.
        (-[WKWebView _pageRefForTransitionToWKWebView]): Deleted.
        (-[WKWebView _canChangeFrameLayout:]): Deleted.
        (-[WKWebView _tryToSwipeWithEvent:ignoringPinnedState:]): Deleted.
        (-[WKWebView _ignoresNonWheelEvents]): Deleted.
        (-[WKWebView _setIgnoresNonWheelEvents:]): Deleted.
        (-[WKWebView _hasActiveVideoForControlsManager]): Deleted.
        (-[WKWebView _dismissContentRelativeChildWindows]): Deleted.
        (-[WKWebView _gestureEventWasNotHandledByWebCore:]): Deleted.
        (-[WKWebView _disableFrameSizeUpdates]): Deleted.
        (-[WKWebView _enableFrameSizeUpdates]): Deleted.
        (-[WKWebView _beginDeferringViewInWindowChanges]): Deleted.
        (-[WKWebView _endDeferringViewInWindowChanges]): Deleted.
        (-[WKWebView _endDeferringViewInWindowChangesSync]): Deleted.
        (-[WKWebView _fullScreenPlaceholderView]): Deleted.
        (-[WKWebView _fullScreenWindow]): Deleted.
        (-[WKWebView _underlayColor]): Deleted.
        (-[WKWebView _setUnderlayColor:]): Deleted.
        (-[WKWebView _setCustomSwipeViews:]): Deleted.
        (-[WKWebView _setCustomSwipeViewsTopContentInset:]): Deleted.
        (-[WKWebView _setDidMoveSwipeSnapshotCallback:]): Deleted.
        (-[WKWebView _setFrame:andScrollBy:]): Deleted.
        (-[WKWebView _setTotalHeightOfBanners:]): Deleted.
        (-[WKWebView _totalHeightOfBanners]): Deleted.
        (-[WKWebView _setShouldSuppressFirstResponderChanges:]): Deleted.
        (-[WKWebView _setFont:sender:]): Deleted.
        (-[WKWebView _setFontSize:sender:]): Deleted.
        (-[WKWebView _setTextColor:sender:]): Deleted.
        (-[WKWebView _requestActivatedElementAtPosition:completionBlock:]): Deleted.
        (-[WKWebView _contentVisibleRect]): Deleted.
        (-[WKWebView _convertPointFromContentsToView:]): Deleted.
        (-[WKWebView _convertPointFromViewToContents:]): Deleted.
        (-[WKWebView didStartFormControlInteraction]): Deleted.
        (-[WKWebView didEndFormControlInteraction]): Deleted.
        (-[WKWebView _uiTextCaretRect]): Deleted.
        (-[WKWebView _accessibilityRetrieveRectsAtSelectionOffset:withText:completionHandler:]): Deleted.
        (-[WKWebView _accessibilityStoreSelection]): Deleted.
        (-[WKWebView _accessibilityClearSelection]): Deleted.
        (-[WKWebView _contentViewIsFirstResponder]): Deleted.
        (-[WKWebView _retainActiveFocusedState]): Deleted.
        (-[WKWebView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]): Deleted.
        (-[WKWebView _snapshotLayerContentsForBackForwardListItem:]): Deleted.
        (-[WKWebView _dataDetectionResults]): Deleted.
        (-[WKWebView _accessibilityRetrieveSpeakSelectionContent]): Deleted.
        (-[WKWebView _accessibilityDidGetSpeakSelectionContent:]): Deleted.
        (-[WKWebView _safeBrowsingWarning]): Deleted.
        (-[WKWebView _doAfterNextStablePresentationUpdate:]): Deleted.
        (-[WKWebView _detectDataWithTypes:completionHandler:]): Deleted.
        (-[WKWebView removeFromSuperview]): Deleted.
        (-[WKWebView _minimumLayoutSizeOverride]): Deleted.
        (-[WKWebView _setViewLayoutSizeOverride:]): Deleted.
        (-[WKWebView _obscuredInsets]): Deleted.
        (-[WKWebView _setObscuredInsets:]): Deleted.
        (-[WKWebView _obscuredInsetEdgesAffectedBySafeArea]): Deleted.
        (-[WKWebView _setObscuredInsetEdgesAffectedBySafeArea:]): Deleted.
        (-[WKWebView _unobscuredSafeAreaInsets]): Deleted.
        (-[WKWebView _setUnobscuredSafeAreaInsets:]): Deleted.
        (-[WKWebView _safeAreaShouldAffectObscuredInsets]): Deleted.
        (-[WKWebView _setInterfaceOrientationOverride:]): Deleted.
        (-[WKWebView _interfaceOrientationOverride]): Deleted.
        (-[WKWebView _clearInterfaceOrientationOverride]): Deleted.
        (-[WKWebView _maximumUnobscuredSizeOverride]): Deleted.
        (-[WKWebView _setMaximumUnobscuredSizeOverride:]): Deleted.
        (-[WKWebView _setAllowsViewportShrinkToFit:]): Deleted.
        (-[WKWebView _allowsViewportShrinkToFit]): Deleted.
        (-[WKWebView _beginInteractiveObscuredInsetsChange]): Deleted.
        (-[WKWebView _endInteractiveObscuredInsetsChange]): Deleted.
        (-[WKWebView _hideContentUntilNextUpdate]): Deleted.
        (-[WKWebView _beginAnimatedResizeWithUpdates:]): Deleted.
        (-[WKWebView _endAnimatedResize]): Deleted.
        (-[WKWebView _resizeWhileHidingContentWithUpdates:]): Deleted.
        (-[WKWebView _firePresentationUpdateForPendingStableStatePresentationCallbacks]): Deleted.
        (-[WKWebView _setOverlaidAccessoryViewsInset:]): Deleted.
        (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]): Deleted.
        (-[WKWebView _overrideLayoutParametersWithMinimumLayoutSize:maximumUnobscuredSizeOverride:]): Deleted.
        (-[WKWebView _clearOverrideLayoutParameters]): Deleted.
        (viewportArgumentsFromDictionary): Deleted.
        (-[WKWebView _overrideViewportWithArguments:]): Deleted.
        (-[WKWebView _viewForFindUI]): Deleted.
        (-[WKWebView _isDisplayingPDF]): Deleted.
        (-[WKWebView _dataForDisplayedPDF]): Deleted.
        (-[WKWebView _suggestedFilenameForDisplayedPDF]): Deleted.
        (-[WKWebView _webViewPrintFormatter]): Deleted.
        (toUserInterfaceLayoutDirection): Deleted.
        (-[WKWebView setSemanticContentAttribute:]): Deleted.
        (-[WKWebView _drawsBackground]): Deleted.
        (-[WKWebView _setDrawsBackground:]): Deleted.
        (-[WKWebView _backgroundColor]): Deleted.
        (-[WKWebView _setBackgroundColor:]): Deleted.
        (-[WKWebView _setDrawsTransparentBackground:]): Deleted.
        (-[WKWebView _inspectorAttachmentView]): Deleted.
        (-[WKWebView _setInspectorAttachmentView:]): Deleted.
        (-[WKWebView _setOverlayScrollbarStyle:]): Deleted.
        (-[WKWebView _overlayScrollbarStyle]): Deleted.
        (-[WKWebView _windowOcclusionDetectionEnabled]): Deleted.
        (-[WKWebView _setWindowOcclusionDetectionEnabled:]): Deleted.
        (-[WKWebView shareSheetDidDismiss:]): Deleted.
        (-[WKWebView _setOverrideDeviceScaleFactor:]): Deleted.
        (-[WKWebView _overrideDeviceScaleFactor]): Deleted.
        (-[WKWebView _setTopContentInset:]): Deleted.
        (-[WKWebView _topContentInset]): Deleted.
        (-[WKWebView _pageExtendedBackgroundColor]): Deleted.
        (-[WKWebView _pinnedState]): Deleted.
        (-[WKWebView _rubberBandingEnabled]): Deleted.
        (-[WKWebView _setRubberBandingEnabled:]): Deleted.
        (-[WKWebView _immediateActionAnimationControllerForHitTestResult:withType:userData:]): Deleted.
        (-[WKWebView _setAutomaticallyAdjustsContentInsets:]): Deleted.
        (-[WKWebView _automaticallyAdjustsContentInsets]): Deleted.
        (-[WKWebView _minimumLayoutWidth]): Deleted.
        (-[WKWebView _setMinimumLayoutWidth:]): Deleted.
        (-[WKWebView _shouldExpandContentToViewHeightForAutoLayout]): Deleted.
        (-[WKWebView _setShouldExpandContentToViewHeightForAutoLayout:]): Deleted.
        (-[WKWebView _alwaysShowsHorizontalScroller]): Deleted.
        (-[WKWebView _setAlwaysShowsHorizontalScroller:]): Deleted.
        (-[WKWebView _alwaysShowsVerticalScroller]): Deleted.
        (-[WKWebView _setAlwaysShowsVerticalScroller:]): Deleted.
        (-[WKWebView _printOperationWithPrintInfo:]): Deleted.
        (-[WKWebView _printOperationWithPrintInfo:forFrame:]): Deleted.
        (-[WKWebView setUserInterfaceLayoutDirection:]): Deleted.
        (-[WKWebView _wantsMediaPlaybackControlsView]): Deleted.
        (-[WKWebView _setWantsMediaPlaybackControlsView:]): Deleted.
        (-[WKWebView _mediaPlaybackControlsView]): Deleted.
        (-[WKWebView _addMediaPlaybackControlsView:]): Deleted.
        (-[WKWebView _removeMediaPlaybackControlsView]): Deleted.
        (-[WKWebView _prepareForMoveToWindow:completionHandler:]): Deleted.
        (-[WKWebView _setThumbnailView:]): Deleted.
        (-[WKWebView _thumbnailView]): Deleted.
        (-[WKWebView _setIgnoresAllEvents:]): Deleted.
        (-[WKWebView _ignoresAllEvents]): Deleted.
        (-[WKWebView _spellCheckerDocumentTag]): Deleted.
        (-[WKWebView hasFullScreenWindowController]): Deleted.
        (-[WKWebView closeFullScreenWindowController]): Deleted.
        (-[WKWebView fullScreenWindowController]): Deleted.
        (-[WKWebView validateUserInterfaceItem:]): Deleted.
        (-[WKWebView goBack:]): Deleted.
        (-[WKWebView goForward:]): Deleted.
        (-[WKWebView reload:]): Deleted.
        (-[WKWebView reloadFromOrigin:]): Deleted.
        (-[WKWebView stopLoading:]): Deleted.
        (-[WKWebView _printFormatterClass]): Deleted.
        (-[WKWebView _printProvider]): Deleted.
        * UIProcess/API/Cocoa/WKWebViewInternal.h:
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/API/Cocoa/WKWebViewTesting.mm:
        * UIProcess/API/ios/WKWebViewIOS.h: Copied from Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h.
        * UIProcess/API/ios/WKWebViewIOS.mm: Added.
        (deviceOrientationForUIInterfaceOrientation):
        (deviceOrientation):
        (-[WKWebView setFrame:]):
        (-[WKWebView setBounds:]):
        (-[WKWebView layoutSubviews]):
        (-[WKWebView _isShowingVideoPictureInPicture]):
        (-[WKWebView _mayAutomaticallyShowVideoPictureInPicture]):
        (-[WKWebView _incrementFocusPreservationCount]):
        (-[WKWebView _decrementFocusPreservationCount]):
        (-[WKWebView _resetFocusPreservationCount]):
        (-[WKWebView _isRetainingActiveFocusedState]):
        (-[WKWebView _effectiveAppearanceIsDark]):
        (-[WKWebView _effectiveUserInterfaceLevelIsElevated]):
        (-[WKWebView _populateArchivedSubviews:]):
        (-[WKWebView _isBackground]):
        (-[WKWebView browsingContextController]):
        (-[WKWebView becomeFirstResponder]):
        (-[WKWebView canBecomeFirstResponder]):
        (-[WKWebView resignFirstResponder]):
        (-[WKWebView canPerformAction:withSender:]):
        (-[WKWebView targetForAction:withSender:]):
        (-[WKWebView willFinishIgnoringCalloutBarFadeAfterPerformingAction]):
        (floorToDevicePixel):
        (pointsEqualInDevicePixels):
        (roundScrollViewContentSize):
        (-[WKWebView _currentContentView]):
        (-[WKWebView _contentProviderRegistry]):
        (-[WKWebView _selectionGranularity]):
        (-[WKWebView _setHasCustomContentView:loadedMIMEType:]):
        (-[WKWebView _didFinishLoadingDataForCustomContentProviderWithSuggestedFilename:data:]):
        (-[WKWebView _handleKeyUIEvent:]):
        (-[WKWebView _willInvokeUIScrollViewDelegateCallback]):
        (-[WKWebView _didInvokeUIScrollViewDelegateCallback]):
        (contentZoomScale):
        (baseScrollViewBackgroundColor):
        (scrollViewBackgroundColor):
        (-[WKWebView _updateScrollViewBackground]):
        (-[WKWebView _videoControlsManagerDidChange]):
        (-[WKWebView _initialContentOffsetForScrollView]):
        (-[WKWebView _contentOffsetAdjustedForObscuredInset:]):
        (-[WKWebView _effectiveObscuredInsetEdgesAffectedBySafeArea]):
        (-[WKWebView _computedObscuredInset]):
        (-[WKWebView _computedContentInset]):
        (-[WKWebView _computedUnobscuredSafeAreaInset]):
        (-[WKWebView _processWillSwapOrDidExit]):
        (-[WKWebView _processWillSwap]):
        (-[WKWebView _processDidExit]):
        (-[WKWebView _didRelaunchProcess]):
        (-[WKWebView _didCommitLoadForMainFrame]):
        (contentOffsetBoundedInValidRange):
        (changeContentOffsetBoundedInValidRange):
        (-[WKWebView visibleRectInViewCoordinates]):
        (areEssentiallyEqualAsFloat):
        (-[WKWebView _didCommitLayerTreeDuringAnimatedResize:]):
        (-[WKWebView _didCommitLayerTree:]):
        (-[WKWebView _layerTreeCommitComplete]):
        (-[WKWebView _couldNotRestorePageState]):
        (-[WKWebView _restorePageScrollPosition:scrollOrigin:previousObscuredInset:scale:]):
        (-[WKWebView _restorePageStateToUnobscuredCenter:scale:]):
        (-[WKWebView _takeViewSnapshot]):
        (-[WKWebView _zoomToPoint:atScale:animated:]):
        (-[WKWebView _zoomToRect:atScale:origin:animated:]):
        (constrainContentOffset):
        (-[WKWebView _scrollToContentScrollPosition:scrollOrigin:]):
        (-[WKWebView _scrollToRect:origin:minimumScrollDistance:]):
        (-[WKWebView _zoomOutWithOrigin:animated:]):
        (-[WKWebView _zoomToInitialScaleWithOrigin:animated:]):
        (-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):
        (-[WKWebView _initialScaleFactor]):
        (-[WKWebView _contentZoomScale]):
        (-[WKWebView _targetContentZoomScaleForRect:currentScale:fitEntireRect:minimumScale:maximumScale:]):
        (-[WKWebView _zoomToRect:withOrigin:fitEntireRect:minimumScale:maximumScale:minimumScrollDistance:]):
        (-[WKWebView didMoveToWindow]):
        (-[WKWebView _setOpaqueInternal:]):
        (-[WKWebView setOpaque:]):
        (-[WKWebView setBackgroundColor:]):
        (-[WKWebView _allowsDoubleTapGestures]):
        (-[WKWebView _stylusTapGestureShouldCreateEditableImage]):
        (-[WKWebView usesStandardContentView]):
        (-[WKWebView scrollView:contentSizeForZoomScale:withProposedSize:]):
        (-[WKWebView viewForZoomingInScrollView:]):
        (-[WKWebView scrollViewWillBeginZooming:withView:]):
        (-[WKWebView scrollViewWillBeginDragging:]):
        (-[WKWebView _didFinishScrolling]):
        (-[WKWebView scrollViewWillEndDragging:withVelocity:targetContentOffset:]):
        (-[WKWebView scrollViewDidEndDragging:willDecelerate:]):
        (-[WKWebView scrollViewDidEndDecelerating:]):
        (-[WKWebView scrollViewDidScrollToTop:]):
        (-[WKWebView _scrollView:adjustedOffsetForOffset:translation:startPoint:locationInView:horizontalVelocity:verticalVelocity:]):
        (-[WKWebView scrollViewDidScroll:]):
        (-[WKWebView scrollViewDidZoom:]):
        (-[WKWebView scrollViewDidEndZooming:withView:atScale:]):
        (-[WKWebView scrollViewDidEndScrollingAnimation:]):
        (-[WKWebView _scrollViewDidInterruptDecelerating:]):
        (-[WKWebView _visibleRectInEnclosingView:]):
        (-[WKWebView _visibleContentRect]):
        (-[WKWebView _didScroll]):
        (-[WKWebView _enclosingScrollerScrollingEnded:]):
        (-[WKWebView _scrollViewSystemContentInset]):
        (-[WKWebView activeViewLayoutSize:]):
        (-[WKWebView _dispatchSetViewLayoutSize:]):
        (-[WKWebView _dispatchSetMaximumUnobscuredSize:]):
        (-[WKWebView _dispatchSetDeviceOrientation:]):
        (-[WKWebView _frameOrBoundsChanged]):
        (-[WKWebView _contentRectForUserInteraction]):
        (-[WKWebView _scrollViewIsRubberBanding]):
        (-[WKWebView safeAreaInsetsDidChange]):
        (-[WKWebView _scheduleVisibleContentRectUpdate]):
        (-[WKWebView _scrollViewIsInStableState:]):
        (-[WKWebView _addUpdateVisibleContentRectPreCommitHandler]):
        (-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]):
        (scrollViewCanScroll):
        (-[WKWebView _contentBoundsExtendedForRubberbandingWithScale:]):
        (-[WKWebView _updateVisibleContentRects]):
        (-[WKWebView _didStartProvisionalLoadForMainFrame]):
        (activeMaximumUnobscuredSize):
        (activeOrientation):
        (-[WKWebView _cancelAnimatedResize]):
        (-[WKWebView _didCompleteAnimatedResize]):
        (-[WKWebView _didFinishLoadForMainFrame]):
        (-[WKWebView _didFailLoadForMainFrame]):
        (-[WKWebView _didSameDocumentNavigationForMainFrame:]):
        (-[WKWebView _keyboardChangedWithInfo:adjustScrollView:]):
        (-[WKWebView _shouldUpdateKeyboardWithInfo:]):
        (-[WKWebView _keyboardWillChangeFrame:]):
        (-[WKWebView _keyboardDidChangeFrame:]):
        (-[WKWebView _keyboardWillShow:]):
        (-[WKWebView _keyboardDidShow:]):
        (-[WKWebView _keyboardWillHide:]):
        (-[WKWebView _windowDidRotate:]):
        (-[WKWebView _contentSizeCategoryDidChange:]):
        (-[WKWebView _accessibilitySettingsDidChange:]):
        (-[WKWebView _contentSizeCategory]):
        (-[WKWebView _isNavigationSwipeGestureRecognizer:]):
        (-[WKWebView _navigationGestureDidBegin]):
        (-[WKWebView _navigationGestureDidEnd]):
        (-[WKWebView _showPasswordViewWithDocumentName:passwordHandler:]):
        (-[WKWebView _hidePasswordView]):
        (-[WKWebView _passwordView]):
        (-[WKWebView _updateScrollViewInsetAdjustmentBehavior]):
        (-[WKWebView _setAvoidsUnsafeArea:]):
        (-[WKWebView _haveSetObscuredInsets]):
        (-[WKWebView removeFromSuperview]):
        (-[WKWebView _firePresentationUpdateForPendingStableStatePresentationCallbacks]):
        (toUserInterfaceLayoutDirection):
        (-[WKWebView setSemanticContentAttribute:]):
        (-[WKWebView _contentVisibleRect]):
        (-[WKWebView _minimumLayoutSizeOverride]):
        (-[WKWebView _setViewLayoutSizeOverride:]):
        (-[WKWebView _maximumUnobscuredSizeOverride]):
        (-[WKWebView _setMaximumUnobscuredSizeOverride:]):
        (-[WKWebView _obscuredInsets]):
        (-[WKWebView _setObscuredInsets:]):
        (-[WKWebView _obscuredInsetEdgesAffectedBySafeArea]):
        (-[WKWebView _setObscuredInsetEdgesAffectedBySafeArea:]):
        (-[WKWebView _unobscuredSafeAreaInsets]):
        (-[WKWebView _setUnobscuredSafeAreaInsets:]):
        (-[WKWebView _safeAreaShouldAffectObscuredInsets]):
        (-[WKWebView _enclosingViewForExposedRectComputation]):
        (-[WKWebView _setInterfaceOrientationOverride:]):
        (-[WKWebView _interfaceOrientationOverride]):
        (-[WKWebView _clearInterfaceOrientationOverride]):
        (-[WKWebView _setAllowsViewportShrinkToFit:]):
        (-[WKWebView _allowsViewportShrinkToFit]):
        (-[WKWebView _isDisplayingPDF]):
        (-[WKWebView _dataForDisplayedPDF]):
        (-[WKWebView _suggestedFilenameForDisplayedPDF]):
        (-[WKWebView _webViewPrintFormatter]):
        (-[WKWebView _dragInteractionPolicy]):
        (-[WKWebView _setDragInteractionPolicy:]):
        (-[WKWebView _shouldAvoidResizingWhenInputViewBoundsChange]):
        (-[WKWebView _contentViewIsFirstResponder]):
        (-[WKWebView _uiTextCaretRect]):
        (-[WKWebView _safeBrowsingWarning]):
        (-[WKWebView _convertPointFromContentsToView:]):
        (-[WKWebView _convertPointFromViewToContents:]):
        (-[WKWebView _doAfterNextStablePresentationUpdate:]):
        (-[WKWebView _setFont:sender:]):
        (-[WKWebView _setFontSize:sender:]):
        (-[WKWebView _setTextColor:sender:]):
        (-[WKWebView _detectDataWithTypes:completionHandler:]):
        (-[WKWebView _requestActivatedElementAtPosition:completionBlock:]):
        (-[WKWebView didStartFormControlInteraction]):
        (-[WKWebView didEndFormControlInteraction]):
        (-[WKWebView _beginInteractiveObscuredInsetsChange]):
        (-[WKWebView _endInteractiveObscuredInsetsChange]):
        (-[WKWebView _hideContentUntilNextUpdate]):
        (-[WKWebView _beginAnimatedResizeWithUpdates:]):
        (-[WKWebView _endAnimatedResize]):
        (-[WKWebView _resizeWhileHidingContentWithUpdates:]):
        (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
        (-[WKWebView _overrideLayoutParametersWithMinimumLayoutSize:maximumUnobscuredSizeOverride:]):
        (-[WKWebView _clearOverrideLayoutParameters]):
        (viewportArgumentsFromDictionary):
        (-[WKWebView _overrideViewportWithArguments:]):
        (-[WKWebView _viewForFindUI]):
        (-[WKWebView _setOverlaidAccessoryViewsInset:]):
        (-[WKWebView _retainActiveFocusedState]):
        (-[WKWebView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]):
        (-[WKWebView _snapshotLayerContentsForBackForwardListItem:]):
        (-[WKWebView _dataDetectionResults]):
        (-[WKWebView _accessibilityRetrieveRectsAtSelectionOffset:withText:completionHandler:]):
        (-[WKWebView _accessibilityStoreSelection]):
        (-[WKWebView _accessibilityClearSelection]):
        (-[WKWebView _accessibilityRetrieveSpeakSelectionContent]):
        (-[WKWebView _accessibilityDidGetSpeakSelectionContent:]):
        (-[WKWebView _fullScreenPlaceholderView]):
        (-[WKWebView hasFullScreenWindowController]):
        (-[WKWebView closeFullScreenWindowController]):
        (-[WKWebView fullScreenWindowController]):
        (-[WKWebView _printFormatterClass]):
        (-[WKWebView _printProvider]):
        * UIProcess/API/ios/WKWebViewTestingIOS.mm:
        * UIProcess/API/mac/WKView.mm:
        (toCoreScrollbarStyle): Deleted.
        (toAPIScrollbarStyle): Deleted.
        * UIProcess/API/mac/WKWebViewMac.h: Added.
        * UIProcess/API/mac/WKWebViewMac.mm: Added.
        (toAPIScrollbarStyle):
        (toCoreScrollbarStyle):
        (-[WKWebView acceptsFirstResponder]):
        (-[WKWebView becomeFirstResponder]):
        (-[WKWebView resignFirstResponder]):
        (-[WKWebView viewWillStartLiveResize]):
        (-[WKWebView viewDidEndLiveResize]):
        (-[WKWebView isFlipped]):
        (-[WKWebView intrinsicContentSize]):
        (-[WKWebView prepareContentInRect:]):
        (-[WKWebView setFrameSize:]):
        (-[WKWebView setUserInterfaceLayoutDirection:]):
        (-[WKWebView ALLOW_DEPRECATED_IMPLEMENTATIONS_END]):
        (-[WKWebView writeSelectionToPasteboard:types:]):
        (-[WKWebView centerSelectionInVisibleArea:]):
        (-[WKWebView validRequestorForSendType:returnType:]):
        (-[WKWebView readSelectionFromPasteboard:]):
        (-[WKWebView changeFont:]):
        (-[WKWebView changeColor:]):
        (-[WKWebView changeAttributes:]):
        (-[WKWebView startSpeaking:]):
        (-[WKWebView stopSpeaking:]):
        (-[WKWebView showGuessPanel:]):
        (-[WKWebView checkSpelling:]):
        (-[WKWebView changeSpelling:]):
        (-[WKWebView toggleContinuousSpellChecking:]):
        (-[WKWebView isGrammarCheckingEnabled]):
        (-[WKWebView setGrammarCheckingEnabled:]):
        (-[WKWebView toggleGrammarChecking:]):
        (-[WKWebView toggleAutomaticSpellingCorrection:]):
        (-[WKWebView orderFrontSubstitutionsPanel:]):
        (-[WKWebView toggleSmartInsertDelete:]):
        (-[WKWebView isAutomaticQuoteSubstitutionEnabled]):
        (-[WKWebView setAutomaticQuoteSubstitutionEnabled:]):
        (-[WKWebView toggleAutomaticQuoteSubstitution:]):
        (-[WKWebView isAutomaticDashSubstitutionEnabled]):
        (-[WKWebView setAutomaticDashSubstitutionEnabled:]):
        (-[WKWebView toggleAutomaticDashSubstitution:]):
        (-[WKWebView isAutomaticLinkDetectionEnabled]):
        (-[WKWebView setAutomaticLinkDetectionEnabled:]):
        (-[WKWebView toggleAutomaticLinkDetection:]):
        (-[WKWebView isAutomaticTextReplacementEnabled]):
        (-[WKWebView setAutomaticTextReplacementEnabled:]):
        (-[WKWebView toggleAutomaticTextReplacement:]):
        (-[WKWebView uppercaseWord:]):
        (-[WKWebView lowercaseWord:]):
        (-[WKWebView capitalizeWord:]):
        (-[WKWebView _wantsKeyDownForEvent:]):
        (-[WKWebView scrollWheel:]):
        (-[WKWebView swipeWithEvent:]):
        (-[WKWebView mouseMoved:]):
        (-[WKWebView mouseDown:]):
        (-[WKWebView mouseUp:]):
        (-[WKWebView mouseDragged:]):
        (-[WKWebView mouseEntered:]):
        (-[WKWebView mouseExited:]):
        (-[WKWebView otherMouseDown:]):
        (-[WKWebView otherMouseDragged:]):
        (-[WKWebView otherMouseUp:]):
        (-[WKWebView rightMouseDown:]):
        (-[WKWebView rightMouseDragged:]):
        (-[WKWebView rightMouseUp:]):
        (-[WKWebView pressureChangeWithEvent:]):
        (-[WKWebView acceptsFirstMouse:]):
        (-[WKWebView shouldDelayWindowOrderingForEvent:]):
        (-[WKWebView doCommandBySelector:]):
        (-[WKWebView inputContext]):
        (-[WKWebView performKeyEquivalent:]):
        (-[WKWebView keyUp:]):
        (-[WKWebView keyDown:]):
        (-[WKWebView flagsChanged:]):
        (-[WKWebView setMarkedText:selectedRange:replacementRange:]):
        (-[WKWebView unmarkText]):
        (-[WKWebView selectedRange]):
        (-[WKWebView hasMarkedText]):
        (-[WKWebView markedRange]):
        (-[WKWebView attributedSubstringForProposedRange:actualRange:]):
        (-[WKWebView characterIndexForPoint:]):
        (-[WKWebView typingAttributesWithCompletionHandler:]):
        (-[WKWebView firstRectForCharacterRange:actualRange:]):
        (-[WKWebView selectedRangeWithCompletionHandler:]):
        (-[WKWebView markedRangeWithCompletionHandler:]):
        (-[WKWebView hasMarkedTextWithCompletionHandler:]):
        (-[WKWebView attributedSubstringForProposedRange:completionHandler:]):
        (-[WKWebView firstRectForCharacterRange:completionHandler:]):
        (-[WKWebView characterIndexForPoint:completionHandler:]):
        (-[WKWebView validAttributesForMarkedText]):
        (-[WKWebView draggedImage:endedAt:operation:]):
        (-[WKWebView draggingEntered:]):
        (-[WKWebView draggingUpdated:]):
        (-[WKWebView draggingExited:]):
        (-[WKWebView prepareForDragOperation:]):
        (-[WKWebView performDragOperation:]):
        (-[WKWebView _hitTest:dragTypes:]):
        (-[WKWebView _windowResizeMouseLocationIsInVisibleScrollerThumb:]):
        (-[WKWebView viewWillMoveToWindow:]):
        (-[WKWebView viewDidMoveToWindow]):
        (-[WKWebView drawRect:]):
        (-[WKWebView isOpaque]):
        (-[WKWebView mouseDownCanMoveWindow]):
        (-[WKWebView viewDidHide]):
        (-[WKWebView viewDidUnhide]):
        (-[WKWebView viewDidChangeBackingProperties]):
        (-[WKWebView _activeSpaceDidChange:]):
        (-[WKWebView accessibilityFocusedUIElement]):
        (-[WKWebView accessibilityHitTest:]):
        (-[WKWebView accessibilityAttributeValue:]):
        (-[WKWebView accessibilityAttributeValue:forParameter:]):
        (-[WKWebView hitTest:]):
        (-[WKWebView conversationIdentifier]):
        (-[WKWebView quickLookWithEvent:]):
        (-[WKWebView addTrackingRect:owner:userData:assumeInside:]):
        (-[WKWebView _addTrackingRect:owner:userData:assumeInside:useTrackingNum:]):
        (-[WKWebView _addTrackingRects:owner:userDataList:assumeInsideList:trackingNums:count:]):
        (-[WKWebView removeTrackingRect:]):
        (-[WKWebView _removeTrackingRects:count:]):
        (-[WKWebView view:stringForToolTip:point:userData:]):
        (-[WKWebView pasteboardChangedOwner:]):
        (-[WKWebView pasteboard:provideDataForType:]):
        (-[WKWebView namesOfPromisedFilesDroppedAtDestination:]):
        (-[WKWebView wantsUpdateLayer]):
        (-[WKWebView updateLayer]):
        (-[WKWebView smartMagnifyWithEvent:]):
        (-[WKWebView magnifyWithEvent:]):
        (-[WKWebView rotateWithEvent:]):
        (-[WKWebView _ensureTextFinderClient]):
        (-[WKWebView findMatchesForString:relativeToMatch:findOptions:maxResults:resultCollector:]):
        (-[WKWebView replaceMatches:withString:inSelectionOnly:resultCollector:]):
        (-[WKWebView scrollFindMatchToVisible:]):
        (-[WKWebView documentContainerView]):
        (-[WKWebView getSelectedText:]):
        (-[WKWebView selectFindMatch:completionHandler:]):
        (-[WKWebView filePromiseProvider:fileNameForType:]):
        (-[WKWebView filePromiseProvider:writePromiseToURL:completionHandler:]):
        (-[WKWebView draggingSession:sourceOperationMaskForDraggingContext:]):
        (-[WKWebView draggingSession:endedAtPoint:operation:]):
        (-[WKWebView _prepareForImmediateActionAnimation]):
        (-[WKWebView _cancelImmediateActionAnimation]):
        (-[WKWebView _completeImmediateActionAnimation]):
        (-[WKWebView _setDrawsTransparentBackground:]):
        (-[WKWebView shareSheetDidDismiss:]):
        (-[WKWebView makeTouchBar]):
        (-[WKWebView candidateListTouchBarItem]):
        (-[WKWebView _web_didAddMediaControlsManager:]):
        (-[WKWebView _web_didRemoveMediaControlsManager]):
        (-[WKWebView _interactWithMediaControlsForTesting]):
        (-[WKWebView validateUserInterfaceItem:]):
        (-[WKWebView goBack:]):
        (-[WKWebView goForward:]):
        (-[WKWebView reload:]):
        (-[WKWebView reloadFromOrigin:]):
        (-[WKWebView stopLoading:]):
        (-[WKWebView _web_superInputContext]):
        (-[WKWebView _web_superQuickLookWithEvent:]):
        (-[WKWebView _web_superSwipeWithEvent:]):
        (-[WKWebView _web_superMagnifyWithEvent:]):
        (-[WKWebView _web_superSmartMagnifyWithEvent:]):
        (-[WKWebView _web_superRemoveTrackingRect:]):
        (-[WKWebView _web_superAccessibilityAttributeValue:]):
        (-[WKWebView _web_superDoCommandBySelector:]):
        (-[WKWebView _web_superPerformKeyEquivalent:]):
        (-[WKWebView _web_superKeyDown:]):
        (-[WKWebView _web_superHitTest:]):
        (-[WKWebView _web_immediateActionAnimationControllerForHitTestResultInternal:withType:userData:]):
        (-[WKWebView _web_prepareForImmediateActionAnimation]):
        (-[WKWebView _web_cancelImmediateActionAnimation]):
        (-[WKWebView _web_completeImmediateActionAnimation]):
        (-[WKWebView _web_didChangeContentSize:]):
        (-[WKWebView _web_dragDestinationActionForDraggingInfo:]):
        (-[WKWebView _web_didPerformDragOperation:]):
        (-[WKWebView _web_dismissContentRelativeChildWindows]):
        (-[WKWebView _web_dismissContentRelativeChildWindowsWithAnimation:]):
        (-[WKWebView _web_editorStateDidChange]):
        (-[WKWebView _web_gestureEventWasNotHandledByWebCore:]):
        (-[WKWebView _web_grantDOMPasteAccess]):
        (-[WKWebView _takeFindStringFromSelectionInternal:]):
        (-[WKWebView insertText:]):
        (-[WKWebView insertText:replacementRange:]):
        (-[WKWebView _pageRefForTransitionToWKWebView]):
        (-[WKWebView _hasActiveVideoForControlsManager]):
        (-[WKWebView _ignoresNonWheelEvents]):
        (-[WKWebView _setIgnoresNonWheelEvents:]):
        (-[WKWebView _safeBrowsingWarning]):
        (-[WKWebView _pinnedState]):
        (-[WKWebView _rubberBandingEnabled]):
        (-[WKWebView _setRubberBandingEnabled:]):
        (-[WKWebView _pageExtendedBackgroundColor]):
        (-[WKWebView _backgroundColor]):
        (-[WKWebView _setBackgroundColor:]):
        (-[WKWebView _underlayColor]):
        (-[WKWebView _setUnderlayColor:]):
        (-[WKWebView _setTotalHeightOfBanners:]):
        (-[WKWebView _totalHeightOfBanners]):
        (-[WKWebView _drawsBackground]):
        (-[WKWebView _setDrawsBackground:]):
        (-[WKWebView _setTopContentInset:]):
        (-[WKWebView _topContentInset]):
        (-[WKWebView _setAutomaticallyAdjustsContentInsets:]):
        (-[WKWebView _automaticallyAdjustsContentInsets]):
        (-[WKWebView _setOverrideDeviceScaleFactor:]):
        (-[WKWebView _overrideDeviceScaleFactor]):
        (-[WKWebView _windowOcclusionDetectionEnabled]):
        (-[WKWebView _setWindowOcclusionDetectionEnabled:]):
        (-[WKWebView _spellCheckerDocumentTag]):
        (-[WKWebView _shouldExpandContentToViewHeightForAutoLayout]):
        (-[WKWebView _setShouldExpandContentToViewHeightForAutoLayout:]):
        (-[WKWebView _minimumLayoutWidth]):
        (-[WKWebView _setMinimumLayoutWidth:]):
        (-[WKWebView _alwaysShowsHorizontalScroller]):
        (-[WKWebView _setAlwaysShowsHorizontalScroller:]):
        (-[WKWebView _alwaysShowsVerticalScroller]):
        (-[WKWebView _setAlwaysShowsVerticalScroller:]):
        (-[WKWebView _useSystemAppearance]):
        (-[WKWebView _setUseSystemAppearance:]):
        (-[WKWebView _setOverlayScrollbarStyle:]):
        (-[WKWebView _overlayScrollbarStyle]):
        (-[WKWebView _inspectorAttachmentView]):
        (-[WKWebView _setInspectorAttachmentView:]):
        (-[WKWebView _setThumbnailView:]):
        (-[WKWebView _thumbnailView]):
        (-[WKWebView _setIgnoresAllEvents:]):
        (-[WKWebView _ignoresAllEvents]):
        (-[WKWebView _usePlatformFindUI]):
        (-[WKWebView _setUsePlatformFindUI:]):
        (-[WKWebView _setShouldSuppressFirstResponderChanges:]):
        (-[WKWebView _canChangeFrameLayout:]):
        (-[WKWebView _tryToSwipeWithEvent:ignoringPinnedState:]):
        (-[WKWebView _dismissContentRelativeChildWindows]):
        (-[WKWebView _setFrame:andScrollBy:]):
        (-[WKWebView _gestureEventWasNotHandledByWebCore:]):
        (-[WKWebView _disableFrameSizeUpdates]):
        (-[WKWebView _enableFrameSizeUpdates]):
        (-[WKWebView _beginDeferringViewInWindowChanges]):
        (-[WKWebView _endDeferringViewInWindowChanges]):
        (-[WKWebView _endDeferringViewInWindowChangesSync]):
        (-[WKWebView _setCustomSwipeViews:]):
        (-[WKWebView _setCustomSwipeViewsTopContentInset:]):
        (-[WKWebView _setDidMoveSwipeSnapshotCallback:]):
        (-[WKWebView _fullScreenPlaceholderView]):
        (-[WKWebView _fullScreenWindow]):
        (-[WKWebView _immediateActionAnimationControllerForHitTestResult:withType:userData:]):
        (-[WKWebView _printOperationWithPrintInfo:]):
        (-[WKWebView _printOperationWithPrintInfo:forFrame:]):
        (-[WKWebView _wantsMediaPlaybackControlsView]):
        (-[WKWebView _setWantsMediaPlaybackControlsView:]):
        (-[WKWebView _mediaPlaybackControlsView]):
        (-[WKWebView _addMediaPlaybackControlsView:]):
        (-[WKWebView _removeMediaPlaybackControlsView]):
        (-[WKWebView _prepareForMoveToWindow:completionHandler:]):
        * UIProcess/API/mac/WKWebViewTestingMac.mm:
        * UIProcess/ios/PageClientImplIOS.mm:
        * UIProcess/ios/WKContentView.mm:
        * UIProcess/ios/WKContentViewInteraction.mm:
        * UIProcess/ios/WKPDFView.mm:
        * UIProcess/ios/WKScrollView.mm:
        * UIProcess/ios/WKSystemPreviewView.mm:
        * WebKit.xcodeproj/project.pbxproj:

2019-12-14  David Kilzer  <ddkilzer@apple.com>

        Add release assert for selectedIndex in WebKit::WebPopupMenu::show()
        <https://webkit.org/b/205223>
        <rdar://problem/57929078>

        Reviewed by Wenson Hsieh.

        * WebProcess/WebCoreSupport/WebPopupMenu.cpp:
        (WebKit::WebPopupMenu::show):
        - Add release assert to check for valid `selectedIndex` to fix
          the bug.
        - Rename `index` parameter to `selectedIndex`.
        * WebProcess/WebCoreSupport/WebPopupMenu.h:
        (WebKit::WebPopupMenu::show):
        - Rename `index` parameter to `selectedIndex`.

2019-12-13  Brady Eidson  <beidson@apple.com>

        Refactor ScriptController's proliferation of ExceptionDetails*.
        https://bugs.webkit.org/show_bug.cgi?id=205151

        Reviewed by Alex Christensen.

        * UIProcess/API/C/WKPage.cpp:
        (WKPageRunJavaScriptInMainFrame):

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _evaluateJavaScript:forceUserGesture:completionHandler:]):

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::runJavaScriptInMainFrame):
        (WebKit::WebPageProxy::runJavaScriptInMainFrameScriptWorld):
        (WebKit::WebPageProxy::runJavaScriptInFrame):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:

        * WebProcess/Plugins/PluginView.cpp:
        (WebKit::PluginView::performJavaScriptURLRequest):

        * WebProcess/WebPage/WebInspectorFrontendAPIDispatcher.cpp:
        (WebKit::WebInspectorFrontendAPIDispatcher::evaluateOrQueueExpression):
        (WebKit::WebInspectorFrontendAPIDispatcher::evaluateQueuedExpressions):

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

2019-12-13  Eric Carlson  <eric.carlson@apple.com>

        Add remote media player message to load and play
        https://bugs.webkit.org/show_bug.cgi?id=205220
        <rdar://problem/57927486>

        Reviewed by Jer Noble.
        
        Add WP -> GPU process messages: PrepareForPlayback, Load, CancelLoad, Play, Pause,
        SetVolume, and SetMuted
        Add GPUP -> WP message: PlaybackStateChanged

        * GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp:
        (WebKit::RemoteMediaPlayerManagerProxy::RemoteMediaPlayerManagerProxy):
        (WebKit::RemoteMediaPlayerManagerProxy::createMediaPlayer):
        (WebKit::RemoteMediaPlayerManagerProxy::deleteMediaPlayer):
        (WebKit::RemoteMediaPlayerManagerProxy::prepareForPlayback):
        (WebKit::RemoteMediaPlayerManagerProxy::load):
        (WebKit::RemoteMediaPlayerManagerProxy::cancelLoad):
        (WebKit::RemoteMediaPlayerManagerProxy::play):
        (WebKit::RemoteMediaPlayerManagerProxy::pause):
        (WebKit::RemoteMediaPlayerManagerProxy::setVolume):
        (WebKit::RemoteMediaPlayerManagerProxy::setMuted):
        (WebKit::RemoteMediaPlayerManagerProxy::logChannel const):
        * GPUProcess/media/RemoteMediaPlayerManagerProxy.h:
        (WebKit::RemoteMediaPlayerManagerProxy::gpuConnectionToWebProcess const):
        (WebKit::RemoteMediaPlayerManagerProxy::webProcessConnection const): Deleted.
        * GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in:
        * GPUProcess/media/RemoteMediaPlayerProxy.cpp:
        (WebKit::RemoteMediaPlayerProxy::RemoteMediaPlayerProxy):
        (WebKit::RemoteMediaPlayerProxy::load):
        (WebKit::RemoteMediaPlayerProxy::prepareForPlayback):
        (WebKit::RemoteMediaPlayerProxy::cancelLoad):
        (WebKit::RemoteMediaPlayerProxy::play):
        (WebKit::RemoteMediaPlayerProxy::pause):
        (WebKit::RemoteMediaPlayerProxy::setVolume):
        (WebKit::RemoteMediaPlayerProxy::setMuted):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerNetworkStateChanged):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerReadyStateChanged):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerVolumeChanged):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerMuteChanged):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerTimeChanged):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerDurationChanged):
        (WebKit::RemoteMediaPlayerProxy::mediaPlayerRateChanged):
        * GPUProcess/media/RemoteMediaPlayerProxy.h:
        * WebProcess/GPU/GPUProcessConnection.cpp:
        (WebKit::GPUProcessConnection::didReceiveMessage):
        * WebProcess/GPU/GPUProcessConnection.h:
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
        (WebKit::MediaPlayerPrivateRemote::prepareForPlayback):
        (WebKit::MediaPlayerPrivateRemote::MediaPlayerPrivateRemote::load):
        (WebKit::MediaPlayerPrivateRemote::cancelLoad):
        (WebKit::MediaPlayerPrivateRemote::play):
        (WebKit::MediaPlayerPrivateRemote::pause):
        (WebKit::MediaPlayerPrivateRemote::setVolumeDouble):
        (WebKit::MediaPlayerPrivateRemote::setMuted):
        (WebKit::MediaPlayerPrivateRemote::muteChanged):
        (WebKit::MediaPlayerPrivateRemote::timeChanged):
        (WebKit::MediaPlayerPrivateRemote::playbackStateChanged):
        (WebKit::MediaPlayerPrivateRemote::paused const): Deleted.
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.h:
        * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp:
        (WebKit::RemoteMediaPlayerManager::RemoteMediaPlayerManager):
        (WebKit::RemoteMediaPlayerManager::~RemoteMediaPlayerManager):
        (WebKit::RemoteMediaPlayerManager::playbackStateChanged):
        * WebProcess/GPU/media/RemoteMediaPlayerManager.h:
        (WebKit::RemoteMediaPlayerManager::didReceiveMessageFromWebProcess):
        * WebProcess/GPU/media/RemoteMediaPlayerManager.messages.in:

2019-12-13  Chris Dumez  <cdumez@apple.com>

        [macOS] Swipe gesture snapshot stays too long if provisional load has not started yet when endSwipeGesture() is called
        https://bugs.webkit.org/show_bug.cgi?id=205206

        Reviewed by Tim Horton.

        Swipe gesture snapshot stays too long if provisional load has not started yet when endSwipeGesture() is called on macOS.
        This is because the SnapshotRemovalTracker::eventOccurred() calls get ignored while the SnapshotRemovalTracker is paused
        and the SnapshotRemovalTracker only gets unpaused once the provisional load has started. The idea is that we should ignore
        any events from a previous navigation. However, the SwipeGestureEnd event is a UI-side event fired by the
        ViewGestureController itself, so there is reason to ignore it. Since we ask the WebContent process to do the load in
        willEndSwipeGesture(), it is possible that the provisional load has not started yet by the time endSwipeGesture() is
        called. In such case, the SwipeGestureEnd event would get ignored and we would keep the snapshot until the timeout.

        * UIProcess/ViewGestureController.cpp:
        (WebKit::stopWaitingForEvent):
        (WebKit::ViewGestureController::SnapshotRemovalTracker::eventOccurred):
        (WebKit::ViewGestureController::endSwipeGesture):
        (WebKit::ViewGestureController::SnapshotRemovalTracker::stopWaitingForEvent): Deleted.
        * UIProcess/ViewGestureController.h:

2019-12-13  David Kilzer  <ddkilzer@apple.com>

        Add MESSAGE_CHECK() for selectedIndex in Messages::WebPageProxy::ShowPopupMenu
        <https://webkit.org/b/205177>
        <rdar://problem/57337872>

        Reviewed by Chris Dumez.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::showPopupMenu): Add MESSAGE_CHECK() to
        validate the `selectedIndex` parameter, which must be -1 to
        select no items, or a valid zero-based index into `items`.

2019-12-13  Alex Christensen  <achristensen@webkit.org>

        Allow cross-origin requests to WKURLSchemeHandlers
        https://bugs.webkit.org/show_bug.cgi?id=205198
        <rdar://problem/57897836>

        Reviewed by Brady Eidson.

        Covered by an API test.

        * UIProcess/API/Cocoa/WKURLSchemeTask.h:
        Document the requirements for cross-origin requests.
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::registerURLSchemeHandler):
        When we register a scheme handler, allow cross origin resources for that scheme.
        This will make the check in DocumentThreadableLoader::checkURLSchemeAsCORSEnabled allow the request to get to the WKURLSchemeHandler.
        The resposne must still have CORS header fields in order for the data to get to the web content, like CORS with HTTP.

2019-12-13  Wenson Hsieh  <wenson_hsieh@apple.com>

        Implement encoding/decoding for DisplayList::DrawNativeImage
        https://bugs.webkit.org/show_bug.cgi?id=205200

        Reviewed by Simon Fraser.

        Add helper functions to encode and decode NativeImagePtr (RetainPtr<CGImageRef> on Cocoa platforms). This
        mirrors the implementation of encoding and decoding for WebCore::Image, which create and draws into
        ShareableBitmap, and send a handle to the data over IPC.

        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::encodeImage):
        (IPC::decodeImage):
        (IPC::encodeNativeImage):
        (IPC::decodeNativeImage):

        Additionally make Image and NativeImagePtr encoding and decoding helpers fail quickly in the case where the
        ShareableBitmap failed to create a graphics context by having the encoder indicate whether a graphics context
        was created, and having the decoder fail if the graphics context could not be created.

        (IPC::encodeOptionalNativeImage):
        (IPC::decodeOptionalNativeImage):
        (IPC::ArgumentCoder<NativeImageHandle>::encode):
        (IPC::ArgumentCoder<NativeImageHandle>::decode):
        * Shared/WebCoreArgumentCoders.h:

2019-12-13  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Deny mach lookup access to "*.apple-extension-service" in the WebContent process
        https://bugs.webkit.org/show_bug.cgi?id=205134
        <rdar://problem/56984257>

        Reviewed by Brent Fulgham.

        Remove mach lookup access to "*.apple-extension-service" in the sandbox.

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

2019-12-13  youenn fablet  <youenn@apple.com>

        Help debugging flaky http/tests/cache-storage/page-cache-domcachestorage-pending-promise.html
        https://bugs.webkit.org/show_bug.cgi?id=205209

        Reviewed by Chris Dumez.

        Add a bunch of asserts that no pending activity is happening in the Cache Storage backend is happening
        when querying the backend representation, which is a debug tool.
        No change of behavior.

        * NetworkProcess/cache/CacheStorageEngine.cpp:
        (WebKit::CacheStorage::Engine::representation):
        * NetworkProcess/cache/CacheStorageEngineCache.h:
        (WebKit::CacheStorage::Cache::hasPendingOpeningCallbacks const):
        * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
        (WebKit::CacheStorage::Caches::appendRepresentation const):

2019-12-13  Kate Cheney  <katherine_cheney@apple.com>

        Create WebKit API calls for ITP Data
        https://bugs.webkit.org/show_bug.cgi?id=204932
        <rdar://problem/57632753>

        Reviewed by Alex Christensen. 

        This patch exposes ITP data captured in the network process through the
        Objective C API using two new classes: _WKResourceLoadStatisticsFirstParty
        and _WKResourceLoadStatisticsThirdParty.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
        (WebKit::ensureThirdPartyDataForSpecificFirstPartyDomain):
        (WebKit::getThirdPartyDataForSpecificFirstPartyDomains):
        (WebKit::ResourceLoadStatisticsMemoryStore::aggregatedThirdPartyData const):
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
        Updated mentions of ThirdPartyData to include the
        WebResourceLoadStatisticsStore:: class specifier after relocating
        ThirdPartyData.

        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::aggregatedThirdPartyData):
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
        Updated the data to be sent via completion handler from
        WebResourceLoadStatisticsStore so that calls to
        aggregatedThirdPartyData() are happening on a background thread.

        * Shared/API/APIObject.h:
        * Shared/Cocoa/APIObject.mm:
        (API::Object::newObject):
        * UIProcess/API/APIResourceLoadStatisticsFirstParty.h: Added.
        * UIProcess/API/APIResourceLoadStatisticsThirdParty.h: Added.
        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _getResourceLoadStatisticsDataSummary:]):
        * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
        * UIProcess/API/Cocoa/_WKResourceLoadStatisticsFirstParty.h: Added.
        * UIProcess/API/Cocoa/_WKResourceLoadStatisticsFirstParty.mm: Added.
        (-[_WKResourceLoadStatisticsFirstParty dealloc]):
        (-[_WKResourceLoadStatisticsFirstParty firstPartyDomain]):
        (-[_WKResourceLoadStatisticsFirstParty storageAccess]):
        (-[_WKResourceLoadStatisticsFirstParty _apiObject]):
        * UIProcess/API/Cocoa/_WKResourceLoadStatisticsFirstPartyInternal.h: Added.
        * UIProcess/API/Cocoa/_WKResourceLoadStatisticsThirdParty.h: Added.
        * UIProcess/API/Cocoa/_WKResourceLoadStatisticsThirdParty.mm: Added.
        (-[_WKResourceLoadStatisticsThirdParty dealloc]):
        (-[_WKResourceLoadStatisticsThirdParty thirdPartyDomain]):
        (-[_WKResourceLoadStatisticsThirdParty underFirstParties]):
        (-[_WKResourceLoadStatisticsThirdParty _apiObject]):
        * UIProcess/API/Cocoa/_WKResourceLoadStatisticsThirdPartyInternal.h: Added.
        _WKResourceLoadStatisticsFirstParty and _WKResourceLoadStatisticsThirdParty
        represent first and third party domains respectively which hold ITP
        data and are strongly typed to ensure the correct data is being
        exposed via API. The function and parameter names for storage access
        specify "third party" because each WKITPFirstParty holds data relevent
        to a specific third party and storage access would not make sense in
        just a first party context.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::getResourceLoadStatisticsDataSummary):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::getResourceLoadStatisticsDataSummary):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::getResourceLoadStatisticsDataSummary):
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        * WebKit.xcodeproj/project.pbxproj:

2019-12-13  Eric Carlson  <eric.carlson@apple.com>

        Add infrastructure needed for playing media player in the GPU process
        https://bugs.webkit.org/show_bug.cgi?id=205094
        <rdar://problem/57815393>

        Reviewed by Youenn Fablet.

        * DerivedSources-input.xcfilelist:
        * DerivedSources-output.xcfilelist:
        * DerivedSources.make:
        * GPUProcess/GPUConnectionToWebProcess.cpp:
        (WebKit::GPUConnectionToWebProcess::GPUConnectionToWebProcess):
        (WebKit::GPUConnectionToWebProcess::~GPUConnectionToWebProcess):
        (WebKit::GPUConnectionToWebProcess::didReceiveMessage):
        (WebKit::GPUConnectionToWebProcess::didReceiveSyncMessage):
        * GPUProcess/GPUConnectionToWebProcess.h:
        * GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp: Added.
        (WebKit::nullLogger):
        (WebKit::RemoteMediaPlayerManagerProxy::PlayerProxy::PlayerProxy):
        (WebKit::RemoteMediaPlayerManagerProxy::PlayerProxy::~PlayerProxy):
        (WebKit::RemoteMediaPlayerManagerProxy::RemoteMediaPlayerManagerProxy):
        (WebKit::RemoteMediaPlayerManagerProxy::~RemoteMediaPlayerManagerProxy):
        (WebKit::RemoteMediaPlayerManagerProxy::createMediaPlayer):
        (WebKit::RemoteMediaPlayerManagerProxy::getSupportedTypes):
        (WebKit::RemoteMediaPlayerManagerProxy::supportsType):
        (WebKit::RemoteMediaPlayerManagerProxy::originsInMediaCache):
        (WebKit::RemoteMediaPlayerManagerProxy::clearMediaCache):
        (WebKit::RemoteMediaPlayerManagerProxy::clearMediaCacheForOrigins):
        (WebKit::RemoteMediaPlayerManagerProxy::supportsKeySystem):
        * GPUProcess/media/RemoteMediaPlayerManagerProxy.h: Added.
        (WebKit::RemoteMediaPlayerManagerProxy::webProcessConnection const):
        (WebKit::RemoteMediaPlayerManagerProxy::didReceiveMessageFromWebProcess):
        (WebKit::RemoteMediaPlayerManagerProxy::didReceiveSyncMessageFromWebProcess):
        * GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in: Added.
        * Scripts/webkit/messages.py:
        * Sources.txt:
        * SourcesCocoa.txt:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: Added.
        (WebKit::MediaPlayerPrivateRemote::MediaPlayerPrivateRemote):
        (WebKit::MediaPlayerPrivateRemote::~MediaPlayerPrivateRemote):
        (WebKit::MediaPlayerPrivateRemote::MediaPlayerPrivateRemote::load):
        (WebKit::MediaPlayerPrivateRemote::load):
        (WebKit::MediaPlayerPrivateRemote::cancelLoad):
        (WebKit::MediaPlayerPrivateRemote::prepareToPlay):
        (WebKit::MediaPlayerPrivateRemote::platformLayer const):
        (WebKit::MediaPlayerPrivateRemote::setVideoFullscreenLayer):
        (WebKit::MediaPlayerPrivateRemote::updateVideoFullscreenInlineImage):
        (WebKit::MediaPlayerPrivateRemote::setVideoFullscreenFrame):
        (WebKit::MediaPlayerPrivateRemote::setVideoFullscreenGravity):
        (WebKit::MediaPlayerPrivateRemote::setVideoFullscreenMode):
        (WebKit::MediaPlayerPrivateRemote::videoFullscreenStandbyChanged):
        (WebKit::MediaPlayerPrivateRemote::accessLog const):
        (WebKit::MediaPlayerPrivateRemote::errorLog const):
        (WebKit::MediaPlayerPrivateRemote::platformErrorCode const):
        (WebKit::MediaPlayerPrivateRemote::play):
        (WebKit::MediaPlayerPrivateRemote::pause):
        (WebKit::MediaPlayerPrivateRemote::setBufferingPolicy):
        (WebKit::MediaPlayerPrivateRemote::supportsPictureInPicture const):
        (WebKit::MediaPlayerPrivateRemote::supportsFullscreen const):
        (WebKit::MediaPlayerPrivateRemote::supportsScanning const):
        (WebKit::MediaPlayerPrivateRemote::requiresImmediateCompositing const):
        (WebKit::MediaPlayerPrivateRemote::canSaveMediaData const):
        (WebKit::MediaPlayerPrivateRemote::naturalSize const):
        (WebKit::MediaPlayerPrivateRemote::hasVideo const):
        (WebKit::MediaPlayerPrivateRemote::hasAudio const):
        (WebKit::MediaPlayerPrivateRemote::setVisible):
        (WebKit::MediaPlayerPrivateRemote::MediaPlayerPrivateRemote::durationMediaTime const):
        (WebKit::MediaPlayerPrivateRemote::currentMediaTime const):
        (WebKit::MediaPlayerPrivateRemote::getStartDate const):
        (WebKit::MediaPlayerPrivateRemote::seek):
        (WebKit::MediaPlayerPrivateRemote::seekWithTolerance):
        (WebKit::MediaPlayerPrivateRemote::seeking const):
        (WebKit::MediaPlayerPrivateRemote::startTime const):
        (WebKit::MediaPlayerPrivateRemote::setRateDouble):
        (WebKit::MediaPlayerPrivateRemote::rate const):
        (WebKit::MediaPlayerPrivateRemote::setPreservesPitch):
        (WebKit::MediaPlayerPrivateRemote::paused const):
        (WebKit::MediaPlayerPrivateRemote::setVolumeDouble):
        (WebKit::MediaPlayerPrivateRemote::setMuted):
        (WebKit::MediaPlayerPrivateRemote::hasClosedCaptions const):
        (WebKit::MediaPlayerPrivateRemote::setClosedCaptionsVisible):
        (WebKit::MediaPlayerPrivateRemote::maxFastForwardRate const):
        (WebKit::MediaPlayerPrivateRemote::minFastReverseRate const):
        (WebKit::MediaPlayerPrivateRemote::networkState const):
        (WebKit::MediaPlayerPrivateRemote::readyState const):
        (WebKit::MediaPlayerPrivateRemote::seekable const):
        (WebKit::MediaPlayerPrivateRemote::buffered const):
        (WebKit::MediaPlayerPrivateRemote::maxMediaTimeSeekable const):
        (WebKit::MediaPlayerPrivateRemote::minMediaTimeSeekable const):
        (WebKit::MediaPlayerPrivateRemote::seekableTimeRangesLastModifiedTime const):
        (WebKit::MediaPlayerPrivateRemote::liveUpdateInterval const):
        (WebKit::MediaPlayerPrivateRemote::totalBytes const):
        (WebKit::MediaPlayerPrivateRemote::didLoadingProgress const):
        (WebKit::MediaPlayerPrivateRemote::setSize):
        (WebKit::MediaPlayerPrivateRemote::paint):
        (WebKit::MediaPlayerPrivateRemote::paintCurrentFrameInContext):
        (WebKit::MediaPlayerPrivateRemote::copyVideoTextureToPlatformTexture):
        (WebKit::MediaPlayerPrivateRemote::nativeImageForCurrentTime):
        (WebKit::MediaPlayerPrivateRemote::setPreload):
        (WebKit::MediaPlayerPrivateRemote::hasAvailableVideoFrame const):
        (WebKit::MediaPlayerPrivateRemote::canLoadPoster const):
        (WebKit::MediaPlayerPrivateRemote::setPoster):
        (WebKit::MediaPlayerPrivateRemote::enterFullscreen):
        (WebKit::MediaPlayerPrivateRemote::exitFullscreen):
        (WebKit::MediaPlayerPrivateRemote::wirelessPlaybackTargetName const):
        (WebKit::MediaPlayerPrivateRemote::wirelessPlaybackTargetType const):
        (WebKit::MediaPlayerPrivateRemote::wirelessVideoPlaybackDisabled const):
        (WebKit::MediaPlayerPrivateRemote::setWirelessVideoPlaybackDisabled):
        (WebKit::MediaPlayerPrivateRemote::canPlayToWirelessPlaybackTarget const):
        (WebKit::MediaPlayerPrivateRemote::isCurrentPlaybackTargetWireless const):
        (WebKit::MediaPlayerPrivateRemote::setWirelessPlaybackTarget):
        (WebKit::MediaPlayerPrivateRemote::setShouldPlayToPlaybackTarget):
        (WebKit::MediaPlayerPrivateRemote::canEnterFullscreen const):
        (WebKit::MediaPlayerPrivateRemote::supportsAcceleratedRendering const):
        (WebKit::MediaPlayerPrivateRemote::acceleratedRenderingStateChanged):
        (WebKit::MediaPlayerPrivateRemote::shouldMaintainAspectRatio const):
        (WebKit::MediaPlayerPrivateRemote::setShouldMaintainAspectRatio):
        (WebKit::MediaPlayerPrivateRemote::hasSingleSecurityOrigin const):
        (WebKit::MediaPlayerPrivateRemote::didPassCORSAccessCheck const):
        (WebKit::MediaPlayerPrivateRemote::wouldTaintOrigin const):
        (WebKit::MediaPlayerPrivateRemote::movieLoadType const):
        (WebKit::MediaPlayerPrivateRemote::prepareForRendering):
        (WebKit::MediaPlayerPrivateRemote::mediaTimeForTimeValue const):
        (WebKit::MediaPlayerPrivateRemote::maximumDurationToCacheMediaTime const):
        (WebKit::MediaPlayerPrivateRemote::decodedFrameCount const):
        (WebKit::MediaPlayerPrivateRemote::droppedFrameCount const):
        (WebKit::MediaPlayerPrivateRemote::audioDecodedByteCount const):
        (WebKit::MediaPlayerPrivateRemote::videoDecodedByteCount const):
        (WebKit::MediaPlayerPrivateRemote::setPrivateBrowsingMode):
        (WebKit::MediaPlayerPrivateRemote::engineDescription const):
        (WebKit::MediaPlayerPrivateRemote::audioSourceProvider):
        (WebKit::MediaPlayerPrivateRemote::createSession):
        (WebKit::MediaPlayerPrivateRemote::setCDMSession):
        (WebKit::MediaPlayerPrivateRemote::keyAdded):
        (WebKit::MediaPlayerPrivateRemote::cdmInstanceAttached):
        (WebKit::MediaPlayerPrivateRemote::cdmInstanceDetached):
        (WebKit::MediaPlayerPrivateRemote::attemptToDecryptWithInstance):
        (WebKit::MediaPlayerPrivateRemote::waitingForKey const):
        (WebKit::MediaPlayerPrivateRemote::requiresTextTrackRepresentation const):
        (WebKit::MediaPlayerPrivateRemote::setTextTrackRepresentation):
        (WebKit::MediaPlayerPrivateRemote::syncTextTrackBounds):
        (WebKit::MediaPlayerPrivateRemote::tracksChanged):
        (WebKit::MediaPlayerPrivateRemote::simulateAudioInterruption):
        (WebKit::MediaPlayerPrivateRemote::beginSimulatedHDCPError):
        (WebKit::MediaPlayerPrivateRemote::endSimulatedHDCPError):
        (WebKit::MediaPlayerPrivateRemote::languageOfPrimaryAudioTrack const):
        (WebKit::MediaPlayerPrivateRemote::extraMemoryCost const):
        (WebKit::MediaPlayerPrivateRemote::fileSize const):
        (WebKit::MediaPlayerPrivateRemote::ended const):
        (WebKit::MediaPlayerPrivateRemote::videoPlaybackQualityMetrics):
        (WebKit::MediaPlayerPrivateRemote::notifyTrackModeChanged):
        (WebKit::MediaPlayerPrivateRemote::notifyActiveSourceBuffersChanged):
        (WebKit::MediaPlayerPrivateRemote::setShouldDisableSleep):
        (WebKit::MediaPlayerPrivateRemote::applicationWillResignActive):
        (WebKit::MediaPlayerPrivateRemote::applicationDidBecomeActive):
        (WebKit::MediaPlayerPrivateRemote::performTaskAtMediaTime):
        (WebKit::MediaPlayerPrivateRemote::shouldIgnoreIntrinsicSize):
        (WebKit::MediaPlayerPrivateRemote::logChannel const):
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.h: Added.
        * WebProcess/GPU/media/MediaPlayerPrivateRemoteIdentifier.h: Added.
        * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp: Added.
        (WebKit::MediaPlayerRemoteFactory::MediaPlayerRemoteFactory):
        (WebKit::RemoteMediaPlayerManager::RemoteMediaPlayerManager):
        (WebKit::RemoteMediaPlayerManager::~RemoteMediaPlayerManager):
        (WebKit::RemoteMediaPlayerManager::supplementName):
        (WebKit::RemoteMediaPlayerManager::initialize):
        (WebKit::RemoteMediaPlayerManager::createRemoteMediaPlayer):
        (WebKit::RemoteMediaPlayerManager::getSupportedTypes):
        (WebKit::RemoteMediaPlayerManager::supportsTypeAndCodecs):
        (WebKit::RemoteMediaPlayerManager::supportsKeySystem):
        (WebKit::RemoteMediaPlayerManager::originsInMediaCache):
        (WebKit::RemoteMediaPlayerManager::clearMediaCache):
        (WebKit::RemoteMediaPlayerManager::clearMediaCacheForOrigins):
        (WebKit::RemoteMediaPlayerManager::networkStateChanged):
        (WebKit::RemoteMediaPlayerManager::updatePreferences):
        (WebKit::RemoteMediaPlayerManager::gpuProcessConnection const):
        * WebProcess/GPU/media/RemoteMediaPlayerManager.h: Added.
        * WebProcess/GPU/media/RemoteMediaPlayerManager.messages.in: Added.
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::updatePreferences):
        * WebProcess/WebProcess.cpp:

2019-12-13  Jim Mason  <jmason@ibinx.com>

        [GTK] WebKitGTK build hangs on g-ir-scanner
        https://bugs.webkit.org/show_bug.cgi?id=204715

        This patch fixes the static initialization order problem
        introduced by Bug 204503.

        The patch replaces the static data members with statics that
        are constructed only upon first access (i.e., the 'construct
        on first use' idiom).

        Reviewed by Carlos Garcia Campos.

        * UIProcess/glib/RemoteInspectorClient.cpp:
        (WebKit::RemoteInspectorClient::messageHandlers):
        (WebKit::RemoteInspectorClient::RemoteInspectorClient):
        * UIProcess/glib/RemoteInspectorClient.h:

2019-12-13  Per Arne Vollan  <pvollan@apple.com>

        [iOS] The AGX compiler service is incorrectly listed as a global name in sandbox
        https://bugs.webkit.org/show_bug.cgi?id=205189

        Reviewed by Brent Fulgham.

        It should be a XPC service name.

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

2019-12-12  Simon Fraser  <simon.fraser@apple.com>

        Minor WKWebView.mm code rearrangement
        https://bugs.webkit.org/show_bug.cgi?id=205129

        Reviewed by Tim Horton.

        Throw in some more #pragma marks and move some functions around, with the goal of
        having the implementation order mostly follow header order, and grouping related functions.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _pageForTesting]):
        (-[WKWebView _page]):
        (-[WKWebView urlSchemeHandlerForURLScheme:]):
        (+[WKWebView handlesURLScheme:]):
        (-[WKWebView _resolutionForShareSheetImmediateCompletionForTesting]):
        (-[WKWebView createPDFWithConfiguration:completionHandler:]):
        (-[WKWebView createWebArchiveDataWithCompletionHandler:]):
        (toFindOptions):
        (-[WKWebView findString:withConfiguration:completionHandler:]):
        (-[WKWebView setMediaType:]):
        (-[WKWebView mediaType]):
        (-[WKWebView layoutSubviews]):
        (-[WKWebView scrollView]):
        (-[WKWebView _isShowingVideoPictureInPicture]):
        (-[WKWebView _mayAutomaticallyShowVideoPictureInPicture]):
        (-[WKWebView _incrementFocusPreservationCount]):
        (-[WKWebView _decrementFocusPreservationCount]):
        (-[WKWebView _resetFocusPreservationCount]):
        (-[WKWebView _isRetainingActiveFocusedState]):
        (-[WKWebView _effectiveAppearanceIsDark]):
        (-[WKWebView _effectiveUserInterfaceLevelIsElevated]):
        (-[WKWebView _shouldAvoidResizingWhenInputViewBoundsChange]):
        (-[WKWebView _dragInteractionPolicy]):
        (-[WKWebView _setDragInteractionPolicy:]):
        (-[WKWebView _populateArchivedSubviews:]):
        (-[WKWebView _isBackground]):
        (-[WKWebView _setShouldSuppressFirstResponderChanges:]):
        (-[WKWebView _retainActiveFocusedState]):
        (-[WKWebView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]):
        (-[WKWebView _snapshotLayerContentsForBackForwardListItem:]):
        (-[WKWebView _dataDetectionResults]):
        (-[WKWebView _accessibilityRetrieveSpeakSelectionContent]):
        (-[WKWebView _accessibilityDidGetSpeakSelectionContent:]):
        (-[WKWebView _viewportSizeForCSSViewportUnits]):
        (-[WKWebView _setViewportSizeForCSSViewportUnits:]):
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/Cocoa/SOAuthorization/SOAuthorizationCoordinator.mm: Unified sources build fix (seen while doing other stuff).

2019-12-12  Simon Fraser  <simon.fraser@apple.com>

        Move WKWebView code related to testing to new files, with new private "for testing" headers.
        https://bugs.webkit.org/show_bug.cgi?id=205021

        Reviewed by Tim Horton.

        Move testing-only SPI to new private headers to discourage first parties from using
        them by mistake. Move test-only code to new files to reduce the size of WKWebView.mm.

        * SourcesCocoa.txt:
        * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _internalDoAfterNextPresentationUpdate:withoutWaitingForPainting:withoutWaitingForAnimatedResize:]):
        (-[WKWebView _prepareForImmediateActionAnimation]):
        (-[WKWebView _cancelImmediateActionAnimation]):
        (-[WKWebView _completeImmediateActionAnimation]):
        (-[WKWebView _useSystemAppearance]):
        (-[WKWebView _setUseSystemAppearance:]):
        (-[WKWebView _pageRefForTransitionToWKWebView]):
        (-[WKWebView _canChangeFrameLayout:]):
        (-[WKWebView _tryToSwipeWithEvent:ignoringPinnedState:]):
        (-[WKWebView _ignoresNonWheelEvents]):
        (-[WKWebView _setIgnoresNonWheelEvents:]):
        (-[WKWebView _hasActiveVideoForControlsManager]):
        (-[WKWebView _dismissContentRelativeChildWindows]):
        (-[WKWebView _gestureEventWasNotHandledByWebCore:]):
        (-[WKWebView _disableFrameSizeUpdates]):
        (-[WKWebView _enableFrameSizeUpdates]):
        (-[WKWebView _beginDeferringViewInWindowChanges]):
        (-[WKWebView _endDeferringViewInWindowChanges]):
        (-[WKWebView _endDeferringViewInWindowChangesSync]):
        (-[WKWebView _fullScreenPlaceholderView]):
        (-[WKWebView _fullScreenWindow]):
        (-[WKWebView _underlayColor]):
        (-[WKWebView _setUnderlayColor:]):
        (-[WKWebView _setCustomSwipeViews:]):
        (-[WKWebView _setCustomSwipeViewsTopContentInset:]):
        (-[WKWebView _setDidMoveSwipeSnapshotCallback:]):
        (-[WKWebView _setFrame:andScrollBy:]):
        (-[WKWebView _setTotalHeightOfBanners:]):
        (-[WKWebView _totalHeightOfBanners]):
        (-[WKWebView _setFont:sender:]):
        (-[WKWebView _setFontSize:sender:]):
        (-[WKWebView _setTextColor:sender:]):
        (-[WKWebView inputAccessoryView]):
        (-[WKWebView inputView]):
        (-[WKWebView _requestActivatedElementAtPosition:completionBlock:]):
        (-[WKWebView _contentVisibleRect]):
        (-[WKWebView _convertPointFromContentsToView:]):
        (-[WKWebView _convertPointFromViewToContents:]):
        (-[WKWebView didStartFormControlInteraction]):
        (-[WKWebView didEndFormControlInteraction]):
        (-[WKWebView _uiTextCaretRect]):
        (-[WKWebView _accessibilityRetrieveRectsAtSelectionOffset:withText:completionHandler:]):
        (-[WKWebView _accessibilityStoreSelection]):
        (-[WKWebView _accessibilityClearSelection]):
        (-[WKWebView _contentViewIsFirstResponder]):
        (-[WKWebView _inspector]):
        (-[WKWebView _mainFrame]):
        (-[WKWebView _isEditable]):
        (-[WKWebView _setEditable:]):
        (-[WKWebView _executeEditCommand:argument:completion:]):
        (-[WKWebView _textManipulationDelegate]):
        (-[WKWebView _setTextManipulationDelegate:]):
        (-[WKWebView _startTextManipulationsWithConfiguration:completion:]):
        (-[WKWebView _completeTextManipulation:completion:]):
        (-[WKWebView _takeFindStringFromSelection:]):
        (+[WKWebView _stringForFind]):
        (+[WKWebView _setStringForFind:]):
        (-[WKWebView _remoteObjectRegistry]):
        (-[WKWebView _handle]):
        (-[WKWebView _observedRenderingProgressEvents]):
        (-[WKWebView _historyDelegate]):
        (-[WKWebView _setHistoryDelegate:]):
        (-[WKWebView _updateMediaPlaybackControlsManager]):
        (-[WKWebView _canTogglePictureInPicture]):
        (-[WKWebView _isPictureInPictureActive]):
        (-[WKWebView _togglePictureInPicture]):
        (-[WKWebView _closeAllMediaPresentations]):
        (-[WKWebView _stopMediaCapture]):
        (-[WKWebView _stopAllMediaPlayback]):
        (-[WKWebView _suspendAllMediaPlayback]):
        (-[WKWebView _resumeAllMediaPlayback]):
        (-[WKWebView _unreachableURL]):
        (-[WKWebView _mainFrameURL]):
        (-[WKWebView _loadAlternateHTMLString:baseURL:forUnreachableURL:]):
        (-[WKWebView _loadData:MIMEType:characterEncodingName:baseURL:userData:]):
        (-[WKWebView _loadRequest:shouldOpenExternalURLs:]):
        (-[WKWebView _certificateChain]):
        (-[WKWebView _committedURL]):
        (-[WKWebView _MIMEType]):
        (-[WKWebView _userAgent]):
        (-[WKWebView _applicationNameForUserAgent]):
        (-[WKWebView _setApplicationNameForUserAgent:]):
        (-[WKWebView _customUserAgent]):
        (-[WKWebView _setCustomUserAgent:]):
        (-[WKWebView _setUserContentExtensionsEnabled:]):
        (-[WKWebView _userContentExtensionsEnabled]):
        (-[WKWebView _webProcessIdentifier]):
        (-[WKWebView _provisionalWebProcessIdentifier]):
        (-[WKWebView _killWebContentProcess]):
        (-[WKWebView _safeBrowsingWarning]):
        (-[WKWebView _reloadWithoutContentBlockers]):
        (-[WKWebView _reloadExpiredOnly]):
        (-[WKWebView _killWebContentProcessAndResetState]):
        (-[WKWebView _convertRectFromRootViewCoordinates:]):
        (-[WKWebView _convertRectToRootViewCoordinates:]):
        (-[WKWebView _requestTextInputContextsInRect:completionHandler:]):
        (-[WKWebView _focusTextInputContext:completionHandler:]):
        (-[WKWebView _takePDFSnapshotWithConfiguration:completionHandler:]):
        (-[WKWebView _setShouldSuppressFirstResponderChanges:]):
        (-[WKWebView _retainActiveFocusedState]):
        (-[WKWebView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]):
        (-[WKWebView _snapshotLayerContentsForBackForwardListItem:]):
        (-[WKWebView _dataDetectionResults]):
        (-[WKWebView _accessibilityRetrieveSpeakSelectionContent]):
        (-[WKWebView _accessibilityDidGetSpeakSelectionContent:]):
        (-[WKWebView inputAssistantItem]):
        (-[WKWebView _sessionStateData]):
        (-[WKWebView _sessionState]):
        (-[WKWebView _sessionStateWithFilter:]):
        (-[WKWebView _restoreFromSessionStateData:]):
        (-[WKWebView _restoreSessionState:andNavigate:]):
        (-[WKWebView _close]):
        (-[WKWebView _insertAttachmentWithFilename:contentType:data:options:completion:]):
        (-[WKWebView _insertAttachmentWithFileWrapper:contentType:options:completion:]):
        (-[WKWebView _insertAttachmentWithFileWrapper:contentType:completion:]):
        (-[WKWebView _attachmentForIdentifier:]):
        (-[WKWebView _simulateDeviceOrientationChangeWithAlpha:beta:gamma:]):
        (+[WKWebView _handlesSafeBrowsing]):
        (-[WKWebView _showSafeBrowsingWarningWithTitle:warning:details:completionHandler:]):
        (-[WKWebView _showSafeBrowsingWarningWithURL:title:warning:details:completionHandler:]):
        (+[WKWebView _confirmMalwareSentinel]):
        (+[WKWebView _visitUnsafeWebsiteSentinel]):
        (-[WKWebView _isJITEnabled:]):
        (-[WKWebView _evaluateJavaScriptWithoutUserGesture:completionHandler:]):
        (-[WKWebView _updateWebsitePolicies:]):
        (-[WKWebView _allowsRemoteInspection]):
        (-[WKWebView _setAllowsRemoteInspection:]):
        (-[WKWebView _remoteInspectionNameOverride]):
        (-[WKWebView _setRemoteInspectionNameOverride:]):
        (-[WKWebView _addsVisitedLinks]):
        (-[WKWebView _setAddsVisitedLinks:]):
        (-[WKWebView _networkRequestsInProgress]):
        (layoutMilestones):
        (-[WKWebView _setObservedRenderingProgressEvents:]):
        (-[WKWebView _getMainResourceDataWithCompletionHandler:]):
        (-[WKWebView _getWebArchiveDataWithCompletionHandler:]):
        (-[WKWebView _getContentsAsStringWithCompletionHandler:]):
        (-[WKWebView _getContentsAsAttributedStringWithCompletionHandler:]):
        (-[WKWebView _getApplicationManifestWithCompletionHandler:]):
        (-[WKWebView _paginationMode]):
        (-[WKWebView _setPaginationMode:]):
        (-[WKWebView _paginationBehavesLikeColumns]):
        (-[WKWebView _setPaginationBehavesLikeColumns:]):
        (-[WKWebView _pageLength]):
        (-[WKWebView _setPageLength:]):
        (-[WKWebView _gapBetweenPages]):
        (-[WKWebView _setGapBetweenPages:]):
        (-[WKWebView _paginationLineGridEnabled]):
        (-[WKWebView _setPaginationLineGridEnabled:]):
        (-[WKWebView _pageCount]):
        (-[WKWebView _supportsTextZoom]):
        (-[WKWebView _textZoomFactor]):
        (-[WKWebView _setTextZoomFactor:]):
        (-[WKWebView setPageZoom:]):
        (-[WKWebView pageZoom]):
        (-[WKWebView _pageZoomFactor]):
        (-[WKWebView _setPageZoomFactor:]):
        (-[WKWebView _diagnosticLoggingDelegate]):
        (-[WKWebView _setDiagnosticLoggingDelegate:]):
        (-[WKWebView _findDelegate]):
        (-[WKWebView _setFindDelegate:]):
        (toFindOptions):
        (-[WKWebView _countStringMatches:options:maxCount:]):
        (-[WKWebView _findString:options:maxCount:]):
        (-[WKWebView _hideFindUI]):
        (-[WKWebView _saveBackForwardSnapshotForItem:]):
        (-[WKWebView _inputDelegate]):
        (-[WKWebView _setInputDelegate:]):
        (-[WKWebView _isDisplayingStandaloneImageDocument]):
        (-[WKWebView _isDisplayingStandaloneMediaDocument]):
        (-[WKWebView _isPlayingAudio]):
        (-[WKWebView _isShowingNavigationGestureSnapshot]):
        (-[WKWebView _layoutMode]):
        (-[WKWebView _setLayoutMode:]):
        (-[WKWebView _fixedLayoutSize]):
        (-[WKWebView _setFixedLayoutSize:]):
        (-[WKWebView _setBackgroundExtendsBeyondPage:]):
        (-[WKWebView _backgroundExtendsBeyondPage]):
        (-[WKWebView _viewScale]):
        (-[WKWebView _setViewScale:]):
        (-[WKWebView _setMinimumEffectiveDeviceWidth:]):
        (-[WKWebView _minimumEffectiveDeviceWidth]):
        (-[WKWebView _setScrollPerformanceDataCollectionEnabled:]):
        (-[WKWebView _scrollPerformanceDataCollectionEnabled]):
        (-[WKWebView _scrollPerformanceData]):
        (-[WKWebView _allowsMediaDocumentInlinePlayback]):
        (-[WKWebView _setAllowsMediaDocumentInlinePlayback:]):
        (-[WKWebView _webProcessIsResponsive]):
        (-[WKWebView _setFullscreenDelegate:]):
        (-[WKWebView _fullscreenDelegate]):
        (-[WKWebView _isInFullscreen]):
        (-[WKWebView _mediaCaptureState]):
        (-[WKWebView _setMediaCaptureEnabled:]):
        (-[WKWebView _mediaCaptureEnabled]):
        (-[WKWebView _setPageMuted:]):
        (-[WKWebView _removeDataDetectedLinks:]):
        (-[WKWebView _doAfterNextPresentationUpdate:]):
        (-[WKWebView _doAfterNextPresentationUpdateWithoutWaitingForPainting:]):
        (-[WKWebView _doAfterNextStablePresentationUpdate:]):
        (-[WKWebView _detectDataWithTypes:completionHandler:]):
        (-[WKWebView removeFromSuperview]):
        (-[WKWebView _minimumLayoutSizeOverride]):
        (-[WKWebView _setViewLayoutSizeOverride:]):
        (-[WKWebView _obscuredInsets]):
        (-[WKWebView _setObscuredInsets:]):
        (-[WKWebView _obscuredInsetEdgesAffectedBySafeArea]):
        (-[WKWebView _setObscuredInsetEdgesAffectedBySafeArea:]):
        (-[WKWebView _unobscuredSafeAreaInsets]):
        (-[WKWebView _setUnobscuredSafeAreaInsets:]):
        (-[WKWebView _safeAreaShouldAffectObscuredInsets]):
        (-[WKWebView _setInterfaceOrientationOverride:]):
        (-[WKWebView _interfaceOrientationOverride]):
        (-[WKWebView _clearInterfaceOrientationOverride]):
        (-[WKWebView _maximumUnobscuredSizeOverride]):
        (-[WKWebView _setMaximumUnobscuredSizeOverride:]):
        (-[WKWebView _setAllowsViewportShrinkToFit:]):
        (-[WKWebView _allowsViewportShrinkToFit]):
        (-[WKWebView _beginInteractiveObscuredInsetsChange]):
        (-[WKWebView _endInteractiveObscuredInsetsChange]):
        (-[WKWebView _hideContentUntilNextUpdate]):
        (-[WKWebView _beginAnimatedResizeWithUpdates:]):
        (-[WKWebView _endAnimatedResize]):
        (-[WKWebView _resizeWhileHidingContentWithUpdates:]):
        (-[WKWebView _setOverlaidAccessoryViewsInset:]):
        (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
        (-[WKWebView _overrideLayoutParametersWithMinimumLayoutSize:maximumUnobscuredSizeOverride:]):
        (-[WKWebView _clearOverrideLayoutParameters]):
        (viewportArgumentsFromDictionary):
        (-[WKWebView _overrideViewportWithArguments:]):
        (-[WKWebView _viewForFindUI]):
        (-[WKWebView _isDisplayingPDF]):
        (-[WKWebView _dataForDisplayedPDF]):
        (-[WKWebView _suggestedFilenameForDisplayedPDF]):
        (-[WKWebView _webViewPrintFormatter]):
        (toUserInterfaceLayoutDirection):
        (-[WKWebView setSemanticContentAttribute:]):
        (-[WKWebView _drawsBackground]):
        (-[WKWebView _setDrawsBackground:]):
        (-[WKWebView _backgroundColor]):
        (-[WKWebView _setBackgroundColor:]):
        (-[WKWebView _setDrawsTransparentBackground:]):
        (-[WKWebView _inspectorAttachmentView]):
        (-[WKWebView _setInspectorAttachmentView:]):
        (-[WKWebView _setOverlayScrollbarStyle:]):
        (-[WKWebView _overlayScrollbarStyle]):
        (-[WKWebView _windowOcclusionDetectionEnabled]):
        (-[WKWebView _setWindowOcclusionDetectionEnabled:]):
        (-[WKWebView shareSheetDidDismiss:]):
        (-[WKWebView _setOverrideDeviceScaleFactor:]):
        (-[WKWebView _overrideDeviceScaleFactor]):
        (-[WKWebView _setTopContentInset:]):
        (-[WKWebView _topContentInset]):
        (-[WKWebView _pageExtendedBackgroundColor]):
        (-[WKWebView _pinnedState]):
        (-[WKWebView _rubberBandingEnabled]):
        (-[WKWebView _setRubberBandingEnabled:]):
        (-[WKWebView _immediateActionAnimationControllerForHitTestResult:withType:userData:]):
        (-[WKWebView _setAutomaticallyAdjustsContentInsets:]):
        (-[WKWebView _automaticallyAdjustsContentInsets]):
        (-[WKWebView _minimumLayoutWidth]):
        (-[WKWebView _setMinimumLayoutWidth:]):
        (-[WKWebView _shouldExpandContentToViewHeightForAutoLayout]):
        (-[WKWebView _setShouldExpandContentToViewHeightForAutoLayout:]):
        (-[WKWebView _alwaysShowsHorizontalScroller]):
        (-[WKWebView _setAlwaysShowsHorizontalScroller:]):
        (-[WKWebView _alwaysShowsVerticalScroller]):
        (-[WKWebView _setAlwaysShowsVerticalScroller:]):
        (-[WKWebView _printOperationWithPrintInfo:]):
        (-[WKWebView _printOperationWithPrintInfo:forFrame:]):
        (-[WKWebView setUserInterfaceLayoutDirection:]):
        (-[WKWebView _wantsMediaPlaybackControlsView]):
        (-[WKWebView _setWantsMediaPlaybackControlsView:]):
        (-[WKWebView _mediaPlaybackControlsView]):
        (-[WKWebView _addMediaPlaybackControlsView:]):
        (-[WKWebView _removeMediaPlaybackControlsView]):
        (-[WKWebView _prepareForMoveToWindow:completionHandler:]):
        (-[WKWebView _setThumbnailView:]):
        (-[WKWebView _thumbnailView]):
        (-[WKWebView _setIgnoresAllEvents:]):
        (-[WKWebView _ignoresAllEvents]):
        (-[WKWebView _spellCheckerDocumentTag]):
        (-[WKWebView _setContinuousSpellCheckingEnabledForTesting:]): Deleted.
        (-[WKWebView _contentsOfUserInterfaceItem:]): Deleted.
        (-[WKWebView _setDeviceOrientationUserPermissionHandlerForTesting:]): Deleted.
        (-[WKWebView keyboardAccessoryBarNext]): Deleted.
        (-[WKWebView keyboardAccessoryBarPrevious]): Deleted.
        (-[WKWebView applyAutocorrection:toString:withCompletionHandler:]): Deleted.
        (-[WKWebView dismissFormAccessoryView]): Deleted.
        (-[WKWebView _dismissFilePicker]): Deleted.
        (-[WKWebView setTimePickerValueToHour:minute:]): Deleted.
        (-[WKWebView selectFormAccessoryPickerRow:]): Deleted.
        (-[WKWebView selectFormPopoverTitle]): Deleted.
        (-[WKWebView textContentTypeForTesting]): Deleted.
        (-[WKWebView formInputLabel]): Deleted.
        (-[WKWebView _didShowContextMenu]): Deleted.
        (-[WKWebView _didDismissContextMenu]): Deleted.
        (-[WKWebView _inputViewBounds]): Deleted.
        (-[WKWebView _uiTextSelectionRects]): Deleted.
        (-[WKWebView _scrollingTreeAsText]): Deleted.
        (-[WKWebView _stableStateOverride]): Deleted.
        (-[WKWebView _propertiesOfLayerWithID:]): Deleted.
        (-[WKWebView _doAfterResettingSingleTapGesture:]): Deleted.
        (-[WKWebView _doAfterReceivingEditDragSnapshotForTesting:]): Deleted.
        (-[WKWebView _requestControlledElementID]): Deleted.
        (-[WKWebView _handleControlledElementIDResponse:]): Deleted.
        (-[WKWebView _handleAcceptedCandidate:]): Deleted.
        (-[WKWebView _didHandleAcceptedCandidate]): Deleted.
        (-[WKWebView _didUpdateCandidateListVisibility:]): Deleted.
        (-[WKWebView _forceRequestCandidates]): Deleted.
        (-[WKWebView _shouldRequestCandidates]): Deleted.
        (-[WKWebView _insertText:replacementRange:]): Deleted.
        (-[WKWebView _candidateRect]): Deleted.
        (-[WKWebView viewDidChangeEffectiveAppearance]): Deleted.
        (-[WKWebView _setHeaderBannerHeight:]): Deleted.
        (-[WKWebView _setFooterBannerHeight:]): Deleted.
        (-[WKWebView _doAfterProcessingAllPendingMouseEvents:]): Deleted.
        (-[WKWebView _activeMenu]): Deleted.
        (-[WKWebView _requestActiveNowPlayingSessionInfo:]): Deleted.
        (-[WKWebView _setPageScale:withOrigin:]): Deleted.
        (-[WKWebView _pageScale]): Deleted.
        (-[WKWebView _scrollingUpdatesDisabledForTesting]): Deleted.
        (-[WKWebView _setScrollingUpdatesDisabledForTesting:]): Deleted.
        (-[WKWebView _doAfterNextPresentationUpdateWithoutWaitingForAnimatedResizeForTesting:]): Deleted.
        (-[WKWebView _doAfterNextVisibleContentRectUpdate:]): Deleted.
        (-[WKWebView _disableBackForwardSnapshotVolatilityForTesting]): Deleted.
        (-[WKWebView _dragCaretRect]): Deleted.
        (-[WKWebView _simulateLongPressActionAtLocation:]): Deleted.
        (-[WKWebView _simulateTextEntered:]): Deleted.
        (-[WKWebView _dynamicUserInterfaceTraitDidChange]): Deleted.
        (-[WKWebView _beginBackSwipeForTesting]): Deleted.
        (-[WKWebView _completeBackSwipeForTesting]): Deleted.
        (-[WKWebView _setDefersLoadingForTesting:]): Deleted.
        (-[WKWebView _setShareSheetCompletesImmediatelyWithResolutionForTesting:]): Deleted.
        (-[WKWebView _hasInspectorFrontend]): Deleted.
        (-[WKWebView _processWillSuspendImminentlyForTesting]): Deleted.
        (-[WKWebView _processDidResumeForTesting]): Deleted.
        (-[WKWebView _setAssertionStateForTesting:]): Deleted.
        (-[WKWebView _hasServiceWorkerBackgroundActivityForTesting]): Deleted.
        (-[WKWebView _hasServiceWorkerForegroundActivityForTesting]): Deleted.
        (-[WKWebView _denyNextUserMediaRequest]): Deleted.
        (-[WKWebView _triggerSystemPreviewActionOnElement:document:page:]): Deleted.
        * UIProcess/API/Cocoa/WKWebViewInternal.h:
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h: Added.
        * UIProcess/API/Cocoa/WKWebViewTesting.mm: Added.
        (-[WKWebView _setPageScale:withOrigin:]):
        (-[WKWebView _pageScale]):
        (-[WKWebView _setContinuousSpellCheckingEnabledForTesting:]):
        (-[WKWebView _contentsOfUserInterfaceItem:]):
        (-[WKWebView _requestActiveNowPlayingSessionInfo:]):
        (-[WKWebView _scrollingUpdatesDisabledForTesting]):
        (-[WKWebView _setScrollingUpdatesDisabledForTesting:]):
        (-[WKWebView _doAfterNextPresentationUpdateWithoutWaitingForAnimatedResizeForTesting:]):
        (-[WKWebView _doAfterNextVisibleContentRectUpdate:]):
        (-[WKWebView _disableBackForwardSnapshotVolatilityForTesting]):
        (-[WKWebView _beginBackSwipeForTesting]):
        (-[WKWebView _completeBackSwipeForTesting]):
        (-[WKWebView _setDefersLoadingForTesting:]):
        (-[WKWebView _setShareSheetCompletesImmediatelyWithResolutionForTesting:]):
        (-[WKWebView _hasInspectorFrontend]):
        (-[WKWebView _processWillSuspendImminentlyForTesting]):
        (-[WKWebView _processDidResumeForTesting]):
        (-[WKWebView _setAssertionStateForTesting:]):
        (-[WKWebView _hasServiceWorkerBackgroundActivityForTesting]):
        (-[WKWebView _hasServiceWorkerForegroundActivityForTesting]):
        (-[WKWebView _denyNextUserMediaRequest]):
        * UIProcess/API/ios/WKWebViewPrivateForTestingIOS.h: Added.
        * UIProcess/API/ios/WKWebViewTestingIOS.mm: Added.
        (-[WKWebView keyboardAccessoryBarNext]):
        (-[WKWebView keyboardAccessoryBarPrevious]):
        (-[WKWebView applyAutocorrection:toString:withCompletionHandler:]):
        (-[WKWebView dismissFormAccessoryView]):
        (-[WKWebView _dismissFilePicker]):
        (-[WKWebView setTimePickerValueToHour:minute:]):
        (-[WKWebView selectFormAccessoryPickerRow:]):
        (-[WKWebView selectFormPopoverTitle]):
        (-[WKWebView textContentTypeForTesting]):
        (-[WKWebView formInputLabel]):
        (-[WKWebView _didShowContextMenu]):
        (-[WKWebView _didDismissContextMenu]):
        (-[WKWebView _inputViewBounds]):
        (-[WKWebView _uiTextSelectionRects]):
        (-[WKWebView _scrollingTreeAsText]):
        (-[WKWebView _stableStateOverride]):
        (-[WKWebView _propertiesOfLayerWithID:]):
        (-[WKWebView _doAfterResettingSingleTapGesture:]):
        (-[WKWebView _doAfterReceivingEditDragSnapshotForTesting:]):
        (-[WKWebView _dragCaretRect]):
        (-[WKWebView _simulateLongPressActionAtLocation:]):
        (-[WKWebView _simulateTextEntered:]):
        (-[WKWebView _dynamicUserInterfaceTraitDidChange]):
        (-[WKWebView _triggerSystemPreviewActionOnElement:document:page:]):
        (-[WKWebView _setDeviceOrientationUserPermissionHandlerForTesting:]):
        * UIProcess/API/mac/WKWebViewPrivateForTestingMac.h: Copied from Tools/TestWebKitAPI/Tests/WebKitCocoa/InteractionDeadlockAfterCrash.mm.
        * UIProcess/API/mac/WKWebViewTestingMac.mm: Added.
        (-[WKWebView _requestControlledElementID]):
        (-[WKWebView _handleControlledElementIDResponse:]):
        (-[WKWebView _handleAcceptedCandidate:]):
        (-[WKWebView _didHandleAcceptedCandidate]):
        (-[WKWebView _didUpdateCandidateListVisibility:]):
        (-[WKWebView _forceRequestCandidates]):
        (-[WKWebView _shouldRequestCandidates]):
        (-[WKWebView _insertText:replacementRange:]):
        (-[WKWebView _candidateRect]):
        (-[WKWebView viewDidChangeEffectiveAppearance]):
        (-[WKWebView _setHeaderBannerHeight:]):
        (-[WKWebView _setFooterBannerHeight:]):
        (-[WKWebView _doAfterProcessingAllPendingMouseEvents:]):
        (-[WKWebView _activeMenu]):
        * UIProcess/Cocoa/PageClientImplCocoa.mm:
        * UIProcess/ios/PageClientImplIOS.mm:
        * UIProcess/ios/WKContentViewInteraction.mm:
        * UIProcess/ios/WKMouseGestureRecognizer.h:
        * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
        * UIProcess/mac/PageClientImplMac.mm:
        * UIProcess/mac/WKFullScreenWindowController.h:
        * WebKit.xcodeproj/project.pbxproj:

2019-12-12  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Add sandbox telemetry to mach lookup rules in the WebContent process
        https://bugs.webkit.org/show_bug.cgi?id=205175

        Reviewed by Brent Fulgham.

        We have already added telemetry to many mach lookup rules, but some were missing telemetry.

        No new tests, no behavior change.

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

2019-12-12  Sihui Liu  <sihui_liu@apple.com>

        IndexedDB: make WebIDBServer a MessageReceiver to replace WebIDBConnection
        https://bugs.webkit.org/show_bug.cgi?id=205145

        Reviewed by Alex Christensen.

        Work towards <rdar://problem/56908496>. Move message handling from WebIDBConnectionToClient to WebIDBServer.

        Also, WebIDBConnectionClient now is owned by WebIDBServer instead of NetworkConnectionToWebProcess.

        No behavior change.

        * CMakeLists.txt:
        * DerivedSources-input.xcfilelist:
        * DerivedSources-output.xcfilelist:
        * DerivedSources.make:
        * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
        (WebKit::WebIDBConnectionToClient::WebIDBConnectionToClient):
        (WebKit::WebIDBConnectionToClient::messageSenderConnection const):
        (WebKit::WebIDBConnectionToClient::idbServer): Deleted.
        (WebKit::WebIDBConnectionToClient::disconnectedFromWebProcess): Deleted.
        (WebKit::WebIDBConnectionToClient::deleteDatabase): Deleted.
        (WebKit::WebIDBConnectionToClient::openDatabase): Deleted.
        (WebKit::WebIDBConnectionToClient::abortTransaction): Deleted.
        (WebKit::WebIDBConnectionToClient::commitTransaction): Deleted.
        (WebKit::WebIDBConnectionToClient::didFinishHandlingVersionChangeTransaction): Deleted.
        (WebKit::WebIDBConnectionToClient::createObjectStore): Deleted.
        (WebKit::WebIDBConnectionToClient::deleteObjectStore): Deleted.
        (WebKit::WebIDBConnectionToClient::renameObjectStore): Deleted.
        (WebKit::WebIDBConnectionToClient::clearObjectStore): Deleted.
        (WebKit::WebIDBConnectionToClient::createIndex): Deleted.
        (WebKit::WebIDBConnectionToClient::deleteIndex): Deleted.
        (WebKit::WebIDBConnectionToClient::renameIndex): Deleted.
        (WebKit::WebIDBConnectionToClient::putOrAdd): Deleted.
        (WebKit::WebIDBConnectionToClient::getRecord): Deleted.
        (WebKit::WebIDBConnectionToClient::getAllRecords): Deleted.
        (WebKit::WebIDBConnectionToClient::getCount): Deleted.
        (WebKit::WebIDBConnectionToClient::deleteRecord): Deleted.
        (WebKit::WebIDBConnectionToClient::openCursor): Deleted.
        (WebKit::WebIDBConnectionToClient::iterateCursor): Deleted.
        (WebKit::WebIDBConnectionToClient::establishTransaction): Deleted.
        (WebKit::WebIDBConnectionToClient::databaseConnectionPendingClose): Deleted.
        (WebKit::WebIDBConnectionToClient::databaseConnectionClosed): Deleted.
        (WebKit::WebIDBConnectionToClient::abortOpenAndUpgradeNeeded): Deleted.
        (WebKit::WebIDBConnectionToClient::didFireVersionChangeEvent): Deleted.
        (WebKit::WebIDBConnectionToClient::openDBRequestCancelled): Deleted.
        (WebKit::WebIDBConnectionToClient::confirmDidCloseFromServer): Deleted.
        (WebKit::WebIDBConnectionToClient::getAllDatabaseNames): Deleted.
        * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
        * NetworkProcess/IndexedDB/WebIDBServer.cpp:
        (WebKit::WebIDBServer::getAllDatabaseNames):
        (WebKit::WebIDBServer::addConnection):
        (WebKit::WebIDBServer::removeConnection):
        * NetworkProcess/IndexedDB/WebIDBServer.h:
        * NetworkProcess/IndexedDB/WebIDBServer.messages.in: Renamed from Source/WebKit/NetworkProcess/IndexedDB/WebIDBConnectionToClient.messages.in.
        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
        (WebKit::NetworkConnectionToWebProcess::didClose):
        (WebKit::NetworkConnectionToWebProcess::findNetworkActivityTracker):
        (WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer): Deleted. 
        NetworkConnectionToWebProcess::establishIDBConnectionToServer was used to ensure WebIDBConnectionToCilent member
        exists in NetworkConnectionToWebProcess. Now WebIDBConnectionToCilent is created in 
        WebIDBServer::addConnection(when NetworkConnectionToWebProcess is created), so we don't need the message to do 
        initialization.
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
        (WebKit::NetworkProcess::connectionToWebProcessClosed):
        * NetworkProcess/NetworkProcess.h:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
        (WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer):
        (WebKit::WebIDBConnectionToServer::deleteDatabase):
        (WebKit::WebIDBConnectionToServer::openDatabase):
        (WebKit::WebIDBConnectionToServer::abortTransaction):
        (WebKit::WebIDBConnectionToServer::commitTransaction):
        (WebKit::WebIDBConnectionToServer::didFinishHandlingVersionChangeTransaction):
        (WebKit::WebIDBConnectionToServer::createObjectStore):
        (WebKit::WebIDBConnectionToServer::deleteObjectStore):
        (WebKit::WebIDBConnectionToServer::renameObjectStore):
        (WebKit::WebIDBConnectionToServer::clearObjectStore):
        (WebKit::WebIDBConnectionToServer::createIndex):
        (WebKit::WebIDBConnectionToServer::deleteIndex):
        (WebKit::WebIDBConnectionToServer::renameIndex):
        (WebKit::WebIDBConnectionToServer::putOrAdd):
        (WebKit::WebIDBConnectionToServer::getRecord):
        (WebKit::WebIDBConnectionToServer::getAllRecords):
        (WebKit::WebIDBConnectionToServer::getCount):
        (WebKit::WebIDBConnectionToServer::deleteRecord):
        (WebKit::WebIDBConnectionToServer::openCursor):
        (WebKit::WebIDBConnectionToServer::iterateCursor):
        (WebKit::WebIDBConnectionToServer::establishTransaction):
        (WebKit::WebIDBConnectionToServer::databaseConnectionPendingClose):
        (WebKit::WebIDBConnectionToServer::databaseConnectionClosed):
        (WebKit::WebIDBConnectionToServer::abortOpenAndUpgradeNeeded):
        (WebKit::WebIDBConnectionToServer::didFireVersionChangeEvent):
        (WebKit::WebIDBConnectionToServer::openDBRequestCancelled):
        (WebKit::WebIDBConnectionToServer::confirmDidCloseFromServer):
        (WebKit::WebIDBConnectionToServer::getAllDatabaseNames):

2019-12-12  Chris Dumez  <cdumez@apple.com>

        Regression(r253394) swipe/basic-cached-back-swipe.html is timing out on iOS
        https://bugs.webkit.org/show_bug.cgi?id=205173

        Reviewed by Tim Horton.

        Test test was calling beginSimulatedSwipeInDirectionForTesting / completeSimulatedSwipeInDirectionForTesting
        on the ViewGestureController. This was causing beginSwipeGesture() and endSwipeGesture() but not
        willEndSwipeGesture(). This was causing the timeout since willEndSwipeGesture() now actually triggers the
        load.

        This patch also gets rid of the SnapshotRemovalTracker::SwipeAnimationEnd. We don't really need it since
        we already wait for SnapshotRemovalTracker::RepaintAfterNavigation and we won't repaint until the swipe
        animation is over (due to the layer tree being frozen during the swipe animation). The SwipeAnimationEnd
        was causing trouble because the provisional load may not have started yet by the time endSwipeGesture()
        is called, which means that the call to eventOccurred(SwipeAnimationEnd) would get ignored because the
        SnapshotRemovalTracker is still paused (it gets unpaused when the provisional load actually starts).

        * UIProcess/ViewGestureController.h:
        * UIProcess/ios/ViewGestureControllerIOS.mm:
        (WebKit::ViewGestureController::beginSwipeGesture):
        (WebKit::ViewGestureController::willEndSwipeGesture):
        (WebKit::ViewGestureController::endSwipeGesture):

2019-12-12  Alex Christensen  <achristensen@webkit.org>

        NetworkDataTaskCocoa and NetworkSessionCocoa should use public methods instead of being friends
        https://bugs.webkit.org/show_bug.cgi?id=204242

        Reviewed by Chris Dumez.

        This makes them stay good abstractions, and probably could make a good meme about not having any friends.

        * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        (WebKit::NetworkDataTaskCocoa::applySniffingPoliciesAndBindRequestToInferfaceIfNeeded):
        * NetworkProcess/cocoa/NetworkSessionCocoa.h:

2019-12-12  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Deny mach lookup access to content filter service in the WebContent sandbox
        https://bugs.webkit.org/show_bug.cgi?id=205077

        Reviewed by Brent Fulgham.

        Mach lookup access to the content filter service in the WebContent process is only needed if
        [WebFilterEvaluator isManagedSession] evaluates to true. If this is the case, issue the needed
        mach lookup sandbox extension to the WebContent process, where it will be consumed.

        * 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):

2019-12-12  Carlos Garcia Campos  <cgarcia@igalia.com>

        WebDriver: tests is_element_enabled/enabled.py::test_fieldset_disabled_descendant are failing
        https://bugs.webkit.org/show_bug.cgi?id=204700

        Reviewed by Carlos Alberto Lopez Perez.

        Add ElementEnabled atom to easily implement is element enabled command.

        * UIProcess/Automation/atoms/ElementEnabled.js: Added.
        (isEnabled.isDisabledAttributeSupported):
        (isEnabled.findParent):
        (isEnabled):

2019-12-11  Jiewen Tan  <jiewen_tan@apple.com>

        Unreviewed, a nit after r253366

        * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.h:
        Change the parameter type of the completion handler from NSData to NSString.

2019-12-11  Daniel Bates  <dabates@apple.com>

        Remove unused Frame parameter from moveByGranularityRespectingWordBoundary() and take const VisiblePosition&
        https://bugs.webkit.org/show_bug.cgi?id=205137

        Reviewed by Wenson Hsieh.

        moveByGranularityRespectingWordBoundary() never makes use of the passed Frame and does not mutate the
        passed VisiblePosition. So, do not accept the former and take the latter as a const lvalue reference.

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::moveByGranularityRespectingWordBoundary):
        (WebKit::WebPage::requestDocumentEditingContext):

2019-12-11  Daniel Bates  <dabates@apple.com>

        UIWKDocumentContext returns 0 character rects when caret is at beginning or end of text
        https://bugs.webkit.org/show_bug.cgi?id=205135
        <rdar://problem/56887914>

        Reviewed by Wenson Hsieh.

        When the specified position to move from is at the beginning or end of the text then return
        the position of the beginning or end of the nearest word based on the specified direction.

        Currently we always return the null position. As a result we do not compute a valid
        character range to convert to rectangles.

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

2019-12-11  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthn] Combine AuthenticatorResponse and PublicKeyCredentialData
        https://bugs.webkit.org/show_bug.cgi?id=190783
        <rdar://problem/57781183>

        Reviewed by Brent Fulgham.

        Code in WebKit are changed to use AuthenticatorResponse and its subtypes.

        * UIProcess/WebAuthentication/Authenticator.h:
        * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
        (WebKit::AuthenticatorManager::respondReceived):
        (WebKit::AuthenticatorManager::invokePendingCompletionHandler):
        * UIProcess/WebAuthentication/AuthenticatorManager.h:
        * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
        (WebKit::LocalAuthenticator::continueMakeCredentialAfterAttested):
        (WebKit::LocalAuthenticator::continueGetAssertionAfterUserConsented):
        * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp:
        (WebKit::WebAuthenticatorCoordinatorProxy::handleRequest):
        * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.h:
        * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.messages.in:
        * UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp:
        (WebKit::CtapAuthenticator::continueMakeCredentialAfterResponseReceived const):
        (WebKit::CtapAuthenticator::continueGetAssertionAfterResponseReceived):
        * UIProcess/WebAuthentication/fido/U2fAuthenticator.cpp:
        (WebKit::U2fAuthenticator::continueRegisterCommandAfterResponseReceived):
        (WebKit::U2fAuthenticator::continueSignCommandAfterResponseReceived):
        * WebProcess/WebAuthentication/WebAuthenticatorCoordinator.cpp:

2019-12-11  Truitt Savell  <tsavell@apple.com>

        Unreviewed, rolling out r253376.

        Broke internal builds

        Reverted changeset:

        "Move WKWebView code related to testing to new files, with
        their own headers, and stop exposing test-only functions as
        SPI."
        https://bugs.webkit.org/show_bug.cgi?id=205021
        https://trac.webkit.org/changeset/253376

2019-12-11  Chris Dumez  <cdumez@apple.com>

        There should be no user-noticeable delay when closing a tab
        https://bugs.webkit.org/show_bug.cgi?id=205069
        <rdar://problem/57797494>

        Reviewed by Ryosuke Niwa.

        There should be no user-noticeable delay when closing a tab. To achieve this, use a timeout of 50ms for doing the
        IPC handshake with the WebContent process, instead of 500ms.

        * UIProcess/WebPageProxy.cpp:

2019-12-11  Chris Dumez  <cdumez@apple.com>

        [iOS] Issue load sooner on swipe back/forward navigation
        https://bugs.webkit.org/show_bug.cgi?id=205127
        <rdar://problem/57843862>

        Reviewed by Tim Horton.

        Issue load sooner on swipe back/forward navigation on iOS. We were waiting until the end of
        the swipe animation to issue the load. We now issue the load as soon as the user lifts the finger
        off the screen and thus commits to navigating. This results in improved perceived performance
        when swiping back/forward to navigate.

        * UIProcess/ViewGestureController.cpp:
        (WebKit::ViewGestureController::didStartProvisionalOrSameDocumentLoadForMainFrame):
        (WebKit::ViewGestureController::willEndSwipeGesture):
        * UIProcess/ViewGestureController.h:
        * UIProcess/ios/ViewGestureControllerIOS.mm:
        (WebKit::ViewGestureController::beginSwipeGesture):
        (WebKit::ViewGestureController::willEndSwipeGesture):
        (WebKit::ViewGestureController::endSwipeGesture):

2019-12-11  Sihui Liu  <sihui_liu@apple.com>

        IndexedDB: Introduce WebIDBServer class
        https://bugs.webkit.org/show_bug.cgi?id=205095

        Reviewed by Alex Christensen.

        Work towards <rdar://problem/56908496>. WebIDBServer currently is just a wrapper of WebCore::IDBServer.

        * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
        (WebKit::WebIDBConnectionToClient::idbServer):
        * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
        * NetworkProcess/IndexedDB/WebIDBServer.cpp: Added.
        (WebKit::WebIDBServer::create):
        (WebKit::WebIDBServer::WebIDBServer):
        (WebKit::WebIDBServer::registerConnection):
        (WebKit::WebIDBServer::unregisterConnection):
        (WebKit::WebIDBServer::closeAndDeleteDatabasesModifiedSince):
        (WebKit::WebIDBServer::closeAndDeleteDatabasesForOrigins):
        (WebKit::WebIDBServer::suspend):
        (WebKit::WebIDBServer::resume):
        (WebKit::WebIDBServer::openDatabase):
        (WebKit::WebIDBServer::deleteDatabase):
        (WebKit::WebIDBServer::abortTransaction):
        (WebKit::WebIDBServer::commitTransaction):
        (WebKit::WebIDBServer::didFinishHandlingVersionChangeTransaction):
        (WebKit::WebIDBServer::createObjectStore):
        (WebKit::WebIDBServer::deleteObjectStore):
        (WebKit::WebIDBServer::renameObjectStore):
        (WebKit::WebIDBServer::clearObjectStore):
        (WebKit::WebIDBServer::createIndex):
        (WebKit::WebIDBServer::deleteIndex):
        (WebKit::WebIDBServer::renameIndex):
        (WebKit::WebIDBServer::putOrAdd):
        (WebKit::WebIDBServer::getRecord):
        (WebKit::WebIDBServer::getAllRecords):
        (WebKit::WebIDBServer::getCount):
        (WebKit::WebIDBServer::deleteRecord):
        (WebKit::WebIDBServer::openCursor):
        (WebKit::WebIDBServer::iterateCursor):
        (WebKit::WebIDBServer::establishTransaction):
        (WebKit::WebIDBServer::databaseConnectionPendingClose):
        (WebKit::WebIDBServer::databaseConnectionClosed):
        (WebKit::WebIDBServer::abortOpenAndUpgradeNeeded):
        (WebKit::WebIDBServer::didFireVersionChangeEvent):
        (WebKit::WebIDBServer::openDBRequestCancelled):
        (WebKit::WebIDBServer::getAllDatabaseNames):
        (WebKit::WebIDBServer::confirmDidCloseFromServer):
        * NetworkProcess/IndexedDB/WebIDBServer.h: Added.
        * NetworkProcess/NetworkProcess.cpp: replace WebCore::IDBServer with WebIDBServer.
        (WebKit::NetworkProcess::deleteWebsiteData):
        (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
        (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
        (WebKit::NetworkProcess::prepareToSuspend):
        (WebKit::NetworkProcess::resume):
        (WebKit::NetworkProcess::createWebIDBServer):
        (WebKit::NetworkProcess::webIDBServer):
        (WebKit::NetworkProcess::createIDBServer): Deleted.
        (WebKit::NetworkProcess::idbServer): Deleted.
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/cache/CacheStorageEngine.cpp:
        (WebKit::CacheStorage::Engine::requestSpace):
        * Sources.txt:
        * WebKit.xcodeproj/project.pbxproj:

2019-12-11  Don Olmstead  <don.olmstead@sony.com>

        [CMake] Add HarfBuzz targets
        https://bugs.webkit.org/show_bug.cgi?id=205042

        Reviewed by Konstantin Tokarev.

        Use the HarfBuzz targets directly instead of HARFBUZZ_LIBRARIES and
        HARFBUZZ_INCLUDE_DIRS.

        * PlatformGTK.cmake:
        * PlatformWPE.cmake:

2019-12-11  Jiewen Tan  <jiewen_tan@apple.com>

        Unreviewed, a nit after r253366

        * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.h:
        Improve the naming of the new SPI a bit.

2019-12-11  Wenson Hsieh  <wenson_hsieh@apple.com>

        Make incremental builds faster after modifying DisplayListItems.h
        https://bugs.webkit.org/show_bug.cgi?id=205032

        Reviewed by Tim Horton.

        Include DisplayListItems.h directly, since these need to know about the actual display list items (and how to
        encode or decode them).

        * GPUProcess/GPUConnectionToWebProcess.h:

2019-12-10  Simon Fraser  <simon.fraser@apple.com>

        Move WKWebView code related to testing to new files, with their own headers, and stop exposing test-only functions as SPI.
        https://bugs.webkit.org/show_bug.cgi?id=205021

        Reviewed by Tim Horton.
        
        Stop exposing WKWebView (WKTesting) as SPI, because everyone added SPI here by mistake, and
        internal clients kept using testing SPI.
        
        Instead, move testing-only functions to internal headers that are not present in the built framework,
        and move to WKWebView (WKPrivate) properties and functions that webkit clients rely on.
        
        Add WKWebViewTesting/WKWebViewTestingMac/WKWebViewTestingIOS for test-only code.
        
        WKWebViewTesting* headers are copied to a "WebKitTestSupport" directory in the Products directory, and WTR/DRT and TestWebKitAPI
        get header search paths to find the headers there.

        * SourcesCocoa.txt:
        * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _internalDoAfterNextPresentationUpdate:withoutWaitingForPainting:withoutWaitingForAnimatedResize:]):
        (-[WKWebView _prepareForImmediateActionAnimation]):
        (-[WKWebView _cancelImmediateActionAnimation]):
        (-[WKWebView _completeImmediateActionAnimation]):
        (-[WKWebView _useSystemAppearance]):
        (-[WKWebView _setUseSystemAppearance:]):
        (-[WKWebView _pageRefForTransitionToWKWebView]):
        (-[WKWebView _canChangeFrameLayout:]):
        (-[WKWebView _tryToSwipeWithEvent:ignoringPinnedState:]):
        (-[WKWebView _ignoresNonWheelEvents]):
        (-[WKWebView _setIgnoresNonWheelEvents:]):
        (-[WKWebView _hasActiveVideoForControlsManager]):
        (-[WKWebView _dismissContentRelativeChildWindows]):
        (-[WKWebView _gestureEventWasNotHandledByWebCore:]):
        (-[WKWebView _disableFrameSizeUpdates]):
        (-[WKWebView _enableFrameSizeUpdates]):
        (-[WKWebView _beginDeferringViewInWindowChanges]):
        (-[WKWebView _endDeferringViewInWindowChanges]):
        (-[WKWebView _endDeferringViewInWindowChangesSync]):
        (-[WKWebView _fullScreenPlaceholderView]):
        (-[WKWebView _fullScreenWindow]):
        (-[WKWebView _underlayColor]):
        (-[WKWebView _setUnderlayColor:]):
        (-[WKWebView _setCustomSwipeViews:]):
        (-[WKWebView _setCustomSwipeViewsTopContentInset:]):
        (-[WKWebView _setDidMoveSwipeSnapshotCallback:]):
        (-[WKWebView _setFrame:andScrollBy:]):
        (-[WKWebView _setTotalHeightOfBanners:]):
        (-[WKWebView _totalHeightOfBanners]):
        (-[WKWebView _setFont:sender:]):
        (-[WKWebView _setFontSize:sender:]):
        (-[WKWebView _setTextColor:sender:]):
        (-[WKWebView inputAccessoryView]):
        (-[WKWebView inputView]):
        (-[WKWebView _requestActivatedElementAtPosition:completionBlock:]):
        (-[WKWebView _contentVisibleRect]):
        (-[WKWebView _convertPointFromContentsToView:]):
        (-[WKWebView _convertPointFromViewToContents:]):
        (-[WKWebView didStartFormControlInteraction]):
        (-[WKWebView didEndFormControlInteraction]):
        (-[WKWebView _uiTextCaretRect]):
        (-[WKWebView _accessibilityRetrieveRectsAtSelectionOffset:withText:completionHandler:]):
        (-[WKWebView _accessibilityStoreSelection]):
        (-[WKWebView _accessibilityClearSelection]):
        (-[WKWebView _contentViewIsFirstResponder]):
        (-[WKWebView _inspector]):
        (-[WKWebView _mainFrame]):
        (-[WKWebView _isEditable]):
        (-[WKWebView _setEditable:]):
        (-[WKWebView _executeEditCommand:argument:completion:]):
        (-[WKWebView _textManipulationDelegate]):
        (-[WKWebView _setTextManipulationDelegate:]):
        (-[WKWebView _startTextManipulationsWithConfiguration:completion:]):
        (-[WKWebView _completeTextManipulation:completion:]):
        (-[WKWebView _takeFindStringFromSelection:]):
        (+[WKWebView _stringForFind]):
        (+[WKWebView _setStringForFind:]):
        (-[WKWebView _remoteObjectRegistry]):
        (-[WKWebView _handle]):
        (-[WKWebView _observedRenderingProgressEvents]):
        (-[WKWebView _historyDelegate]):
        (-[WKWebView _setHistoryDelegate:]):
        (-[WKWebView _updateMediaPlaybackControlsManager]):
        (-[WKWebView _canTogglePictureInPicture]):
        (-[WKWebView _isPictureInPictureActive]):
        (-[WKWebView _togglePictureInPicture]):
        (-[WKWebView _closeAllMediaPresentations]):
        (-[WKWebView _stopMediaCapture]):
        (-[WKWebView _stopAllMediaPlayback]):
        (-[WKWebView _suspendAllMediaPlayback]):
        (-[WKWebView _resumeAllMediaPlayback]):
        (-[WKWebView _unreachableURL]):
        (-[WKWebView _mainFrameURL]):
        (-[WKWebView _loadAlternateHTMLString:baseURL:forUnreachableURL:]):
        (-[WKWebView _loadData:MIMEType:characterEncodingName:baseURL:userData:]):
        (-[WKWebView _loadRequest:shouldOpenExternalURLs:]):
        (-[WKWebView _certificateChain]):
        (-[WKWebView _committedURL]):
        (-[WKWebView _MIMEType]):
        (-[WKWebView _userAgent]):
        (-[WKWebView _applicationNameForUserAgent]):
        (-[WKWebView _setApplicationNameForUserAgent:]):
        (-[WKWebView _customUserAgent]):
        (-[WKWebView _setCustomUserAgent:]):
        (-[WKWebView _setUserContentExtensionsEnabled:]):
        (-[WKWebView _userContentExtensionsEnabled]):
        (-[WKWebView _webProcessIdentifier]):
        (-[WKWebView _provisionalWebProcessIdentifier]):
        (-[WKWebView _killWebContentProcess]):
        (-[WKWebView _safeBrowsingWarning]):
        (-[WKWebView _reloadWithoutContentBlockers]):
        (-[WKWebView _reloadExpiredOnly]):
        (-[WKWebView _killWebContentProcessAndResetState]):
        (-[WKWebView _convertRectFromRootViewCoordinates:]):
        (-[WKWebView _convertRectToRootViewCoordinates:]):
        (-[WKWebView _requestTextInputContextsInRect:completionHandler:]):
        (-[WKWebView _focusTextInputContext:completionHandler:]):
        (-[WKWebView _takePDFSnapshotWithConfiguration:completionHandler:]):
        (-[WKWebView _setShouldSuppressFirstResponderChanges:]):
        (-[WKWebView _retainActiveFocusedState]):
        (-[WKWebView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]):
        (-[WKWebView _snapshotLayerContentsForBackForwardListItem:]):
        (-[WKWebView _dataDetectionResults]):
        (-[WKWebView _accessibilityRetrieveSpeakSelectionContent]):
        (-[WKWebView _accessibilityDidGetSpeakSelectionContent:]):
        (-[WKWebView inputAssistantItem]):
        (-[WKWebView _sessionStateData]):
        (-[WKWebView _sessionState]):
        (-[WKWebView _sessionStateWithFilter:]):
        (-[WKWebView _restoreFromSessionStateData:]):
        (-[WKWebView _restoreSessionState:andNavigate:]):
        (-[WKWebView _close]):
        (-[WKWebView _insertAttachmentWithFilename:contentType:data:options:completion:]):
        (-[WKWebView _insertAttachmentWithFileWrapper:contentType:options:completion:]):
        (-[WKWebView _insertAttachmentWithFileWrapper:contentType:completion:]):
        (-[WKWebView _attachmentForIdentifier:]):
        (-[WKWebView _simulateDeviceOrientationChangeWithAlpha:beta:gamma:]):
        (+[WKWebView _handlesSafeBrowsing]):
        (-[WKWebView _showSafeBrowsingWarningWithTitle:warning:details:completionHandler:]):
        (-[WKWebView _showSafeBrowsingWarningWithURL:title:warning:details:completionHandler:]):
        (+[WKWebView _confirmMalwareSentinel]):
        (+[WKWebView _visitUnsafeWebsiteSentinel]):
        (-[WKWebView _isJITEnabled:]):
        (-[WKWebView _evaluateJavaScriptWithoutUserGesture:completionHandler:]):
        (-[WKWebView _updateWebsitePolicies:]):
        (-[WKWebView _allowsRemoteInspection]):
        (-[WKWebView _setAllowsRemoteInspection:]):
        (-[WKWebView _remoteInspectionNameOverride]):
        (-[WKWebView _setRemoteInspectionNameOverride:]):
        (-[WKWebView _addsVisitedLinks]):
        (-[WKWebView _setAddsVisitedLinks:]):
        (-[WKWebView _networkRequestsInProgress]):
        (layoutMilestones):
        (-[WKWebView _setObservedRenderingProgressEvents:]):
        (-[WKWebView _getMainResourceDataWithCompletionHandler:]):
        (-[WKWebView _getWebArchiveDataWithCompletionHandler:]):
        (-[WKWebView _getContentsAsStringWithCompletionHandler:]):
        (-[WKWebView _getContentsAsAttributedStringWithCompletionHandler:]):
        (-[WKWebView _getApplicationManifestWithCompletionHandler:]):
        (-[WKWebView _paginationMode]):
        (-[WKWebView _setPaginationMode:]):
        (-[WKWebView _paginationBehavesLikeColumns]):
        (-[WKWebView _setPaginationBehavesLikeColumns:]):
        (-[WKWebView _pageLength]):
        (-[WKWebView _setPageLength:]):
        (-[WKWebView _gapBetweenPages]):
        (-[WKWebView _setGapBetweenPages:]):
        (-[WKWebView _paginationLineGridEnabled]):
        (-[WKWebView _setPaginationLineGridEnabled:]):
        (-[WKWebView _pageCount]):
        (-[WKWebView _supportsTextZoom]):
        (-[WKWebView _textZoomFactor]):
        (-[WKWebView _setTextZoomFactor:]):
        (-[WKWebView setPageZoom:]):
        (-[WKWebView pageZoom]):
        (-[WKWebView _pageZoomFactor]):
        (-[WKWebView _setPageZoomFactor:]):
        (-[WKWebView _diagnosticLoggingDelegate]):
        (-[WKWebView _setDiagnosticLoggingDelegate:]):
        (-[WKWebView _findDelegate]):
        (-[WKWebView _setFindDelegate:]):
        (toFindOptions):
        (-[WKWebView _countStringMatches:options:maxCount:]):
        (-[WKWebView _findString:options:maxCount:]):
        (-[WKWebView _hideFindUI]):
        (-[WKWebView _saveBackForwardSnapshotForItem:]):
        (-[WKWebView _inputDelegate]):
        (-[WKWebView _setInputDelegate:]):
        (-[WKWebView _isDisplayingStandaloneImageDocument]):
        (-[WKWebView _isDisplayingStandaloneMediaDocument]):
        (-[WKWebView _isPlayingAudio]):
        (-[WKWebView _isShowingNavigationGestureSnapshot]):
        (-[WKWebView _layoutMode]):
        (-[WKWebView _setLayoutMode:]):
        (-[WKWebView _fixedLayoutSize]):
        (-[WKWebView _setFixedLayoutSize:]):
        (-[WKWebView _setBackgroundExtendsBeyondPage:]):
        (-[WKWebView _backgroundExtendsBeyondPage]):
        (-[WKWebView _viewScale]):
        (-[WKWebView _setViewScale:]):
        (-[WKWebView _setMinimumEffectiveDeviceWidth:]):
        (-[WKWebView _minimumEffectiveDeviceWidth]):
        (-[WKWebView _setScrollPerformanceDataCollectionEnabled:]):
        (-[WKWebView _scrollPerformanceDataCollectionEnabled]):
        (-[WKWebView _scrollPerformanceData]):
        (-[WKWebView _allowsMediaDocumentInlinePlayback]):
        (-[WKWebView _setAllowsMediaDocumentInlinePlayback:]):
        (-[WKWebView _webProcessIsResponsive]):
        (-[WKWebView _setFullscreenDelegate:]):
        (-[WKWebView _fullscreenDelegate]):
        (-[WKWebView _isInFullscreen]):
        (-[WKWebView _mediaCaptureState]):
        (-[WKWebView _setMediaCaptureEnabled:]):
        (-[WKWebView _mediaCaptureEnabled]):
        (-[WKWebView _setPageMuted:]):
        (-[WKWebView _removeDataDetectedLinks:]):
        (-[WKWebView _doAfterNextPresentationUpdate:]):
        (-[WKWebView _doAfterNextPresentationUpdateWithoutWaitingForPainting:]):
        (-[WKWebView _doAfterNextStablePresentationUpdate:]):
        (-[WKWebView _detectDataWithTypes:completionHandler:]):
        (-[WKWebView removeFromSuperview]):
        (-[WKWebView _minimumLayoutSizeOverride]):
        (-[WKWebView _setViewLayoutSizeOverride:]):
        (-[WKWebView _obscuredInsets]):
        (-[WKWebView _setObscuredInsets:]):
        (-[WKWebView _obscuredInsetEdgesAffectedBySafeArea]):
        (-[WKWebView _setObscuredInsetEdgesAffectedBySafeArea:]):
        (-[WKWebView _unobscuredSafeAreaInsets]):
        (-[WKWebView _setUnobscuredSafeAreaInsets:]):
        (-[WKWebView _safeAreaShouldAffectObscuredInsets]):
        (-[WKWebView _setInterfaceOrientationOverride:]):
        (-[WKWebView _interfaceOrientationOverride]):
        (-[WKWebView _clearInterfaceOrientationOverride]):
        (-[WKWebView _maximumUnobscuredSizeOverride]):
        (-[WKWebView _setMaximumUnobscuredSizeOverride:]):
        (-[WKWebView _setAllowsViewportShrinkToFit:]):
        (-[WKWebView _allowsViewportShrinkToFit]):
        (-[WKWebView _beginInteractiveObscuredInsetsChange]):
        (-[WKWebView _endInteractiveObscuredInsetsChange]):
        (-[WKWebView _hideContentUntilNextUpdate]):
        (-[WKWebView _beginAnimatedResizeWithUpdates:]):
        (-[WKWebView _endAnimatedResize]):
        (-[WKWebView _resizeWhileHidingContentWithUpdates:]):
        (-[WKWebView _setOverlaidAccessoryViewsInset:]):
        (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
        (-[WKWebView _overrideLayoutParametersWithMinimumLayoutSize:maximumUnobscuredSizeOverride:]):
        (-[WKWebView _clearOverrideLayoutParameters]):
        (viewportArgumentsFromDictionary):
        (-[WKWebView _overrideViewportWithArguments:]):
        (-[WKWebView _viewForFindUI]):
        (-[WKWebView _isDisplayingPDF]):
        (-[WKWebView _dataForDisplayedPDF]):
        (-[WKWebView _suggestedFilenameForDisplayedPDF]):
        (-[WKWebView _webViewPrintFormatter]):
        (toUserInterfaceLayoutDirection):
        (-[WKWebView setSemanticContentAttribute:]):
        (-[WKWebView _drawsBackground]):
        (-[WKWebView _setDrawsBackground:]):
        (-[WKWebView _backgroundColor]):
        (-[WKWebView _setBackgroundColor:]):
        (-[WKWebView _setDrawsTransparentBackground:]):
        (-[WKWebView _inspectorAttachmentView]):
        (-[WKWebView _setInspectorAttachmentView:]):
        (-[WKWebView _setOverlayScrollbarStyle:]):
        (-[WKWebView _overlayScrollbarStyle]):
        (-[WKWebView _windowOcclusionDetectionEnabled]):
        (-[WKWebView _setWindowOcclusionDetectionEnabled:]):
        (-[WKWebView shareSheetDidDismiss:]):
        (-[WKWebView _setOverrideDeviceScaleFactor:]):
        (-[WKWebView _overrideDeviceScaleFactor]):
        (-[WKWebView _setTopContentInset:]):
        (-[WKWebView _topContentInset]):
        (-[WKWebView _pageExtendedBackgroundColor]):
        (-[WKWebView _pinnedState]):
        (-[WKWebView _rubberBandingEnabled]):
        (-[WKWebView _setRubberBandingEnabled:]):
        (-[WKWebView _immediateActionAnimationControllerForHitTestResult:withType:userData:]):
        (-[WKWebView _setAutomaticallyAdjustsContentInsets:]):
        (-[WKWebView _automaticallyAdjustsContentInsets]):
        (-[WKWebView _minimumLayoutWidth]):
        (-[WKWebView _setMinimumLayoutWidth:]):
        (-[WKWebView _shouldExpandContentToViewHeightForAutoLayout]):
        (-[WKWebView _setShouldExpandContentToViewHeightForAutoLayout:]):
        (-[WKWebView _alwaysShowsHorizontalScroller]):
        (-[WKWebView _setAlwaysShowsHorizontalScroller:]):
        (-[WKWebView _alwaysShowsVerticalScroller]):
        (-[WKWebView _setAlwaysShowsVerticalScroller:]):
        (-[WKWebView _printOperationWithPrintInfo:]):
        (-[WKWebView _printOperationWithPrintInfo:forFrame:]):
        (-[WKWebView setUserInterfaceLayoutDirection:]):
        (-[WKWebView _wantsMediaPlaybackControlsView]):
        (-[WKWebView _setWantsMediaPlaybackControlsView:]):
        (-[WKWebView _mediaPlaybackControlsView]):
        (-[WKWebView _addMediaPlaybackControlsView:]):
        (-[WKWebView _removeMediaPlaybackControlsView]):
        (-[WKWebView _prepareForMoveToWindow:completionHandler:]):
        (-[WKWebView _setThumbnailView:]):
        (-[WKWebView _thumbnailView]):
        (-[WKWebView _setIgnoresAllEvents:]):
        (-[WKWebView _ignoresAllEvents]):
        (-[WKWebView _spellCheckerDocumentTag]):
        (-[WKWebView _setContinuousSpellCheckingEnabledForTesting:]): Deleted.
        (-[WKWebView _contentsOfUserInterfaceItem:]): Deleted.
        (-[WKWebView keyboardAccessoryBarNext]): Deleted.
        (-[WKWebView keyboardAccessoryBarPrevious]): Deleted.
        (-[WKWebView applyAutocorrection:toString:withCompletionHandler:]): Deleted.
        (-[WKWebView dismissFormAccessoryView]): Deleted.
        (-[WKWebView _dismissFilePicker]): Deleted.
        (-[WKWebView setTimePickerValueToHour:minute:]): Deleted.
        (-[WKWebView selectFormAccessoryPickerRow:]): Deleted.
        (-[WKWebView selectFormPopoverTitle]): Deleted.
        (-[WKWebView textContentTypeForTesting]): Deleted.
        (-[WKWebView formInputLabel]): Deleted.
        (-[WKWebView _didShowContextMenu]): Deleted.
        (-[WKWebView _didDismissContextMenu]): Deleted.
        (-[WKWebView _inputViewBounds]): Deleted.
        (-[WKWebView _uiTextSelectionRects]): Deleted.
        (-[WKWebView _scrollingTreeAsText]): Deleted.
        (-[WKWebView _stableStateOverride]): Deleted.
        (-[WKWebView _propertiesOfLayerWithID:]): Deleted.
        (-[WKWebView _doAfterResettingSingleTapGesture:]): Deleted.
        (-[WKWebView _doAfterReceivingEditDragSnapshotForTesting:]): Deleted.
        (-[WKWebView _requestControlledElementID]): Deleted.
        (-[WKWebView _handleControlledElementIDResponse:]): Deleted.
        (-[WKWebView _handleAcceptedCandidate:]): Deleted.
        (-[WKWebView _didHandleAcceptedCandidate]): Deleted.
        (-[WKWebView _didUpdateCandidateListVisibility:]): Deleted.
        (-[WKWebView _forceRequestCandidates]): Deleted.
        (-[WKWebView _shouldRequestCandidates]): Deleted.
        (-[WKWebView _insertText:replacementRange:]): Deleted.
        (-[WKWebView _candidateRect]): Deleted.
        (-[WKWebView viewDidChangeEffectiveAppearance]): Deleted.
        (-[WKWebView _setHeaderBannerHeight:]): Deleted.
        (-[WKWebView _setFooterBannerHeight:]): Deleted.
        (-[WKWebView _doAfterProcessingAllPendingMouseEvents:]): Deleted.
        (-[WKWebView _activeMenu]): Deleted.
        (-[WKWebView _requestActiveNowPlayingSessionInfo:]): Deleted.
        (-[WKWebView _setPageScale:withOrigin:]): Deleted.
        (-[WKWebView _pageScale]): Deleted.
        (-[WKWebView _scrollingUpdatesDisabledForTesting]): Deleted.
        (-[WKWebView _setScrollingUpdatesDisabledForTesting:]): Deleted.
        (-[WKWebView _doAfterNextPresentationUpdateWithoutWaitingForAnimatedResizeForTesting:]): Deleted.
        (-[WKWebView _doAfterNextVisibleContentRectUpdate:]): Deleted.
        (-[WKWebView _disableBackForwardSnapshotVolatilityForTesting]): Deleted.
        (-[WKWebView _dragCaretRect]): Deleted.
        (-[WKWebView _simulateLongPressActionAtLocation:]): Deleted.
        (-[WKWebView _simulateTextEntered:]): Deleted.
        (-[WKWebView _dynamicUserInterfaceTraitDidChange]): Deleted.
        (-[WKWebView _beginBackSwipeForTesting]): Deleted.
        (-[WKWebView _completeBackSwipeForTesting]): Deleted.
        (-[WKWebView _setDefersLoadingForTesting:]): Deleted.
        (-[WKWebView _setShareSheetCompletesImmediatelyWithResolutionForTesting:]): Deleted.
        (-[WKWebView _hasInspectorFrontend]): Deleted.
        (-[WKWebView _processWillSuspendImminentlyForTesting]): Deleted.
        (-[WKWebView _processDidResumeForTesting]): Deleted.
        (-[WKWebView _setAssertionStateForTesting:]): Deleted.
        (-[WKWebView _hasServiceWorkerBackgroundActivityForTesting]): Deleted.
        (-[WKWebView _hasServiceWorkerForegroundActivityForTesting]): Deleted.
        (-[WKWebView _denyNextUserMediaRequest]): Deleted.
        (-[WKWebView _triggerSystemPreviewActionOnElement:document:page:]): Deleted.
        * UIProcess/API/Cocoa/WKWebViewInternal.h:
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/API/Cocoa/WKWebViewTesting.h: Added.
        * UIProcess/API/Cocoa/WKWebViewTesting.mm: Added.
        (-[WKWebView _setPageScale:withOrigin:]):
        (-[WKWebView _pageScale]):
        (-[WKWebView _setContinuousSpellCheckingEnabledForTesting:]):
        (-[WKWebView _contentsOfUserInterfaceItem:]):
        (-[WKWebView _requestActiveNowPlayingSessionInfo:]):
        (-[WKWebView _scrollingUpdatesDisabledForTesting]):
        (-[WKWebView _setScrollingUpdatesDisabledForTesting:]):
        (-[WKWebView _doAfterNextPresentationUpdateWithoutWaitingForAnimatedResizeForTesting:]):
        (-[WKWebView _doAfterNextVisibleContentRectUpdate:]):
        (-[WKWebView _disableBackForwardSnapshotVolatilityForTesting]):
        (-[WKWebView _beginBackSwipeForTesting]):
        (-[WKWebView _completeBackSwipeForTesting]):
        (-[WKWebView _setDefersLoadingForTesting:]):
        (-[WKWebView _setShareSheetCompletesImmediatelyWithResolutionForTesting:]):
        (-[WKWebView _hasInspectorFrontend]):
        (-[WKWebView _processWillSuspendImminentlyForTesting]):
        (-[WKWebView _processDidResumeForTesting]):
        (-[WKWebView _setAssertionStateForTesting:]):
        (-[WKWebView _hasServiceWorkerBackgroundActivityForTesting]):
        (-[WKWebView _hasServiceWorkerForegroundActivityForTesting]):
        (-[WKWebView _denyNextUserMediaRequest]):
        * UIProcess/API/ios/WKWebViewTestingIOS.h: Added.
        * UIProcess/API/ios/WKWebViewTestingIOS.mm: Added.
        (-[WKWebView keyboardAccessoryBarNext]):
        (-[WKWebView keyboardAccessoryBarPrevious]):
        (-[WKWebView applyAutocorrection:toString:withCompletionHandler:]):
        (-[WKWebView dismissFormAccessoryView]):
        (-[WKWebView _dismissFilePicker]):
        (-[WKWebView setTimePickerValueToHour:minute:]):
        (-[WKWebView selectFormAccessoryPickerRow:]):
        (-[WKWebView selectFormPopoverTitle]):
        (-[WKWebView textContentTypeForTesting]):
        (-[WKWebView formInputLabel]):
        (-[WKWebView _didShowContextMenu]):
        (-[WKWebView _didDismissContextMenu]):
        (-[WKWebView _inputViewBounds]):
        (-[WKWebView _uiTextSelectionRects]):
        (-[WKWebView _scrollingTreeAsText]):
        (-[WKWebView _stableStateOverride]):
        (-[WKWebView _propertiesOfLayerWithID:]):
        (-[WKWebView _doAfterResettingSingleTapGesture:]):
        (-[WKWebView _doAfterReceivingEditDragSnapshotForTesting:]):
        (-[WKWebView _dragCaretRect]):
        (-[WKWebView _simulateLongPressActionAtLocation:]):
        (-[WKWebView _simulateTextEntered:]):
        (-[WKWebView _dynamicUserInterfaceTraitDidChange]):
        (-[WKWebView _triggerSystemPreviewActionOnElement:document:page:]):
        * UIProcess/API/mac/WKWebViewTestingMac.h: Copied from Tools/TestWebKitAPI/Tests/WebKitCocoa/InteractionDeadlockAfterCrash.mm.
        * UIProcess/API/mac/WKWebViewTestingMac.mm: Added.
        (-[WKWebView _requestControlledElementID]):
        (-[WKWebView _handleControlledElementIDResponse:]):
        (-[WKWebView _handleAcceptedCandidate:]):
        (-[WKWebView _didHandleAcceptedCandidate]):
        (-[WKWebView _didUpdateCandidateListVisibility:]):
        (-[WKWebView _forceRequestCandidates]):
        (-[WKWebView _shouldRequestCandidates]):
        (-[WKWebView _insertText:replacementRange:]):
        (-[WKWebView _candidateRect]):
        (-[WKWebView viewDidChangeEffectiveAppearance]):
        (-[WKWebView _setHeaderBannerHeight:]):
        (-[WKWebView _setFooterBannerHeight:]):
        (-[WKWebView _doAfterProcessingAllPendingMouseEvents:]):
        (-[WKWebView _activeMenu]):
        * UIProcess/Cocoa/PageClientImplCocoa.mm:
        * UIProcess/ios/PageClientImplIOS.mm:
        * UIProcess/ios/WKContentViewInteraction.mm:
        * UIProcess/ios/WKMouseGestureRecognizer.h:
        * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
        * UIProcess/mac/PageClientImplMac.mm:
        * UIProcess/mac/WKFullScreenWindowController.h:
        * WebKit.xcodeproj/project.pbxproj:

2019-12-11  Chris Dumez  <cdumez@apple.com>

        Unreviewed iOS build fix after r253343.

        * UIProcess/API/Cocoa/WKWebViewPrivate.h:

2019-12-11  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthn] Implement dummy _WKWebAuthenticationPanel SPIs for CTAP PIN support
        https://bugs.webkit.org/show_bug.cgi?id=205100
        <rdar://problem/57822953>

        Reviewed by Brent Fulgham.

        This patch implements dummy _WKWebAuthenticationPanel SPIs for CTAP PIN support.
        CTAP PIN is a way for authenticators to be able to do user verification by asking
        clients/users for a pre-set PIN. Here is the spec:
        https://fidoalliance.org/specs/fido-v2.0-ps-20190130/fido-client-to-authenticator-protocol-v2.0-ps-20190130.html#authenticatorClientPIN
        In order to support this, WebKit needs to interacts with UIClients to ask users
        to enter the PINs. Therefore, a new set of SPI is needed.

        Here is the proposed SPI for WebKit to ask Safari for the PIN:
        @protocol _WKWebAuthenticationPanelDelegate <NSObject>
        @optional
        ...
        - (void)panel:(_WKWebAuthenticationPanel *)panel requestPINWithRetries:(NSUInteger)retries completionHandler:(void (^)(NSData *))completionHandler WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
        ...
        @end

        Retries is the number of retires before the authenticator getting blocked, which
        is a state that only factory reset can save the authenticator. UIClients can have
        a threshold and WARN users loudly when the threshold is reached.
        A byte array that is less than or equal to 63 bytes is expected to return to the
        passed completion handler. Otherwise, the completion handler will bail out.

        For error handling:
        typedef NS_ENUM(NSInteger, _WKWebAuthenticationPanelUpdate) {
            ...
            _WKWebAuthenticationPanelUpdatePINBlocked,
            _WKWebAuthenticationPanelUpdatePINAuthBlocked,
            _WKWebAuthenticationPanelUpdatePINInvalid,
        } WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));

        The above three error will be passed to UIClients via updateWebAuthenticationPanel SPI.
        _WKWebAuthenticationPanelUpdatePINBlocked means the authenticator is dead. A factory
        reset is needed.
        _WKWebAuthenticationPanelUpdatePINAuthBlocked means 3 consecutive mismatches. The
        authenticator will need to be reconnected.
        _WKWebAuthenticationPanelUpdatePINInvalid means a wrong PIN is provided. This will
        often be followed with another requestPINWithRetries delegate call.
        Here is the spec for the error:
        https://fidoalliance.org/specs/fido-v2.0-ps-20190130/fido-client-to-authenticator-protocol-v2.0-ps-20190130.html#using-pinToken-in-authenticatorMakeCredential.

        * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.h:

2019-12-10  Chris Dumez  <cdumez@apple.com>

        [macOS] Issue load sooner on swipe back/forward navigation
        https://bugs.webkit.org/show_bug.cgi?id=205087

        Reviewed by Tim Horton.

        Issue load sooner on swipe back/forward navigation on macOS. We were waiting until the end of
        the swipe animation to issue the load. We now issue the load as soon as the user lifts the finger
        off the screen and thus commits to navigating. This results in improved perceived performance
        when swiping back/forward to navigate.

        This patch does not take care of iOS because the ViewGestureController logic is different on that
        platform. There is no reason we shouldn't be able to do the same optimization on iOS too though.

        To achieve the behavior change on macOS, the following was done:
        - Issue the load in ViewGestureController::willEndSwipeGesture() instead of
          ViewGestureController::endSwipeGesture().
        - Add a new SnapshotRemovalTracker::Event::SwipeAnimationEnd event and wait for this event before
          taking away the snapshot. This makes sure we do not take away the swipe snapshot until the swipe
          animation is actually over (now that we start the navigation during the animation, instead of
          after).
        - To make sure that layer being swiped away stays the same until the end of the animation, I added
          a new SwipeAnimation reason for freezing the layer tree. At the beginning of the animation, the
          UIProcess sends a FreezeLayerTreeDueToSwipeAnimation IPC to the WebProcess to add this layer tree
          freeze reason. At the end of the animation, the UIProcess sends the UnfreezeLayerTreeDueToSwipeAnimation
          IPC to remove this freeze reason. Without this change, the layer being swiped away would sometimes
          start showing the destination site being loaded before the end of the animation. On cross-process
          navigation, not freezing the layer tree would cause the swipe animation to get interrupted when
          we have something to paint in the new process before the end of the swipe animation.

        * UIProcess/ProvisionalPageProxy.cpp:
        (WebKit::ProvisionalPageProxy::initializeWebPage):
        * UIProcess/ViewGestureController.cpp:
        (WebKit::ViewGestureController::SnapshotRemovalTracker::eventsDescription):
        (WebKit::ViewGestureController::willEndSwipeGesture):
        (WebKit::ViewGestureController::endSwipeGesture):
        * UIProcess/ViewGestureController.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::commitProvisionalPage):
        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::isLayerTreeFrozenDueToSwipeAnimation const):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::freezeLayerTreeDueToSwipeAnimation):
        (WebKit::WebPage::unfreezeLayerTreeDueToSwipeAnimation):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2019-12-10  Fujii Hironori  <Hironori.Fujii@sony.com>

        [Win] Fix MSVC warning C4701: potentially uninitialized local variable 'x' used
        https://bugs.webkit.org/show_bug.cgi?id=205052

        Reviewed by Don Olmstead.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
        (WebKit::ResourceLoadStatisticsMemoryStore::shouldRemoveAllButCookiesFor const):
        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
        (WebKit::ResourceLoadStatisticsStore::hasStatisticsExpired const):
        Zero-initialized local variables.

2019-12-10  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Calls to the device motion API should be done in the UI process
        https://bugs.webkit.org/show_bug.cgi?id=204770

        Reviewed by Brent Fulgham.

        The class WebDeviceOrientationUpdateProviderProxy will handle messages to start and stop updating device motion
        in the UI process. Also, add a message to update the device motion in the WebContent process. In the UI process,
        the device motion API is called through the already existing WebCoreMotionManager class.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
        * UIProcess/ios/WebDeviceOrientationUpdateProviderProxy.h:
        * UIProcess/ios/WebDeviceOrientationUpdateProviderProxy.messages.in:
        * UIProcess/ios/WebDeviceOrientationUpdateProviderProxy.mm:
        (WebKit::WebDeviceOrientationUpdateProviderProxy::startUpdatingDeviceMotion):
        (WebKit::WebDeviceOrientationUpdateProviderProxy::stopUpdatingDeviceMotion):
        (WebKit::WebDeviceOrientationUpdateProviderProxy::motionChanged):
        * WebProcess/WebCoreSupport/WebDeviceOrientationUpdateProvider.cpp:
        (WebKit::WebDeviceOrientationUpdateProvider::startUpdatingDeviceOrientation):
        (WebKit::WebDeviceOrientationUpdateProvider::stopUpdatingDeviceOrientation):
        (WebKit::WebDeviceOrientationUpdateProvider::startUpdatingDeviceMotion):
        (WebKit::WebDeviceOrientationUpdateProvider::stopUpdatingDeviceMotion):
        (WebKit::WebDeviceOrientationUpdateProvider::deviceOrientationChanged):
        (WebKit::WebDeviceOrientationUpdateProvider::deviceMotionChanged):
        (WebKit::WebDeviceOrientationUpdateProvider::startUpdating): Deleted.
        (WebKit::WebDeviceOrientationUpdateProvider::stopUpdating): Deleted.
        * WebProcess/WebCoreSupport/WebDeviceOrientationUpdateProvider.h:
        * WebProcess/WebCoreSupport/WebDeviceOrientationUpdateProvider.messages.in:

2019-12-10  Chris Dumez  <cdumez@apple.com>

        Unreviewed, drop debug assertion in InspectorTargetProxy::didCommitProvisionalTarget() that is hitting after r253337

        r253337 causes the ProvisionalPageProxy to get destroyed a little bit early, before didCommitProvisionalTarget()
        is called. didCommitProvisionalTarget() had an assertion that isProvisional() returns true, which merely checked
        that the ProvisionalPageProxy is still alive before nulling out its WeakPtr.

        * UIProcess/InspectorTargetProxy.cpp:
        (WebKit::InspectorTargetProxy::didCommitProvisionalTarget):

2019-12-10  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Deny mach lookup access to network extension services in the WebContent sandbox
        https://bugs.webkit.org/show_bug.cgi?id=203929

        Reviewed by Brent Fulgham.

        Mach lookup access to network extension services in the WebContent process is only needed if
        NEFilterSource.filterRequired is true. If this is the case, issue the needed mach lookup
        sandbox extensions to the WebContent process, where they will be consumed. Eventually, all
        the content filtering code should be moved to the Networking process, but since this is a
        bigger undertaking, we can issue extensions in the meantime to strengthen the sandbox.

        * 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:

2019-12-10  Chris Dumez  <cdumez@apple.com>

        Leverage the fact that WebPageProxy subclasses IPC::MessageSender to simplify IPC sending code
        https://bugs.webkit.org/show_bug.cgi?id=205065

        Reviewed by Alex Christensen.

        * UIProcess/API/C/WKPage.cpp:
        (WKPageSetPageLoaderClient):
        * 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):
        * UIProcess/RemoteWebInspectorProxy.cpp:
        (WebKit::RemoteWebInspectorProxy::load):
        (WebKit::RemoteWebInspectorProxy::sendMessageToFrontend):
        * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
        (WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy):
        * UIProcess/WebEditCommandProxy.cpp:
        (WebKit::WebEditCommandProxy::unapply):
        (WebKit::WebEditCommandProxy::reapply):
        * UIProcess/WebFrameProxy.cpp:
        (WebKit::WebFrameProxy::loadURL):
        (WebKit::WebFrameProxy::loadData):
        (WebKit::WebFrameProxy::stopLoading const):
        * UIProcess/WebInspectorProxy.cpp:
        (WebKit::WebInspectorProxy::sendMessageToFrontend):
        (WebKit::WebInspectorProxy::connect):
        (WebKit::WebInspectorProxy::close):
        (WebKit::WebInspectorProxy::updateForNewPageProcess):
        (WebKit::WebInspectorProxy::setFrontendConnection):
        (WebKit::WebInspectorProxy::showConsole):
        (WebKit::WebInspectorProxy::showResources):
        (WebKit::WebInspectorProxy::showMainResourceForFrame):
        (WebKit::WebInspectorProxy::attach):
        (WebKit::WebInspectorProxy::detach):
        (WebKit::WebInspectorProxy::togglePageProfiling):
        (WebKit::WebInspectorProxy::toggleElementSelection):
        (WebKit::WebInspectorProxy::openLocalInspectorFrontend):
        (WebKit::WebInspectorProxy::open):
        (WebKit::WebInspectorProxy::closeFrontendPageAndWindow):
        (WebKit::WebInspectorProxy::attachAvailabilityChanged):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::setUIClient):
        (WebKit::WebPageProxy::setIconLoadingClient):
        (WebKit::WebPageProxy::launchProcessForReload):
        (WebKit::WebPageProxy::launchProcessWithItem):
        (WebKit::WebPageProxy::initializeWebPage):
        (WebKit::WebPageProxy::close):
        (WebKit::WebPageProxy::loadRequestWithNavigationShared):
        (WebKit::WebPageProxy::loadFile):
        (WebKit::WebPageProxy::loadAlternateHTML):
        (WebKit::WebPageProxy::loadWebArchiveData):
        (WebKit::WebPageProxy::navigateToPDFLinkWithSimulatedClick):
        (WebKit::WebPageProxy::stopLoading):
        (WebKit::WebPageProxy::reload):
        (WebKit::WebPageProxy::goToBackForwardItem):
        (WebKit::WebPageProxy::tryRestoreScrollPosition):
        (WebKit::WebPageProxy::setControlledByAutomation):
        (WebKit::WebPageProxy::setIndicating):
        (WebKit::WebPageProxy::setBackgroundColor):
        (WebKit::WebPageProxy::setTopContentInset):
        (WebKit::WebPageProxy::setUnderlayColor):
        (WebKit::WebPageProxy::viewWillStartLiveResize):
        (WebKit::WebPageProxy::viewWillEndLiveResize):
        (WebKit::WebPageProxy::viewDidEnterWindow):
        (WebKit::WebPageProxy::dispatchActivityStateChange):
        (WebKit::WebPageProxy::layerHostingModeDidChange):
        (WebKit::WebPageProxy::setInitialFocus):
        (WebKit::WebPageProxy::clearSelection):
        (WebKit::WebPageProxy::restoreSelectionInFocusedEditableElement):
        (WebKit::WebPageProxy::validateCommand):
        (WebKit::WebPageProxy::increaseListLevel):
        (WebKit::WebPageProxy::decreaseListLevel):
        (WebKit::WebPageProxy::changeListType):
        (WebKit::WebPageProxy::setBaseWritingDirection):
        (WebKit::WebPageProxy::setNeedsFontAttributes):
        (WebKit::WebPageProxy::scheduleFullEditorStateUpdate):
        (WebKit::WebPageProxy::selectAll):
        (WebKit::WebPageProxy::executeEditCommand):
        (WebKit::WebPageProxy::requestFontAttributesAtSelectionStart):
        (WebKit::WebPageProxy::setEditable):
        (WebKit::WebPageProxy::performDragControllerAction):
        (WebKit::WebPageProxy::dragEnded):
        (WebKit::WebPageProxy::didStartDrag):
        (WebKit::WebPageProxy::dragCancelled):
        (WebKit::WebPageProxy::processNextQueuedMouseEvent):
        (WebKit::WebPageProxy::sendWheelEvent):
        (WebKit::WebPageProxy::handleKeyboardEvent):
        (WebKit::WebPageProxy::handleGestureEvent):
        (WebKit::WebPageProxy::handlePreventableTouchEvent):
        (WebKit::WebPageProxy::resetPotentialTapSecurityOrigin):
        (WebKit::WebPageProxy::handleUnpreventableTouchEvent):
        (WebKit::WebPageProxy::handleTouchEvent):
        (WebKit::WebPageProxy::cancelPointer):
        (WebKit::WebPageProxy::touchWithIdentifierWasRemoved):
        (WebKit::WebPageProxy::scrollBy):
        (WebKit::WebPageProxy::centerSelectionInVisibleArea):
        (WebKit::WebPageProxy::commitProvisionalPage):
        (WebKit::WebPageProxy::setUserAgent):
        (WebKit::WebPageProxy::resumeActiveDOMObjectsAndAnimations):
        (WebKit::WebPageProxy::suspendActiveDOMObjectsAndAnimations):
        (WebKit::WebPageProxy::setCustomTextEncodingName):
        (WebKit::WebPageProxy::restoreFromSessionState):
        (WebKit::WebPageProxy::setTextZoomFactor):
        (WebKit::WebPageProxy::setPageZoomFactor):
        (WebKit::WebPageProxy::setPageAndTextZoomFactors):
        (WebKit::WebPageProxy::scalePage):
        (WebKit::WebPageProxy::scalePageInViewCoordinates):
        (WebKit::WebPageProxy::scaleView):
        (WebKit::WebPageProxy::windowScreenDidChange):
        (WebKit::WebPageProxy::accessibilitySettingsDidChange):
        (WebKit::WebPageProxy::setUseFixedLayout):
        (WebKit::WebPageProxy::setFixedLayoutSize):
        (WebKit::WebPageProxy::setAlwaysShowsHorizontalScroller):
        (WebKit::WebPageProxy::setAlwaysShowsVerticalScroller):
        (WebKit::WebPageProxy::listenForLayoutMilestones):
        (WebKit::WebPageProxy::setSuppressScrollbarAnimations):
        (WebKit::WebPageProxy::setEnableVerticalRubberBanding):
        (WebKit::WebPageProxy::setEnableHorizontalRubberBanding):
        (WebKit::WebPageProxy::setBackgroundExtendsBeyondPage):
        (WebKit::WebPageProxy::setPaginationMode):
        (WebKit::WebPageProxy::setPaginationBehavesLikeColumns):
        (WebKit::WebPageProxy::setPageLength):
        (WebKit::WebPageProxy::setGapBetweenPages):
        (WebKit::WebPageProxy::setPaginationLineGridEnabled):
        (WebKit::WebPageProxy::findStringMatches):
        (WebKit::WebPageProxy::findString):
        (WebKit::WebPageProxy::getImageForFindMatch):
        (WebKit::WebPageProxy::selectFindMatch):
        (WebKit::WebPageProxy::indicateFindMatch):
        (WebKit::WebPageProxy::hideFindUI):
        (WebKit::WebPageProxy::countStringMatches):
        (WebKit::WebPageProxy::replaceMatches):
        (WebKit::WebPageProxy::runJavaScriptInMainFrameScriptWorld):
        (WebKit::WebPageProxy::runJavaScriptInFrame):
        (WebKit::WebPageProxy::getRenderTreeExternalRepresentation):
        (WebKit::WebPageProxy::getSourceForFrame):
        (WebKit::WebPageProxy::getContentsAsString):
        (WebKit::WebPageProxy::getBytecodeProfile):
        (WebKit::WebPageProxy::getSamplingProfilerOutput):
        (WebKit::WebPageProxy::getContentsAsMHTMLData):
        (WebKit::WebPageProxy::getSelectionOrContentsAsString):
        (WebKit::WebPageProxy::getSelectionAsWebArchiveData):
        (WebKit::WebPageProxy::getMainResourceDataOfFrame):
        (WebKit::WebPageProxy::getResourceDataFromFrame):
        (WebKit::WebPageProxy::getWebArchiveOfFrame):
        (WebKit::WebPageProxy::forceRepaint):
        (WebKit::WebPageProxy::preferencesDidChange):
        (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
        (WebKit::WebPageProxy::willSubmitForm):
        (WebKit::WebPageProxy::showShareSheet):
        (WebKit::WebPageProxy::setMediaVolume):
        (WebKit::WebPageProxy::setMuted):
        (WebKit::WebPageProxy::stopMediaCapture):
        (WebKit::WebPageProxy::stopAllMediaPlayback):
        (WebKit::WebPageProxy::suspendAllMediaPlayback):
        (WebKit::WebPageProxy::resumeAllMediaPlayback):
        (WebKit::WebPageProxy::handleMediaEvent):
        * UIProcess/gtk/WebInspectorProxyGtk.cpp:
        (WebKit::WebInspectorProxy::platformSave):

2019-12-10  Chris Dumez  <cdumez@apple.com>

        Gyroscope (DeviceMotion related) permission cannot be requested in WKWebView unless the client app sets a WKUIDelegate
        https://bugs.webkit.org/show_bug.cgi?id=203287

        Reviewed by Alex Christensen.

        Device orientation / motion events permission dialog would not be shown unless the client app
        set a WKUIDelegate on the WKWebView, even though we do not need this WKUIDelegate to show the
        prompt.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _deviceOrientationUserPermissionHandler]):
        (-[WKWebView _setDeviceOrientationUserPermissionHandler:]):
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/Cocoa/UIDelegate.mm:
        (WebKit::UIDelegate::UIClient::shouldAllowDeviceOrientationAndMotionAccess):
        * UIProcess/Cocoa/WKOrientationAccessAlert.mm:
        (WebKit::presentOrientationAccessAlert):

2019-12-10  Chris Dumez  <cdumez@apple.com>

        Unreviewed, drop bad assertion in PreconnectTask::willSendRedirectedRequest()

        PreconnectTask::willSendRedirectedRequest() may get called in case of HSTS redirect,
        so the ASSERT_NOT_REACHED() is wrong.

        * NetworkProcess/PreconnectTask.cpp:
        (WebKit::PreconnectTask::willSendRedirectedRequest):

2019-12-10  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r253212.
        https://bugs.webkit.org/show_bug.cgi?id=205074

        '<rdar://problem/57771300> REGRESSION (253212): Safari does
        not load local html file, base system Safari does not load
        RecoveryInformation.html' (Requested by nham on #webkit).

        Reverted changeset:

        "Drop support for NSURLCache callbacks in NetworkProcess"
        https://bugs.webkit.org/show_bug.cgi?id=203344
        https://trac.webkit.org/changeset/253212

2019-12-10  Chris Dumez  <cdumez@apple.com>

        [WK2][iOS] Visibility propagation view is not properly updated when navigating cross-process
        https://bugs.webkit.org/show_bug.cgi?id=205028

        Reviewed by Tim Horton.

        Make sure we keep the contextIDForVisibilityPropagation on the ProvisionalPageProxy / SuspendedPageProxy
        objects and update WebPageProxy::m_contextIDForVisibilityPropagation whenever we commit a provisional
        page. Also update ProvisionalPageProxy to listen for the WebPageProxy::DidCreateContextForVisibilityPropagation
        IPC so that it can update m_contextIDForVisibilityPropagation once the WebPage is created in the
        provisional WebProcess (which creates the visibility propagation view).

        * UIProcess/ProvisionalPageProxy.cpp:
        (WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
        (WebKit::ProvisionalPageProxy::didCreateContextForVisibilityPropagation):
        (WebKit::ProvisionalPageProxy::didReceiveMessage):
        * UIProcess/ProvisionalPageProxy.h:
        (WebKit::ProvisionalPageProxy::contextIDForVisibilityPropagation const):
        * UIProcess/SuspendedPageProxy.cpp:
        (WebKit::SuspendedPageProxy::SuspendedPageProxy):
        * UIProcess/SuspendedPageProxy.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::swapToProvisionalPage):
        (WebKit::WebPageProxy::commitProvisionalPage):
        (WebKit::WebPageProxy::resetState):
        (WebKit::WebPageProxy::swapToWebProcess): Deleted.
        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/WKContentView.mm:
        (-[WKContentView _setupVisibilityPropagationView]):
        (-[WKContentView _removeVisibilityPropagationView]):

2019-12-10  Chris Dumez  <cdumez@apple.com>

        Regression(r253277) ASSERTION FAILED: !parameters.request.httpBody() in NetworkConnectionToWebProcess::preconnectTo()
        https://bugs.webkit.org/show_bug.cgi?id=205030

        Reviewed by Antti Koivisto.

        Instead of using the full request as preconnect request, create a simple one that contains only the destination URL.
        This avoids sending a request body unnecessarily over IPC, which was the cause of the assertion.

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

2019-12-10  Chris Dumez  <cdumez@apple.com>

        Make preconnectTo()'s completionHandler optional
        https://bugs.webkit.org/show_bug.cgi?id=205011

        Reviewed by Antti Koivisto.

        Make preconnectTo()'s completionHandler optional, so that the network process does not unnecessarily
        send an IPC back if the client is not interested.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::preconnectTo):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::preconnectTo):
        * WebProcess/Network/WebLoaderStrategy.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::loadRequest):

2019-12-09  Eric Carlson  <eric.carlson@apple.com>

        Rename media in the GPU process preference
        https://bugs.webkit.org/show_bug.cgi?id=205013
        <rdar://problem/57755319>

        Reviewed by Tim Horton.

        * Shared/WebPreferences.yaml:
        * WebProcess/InjectedBundle/InjectedBundle.cpp:
        (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):

2019-12-09  Truitt Savell  <tsavell@apple.com>

        Unreviewed, rolling out r253299.

        Casued 30+ imported/ test failures on Mac wk2

        Reverted changeset:

        "Throttling requestAnimationFrame should be controlled by
        RenderingUpdateScheduler"
        https://bugs.webkit.org/show_bug.cgi?id=204713
        https://trac.webkit.org/changeset/253299

2019-12-09  Chris Dumez  <cdumez@apple.com>

        Regression(r249329) ViewGestureController::requestRenderTreeSizeNotificationIfNeeded() sometimes uses wrong webPageID for IPC
        https://bugs.webkit.org/show_bug.cgi?id=205012

        Reviewed by Tim Horton.

        * UIProcess/InspectorTargetProxy.cpp:
        (WebKit::InspectorTargetProxy::connect):
        (WebKit::InspectorTargetProxy::disconnect):
        (WebKit::InspectorTargetProxy::sendMessageToTargetBackend):
        * UIProcess/ProvisionalPageProxy.cpp:
        (WebKit::ProvisionalPageProxy::~ProvisionalPageProxy):
        (WebKit::ProvisionalPageProxy::initializeWebPage):
        (WebKit::ProvisionalPageProxy::goToBackForwardItem):
        (WebKit::ProvisionalPageProxy::messageSenderConnection const):
        (WebKit::ProvisionalPageProxy::messageSenderDestinationID const):
        * UIProcess/ProvisionalPageProxy.h:
        * UIProcess/SuspendedPageProxy.cpp:
        (WebKit::SuspendedPageProxy::SuspendedPageProxy):
        (WebKit::SuspendedPageProxy::unsuspend):
        (WebKit::SuspendedPageProxy::close):
        (WebKit::SuspendedPageProxy::messageSenderConnection const):
        (WebKit::SuspendedPageProxy::messageSenderDestinationID const):
        * UIProcess/SuspendedPageProxy.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::continueNavigationInNewProcess):
        Have SuspendedPageProxy & ProvisionalPageProxy subclass IPC::MessageSender so that we can call send()
        on them without having to pass in a PageIdentifier. Passing a PageIdentifier was error-prone.

        * UIProcess/ViewGestureController.cpp:
        (WebKit::ViewGestureController::requestRenderTreeSizeNotificationIfNeeded):
        When there was a provisonal page proxy, we would properly send the IPC to the provisional page's process
        but would use the wrong PageIdentifier for the IPC. We would use the identifier of the committed WebPage
        instead of the one of the provisional WebPage.

2019-12-09  Wenson Hsieh  <wenson_hsieh@apple.com>

        Finish encoding/decoding support for DisplayList::SetState
        https://bugs.webkit.org/show_bug.cgi?id=205018

        Reviewed by Tim Horton.

        Replaces WebCore::DisplayList::ImageHandle with just WebCore::ImageHandle. See WebCore ChangeLog for more
        details.

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

2019-12-09  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Throttling requestAnimationFrame should be controlled by RenderingUpdateScheduler
        https://bugs.webkit.org/show_bug.cgi?id=204713

        Reviewed by Simon Fraser.

        Create an IPC message on the DrawingArea to send a message from the
        WebProcess to the UIProcess to setPreferredFramesPerSecond of the
        DisplayRefreshMonitor.

        * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h:
        * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.messages.in:

        * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
        (-[WKOneShotDisplayLinkHandler setPreferredFramesPerSecond:]):
        (WebKit::RemoteLayerTreeDrawingAreaProxy::setPreferredFramesPerSecond):
        Set the preferredFramesPerSecond of the CADisplayLink.

        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.h:
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm:
        (WebKit::RemoteLayerTreeDisplayRefreshMonitor::setPreferredFramesPerSecond):
        Delegate the call to RemoteLayerTreeDrawingArea.

        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
        (WebKit::RemoteLayerTreeDrawingArea::setPreferredFramesPerSecond):
        Send the IPC message from the WebProcess to the UIProcess.

2019-12-09  youenn fablet  <youenn@apple.com>

        NetworkResourceLoader should consume its sandbox extensions when starting a fetch through service worker
        https://bugs.webkit.org/show_bug.cgi?id=204883
        <rdar://problem/57568535>

        Reviewed by Alex Christensen.

        Consume sandbox extensions in network process before sending fetch task to service worker.
        This makes sure network process can send proper sandbox extensions to the service worker and it also ensures
        it will have the necessary rights to access the file if the fetch task is not handled by service worker.
        Test: http/wpt/service-workers/file-upload.html

        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::consumeSandboxExtensionsIfNeeded):
        * NetworkProcess/NetworkResourceLoader.h:
        * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp:
        (WebKit::ServiceWorkerFetchTask::startFetch):

2019-12-09  Wenson Hsieh  <wenson_hsieh@apple.com>

        Unreviewed, fix the macCatalyst build after r253267

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

2019-12-09  Alex Christensen  <achristensen@webkit.org>

        Re-disable TLS1.0 and TLS1.1 by default
        https://bugs.webkit.org/show_bug.cgi?id=204922
        <rdar://problem/57677752>

        Reviewed by Youenn Fablet.

        Covered by updated API tests.

        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
        (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeNetworkProcess):
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::parameters):

2019-12-09  Chris Dumez  <cdumez@apple.com>

        Unreviewed, fix debug assertion for ApplePay API tests on iOS after r253277.

        Disable server preconnect if the load will be handled by the LegacyCustomProtocolManager.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::preconnectTo):

2019-12-09  youenn fablet  <youenn@apple.com>

        Add an option to capture audio in GPU process
        https://bugs.webkit.org/show_bug.cgi?id=205007

        Reviewed by Eric Carlson.

        Add a flag to make audio capture in GPU process.
        In WebProcess, if trying to capture through GPUProcess, send back an error since this is not implemented.

        * Shared/WebPreferences.yaml:
        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const):
        (WebKit::WebProcessCreationParameters::decode):
        * Shared/WebProcessCreationParameters.h:
        * UIProcess/API/APIProcessPoolConfiguration.h:
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetCaptureAudioInGPUProcessEnabled):
        (WKPreferencesGetCaptureAudioInGPUProcessEnabled):
        * UIProcess/API/C/WKPreferencesRef.h:
        * UIProcess/WebPreferences.cpp:
        (WebKit::WebPreferences::updateBoolValueForInternalDebugFeatureKey):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::initializeNewWebProcess):
        (WebKit::WebProcessPool::createWebPage):
        * WebProcess/InjectedBundle/InjectedBundle.cpp:
        (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
        * WebProcess/cocoa/UserMediaCaptureManager.cpp:
        (WebKit::UserMediaCaptureManager::initialize):
        (WebKit::UserMediaCaptureManager::AudioFactory::createAudioCaptureSource):
        * WebProcess/cocoa/UserMediaCaptureManager.h:
        (WebKit::UserMediaCaptureManager::AudioFactory::setShouldCaptureInGPUProcess):

2019-12-08  Wenson Hsieh  <wenson_hsieh@apple.com>

        Move WebCore::Path encoders and decoders into WebCore from WebCoreArgumentCoders
        https://bugs.webkit.org/show_bug.cgi?id=204993

        Reviewed by Tim Horton.

        Remove Encoder/Decoder support for WebCore::Path.

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

2019-12-08  Chris Dumez  <cdumez@apple.com>

        Preconnect to server as early as possible in WebPage::LoadRequest
        https://bugs.webkit.org/show_bug.cgi?id=204992

        Reviewed by Antti Koivisto.

        Preconnect to server as early as possible in WebPage::LoadRequest. This avoids delaying the
        connection to the server until after the policy check and is a ~1.3% progression on PLT5 on
        both macOS and iOS.

        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::preconnectTo):
        * WebProcess/Network/WebLoaderStrategy.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::loadRequest):

2019-12-08  youenn fablet  <youenn@apple.com>

        Support different resolutions for video tracks captured from UIProcess
        https://bugs.webkit.org/show_bug.cgi?id=204945

        Reviewed by Eric Carlson.

        Change video capture in uiprocess to an experimental flag.
        Add support for remote video source cloning by sending some IPC to UIProcess and cloning the source there.
        This triggers IPC for both cloning and cloned sources but this allows to do resizing in UIProcess instead of WebProcess.
        We thus disable video capture resizing in WebProcess.

        * Shared/WebPreferences.yaml:
        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
        (WebKit::UserMediaCaptureManagerProxy::SourceProxy::start):
        (WebKit::UserMediaCaptureManagerProxy::SourceProxy::stop):
        (WebKit::UserMediaCaptureManagerProxy::SourceProxy::requestToEnd):
        (WebKit::UserMediaCaptureManagerProxy::SourceProxy::preventSourceFromStopping):
        (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
        (WebKit::UserMediaCaptureManagerProxy::startProducingData):
        (WebKit::UserMediaCaptureManagerProxy::stopProducingData):
        (WebKit::UserMediaCaptureManagerProxy::clone):
        (WebKit::UserMediaCaptureManagerProxy::requestToEnd):
        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
        * WebProcess/cocoa/UserMediaCaptureManager.cpp:
        (WebKit::UserMediaCaptureManager::Source::sourceID const):
        (WebKit::UserMediaCaptureManager::Source::settings const):
        (WebKit::UserMediaCaptureManager::Source::remoteVideoSampleAvailable):
        (WebKit::UserMediaCaptureManager::Source::requestToEnd):
        (WebKit::UserMediaCaptureManager::Source::stopBeingObserved):
        (WebKit::UserMediaCaptureManager::cloneSource):
        (WebKit::UserMediaCaptureManager::cloneVideoSource):
        (WebKit::UserMediaCaptureManager::requestToEnd):
        (WebKit::UserMediaCaptureManager::VideoFactory::setVideoCapturePageState):
        * WebProcess/cocoa/UserMediaCaptureManager.h:

2019-12-08  youenn fablet  <youenn@apple.com>

        Tighten Mac sandbox by removing microphone access
        https://bugs.webkit.org/show_bug.cgi?id=204939

        Reviewed by Brent Fulgham.

        No change of behavior, we do audio capture in UIProcess.

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

2019-12-08  youenn fablet  <youenn@apple.com>

        Add logging to NetworkRTCMonitor
        https://bugs.webkit.org/show_bug.cgi?id=204850
        <rdar://problem/57618773>

        Reviewed by Eric Carlson.

        Add logging and send IPC message back to WebProcess even if monitoring is stopped.
        No observable change of behavior.

        * NetworkProcess/webrtc/NetworkRTCMonitor.cpp:
        (WebKit::NetworkRTCMonitor::startUpdatingIfNeeded):
        (WebKit::NetworkRTCMonitor::stopUpdating):
        (WebKit::NetworkRTCMonitor::onNetworksChanged):

2019-12-07  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Make ColorSpace an enum class
        https://bugs.webkit.org/show_bug.cgi?id=204970

        Reviewed by Sam Weinig.

        * Shared/WebCoreArgumentCoders.h:

2019-12-07  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] WKWebView touch event gesture recognition should not block the application process main thread when possible
        https://bugs.webkit.org/show_bug.cgi?id=204664
        <rdar://problem/38670692>

        Reviewed by Tim Horton.

        Adds a mechanism that allows some sync touch events on iOS to be sent asynchronously. To do this, we use the
        deferring gesture mechanism introduced in trac.webkit.org/r253005 to defer all gestures under WKContentView (and
        WebKit-owned scroll views) when a touch starts, such that they will not recognize until we know that the page
        has either prevented default or not (assuming that the touch was over an active listener). See below for more
        details.

        Tests: fast/events/touch/ios/prevent-default-on-touch-start-with-slow-event-listener.html
               fast/events/touch/ios/scroll-on-touch-start-with-slow-event-listener.html

        * UIProcess/GenericCallback.h:
        * UIProcess/PageClient.h:
        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
        (-[WKChildScrollView gestureRecognizer:shouldRequireFailureOfGestureRecognizer:]):
        (-[WKChildScrollView gestureRecognizer:shouldBeRequiredToFailByGestureRecognizer:]):

        Implement gesture recognizer delegate hooks to add dynamic failure requirements between a child scroll view's
        gestures and the new deferring gesture recognizers on WKContentView. This allows pan gestures over a scrollable
        container to hold off on recognizing while the deferring gesture recognizer has not failed yet.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::handlePreventableTouchEvent):
        (WebKit::WebPageProxy::handleUnpreventableTouchEvent):

        Rename handleTouchEventSynchronously and handleTouchEventAsynchronously to handlePreventableTouchEvent and
        handleUnpreventableTouchEvent, respectively. Instead of always sending touchstart events that may prevent native
        gestures synchronously, we may now go through the same `EventDispatcher::TouchEvent` codepath used when
        dispatching touch events in passive tracking regions. However, in the case of preventable touchstarts, we
        additionally store a completion callback that is invoked after the touch event has been handled by the page; we
        then either un-defer or prevent native gestures here (depending on whether the page prevented default) by
        calling PageClient::doneDeferringNativeGestures.

        Non-touchstart events are still dispatched synchronously, to ensure that calling preventDefault() on touchmove
        and touchend continue to prevent default gestures from recognizing.

        (WebKit::WebPageProxy::boolCallback):
        (WebKit::WebPageProxy::handleTouchEventSynchronously): Deleted.
        (WebKit::WebPageProxy::handleTouchEventAsynchronously): Deleted.

        See above.

        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::isHandlingPreventableTouchStart const):

        This is used in WKContentView to determine whether deferring gestures need to remain active after the touch
        ends. See below for more detail.

        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/ios/PageClientImplIOS.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::doneDeferringNativeGestures):
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[UIGestureRecognizer _wk_cancel]):
        (-[WKContentView setupInteraction]):
        (-[WKContentView cleanupInteraction]):
        (-[WKContentView _removeDefaultGestureRecognizers]):
        (-[WKContentView _addDefaultGestureRecognizers]):

        Add and remove the new deferring gesture recognizers here.

        (-[WKContentView _webTouchEventsRecognized:]):
        (-[WKContentView _webTouchEvent:preventsNativeGestures:]):
        (-[WKContentView _doneDeferringNativeGestures:]):
        (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
        (-[WKContentView ensurePositionInformationIsUpToDate:]):

        Drive-by fix: add a missing hasRunningProcess check that causes a flaky assertion under
        `AuxiliaryProcessProxy::connection()` in layout tests.

        (-[WKContentView gestureRecognizer:shouldRequireFailureOfGestureRecognizer:]):
        (-[WKContentView gestureRecognizer:shouldBeRequiredToFailByGestureRecognizer:]):

        Add dynamic failure requirements between WKContentView's gestures (including all text interaction, context menu,
        and drag and drop gestures) and the new deferring gesture recognizers.

        (-[WKContentView _didStartProvisionalLoadForMainFrame]):

        Force the two-finger double tap gesture recognizer to reset when loading a new page. Without this, the layout
        test fast/events/ios/click-event-while-editing-node.html will rarely fail when run after a test that dispatches
        a two-finger tap, such as fast/events/ios/click-event-two-finger-single-tap-meta-key.html. This is because the
        new deferring gestures will temporarily unite multi-finger tap gestures with one-finger double tap gestures in
        the same subgraph when performing a tap gesture with more than one finger. This means that there's a 300 ms
        delay before a normal single tap can be recognized again, which (without forcing the two-finger double tap to
        reset) would cause a subsequent test that loads in under 300 ms and attempts to send a tap to fail.

        (-[WKContentView deferringGestureRecognizer:shouldDeferGesturesAfterBeginningTouchesWithEvent:]):

        Avoid deferring native gestures if the scroll view is decelerating; this matches behavior of the web touch event
        gesture recognizer.

        (-[WKContentView deferringGestureRecognizer:shouldDeferGesturesAfterEndingTouchesWithEvent:]):

        Normally, after -touchesEnded:withEvent:, we stop deferring native gesture recognizers by failing the deferring
        gestures. However, if we're still waiting for a response from the web process, then let
        -_doneDeferringNativeGestures: handle this instead.

        (-[WKContentView deferringGestureRecognizer:shouldDeferOtherGestureRecognizer:]):
        (-[WKContentView deferringGestureRecognizer:shouldDeferGesturesWithEvent:]): Deleted.

        Renamed to -shouldDeferGesturesAfterBeginningTouchesWithEvent:.

        * UIProcess/ios/WKDeferringGestureRecognizer.h:
        * UIProcess/ios/WKDeferringGestureRecognizer.mm:
        (-[WKDeferringGestureRecognizer touchesBegan:withEvent:]):
        (-[WKDeferringGestureRecognizer touchesEnded:withEvent:]):

        Override this and add a new delegate hook to determine whether we want the deferring gesture recognizer to
        immediately fail when touches end. It's important to override this and transition to failure state in this case,
        since not doing so could mean that the deferring gestures stay in Possible state forever; this may lead to the
        gesture subgraph containing these deferring gestures being unable to reset, since it's waiting for the deferring
        gesture to either fail or end.

        * UIProcess/ios/WKScrollView.mm:
        (-[WKScrollView gestureRecognizer:shouldRequireFailureOfGestureRecognizer:]):
        (-[WKScrollView gestureRecognizer:shouldBeRequiredToFailByGestureRecognizer:]):

        Defer more scroll view gestures.

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

        Add an optional CallbackID parameter to this IPC message. If a callback ID is given, then we avoid coalescing
        the touch event. To implement this, we additionally refactor the queued touch events map to contain lists of
        <WebTouchEvent, Optional<CallbackID>> pairs; if a queued touch event has a corresponding CallbackID, then we
        fire the callback corresponding to the ID, indicating whether the touch event was handled by the page.

        * WebProcess/WebPage/EventDispatcher.h:
        * WebProcess/WebPage/EventDispatcher.messages.in:
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::dispatchAsynchronousTouchEvents):

2019-12-07  David Quesada  <david_quesada@apple.com>

        REGRESSION(r253231): Debug assertion failures under ~WebDeviceOrientationUpdateProvider(Proxy)
        https://bugs.webkit.org/show_bug.cgi?id=204977
        rdar://problem/57724251

        Reviewed by Per Arne Vollan.

        In the UI process, have the WebPageProxy swap out its WebDeviceOrientationUpdateProviderProxy whenever
        it connects to a new process, instead of creating one on construction and holding onto it for the rest
        of the WebPageProxy lifetime. The …UpdateProviderProxy assumes that its page will have the same ID
        at the time of registering as a message receiver and later unregistering, but the page ID could change
        if the WebPageProxy swaps web processes. Using a new instance per web page ID ensures that the
        updater is always able to successfully remove itself as a message receiver when deallocating.

        In the Web process, ~WebDeviceOrientationUpdateProvider() should remove itself as a message receiver
        specifically for its page ID, rather than as a global message receiver.

        No new tests -- existing tests (at least the ProcessSwap API tests) revealed the regression.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::m_tryCloseTimeoutTimer):
        (WebKit::WebPageProxy::didAttachToRunningProcess):
        (WebKit::WebPageProxy::resetState):
        (WebKit::m_webDeviceOrientationUpdateProviderProxy): Deleted.
        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/WebDeviceOrientationUpdateProviderProxy.h:
        * WebProcess/WebCoreSupport/WebDeviceOrientationUpdateProvider.cpp:
        (WebKit::WebDeviceOrientationUpdateProvider::WebDeviceOrientationUpdateProvider):
        (WebKit::WebDeviceOrientationUpdateProvider::~WebDeviceOrientationUpdateProvider):
        * WebProcess/WebCoreSupport/WebDeviceOrientationUpdateProvider.h:

2019-12-07  Tim Horton  <timothy_horton@apple.com>

        Implement encoding for DrawImage and DrawRoundedRect display list items
        https://bugs.webkit.org/show_bug.cgi?id=204881

        Reviewed by Simon Fraser.

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

2019-12-06  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r253218.
        https://bugs.webkit.org/show_bug.cgi?id=204968

        Broke the build (Requested by ap on #webkit).

        Reverted changeset:

        "Remove various .order files."
        https://bugs.webkit.org/show_bug.cgi?id=204959
        https://trac.webkit.org/changeset/253218

2019-12-06  Chris Dumez  <cdumez@apple.com>

        [IPC] MESSAGE_CHECK() parameters for AddPlugInAutoStartOriginHash / PlugInDidReceiveUserInteraction IPCs
        https://bugs.webkit.org/show_bug.cgi?id=204962

        Reviewed by Ryosuke Niwa.

        MESSAGE_CHECK() parameters for AddPlugInAutoStartOriginHash / PlugInDidReceiveUserInteraction IPCs. Those parameters
        are used as keys in HashMaps.

        * UIProcess/Plugins/PlugInAutoStartProvider.cpp:
        (WebKit::PlugInAutoStartProvider::PlugInAutoStartProvider):
        (WebKit::PlugInAutoStartProvider::addAutoStartOriginHash):
        (WebKit::PlugInAutoStartProvider::setAutoStartOriginsTableWithItemsPassingTest):
        (WebKit::PlugInAutoStartProvider::didReceiveUserInteraction):
        * UIProcess/Plugins/PlugInAutoStartProvider.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::addPlugInAutoStartOriginHash):
        (WebKit::WebProcessProxy::plugInDidReceiveUserInteraction):

2019-12-06  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Calls to device orientation API should be done in the UI process
        https://bugs.webkit.org/show_bug.cgi?id=204720

        Reviewed by Alex Christensen.

        Add a new class, WebDeviceOrientationUpdateProviderProxy, to handle messages to start and stop updating device orientation
        in the UI process. Also, add a message to update the device orientation in the WebContent process. In the UI process, the
        device orientation API is called through the already existing WebCoreMotionManager class.

        * DerivedSources-input.xcfilelist:
        * DerivedSources-output.xcfilelist:
        * DerivedSources.make:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::m_webDeviceOrientationUpdateProviderProxy):
        (WebKit::m_resetRecentCrashCountTimer): Deleted.
        * UIProcess/WebPageProxy.h:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_overriddenMediaType):

2019-12-06  Chris Dumez  <cdumez@apple.com>

        Reduce timeout for page to handle beforeunload events when trying to close a page
        https://bugs.webkit.org/show_bug.cgi?id=204950
        <rdar://problem/57700419>

        Reviewed by Ryosuke Niwa.

        Reduce timeout for page to handle beforeunload events when trying to close a page. It would previously
        take up to 3 seconds to actually close a tab after the user would click on the "X" to close it. This
        is because we would wait for the page to fire and handle the beforeunload events and only give up after
        3 seconds. This patch reduces this timeout to something more reasonable from a user standpoint (500ms).

        * UIProcess/WebPageProxy.cpp:
        (WebKit::m_tryCloseTimeoutTimer):
        (WebKit::WebPageProxy::tryClose):
        (WebKit::WebPageProxy::tryCloseTimedOut):
        (WebKit::WebPageProxy::closePage):
        (WebKit::m_resetRecentCrashCountTimer): Deleted.
        * UIProcess/WebPageProxy.h:

2019-12-06  Jonathan Bedard  <jbedard@apple.com>

        Python 3: Add support in webkitpy.test
        https://bugs.webkit.org/show_bug.cgi?id=204952

        Reviewed by Stephanie Lewis.

        Tested by test-webkitpy.

        * Scripts/webkit/messages_unittest.py: Use Python 2/3 compatible StringIO.

2019-12-06  Keith Miller  <keith_miller@apple.com>

        Remove various .order files.
        https://bugs.webkit.org/show_bug.cgi?id=204959

        Reviewed by Yusuke Suzuki.

        These files are all super out of date and likely don't do anything anymore.
        The signatures of the functions have changed thus the mangled name has changed.

        * mac/WebKit2.order: Removed.

2019-12-06  Dan Bernstein  <mitz@apple.com>

        Address <https://bugs.webkit.org/show_bug.cgi?id=189222#c3>

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView valueForUndefinedKey:]): Added a newline.

2019-12-06  Benjamin Nham  <nham@apple.com>

        Drop support for NSURLCache callbacks in NetworkProcess
        https://bugs.webkit.org/show_bug.cgi?id=203344

        Reviewed by Alex Christensen.

        Remove the NSURLSession caching policy callback in NetworkProcess. It's no longer necessary since
        we don't use NSURLCache in NetworkProcess (https://bugs.webkit.org/show_bug.cgi?id=185990).

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (-[WKNetworkSessionDelegate URLSession:dataTask:willCacheResponse:completionHandler:]): Deleted.

2019-12-05  Chris Dumez  <cdumez@apple.com>

        Stop using reserveCapacity() / reserveInitialCapacity() in IPC decoders
        https://bugs.webkit.org/show_bug.cgi?id=204930
        <rdar://problem/57682737>

        Reviewed by Ryosuke Niwa.

        This is IPC hardening since the size we use to reserve the capacity is encoded over IPC
        and cannot be trusted in some cases.

        * Platform/IPC/ArgumentCoders.h:
        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<Vector<RefPtr<SecurityOrigin>>>::decode):

2019-12-06  youenn fablet  <youenn@apple.com>

        Protect WebRTC network monitoring to wait forever in edge cases
        https://bugs.webkit.org/show_bug.cgi?id=204846

        Reviewed by Eric Carlson.

        We were limiting the number of IPC message sent to network process by only sending the start monitoring event for the first client.
        The issue is that, if network process crashes for instance while having not yet given the list of networks, all clients will be hanging
        waiting for the completion of network list.
        We are now sending an IPC message for every client and the network process will ignore the ones that are not useful.
        In addition, in case of network process crash, we send a signal that network list has changed to make sure clients will never hang.
        They might still fail connecting, which is ok since network process crashed.

        Test: webrtc/datachannel/gather-candidates-networkprocess-crash.html

        * NetworkProcess/webrtc/NetworkRTCMonitor.cpp:
        (WebKit::NetworkRTCMonitor::startUpdatingIfNeeded):
        * NetworkProcess/webrtc/NetworkRTCMonitor.h:
        * NetworkProcess/webrtc/NetworkRTCMonitor.messages.in:
        * WebProcess/Network/webrtc/LibWebRTCNetwork.h:
        (WebKit::LibWebRTCNetwork::networkProcessCrashed):
        * WebProcess/Network/webrtc/WebRTCMonitor.cpp:
        (WebKit::WebRTCMonitor::StartUpdating):
        (WebKit::WebRTCMonitor::StopUpdating):
        (WebKit::WebRTCMonitor::networksChanged):
        (WebKit::WebRTCMonitor::networkProcessCrashed):
        * WebProcess/Network/webrtc/WebRTCMonitor.h:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::networkProcessConnectionClosed):

2019-12-06  youenn fablet  <youenn@apple.com>

        Output libwebrtc logging from Network Process as release logging
        https://bugs.webkit.org/show_bug.cgi?id=204853

        Reviewed by Eric Carlson.

        This will help debugging WebRTC networking issues.
        No observable change of behavior.

        * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
        (WebKit::doReleaseLogging):
        (WebKit::NetworkRTCProvider::NetworkRTCProvider):

2019-12-05  Yousuke Kimoto  <yousuke.kimoto@sony.com>

        [WinCairo] Improve Inspectable Target Page to adapt a long title and URL
        https://bugs.webkit.org/show_bug.cgi?id=204874

        Reviewed by Fujii Hironori.

        Add some CSS atributes to make such long titles and URLs fit the width
        of a window size. Then "Inspector" button is shown at the visible area.
        No new tests, since there is no change in behavior.

        * UIProcess/socket/RemoteInspectorProtocolHandler.cpp:
        (WebKit::RemoteInspectorProtocolHandler::platformStartTask):

2019-12-05  Fujii Hironori  <Hironori.Fujii@sony.com>

        [WebKit] Fix compilation warnings for MSVC
        https://bugs.webkit.org/show_bug.cgi?id=204661

        Reviewed by Don Olmstead.

        No behavior changes.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        * NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.cpp:
        (WebKit::makeDescription):
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::cleanup):
        * NetworkProcess/cache/NetworkCacheIOChannelCurl.cpp:
        (WebKit::NetworkCache::IOChannel::IOChannel):
        * Shared/API/c/WKSharedAPICast.h:
        (WebKit::toAPI):
        (WebKit::toDiagnosticLoggingResultType):
        * UIProcess/WebURLSchemeTask.cpp:
        (WebKit::WebURLSchemeTask::didReceiveData):
        * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
        (WebKit::WebServiceWorkerFetchTaskClient::didReceiveData):
        * WebProcess/WebCoreSupport/WebEditorClient.cpp:
        (WebKit::WebEditorClient::registerAttachmentIdentifier):

2019-12-05  Brian Burg  <bburg@apple.com>

        [Cocoa] _WKInspector uses wrong WKWebView in -setDiagnosticLoggingDelegate:
        https://bugs.webkit.org/show_bug.cgi?id=204928

        Reviewed by Timothy Hatcher.

        I feel like I've made this mistake before. To make the right thing more obvious,
        add a property named inspectorWebView that returns the Inspector WKWebView.

        * UIProcess/API/Cocoa/_WKInspector.mm:
        (-[_WKInspector inspectorWebView]):
        (-[_WKInspector _setDiagnosticLoggingDelegate:]):
        * UIProcess/WebInspectorProxy.h:
        (WebKit::WebInspectorProxy::inspectorPage const):

2019-12-05  Chris Dumez  <cdumez@apple.com>

        Use sendWithAsyncReply() for WebPage::TryClose IPC
        https://bugs.webkit.org/show_bug.cgi?id=204926

        Reviewed by Alex Christensen.

        Use sendWithAsyncReply() for WebPage::TryClose IPC, instead of 2 separate IPCs.

        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::closeBrowsingContext):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::tryClose):
        (WebKit::WebPageProxy::closePage):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::tryClose):
        (WebKit::WebPage::sendClose):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2019-12-05  John Wilander  <wilander@apple.com>

        Resource Load Statistics (experimental): Add fast mode for non-cookie website data deletion
        https://bugs.webkit.org/show_bug.cgi?id=204858
        <rdar://problem/57639851>

        Reviewed by Alex Christensen.

        The purpose of this change is to allow for dedicated testing of the change in
        https://trac.webkit.org/changeset/253082/webkit. Waiting seven days just isn't a good
        starting point.

        This change adds two internal flags:
        - "Live-On Testing" with a one hour timeout instead of seven days.
        - "Repro Testing" with an instant timeout (bar ITP's regular delays) instead of seven days.

        The change also makes sure that hasHadUnexpiredRecentUserInteraction() in
        ResourceLoadStatisticsDatabaseStore and ResourceLoadStatisticsMemoryStore only
        age out the user interaction timestamp if the OperatingDatesWindow is Long so
        that we don't age out timestamps early with the shorter OperatingDatesWindows.

        This change changes the default value of IsFirstPartyWebsiteDataRemovalEnabled to true.

        These internal flags should be removed once testing is complete: <rdar://problem/57673418>

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
        (WebKit::ResourceLoadStatisticsMemoryStore::hasHadUnexpiredRecentUserInteraction const):
        (WebKit::ResourceLoadStatisticsMemoryStore::shouldRemoveAllButCookiesFor const):
        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
        (WebKit::ResourceLoadStatisticsStore::hasStatisticsExpired const):
        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::setFirstPartyWebsiteDataRemovalMode):
        * NetworkProcess/NetworkProcess.messages.in:
        * Shared/WebPreferences.yaml:
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::parameters):

2019-12-05  Chris Dumez  <cdumez@apple.com>

        Optimize IPC::Connection::SyncMessageState methods
        https://bugs.webkit.org/show_bug.cgi?id=204890

        Reviewed by Alex Christensen.

        Optimize IPC::Connection::SyncMessageState methods. We are seeing lock contention on some (app launch)
        benchmarks, resulting in the main thread yielding for 10ms.

        * Platform/IPC/Connection.cpp:
        (IPC::Connection::SyncMessageState): Make constructor private since this is a singleton class.
        (IPC::Connection::ConnectionAndIncomingMessage): Add convenience dispatch() method.

        (IPC::Connection::SyncMessageState::processIncomingMessage):
        Drop the lock as early as possible, *before* calling RunLoop::main().dispatch().

        (IPC::Connection::SyncMessageState::dispatchMessages):
        Drop allowedConnection parameter and simplify the code a lot as a result. Only dispatchMessagesAndResetDidScheduleDispatchMessagesForConnection()
        needed the pass an allowedConnection but having dispatchMessagesAndResetDidScheduleDispatchMessagesForConnection() call dispatchMessages() was
        inefficient since it would cause us to grab the lock in dispatchMessagesAndResetDidScheduleDispatchMessagesForConnection() to update
        m_didScheduleDispatchMessagesWorkSet, then release it, then grab the lock again in dispatchMessages() for m_messagesToDispatchWhileWaitingForSyncReply.

        (IPC::Connection::SyncMessageState::dispatchMessagesAndResetDidScheduleDispatchMessagesForConnection):
        Grab the lock only once to update m_didScheduleDispatchMessagesWorkSet and m_messagesToDispatchWhileWaitingForSyncReply, instead of doing it in 2
        separate steps, each one taking the lock.

        (IPC::Connection::waitForMessage):
        (IPC::Connection::waitForSyncReply):
        (IPC::Connection::dispatchSyncMessage):
        stop passing a null allowedConnection when calling dispatchMessages().

2019-12-05  Chris Dumez  <cdumez@apple.com>

        PageConfiguration::dragClient should use a smart pointer
        https://bugs.webkit.org/show_bug.cgi?id=204816

        Reviewed by Alex Christensen.

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

2019-12-05  Chris Dumez  <cdumez@apple.com>

        [IPC] Fail BackForwardItemIdentifier decoding if the decoded integer is not a valid ID
        https://bugs.webkit.org/show_bug.cgi?id=204920
        <rdar://problem/57677453>

        Reviewed by Ryosuke Niwa.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::willGoToBackForwardListItem):
        (WebKit::WebPageProxy::backForwardGoToItemShared):
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::updateBackForwardItem):

2019-12-05  Sihui Liu  <sihui_liu@apple.com>

        Move InProcessIDBServer to WebKitLegacy
        https://bugs.webkit.org/show_bug.cgi?id=204896

        Reviewed by Brady Eidson.

        * WebProcess/Databases/WebDatabaseProvider.h:

2019-12-05  Sihui Liu  <sihui_liu@apple.com>

        Add ThreadMessageReceiver to IPC::Connection
        https://bugs.webkit.org/show_bug.cgi?id=204908

        Reviewed by Brady Eidson.

        ThreadMesageReceiver is similar to WorkQueueMessageReceiver, but it should handle messages (dispatched from IPC 
        thread) on a specific thread, while WorkQueueMessageReceiver may handle messages on different threads.

        * Platform/IPC/Connection.cpp:
        (IPC::Connection::addThreadMessageReceiver):
        (IPC::Connection::removeThreadMessageReceiver):
        (IPC::Connection::dispatchThreadMessageReceiverMessage):
        (IPC::Connection::processIncomingMessage):
        (IPC::Connection::dispatchMessageToThreadReceiver):
        * Platform/IPC/Connection.h:
        (IPC::Connection::ThreadMessageReceiver::dispatchToThread):

2019-12-05  Chris Dumez  <cdumez@apple.com>

        MESSAGE_CHECK BackForwardItemIdentifier on incoming IPC from the WebProcess
        https://bugs.webkit.org/show_bug.cgi?id=204899

        Reviewed by Ryosuke Niwa.

        MESSAGE_CHECK BackForwardItemIdentifier on incoming IPC from the WebProcess. This is important since we use this identifier
        to look up the WebBackForwardListItem in a HashMap, and looking up a bad ID could corrupt said HashMap.

        * Shared/WebBackForwardListItem.cpp:
        Make sure the WebBackForwardListItem is always constructed and destroyed on the main thread, to avoid corrupting
        the allItems() HashMap.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::willGoToBackForwardListItem):
        (WebKit::WebPageProxy::backForwardGoToItemShared):
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::updateBackForwardItem):

2019-12-05  Kate Cheney  <katherine_cheney@apple.com>

        [MSVC] WebResourceLoadStatisticsStore.h is reporting warning C4804: '/': unsafe use of type 'bool' in operation
        https://bugs.webkit.org/show_bug.cgi?id=204870

        Reviewed by Darin Adler.

        This patch converts storageAccessGranted to a char since makeString()
        does not explicitly accept bool types.

        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
        (WebKit::ThirdPartyDataForSpecificFirstParty::toString const):

2019-12-05  Philippe Normand  <pnormand@igalia.com>

        [GLib] Display GStreamer version in about:gpu page

        Rubber-stamped by Carlos Garcia Campos.

        * UIProcess/API/glib/WebKitProtocolHandler.cpp:
        (WebKit::WebKitProtocolHandler::handleGPU):

2019-12-05  youenn fablet  <youenn@apple.com>

        inspector/page/overrideSetting-MockCaptureDevicesEnabled.html is failing after removal of internals.setMockMediaCaptureDevicesEnabled API
        https://bugs.webkit.org/show_bug.cgi?id=204849

        Reviewed by Eric Carlson.

        Synchronize the center with the preferences when the value might be updated.
        Add API to check which center is used in UIProcess.

        * UIProcess/API/C/WKPage.cpp:
        (WKPageIsMockRealtimeMediaSourceCenterEnabled):
        * UIProcess/API/C/WKPagePrivate.h:
        * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
        (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy):
        (WebKit::UserMediaPermissionRequestManagerProxy::setMockCaptureDevicesEnabledOverride):
        * UIProcess/UserMediaPermissionRequestManagerProxy.h:
        (WebKit::UserMediaPermissionRequestManagerProxy::setMockCaptureDevicesEnabledOverride): Deleted.

2019-12-04  Joonghun Park  <jh718.park@samsung.com>

        Unreviewed. Remove build warnings below since r253025.
        warning: unused variable ‘iter’ [-Wunused-variable]
        warning: unused variable ‘isNewEntry’ [-Wunused-variable]

        No new tests, no new behavioral changes.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::addSessionStorageQuotaManager):
        * NetworkProcess/NetworkProcess.h:
        (WebKit::NetworkProcess::SessionStorageQuotaManager::ensureOriginStorageQuotaManager):

2019-12-04  Chris Dumez  <cdumez@apple.com>

        IPC messages may get processed out of order in some cases
        https://bugs.webkit.org/show_bug.cgi?id=204864

        Reviewed by Ryosuke Niwa.

        IPC messages may get processed out of order in some cases. Connection::SyncMessageState::dispatchMessages()
        puts messages it did not process back at the end of the queue, instead of the beginning. This means that
        messages added to the queue while Connection::SyncMessageState::dispatchMessages() was running will
        incorrectly run *before* the ones dispatchMessages() did not process.

        * Platform/IPC/Connection.cpp:
        (IPC::Connection::SyncMessageState::dispatchMessages):

2019-12-04  Chris Dumez  <cdumez@apple.com>

        PageConfiguration::progressTrackerClient should use a smart pointer
        https://bugs.webkit.org/show_bug.cgi?id=204854

        Reviewed by Alex Christensen.

        * WebProcess/WebCoreSupport/WebProgressTrackerClient.cpp:
        (WebKit::WebProgressTrackerClient::progressTrackerDestroyed): Deleted.
        * WebProcess/WebCoreSupport/WebProgressTrackerClient.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_overriddenMediaType):

2019-12-04  Tim Horton  <timothy_horton@apple.com>

        Fix the iOS build

        * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb: Added.
        * WebKit.xcodeproj/project.pbxproj:

2019-12-04  Per Arne Vollan  <pvollan@apple.com>

        Unreviewed fix for failure to create sandbox extension on macOS after r253011. This should be iOS only.

        * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
        (WebKit::UserMediaPermissionRequestManagerProxy::finishGrantingRequest):
        * UIProcess/UserMediaPermissionRequestManagerProxy.h:

2019-12-04  Per Arne Vollan  <pvollan@apple.com>

        [iOS] The UI process should issue mach sandbox extension to "com.apple.AGXCompilerService"
        https://bugs.webkit.org/show_bug.cgi?id=203915

        Reviewed by Brent Fulgham.

        Only a few iPad models need access to "com.apple.AGXCompilerService” in the WebContent process.
        The UI process should issue this mach extension for these iPad models.
 
        * 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::deviceHasAGXCompilerService):
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):

2019-12-04  Kate Cheney  <katherine_cheney@apple.com>

        Expose basic ITP data from the database for future API/SPI use
        https://bugs.webkit.org/show_bug.cgi?id=203432
        <rdar://problem/56085040>

        Reviewed John Wilander.

        Tests: http/tests/resourceLoadStatistics/user-interface-data-no-storage-access-database.html
               http/tests/resourceLoadStatistics/user-interface-data-no-storage-access.html
               http/tests/storageAccess/user-interface-data-with-storage-access-database.html
               http/tests/storageAccess/user-interface-data-with-storage-access.html

        Adds the ability to collect sorted ITP data for displaying in a
        user interface. 

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        (WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore):
        (WebKit::ResourceLoadStatisticsDatabaseStore::prepareStatements):
        Added new queries to the database store to check for storage access in
        the database and aggregate topFrames with the same
        subframe/subresource so easily create the struct for collecting data
        for the UI.

        (WebKit::ResourceLoadStatisticsDatabaseStore::relationshipExists const):
        Fixed an incorrect function name in the error message.

        (WebKit::ResourceLoadStatisticsDatabaseStore::joinSubStatisticsForSorting):
        Renamed unclear SQL variable names and added a bind parameter to
        specify whether resource is prevalent or not, which allows
        this function to be used to collect sorted ITP data
        for the UI.

        (WebKit::ResourceLoadStatisticsDatabaseStore::getFirstPartyDataForDomain const):
        (WebKit::ResourceLoadStatisticsDatabaseStore::gatherDataForUserInterface const):

        (WebKit::buildQueryStartAndEnd):
        (WebKit::getMedianOfPrevalentResourcesWithUserInteraction):
        (WebKit::ResourceLoadStatisticsDatabaseStore::getTopPrevelentResourceDaysSinceUI const):
        (WebKit::getMedianOfPrevalentResourceWithoutUserInteraction):
        (WebKit::getNumberOfPrevalentResourcesInTopResources):
        Changed sql query variable names to make them more clear and added a
        new bind parameter to allow for more general use of substatistic
        sorting query.

        (WebKit::ResourceLoadStatisticsDatabaseStore::hasStorageAccess const):
        (WebKit::ResourceLoadStatisticsDatabaseStore::dumpResourceLoadStatistics const):
        Combined UI data with dumpResourceLoadStatistics() data to keep the testing aspect
        of this patch simpler.

        (WebKit::ResourceLoadStatisticsDatabaseStore::resourceToString const):
        Since mostRecentUserInteractionTime changes with each test run, I
        updated the dumping to report only if it was in the last 24 hours as
        opposed to reporting an actual time.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
        (WebKit::ensureFirstPartyStatistic):
        (WebKit::getFirstPartyDataForDomain):
        (WebKit::hasBeenThirdParty):
        (WebKit::ResourceLoadStatisticsMemoryStore::gatherDataForUserInterface const):
        (WebKit::ResourceLoadStatisticsMemoryStore::dumpResourceLoadStatistics):
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::gatherDataForUserInterface):
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
        (WebKit::FirstPartyData::toString const):
        (WebKit::FirstPartyData::operator== const):
        (WebKit::ThirdPartyData::toString const):
        (WebKit::ThirdPartyData::operator< const):
        The toString methods allow the structs to be printed for testing
        purposes. The equals methods allow the return vectors to use
        appendIfNotContains.

2019-12-04  Simon Fraser  <simon.fraser@apple.com>

        Minor RemoteLayerTree logging cleanup
        https://bugs.webkit.org/show_bug.cgi?id=204865

        Reviewed by Tim Horton.

        Have the ::description() methods return Strings like everything else does.
        Use LOG_WITH_STREAM() so we don't call description() unless the log channel is on.

        * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
        * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
        (WebKit::RemoteLayerTreeTransaction::dump const):
        (WebKit::RemoteLayerTreeTransaction::description const):
        * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
        (WebKit::RemoteScrollingCoordinatorTransaction::description const):
        (WebKit::RemoteScrollingCoordinatorTransaction::dump const):
        * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.h:
        * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
        (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):

2019-12-04  Louie Livon-Bemel  <llivonbemel@apple.com>

        Add exclusion rule for text manipulation SPI to exclude based on element class
        https://bugs.webkit.org/show_bug.cgi?id=204754
        <rdar://problem/57398802>

        Reviewed by Ryosuke Niwa.

        Give clients another option for adding an exclusion for text manipulation; allow them to exclude based on an
        element having a certain class.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _startTextManipulationsWithConfiguration:completion:]):
            If the rule doesn't have an attribute but does have a class name, treat it as a ClassRule exclusion.
        * UIProcess/API/Cocoa/_WKTextManipulationExclusionRule.h:
            Add an initializer for excluding based on a class name. Also add a getter for the className.
        * UIProcess/API/Cocoa/_WKTextManipulationExclusionRule.mm:
        (-[_WKTextManipulationExclusionRule initExclusion:forClass:]):
        (-[_WKTextManipulationExclusionRule className]):

2019-12-04  Kenneth Russell  <kbr@chromium.org>

        Enable WebGL's ASTC extension all the time
        https://bugs.webkit.org/show_bug.cgi?id=202836
        <rdar://problem/57627592>

        Reviewed by Dean Jackson.

        Remove the run-time flag - no longer necessary.

        * Shared/WebPreferences.yaml:

2019-12-04  youenn fablet  <youenn@apple.com>

        WebProcessPool::terminateServiceWorkerProcess should be renamed terminateServiceWorkers
        https://bugs.webkit.org/show_bug.cgi?id=204792

        Reviewed by Chris Dumez.

        Make use of disableServiceWorkers in terminateServiceWorkers as we might need to handle the case of a service worker in a process containing a page.
        Renaming API accordingly.
        Covered by existing tests.

        * UIProcess/API/C/WKContext.cpp:
        (WKContextTerminateServiceWorkers):
        * UIProcess/API/C/WKContextPrivate.h:
        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _terminateServiceWorkers]):
        * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess):
        (WebKit::WebProcessPool::createWebPage):
        (WebKit::WebProcessPool::updateServiceWorkerUserAgent):
        (WebKit::WebProcessPool::terminateNetworkProcess):
        (WebKit::WebProcessPool::terminateServiceWorkers):
        (WebKit::WebProcessPool::updateProcessAssertions):
        (WebKit::WebProcessPool::isServiceWorkerPageID const):
        * UIProcess/WebProcessPool.h:

2019-12-04  youenn fablet  <youenn@apple.com>

        Move soft update handling to network process
        https://bugs.webkit.org/show_bug.cgi?id=204678

        Reviewed by Chris Dumez.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::swServerForSession):
        * NetworkProcess/NetworkSession.h:
        (WebKit::NetworkSession::addSoftUpdateLoader):
        (WebKit::NetworkSession::removeSoftUpdateLoader):
        * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp:
        (WebKit::ServiceWorkerFetchTask::ServiceWorkerFetchTask):
        (WebKit::ServiceWorkerFetchTask::didReceiveRedirectResponse):
        (WebKit::ServiceWorkerFetchTask::didReceiveResponse):
        (WebKit::ServiceWorkerFetchTask::didFail):
        (WebKit::ServiceWorkerFetchTask::didNotHandle):
        (WebKit::ServiceWorkerFetchTask::continueFetchTaskWith):
        (WebKit::ServiceWorkerFetchTask::timeoutTimerFired):
        (WebKit::ServiceWorkerFetchTask::softUpdateIfNeeded):
        * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h:
        * NetworkProcess/ServiceWorker/ServiceWorkerSoftUpdateLoader.cpp: Added.
        (WebKit::ServiceWorkerSoftUpdateLoader::start):
        (WebKit::ServiceWorkerSoftUpdateLoader::ServiceWorkerSoftUpdateLoader):
        (WebKit::ServiceWorkerSoftUpdateLoader::~ServiceWorkerSoftUpdateLoader):
        (WebKit::ServiceWorkerSoftUpdateLoader::fail):
        (WebKit::ServiceWorkerSoftUpdateLoader::loadWithCacheEntry):
        (WebKit::ServiceWorkerSoftUpdateLoader::loadFromNetwork):
        (WebKit::ServiceWorkerSoftUpdateLoader::willSendRedirectedRequest):
        (WebKit::ServiceWorkerSoftUpdateLoader::didReceiveResponse):
        (WebKit::ServiceWorkerSoftUpdateLoader::didReceiveBuffer):
        (WebKit::ServiceWorkerSoftUpdateLoader::didFinishLoading):
        (WebKit::ServiceWorkerSoftUpdateLoader::didFailLoading):
        (WebKit::ServiceWorkerSoftUpdateLoader::didComplete):
        * NetworkProcess/ServiceWorker/ServiceWorkerSoftUpdateLoader.h: Added.
        * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
        (WebKit::WebSWServerConnection::createFetchTask):
        * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
        * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
        * Shared/Authentication/AuthenticationManager.cpp:
        (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
        * Sources.txt:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        * WebProcess/Storage/WebSWContextManagerConnection.h:
        * WebProcess/Storage/WebSWContextManagerConnection.messages.in:

2019-12-04  Tim Horton  <timothy_horton@apple.com>

        Introduce a GPU process
        https://bugs.webkit.org/show_bug.cgi?id=204343

        Reviewed by Simon Fraser.

        Add a GPU process. This process is destined to be used as a proxy between
        WebKit and the underlying graphics mechanisms; in the case of the Cocoa
        ports, it will specifically gate access to IOKit and a few media-related
        daemons.

        In this patch, the process is a UI-process singleton; the WebKit client
        application gets a single GPU process for all rendering, regardless of
        the number of Web Content processes, process pools, or web views.

        For now, it is just a shell of a process; functionality will be added
        in future patches!

        * Configurations/FeatureDefines.xcconfig:
        Add ENABLE(GPU_PROCESS).

        * Configurations/GPUService.xcconfig: Added.
        * GPUProcess/EntryPoint/Cocoa/XPCService/GPUService/Info-OSX.plist: Added.
        * GPUProcess/EntryPoint/Cocoa/XPCService/GPUService/Info-iOS.plist: Added.
        * GPUProcess/EntryPoint/Cocoa/XPCService/GPUServiceEntryPoint.mm: Added.
        * Shared/AuxiliaryProcess.h:
        * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h:
        * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
        * Platform/ExtraPrivateSymbolsForTAPI.h:
        * Shared/mac/AuxiliaryProcessMac.mm:
        * Sources.txt:
        * SourcesCocoa.txt:
        * WebKit.xcodeproj/project.pbxproj:
        * Configurations/WebKit.xcconfig:
        * DerivedSources-input.xcfilelist:
        * DerivedSources-output.xcfilelist:
        * DerivedSources.make:
        * UIProcess/AuxiliaryProcessProxy.cpp:
        (WebKit::AuxiliaryProcessProxy::getLaunchOptions):
        * UIProcess/Launcher/ProcessLauncher.h:
        * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
        (WebKit::serviceName):
        (WebKit::shouldLeakBoost):
        Add a new target for the XPC service, and do the paperwork to launch it.

        * GPUProcess/GPUConnectionToWebProcess.cpp: Added.
        * GPUProcess/GPUConnectionToWebProcess.h: Added.
        * GPUProcess/GPUConnectionToWebProcess.messages.in: Added.
        On the GPU process side, the incoming connection from the Web Content process.

        * GPUProcess/GPUProcess.cpp: Added.
        * GPUProcess/GPUProcess.h: Added.
        * GPUProcess/GPUProcess.messages.in: Added.
        * GPUProcess/GPUProcessCreationParameters.cpp: Added.
        * GPUProcess/GPUProcessCreationParameters.h: Added.
        * GPUProcess/cocoa/GPUProcessCocoa.mm: Added.
        * GPUProcess/ios/GPUProcessIOS.mm: Added.
        * GPUProcess/mac/GPUProcessMac.mm: Added.
        Add the shell of the GPU process. Mostly stolen from the Networking process.

        * UIProcess/GPU/GPUProcessProxy.cpp: Added.
        (WebKit::GPUProcessProxy::singleton):
        (WebKit::GPUProcessProxy::GPUProcessProxy):
        (WebKit::GPUProcessProxy::~GPUProcessProxy):
        (WebKit::GPUProcessProxy::getLaunchOptions):
        (WebKit::GPUProcessProxy::connectionWillOpen):
        (WebKit::GPUProcessProxy::processWillShutDown):
        (WebKit::GPUProcessProxy::getGPUProcessConnection):
        (WebKit::GPUProcessProxy::openGPUProcessConnection):
        (WebKit::GPUProcessProxy::gpuProcessCrashed):
        (WebKit::GPUProcessProxy::didReceiveMessage):
        (WebKit::GPUProcessProxy::didReceiveSyncMessage):
        (WebKit::GPUProcessProxy::didClose):
        (WebKit::GPUProcessProxy::didReceiveInvalidMessage):
        (WebKit::GPUProcessProxy::didFinishLaunching):
        (WebKit::GPUProcessProxy::updateProcessAssertion):
        * UIProcess/GPU/GPUProcessProxy.h: Added.
        * UIProcess/GPU/GPUProcessProxy.messages.in: Added.
        On the UI process side, the GPUProcessProxy is the singleton that
        owns the GPU process for the process.

        * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in: Added.
        This sandbox profile is copied from the Web Content process.
        We will cut it down in the future, but this is a sensible starting point,
        since the code that is moving to the GPU process is code that currently
        lives in the Web Content process.
        
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::updateProcessAssertion):
        Fix a logging typo I stumbled upon.

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::getGPUProcessConnection):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::getGPUProcessConnection):
        * UIProcess/WebProcessProxy.h:
        * UIProcess/WebProcessProxy.messages.in:
        Add a message from Web->UI to retrieve the GPU process connection.
        In the future, we should send this along with the Web Content process
        initialization message, but this mechanism doesn't exist yet.

        * WebProcess/GPU/GPUProcessConnection.cpp: Added.
        (WebKit::GPUProcessConnection::GPUProcessConnection):
        (WebKit::GPUProcessConnection::~GPUProcessConnection):
        (WebKit::GPUProcessConnection::didReceiveMessage):
        (WebKit::GPUProcessConnection::didReceiveSyncMessage):
        (WebKit::GPUProcessConnection::didClose):
        (WebKit::GPUProcessConnection::didReceiveInvalidMessage):
        * WebProcess/GPU/GPUProcessConnection.h: Added.
        (WebKit::GPUProcessConnection::create):
        (WebKit::GPUProcessConnection::connection):
        * WebProcess/GPU/GPUProcessConnection.messages.in: Added.
        * WebProcess/GPU/GPUProcessConnectionInfo.h: Added.
        (WebKit::GPUProcessConnectionInfo::identifier):
        (WebKit::GPUProcessConnectionInfo::releaseIdentifier):
        (WebKit::GPUProcessConnectionInfo::encode const):
        (WebKit::GPUProcessConnectionInfo::decode):
        In the Web Content process, GPUProcessConnection is the process-wide
        connection to the GPU process. All pages in a given Web Content process
        use the same connection to talk to the singleton GPU process.

        * WebProcess/WebProcess.cpp:
        (WebKit::getGPUProcessConnection):
        (WebKit::WebProcess::ensureGPUProcessConnection):
        (WebKit::WebProcess::gpuProcessConnectionClosed):
        * WebProcess/WebProcess.h:
        (WebKit::WebProcess::existingGPUProcessConnection):
        In the Web Content process, make it possible for clients to retrieve
        the GPU process connection.

2019-12-04  Yury Semikhatsky  <yurys@chromium.org>

        Web Inspector: allow inspector to pause provisional page load and restore its state
        https://bugs.webkit.org/show_bug.cgi?id=204170

        Reviewed by Devin Rousso.

        Provisional page loading can be deffered if inspector front-end is connected. This
        allows to configure inspector backend in the provisional page before load request
        is sent. If inspector front-end is not connected provisional loading will conitinue
        exactly as before.

        Tests: http/tests/inspector/target/pause-on-inline-debugger-statement.html
               http/tests/inspector/target/provisional-load-cancels-previous-load.html

        * UIProcess/InspectorTargetProxy.cpp:
        (WebKit::InspectorTargetProxy::disconnect):
        * UIProcess/WebPageInspectorController.cpp:
        (WebKit::WebPageInspectorController::shouldPauseLoading const):
        (WebKit::WebPageInspectorController::setContinueLoadingCallback):
        * UIProcess/WebPageInspectorController.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::continueNavigationInNewProcess):

2019-12-03  Megan Gardner  <megan_gardner@apple.com>

        Add disabled highlight API skeleton
        https://bugs.webkit.org/show_bug.cgi?id=204809

        Reviewed by Ryosuke Niwa.

        * Shared/WebPreferences.yaml:
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetHighlightAPIEnabled):
        (WKPreferencesGetHighlightAPIEnabled):
        * UIProcess/API/C/WKPreferencesRefPrivate.h:

2019-12-03  Ryosuke Niwa  <rniwa@webkit.org>

        Replace customJavaScriptUserAgentAsSiteSpecificQuirks with customUserAgentAsSiteSpecificQuirks
        https://bugs.webkit.org/show_bug.cgi?id=204824

        Reviewed by Brent Fulgham.

        This patch replaces _WKWebsitePolicies's customJavaScriptUserAgentAsSiteSpecificQuirks with
        customUserAgentAsSiteSpecificQuirks and makes it apply to network requests as well as JS API.

        * Shared/WebsitePoliciesData.cpp:
        (WebKit::WebsitePoliciesData::encode const):
        (WebKit::WebsitePoliciesData::decode):
        (WebKit::WebsitePoliciesData::applyToDocumentLoader):
        * Shared/WebsitePoliciesData.h:
        * UIProcess/API/APIWebsitePolicies.cpp:
        (API::WebsitePolicies::copy const):
        (API::WebsitePolicies::data):
        * UIProcess/API/APIWebsitePolicies.h:
        * UIProcess/API/Cocoa/WKWebpagePreferences.mm:
        (-[WKWebpagePreferences _setCustomUserAgentAsSiteSpecificQuirks:]): Renamed from _setCustomJavaScriptUserAgentAsSiteSpecificQuirks.
        (-[WKWebpagePreferences _customUserAgentAsSiteSpecificQuirks]): Renamed from _customJavaScriptUserAgentAsSiteSpecificQuirks.
        * UIProcess/API/Cocoa/WKWebpagePreferencesPrivate.h:
        * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
        * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
        (-[_WKWebsitePolicies setCustomUserAgentAsSiteSpecificQuirks:]): Renamed from setCustomJavaScriptUserAgentAsSiteSpecificQuirks.
        (-[_WKWebsitePolicies customUserAgentAsSiteSpecificQuirks]): Renamed from customJavaScriptUserAgentAsSiteSpecificQuirks.

2019-12-03  Andres Gonzalez  <andresg_22@apple.com>

        Focus tracking support in the accessibility isolatedtree.
        https://bugs.webkit.org/show_bug.cgi?id=204535

        Reviewed by Chris Fleizach.

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

2019-12-03  John Wilander  <wilander@apple.com>

        Resource Load Statistics (experimental): Delete non-cookie website data after 7 days of no user interaction
        https://bugs.webkit.org/show_bug.cgi?id=204779
        <rdar://problem/57578989>

        Reviewed by Alex Christensen.

        Trackers are continuing to move cross-site tracking IDs into first-party storage.
        This change ages out script-writable non-cookie website data in alignment with the
        7-day cap on client-side cookies.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        (WebKit::ResourceLoadStatisticsDatabaseStore::shouldRemoveAllButCookiesFor const):
            Now makes use of the set WebCore::FirstPartyWebsiteDataRemovalMode.
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
        (WebKit::ResourceLoadStatisticsMemoryStore::shouldRemoveAllButCookiesFor const):
            Now makes use of the set WebCore::FirstPartyWebsiteDataRemovalMode.
        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
        (WebKit::ResourceLoadStatisticsStore::setFirstPartyWebsiteDataRemovalMode):
        (WebKit::ResourceLoadStatisticsStore::firstPartyWebsiteDataRemovalMode const):
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::setFirstPartyWebsiteDataRemovalMode):
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::setFirstPartyWebsiteDataRemovalModeForTesting):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::setResourceLoadStatisticsEnabled):
        (WebKit::NetworkSession::recreateResourceLoadStatisticStore):
        (WebKit::NetworkSession::forwardResourceLoadStatisticsSettings):
            New convenience function to avoid code duplication in
            NetworkSession::setResourceLoadStatisticsEnabled() and 
            NetworkSession::forwardResourceLoadStatisticsSettings().
        * NetworkProcess/NetworkSession.h:
        * NetworkProcess/NetworkSessionCreationParameters.cpp:
        (WebKit::NetworkSessionCreationParameters::encode const):
        (WebKit::NetworkSessionCreationParameters::decode):
        * NetworkProcess/NetworkSessionCreationParameters.h:
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
        * Scripts/webkit/messages.py:
            Makes sure the WebCore::FirstPartyWebsiteDataRemovalMode is found in WebCore/NetworkStorageSession.h.
        * Shared/WebPreferences.yaml:
            New experimental feature, off by default.
        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreSetResourceLoadStatisticsFirstPartyWebsiteDataRemovalModeForTesting):
        (WKWebsiteDataStoreStatisticsResetToConsistentState):
        * UIProcess/API/C/WKWebsiteDataStoreRef.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::setFirstPartyWebsiteDataRemovalModeForTesting):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::parameters):
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::setResourceLoadStatisticsFirstPartyWebsiteDataRemovalModeForTesting):
        * UIProcess/WebsiteData/WebsiteDataStore.h:

2019-12-03  Chris Dumez  <cdumez@apple.com>

        [iOS] Unable to interact with the view after a back swipe until lifting the finger off the screen
        https://bugs.webkit.org/show_bug.cgi?id=204821

        Reviewed by Tim Horton.

        If you swipe back on iOS and then put your finger on the screen before the view gesture snapshot is taken down,
        your gestures will not be recognized, even after the snapshot is taken down, until after you lift your finger
        off the screen and back on. This makes MobileSafari look more unresponsive than it needs to be.

        To address the issue, disable user interactions for the snapshot view, so that interactions go through to the
        actual view underneath.

        * UIProcess/ios/ViewGestureControllerIOS.mm:
        (WebKit::ViewGestureController::beginSwipeGesture):

2019-12-03  Chris Dumez  <cdumez@apple.com>

        Use a 3 second timeout for the view gesture snapshot on macOS
        https://bugs.webkit.org/show_bug.cgi?id=204818

        Reviewed by Tim Horton.

        Use a 3 second timeout for the view gesture snapshot on macOS, for consistency with iOS.
        It used to be 5 seconds on macOS.

        * UIProcess/ViewGestureController.cpp:

2019-12-03  Chris Dumez  <cdumez@apple.com>

        REGRESSION (r252778): ASSERT(!m_networkLoad); in ~SpeculativeLoad()
        https://bugs.webkit.org/show_bug.cgi?id=204813
        <rdar://problem/57581082>

        Reviewed by Antti Koivisto.

        After r252778, SpeculativeLoadManager::revalidateSubresource() may delay the revalidation until we receive
        the response for the main resource. We can hit the assertion in the SpeculativeLoad destructor if a speculative
        revalidation for the SAME resource gets scheduled while we're waiting for the main resource response. When we
        eventually receive the main resource response, we would call revalidateSubresource() again, which would create
        a SpeculativeLoad and try to add it to m_pendingPreloads. Because m_pendingPreloads would already contain a
        preload for this same resource, the SpeculativeLoad would not get added to the map and it would get destroyed
        right away, before completing (thus hitting the assert). This unnecessary creation of the SpeculativeLoad is
        inefficient and it is thus best to avoid it.

        To address the issue, when we receive the response, we now make sure that m_pendingPreloads does not already
        contain a preload for this resource before calling revalidateSubresource() again, similarly to what was
        already done at the beginning of SpeculativeLoadManager::preloadEntry().

        No new tests, unknown how to reproduce.

        * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
        (WebKit::NetworkCache::SpeculativeLoadManager::revalidateSubresource):

2019-12-03  Eric Carlson  <eric.carlson@apple.com>

        Add a runtime setting for media in the GPU process
        https://bugs.webkit.org/show_bug.cgi?id=204801
        <rdar://problem/57596199>

        Reviewed by Jer Noble.

        * Shared/WebPreferences.yaml:
        * WebProcess/InjectedBundle/InjectedBundle.cpp:
        (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):

2019-12-03  Per Arne Vollan  <pvollan@apple.com>

        Unreviewed assertion fix for older macOS versions after r253011.

        * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
        (WebKit::UserMediaPermissionRequestManagerProxy::finishGrantingRequest):
        * UIProcess/UserMediaPermissionRequestManagerProxy.h:

2019-12-03  Antoine Quint  <graouts@apple.com>

        [Web Animations] Add a runtime flag for Web Animations composite operations
        https://bugs.webkit.org/show_bug.cgi?id=204718

        Reviewed by Dean Jackson.

        * Shared/WebPreferences.yaml:

2019-12-03  Youenn Fablet  <youenn@apple.com>

        UserMediaCaptureManager should have independent capture factories
        https://bugs.webkit.org/show_bug.cgi?id=204786

        Reviewed by Eric Carlson.

        Refactor the code to make UserMediaCaptureManager have 3 different factories.
        This allows having 3 potential active sources which are used on iOS.
        We cannot test right now on iOS as audio capture in UIProcess is not yet ready.

        * WebProcess/cocoa/UserMediaCaptureManager.cpp:
        (WebKit::UserMediaCaptureManager::Source::Source):
        (WebKit::UserMediaCaptureManager::Source::~Source):
        (WebKit::UserMediaCaptureManager::UserMediaCaptureManager):
        (WebKit::UserMediaCaptureManager::~UserMediaCaptureManager):
        (WebKit::UserMediaCaptureManager::initialize):
        (WebKit::UserMediaCaptureManager::createCaptureSource):
        (WebKit::UserMediaCaptureManager::AudioFactory::setAudioCapturePageState):
        (WebKit::UserMediaCaptureManager::VideoFactory::setVideoCapturePageState):
        (WebKit::UserMediaCaptureManager::setAudioCapturePageState): Deleted.
        (WebKit::UserMediaCaptureManager::setVideoCapturePageState): Deleted.
        * WebProcess/cocoa/UserMediaCaptureManager.h:
        (WebKit::UserMediaCaptureManager::AudioFactory::AudioFactory):
        (WebKit::UserMediaCaptureManager::VideoFactory::VideoFactory):
        (WebKit::UserMediaCaptureManager::DisplayFactory::DisplayFactory):

2019-12-03  Chris Dumez  <cdumez@apple.com>

        PageConfiguration::pluginClient should use a smart pointer
        https://bugs.webkit.org/show_bug.cgi?id=204780

        Reviewed by Anders Carlsson.

        * WebProcess/WebCoreSupport/WebPlugInClient.cpp:
        * WebProcess/WebCoreSupport/WebPlugInClient.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_overriddenMediaType):

2019-12-03  Chris Dumez  <cdumez@apple.com>

        PageConfiguration::alternativeTextClient should use a smart pointer
        https://bugs.webkit.org/show_bug.cgi?id=204777

        Reviewed by Anders Carlsson.

        * WebProcess/WebCoreSupport/WebAlternativeTextClient.h:
        * WebProcess/WebCoreSupport/mac/WebAlternativeTextClient.cpp:
        (WebKit::WebAlternativeTextClient::pageDestroyed): Deleted.
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_overriddenMediaType):

2019-12-03  Kate Cheney  <katherine_cheney@apple.com>

        Activate the SQLite database as an on-by-default feature
        https://bugs.webkit.org/show_bug.cgi?id=204774
        <rdar://problem/56117706>

        Reviewed by Brent Fulgham.

        The flag to use the ITP Database backend should be set to true by default.
        * Shared/WebPreferences.yaml:

2019-12-03  youenn fablet  <youenn@apple.com>

        Add support for camera rotation when capturing in UIProcess
        https://bugs.webkit.org/show_bug.cgi?id=204750

        Reviewed by Eric Carlson.

        Make UserMediaCaptureManagerProxy have an OrientationNotifier.
        It is updated by each web page of the web process being notified of a device orientation change.
        Whenever a rotation happens, UIProcess sources are now notified to correctly compute the frame rotations.

        Covered by existing tests.

        * UIProcess/API/C/WKPage.cpp:
        (WKPageSetMockCameraOrientation):
        * UIProcess/API/C/WKPagePrivate.h:
        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
        (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
        (WebKit::UserMediaCaptureManagerProxy::setOrientation):
        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::setOrientationForMediaCapture):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebProcessProxy.h:
        (WebKit::WebProcessProxy::userMediaCaptureManagerProxy):
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::setDeviceOrientation):

2019-12-03  Antti Koivisto  <antti@apple.com>

        [LFC][Integration] Shorten feature flag name
        https://bugs.webkit.org/show_bug.cgi?id=204788

        Reviewed by Sam Weinig.

        * Shared/WebPreferences.yaml:
        * WebProcess/InjectedBundle/InjectedBundle.cpp:
        (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):

2019-12-03  youenn fablet  <youenn@apple.com>

        Expose WKWebView API to stop ongoing capture
        https://bugs.webkit.org/show_bug.cgi?id=204787

        Reviewed by Eric Carlson.

        Covered by API test.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _stopMediaCapture]):
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:

2019-12-03  youenn fablet  <youenn@apple.com>

        [Cocoa] Run camera capture in UIProcess by default in layout tests
        https://bugs.webkit.org/show_bug.cgi?id=204512

        Reviewed by Eric Carlson.

        * UIProcess/UserMediaProcessManager.cpp:
        (WebKit::UserMediaProcessManager::willCreateMediaStream):
        Do not send sandbox extensions in case capture happens in UIProcess.
        * WebProcess/cocoa/UserMediaCaptureManager.cpp:
        (WebKit::UserMediaCaptureManager::Source::~Source):
        (WebKit::UserMediaCaptureManager::createCaptureSource):
        Register/unregister sources as active/unactive sources to the factory.

2019-12-03  Carlos Garcia Campos  <cgarcia@igalia.com>

        WebDriver: handle elements of type file in send keys command
        https://bugs.webkit.org/show_bug.cgi?id=188514

        Reviewed by Brian Burg.

        Add setFilesForInputFileUpload method to Automation. It's like setFilesToSelectForFileUpload, but it works
        differently, so I'm keeping both to not break safaridriver. The new one simply sends the file list to the web
        process to be set on the input element, instead of saving the file list, wait for the driver to trigger the open
        panel, intercept and complete the open panel request and send a dismiss open panel event to the driver.

        * UIProcess/Automation/Automation.json: Add setFilesForInputFileUpload.
        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::setFilesForInputFileUpload): Send SetFilesForInputFileUpload message to the web process.
        * UIProcess/Automation/WebAutomationSession.h:
        * WebProcess/Automation/WebAutomationSessionProxy.cpp:
        (WebKit::WebAutomationSessionProxy::setFilesForInputFileUpload): Create a FileList with the received paths and
        call HTMLInputElement::setFiles() on the given element.
        * WebProcess/Automation/WebAutomationSessionProxy.h:
        * WebProcess/Automation/WebAutomationSessionProxy.messages.in: Add SetFilesForInputFileUpload message.

2019-12-03  Carlos Garcia Campos  <cgarcia@igalia.com>

        WebDriver: most of the clear tests are failing
        https://bugs.webkit.org/show_bug.cgi?id=180404

        Reviewed by Brian Burg.

        Update the FormElementClear atom to follow the spec.

        * UIProcess/Automation/atoms/FormElementClear.js:
        (isEditable):
        (isResettableElementEmpty):

2019-12-03  Carlos Garcia Campos  <cgarcia@igalia.com>

        [PSON] Tooltips from previous page shown on new page
        https://bugs.webkit.org/show_bug.cgi?id=204735

        Reviewed by Chris Dumez.

        The problem is that WebPage (in the web process) is caching the tooltip text to avoid sending IPC messages when
        the tooltip didn't change. When a new web process is used for the same web view, the tooltip text doesn't really
        change (it's always null) until a new one is set. The setToolTip message is always sent right after the
        MouseDidMoveOverElement, and they both depend on the same hit test result, so we can include the tooltip text as
        part of the WebHitTestResultData struct passed to MouseDidMoveOverElement and remove the SetToolTip
        message. Since the UI process is already caching the tooltip, we can simply notify the page client when it changes.

        * Shared/WebHitTestResultData.cpp:
        (WebKit::WebHitTestResultData::WebHitTestResultData): Initialize toolTipText.
        (WebKit::WebHitTestResultData::encode const): Encode toolTipText.
        (WebKit::WebHitTestResultData::decode): Decode toolTipText.
        * Shared/WebHitTestResultData.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::mouseDidMoveOverElement): Call setToolTip() after notifying the UI client about the mouse move.
        (WebKit::WebPageProxy::setToolTip): Return early if tooltip didn't change.
        (WebKit::WebPageProxy::resetState): Use setToolTip() to ensure the page client is notified about the change.
        * UIProcess/WebPageProxy.messages.in: Remove SetToolTip message.
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::mouseDidMoveOverElement): Pass tooltip text to WebHitTestResultData constructor.
        * WebProcess/WebCoreSupport/WebChromeClient.h:

2019-12-02  Sihui Liu  <sihui_liu@apple.com>

        Cross-thread version StorageQuotaManager
        https://bugs.webkit.org/show_bug.cgi?id=203971
        <rdar://problem/57290349>

        Reviewed by Chris Dumez.

        * NetworkProcess/NetworkProcess.cpp: Introduce class SessionStorageQuotaManager to manage all 
        StorageQuotaManagers of the same session. 
        (WebKit::NetworkProcess::initializeNetworkProcess):
        (WebKit::NetworkProcess::addWebsiteDataStore):
        (WebKit::NetworkProcess::addSessionStorageQuotaManager):
        (WebKit::NetworkProcess::removeSessionStorageQuotaManager):
        (WebKit::NetworkProcess::destroySession):
        (WebKit::NetworkProcess::deleteWebsiteData):
        (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
        (WebKit::NetworkProcess::createIDBServer):
        (WebKit::NetworkProcess::addIndexedDatabaseSession):
        (WebKit::NetworkProcess::setSessionStorageQuotaManagerIDBRootPath):
        (WebKit::NetworkProcess::updateQuotaBasedOnSpaceUsageForTesting):
        (WebKit::NetworkProcess::resetQuota):
        (WebKit::NetworkProcess::storageQuotaManager):
        (WebKit::NetworkProcess::initializeStorageQuota): Deleted.
        (WebKit::NetworkProcess::clearStorageQuota): Deleted.
        (): Deleted.
        (WebKit::NetworkProcess::initializeQuotaUsers): Deleted.
        * NetworkProcess/NetworkProcess.h:
        (WebKit::NetworkProcess::SessionStorageQuotaManager::SessionStorageQuotaManager):
        (WebKit::NetworkProcess::SessionStorageQuotaManager::defaultQuota const):
        (WebKit::NetworkProcess::SessionStorageQuotaManager::ensureOriginStorageQuotaManager):
        (WebKit::NetworkProcess::SessionStorageQuotaManager::existingStorageQuotaManagers):
        (WebKit::NetworkProcess::SessionStorageQuotaManager::cacheRootPath const):
        (WebKit::NetworkProcess::SessionStorageQuotaManager::setIDBRootPath):
        (WebKit::NetworkProcess::SessionStorageQuotaManager::idbRootPath const):
        (WebKit::NetworkProcess::StorageQuotaManagers::defaultQuota const): Deleted.
        (WebKit::NetworkProcess::StorageQuotaManagers::setDefaultQuotas): Deleted.
        (WebKit::NetworkProcess::StorageQuotaManagers::managersPerOrigin): Deleted.
        * NetworkProcess/NetworkProcess.messages.in:
        * NetworkProcess/cache/CacheStorageEngine.cpp:
        (WebKit::CacheStorage::getDirectorySize):
        (WebKit::CacheStorage::Engine::diskUsage): static function to get the disk usage of CacheStorage given 
        CacheStorage root directory.
        (WebKit::CacheStorage::Engine::requestSpace):
        (WebKit::CacheStorage::Engine::readCachesFromDisk):
        (WebKit::CacheStorage::Engine::writeSizeFile):
        (WebKit::CacheStorage::Engine::readSizeFile):
        (WebKit::CacheStorage::Engine::initializeQuotaUser): Deleted.
        * NetworkProcess/cache/CacheStorageEngine.h:
        * NetworkProcess/cache/CacheStorageEngineCache.cpp:
        (WebKit::CacheStorage::Cache::put):
        (WebKit::CacheStorage::Cache::remove):
        * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
        (WebKit::CacheStorage::Caches::create):
        (WebKit::CacheStorage::Caches::Caches):
        (WebKit::CacheStorage::Caches::~Caches):
        (WebKit::CacheStorage::Caches::updateSizeFile):
        (WebKit::CacheStorage::Caches::initializeSize):
        (WebKit::CacheStorage::Caches::clear):
        (WebKit::CacheStorage::Caches::requestSpace):
        (WebKit::CacheStorage::Caches::writeRecord):
        (WebKit::CacheStorage::Caches::removeRecord):
        (WebKit::CacheStorage::Caches::whenInitialized): Deleted.
        (WebKit::CacheStorage::Caches::resetSpaceUsed): Deleted.
        * NetworkProcess/cache/CacheStorageEngineCaches.h:
        * Shared/WebsiteDataStoreParameters.cpp:
        (WebKit::WebsiteDataStoreParameters::encode const):
        (WebKit::WebsiteDataStoreParameters::decode):
        * Shared/WebsiteDataStoreParameters.h: Add a cacheStorageDirectory parameter so we know the direcotry of 
        CacheStorage when we start using WebsiteDataStore.
        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreResetQuota):
        * UIProcess/API/C/WKWebsiteDataStoreRef.h: Add a C API for reseting quota in TestRunner.
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::resetQuota):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::parameters):
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::parameters):
        (WebKit::WebsiteDataStore::resetQuota):
        * UIProcess/WebsiteData/WebsiteDataStore.h:

2019-12-02  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Create sandbox extension for "com.apple.tccd"
        https://bugs.webkit.org/show_bug.cgi?id=204367
        <rdar://problem/57330176>

        Reviewed by Eric Carlson.

        When camera or microphone access has been granted by the user, have the UI process create a sandbox extension
        for "com.apple.tccd", and send it to the WebContent process. Also make sure the extension is created only once
        for each WebContent process. Add telemetry to the tccd rule in the sandbox.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
        * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
        (WebKit::UserMediaPermissionRequestManagerProxy::finishGrantingRequest):
        * UIProcess/UserMediaPermissionRequestManagerProxy.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::userMediaAccessWasGranted):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2019-12-02  Louie Livon-Bemel  <llivonbemel@apple.com>

        Add helper methods for description and equality to text manipulation SPI
        https://bugs.webkit.org/show_bug.cgi?id=204758
        <rdar://problem/57438200>

        Reviewed by Wenson Hsieh.

        I originally added some category methods to _WKTextManipulationItem and _WKTextManipulationToken within Safari
        to make working with these classes easier. However it makes more sense to just move these methods into
        the main class. One method is for checking if two instances are equal (including identifiers) and optionally
        checking if the content itself is equal. The other methods are for debug descriptions for lldb, and a
        method to get a description that preserves privacy; when logging the instance, the content of the webpage
        should be redacted.

        Tests: Tests are added as API tests.

        * UIProcess/API/Cocoa/_WKTextManipulationItem.h:
            - Assume everything is non-null unless otherwise specified.
            - Allow the identifier to be nil, but not the array of tokens.
            - Add a method to check the equality to another item, optionally including a check for the content of each
              token being equal.
            - Add a -debugDescription method that includes the content of tokens for use in lldb. This NSObject
              declaration is marked optional, so redeclare it here.
            - No need to add a -description declaration since it exists on NSObject already.
        * UIProcess/API/Cocoa/_WKTextManipulationItem.mm:
        (-[_WKTextManipulationItem isEqual:]):
            The standard NSObject equality check should call our method with equal content.
        (-[_WKTextManipulationItem isEqualToTextManipulationItem:includingContentEquality:]):
            - If the other item is nil, the identifiers aren't equal or the number of tokens are mismatched, these
              items aren't equal.
            - Just to be safe, only iterate the smaller of the token arrays so we don't crash.
            - Check if each token is equal, passing along the `includingContentEquality` parameter.
        (-[_WKTextManipulationItem description]):
            The general description should not include the webpage content.
        (-[_WKTextManipulationItem debugDescription]):
            Include the webpage content, since this is for lldb.
        (-[_WKTextManipulationItem _descriptionPreservingPrivacy:]):
            Include the standard description format, and each token on its own line. If we're including the content
            then use `token.debugDescription`.
        * UIProcess/API/Cocoa/_WKTextManipulationToken.h:
            - Also assume everything is non-null.
            - Identifier and Content can be nil.
            - Declare a -debugDescription method.
            - Declare a method to check equality, with or without the content.
        * UIProcess/API/Cocoa/_WKTextManipulationToken.mm:
        (isEqualOrBothNil):
            Helper that checks equality but considers two nil values to be equal as well.
        (-[_WKTextManipulationToken isEqual:]):
            The standard NSObject equality check should call our method with equal content.
        (-[_WKTextManipulationToken isEqualToTextManipulationToken:includingContentEquality:]):
            Check that the exclusions are equal, the identifiers are equal (considering two nils to be equal), and the
            content if necessary.
        (-[_WKTextManipulationToken description]):
        (-[_WKTextManipulationToken debugDescription]):
        (-[_WKTextManipulationToken _descriptionPreservingPrivacy:]):
            If we're preserving privacy, log the content length rather than the content string itself.

2019-12-02  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] Introduce a gesture recognizer that can be used to defer recognition of other gestures
        https://bugs.webkit.org/show_bug.cgi?id=204748
        <rdar://problem/38670692>

        Reviewed by Tim Horton.

        Introduces WKDeferringGestureRecognizer, which is similar to UIKit's _UIRelationshipGestureRecognizer. In a
        future patch, this will be added to WKContentView to prevent platform gestures (pinching, panning, single/double
        taps, etc.) from recognizing when dispatching a preventable touch event to the page.

        Additionally renames a member variable on WKContentView, in preparation for making touch gesture recognition
        asynchronous. No new tests, since there is no change in behavior yet.

        * SourcesCocoa.txt:

        Add the new file.

        * UIProcess/ios/WKContentViewInteraction.h:

        Add a couple of (currently unused) deferring gesture recognizers. These will be added to WKContentView in a
        future patch. There are two deferring gestures here (one for "immediately resettable" gestures and another for
        gestures for which the reset is "deferred" -- i.e., multi-tap gestures); this prevents a single deferring
        gesture from connecting the entire gesture subgraph under WKWebView through failure dependencies. This would
        result in various usability issues, such as being unable to perform a pan gesture to scroll WKScrollView if a
        tap was recognized within the last 300 ms, since all gestures would need to wait until every double and triple-
        tap gesture under WKWebView has failed.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView setupInteraction]):
        (-[WKContentView _webTouchEventsRecognized:]):

        Rename _canSendTouchEventsAsynchronously to _touchEventsCanPreventNativeGestures in preparation for adding a
        codepath for fully asynchronous touch event dispatch; we also flip the conditional in any places where
        _canSendTouchEventsAsynchronously was previously set or read.

        (-[WKContentView _webTouchEvent:preventsNativeGestures:]):
        (-[WKContentView scrollViewWillStartPanOrPinchGesture]):
        (-[WKContentView gestureRecognizer:shouldIgnoreWebTouchWithEvent:]):
        (-[WKContentView gestureRecognizer:isInterruptingMomentumScrollingWithEvent:]):
        (-[WKContentView deferringGestureRecognizer:shouldDeferGesturesWithEvent:]):
        (-[WKContentView deferringGestureRecognizer:shouldDeferOtherGestureRecognizer:]):

        Implement WKDeferringGestureRecognizerDelegate.

        (-[WKContentView shouldIgnoreWebTouch]): Deleted.

        Drive-by fix: remove this unnecessary method implementation, and the related FIXME.

        * UIProcess/ios/WKDeferringGestureRecognizer.h: Added.
        * UIProcess/ios/WKDeferringGestureRecognizer.mm: Added.
        (-[WKDeferringGestureRecognizer initWithDeferringGestureDelegate:]):
        (-[WKDeferringGestureRecognizer deferringGestureDelegate]):
        (-[WKDeferringGestureRecognizer touchesBegan:withEvent:]):

        Unless the touch is interrupts momentum scrolling, WKDeferringGestureRecognizer should transition to Possible
        state when starting a touch. Later, -setDefaultPrevented: is invoked, which will either transition the deferring
        gesture recognizer to Failed state (thereby allowing native gestures to begin), or Ended state (preventing other
        native gestures).

        (-[WKDeferringGestureRecognizer touchesCancelled:withEvent:]):
        (-[WKDeferringGestureRecognizer setDefaultPrevented:]):
        (-[WKDeferringGestureRecognizer canBePreventedByGestureRecognizer:]):

        Return NO here to prevent certain platform gestures (e.g. scroll view panning) from causing the deferring
        gesture to Failed state, when these gestures attempt to transition from Possible to Began state.

        (-[WKDeferringGestureRecognizer shouldDeferGestureRecognizer:]):
        * WebKit.xcodeproj/project.pbxproj:

2019-12-02  Yoshiaki Jitsukawa  <yoshiaki.jitsukawa@sony.com>

        ResponsivenessTimer mistakenly restarts immediately
        https://bugs.webkit.org/show_bug.cgi?id=204659

        Reviewed by Chris Dumez.

        * UIProcess/ResponsivenessTimer.cpp:
        (WebKit::ResponsivenessTimer::timerFired):
        Give startOneShot() a positive number timeout.

2019-12-02  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][PSON] Crash in NetworkProcessProxy::openNetworkProcessConnection
        https://bugs.webkit.org/show_bug.cgi?id=204703

        Reviewed by Michael Catanzaro.

        Stop sending a message to all web process to prefetch DNS for a hostname. All web processes then send a messaage
        to their network process to prefetch the DNS. Instead, send a message directly to the network process.

        * NetworkProcess/NetworkProcess.messages.in:
        * UIProcess/API/glib/WebKitWebContext.cpp:
        (webkit_web_context_prefetch_dns):
        * WebProcess/InjectedBundle/API/glib/WebKitWebExtension.cpp:

2019-12-01  Fujii Hironori  <Hironori.Fujii@sony.com>

        [Win] Retrieve all following WM_CHAR events at the beginning of processing WM_KEYDOWN event
        https://bugs.webkit.org/show_bug.cgi?id=204694

        Reviewed by Ross Kirsling.

        In Windows ports, WM_KEYDOWN dispatches keydown event, and
        WM_CHAR dispatches keypress event. If a keydown event is canceled
        by calling preventDefault, the following corresponding keypress
        events shouldn't be dispatched.

        WebKit1 implemented it by removing WM_CHAR events if the keydown
        event is consumed. However, WebKit2 can't do so because WebKit2
        processes key events asynchronously. Thus, retrieve all following
        WM_CHAR events, and dispatch them after processing the keydown
        and if it is not consumed.

        In addition to that, retrieving following WM_CHAR events is needed
        to fix Bug 204672 because the events are needed for 'key' property
        of keydown KeyboardEvent for dead key combination.

        Gecko and Chromium also implements 'key' property in the same approach.

        Test: Covered by existing fast/events/inputText-never-fired-on-keydown-cancel.html and fast/events/keydown-keypress-preventDefault.html

        * Shared/NativeWebKeyboardEvent.h: Added m_pendingCharEvents as Vector<MSG>.
        (WebKit::NativeWebKeyboardEvent::pendingCharEvents const):
        * Shared/win/NativeWebKeyboardEventWin.cpp:
        (WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::didReceiveEvent):
        * UIProcess/WebPageProxy.h:
        * UIProcess/win/WebPageProxyWin.cpp:
        (WebKit::WebPageProxy::dispatchPendingCharEvents):
        * UIProcess/win/WebView.cpp:
        (WebKit::WebView::onKeyEvent):

2019-11-30  Tim Horton  <timothy_horton@apple.com>

        Make CompositeOperator and BlendMode encodable
        https://bugs.webkit.org/show_bug.cgi?id=204722

        Reviewed by Eric Carlson.

        * UIProcess/cairo/BackingStoreCairo.cpp:
        (WebKit::BackingStore::incorporateUpdate):
        * WebProcess/Plugins/PluginProxy.cpp:
        (WebKit::PluginProxy::paint):
        (WebKit::PluginProxy::update):
        * WebProcess/WebPage/FindController.cpp:
        (WebKit::FindController::drawRect):

2019-11-30  Tim Horton  <timothy_horton@apple.com>

        Reimplement some PlatformCALayer methods using GraphicsContext instead of CGContextRef
        https://bugs.webkit.org/show_bug.cgi?id=204698

        Reviewed by Sam Weinig.

        * Shared/RemoteLayerTree/RemoteLayerBackingStore.h:
        * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
        (WebKit::RemoteLayerBackingStore::drawInContext):
        (WebKit::RemoteLayerBackingStore::enumerateRectsBeingDrawn):
        * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
        (WebKit::PlatformCALayerRemote::enumerateRectsBeingDrawn):
        * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h:

2019-11-27  Antoine Quint  <graouts@apple.com>

        [Web Animations] Enable WebAnimationsCSSIntegrationEnabled by default
        https://bugs.webkit.org/show_bug.cgi?id=204650
        <rdar://problem/45562752>

        Reviewed by Dean Jackson.

        * Shared/WebPreferences.yaml:

2019-11-28  Fujii Hironori  <Hironori.Fujii@sony.com>

        Remove ENABLE_KEYBOARD_CODE_ATTRIBUTE and ENABLE_KEYBOARD_KEY_ATTRIBUTE macros
        https://bugs.webkit.org/show_bug.cgi?id=204666

        No behavior change.

        * Configurations/FeatureDefines.xcconfig:
        * Shared/WebEvent.h:
        (WebKit::WebKeyboardEvent::unmodifiedText const):
        (WebKit::WebKeyboardEvent::key const):
        (WebKit::WebKeyboardEvent::code const):
        * Shared/WebEventConversion.cpp:
        (WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent):
        * Shared/WebKeyboardEvent.cpp:
        (WebKit::WebKeyboardEvent::WebKeyboardEvent):
        (WebKit::WebKeyboardEvent::encode const):
        (WebKit::WebKeyboardEvent::decode):
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::generateSyntheticEditingCommand):

2019-11-27  Philippe Normand  <pnormand@igalia.com>

        [GTK][WebInspector] Use CString to store exported data
        https://bugs.webkit.org/show_bug.cgi?id=204623

        Reviewed by Carlos Garcia Campos.

        * UIProcess/gtk/WebInspectorProxyGtk.cpp:
        (WebKit::WebInspectorProxy::platformSave): Use a CString for copy-on-write assignment.

2019-11-27  Alejandro G. Castro  <alex@igalia.com>

        Unreviewed. Update OptionsWPE.cmake and NEWS for the 2.27.3 release

        * wpe/NEWS: Add release notes for 2.27.3.

2019-11-27  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] WebDriver: moving toplevel windows is not supported under wayland
        https://bugs.webkit.org/show_bug.cgi?id=204614

        Reviewed by Alejandro G. Castro.

        So we can stop trying and simply ignore the requests to move the window.

        * UIProcess/API/glib/WebKitUIClient.cpp:
        (UIClient::windowConfigureEventCallback): Ensure we only move or resize when actually required and reduce the
        time we wait for configure events to 200ms (1 second was too long).

2019-11-26  Antti Koivisto  <antti@apple.com>

        [LFC][Render tree] Add LFC line layout path to RenderBlockFlow
        https://bugs.webkit.org/show_bug.cgi?id=204613

        Reviewed by Zalan Bujtas.

        * Shared/WebPreferences.yaml:
        * WebProcess/InjectedBundle/InjectedBundle.cpp:
        (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):

2019-11-26  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Update OptionsGTK.cmake and NEWS for 2.27.3 release

        * gtk/NEWS: Add release notes for 2.27.3.

2019-11-26  Carlos Garcia Campos  <cgarcia@igalia.com>

        REGRESSION(2.27.2): [GTK] Incognito mode is broken under flatpak
        https://bugs.webkit.org/show_bug.cgi?id=203460

        Reviewed by Youenn Fablet.

        The problem is that in ephemeral sessions the base disk cache directory is null, and Storage::open() ends up
        building a cache path with only the version part (/Version n). For some reason g_mkdir_with_parents() doesn't
        return -1 in flatpak when it fails to create the directory due to write permission, like in this case. But the
        network process ends up crashing later trying to open a directory that doesn't exist.

        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::NetworkSession): Do not create the cache if networkCacheDirectory is null.
        * NetworkProcess/cache/NetworkCacheStorage.cpp:
        (WebKit::NetworkCache::Storage::open): Add an ASSERT to ensure we don't receive a null baseCachePath.

2019-11-25  Yusuke Suzuki  <ysuzuki@apple.com>

        [JSC] InternalFunction should be non-destructible
        https://bugs.webkit.org/show_bug.cgi?id=204556

        Reviewed by Mark Lam.

        * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
        (WebKit::JSNPMethod::subspaceForImpl):

2019-11-25  Wenson Hsieh  <wenson_hsieh@apple.com>

        [macOS] Dragged images are only available as .tiff when dropping onto macCatalyst apps
        https://bugs.webkit.org/show_bug.cgi?id=204598
        <rdar://problem/57093920>

        Reviewed by Tim Horton.

        On macOS, writing dragged images to the pasteboard only as file promises is mostly sufficient for the purposes
        of dropping into Finder, Photos, and other apps. However, when dropping into a macCatalyst app, the contents of
        NSPasteboard will only contain a file URL, which most Catalyst apps aren't able to handle. The only other valid
        image representation that is written to the pasteboard in this case is "public.tiff", which loses fidelity in
        the case of animated GIFs.

        Instead, if the dragged image has a corresponding UTI and corresponding decoded image data, declare the UTI when
        writing promised data to the pasteboard, and later provide data for the UTI, if the drop destination asks, by
        using the promised image's data.

        Test: DragAndDropTests.ProvideImageDataAsTypeIdentifiers

        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::setPromisedDataForImage):
        (WebKit::WebViewImpl::provideDataForPasteboard):

2019-11-25  Fujii Hironori  <Hironori.Fujii@sony.com>

        [Win] Update KeyboardEvent as per the latest specification
        https://bugs.webkit.org/show_bug.cgi?id=202183

        Reviewed by Ross Kirsling.

        * Shared/WebEvent.h:
        * Shared/WebKeyboardEvent.cpp:
        (WebKit::WebKeyboardEvent::WebKeyboardEvent):
        * Shared/win/WebEventFactory.cpp:
        (WebKit::windowsKeyNames):
        (WebKit::WebEventFactory::createWebKeyboardEvent):

2019-11-25  ChangSeok Oh  <changseok@webkit.org>

        [GTK] Check EGL image extension by using native gl API in AcceleratedBackingStoreWayland
        https://bugs.webkit.org/show_bug.cgi?id=204446

        Reviewed by Carlos Garcia Campos.

        This change is part of efforts bringing ANGLE backend for WebGL to the gtk port.
        When ANGLE WebGL is enabled, we face a dilemma of choosing either Extensions3DANGLE
        or Extensions3DOpenGL in AcceleratedBackingStoreWayland.cpp. Since they cannot
        coexist, we chose Extensions3DANGLE even if what we really want is Extensions3DOepnGL.
        We address this problem by directly checking egl image extension availability
        via native GL API rather than relying on Extensions3D* classes in the file.

        * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
        (WebKit::isEGLImageAvailable):
        (WebKit::AcceleratedBackingStoreWayland::checkRequirements):

2019-11-25  Youenn Fablet  <youenn@apple.com>

        Crash in WebCore::ServiceWorkerRegistrationKey::hash() const
        https://bugs.webkit.org/show_bug.cgi?id=204497
        <rdar://problem/57348603>

        Reviewed by Alex Christensen.

        * WebProcess/Storage/WebSWClientConnection.cpp:
        (WebKit::WebSWClientConnection::scheduleJobInServer):
        Add a release assert to be able to further debug the crash.

2019-11-23  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Allow multiple third-party cookie blocking settings
        https://bugs.webkit.org/show_bug.cgi?id=204389
        <rdar://problem/57344054>

        Reviewed by Brent Fulgham.

        This change make the third-party cookie blocking setting go from a boolean to
        the new enum WebCore::ThirdPartyCookieBlockingMode with three different settings.
        Functions and member variables are renamed accordingly.

        The reason for supporting three different modes is that what is now named
        OnlyAccordingToPerDomainPolicy is shipping, AllOnSitesWithoutUserInteraction is
        in beta, and All is behind an experimental flag.

        The change also updates the test API to map the TestRunner call to the enum.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        (WebKit::ResourceLoadStatisticsDatabaseStore::hasStorageAccess):
        (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccess):
        (WebKit::ResourceLoadStatisticsDatabaseStore::clearUserInteraction):
            Now makes use of a completion handler and updates the cookie blocking state.
        (WebKit::ResourceLoadStatisticsDatabaseStore::hasHadUserInteraction):
        (WebKit::ResourceLoadStatisticsDatabaseStore::areAllThirdPartyCookiesBlockedUnder):
            New convenience function to check the cookie blocking status per first-party domain.
        (WebKit::ResourceLoadStatisticsDatabaseStore::cookieAccess):
            Restructured the code to make it very clear that the logic is the same as the
            corresponding function in ResourceLoadStatisticsMemoryStore.
            Can no longer be const since it calls areAllThirdPartyCookiesBlockedUnder() which
            in turn calls hasHadUserInteraction() and that function may clear user interaction data.
        (WebKit::ResourceLoadStatisticsDatabaseStore::hasHadUnexpiredRecentUserInteraction):
        (WebKit::ResourceLoadStatisticsDatabaseStore::cookieAccess const): Deleted.
            See comment above on the non-const version of this function.
        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
        (WebKit::ResourceLoadStatisticsMemoryStore::areAllThirdPartyCookiesBlockedUnder):
            New convenience function to check the cookie blocking status per first-party domain.
        (WebKit::ResourceLoadStatisticsMemoryStore::cookieAccess):
            Restructured the code to make it very clear that the logic is the same as the
            corresponding function in ResourceLoadStatisticsDatabaseStore.
            Can no longer be const since it calls areAllThirdPartyCookiesBlockedUnder() which
            in turn calls hasHadUserInteraction() and that function may clear user interaction data.
        (WebKit::ResourceLoadStatisticsMemoryStore::hasStorageAccess):
        (WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccess):
        (WebKit::ResourceLoadStatisticsMemoryStore::clearUserInteraction):
            Now makes use of a completion handler and updates the cookie blocking state.
        (WebKit::ResourceLoadStatisticsMemoryStore::cookieAccess const): Deleted.
            See comment above on the non-const version of this function.
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
        (WebKit::ResourceLoadStatisticsStore::setThirdPartyCookieBlockingMode):
        (WebKit::ResourceLoadStatisticsStore::thirdPartyCookieBlockingMode const):
        (WebKit::ResourceLoadStatisticsStore::setIsThirdPartyCookieBlockingEnabled): Deleted.
        (WebKit::ResourceLoadStatisticsStore::isThirdPartyCookieBlockingEnabled const): Deleted.
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::setThirdPartyCookieBlockingMode):
        (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction):
            Now forwards the completion handler.
        (WebKit::WebResourceLoadStatisticsStore::setIsThirdPartyCookieBlockingEnabled): Deleted.
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::setShouldBlockThirdPartyCookiesForTesting):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
            The SetShouldBlockThirdPartyCookiesForTesting message now uses an enum instead of a
            boolean.
        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::setResourceLoadStatisticsEnabled):
            Now forwards the enum value instead of a boolean.
        (WebKit::NetworkSession::recreateResourceLoadStatisticStore):
            Now makes sure the cookie blocking setting is forwarded to the recreated store.
        (WebKit::NetworkSession::setThirdPartyCookieBlockingMode):
        (WebKit::NetworkSession::setIsThirdPartyCookieBlockingEnabled): Deleted.
        * NetworkProcess/NetworkSession.h:
        * NetworkProcess/NetworkSessionCreationParameters.cpp:
        (WebKit::NetworkSessionCreationParameters::encode const):
        (WebKit::NetworkSessionCreationParameters::decode):
            Support for the new enum.
        * NetworkProcess/NetworkSessionCreationParameters.h:
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
        * Scripts/webkit/messages.py:
            Tells the IPC code generator where to find WebCore::ThirdPartyCookieBlockingMode.
        * Shared/WebPreferences.yaml:
            Flipped the IsThirdPartyCookieBlockingEnabled flag to on by default.
        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreSetResourceLoadStatisticsShouldBlockThirdPartyCookiesForTesting):
        (WKWebsiteDataStoreStatisticsResetToConsistentState):
        * UIProcess/API/C/WKWebsiteDataStoreRef.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::setShouldBlockThirdPartyCookiesForTesting):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):
            Makes use of the enum in the NetworkSessionCreationParameters.
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::parameters):
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::setResourceLoadStatisticsShouldBlockThirdPartyCookiesForTesting):
        * UIProcess/WebsiteData/WebsiteDataStore.h:

2019-11-23  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r252805.
        https://bugs.webkit.org/show_bug.cgi?id=204553

        Caused test failures and ASan crashes (Requested by ap on
        #webkit).

        Reverted changeset:

        "Cross-thread version StorageQuotaManager"
        https://bugs.webkit.org/show_bug.cgi?id=203971
        https://trac.webkit.org/changeset/252805

2019-11-22  Alex Christensen  <achristensen@webkit.org>

        Unreviewed, rolling out r252796.

        Turns out my reverting earlier today wasn't so necessary after all.
        This is effectively re-landing r250422.

        Reverted changeset:

        "Revert r250422"
        https://bugs.webkit.org/show_bug.cgi?id=202285
        https://trac.webkit.org/changeset/252796

2019-11-22  Alex Christensen  <achristensen@webkit.org>

        Unreviewed, rolling out r252798.

        Turns out my reverting earlier today wasn't so necessary after all.
        This is effectively re-landing r250421.

        Reverted changeset:

        "Revert r250421"
        https://bugs.webkit.org/show_bug.cgi?id=202290
        https://trac.webkit.org/changeset/252798

2019-11-22  Kate Cheney  <katherine_cheney@apple.com>

        ITP Database crashes if table schema is not correct
        https://bugs.webkit.org/show_bug.cgi?id=204458
        <rdar://problem/57399084>
        
        Reviewed by Brent Fulgham.

        ITP database was crashing if the table schema wasn't correct. This
        should instead be handled by re-opening a new database with a correct
        schema to allow for future schema updates.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        (WebKit::ResourceLoadStatisticsDatabaseStore::isCorrectTableSchema):
        (WebKit::ResourceLoadStatisticsDatabaseStore::openAndDropOldDatabaseIfNecessary):
        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:

2019-11-22  Chris Dumez  <cdumez@apple.com>

        Simplify VisitedLinkStore process registration logic
        https://bugs.webkit.org/show_bug.cgi?id=204472

        Reviewed by Geoffrey Garen.

        Simplify VisitedLinkStore process registration logic:
        1. WebProcessProxy objects no longer delay their registration with the VisitedLinkStore until
           after they are done launching. There is no need to do this because AuxiliaxyProcessProxy::send()
           will correctly queue the IPC message if the process is not done launching when the VisitedLinkStore
           tries to send its IPC.
        2. Switch VisitedLinkStore to using a WeakHashSet to store the WebProcessProxy object pointers. This
           is safer and this also makes it so that the WebProcessProxy no longer need to unregister themselves
           when shutting down. Note that AuxiliaxyProcessProxy::send() properly discards IPC messages to
           a terminated process anyway.

        * UIProcess/VisitedLinkStore.cpp:
        (WebKit::VisitedLinkStore::~VisitedLinkStore):
        (WebKit::VisitedLinkStore::addProcess):
        (WebKit::VisitedLinkStore::removeProcess):
        (WebKit::VisitedLinkStore::removeAll):
        (WebKit::VisitedLinkStore::didInvalidateSharedMemory):
        (WebKit::VisitedLinkStore::didUpdateSharedStringHashes):
        * UIProcess/VisitedLinkStore.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::shutDown):
        (WebKit::WebProcessProxy::addVisitedLinkStoreUser):
        (WebKit::WebProcessProxy::didFinishLaunching):

2019-11-22  Chris Dumez  <cdumez@apple.com>

        [iOS] Copy assertions before iterating over them in _notifyAssertionsOfImminentSuspension
        https://bugs.webkit.org/show_bug.cgi?id=204524
        <rdar://problem/57265830>

        Reviewed by Alexey Proskuryakov.

        Copy assertions before iterating over them in _notifyAssertionsOfImminentSuspension and use WeakPtr
        to make sure the assertions are still alive before calling uiAssertionWillExpireImminently() on
        them. It is common for process assertions to get released when uiAssertionWillExpireImminently()
        gets called, which would remove them from the _assertionsNeedingBackgroundTask vector we were
        iterating on.

        * UIProcess/ios/ProcessAssertionIOS.mm:
        (-[WKProcessAssertionBackgroundTaskManager _notifyAssertionsOfImminentSuspension]):

2019-11-22  Alex Christensen  <achristensen@webkit.org>

        Null check callback in NetworkConnectionToWebProcess::didDeliverMessagePortMessages
        https://bugs.webkit.org/show_bug.cgi?id=204460
        <rdar://problem/57348618>

        Reviewed by Chris Dumez.

        When the network process crashes during a message port connection establishment,
        a web process may have an identifier that becomes stale.  In this case, we should not crash again.
        No test because this only happens during a rare race condition after a network process crash, but the radar shows records of this happening.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::didDeliverMessagePortMessages):

2019-11-22  Sihui Liu  <sihui_liu@apple.com>

        Cross-thread version StorageQuotaManager
        https://bugs.webkit.org/show_bug.cgi?id=203971
        <rdar://problem/57290349>

        Reviewed by Chris Dumez.

        * NetworkProcess/NetworkProcess.cpp: Introduce class SessionStorageQuotaManager to manage all 
        StorageQuotaManagers of the same session. 
        (WebKit::NetworkProcess::initializeNetworkProcess):
        (WebKit::NetworkProcess::addWebsiteDataStore):
        (WebKit::NetworkProcess::addSessionStorageQuotaManager):
        (WebKit::NetworkProcess::removeSessionStorageQuotaManager):
        (WebKit::NetworkProcess::destroySession):
        (WebKit::NetworkProcess::deleteWebsiteData):
        (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
        (WebKit::NetworkProcess::createIDBServer):
        (WebKit::NetworkProcess::addIndexedDatabaseSession):
        (WebKit::NetworkProcess::setSessionStorageQuotaManagerIDBRootPath):
        (WebKit::NetworkProcess::updateQuotaBasedOnSpaceUsageForTesting):
        (WebKit::NetworkProcess::resetQuota):
        (WebKit::NetworkProcess::storageQuotaManager):
        (WebKit::NetworkProcess::initializeStorageQuota): Deleted.
        (WebKit::NetworkProcess::clearStorageQuota): Deleted.
        (): Deleted.
        (WebKit::NetworkProcess::initializeQuotaUsers): Deleted.
        * NetworkProcess/NetworkProcess.h:
        (WebKit::NetworkProcess::SessionStorageQuotaManager::SessionStorageQuotaManager):
        (WebKit::NetworkProcess::SessionStorageQuotaManager::defaultQuota const):
        (WebKit::NetworkProcess::SessionStorageQuotaManager::ensureOriginStorageQuotaManager):
        (WebKit::NetworkProcess::SessionStorageQuotaManager::existingStorageQuotaManagers):
        (WebKit::NetworkProcess::SessionStorageQuotaManager::cacheRootPath const):
        (WebKit::NetworkProcess::SessionStorageQuotaManager::setIDBRootPath):
        (WebKit::NetworkProcess::SessionStorageQuotaManager::idbRootPath const):
        (WebKit::NetworkProcess::StorageQuotaManagers::defaultQuota const): Deleted.
        (WebKit::NetworkProcess::StorageQuotaManagers::setDefaultQuotas): Deleted.
        (WebKit::NetworkProcess::StorageQuotaManagers::managersPerOrigin): Deleted.
        * NetworkProcess/NetworkProcess.messages.in:
        * NetworkProcess/cache/CacheStorageEngine.cpp:
        (WebKit::CacheStorage::getDirectorySize):
        (WebKit::CacheStorage::Engine::diskUsage): static function to get the disk usage of CacheStorage given 
        CacheStorage root directory.
        (WebKit::CacheStorage::Engine::requestSpace):
        (WebKit::CacheStorage::Engine::readCachesFromDisk):
        (WebKit::CacheStorage::Engine::writeSizeFile):
        (WebKit::CacheStorage::Engine::readSizeFile):
        (WebKit::CacheStorage::Engine::initializeQuotaUser): Deleted.
        * NetworkProcess/cache/CacheStorageEngine.h:
        * NetworkProcess/cache/CacheStorageEngineCache.cpp:
        (WebKit::CacheStorage::Cache::put):
        (WebKit::CacheStorage::Cache::remove):
        * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
        (WebKit::CacheStorage::Caches::create):
        (WebKit::CacheStorage::Caches::Caches):
        (WebKit::CacheStorage::Caches::~Caches):
        (WebKit::CacheStorage::Caches::updateSizeFile):
        (WebKit::CacheStorage::Caches::initializeSize):
        (WebKit::CacheStorage::Caches::clear):
        (WebKit::CacheStorage::Caches::requestSpace):
        (WebKit::CacheStorage::Caches::writeRecord):
        (WebKit::CacheStorage::Caches::removeRecord):
        (WebKit::CacheStorage::Caches::whenInitialized): Deleted.
        (WebKit::CacheStorage::Caches::resetSpaceUsed): Deleted.
        * NetworkProcess/cache/CacheStorageEngineCaches.h:
        * Shared/WebsiteDataStoreParameters.cpp:
        (WebKit::WebsiteDataStoreParameters::encode const):
        (WebKit::WebsiteDataStoreParameters::decode):
        * Shared/WebsiteDataStoreParameters.h: Add a cacheStorageDirectory parameter so we know the direcotry of 
        CacheStorage when we start using WebsiteDataStore.
        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreResetQuota):
        * UIProcess/API/C/WKWebsiteDataStoreRef.h: Add a C API for reseting quota in TestRunner.
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::resetQuota):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::parameters):
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::parameters):
        (WebKit::WebsiteDataStore::resetQuota):
        * UIProcess/WebsiteData/WebsiteDataStore.h:

2019-11-22  Alex Christensen  <achristensen@webkit.org>

        Revert r250421
        https://bugs.webkit.org/show_bug.cgi?id=202290

        This is needed for rdar://problem/56760896
        I left the soup parts of the original change untouched, which leaves speculative validation on for soup ports.

        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
        (WebKit::NetworkProcessCreationParameters::decode):
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
        * UIProcess/API/APIProcessPoolConfiguration.cpp:
        (API::ProcessPoolConfiguration::copy):
        * UIProcess/API/APIProcessPoolConfiguration.h:
        * UIProcess/API/C/WKContext.cpp:
        (WKContextSetDiskCacheSpeculativeValidationEnabled):
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
        (-[_WKProcessPoolConfiguration diskCacheSpeculativeValidationEnabled]):
        (-[_WKProcessPoolConfiguration setDiskCacheSpeculativeValidationEnabled:]):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):

2019-11-22  Alex Christensen  <achristensen@webkit.org>

        Revert r250422
        https://bugs.webkit.org/show_bug.cgi?id=202285

        This is needed for rdar://problem/56760896

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::initializeNetworkProcess):
        (WebKit::NetworkProcess::setCanHandleHTTPSServerTrustEvaluation):
        * NetworkProcess/NetworkProcess.h:
        (WebKit::NetworkProcess::canHandleHTTPSServerTrustEvaluation const):
        * NetworkProcess/NetworkProcess.messages.in:
        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
        (WebKit::NetworkProcessCreationParameters::decode):
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
        * UIProcess/API/C/WKContext.cpp:
        (WKContextSetCanHandleHTTPSServerTrustEvaluation):
        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _setCanHandleHTTPSServerTrustEvaluation:]):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):
        (WebKit::WebProcessPool::setCanHandleHTTPSServerTrustEvaluation):
        * UIProcess/WebProcessPool.h:

2019-11-22  Conrad Shultz  <conrad_shultz@apple.com>

        Remove -[_WKThumbnailView usesSnapshot/setUsesSnapshot:]
        https://bugs.webkit.org/show_bug.cgi?id=150099

        Reviewed by Tim Horton.

        Remove some unused, no-op SPI. While we're here, remove a couple unneeded explicit
        property syntheses.

        * UIProcess/API/Cocoa/_WKThumbnailView.h:
        * UIProcess/API/Cocoa/_WKThumbnailView.mm:
        (-[_WKThumbnailView setUsesSnapshot:]): Deleted.
        (-[_WKThumbnailView usesSnapshot]): Deleted.

2019-11-22  Chris Dumez  <cdumez@apple.com>

        Speculative loading sometimes happens too early and is missing login cookies
        https://bugs.webkit.org/show_bug.cgi?id=204305
        <rdar://problem/57063840>

        Reviewed by Antti Koivisto.

        Speculative loads were issued before receiving the response from the main resource. However,
        the main resource may set important cookies that are thus missing from the speculative requests.

        To address the issue we now delay speculative loads for first-party subresources until we've
        received the response from the main resource. To avoid regressing PLT, we still warm up the
        first-party subresources from disk right away and preconnect to the server.

        No new tests, extended existing test.

        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::didReceiveResponse):
        (WebKit::NetworkResourceLoader::didReceiveMainResourceResponse):
        (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
        * NetworkProcess/NetworkResourceLoader.h:
        * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
        (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::didReceiveMainResourceResponse const):
        (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::markMainResourceResponseAsReceived):
        (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::addPostMainResourceResponseTask):
        (WebKit::NetworkCache::SpeculativeLoadManager::shouldRegisterLoad):
        (WebKit::NetworkCache::SpeculativeLoadManager::registerLoad):
        (WebKit::NetworkCache::SpeculativeLoadManager::registerMainResourceLoadResponse):
        (WebKit::NetworkCache::SpeculativeLoadManager::preconnectForSubresource):
        (WebKit::NetworkCache::SpeculativeLoadManager::revalidateSubresource):
        * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:
        * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
        (WebKit::NetworkCache::SubresourceInfo::isFirstParty const):
        * NetworkProcess/cache/NetworkCacheSubresourcesEntry.h:

2019-11-22  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] RemoteInspector: use sockets instead of DBus
        https://bugs.webkit.org/show_bug.cgi?id=204503

        Reviewed by Žan Doberšek.

        Use GSockets API instead of DBus.

        * Platform/IPC/Connection.h:
        * SourcesGTK.txt: Remove GSocketMonitor that has been moved to WTF.
        * SourcesWPE.txt: Ditto.
        * UIProcess/glib/RemoteInspectorClient.cpp:
        (WebKit::RemoteInspectorClient::RemoteInspectorClient):
        (WebKit::RemoteInspectorClient::~RemoteInspectorClient):
        (WebKit::RemoteInspectorClient::setupConnection):
        (WebKit::RemoteInspectorClient::connectionDidClose):
        (WebKit::RemoteInspectorClient::inspect):
        (WebKit::RemoteInspectorClient::sendMessageToBackend):
        (WebKit::RemoteInspectorClient::closeFromFrontend):
        * UIProcess/glib/RemoteInspectorClient.h:

2019-11-21  Jer Noble  <jer.noble@apple.com>

        Experimental support for HDR media query
        https://bugs.webkit.org/show_bug.cgi?id=204422

        Reviewed by Eric Carlson.

        Notify the WebContent process of updated screen properties when the screen's
        color space changes.

        * UIProcess/Cocoa/WebViewImpl.h:
        * UIProcess/Cocoa/WebViewImpl.mm:
        (-[WKWindowVisibilityObserver startObserving:]):
        (-[WKWindowVisibilityObserver stopObserving:]):
        (-[WKWindowVisibilityObserver _screenDidChangeColorSpace:]):
        (WebKit::WebViewImpl::screenDidChangeColorSpace):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::screenPropertiesDidChange):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::setScreenProperties):

2019-11-21  Brian Burg  <bburg@apple.com>

        Unreviewed, sort WebKit's project file after changes in r252702 and r252637.

        * WebKit.xcodeproj/project.pbxproj:

2019-11-21  Sihui Liu  <sihui_liu@apple.com>

        Crash in com.apple.WebKit.WebContent at WebKit: WebKit::StorageAreaMap::loadValuesIfNeeded
        https://bugs.webkit.org/show_bug.cgi?id=204459
        <rdar://problem/57383446>

        Reviewed by Geoffrey Garen.

        If m_storageMapID can be null if connect() fails.

        * WebProcess/WebStorage/StorageAreaMap.cpp:
        (WebKit::StorageAreaMap::setItem):
        (WebKit::StorageAreaMap::removeItem):
        (WebKit::StorageAreaMap::clear):
        (WebKit::StorageAreaMap::loadValuesIfNeeded):

2019-11-21  Peng Liu  <peng.liu6@apple.com>

        Ignore the requests to enter/exit video fullscreen/picture-in-picture if the requesting mode is the same as the current mode
        https://bugs.webkit.org/show_bug.cgi?id=204461

        Reviewed by Jer Noble.

        In enterVideoFullscreenForVideoElement() and exitVideoFullscreenForVideoElement(),
        we can ignore the request if the targeting mode is the same as the current one.

        * WebProcess/cocoa/VideoFullscreenManager.mm:
        (WebKit::VideoFullscreenManager::enterVideoFullscreenForVideoElement):
        (WebKit::VideoFullscreenManager::exitVideoFullscreenForVideoElement):

2019-11-20  ChangSeok Oh  <changseok@webkit.org>

        [GTK] Add ANGLE backend to GTK port
        https://bugs.webkit.org/show_bug.cgi?id=199060

        Reviewed by Žan Doberšek.

        * UIProcess/API/glib/WebKitProtocolHandler.cpp: Extention3DANGLE is used instead
          where ANGLE for WebGL is enabled.
        * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp: Append gl extensions for ANGLE.
        (WebKit::AcceleratedBackingStoreWayland::checkRequirements):

2019-11-20  Chris Dumez  <cdumez@apple.com>

        [iOS] Make sure WebContent process does not get suspended while it is holding a process assertion for the UIProcess
        https://bugs.webkit.org/show_bug.cgi?id=204418

        Reviewed by Jer Noble.

        Make sure WebContent process does not get suspended while it is holding a process assertion for the UIProcess. We
        see this happening in sysdiagnoses, and it means the system ends up killing the WebContent process because it leaked
        a process assertion.

        * WebProcess/WebProcess.h:
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::processTaskStateDidChange):
        (WebKit::WebProcess::releaseProcessWasResumedAssertions):

2019-11-19  Brian Burg  <bburg@apple.com>

        [Cocoa] Add _WKRemoteWebInspectorViewController SPI to set diagnostic logging delegate
        https://bugs.webkit.org/show_bug.cgi?id=204371

        Reviewed by Devin Rousso.

        * UIProcess/WebInspectorProxy.h:
        * UIProcess/RemoteWebInspectorProxy.h:
        * UIProcess/RemoteWebInspectorProxy.cpp:
        (WebKit::RemoteWebInspectorProxy::setDiagnosticLoggingAvailable):
        Hook up the plumbing to forward this state change to the frontend.

        * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewControllerPrivate.h: Added.
        * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm:
        (-[_WKRemoteWebInspectorViewController _setDiagnosticLoggingDelegate:]):
        Add new SPI to set the diagnostic logging delegate. This is preferable to directly
        setting the delegate on the inspector WKWebView (via .webView._diagnosticLoggingDelegate),
        because the controller can notify the frontend that diagnostic logging is now available.

        * WebKit.xcodeproj/project.pbxproj: Add new header file and make it private.

        * WebProcess/WebPage/WebInspectorUI.h:
        * WebProcess/WebPage/WebInspectorUI.cpp:
        (WebKit::WebInspectorUI::setDiagnosticLoggingAvailable):
        Cache this value and use it for InspectorFrontendClient::diagnosticLoggingAvailable().

        * WebProcess/WebPage/RemoteWebInspectorUI.messages.in:
        * WebProcess/WebPage/RemoteWebInspectorUI.h:
        * WebProcess/WebPage/RemoteWebInspectorUI.cpp:
        (WebKit::RemoteWebInspectorUI::setDiagnosticLoggingAvailable):
        Duplicate what is done for the local case.

2019-11-20  Jer Noble  <jer.noble@apple.com>

        HTML5 audio .ended event not fired when app in background or phone screen is off
        https://bugs.webkit.org/show_bug.cgi?id=173332
        <rdar://problem/32757402>

        Reviewed by Eric Carlson.

        When a WebPage goes from audible to inaudible, allow a short grace period before removing
        the activity token, to give the page a chance to (e.g.) move to the next item in a playlist
        before the process is suspended when in the background.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::close):
        (WebKit::WebPageProxy::updateThrottleState):
        (WebKit::WebPageProxy::clearAudibleActivity):
        * UIProcess/WebPageProxy.h:

2019-11-19  Chris Dumez  <cdumez@apple.com>

        Unreviewed, fix webkitpy failures after r252655.

        * Scripts/webkit/LegacyMessageReceiver-expected.cpp:
        (WebKit::WebPage::didReceiveWebPageMessage):
        (WebKit::WebPage::didReceiveSyncWebPageMessage):
        * Scripts/webkit/MessageReceiver-expected.cpp:
        (WebKit::WebPage::didReceiveMessage):
        (WebKit::WebPage::didReceiveSyncMessage):
        * Scripts/webkit/MessageReceiverSuperclass-expected.cpp:
        (WebKit::WebPage::didReceiveMessage):
        (WebKit::WebPage::didReceiveSyncMessage):

2019-11-19  Chris Dumez  <cdumez@apple.com>

        Unreviewed mac catalyst build fix after r252655.

        * WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.messages.in:

2019-11-19  Ross Kirsling  <ross.kirsling@sony.com>

        Unreviewed non-unified build fixes.

        * WebProcess/WebPage/FindController.cpp:
        * WebProcess/WebPage/FindController.h:

2019-11-19  Chris Dumez  <cdumez@apple.com>

        Protect MessageReceivers when possible while they are processing incoming IPC messages
        https://bugs.webkit.org/show_bug.cgi?id=204377

        Reviewed by Brady Eidson.

        Protect MessageReceiver while they are processing incoming IPC messages for
        extra safety. It is a common mistake to call client delegates as a result of an IPC, and
        failing to protect |this| while doing so. Client code can destroy |this| and we end up
        crashing.

        For MessageReceivers that are not RefCounted, they can use the "NotRefCounted" attribute
        in their messages.in file to opt out.

        * NetworkProcess/Cookies/WebCookieManager.messages.in:
        * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.messages.in:
        * NetworkProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
        * NetworkProcess/NetworkContentRuleListManager.messages.in:
        * NetworkProcess/NetworkSocketChannel.messages.in:
        * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.messages.in:
        * NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in:
        * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
        * NetworkProcess/webrtc/NetworkMDNSRegister.messages.in:
        * NetworkProcess/webrtc/NetworkRTCMonitor.messages.in:
        * NetworkProcess/webrtc/NetworkRTCSocket.messages.in:
        * PluginProcess/PluginControllerProxy.messages.in:
        * PluginProcess/PluginProcess.messages.in:
        * Scripts/webkit/messages.py:
        * Shared/API/Cocoa/RemoteObjectRegistry.messages.in:
        * Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in:
        * Shared/Authentication/AuthenticationManager.messages.in:
        * Shared/AuxiliaryProcess.messages.in:
        * Shared/Plugins/NPObjectMessageReceiver.messages.in:
        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
        * UIProcess/DrawingAreaProxy.messages.in:
        * UIProcess/Network/CustomProtocols/LegacyCustomProtocolManagerProxy.messages.in:
        * UIProcess/Network/NetworkProcessProxy.messages.in:
        * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.messages.in:
        * UIProcess/ViewGestureController.messages.in:
        * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.messages.in:
        * UIProcess/WebFullScreenManagerProxy.messages.in:
        * UIProcess/WebPasteboardProxy.messages.in:
        * UIProcess/ios/SmartMagnificationController.messages.in:
        * WebProcess/ApplePay/WebPaymentCoordinator.messages.in:
        * WebProcess/Automation/WebAutomationSessionProxy.messages.in:
        * WebProcess/Geolocation/WebGeolocationManager.messages.in:
        * WebProcess/Network/webrtc/WebMDNSRegister.messages.in:
        * WebProcess/Network/webrtc/WebRTCMonitor.messages.in:
        * WebProcess/Network/webrtc/WebRTCResolver.messages.in:
        * WebProcess/Network/webrtc/WebRTCSocket.messages.in:
        * WebProcess/Notifications/WebNotificationManager.messages.in:
        * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
        * WebProcess/WebPage/DrawingArea.messages.in:
        * WebProcess/WebPage/ViewGestureGeometryCollector.messages.in:
        * WebProcess/WebProcess.messages.in:
        * WebProcess/cocoa/UserMediaCaptureManager.messages.in:

2019-11-19  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Fix sysctl-read sandbox violation
        https://bugs.webkit.org/show_bug.cgi?id=204358
        <rdar://problem/57298313>

        Reviewed by Brent Fulgham.

        The WebContent sandbox should allow sysctl-read of "kern.hostname", "kern.osrelease", and "kern.version".

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

2019-11-19  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Count third-party script loads under top frame
        https://bugs.webkit.org/show_bug.cgi?id=204262
        <rdar://problem/57244945>

        Reviewed by Alex Christensen.

        Third-party scripts running in the first-party context are a significant privacy
        and security risk. This change captures the number of such script loads which will
        allow ITP to take action.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        (WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore):
        (WebKit::ResourceLoadStatisticsDatabaseStore::createUniqueIndices):
        (WebKit::ResourceLoadStatisticsDatabaseStore::createSchema):
        (WebKit::ResourceLoadStatisticsDatabaseStore::prepareStatements):
        (WebKit::ResourceLoadStatisticsDatabaseStore::insertDomainRelationships):
        (WebKit::ResourceLoadStatisticsDatabaseStore::getSubStatisticStatement):
            Addition of the new category TopFrameLoadedThirdPartyScripts.
        (WebKit::ResourceLoadStatisticsDatabaseStore::resourceToString):
            Removed the lastSeen output since it may differ between test runs.
        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
            Bumped statisticsModelVersion to 17.
        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
        (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
            Encoding and decoding of the new category topFrameLoadedThirdPartyScripts.
        * WebProcess/WebCoreSupport/WebResourceLoadObserver.cpp:
        (WebKit::WebResourceLoadObserver::logSubresourceLoading):
            Now takes an additional enum parameter FetchDestinationIsScriptLike which
            is used to detect third-party script-like loads (script, worker, or
            service worker) from third-parties. If one is detected, it is stored
            in the new topFrameLoadedThirdPartyScripts category.
        * WebProcess/WebCoreSupport/WebResourceLoadObserver.h:

2019-11-19  Brian Burg  <bburg@apple.com>

        [Cocoa] Add _WKInspector SPI to set diagnostic logging delegate for a local Web Inspector
        https://bugs.webkit.org/show_bug.cgi?id=204323

        Reviewed by Devin Rousso.

        Testing this end-to-end isn't quite possible yet because WebInspectorUI does not
        yet send any dummy diagnostic events that we can use for testing purposes.

        * WebKit.xcodeproj/project.pbxproj:

        * UIProcess/API/Cocoa/_WKInspectorInternal.h: Fix include.
        * UIProcess/API/Cocoa/_WKInspectorPrivate.h: Added.
        * UIProcess/API/Cocoa/_WKInspector.mm: Fix include.
        (-[_WKInspector _setDiagnosticLoggingDelegate:]):
        Allow clients to set the diagnosticLoggingDelegate directly on _WKInspector.
        The implementation forwards this setter to the Inspector's WKWebView and notifies
        the frontend that diagnostic logging availability did change.

        * UIProcess/WebInspectorProxy.h:
        * UIProcess/WebInspectorProxy.cpp:
        (WebKit::WebInspectorProxy::setDiagnosticLoggingAvailable):
        Plumbing.

        * WebProcess/WebPage/WebInspectorUI.cpp:
        (WebKit::WebInspectorUI::setDiagnosticLoggingAvailable):
        * WebProcess/WebPage/WebInspectorUI.h:
        * WebProcess/WebPage/WebInspectorUI.messages.in:
        More plumbing.

2019-11-19  Chris Dumez  <cdumez@apple.com>

        Make sendWithAsyncReply() safe to call from any thread
        https://bugs.webkit.org/show_bug.cgi?id=204355

        Reviewed by Alex Christensen.

        Make sendWithAsyncReply() safe to call from any thread, similarly to the regular send().
        Also start using it in WebProcess::processTaskStateDidChange() now that it is safe.

        * Platform/IPC/Connection.cpp:
        (IPC::asyncReplyHandlerMapLock):
        (IPC::asyncReplyHandlerMap):
        (IPC::nextAsyncReplyHandlerID):
        (IPC::addAsyncReplyHandler):
        (IPC::clearAsyncReplyHandlers):
        (IPC::CompletionHandler<void):
        * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
        (WebKit::WebProcessProxy::processWasResumed):
        * UIProcess/WebProcessProxy.h:
        (WebKit::WebProcessProxy::hasServiceWorkerPageProxy): Deleted.
        (WebKit::WebProcessProxy::setAssertionStateForTesting): Deleted.
        (WebKit::WebProcessProxy::WeakOrStrongPtr::WeakOrStrongPtr): Deleted.
        (WebKit::WebProcessProxy::WeakOrStrongPtr::setIsWeak): Deleted.
        (WebKit::WebProcessProxy::WeakOrStrongPtr::get const): Deleted.
        (WebKit::WebProcessProxy::WeakOrStrongPtr::operator-> const): Deleted.
        (WebKit::WebProcessProxy::WeakOrStrongPtr::operator* const): Deleted.
        (WebKit::WebProcessProxy::WeakOrStrongPtr::operator bool const): Deleted.
        (WebKit::WebProcessProxy::WeakOrStrongPtr::updateStrongReference): Deleted.
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::processTaskStateDidChange):
        (WebKit::WebProcess::parentProcessDidHandleProcessWasResumed): Deleted.

2019-11-19  Megan Gardner  <megan_gardner@apple.com>

        <rdar://problem/57323799>

        Unreviwed build fix for older bots.

        * Platform/spi/ios/UIKitSPI.h:

2019-11-19  Brian Burg  <bburg@apple.com>

        [Cocoa] Add WKUIDelegate SPI to inform clients when a _WKInspector attaches to a WKWebView
        https://bugs.webkit.org/show_bug.cgi?id=204300
        <rdar://problem/57136993>

        Reviewed by Devin Rousso.

        Add a new UI delegate method to notify clients when local Web Inspector is about to be loaded.
        This can be triggered by -[_WKInspector show] in the Cocoa API, or via the WebCore-controlled 
        Inspect context menu item.

        The client can then configure Web Inspector using delegates or by setting _WKInspector properties.

        Covered by new API test WebKit.DidNotifyWhenInspectorAttached.

        * UIProcess/API/APIUIClient.h:
        (API::UIClient::didAttachInspector):
        * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
        * UIProcess/Cocoa/UIDelegate.h:
        * UIProcess/Cocoa/UIDelegate.mm:
        (WebKit::UIDelegate::setDelegate):
        (WebKit::UIDelegate::UIClient::didAttachInspector):
        * UIProcess/WebInspectorProxy.cpp:
        (WebKit::WebInspectorProxy::openLocalInspectorFrontend):

2019-11-18  John Wilander  <wilander@apple.com>

        Check if ITP is on before applying third-party cookie blocking
        https://bugs.webkit.org/show_bug.cgi?id=204322
        <rdar://problem/57120772>

        Reviewed by Chris Dumez and Alexey Proskuryakov.

        This change makes sure WebCore::NetworkStorageSession knows
        whether ITP is on or off and checks that first thing in
        WebCore::NetworkStorageSession::shouldBlockCookies().

        This check was never needed before since if ITP was off,
        there would be no classified domains and thus the function
        would always return false. However,
        https://trac.webkit.org/changeset/251353/webkit introduced
        full third-party cookie blocking for websites without user
        interaction and that rule is checked before checking domain
        classification. The effect was unconditional third-party
        cookie blocking if ITP is off. This changes fixes that bug.

        Note that this patch already landed as branch-specific in
        https://trac.webkit.org/changeset/252549/webkit

        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::setResourceLoadStatisticsEnabled):
            Now tells WebCore::NetworkStorageSession the status of
            ITP.

2019-11-18  David Kilzer  <ddkilzer@apple.com>

        IPC::Decoder should use nullptr as invalid value
        <https://webkit.org/b/203880>
        <rdar://problem/53159906>

        Reviewed by Brent Fulgham.

        Covered by existing tests.

        * Platform/IPC/Decoder.cpp:
        (IPC::alignedBufferIsLargeEnoughToContain): Add bufferStart
        parameter to add beginning bounds check now that m_bufferPos
        uses nullptr for an invalid value.
        (IPC::Decoder::alignBufferPosition): Update to pass m_buffer to
        IPC::alignedBufferIsLargeEnoughToContain().
        (IPC::Decoder::bufferIsLargeEnoughToContain const): Ditto.
        * Platform/IPC/Decoder.h:
        (IPC::Decoder::isInvalid const): Add beginning bounds check now
        that m_bufferPos uses nullptr for an invalid value.
        (IPC::Decoder::markInvalid): Make nullptr the invalid value for
        m_bufferPos.

2019-11-18  Andres Gonzalez  <andresg_22@apple.com>

        Run AccessibilityController::rootElement on secondary thread to simulate HIServices during LayoutTests.
        https://bugs.webkit.org/show_bug.cgi?id=204226

        Reviewed by Chris Fleizach.

        Added WKAccessibilityCanUseSecondaryAXThread to support
        WTR::AccessibilityController spawning of a secondary thread to simulate
        execution of isolated tree code.

        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
        (WKAccessibilityCanUseSecondaryAXThread):
        * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:

2019-11-18  Chris Dumez  <cdumez@apple.com>

        Promote main thread assertions related to sendWithAsyncReply() to be release assertions
        https://bugs.webkit.org/show_bug.cgi?id=204298

        Reviewed by Wenson Hsieh.

        Promote main thread assertions related to sendWithAsyncReply() to be release assertions, to help identify
        threading bugs such as <rdar://problem/57231170>.

        * Platform/IPC/Connection.cpp:
        (IPC::addAsyncReplyHandler):
        (IPC::clearAsyncReplyHandlers):
        (IPC::CompletionHandler<void):

2019-11-18  Alex Christensen  <achristensen@webkit.org>

        Fix assertion in layout test after r252492.
        https://bugs.webkit.org/show_bug.cgi?id=204199

        There is still a case in a test where there is no frame identifier, so keep the status quo.
        This is a partial revert of r252492.
        This fixes layout test http/tests/navigation/window-open-redirect-and-remove-opener.html

        * Shared/FrameInfoData.cpp:
        (WebKit::FrameInfoData::decode):
        * Shared/FrameInfoData.h:
        * UIProcess/API/APIFrameInfo.cpp:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
        (WebKit::WebPageProxy::createNewPage):

2019-11-18  Alex Christensen  <achristensen@webkit.org>

        Use SecTrustEvaluateWithError instead of SecTrustEvaluate where available
        https://bugs.webkit.org/show_bug.cgi?id=204159

        Reviewed by Darin Adler.

        * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
        (-[WKFullScreenWindowController _EVOrganizationName]):

2019-11-18  Darin Adler  <darin@apple.com>

        WKWebView.mediaType is nullable, not null_resettable
        https://bugs.webkit.org/show_bug.cgi?id=204297

        Reviewed by Anders Carlsson.

        * UIProcess/API/Cocoa/WKWebView.h: Use nullable for mediaType since this
        property returns a null value when the media type is not being overridden.

2019-11-18  Carlos Garcia Campos  <cgarcia@igalia.com>

        Automation: scrollIntoView should do nothing if element is visible
        https://bugs.webkit.org/show_bug.cgi?id=204194

        Reviewed by Carlos Alberto Lopez Perez.

        "To scroll into view an element perform the following steps only if the element is not already in view"
        https://w3c.github.io/webdriver/#dfn-scrolls-into-view

        Fixes: imported/w3c/webdriver/tests/element_click/scroll_into_view.py::test_partially_visible_does_not_scroll[9]
               imported/w3c/webdriver/tests/element_click/scroll_into_view.py::test_partially_visible_does_not_scroll[8]
               imported/w3c/webdriver/tests/element_click/scroll_into_view.py::test_partially_visible_does_not_scroll[7]
               imported/w3c/webdriver/tests/element_click/scroll_into_view.py::test_partially_visible_does_not_scroll[6]
               imported/w3c/webdriver/tests/element_click/scroll_into_view.py::test_partially_visible_does_not_scroll[5]
               imported/w3c/webdriver/tests/element_click/scroll_into_view.py::test_partially_visible_does_not_scroll[4]
               imported/w3c/webdriver/tests/element_click/scroll_into_view.py::test_partially_visible_does_not_scroll[3]
               imported/w3c/webdriver/tests/element_click/scroll_into_view.py::test_partially_visible_does_not_scroll[2]
               imported/w3c/webdriver/tests/element_click/scroll_into_view.py::test_partially_visible_does_not_scroll[1]

        * WebProcess/Automation/WebAutomationSessionProxy.cpp:
        (WebKit::WebAutomationSessionProxy::computeElementLayout): Use scrollIntoViewIfNotVisible instead of
        scrollIntoViewIfNeeded.

2019-11-17  Alexey Proskuryakov  <ap@apple.com>

        Better build fix attempt after r252434. 

        We do need this variant, it was a mistake to claim that it's "old".

        * Platform/spi/ios/UIKitSPI.h:
        * UIProcess/ios/WKGeolocationProviderIOSObjCSecurityOrigin.mm:
        (WebKit::decidePolicyForGeolocationRequestFromOrigin):

2019-11-17  Alexey Proskuryakov  <ap@apple.com>

        Build fix attempt after r252434.

        This variant of decidePolicyForGeolocationRequestFromOrigin doesn't exist in UIKit.
        Removing dead code, but someone needs to take a look at what the original intent here was.

        * Platform/spi/ios/UIKitSPI.h:
        * UIProcess/ios/WKGeolocationProviderIOSObjCSecurityOrigin.mm:
        (WebKit::decidePolicyForGeolocationRequestFromOrigin):

2019-11-16  Wenson Hsieh  <wenson_hsieh@apple.com>

        REGRESSION (r243606): Interacting with date and time pickers hangs the UI process on watchOS
        https://bugs.webkit.org/show_bug.cgi?id=204280
        <rdar://problem/49718359>

        Reviewed by Chris Dumez.

        After r243606, interacting with date and time inputs on watchOS hangs the UI process indefinitely while
        attempting to create an input peripheral (WKFormInputControl) for the date or time picker. This is because, in
        the process of setting up a new WKDateTimePicker, we call into +[UIKeyboard defaultSizeForInterfaceOrientation:]
        which hangs when attempting to fetch the current UIKit keyboard layout type.

        To address this, we simply avoid setting _inputPeripheral on watchOS, as we did prior to r243606. Covered by the
        existing layout test fast/forms/watchos/time-picker-value-change.html, which currently times out.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (createInputPeripheralWithView):

2019-11-16  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] [UIWKDocumentContext] Add the ability to request all marked text rects
        https://bugs.webkit.org/show_bug.cgi?id=204278
        <rdar://problem/56527803>

        Reviewed by Tim Horton.

        Add support for a new UIWKDocumentRequest option to request character rects for each character in the marked
        text range. Unless UIWKDocumentRequestRects is additionally specified (in which case we'll return rects for
        every single character in the editable root anyways), this option will ensure that all characters in the
        composition range (which should match -[UIWKDocumentContext markedTextRange]) will have known character rects
        that can be retrieved using -[UIWKDocumentContext enumerateLayoutRects:] (or one of the other helper methods
        that utilize -enumerateLayoutRects:).

        Test: WebKit.DocumentEditingContextWithMarkedText

        * Platform/spi/ios/UIKitSPI.h:

        Add a staging declaration for the new option.

        * Shared/DocumentEditingContext.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (toWebDocumentRequestOptions):
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::requestDocumentEditingContext):

        Refactor logic that uses CharacterIterator to find rects for each character range into a lambda function, and
        use this lambda function to handle UIWKDocumentRequestRects and the new UIWKDocumentRequestMarkedTextRects. The
        marked text range is relative to the start of the context before the selection.

2019-11-15  Eric Carlson  <eric.carlson@apple.com>

        Don't use AVCapture on watchOS and tvOS
        https://bugs.webkit.org/show_bug.cgi?id=204254
        <rdar://problem/45508044>

        Reviewed by Youenn Fablet.

        * Configurations/FeatureDefines.xcconfig:

2019-11-15  Myles C. Maxfield  <mmaxfield@apple.com>

        [Apple] Enable variation fonts on all Apple platforms
        https://bugs.webkit.org/show_bug.cgi?id=198100

        Reviewed by Simon Fraser.

        * Configurations/FeatureDefines.xcconfig:

2019-11-15  Chris Dumez  <cdumez@apple.com>

        Add more release logging for network load restarts
        https://bugs.webkit.org/show_bug.cgi?id=204234

        Reviewed by Youenn Fablet.

        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
        (WebKit::NetworkResourceLoader::restartNetworkLoad):
        (WebKit::NetworkResourceLoader::continueWillSendRequest):
        (WebKit::NetworkResourceLoader::serviceWorkerDidNotHandle):

2019-11-15  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Fix sysctl-read sandbox violation
        https://bugs.webkit.org/show_bug.cgi?id=204238
        <rdar://problem/57198954>

        Reviewed by Brent Fulgham.

        There is missing a rule for reading a specific sysctl property in the WebContent process on iOS.

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

2019-11-15  Benjamin Nham  <nham@apple.com>

        Add SPI to clear web process cache
        https://bugs.webkit.org/show_bug.cgi?id=204210

        Reviewed by Chris Dumez.

        This adds an SPI to clear cached web processes. The intended use case is to add a lukewarm mode to
        Mac PLT5 in which web pages load in a new WebProcess and load resources from the disk cache.

        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _clearWebProcessCache]):
        * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
        (-[WKProcessPool _clearWebProcessCache]):

2019-11-15  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Fix sandbox violation in the WebContent process related to WebRTC audio captures
        https://bugs.webkit.org/show_bug.cgi?id=204240
        <rdar://problem/57170333>

        Reviewed by Brent Fulgham.

        The WebContent process needs access to read a new audio related preference domain.

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

2019-11-15  Alex Christensen  <achristensen@webkit.org>

        Reduce structure copies when creating an API::FrameInfo
        https://bugs.webkit.org/show_bug.cgi?id=204199

        Reviewed by Brady Eidson.

        Use WTFMove and references where possible.  This is cleanup needed for a future patch.

        * Shared/FrameInfoData.cpp:
        (WebKit::FrameInfoData::decode):
        * Shared/FrameInfoData.h:
        * UIProcess/API/APIFrameInfo.cpp:
        (API::FrameInfo::create):
        (API::FrameInfo::FrameInfo):
        (API::FrameInfo::~FrameInfo): Deleted.
        (API::FrameInfo::clearPage): 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::runWebAuthenticationPanel):
        * UIProcess/API/C/WKFrame.cpp:
        (WKFrameCreateFrameInfo):
        * UIProcess/API/C/WKPage.cpp:
        (WKPageSetPageUIClient):
        (WKPageSetPageNavigationClient):
        * UIProcess/API/Cocoa/WKFrameInfo.mm:
        (-[WKFrameInfo webView]):
        * UIProcess/API/Cocoa/WKUserContentController.mm:
        * UIProcess/Cocoa/NavigationState.h:
        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::NavigationClient::didFailProvisionalLoadInSubframeWithError):
        * 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/ProvisionalPageProxy.cpp:
        (WebKit::ProvisionalPageProxy::didFailProvisionalLoadForFrame):
        (WebKit::ProvisionalPageProxy::decidePolicyForResponse):
        * UIProcess/ProvisionalPageProxy.h:
        * UIProcess/UserContent/WebScriptMessageHandler.h:
        * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
        (WebKit::WebUserContentControllerProxy::didPostMessage):
        * UIProcess/UserContent/WebUserContentControllerProxy.h:
        * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
        (WebKit::AuthenticatorManager::runPanel):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
        (WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared):
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
        (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
        (WebKit::WebPageProxy::decidePolicyForResponse):
        (WebKit::WebPageProxy::decidePolicyForResponseShared):
        (WebKit::WebPageProxy::createNewPage):
        (WebKit::WebPageProxy::runJavaScriptAlert):
        (WebKit::WebPageProxy::runJavaScriptConfirm):
        (WebKit::WebPageProxy::runJavaScriptPrompt):
        (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel):
        (WebKit::WebPageProxy::runOpenPanel):
        * UIProcess/WebPageProxy.h:

2019-11-15  Chris Dumez  <cdumez@apple.com>

        Regression(r244361) iOS: Layout test http/tests/quicklook/rtf-document-domain-is-empty-string.html is crashing
        https://bugs.webkit.org/show_bug.cgi?id=204205
        <rdar://problem/51864314>

        Reviewed by Alex Christensen.

        In this test, NSHTMLWriter ends up creating a WebArchive providing file:///index.html as URL. The page's script
        then calls document.open(), which triggers a DidExplicitOpenForFrame() IPC to the UIProcess with this URL.
        This trips our MESSAGE_CHECK_URL() check in the UIProcess when this path is not within the WebContent process'
        sandbox, and we kill the WebContent process. To address the issue, this patch replaces the MESSAGE_CHECK_URL()
        with an if check and an early return so that we ignore the IPC if the URL does not make sense, without actually
        terminating the WebContent process.

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

2019-11-12  Youenn Fablet  <youenn@apple.com>

        Update libwebrtc to M78
        https://bugs.webkit.org/show_bug.cgi?id=203897

        Reviewed by Eric Carlson.

        Update include paths.
        Update according API change to client TCP socket creation and network monitor.

        * NetworkProcess/webrtc/LibWebRTCSocketClient.h:
        * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
        (WebKit::NetworkRTCProvider::createClientTCPSocket):
        * NetworkProcess/webrtc/NetworkRTCProvider.h:
        * NetworkProcess/webrtc/NetworkRTCProvider.mm:
        * NetworkProcess/webrtc/NetworkRTCSocket.h:
        * Shared/RTCPacketOptions.h:
        * WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
        (WebKit::RTCSocketFactory::CreateClientTcpSocket):
        * WebProcess/Network/webrtc/LibWebRTCResolver.h:
        * WebProcess/Network/webrtc/LibWebRTCSocket.h:
        * WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp:
        (WebKit::LibWebRTCSocketFactory::createClientTcpSocket):
        * WebProcess/Network/webrtc/LibWebRTCSocketFactory.h:
        * WebProcess/Network/webrtc/WebRTCMonitor.cpp:
        * WebProcess/Network/webrtc/WebRTCMonitor.h:

2019-11-14  Alex Christensen  <achristensen@webkit.org>

        Make NetworkResourceLoader::didReceiveResponse more straightforward after r244700
        https://bugs.webkit.org/show_bug.cgi?id=204134

        Reviewed by Youenn Fablet.

        If m_isKeptAlive is true, we do not want to receive any HTTP body.
        Rather than storing the CompletionHandler and relying on the destructor to call it, just call it.

        No change in behavior.

        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::didReceiveResponse):

2019-11-14  Chris Dumez  <cdumez@apple.com>

        [iOS] Crash under WebProcess::processTaskStateDidChange(WebKit::ProcessTaskStateObserver::TaskState)
        https://bugs.webkit.org/show_bug.cgi?id=204177

        Reviewed by Jer Noble.

        Delay creating the ProcessTaskStateObserver until the WebProcess's connection to its parent had been
        initialized. This is necessary because ProcessTaskStateObserver may call WebProcess::processTaskStateDidChange()
        on a background thread, which will deference the IPC connection.

        * WebProcess/WebProcess.cpp:
        (WebKit::m_webSQLiteDatabaseTracker):
        (WebKit::WebProcess::~WebProcess):
        (WebKit::WebProcess::initializeConnection):
        (WebKit::m_taskStateObserver): Deleted.
        * WebProcess/WebProcess.h:

2019-11-14  Brady Eidson  <beidson@apple.com>

        Summary: WKWebView is missing an equivalent to WebKit 1's API to set the media style.
        <rdar://problem/49862107> and https://bugs.webkit.org/show_bug.cgi?id=203974

        Reviewed by Alex Christensen.

        Covered by new API test.

        This is basically:
        - Expose a read/write property on WKWebView.
        - Pipe the new media type to the WebProcess.
        - Force a style recalc.

        * UIProcess/API/Cocoa/WKWebView.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView setMediaType:]):
        (-[WKWebView mediaType]):
        
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::setOverriddenMediaType):
        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::overriddenMediaType const):
        
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::overrideMediaType const):
        
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::setOverriddenMediaType):
        * WebProcess/WebPage/WebPage.h:
        (WebKit::WebPage::overriddenMediaType const):
        * WebProcess/WebPage/WebPage.messages.in:

2019-11-14  Brady Eidson  <beidson@apple.com>

        pageZoom/setPageZoom: should not be in a Mac-only part of WKWebView.mm
        https://bugs.webkit.org/show_bug.cgi?id=204128

        Reviewed by Alex Christensen.

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

2019-11-13  Per Arne Vollan  <pvollan@apple.com>

        REGRESSION: WKWebView navigation fails when navigating from about:blank
        https://bugs.webkit.org/show_bug.cgi?id=203852
        <rdar://problem/56973112>

        Reviewed by Brent Fulgham.

        Previously, WebPageProxy::loadFile would unconditionally create a sandbox extension for the resource directory URL. Currently,
        this method is calling WebPageProxy::maybeInitializeSandboxExtension to create a sandbox extension if needed. The sandbox
        extension for the resource URL is not created if the WebContent process already has assumed access to the resource URL, which
        is the case when loading the same file for the second time. The sandbox extension still needs to be issued in this case, since
        the WebContent process is revoking its extension when the load is done. This patch restore the original behaviour by adding a
        flag to WebPageProxy::maybeInitializeSandboxExtension to indicate whether the method should check if the process already has
        assumed access.

        API test: WKWebView.LoadRelativeFileURL

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
        (WebKit::WebPageProxy::loadRequestWithNavigationShared):
        (WebKit::WebPageProxy::loadFile):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::shouldSendPendingMessage):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::loadRequestWaitingForProcessLaunch):
        (WebKit::WebPage::loadRequestWaitingForPID): Deleted.
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2019-11-13  Myles C. Maxfield  <mmaxfield@apple.com>

        [Mac] Fix build
        https://bugs.webkit.org/show_bug.cgi?id=204136

        Reviewed by Alex Christensen.

        Remove deprecation warnings.

        * PluginProcess/mac/PluginProcessMac.mm:
        (WebKit::replacedNSWorkspace_launchApplicationAtURL_options_configuration_error):
        (WebKit::initializeCocoaOverrides):
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView changeFont:]):
        (-[WKWebView changeColor:]):
        (-[WKWebView view:stringForToolTip:point:userData:]):
        (-[WKWebView pasteboardChangedOwner:]):
        (-[WKWebView pasteboard:provideDataForType:]):
        * UIProcess/API/mac/WKView.mm:
        (-[WKView changeFont:]):
        (-[WKView view:stringForToolTip:point:userData:]):
        (-[WKView pasteboardChangedOwner:]):
        (-[WKView pasteboard:provideDataForType:]):
        * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
        (WebKit::PluginProcessProxy::launchApplicationAtURL):
        (WebKit::PluginProcessProxy::openFile):
        * UIProcess/mac/WebDataListSuggestionsDropdownMac.mm:
        (-[WKDataListSuggestionView setBackgroundStyle:]):
        * UIProcess/mac/WebPageProxyMac.mm:
        (WebKit::WebPageProxy::savePDFToTemporaryFolderAndOpenWithNativeApplication):
        (WebKit::WebPageProxy::openPDFFromTemporaryFolderWithNativeApplication):

2019-11-13  Megan Gardner  <megan_gardner@apple.com>

        Cleanup old UIKit Staging
        https://bugs.webkit.org/show_bug.cgi?id=204130

        Reviewed by Wenson Hsieh.

        Not new tests - linking only.

        * Platform/spi/ios/UIKitSPI.h:

        Removing old staging code that should be unnecessary now. 

2019-11-13  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Cannot open camera from websites
        https://bugs.webkit.org/show_bug.cgi?id=204168
        <rdar://problem/57138788>

        Reviewed by Jer Noble.

        The sandbox is blocking a required service.

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

2019-11-13  Benjamin Nham  <nham@apple.com>

        VeryHigh priority loads are actually loading at VeryLow priority
        https://bugs.webkit.org/show_bug.cgi?id=203423
        <rdar://problem/56621789>

        Reviewed by Antti Koivisto.

        There are two issues with the way we translate ResourceLoadPriority to
        CFURLRequestPriority:

        1. We call _CFNetworkHTTPConnectionCacheSetLimit and set 1 too few
        priority levels. This means VeryHigh priority loads are actually out
        of bounds, which causes CFNetwork to set the priority level back to 0
        in HTTPConnectionCacheEntry::_prepareNewRequest. After this patch we'll
        call _CFNetworkHTTPConnectionCacheSetLimit with the correct number of
        levels.

        2. _CFNetworkHTTPConnectionCacheSetLimit doesn't work for NSURLSession
        right now (<rdar://problem/56621205>), so we have to map to the default
        number of CFURLRequestPriority levels, which is 4. Right now we have 5
        ResourceLoadPriority levels, so there will be some aliasing involved.
        After this patch VeryLow gets a priority of -1 and Low gets a priority
        of 0, but due to the aforementioned clamping behavior both VeryLow and
        Low will effectively both have a CFURLRequestPriority of 0.

        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::initializeNetworkSettings):

2019-11-13  Youenn Fablet  <youenn@apple.com>

        Remove timer to stop service worker process
        https://bugs.webkit.org/show_bug.cgi?id=204118

        Reviewed by Alex Christensen.

        Removal of a timer that is never get activated.
        No change of behavior.

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::createNewWebProcess):
        * UIProcess/WebProcessPool.h:

2019-11-13  Youenn Fablet  <youenn@apple.com>

        Take service worker assertions based on client processes assertion states
        https://bugs.webkit.org/show_bug.cgi?id=204119

        Reviewed by Chris Dumez.

        Compute in network process which processes contain clients for service workers of a given process.
        WebSWServerConnection implements it and sends update to UIProcess/WebProcessProxy.
        WebProcessProxy keeps for each service worker process a set of client web processes.
        WebProcessProxy now computes the service worker process assertion based on this set.

        Add some private APIs to set process assertions/get service worker process assertion states.
        Covered by new API test.

        * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
        (WebKit::WebSWServerConnection::registerServiceWorkerClient):
        (WebKit::WebSWServerConnection::unregisterServiceWorkerClient):
        (WebKit::WebSWServerConnection::contextConnectionCreated):
        * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
        (WebKit::WebSWServerToContextConnection::webProcessIdentifier const):
        * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _setAssertionStateForTesting:]):
        (-[WKWebView _hasServiceWorkerBackgroundActivityForTesting]):
        (-[WKWebView _hasServiceWorkerForegroundActivityForTesting]):
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::registerWebProcessToServiceWorkerProcess):
        (WebKit::NetworkProcessProxy::unregisterWebProcessToServiceWorkerProcess):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/Network/NetworkProcessProxy.messages.in:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::updateProcessAssertions):
        (WebKit::WebProcessPool::hasServiceWorkerForegroundActivityForTesting const):
        (WebKit::WebProcessPool::hasServiceWorkerBackgroundActivityForTesting const):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::updateServiceWorkerProcessAssertion):
        (WebKit::WebProcessProxy::registerWebProcessToServiceWorkerProcess):
        (WebKit::WebProcessProxy::unregisterWebProcessToServiceWorkerProcess):
        (WebKit::WebProcessProxy::hasServiceWorkerForegroundActivityForTesting const):
        (WebKit::WebProcessProxy::hasServiceWorkerBackgroundActivityForTesting const):
        * UIProcess/WebProcessProxy.h:
        (WebKit::WebProcessProxy::setAssertionStateForTesting):

2019-11-13  Andres Gonzalez  <andresg_22@apple.com>

        AXObjectCache::rootObject should generate the isolated tree.
        https://bugs.webkit.org/show_bug.cgi?id=204131

        Reviewed by Chris Fleizach.

        * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.h:
        * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
        (-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper]):
        (-[WKAccessibilityWebPageObjectBase clientSupportsIsolatedTree]): Became a member of AXObjectCache.
        (-[WKAccessibilityWebPageObjectBase isolatedTreeRootObject]): Deleted.
        * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
        (-[WKAccessibilityWebPageObject accessibilityHitTest:]):

2019-11-13  Youenn Fablet  <youenn@apple.com>

        [ iOS ]: Layout Test http/tests/IndexedDB/storage-limit-1.https.html is a Flaky Failure
        https://bugs.webkit.org/show_bug.cgi?id=203275
        <rdar://problem/56516249>

        Reviewed by Alex Christensen.

        Fix flakiness by clearing the storage of each cache when the cache is being cleared.
        This ensures that the storage salt gets recreated if needed.

        To further improve repeatability, make sure that initialize based tasks happen after clear tasks are complete.
        For that purpose, add a clear task counter and append initialize callbacks to a Vector if counter is not zero.
        Increment counter at clear task creation and decrement counter at completion time.
        If counter is back to 0, we can safely process the pending clear tasks.

        Covered by unflaked test.

        * NetworkProcess/cache/CacheStorageEngine.cpp:
        (WebKit::CacheStorage::Engine::~Engine):
        (WebKit::CacheStorage::Engine::initialize):
        (WebKit::CacheStorage::CompletionHandler<void):
        (WebKit::CacheStorage::Engine::clearAllCaches):
        (WebKit::CacheStorage::Engine::clearCachesForOrigin):
        * NetworkProcess/cache/CacheStorageEngine.h:
        * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
        (WebKit::CacheStorage::Caches::clearMemoryRepresentation):

2019-11-13  Chris Dumez  <cdumez@apple.com>

        Rollout(r251358) Causes load hangs
        https://bugs.webkit.org/show_bug.cgi?id=204158
        <rdar://problem/57120002>

        Unreviewed, revert r251358 because it causes load hangs.

        * Platform/spi/Cocoa/SecItemSPI.h: Removed.
        * Shared/mac/SecItemRequestData.cpp:
        (WebKit::SecItemRequestData::decode):
        * Shared/mac/SecItemRequestData.h:
        * WebKit.xcodeproj/project.pbxproj:

2019-11-13  Philippe Normand  <pnormand@igalia.com>

        Unreviewed, fix build for ServiceWorkers disabled

        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::enableServiceWorkers):

2019-11-13  Rob Buis  <rbuis@igalia.com>

        Support stale-while-revalidate cache strategy
        https://bugs.webkit.org/show_bug.cgi?id=201461

        Reviewed by Youenn Fablet.

        Add a new UseDecision value AsyncRevalidate for async revalidation. This is used
        when the retrieved cache entry is a stale-while-revalidate response [1].
        In case of AsyncRevalidate, a check is made to see if there is a
        current async revalidation ongoing for the entry, if not one is
        started. Regardless, the stale entry is returned, until either the
        async revalidation ends successfully or at the moment when the
        response expires for real.

        [1] https://fetch.spec.whatwg.org/#concept-stale-while-revalidate-response

        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::NetworkSession):
        * NetworkProcess/NetworkSession.h:
        (WebKit::NetworkSession::isStaleWhileRevalidateEnabled const):
        * NetworkProcess/NetworkSessionCreationParameters.cpp:
        (WebKit::NetworkSessionCreationParameters::encode const):
        (WebKit::NetworkSessionCreationParameters::decode):
        * NetworkProcess/NetworkSessionCreationParameters.h:
        * NetworkProcess/cache/AsyncRevalidation.cpp: Added.
        (WebKit::NetworkCache::constructRevalidationRequest):
        (WebKit::NetworkCache::AsyncRevalidation::staleWhileRevalidateEnding):
        (WebKit::NetworkCache::AsyncRevalidation::AsyncRevalidation):
        * NetworkProcess/cache/AsyncRevalidation.h: Added.
        (WebKit::NetworkCache::AsyncRevalidation::load const):
        * NetworkProcess/cache/NetworkCache.cpp:
        (WebKit::NetworkCache::responseNeedsRevalidation):
        (WebKit::NetworkCache::makeUseDecision):
        (WebKit::NetworkCache::makeStoreDecision):
        (WebKit::NetworkCache::Cache::startAsyncRevalidationIfNeeded):
        (WebKit::NetworkCache::Cache::retrieve):
        (WebKit::NetworkCache::responseHasExpired): Deleted.
        * NetworkProcess/cache/NetworkCache.h:
        * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
        (WebKit::NetworkCache::dumpHTTPHeadersDiff):
        (WebKit::NetworkCache::requestsHeadersMatch):
        * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
        * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
        (WebKit::NetworkCache::dumpHTTPHeadersDiff): Deleted.
        (WebKit::NetworkCache::requestsHeadersMatch): Deleted.
        * Sources.txt:
        * UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.cpp:
        (WKWebsiteDataStoreConfigurationGetStaleWhileRevalidateEnabled):
        (WKWebsiteDataStoreConfigurationSetStaleWhileRevalidateEnabled):
        * UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.h:
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::parameters):
        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
        (WebKit::WebsiteDataStoreConfiguration::copy const):
        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
        (WebKit::WebsiteDataStoreConfiguration::staleWhileRevalidateEnabled const):
        (WebKit::WebsiteDataStoreConfiguration::setStaleWhileRevalidateEnabled):
        * WebKit.xcodeproj/project.pbxproj:

2019-11-12  Simon Fraser  <simon.fraser@apple.com>

        Convert CSSPrimitiveValue::UnitType to an enum class, and cleanup
        https://bugs.webkit.org/show_bug.cgi?id=204101

        Reviewed by Antti Koivisto.

        Move CSSPrimitiveValue::UnitType to a standalone enum class CSSUnitType, and
        CSSPrimitiveVallue::UnitCategory to CSSUnitCategory; these are going to more extensive
        use in calc() and in the CSS OM.

        * WebProcess/Plugins/PDF/PDFPluginAnnotation.mm:
        (WebKit::PDFPluginAnnotation::updateGeometry):
        * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm:
        (WebKit::PDFPluginChoiceAnnotation::updateGeometry):
        * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm:
        (WebKit::PDFPluginTextAnnotation::updateGeometry):

2019-11-12  Sihui Liu  <sihui_liu@apple.com>

        Add size file for CacheStorage
        https://bugs.webkit.org/show_bug.cgi?id=204027
        <rdar://problem/57100861>

        Reviewed by Youenn Fablet.

        Keep the CacheStorage size in a separate file so that we can get that value without waiting for Engine to 
        initialize and read caches from disk.

        No behavior change as the file is not in use now.

        * NetworkProcess/cache/CacheStorageEngine.cpp:
        (WebKit::CacheStorage::Engine::writeSizeFile):
        (WebKit::CacheStorage::Engine::readSizeFile):
        (WebKit::CacheStorage::Engine::clearAllCachesFromDisk):
        (WebKit::CacheStorage::Engine::deleteDirectoryRecursivelyOnBackgroundThread):
        * NetworkProcess/cache/CacheStorageEngine.h:
        * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
        (WebKit::CacheStorage::Caches::cachesSizeFilename):
        (WebKit::CacheStorage::Caches::updateSizeFile):
        (WebKit::CacheStorage::Caches::initializeSize):
        (WebKit::CacheStorage::Caches::writeRecord):
        (WebKit::CacheStorage::Caches::removeRecord):
        (WebKit::CacheStorage::Caches::resetSpaceUsed):
        * NetworkProcess/cache/CacheStorageEngineCaches.h:

2019-11-12  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] WKWebView does not respect system spellchecking preference
        https://bugs.webkit.org/show_bug.cgi?id=204100
        <rdar://problem/56653808>

        Reviewed by Tim Horton.

        Implements a platform hook on iOS (-setContinuousSpellCheckingEnabled:) to allow UIKit to inform us when the
        system spellchecking preference changes, and adds logic to propagate these changes to the web process. See below
        for more details.

        Test: editing/spelling/toggle-spellchecking.html

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _setContinuousSpellCheckingEnabledForTesting:]):
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:

        Add testing SPI to enable or disable continuous spellchecking, for both iOS and macOS.

        * UIProcess/Cocoa/WebViewImpl.h:
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::setContinuousSpellCheckingEnabled):
        * UIProcess/TextChecker.h:
        * UIProcess/gtk/TextCheckerGtk.cpp:
        (WebKit::TextChecker::setContinuousSpellCheckingEnabled):
        * UIProcess/ios/TextCheckerIOS.mm:
        (WebKit::TextChecker::setContinuousSpellCheckingEnabled):
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView setupInteraction]):
        (-[WKContentView setContinuousSpellCheckingEnabled:]):

        Implement this method to handle changes to the system spellchecking preference. This hook is also used by legacy
        WebKit on iOS to turn spellchecking on or off. If the value of the preference changed, we additionally notify
        the web process. In the future, we should consider refactoring TextCheckerState to be per-web view and per-page,
        since Cocoa platform APIs would allow for different WKWebViews to have different spell checking preferences.

        * UIProcess/mac/TextCheckerMac.mm:
        (WebKit::TextChecker::setContinuousSpellCheckingEnabled):
        * UIProcess/win/TextCheckerWin.cpp:
        (WebKit::TextChecker::setContinuousSpellCheckingEnabled):
        * UIProcess/wpe/TextCheckerWPE.cpp:
        (WebKit::TextChecker::setContinuousSpellCheckingEnabled):

        Adjusted setContinuousSpellCheckingEnabled to return whether or not the continuous spellchecking state changed.

2019-11-12  Truitt Savell  <tsavell@apple.com>

        Unreviewed, rolling out r252351.

        casued 50+ crashes on Mac and iOS wk2 debug

        Reverted changeset:

        "Add size file for CacheStorage"
        https://bugs.webkit.org/show_bug.cgi?id=204027
        https://trac.webkit.org/changeset/252351

2019-11-12  Alex Christensen  <achristensen@webkit.org>

        Revert remainder of r251676
        https://bugs.webkit.org/show_bug.cgi?id=203066
        <rdar://problem/57115922>

        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
        (WebKit::NetworkProcessCreationParameters::decode):
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
        * NetworkProcess/cocoa/NetworkSessionCocoa.h:
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::globalCTDataConnectionServiceType):
        (WebKit::NetworkSessionCocoa::setCTDataConnectionServiceType):
        (WebKit::NetworkSessionCocoa::dataConnectionServiceType const):
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
        * UIProcess/API/APIProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
        (-[_WKProcessPoolConfiguration CTDataConnectionServiceType]):
        (-[_WKProcessPoolConfiguration setCTDataConnectionServiceType:]):
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeNetworkProcess):
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::paymentCoordinatorCTDataConnectionServiceType):

2019-11-12  Megan Gardner  <megan_gardner@apple.com>

        Rename _textSelectionAssistant to _textInteractionAssistant to reflect the only class it can now represent
        https://bugs.webkit.org/show_bug.cgi?id=204103

        Reviewed by Wenson Hsieh.

        No new tests - rename only.

        Now that UIWKSelectionAssistant is no longer, the _textSelectionAssistant can only be a
        UIWKTextInteractionAssistant. There is enough confusion around all the selection and 
        interaction assistants, renaming this should alleviate some of that confusion.

        * UIProcess/ios/WKContentView.mm:
        (-[WKContentView _didExitStableState]):
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView cleanupInteraction]):
        (-[WKContentView becomeFirstResponderForWebView]):
        (-[WKContentView endEditingAndUpdateFocusAppearanceWithReason:]):
        (-[WKContentView _scrollingNodeScrollingWillBegin]):
        (-[WKContentView _scrollingNodeScrollingDidEnd]):
        (-[WKContentView gestureRecognizer:canBePreventedByGestureRecognizer:]):
        (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
        (-[WKContentView _uiTextSelectionRects]):
        (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
        (-[WKContentView setUpTextSelectionAssistant]):
        (-[WKContentView _willStartScrollingOrZooming]):
        (-[WKContentView _didEndScrollingOrZooming]):
        (-[WKContentView _lookupForWebView:]):
        (-[WKContentView _shareForWebView:]):
        (-[WKContentView _addShortcutForWebView:]):
        (-[WKContentView _promptForReplaceForWebView:]):
        (-[WKContentView _transliterateChineseForWebView:]):
        (-[WKContentView tintColorDidChange]):
        (-[WKContentView _didHideMenu:]):
        (-[WKContentView selectForWebView:]):
        (-[WKContentView selectAllForWebView:]):
        (-[WKContentView _showTextStyleOptionsForWebView:]):
        (-[WKContentView _showDictionary:]):
        (-[WKContentView interactionAssistant]):
        (-[WKContentView _showKeyboard]):
        (-[WKContentView _hideKeyboard]):
        (-[WKContentView _updateChangedSelection:]):
        (-[WKContentView _startSuppressingSelectionAssistantForReason:]):
        (-[WKContentView _stopSuppressingSelectionAssistantForReason:]):
        (-[WKContentView _restoreCalloutBarIfNeeded]):
        (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]):

2019-11-12  Carlos Alberto Lopez Perez  <clopez@igalia.com>

        [GTK][WPE] Support Pointer Events
        https://bugs.webkit.org/show_bug.cgi?id=202789

        Reviewed by Carlos Garcia Campos.

        Covered by existing tests.

        * UIProcess/PageClient.h: Add a ifdef for platform COCOA on two
        function declarations that depend on the UIGestureRecognizer ObjC type.
        This is not needed for GTK/WPE code.

2019-11-12  Alex Christensen  <achristensen@webkit.org>

        Revert part of r251676
        https://bugs.webkit.org/show_bug.cgi?id=203066
        <rdar://problem/57008444>

        * NetworkProcess/NetworkProcess.h:
        (WebKit::NetworkProcess::suppressesConnectionTerminationOnSystemChange const):
        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
        (WebKit::NetworkProcessCreationParameters::decode):
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
        * UIProcess/API/APIProcessPoolConfiguration.cpp:
        (API::ProcessPoolConfiguration::copy):
        * UIProcess/API/APIProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
        (-[_WKProcessPoolConfiguration suppressesConnectionTerminationOnSystemChange]):
        (-[_WKProcessPoolConfiguration setSuppressesConnectionTerminationOnSystemChange:]):
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeNetworkProcess):

2019-11-12  Carlos Alberto Lopez Perez  <clopez@igalia.com>

        [GTK][WPE] Enable CSS Painting API
        https://bugs.webkit.org/show_bug.cgi?id=190710

        Reviewed by Don Olmstead.

        Enable the runtime feature by default on GTK/WPE when building with
        experimental features enabled.

        Covered by existing tests.

        * Shared/WebPreferences.yaml:
        * Shared/WebPreferencesDefaultValues.h:

2019-11-12  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] WebDriver: implement new window command
        https://bugs.webkit.org/show_bug.cgi?id=203994

        Reviewed by Carlos Alberto Lopez Perez.

        Add new API to support new window command. The WebKitAutomationSession::create-web-view signal can now receive a
        detail that can be "window" or "tab". Applications can use that to decide whether to add the new webview to a
        new window or tab. WebKitWebView has a new construct only property automation-presentation-type, which is an
        enum that can be either window or tab value. Appplications should use the new property when creating the web
        view for automation to indicate whether the web view was added to a new window or tab.

        * UIProcess/API/glib/WebKitAutomationSession.cpp:
        (webkit_automation_session_class_init):
        * UIProcess/API/glib/WebKitWebView.cpp:
        (webkitWebViewSetProperty):
        (webkitWebViewGetProperty):
        (webkit_web_view_class_init):
        (webkit_web_view_get_automation_presentation_type):
        * UIProcess/API/gtk/WebKitAutomationSession.h:
        * UIProcess/API/gtk/WebKitWebView.h:
        * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
        * UIProcess/API/wpe/WebKitWebView.h:
        * UIProcess/API/wpe/docs/wpe-1.0-sections.txt:

2019-11-12  Carlos Garcia Campos  <cgarcia@igalia.com>

        REGRESSION(r250707): [GTK] UIClient::setWindowFrame only works the first time
        https://bugs.webkit.org/show_bug.cgi?id=204068

        Reviewed by Adrian Perez de Castro.

        This is because we are connecting to configure-event of parent window, but not returning FALSE from the callback
        to propagate the event.

        * UIProcess/API/glib/WebKitUIClient.cpp:
        (UIClient::windowConfigureEventCallback): Make it boolean and return FALSE.

2019-11-11  Alex Christensen  <achristensen@webkit.org>

        Add SPI to access a WebsiteDataStore without instantiating it, and its configuration
        https://bugs.webkit.org/show_bug.cgi?id=204089

        Reviewed by Tim Horton.

        Calling WKWebViewConfiguration.websiteDataStore instantiates the default data store.
        We need a way to query if it has been set but not instantiate anything if it hasn't.
        We also need a way to access the configuration used to create a WKWebsiteDataStore like we do with WKWebView.
        These have been requested to fix <rdar://problem/57091216> and I think they're a good idea in general.

        Covered by API tests.

        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
        (-[WKWebViewConfiguration _websiteDataStoreIfExists]):
        * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _setDelegate:]):
        (-[WKWebsiteDataStore set_delegate:]):
        (-[WKWebsiteDataStore _configuration]):
        * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
        (WebKit::WebsiteDataStoreConfiguration::copy const):
        (WebKit::WebsiteDataStoreConfiguration::copy): Deleted.
        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:

2019-11-11  Sihui Liu  <sihui_liu@apple.com>

        Add size file for CacheStorage
        https://bugs.webkit.org/show_bug.cgi?id=204027

        Reviewed by Youenn Fablet.

        Keep the CacheStorage size in a separate file so that we can get that value without waiting for Engine to 
        initialize and read caches from disk.

        No behavior change as the file is not in use now.

        * NetworkProcess/cache/CacheStorageEngine.cpp:
        (WebKit::CacheStorage::Engine::writeSizeFile):
        (WebKit::CacheStorage::Engine::readSizeFile):
        * NetworkProcess/cache/CacheStorageEngine.h:
        * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
        (WebKit::CacheStorage::cachesSizeFilename):
        (WebKit::CacheStorage::Caches::updateSizeFile):
        (WebKit::CacheStorage::Caches::initializeSize):
        (WebKit::CacheStorage::Caches::writeRecord):
        (WebKit::CacheStorage::Caches::removeRecord):
        (WebKit::CacheStorage::Caches::resetSpaceUsed):
        * NetworkProcess/cache/CacheStorageEngineCaches.h:

2019-11-11  Youenn Fablet  <youenn@apple.com>

        Fail cross-origin redirection loads in case of CORS with redirection URLs having credentials
        https://bugs.webkit.org/show_bug.cgi?id=204036

        Reviewed by Alex Christensen.

        Implement https://fetch.spec.whatwg.org/#http-redirect-fetch steps 7 and 8.
        Covered by updated tests.

        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::checkRedirection):

2019-11-11  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Unable to view .pages files
        https://bugs.webkit.org/show_bug.cgi?id=204076
        <rdar://problem/57079557>

        Reviewed by Brent Fulgham.

        This is caused by a syscall being blocked by the sandbox. The syscall was previously unused in the
        WebContent process.
       
        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

2019-11-11  Carlos Garcia Campos  <cgarcia@igalia.com>

        WebDriver: implement proxy support
        https://bugs.webkit.org/show_bug.cgi?id=180408

        Reviewed by Carlos Alberto Lopez Perez.

        * UIProcess/API/glib/WebKitAutomationSession.cpp:
        (parseProxyCapabilities): Parse the proxy settings from capabilities.
        (webkitAutomationSessionCreate): Set the proxy settings received from capabilities.

2019-11-10  David Kilzer  <ddkilzer@apple.com>

        StorageManagerSet.m_storageAreas should use weak pointers to StorageArea
        <https://webkit.org/b/204048>
        <rdar://problem/55342744>

        Reviewed by Geoffrey Garen.

        * NetworkProcess/WebStorage/StorageArea.h:
        (class WebKit::StorageArea):
        - Inherit from CanMakeWeakPtr<StorageArea>.
        * NetworkProcess/WebStorage/StorageManagerSet.cpp:
        (WebKit::StorageManagerSet::removeConnection):
        (WebKit::StorageManagerSet::waitUntilSyncingLocalStorageFinished):
        (WebKit::StorageManagerSet::connectToLocalStorageArea):
        (WebKit::StorageManagerSet::connectToTransientLocalStorageArea):
        (WebKit::StorageManagerSet::connectToSessionStorageArea):
        (WebKit::StorageManagerSet::disconnectFromStorageArea):
        (WebKit::StorageManagerSet::getValues): Initialize `quotaError`
        stack value since it is not guaranteed to be set.
        (WebKit::StorageManagerSet::setItem):
        (WebKit::StorageManagerSet::removeItem):
        (WebKit::StorageManagerSet::clear):
        - Use makeWeakPtr() to add StorageArea pointers to
          m_storageAreas.
        - Use `const auto&` to store WeakPtr<StorageArea> values from
          m_storageAreas.
        - Add nullptr checks before using WeakPtr<StorageArea> values.
        * NetworkProcess/WebStorage/StorageManagerSet.h:
        (WebKit::StorageManagerSet::m_storageAreas):
        - Use WeakPtr<StorageArea>.

2019-11-09  Dean Jackson  <dino@apple.com>

        Clicky Orbing support.apple.com categories shows a PNG instead of the web page preview, tapping loads image asset only instead of web page
        https://bugs.webkit.org/show_bug.cgi?id=204037
        <rdar://55614939>

        Reviewed by Simon Fraser.

        When Safari adopted the ContextMenu API they began providing a PreviewViewController that
        showed the image rather than the link, for the case of <a><img></a>.

        This could be fixed in Safari, but I noticed that we actually tell the delegate that the
        type of the activated element is an image, which is why they treat it as such. It's not
        clear that because the image also has a link attached, a client should defer to the link.

        Instead, I think it makes more sense to identify this as a link, because that is the more
        important information in this API.

        While here I also changed the logic to make sure we call the API if both the API and SPI
        are available.

        New ContextMenus and WKRequestActivatedElementInfo API tests.

        * UIProcess/API/Cocoa/_WKActivatedElementInfo.mm: Identify as a link if you have a link.
        (-[_WKActivatedElementInfo _initWithInteractionInformationAtPosition:userInfo:]):
        * UIProcess/ios/WKContentViewInteraction.mm: Look for the API before the SPI.
        (-[WKContentView continueContextMenuInteraction:]):

2019-11-08  Brady Eidson  <beidson@apple.com>

        WKWebView Find-in-page API.
        <rdar://problem/46971112> and https://bugs.webkit.org/show_bug.cgi?id=203872

        Reviewed by Tim Horton.

        Covered by API tests.

        - Promote _findString:
        - Add a completion handler for it.

        * SourcesCocoa.txt:
        
        * UIProcess/API/Cocoa/WKFindConfiguration.h: Added.
        * UIProcess/API/Cocoa/WKFindConfiguration.mm: Added.
        (-[WKFindConfiguration init]):
        (-[WKFindConfiguration copyWithZone:]):

        * UIProcess/API/Cocoa/WKFindResult.h: Added.
        * UIProcess/API/Cocoa/WKFindResult.mm: Added.
        (-[WKFindResult init]):
        (-[WKFindResult _initWithMatchFound:]):
        (-[WKFindResult copyWithZone:]):
        * UIProcess/API/Cocoa/WKFindResultInternal.h: Added.

        * UIProcess/API/Cocoa/WKWebView.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (toFindOptions):
        (-[WKWebView findString:withConfiguration:completionHandler:]):
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:

        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:

        * UIProcess/Cocoa/SOAuthorization/PopUpSOAuthorizationSession.h:
        * UIProcess/Cocoa/SOAuthorization/PopUpSOAuthorizationSession.mm:

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::findString):
        (WebKit::WebPageProxy::findStringCallback):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:

        * WebKit.xcodeproj/project.pbxproj:

        * WebProcess/WebPage/FindController.cpp:
        (WebKit::FindController::findString):
        * WebProcess/WebPage/FindController.h:

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::findString):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2019-11-08  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthn] Add quirk needed to support legacy Google NFC Titan security keys
        https://bugs.webkit.org/show_bug.cgi?id=204024
        <rdar://problem/56962320>

        Reviewed by Brent Fulgham.

        Some legacy U2F keys such as Google T1 Titan don't understand the FIDO applet command. Instead,
        they are configured to only have the FIDO applet. Therefore, when the above command fails, we
        use U2F_VERSION command to double check if the connected tag can actually speak U2F, indicating
        we are interacting with one of these legacy keys.

        * UIProcess/WebAuthentication/Cocoa/NfcConnection.mm:
        (WebKit::fido::compareVersion):
        (WebKit::fido::trySelectFidoApplet):
        (WebKit::NfcConnection::transact const):
        (WebKit::NfcConnection::didDetectTags):

2019-11-08  Jonathan Bedard  <jbedard@apple.com>

        Unreviewed, rolling out r252260.

        Breaks half of API tests

        Reverted changeset:

        "Make DownloadID an ObjectIdentifier"
        https://bugs.webkit.org/show_bug.cgi?id=203962
        https://trac.webkit.org/changeset/252260

2019-11-08  Antti Koivisto  <antti@apple.com>

        Use separate cache directory for development WebKit on Mac
        https://bugs.webkit.org/show_bug.cgi?id=204015

        Reviewed by Youenn Fablet.

        Replace the NetworkCache::lastStableVersion scheme with a completely separate directory.
        This way potential bugs in development WebKit can't end up affecting system WebKit cache.
        This also removes the need to keep lastStableVersion updated.

        * NetworkProcess/cache/NetworkCacheStorage.cpp:
        (WebKit::NetworkCache::makeCachePath):

        Add '/Development' to cache path if this is not system WebKit.

        (WebKit::NetworkCache::Storage::open):
        (WebKit::NetworkCache::Storage::deleteOldVersions):

        No need to avoid deleting lastStableVersion anymore.

        * NetworkProcess/cache/NetworkCacheStorage.h:

2019-11-08  Per Arne Vollan  <pvollan@apple.com>

        [macOS] [iOS] Add logging and telemetry to mach lookup rules
        https://bugs.webkit.org/show_bug.cgi?id=203999

        Reviewed by Brent Fulgham.

        Add logging and telemetry to help determine if mach lookups to a set of services can be denied in the WebContent process.

        No new tests, since this only adds logging and telemetry.

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

2019-11-08  Alex Christensen  <achristensen@webkit.org>

        Make DownloadID an ObjectIdentifier
        https://bugs.webkit.org/show_bug.cgi?id=203962

        Reviewed by Youenn Fablet.

        Also deprecate the unused WKDownloadGetID because this identifier is internal.

        * NetworkProcess/Downloads/Download.cpp:
        (WebKit::Download::Download):
        (WebKit::Download::didReceiveData):
        (WebKit::Download::didFinish):
        (WebKit::Download::didFail):
        (WebKit::Download::didCancel):
        (WebKit::Download::messageSenderDestinationID const):
        * NetworkProcess/Downloads/DownloadID.h:
        (WebKit::DownloadID::DownloadID): Deleted.
        (WebKit::DownloadID::operator== const): Deleted.
        (WebKit::DownloadID::operator!= const): Deleted.
        (WebKit::DownloadID::downloadID const): Deleted.
        (IPC::ArgumentCoder<WebKit::DownloadID>::encode): Deleted.
        (IPC::ArgumentCoder<WebKit::DownloadID>::decode): Deleted.
        (WTF::DownloadIDHash::hash): Deleted.
        (WTF::DownloadIDHash::equal): Deleted.
        (WTF::HashTraits<WebKit::DownloadID>::emptyValue): Deleted.
        (WTF::HashTraits<WebKit::DownloadID>::constructDeletedValue): Deleted.
        (WTF::HashTraits<WebKit::DownloadID>::isDeletedValue): Deleted.
        * NetworkProcess/Downloads/DownloadMonitor.cpp:
        (WebKit::DownloadMonitor::applicationWillEnterForeground):
        (WebKit::DownloadMonitor::applicationDidEnterBackground):
        (WebKit::DownloadMonitor::timerFired):
        * NetworkProcess/Downloads/PendingDownload.cpp:
        (WebKit::PendingDownload::messageSenderDestinationID const):
        * NetworkProcess/Downloads/PendingDownload.h:
        * NetworkProcess/NetworkDataTask.h:
        (WebKit::NetworkDataTask::setPendingDownloadID):
        (WebKit::NetworkDataTask::isDownload const):
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::pendingDownloadCanceled):
        (WebKit::NetworkProcess::findPendingDownloadLocation):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::convertToDownload):
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
        (-[WKNetworkSessionDelegate URLSession:downloadTask:didFinishDownloadingToURL:]):
        (-[WKNetworkSessionDelegate URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:]):
        (WebKit::NetworkSessionCocoa::continueDidReceiveChallenge):
        * Scripts/webkit/messages.py:
        * Shared/Authentication/AuthenticationManager.h:
        * UIProcess/API/C/WKDownload.cpp:
        (WKDownloadGetID):
        * UIProcess/API/C/WKDownload.h:
        * UIProcess/Downloads/DownloadProxy.cpp:
        (WebKit::DownloadProxy::DownloadProxy):
        (WebKit::generateDownloadID): Deleted.
        * UIProcess/Downloads/DownloadProxy.h:
        * UIProcess/Downloads/DownloadProxyMap.cpp:
        (WebKit::DownloadProxyMap::createDownloadProxy):
        (WebKit::DownloadProxyMap::downloadFinished):
        (WebKit::DownloadProxyMap::invalidate):
        * WebProcess/WebPage/WebFrame.cpp:
        (WebKit::WebFrame::startDownload):
        (WebKit::WebFrame::convertMainResourceLoadToDownload):
        * WebProcess/WebPage/WebFrame.h:
        * WebProcess/WebPage/WebPage.h:

2019-11-08  Alex Christensen  <achristensen@webkit.org>

        Fix flaky tests in http/tests/cache/disk-cache
        https://bugs.webkit.org/show_bug.cgi?id=203822

        Reviewed by Youenn Fablet.

        Right now tests that set the cache model do so using a race condition.  I think this will fix the flakyness we've observed.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::setCacheModelSynchronouslyForTesting):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreSetCacheModelSynchronouslyForTesting):
        * UIProcess/API/C/WKWebsiteDataStoreRef.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::setCacheModelSynchronouslyForTesting):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::setCacheModelSynchronouslyForTesting):
        * UIProcess/WebsiteData/WebsiteDataStore.h:

2019-11-08  Alex Christensen  <achristensen@webkit.org>

        Revert some changes accidentally committed with r252257
        https://bugs.webkit.org/show_bug.cgi?id=202178

        * UIProcess/API/C/WKContextPrivate.h:

2019-11-08  Alex Christensen  <achristensen@webkit.org>

        Move schemes for SchemeRegistry from WebProcessPool to LegacyGlobalSettings
        https://bugs.webkit.org/show_bug.cgi?id=202178

        Reviewed by Youenn Fablet.

        The current users of the SPI to set these only have one WebProcessPool, so they intend these settings to be global.
        Moving them to LegacyGlobalSettings allows me to make a NetworkProcessProxy without a WebProcessPool and not regress existing functionality.
        I move only the four sets of schemes needed to launch a NetworkProcess to remove the dependency the NetworkProcess has on the WebProcessPool.

        * UIProcess/LegacyGlobalSettings.h:
        (WebKit::LegacyGlobalSettings::schemesToRegisterAsSecure):
        (WebKit::LegacyGlobalSettings::registerURLSchemeAsSecure):
        (WebKit::LegacyGlobalSettings::schemesToRegisterAsBypassingContentSecurityPolicy):
        (WebKit::LegacyGlobalSettings::registerURLSchemeAsBypassingContentSecurityPolicy):
        (WebKit::LegacyGlobalSettings::schemesToRegisterAsLocal):
        (WebKit::LegacyGlobalSettings::registerURLSchemeAsLocal):
        (WebKit::LegacyGlobalSettings::schemesToRegisterAsNoAccess):
        (WebKit::LegacyGlobalSettings::registerURLSchemeAsNoAccess):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):
        (WebKit::WebProcessPool::initializeNewWebProcess):
        (WebKit::WebProcessPool::registerURLSchemeAsSecure):
        (WebKit::WebProcessPool::registerURLSchemeAsBypassingContentSecurityPolicy):
        (WebKit::WebProcessPool::registerURLSchemeAsLocal):
        (WebKit::WebProcessPool::registerURLSchemeAsNoAccess):
        * UIProcess/WebProcessPool.h:

2019-11-08  Daniel Bates  <dabates@apple.com>

        Add WebKit Legacy SPI to retrieve editable elements in rect
        https://bugs.webkit.org/show_bug.cgi?id=204006
        <rdar://problem/57024093>

        Reviewed by Wenson Hsieh.

        Write WebPage::textInputContextsInRect() in terms of Page::editableElementsInRect().
        Also make use of Element::clientRect() instead of elementRectInRootViewCoordinates(),
        which duplicates what the former does.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::textInputContextsInRect): Write in terms of Page::editableElementsInRect().
        (WebKit::WebPage::contextForElement const): Use Element::clientRect() which does what
        elementRectInRootViewCoordinates() does.
        (WebKit::elementRectInRootViewCoordinates): Deleted.
        (WebKit::isEditableTextInputElement): Deleted.

2019-11-06  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthn] Return NotAllowedError immediately for UI cancellations
        https://bugs.webkit.org/show_bug.cgi?id=203937
        <rdar://problem/56962420>

        Reviewed by Brent Fulgham.

        NotAllowedError representing UI cancellations should be returned to sites
        immediately such that sites could show appropriate error page immediately.

        Covered by existing tests.

        * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
        (WebKit::AuthenticatorManager::cancelRequest):
        (WebKit::AuthenticatorManager::clearState):
        (WebKit::AuthenticatorManager::resetState): Deleted.
        * UIProcess/WebAuthentication/AuthenticatorManager.h:

2019-11-08  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Add pointer lock permission request API
        https://bugs.webkit.org/show_bug.cgi?id=203896

        Reviewed by Adrian Perez de Castro.

        Add a WebKitPointerLockPermissionRequest class to handle pointer lock permissions.

        * PlatformGTK.cmake:
        * SourcesGTK.txt:
        * UIProcess/API/glib/WebKitPointerLockPermissionRequest.cpp: Added.
        (webkitPointerLockPermissionRequestAllow):
        (webkitPointerLockPermissionRequestDeny):
        (webkit_permission_request_interface_init):
        (webkitPointerLockPermissionRequestDispose):
        (webkit_pointer_lock_permission_request_class_init):
        (webkitPointerLockPermissionRequestCreate):
        (webkitPointerLockPermissionRequestDidLosePointerLock):
        * UIProcess/API/glib/WebKitPointerLockPermissionRequestPrivate.h: Added.
        * UIProcess/API/glib/WebKitUIClient.cpp:
        (UIClient::~UIClient):
        * UIProcess/API/glib/WebKitWebView.cpp:
        (webkitWebViewPermissionRequest):
        (webkitWebViewDenyPointerLockRequest):
        * UIProcess/API/glib/WebKitWebViewPrivate.h:
        * UIProcess/API/gtk/WebKitPointerLockPermissionRequest.h: Added.
        * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
        * UIProcess/API/gtk/docs/webkit2gtk-4.0.types:
        * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
        * UIProcess/API/gtk/webkit2.h:

2019-11-07  Tim Horton  <timothy_horton@apple.com>

        Remove an unused icon resource
        https://bugs.webkit.org/show_bug.cgi?id=203983

        Reviewed by Wenson Hsieh.

        * Resources/mac/mediaIcon.pdf: Removed.
        * WebKit.xcodeproj/project.pbxproj:
        This file has not been used in years.

2019-11-07  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Add logging and telemetry to more mach lookup rules
        https://bugs.webkit.org/show_bug.cgi?id=203978

        Reviewed by Brent Fulgham.

        Add logging and telemetry to help determine if mach lookup of these services can be denied in the WebContent process.

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

2019-11-07  Alex Christensen  <achristensen@webkit.org>

        Re-enable NSURLSession isolation after r252116
        https://bugs.webkit.org/show_bug.cgi?id=203934
        <rdar://problem/56921584>

        Reviewed by Chris Dumez.

        r252116 was a rollout of r248640, which introduced cases where data tasks from different NSURLSessions
        which can have the same task identifiers were put into the same maps.  This key collision caused data from the wrong
        tasks to be sent to NetworkResourceLoader, causing rare and strange loading bugs.  In order to prevent insertion into
        wrong maps again, I made a new abstraction, SessionWrapper, which wraps a NSURLSession, its delegate, and all maps
        that are scoped to that NSURLSession.  Along the way I found a few other places where we had made similar mistakes.

        Covered by an API test which would've failed before r252116 because it exercises the key collision condition,
        and by tests which were skipped in r252116 and I now unskipped.

        * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
        (WebKit::Download::resume):
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
        (WebKit::NetworkDataTaskCocoa::~NetworkDataTaskCocoa):
        * NetworkProcess/cocoa/NetworkSessionCocoa.h:
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (-[WKNetworkSessionDelegate initWithSessionWrapper:withCredentials:]):
        (-[WKNetworkSessionDelegate sessionInvalidated]):
        (-[WKNetworkSessionDelegate existingTask:]):
        (-[WKNetworkSessionDelegate sessionCocoa]):
        (-[WKNetworkSessionDelegate URLSession:didBecomeInvalidWithError:]):
        (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
        (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
        (-[WKNetworkSessionDelegate URLSession:dataTask:willCacheResponse:completionHandler:]):
        (processServerTrustEvaluation):
        (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
        (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
        (-[WKNetworkSessionDelegate URLSession:downloadTask:didFinishDownloadingToURL:]):
        (-[WKNetworkSessionDelegate URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:]):
        (-[WKNetworkSessionDelegate URLSession:downloadTask:didResumeAtOffset:expectedTotalBytes:]):
        (-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]):
        (-[WKNetworkSessionDelegate existingWebSocketTask:]):
        (WebKit::SessionWrapper::initialize):
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
        (WebKit::NetworkSessionCocoa::initializeEphemeralStatelessSession):
        (WebKit::NetworkSessionCocoa::sessionWrapperForTask):
        (WebKit::NetworkSessionCocoa::isolatedSession):
        (WebKit::NetworkSessionCocoa::invalidateAndCancel):
        (WebKit::NetworkSessionCocoa::continueDidReceiveChallenge):
        (WebKit::NetworkSessionCocoa::createWebSocketTask):
        (WebKit::NetworkSessionCocoa::addWebSocketTask):
        (WebKit::NetworkSessionCocoa::removeWebSocketTask):
        (-[WKNetworkSessionDelegate initWithNetworkSession:withCredentials:]): Deleted.
        (WebKit::NetworkSessionCocoa::initializeEphemeralStatelessCookielessSession): Deleted.
        (WebKit::NetworkSessionCocoa::session): Deleted.
        (WebKit::NetworkSessionCocoa::dataTaskForIdentifier): Deleted.
        (WebKit::NetworkSessionCocoa::downloadTaskWithResumeData): Deleted.
        (WebKit::NetworkSessionCocoa::addDownloadID): Deleted.
        (WebKit::NetworkSessionCocoa::downloadID): Deleted.
        (WebKit::NetworkSessionCocoa::takeDownloadID): Deleted.
        (WebKit::NetworkSessionCocoa::webSocketDataTaskForIdentifier): Deleted.
        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _logUserInteraction:completionHandler:]):
        * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:

2019-11-07  Peng Liu  <peng.liu6@apple.com>

        ASSERTION FAILED: m_clientCounts.contains(contextId) in WebKit::VideoFullscreenManagerProxy::removeClientForContext(uint64_t)
        https://bugs.webkit.org/show_bug.cgi?id=203918

        Reviewed by Jer Noble.

        Postpone the transition to exit fullscreen of a video element
        before the previous transition of fullscreen mode change is completed.

        Fix a flakey layout test (media/video-autoplay.html). No new test is needed.

        * WebProcess/cocoa/VideoFullscreenManager.mm:
        (WebKit::VideoFullscreenManager::exitVideoFullscreenForVideoElement):

2019-11-07  Carlos Garcia Campos  <cgarcia@igalia.com>

        WebDriver: correctly handle errors when focusing element before sending key events
        https://bugs.webkit.org/show_bug.cgi?id=203945

        Reviewed by Carlos Alberto Lopez Perez.

        Handle ElementNotInteractable JavaScript exception to generate the appropriate Automation error.

        * WebProcess/Automation/WebAutomationSessionProxy.cpp:
        (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction):

2019-11-06  Eric Liang  <ericliang@apple.com>

        AX: WKWebView does not shift Accessibility Focus for Catalyst (203798)
        https://bugs.webkit.org/show_bug.cgi?id=203798

        Reviewed by Chris Fleizach.

        Added the code to register/unregister remote UI Process identifier on the host app.
        This is used so that the host app can appear as the sender for notifications sent from its web processes. Unfortunately this has to be done in WebKit: in accessibility bundles the swizzled code is not called because of bundle loading time.
        Added AppKit softlink for Mac catalyst.

        * SourcesCocoa.txt:
        * UIProcess/Cocoa/WebViewImpl.mm:
        * UIProcess/ios/AppKitSoftLink.h: Added.
        * UIProcess/ios/AppKitSoftLink.mm: Added.
        * UIProcess/ios/ViewGestureControllerIOS.mm:
        (-[WKSwipeTransitionController gestureRecognizerForInteractiveTransition:WithTarget:action:]):
        * UIProcess/ios/WKContentView.mm:
        (-[WKContentView _updateRemoteAccessibilityRegistration:]):
        (-[WKContentView _accessibilityRegisterUIProcessTokens]):
        (-[WKContentView _processDidExit]):
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
        * WebProcess/WebPage/mac/WebPageMac.mm:
        * WebProcess/cocoa/WebProcessCocoa.mm:

2019-11-06  Keith Rollin  <krollin@apple.com>

        Update availability annotations to match the macOS 10.15 and iOS 13.0 GM SDKs
        https://bugs.webkit.org/show_bug.cgi?id=202243
        <rdar://problem/55720747>

        Reviewed by Brent Fulgham.

        Changed WK_MAC_TBA and WK_IOS_TBA to 10.15 and 13.0, respectively, in
        all declarations that appear in the GM SDKs.

        * Configurations/WebKit.xcconfig:
        * Shared/API/Cocoa/WKMain.h:
        * UIProcess/API/Cocoa/NSAttributedString.h:
        * UIProcess/API/Cocoa/WKContextMenuElementInfo.h:
        * UIProcess/API/Cocoa/WKError.h:
        * UIProcess/API/Cocoa/WKErrorPrivate.h:
        * UIProcess/API/Cocoa/WKNavigation.h:
        * UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
        * UIProcess/API/Cocoa/WKNavigationDelegate.h:
        * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
        * UIProcess/API/Cocoa/WKNavigationResponsePrivate.h:
        * UIProcess/API/Cocoa/WKPreferences.h:
        * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
        * UIProcess/API/Cocoa/WKPreviewActionItem.h:
        * UIProcess/API/Cocoa/WKPreviewActionItemIdentifiers.h:
        * UIProcess/API/Cocoa/WKPreviewElementInfo.h:
        * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
        * UIProcess/API/Cocoa/WKSnapshotConfiguration.h:
        * UIProcess/API/Cocoa/WKUIDelegate.h:
        * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
        * UIProcess/API/Cocoa/WKURLSchemeTaskPrivate.h:
        * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
        * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/API/Cocoa/WKWebpagePreferences.h:
        * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h:
        * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
        * UIProcess/API/Cocoa/_WKActivatedElementInfo.h:
        * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
        * UIProcess/API/Cocoa/_WKContentRuleListAction.h:
        * UIProcess/API/Cocoa/_WKCustomHeaderFields.h:
        * UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h:
        * UIProcess/API/Cocoa/_WKElementAction.h:
        * UIProcess/API/Cocoa/_WKInspectorWindow.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKTextInputContext.h:
        * UIProcess/API/Cocoa/_WKUserContentExtensionStorePrivate.h:
        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
        * UIProcess/API/Cocoa/_WKWebsiteDataStoreDelegate.h:
        * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
        * UIProcess/_WKTouchEventGenerator.h:
        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h:

2019-11-06  Antti Koivisto  <antti@apple.com>

        REGRESSION: [ iOS ] ( r251015 ) Layout Test fast/text/whitespace/pre-wrap-overflow-selection.html is flaky
        https://bugs.webkit.org/show_bug.cgi?id=203366
        <rdar://problem/56580680>

        Reviewed by Simon Fraser.

        WKBundlePageForceRepaint may fail to do synchronous layer flush if there is a pending layer flush in-flight and waiting
        for completion message from UI process. Layer flush also flushes pending editor state so that doesn't get done either.
        This may cause randomness in test results.

        In this case the randomness is the switch between simple and complex line layout, triggered by editor state flush. The results
        between line layout paths are observably identical but produce slightly different render tree dumps.

        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
        (WKBundlePageFlushPendingEditorStateUpdate):
        * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:

        Add a function for forcing editor state flush, called from the test runner dump() function.

2019-11-06  Chris Dumez  <cdumez@apple.com>

        Unreviewed, fix watchOS build after r252011.

        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::startBackgroundActivityForFullscreenInput):

2019-11-06  Fujii Hironori  <Hironori.Fujii@sony.com>

        WEBCORE_TESTSUPPORT_EXPORT should be used only for WebCoreTestSupport, not for WebCore
        https://bugs.webkit.org/show_bug.cgi?id=203876

        Reviewed by Ross Kirsling.

        * config.h: Removed WEBCORE_TESTSUPPORT_EXPORT definition because it shouldn't be used in WebKit.

2019-11-06  Chris Dumez  <cdumez@apple.com>

        Unreviewed, rolling out r251907.

        Causes white flashing in some cases <rdar://problem/56957850>

        Reverted changeset:

        "Take down the gesture snapshot early when the back/forward
        cache is not leveraged"
        https://bugs.webkit.org/show_bug.cgi?id=203713
        https://trac.webkit.org/changeset/251907

2019-11-06  Chris Dumez  <cdumez@apple.com>

        Make sure we never end up with NetworkDataTaskCocoa TaskIdentifier conflicts
        https://bugs.webkit.org/show_bug.cgi?id=203902

        Reviewed by Antti Koivisto.

        Consolidate the all the code related to data task registration / lookup / unregistration
        in NetworkSessionCocoa and add a utility method (dataTaskMap()) to decide which data
        task map to use. This makes it less error-prone and unlikely that someone would update
        part of the code and fail to update the rest accordingly.

        I also converted the debug assertions into release ones so that we crash in case of
        id confusion instead of having a very bad and hard to diagnose bug like Bug 201822.

        * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
        (WebKit::NetworkDataTaskCocoa::~NetworkDataTaskCocoa):
        * NetworkProcess/cocoa/NetworkSessionCocoa.h:
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::dataTaskForIdentifier):
        (WebKit::NetworkSessionCocoa::registerDataTask):
        (WebKit::NetworkSessionCocoa::unregisterDataTask):

2019-11-06  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Implement support for Pointer Lock API
        https://bugs.webkit.org/show_bug.cgi?id=202956

        Reviewed by Carlos Alberto Lopez Perez.

        Add platform specific implementation of Pointer Lock for the GTK port.

        * PlatformGTK.cmake: Generate code for pointer-constraints and relative-pointer Wayland protocols.
        * Shared/NativeWebMouseEvent.h: Add optional mouse movement delta.
        * Shared/gtk/NativeWebMouseEventGtk.cpp:
        (WebKit::NativeWebMouseEvent::NativeWebMouseEvent): Pass movement delta to WebEventFactory::createWebMouseEvent().
        * Shared/gtk/WebEventFactory.cpp:
        (WebKit::WebEventFactory::createWebMouseEvent): Initialize deltaX and deltaY for motion events using the received delta.
        * Shared/gtk/WebEventFactory.h: Add optional mouse movement delta.
        * SourcesGTK.txt: Add new files to compilation.
        * UIProcess/API/glib/WebKitUIClient.cpp: Add implementation for requestPointerLock and didLosePointerLock.
        * UIProcess/API/glib/WebKitWebView.cpp:
        (webkitWebViewRequestPointerLock): Call webkitWebViewBaseRequestPointerLock().
        (webkitWebViewDidLosePointerLock): Call webkitWebViewBaseDidLosePointerLock().
        * UIProcess/API/glib/WebKitWebViewPrivate.h:
        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (webkitWebViewBaseDispose): Unlock the pointer and release the PointerLockManager.
        (webkitWebViewBaseHandleMouseEvent): Initialize the mouse movement delta for motion events and save the current event.
        (webkitWebViewBaseMotionNotifyEvent): Let PointerLockManager handle motion events while pointer is locked.
        (webkitWebViewBaseRequestPointerLock): Create a PointerLockManager and request it to lock the pointer.
        (webkitWebViewBaseDidLosePointerLock): Request PointerLockManager to unlock the pointer.
        * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
        * UIProcess/gtk/PointerLockManager.cpp: Added.
        (WebKit::PointerLockManager::create):
        (WebKit::PointerLockManager::PointerLockManager):
        (WebKit::PointerLockManager::~PointerLockManager):
        (WebKit::PointerLockManager::lock):
        (WebKit::PointerLockManager::unlock):
        (WebKit::PointerLockManager::handleMotion):
        * UIProcess/gtk/PointerLockManager.h: Added.
        (WebKit::PointerLockManager::didReceiveMotionEvent):
        * UIProcess/gtk/PointerLockManagerWayland.cpp: Added.
        (WebKit::PointerLockManagerWayland::PointerLockManagerWayland):
        (WebKit::PointerLockManagerWayland::~PointerLockManagerWayland):
        (WebKit::PointerLockManagerWayland::lock):
        (WebKit::PointerLockManagerWayland::unlock):
        * UIProcess/gtk/PointerLockManagerWayland.h: Added.
        * UIProcess/gtk/PointerLockManagerX11.cpp: Added.
        (WebKit::PointerLockManagerX11::PointerLockManagerX11):
        (WebKit::PointerLockManagerX11::didReceiveMotionEvent):
        * UIProcess/gtk/PointerLockManagerX11.h: Added.

2019-11-05  Chris Dumez  <cdumez@apple.com>

        [iOS] Scroll position does not get restored when doing a history navigation while the reader view is shown
        https://bugs.webkit.org/show_bug.cgi?id=203871
        <rdar://problem/56564603>

        Reviewed by Tim Horton.

        Previously, attempts to restore the scroll position on the web view while it is being dynamically resized
        would get ignored. Instead, we now delay restoring the scroll position until after the view is resized.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _restorePageScrollPosition:scrollOrigin:previousObscuredInset:scale:]):
        (-[WKWebView _restorePageStateToUnobscuredCenter:scale:]):

2019-11-05  Kate Cheney  <katherine_cheney@apple.com>

        Layout test website-data-removal-for-site-navigated-to-with-link-decoration.html is a flaky failure
        https://bugs.webkit.org/show_bug.cgi?id=203706
        <rdar://problem/56801615>

        Reviewed by Chris Dumez. 

        No new tests, this change is tested by the existing resourceLoadStatistics
        tests.

        This test started flaking when a new memory store was being created
        between tests to maintain consistency. The call to grandfatherExistingWebsiteData
        from populateMemoryStoreFromDisk in the persistent storage was
        async, causing a race condition that led to occasional failures.
        Adding a completion handler and changing the callsite of
        populateMemoryStoreFromDisk should fix this problem.

        * NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.cpp:
        (WebKit::ResourceLoadStatisticsPersistentStorage::populateMemoryStoreFromDisk):
        * NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.h:
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::populateMemoryStoreFromDisk):

2019-11-05  John Wilander  <wilander@apple.com>

        Temporarily turn off NSURLSession isolation
        https://bugs.webkit.org/show_bug.cgi?id=201822

        Reviewed by Chris Dumez.

        Existing tests skipped.

        Re-enabling it is tracked in rdar://problem/56921584.

        * NetworkProcess/cache/NetworkCacheStorage.h:
            Bumps the version to force a clean cache.
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
            Skips setting needsIsolatedSession.

2019-11-05  Per Arne Vollan  <pvollan@apple.com>

        Eliminate mach lookup to cfprefsd on process startup
        https://bugs.webkit.org/show_bug.cgi?id=202866

        Reviewed by Geoffrey Garen.

        Currently, the WebContent and Networking process is calling CFBundleGetValueForInfoDictionaryKey on startup
        to get the entry point function name into the WebKit bundle. This causes a mach lookup to cfprefsd which
        should be avoided. Instead, we can send the service name as part of the bootstrap message when the UI process
        is starting the process, and have the new process read this value from the message on startup to determine
        the name of the entry point. This is possibly also an improvement in launch time, since we avoid reading a
        value from Info.plist.

        * NetworkProcess/EntryPoint/Cocoa/XPCService/NetworkService/Info-OSX.plist:
        * NetworkProcess/EntryPoint/Cocoa/XPCService/NetworkService/Info-iOS.plist:
        * PluginProcess/EntryPoint/Cocoa/XPCService/PluginService.64.Info.plist:
        * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
        (WebKit::XPCServiceEventHandler):
        * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
        (WebKit::ProcessLauncher::launchProcess):
        * WebProcess/EntryPoint/Cocoa/XPCService/WebContentService/Info-OSX.plist:
        * WebProcess/EntryPoint/Cocoa/XPCService/WebContentService/Info-iOS.plist:

2019-11-05  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Add logging and telemetry to mach services believed to be unused
        https://bugs.webkit.org/show_bug.cgi?id=203831

        Reviewed by Geoffrey Garen.

        The sandbox rules for mach services believed to be unused should have logging and telemetry added to confirm
        whether the assumption is correct.

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

2019-11-05  Tuomas Karkkainen  <tuomas.webkit@apple.com>

        move CrashReporterClientSPI.h and parts of WKCrashReporter to WTF so it can be used in JavaScriptCore
        https://bugs.webkit.org/show_bug.cgi?id=203803

        Reviewed by Saam Barati.

        No new tests added because functionality is not changing, code is only
        moved from WebKit to WTF.

        * Platform/cocoa/WKCrashReporter.mm:
        (WebKit::setCrashReportApplicationSpecificInformation):
        (WebKit::setCrashLogMessage): Deleted.
        * WebKit.xcodeproj/project.pbxproj:

2019-11-05  Wenson Hsieh  <wenson_hsieh@apple.com>

        Native text substitutions interfere with HTML <datalist> options resulting in crash
        https://bugs.webkit.org/show_bug.cgi?id=203116
        <rdar://problem/49875932>

        Reviewed by Tim Horton.

        On macOS, an NSTableView inside a separate window is used to render suggestions when showing a datalist. The
        crash happens when this table view is reloaded while clicking a datalist suggestion; that is, if -[NSTableView
        reloadData] is invoked after the user sends a platform MouseDown event on the table view cell but before the
        MouseUp is received, the selected row of the table view will be -1 when the action, `-selectedRow:`, is invoked.

        In this particular case, the table view reload is triggered as a result of hiding the autocorrection bubble on
        macOS, thereby committing the alternative text suggestion and changing the value of the text field via an
        editing command.

        To avoid crashing, we simply make `-selectedRow:` robust in the case where the index is invalid.

        Test: fast/forms/datalist/datalist-click-crash.html

        * UIProcess/mac/WebDataListSuggestionsDropdownMac.mm:
        (-[WKDataListSuggestionsController selectedRow:]):

2019-11-05  Sihui Liu  <sihui_liu@apple.com>

        REGRESSION (r250754): web page using IDBIndex doesn't load occasionally
        https://bugs.webkit.org/show_bug.cgi?id=203431

        Reviewed by Brady Eidson.

        * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
        (WebKit::WebIDBConnectionToClient::didFireVersionChangeEvent):
        * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
        * NetworkProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
        * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
        (WebKit::WebIDBConnectionToServer::didFireVersionChangeEvent):
        * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:

2019-11-05  Fujii Hironori  <Hironori.Fujii@sony.com>

        Unreviewed build fix for !ENABLE(MEDIA_STREAM) builds
        https://bugs.webkit.org/show_bug.cgi?id=203362
        <rdar://problem/56648232>

        * UIProcess/UserMediaPermissionRequestProxy.h: Enclosed isUserGesturePriviledged with #if ENABLE(MEDIA_STREAM).

2019-11-05  youenn fablet  <youenn@apple.com>

        mp4 video element broken with service worker
        https://bugs.webkit.org/show_bug.cgi?id=184447
        <rdar://problem/39313155>

        Reviewed by Chris Dumez.

        Make a response as range-requested as per https://fetch.spec.whatwg.org/#http-network-or-cache-fetch step 15.

        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::checkRedirection):
        (WebKit::NetworkLoadChecker::validateResponse):
        * NetworkProcess/NetworkLoadChecker.h:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::didReceiveResponse):
        (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):

2019-11-05  youenn fablet  <youenn@apple.com>

        Enforce user gesture for getUserMedia in case a previous getUserMedia call was denied
        https://bugs.webkit.org/show_bug.cgi?id=203362

        Reviewed by Eric Carlson.

        In case the request has user gesture priviledge, do not look at denied request history.

        * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
        (WebKit::UserMediaPermissionRequestManagerProxy::getRequestAction):
        * UIProcess/UserMediaPermissionRequestProxy.h:
        (WebKit::UserMediaPermissionRequestProxy::isUserGesturePriviledged const):

2019-11-04  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthn] Guard against unexpected -[_WKWebAuthenticationPanel cancel]
        https://bugs.webkit.org/show_bug.cgi?id=203830
        <rdar://problem/56797134>

        Reviewed by Brent Fulgham .

        -[_WKWebAuthenticationPanel cancel] was only expected to be called on behalf of an
        explicit user cancel from the UI. However, clients may call it in different other
        unexpected scenarios as well. We should guard against that.

        To do so, two counter ways are implemented:
        1) AuthenticatorManager::cancelRequest is changed to invoke the pending request if there
        is no GlobalFrameID. This case can only be reached via calling -[_WKWebAuthenticationPanel cancel]
        before AuthenticatorManager::cancelRequest.
        2) WebAuthenticationPanelClient::updatePanel and WebAuthenticationPanelClient::dismissPanel
        will call delegate methods in the next run loop to prevent -[_WKWebAuthenticationPanel cancel]
        being called in the delegates.

        Covered by new API tests.

        * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
        (WebKit::AuthenticatorManager::cancelRequest):
        (WebKit::AuthenticatorManager::createService const):
        (WebKit::AuthenticatorManager::invokePendingCompletionHandler):
        * UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.mm:
        (WebKit::WebAuthenticationPanelClient::updatePanel const):
        (WebKit::WebAuthenticationPanelClient::dismissPanel const):

2019-11-04  Ross Kirsling  <ross.kirsling@sony.com>

        Unreviewed fix for non-unified build.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        * NetworkProcess/NetworkResourceLoader.cpp:
        * Shared/ServiceWorkerInitializationData.cpp:
        * UIProcess/API/APIAttachment.cpp:
        * WebProcess/Storage/WebServiceWorkerProvider.h:
        Add missing includes.

2019-11-04  Per Arne Vollan  <pvollan@apple.com>

        Fix crash caused by syscall sandbox violation
        https://bugs.webkit.org/show_bug.cgi?id=203826
        <rdar://problem/56332491>

        Reviewed by Brent Fulgham.

        A new syscall needs to be allowed in the WebContent process' sandbox.

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

2019-11-04  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Flush the shared ResourceLoadObserver when the webpage is closed by JavaScript
        https://bugs.webkit.org/show_bug.cgi?id=203623
        <rdar://problem/56756427>

        Reviewed by Alex Christensen.

        This patch adds flushing of pending statistics when a window is closed by JavaScript,
        when a webpage is removed from the web process, and when the web process prepares to
        suspend.

        New API test added.

        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
            Now calls logTestingEvent() so that the test infrastructure can wait for updates.
        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _seedResourceLoadStatisticsForTestingWithFirstParty:thirdParty:shouldScheduleNotification:completionHandler:]):
            Test infrastructure to seed every web process' WebCore::ResourceLoadObserver with test data.
        * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _clearResourceLoadStatistics:]):
        (-[WKWebsiteDataStore _isRegisteredAsSubresourceUnderFirstParty:thirdParty:completionHandler:]):
            Test infrastructure.
        * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::seedResourceLoadStatisticsForTesting):
            Test infrastructure.
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::isRegisteredAsSubresourceUnder):
            Made sure the completion handler is called even if there is no network process.
        (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
            Now tells all web processes to turn ITP on or off.
        * WebProcess/WebCoreSupport/WebResourceLoadObserver.cpp:
        (WebKit::WebResourceLoadObserver::~WebResourceLoadObserver):
        (WebKit::WebResourceLoadObserver::logSubresourceLoadingForTesting):
            Test infrastructure to seed the observer with test data.
        * WebProcess/WebCoreSupport/WebResourceLoadObserver.h:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::setWebsiteDataStoreParameters):
            Now checks whether a shared observer already exists before setting one.
        (WebKit::WebProcess::removeWebPage):
        (WebKit::WebProcess::prepareToSuspend):
            These two functions now call WebProcess::flushResourceLoadStatistics().
        (WebKit::WebProcess::setResourceLoadStatisticsEnabled):
            This function now sets the process' shared WebCore::ResourceLoadObserver if none exists.
        (WebKit::WebProcess::flushResourceLoadStatistics):
            This function tells the shared WebCore::ResourceLoadObserver to send any pending
            statistics to the central ITP store.
        (WebKit::WebProcess::seedResourceLoadStatisticsForTesting):
            Test infrastructure to seed the shared observer with test data.
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:

2019-11-04  Chris Dumez  <cdumez@apple.com>

        [iOS][WK2] Simplify process assertion handling for the network process and service worker processes
        https://bugs.webkit.org/show_bug.cgi?id=203633

        Reviewed by Alex Christensen.

        Simplify process assertion handling for the network process and service worker processes.
        In particular, the following changes were made:
        1. Put the NetworkProcessProxy in charge of keeping the network process runnable instead
           of relying on the WebProcessPool to do it.
        2. Put the WebProcessProxy in charge of keeping the web process runnable due to service
           worker activity, instead of relying on the WebProcessPool to do it.
        3. Introduce a new Variant data type which can store a foreground activity, a background
           activity or no activity. This avoid having 2 separate and mutually-exclusive data
           members for foreground and background activities.
        4. The new code is a bit more correct because it makes sure the the activity we're holding
           is valid, instead of simply checking that it has an activity. This means that if the
           process assertion was previously invalidated, we will now properly take a new activity,
           which will re-take a process assertion.

        This patch also reduces the #ifdefing for IOS_FAMILY, since ProcessThrottler and
        ProcessAssertion exist on all platforms.

        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::updateProcessAssertion):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/ProcessThrottler.cpp:
        (WebKit::ProcessThrottler::isValidBackgroundActivity):
        (WebKit::ProcessThrottler::isValidForegroundActivity):
        * UIProcess/ProcessThrottler.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::m_backgroundWebProcessCounter):
        (WebKit::WebProcessPool::ensureNetworkProcess):
        (WebKit::WebProcessPool::networkProcessCrashed):
        (WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess):
        (WebKit::WebProcessPool::disconnectProcess):
        (WebKit::WebProcessPool::terminateNetworkProcess):
        (WebKit::WebProcessPool::updateProcessAssertions):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::didSetAssertionState):
        (WebKit::WebProcessProxy::updateServiceWorkerProcessAssertion):
        (WebKit::WebProcessProxy::enableServiceWorkers):
        * UIProcess/WebProcessProxy.h:
        (WebKit::WebProcessProxy::isStandaloneServiceWorkerProcess const):

2019-11-03  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthn] CtapAuthenticator::tryDowngrade should distinguish requestData().options
        https://bugs.webkit.org/show_bug.cgi?id=203771
        <rdar://problem/56832618>

        Reviewed by Brent Fulgham.

        CtapAuthenticator::tryDowngrade assumes the request is a getAssertion request. This is true
        for most cases but not for Google's registration. For Google's registration, a quirk is
        implemented to use U2F commands for registration if GoogleLegacyAppIdSupportExtension asks
        us to do so.

        No tests given there is no way to simulate google.com in our test infrastructures.

        * UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp:
        (WebKit::CtapAuthenticator::tryDowngrade):

2019-11-03  Tim Horton  <timothy_horton@apple.com>

        WKWebView can get stuck blank (Web Content process thinks the app is backgrounded)
        https://bugs.webkit.org/show_bug.cgi?id=203774
        <rdar://problem/53399054>

        Reviewed by Chris Dumez.

        With careful timing, if a WKWebView swaps out its content view in the
        background, the incoming view can fail to inform the Web Content process
        when the app comes to the foreground, leaving the layer tree frozen.

        This occurs because the last-sent state is stored per-WKApplicationStateTrackingView,
        and the content view is the WKApplicationStateTrackingView, so it is possible
        for e.g. a WKPDFView to be in the hierarchy, keeping the correct state,
        with an initialized-but-never-parented WKContentView hanging off the WKWebView.

        If it is never parented, WKContentView will think that the current application
        state is foreground (_lastObservedStateWasBackground is initialized to NO).

        If you go into the background with a WKPDFView as the current content view,
        it will inform the Web Content process that the application has backgrounded.

        If, still in the background, WKWebView swaps from the WKPDFView to
        the WKContentView, and then comes into the foreground, when we get the
        notification that the app came to the foreground, we will not forward it
        to the Web Content process, because WKContentView's _lastObservedStateWasBackground
        remains NO.

        To fix this, move _lastObservedStateWasBackground to WebPageProxy, so that
        it always tracks the most recently sent state, regardless of which content view
        is active.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::resetState):
        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::lastObservedStateWasBackground const):
        * UIProcess/ios/WKApplicationStateTrackingView.mm:
        (-[WKApplicationStateTrackingView willMoveToWindow:]):
        (-[WKApplicationStateTrackingView didMoveToWindow]):
        (-[WKApplicationStateTrackingView _applicationDidEnterBackground]):
        (-[WKApplicationStateTrackingView _applicationWillEnterForeground]):
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::applicationDidEnterBackground):
        (WebKit::WebPageProxy::applicationWillEnterForeground):

2019-11-02  Devin Rousso  <drousso@apple.com>

        Web Inspector: Add diagnostic logging for frontend feature usage
        https://bugs.webkit.org/show_bug.cgi?id=203579
        <rdar://problem/56717410>

        Reviewed by Brian Burg.

        This patch enables diagnostic logging for the Web Inspector web process
        and adds the necessary `InspectorFrontendClient` plumbing to `WebInspectorUI`.

        Original patch by Matt Baker <mattbaker@apple.com>.

        * WebProcess/WebPage/WebInspectorUI.h:
        * WebProcess/WebPage/WebInspectorUI.cpp:
        (WebKit::WebInspectorUI::supportsDiagnosticLogging): Added.
        (WebKit::WebInspectorUI::logDagnosticEvent): Added.
        * WebProcess/WebPage/RemoteWebInspectorUI.h:
        * WebProcess/WebPage/RemoteWebInspectorUI.cpp:
        (WebKit::RemoteWebInspectorUI::supportsDiagnosticLogging): Added.
        (WebKit::RemoteWebInspectorUI::logDiagnosticEvent): Added.

        * UIProcess/mac/WKInspectorViewController.mm:
        (-[WKInspectorViewController configuration]):
        Default to enabling diagnostic logging for the Web Inspector frontend window.

        * Configurations/FeatureDefines.xcconfig:
        Add `ENABLE_INSPECTOR_TELEMETRY`, which is only enabled for macOS.

2019-11-01  Brady Eidson  <beidson@apple.com>

        Promote "_getWebArchive" to API.
        <rdar://problem/17317547> and https://bugs.webkit.org/show_bug.cgi?id=203767

        Reviewed by Andy Estes.

        * UIProcess/API/Cocoa/WKWebView.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView createWebArchiveDataWithCompletionHandler:]):
        (-[WKWebView _getWebArchiveDataWithCompletionHandler:]):

2019-11-01  Brady Eidson  <beidson@apple.com>

        Rejigger WKWebArchive headers.
        https://bugs.webkit.org/show_bug.cgi?id=203648

        Reviewed by Andy Estes.

        * Shared/API/c/mac/WKWebArchiveRef.cpp: Renamed from Source/WebKit/Shared/API/c/mac/WKWebArchive.cpp.
        (WKWebArchiveGetTypeID):
        (WKWebArchiveCreate):
        (WKWebArchiveCreateWithData):
        (WKWebArchiveCreateFromRange):
        (WKWebArchiveCopyMainResource):
        (WKWebArchiveCopySubresources):
        (WKWebArchiveCopySubframeArchives):
        (WKWebArchiveCopyData):
        * Shared/API/c/mac/WKWebArchiveRef.h: Copied from Source/WebKit/Shared/API/c/mac/WKWebArchive.h.
        * SourcesCocoa.txt:
        * UIProcess/API/Cocoa/WKWebArchive.h: Renamed from Source/WebKit/Shared/API/c/mac/WKWebArchive.h.
        * WebKit.xcodeproj/project.pbxproj:

2019-11-01  Eric Carlson  <eric.carlson@apple.com>

        Add experimental TextTrackCue API
        https://bugs.webkit.org/show_bug.cgi?id=203649
        <rdar://problem/55675172>

        Reviewed by Jer Noble.

        * Shared/WebPreferences.yaml:

2019-11-01  Brian Burg  <bburg@apple.com>

        REGRESSION(r248696): Element Click on Mac is adding an extra page topContentInsets to y-coordinate
        https://bugs.webkit.org/show_bug.cgi?id=203765
        <rdar://problem/56014369>

        Reviewed by Devin Rousso.

        * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
        (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
        The topContentInsets is accounted for by rootViewToWindow(), so don't add it in manually.

2019-11-01  Per Arne Vollan  <pvollan@apple.com>

        Investigate if mach lookup access to *.apple-extension-service, *.viewservice, and com.apple.uikit.viewservice.* can be denied
        https://bugs.webkit.org/show_bug.cgi?id=203626

        Reviewed by Alexey Proskuryakov.

        Modify the allow rule for these services to include the telemetry option.

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

2019-11-01  Peng Liu  <peng.liu6@apple.com>

        Turn on the Picture-in-Picture API feature by default
        https://bugs.webkit.org/show_bug.cgi?id=203725

        Reviewed by Jer Noble.

        * Shared/WebPreferences.yaml:

2019-10-31  Chris Dumez  <cdumez@apple.com>

        Take down the gesture snapshot early when the back/forward cache is not leveraged
        https://bugs.webkit.org/show_bug.cgi?id=203713
        <rdar://problem/56803910>

        Reviewed by Tim Horton.

        Take down the gesture snapshot as soon as the gesture is done when the back/forward cache
        is not leveraged. Otherwise, the snapshot may stay up for a long time (while we load, parse
        and restore scroll position) and it would look to the user as if the view was unresponsive.
        Showing the page slowly loading in such cases is less confusing as the user knows what's
        going on and is even able to interact with the partially loaded page.

        * Shared/WebBackForwardListItem.cpp:
        (WebKit::WebBackForwardListItem::hasCachedWebPage const):
        * Shared/WebBackForwardListItem.h:
        * UIProcess/ViewGestureController.cpp:
        (WebKit::ViewGestureController::endSwipeGesture):
        * UIProcess/ViewGestureController.h:
        * UIProcess/ios/ViewGestureControllerIOS.mm:
        (WebKit::ViewGestureController::makeSnapshotBlank):
        (WebKit::ViewGestureController::endSwipeGesture):
        * UIProcess/mac/ViewGestureControllerMac.mm:
        (WebKit::ViewGestureController::makeSnapshotBlank):

2019-10-31  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Fix mach lookup sandbox violations in the Mail app
        https://bugs.webkit.org/show_bug.cgi?id=203697

        Reviewed by Alexey Proskuryakov.

        Allow mach lookup to the services "com.apple.logd.events" and "com.apple.distributed_notifications@1v3",
        which are seen when running the Mail application. Also allow "com.apple.aggregated", which was previously
        allowed, and is showing up in reports.

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

2019-10-31  Tim Horton  <timothy_horton@apple.com>

        Turn on IOSurface support in the iOS Simulator
        https://bugs.webkit.org/show_bug.cgi?id=203026
        <rdar://problem/56320993>

        Reviewed by Simon Fraser.

        * Configurations/WebKit.xcconfig:
        Always link IOSurface now that we always have it.

        * Shared/WebPreferences.yaml:
        * Shared/WebPreferencesDefaultValues.h:
        Turn on Accelerated Drawing and Accelerated Drawing for Canvas by default.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _takeViewSnapshot]):
        Don't use RGB10 if we don't have it.

        (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
        Don't use render server snapshotting in hidden windows, because it
        (correctly, but unhelpfully) cannot capture contents in that case.

2019-10-31  Dean Jackson  <dino@apple.com>

        REGRESSION (r251215): Mail failed to build
        https://bugs.webkit.org/show_bug.cgi?id=203700
        <rdar://problem/56787012>

        Reviewed by Antoine Quint.

        Revert the private modulemap. It didn't include enough things
        and caused some internal builds to fail.

        We'll put it back with everything included sometime soon.

        * Configurations/WebKit.xcconfig:
        * Modules/OSX.modulemap: Renamed from Source/WebKit/Modules/macOS.modulemap.
        * Modules/iOS.private.modulemap: Removed.
        * Modules/macOS.private.modulemap: Removed.
        * Shared/API/Cocoa/WebKitPrivate.h:

2019-10-31  Alex Christensen  <achristensen@apple.com>

        Enable more features in Mac CMake build
        https://bugs.webkit.org/show_bug.cgi?id=203699

        Rubber-stamped by Tim Horton.

        * PlatformMac.cmake:
        * WebProcess/cocoa/UserMediaCaptureManager.cpp:
        (WebKit::UserMediaCaptureManager::createCaptureSource):

2019-10-31  Russell Epstein  <repstein@apple.com>

        Unreviewed, rolling out r251861.

        Caused 50+ Layout Test Crashes

        Reverted changeset:

        "Use SecurityOriginData in NetworkProcess where possible
        without other changes"
        https://bugs.webkit.org/show_bug.cgi?id=203615
        https://trac.webkit.org/changeset/251861

2019-10-31  Truitt Savell  <tsavell@apple.com>

        Unreviewed, rolling out r251854.

        Broke iOS build

        Reverted changeset:

        "Rejigger WKWebArchive headers."
        https://bugs.webkit.org/show_bug.cgi?id=203648
        https://trac.webkit.org/changeset/251854

2019-10-31  Alex Christensen  <achristensen@webkit.org>

        Remove unneeded HAVE_TIMINGDATAOPTIONS
        https://bugs.webkit.org/show_bug.cgi?id=202990

        Reviewed by Brady Eidson.

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):

2019-10-31  Alex Christensen  <achristensen@webkit.org>

        Use SecurityOriginData in NetworkProcess where possible without other changes
        https://bugs.webkit.org/show_bug.cgi?id=203615

        Reviewed by Brady Eidson.

        * NetworkProcess/NetworkResourceLoadParameters.cpp:
        (WebKit::NetworkResourceLoadParameters::encode const):
        * NetworkProcess/NetworkResourceLoadParameters.h:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::shouldInterruptLoadForXFrameOptions):
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):

2019-10-31  Alex Christensen  <achristensen@webkit.org>

        Expose more WKPreferences SPI
        https://bugs.webkit.org/show_bug.cgi?id=203631
        <rdar://problem/56717160>

        Reviewed by Brady Eidson.

        I added a unit test for the one that can be easily tested.

        * UIProcess/API/Cocoa/WKPreferences.mm:
        (-[WKPreferences _setWebAudioEnabled:]):
        (-[WKPreferences _webAudioEnabled]):
        (-[WKPreferences _setAcceleratedCompositingEnabled:]):
        (-[WKPreferences _acceleratedCompositingEnabled]):
        (-[WKPreferences _setRequestAnimationFrameEnabled:]):
        (-[WKPreferences _requestAnimationFrameEnabled]):
        * UIProcess/API/Cocoa/WKPreferencesPrivate.h:

2019-10-31  Alex Christensen  <achristensen@webkit.org>

        CMake build should make WebKit framework able to be used by Safari
        https://bugs.webkit.org/show_bug.cgi?id=203685

        Rubber-stamped by Tim Horton.

        * PlatformMac.cmake:

2019-10-31  Brady Eidson  <beidson@apple.com>

        Rejigger WKWebArchive headers.
        https://bugs.webkit.org/show_bug.cgi?id=203648

        Reviewed by Andy Estes.

        * Shared/API/c/mac/WKWebArchiveRef.cpp: Renamed from Source/WebKit/Shared/API/c/mac/WKWebArchive.cpp.
        (WKWebArchiveGetTypeID):
        (WKWebArchiveCreate):
        (WKWebArchiveCreateWithData):
        (WKWebArchiveCreateFromRange):
        (WKWebArchiveCopyMainResource):
        (WKWebArchiveCopySubresources):
        (WKWebArchiveCopySubframeArchives):
        (WKWebArchiveCopyData):
        * Shared/API/c/mac/WKWebArchiveRef.h: Copied from Source/WebKit/Shared/API/c/mac/WKWebArchive.h.
        * SourcesCocoa.txt:
        * UIProcess/API/Cocoa/WKWebArchive.h: Renamed from Source/WebKit/Shared/API/c/mac/WKWebArchive.h.
        * WebKit.xcodeproj/project.pbxproj:

2019-10-31  Wenson Hsieh  <wenson_hsieh@apple.com>

        Add telemetry to test a potential cause of crashes under -[WKContentView _interpretKeyEvent:isCharEvent:]
        https://bugs.webkit.org/show_bug.cgi?id=203630
        <rdar://problem/56769229>

        Reviewed by Simon Fraser.

        This iOS-specific crash occurs under `-_interpretKeyEvent:isCharEvent:`, when we first try to access WebEvent's
        properties with `event.keyboardFlags`. This suggests that between storing the WebEvent in WebPageProxy's
        m_keyEventQueue, and later receiving an InterpretKeyEvent sync IPC message in the UI process, something ends up
        overreleasing (or otherwise writing over or corrupting) the WebEvent.

        However, from code inspection, nothing appears to overrelease the WebEvent; an alternate possibility is that the
        API is somehow being invoked from a background thread, which would explain why the WebEvent may sometimes get
        destroyed too early.

        To try and detect this scenario (and avoid keeping any strong references to WebEvent at all), add an
        `os_log_fault` in case the API is being called on a background thread, and bail immediately.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView handleKeyWebEvent:withCompletionHandler:]):

2019-10-31  Miguel Gomez  <magomez@igalia.com>

        [CoordGraphics] Avoid painting backing stores for zero-opacity layers
        https://bugs.webkit.org/show_bug.cgi?id=184143

        Reviewed by Žan Doberšek.

        Do not check whether a backingStore is required by a layer inside CoordinatedGraphicsScene. This
        decision is made by the appropriate CoordinatedGraphicsLayer and propagated to the scene by
        sending a valid or null Nicosia::BackingStore instance through the state.

        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
        (WebKit::updateBackingStore):
        (WebKit::layerShouldHaveBackingStore): Deleted.

2019-10-30  Peng Liu  <peng.liu6@apple.com>

        [Picture-in-Picture Web API] Enable the support for iOS
        https://bugs.webkit.org/show_bug.cgi?id=202618

        Reviewed by Jer Noble.

        Enable the Picture-in-Picture API support for iOS (iPad only).

        * Configurations/FeatureDefines.xcconfig:
        * WebProcess/cocoa/VideoFullscreenManager.mm:

2019-10-30  Alex Christensen  <achristensen@webkit.org>

        Prevent Mac CMake build from bit rotting
        https://bugs.webkit.org/show_bug.cgi?id=203647

        Rubber-stamped by Tim Horton.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::m_messagePortChannelRegistry):
        * PlatformMac.cmake:
        * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm:
        (-[_WKWebAuthenticationPanel delegate]):
        (-[_WKWebAuthenticationPanel setDelegate:]):
        * UIProcess/WebProcessProxy.cpp:

2019-10-30  Per Arne Vollan  <pvollan@apple.com>

        It should be possible to create a mach sandbox extension for the WebContent process before the audit token is known
        https://bugs.webkit.org/show_bug.cgi?id=203618

        Reviewed by Brent Fulgham.

        Currently, we are only able to create a mach sandbox extension for the WebContent process if we know its
        audit token. It should be possible to create a mach extension without the audit token, since this is
        needed when we want to create extensions before the PID or audit token is known. These extensions are
        typically sent in the WebProcess creation parameters.
        
        No new tests, this is not a behavior change, but a patch in preparation for future patches.

        * Shared/Cocoa/SandboxExtensionCocoa.mm:
        (WebKit::SandboxExtensionImpl::sandboxExtensionForType):
        (WebKit::SandboxExtension::createHandleForMachLookup):
        (WebKit::SandboxExtension::createHandleForMachLookupByAuditToken): Deleted.
        * Shared/SandboxExtension.h:
        * UIProcess/ios/WebProcessProxyIOS.mm:
        (WebKit::WebProcessProxy::unblockAccessibilityServerIfNeeded):

2019-10-30  Per Arne Vollan  <pvollan@apple.com>

        Fix some sysctl read violations in the WebContent process
        https://bugs.webkit.org/show_bug.cgi?id=203632

        Reviewed by Brent Fulgham.

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

2019-10-30  Dean Jackson  <dino@apple.com>

        REGRESSION(r251568) If we didn't start a Service Worker, don't try talking to it
        https://bugs.webkit.org/show_bug.cgi?id=203639
        <rdar://problem/56762071>

        Reviewed by Chris Dumez.

        Similar to the fix that introduced this regression, if the UI process does
        not have the entitlement to start a service worker, we should not try
        to load with one.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad): If the
        parent process doesn't have a service worker, use the regular load path.

2019-10-30  Simon Fraser  <simon.fraser@apple.com>

        Turn Resize Observer on by default
        https://bugs.webkit.org/show_bug.cgi?id=203644
        rdar://problem/56026799

        Reviewed by Tim Horton.

        Change the defaultValue of Resize Observer to true.

        * Shared/WebPreferences.yaml:

2019-10-30  Per Arne Vollan  <pvollan@apple.com>

        Lookup to mach services with the WebKit extension should list the allowed services
        https://bugs.webkit.org/show_bug.cgi?id=203619

        Reviewed by Alexey Proskuryakov.

        To tighten the mach lookup rule which allows lookup to services with the "com.apple.webkit.extension.mach"
        extension, all allowed services should be listed. Currently, we are only creating mach lookup extensions to
        "com.apple.iphone.axserver-systemwide", but more will come in the future.

        No new tests. Testing this requires UI interaction on the device to enable Accessibility.

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

2019-10-30  Alex Christensen  <achristensen@webkit.org>

        WKContentRuleLists should block requests from service workers
        https://bugs.webkit.org/show_bug.cgi?id=201980
        <rdar://problem/55516735>

        Reviewed by Chris Dumez.

        Test: http/tests/contentextensions/service-worker.https.html

        Also covered by an API test.

        * Shared/ServiceWorkerInitializationData.cpp: Added.
        (WebKit::ServiceWorkerInitializationData::encode const):
        (WebKit::ServiceWorkerInitializationData::decode):
        * Shared/ServiceWorkerInitializationData.h: Added.
        * Sources.txt:
        * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
        (WebKit::WebUserContentControllerProxy::addProcess):
        (WebKit::WebUserContentControllerProxy::contentRuleListData):
        * UIProcess/UserContent/WebUserContentControllerProxy.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess):
        (WebKit::WebProcessPool::createWebPage):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::createForServiceWorkers):
        (WebKit::WebProcessProxy::establishServiceWorkerContext):
        (WebKit::contentRuleListsFromIdentifier):
        (WebKit::WebProcessProxy::enableServiceWorkers):
        * UIProcess/WebProcessProxy.h:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        (WebKit::WebSWContextManagerConnection::WebSWContextManagerConnection):
        (WebKit::m_userAgent):
        (WebKit::WebSWContextManagerConnection::installServiceWorker):
        * WebProcess/Storage/WebSWContextManagerConnection.h:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::establishWorkerContextConnectionToNetworkProcess):
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:

2019-10-30  Andres Gonzalez  <andresg_22@apple.com>

        Create base class common to AccessibilityObject and AXIsolatedTreeNode.
        https://bugs.webkit.org/show_bug.cgi?id=203408

        Reviewed by Chris Fleizach.

        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
        (WKAccessibilityRootObject):
        (WKAccessibilityFocusedObject):

2019-10-30  Chris Dumez  <cdumez@apple.com>

        Unreviewed, fix reversed assertion landed in r251778.

        * UIProcess/ProcessThrottler.h:
        (WebKit::ProcessThrottler::Activity::invalidate):

2019-10-30  Chris Dumez  <cdumez@apple.com>

        Unreviewed, fix WatchOS build after r251778.

        * UIProcess/WebProcessProxy.h:

2019-10-30  Chris Dumez  <cdumez@apple.com>

        WKFrameIsDisplayingMarkupDocument() should return true after a window.open/document.write
        https://bugs.webkit.org/show_bug.cgi?id=203587
        <rdar://problem/56717726>

        Reviewed by Alex Christensen.

        When doing a document.open(), we were propagating the document's URL to the UIProcess but not its
        MIME type. WKFrameIsDisplayingMarkupDocument() was relying on this MIME type.

        * UIProcess/WebFrameProxy.cpp:
        (WebKit::WebFrameProxy::didExplicitOpen):
        * UIProcess/WebFrameProxy.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::didExplicitOpenForFrame):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDidExplicitOpen):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:

2019-10-30  Chris Dumez  <cdumez@apple.com>

        REGRESSION (r238252): HTTP POST is losing application/x-www-form-urlencoded body if there's a redirect to different host
        https://bugs.webkit.org/show_bug.cgi?id=201950
        <rdar://problem/55577782>

        Reviewed by Alex Christensen.

        The resource request body was getting lost on cross-site redirects. This was caused by the fact that a cross-site
        redirect would cause a process-swap and the request to start again from a new process. This would work fine if
        the request does not have a body. However, we have an optimization in place which avoids encoding the request body
        whenever it is sent over IPC. Because the WebResourceLoader::WillSendRequest IPC would not encode the request body,
        any decision to process swap as a result of this IPC (i.e. redirect) would cause the new request in the new process
        to be missing its body. To address the issue, we now make sure to pass the request body in the WillSendRequest IPC
        and reconsile the request with its body on the recipient side.

        Test: http/tests/misc/form-submit-file-cross-site-redirect.html

        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::continueWillSendRedirectedRequest):
        * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp:
        (WebKit::ServiceWorkerFetchTask::didReceiveRedirectResponse):
        * WebProcess/Network/WebResourceLoader.cpp:
        (WebKit::WebResourceLoader::willSendRequest):
        * WebProcess/Network/WebResourceLoader.h:
        * WebProcess/Network/WebResourceLoader.messages.in:

2019-10-30  Jer Noble  <jer.noble@apple.com>

        Enable Remote Playback API by default
        https://bugs.webkit.org/show_bug.cgi?id=203595

        Reviewed by Eric Carlson.

        * Shared/WebPreferences.yaml:

2019-10-30  Chris Dumez  <cdumez@apple.com>

        [iOS] [WK2] Improve process assertion-related logging to help identify causes of leaked assertions
        https://bugs.webkit.org/show_bug.cgi?id=203438

        Reviewed by Antti Koivisto.

        Improve process assertion-related logging to help identify causes of leaked assertions. Previously,
        whenever our code needed to prevent suspension of a child process due to some kind of activity, it
        would simply grab a "token" from the child process' ProcessThrottler. This, in-turn, would cause
        the ProcessThrottler to take the right kind of ProcessAssertion or release it when nobody holds
        any tokens any more.

        We frequently have issues where the UIProcess keeps its assertions around for too long after getting
        backgrounding. This causes the assertions to get invalidated and the UIProcess will usually suspend
        (albeit with a delay, which is bad for power). Sometimes though, we get killed because our invalidation
        handler does not get a chance to release the assertion in time.

        Finding out why we're keeping around assertions is currently very difficult because we cannot easily
        see in the logs who is still holding ProcessThrottler tokens. To make such debugging easier, clients
        now notify the ProcessThrottler when they start some activity and provide a user-readable description
        of the activity. The client then gets a ForegroundActivity or BackgroundActivity object instead of
        simply a token. As a result, we are now able to log when a given activity that prevents suspension
        begins and ends, with a user-friendly string. Also, when the assertion gets invalidated, it will
        invalidate all these pending activities and we'll see in the logs the name of the activities that
        were still going on upon invalidation.

        * Shared/API/Cocoa/RemoteObjectRegistry.h:
        (WebKit::RemoteObjectRegistry::backgroundActivity):
        * Shared/API/Cocoa/RemoteObjectRegistry.mm:
        (WebKit::RemoteObjectRegistry::sendInvocation):
        * UIProcess/Cocoa/DownloadClient.h:
        * UIProcess/Cocoa/DownloadClient.mm:
        (WebKit::DownloadClient::takeActivityToken):
        (WebKit::DownloadClient::releaseActivityTokenIfNecessary):
        * UIProcess/Cocoa/NavigationState.h:
        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::NavigationState):
        (WebKit::NavigationState::releaseNetworkActivity):
        (WebKit::NavigationState::didChangeIsLoading):
        (WebKit::NavigationState::didSwapWebProcesses):
        * UIProcess/Cocoa/UIRemoteObjectRegistry.cpp:
        (WebKit::UIRemoteObjectRegistry::backgroundActivity):
        * UIProcess/Cocoa/UIRemoteObjectRegistry.h:
        * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
        (WebKit::WebProcessProxy::processWasResumed):
        * UIProcess/GenericCallback.h:
        (WebKit::CallbackBase::CallbackBase):
        (WebKit::GenericCallback::create):
        (WebKit::GenericCallback::GenericCallback):
        (WebKit::CallbackMap::put):
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::fetchWebsiteData):
        (WebKit::NetworkProcessProxy::deleteWebsiteData):
        (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins):
        (WebKit::NetworkProcessProxy::didClose):
        (WebKit::NetworkProcessProxy::setIsHoldingLockedFiles):
        (WebKit::NetworkProcessProxy::syncAllCookies):
        (WebKit::NetworkProcessProxy::didSyncAllCookies):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/ProcessThrottler.cpp:
        (WebKit::ProcessThrottler::ProcessThrottler):
        (WebKit::ProcessThrottler::~ProcessThrottler):
        (WebKit::ProcessThrottler::addActivity):
        (WebKit::ProcessThrottler::removeActivity):
        (WebKit::ProcessThrottler::invalidateAllActivities):
        (WebKit::ProcessThrottler::expectedAssertionState):
        (WebKit::ProcessThrottler::setAssertionState):
        (WebKit::ProcessThrottler::uiAssertionWillExpireImminently):
        * UIProcess/ProcessThrottler.h:
        (WebKit::ProcessThrottler::Activity::Activity):
        (WebKit::ProcessThrottler::Activity::~Activity):
        (WebKit::ProcessThrottler::Activity::isValid const):
        (WebKit::ProcessThrottler::Activity::invalidate):
        (WebKit::ProcessThrottler::shouldBeRunnable const):
        (WebKit::ProcessThrottler::foregroundActivity):
        (WebKit::ProcessThrottler::backgroundActivity):
        * UIProcess/ProvisionalPageProxy.cpp:
        (WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
        * UIProcess/ProvisionalPageProxy.h:
        * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
        (WebKit::RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing):
        * UIProcess/SuspendedPageProxy.cpp:
        (WebKit::SuspendedPageProxy::SuspendedPageProxy):
        (WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
        * UIProcess/SuspendedPageProxy.h:
        * UIProcess/WebBackForwardCacheEntry.cpp:
        (WebKit::WebBackForwardCacheEntry::~WebBackForwardCacheEntry):
        * UIProcess/WebCookieManagerProxy.cpp:
        (WebKit::WebCookieManagerProxy::getHostnamesWithCookies):
        (WebKit::WebCookieManagerProxy::deleteCookie):
        (WebKit::WebCookieManagerProxy::deleteAllCookiesModifiedSince):
        (WebKit::WebCookieManagerProxy::setCookies):
        (WebKit::WebCookieManagerProxy::getAllCookies):
        (WebKit::WebCookieManagerProxy::getCookies):
        (WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy):
        (WebKit::WebCookieManagerProxy::getHTTPCookieAcceptPolicy):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::close):
        (WebKit::WebPageProxy::updateThrottleState):
        (WebKit::WebPageProxy::waitForDidUpdateActivityState):
        (WebKit::WebPageProxy::setInitialFocus):
        (WebKit::WebPageProxy::validateCommand):
        (WebKit::WebPageProxy::executeEditCommand):
        (WebKit::WebPageProxy::requestFontAttributesAtSelectionStart):
        (WebKit::WebPageProxy::replaceMatches):
        (WebKit::WebPageProxy::runJavaScriptInMainFrameScriptWorld):
        (WebKit::WebPageProxy::runJavaScriptInFrame):
        (WebKit::WebPageProxy::getRenderTreeExternalRepresentation):
        (WebKit::WebPageProxy::getSourceForFrame):
        (WebKit::WebPageProxy::getContentsAsString):
        (WebKit::WebPageProxy::getBytecodeProfile):
        (WebKit::WebPageProxy::getSamplingProfilerOutput):
        (WebKit::WebPageProxy::getContentsAsMHTMLData):
        (WebKit::WebPageProxy::getSelectionOrContentsAsString):
        (WebKit::WebPageProxy::getSelectionAsWebArchiveData):
        (WebKit::WebPageProxy::getMainResourceDataOfFrame):
        (WebKit::WebPageProxy::getResourceDataFromFrame):
        (WebKit::WebPageProxy::getWebArchiveOfFrame):
        (WebKit::WebPageProxy::forceRepaint):
        (WebKit::WebPageProxy::resetStateAfterProcessExited):
        (WebKit::WebPageProxy::drawToPDF):
        (WebKit::WebPageProxy::getMarkedRangeAsync):
        (WebKit::WebPageProxy::getSelectedRangeAsync):
        (WebKit::WebPageProxy::characterIndexForPointAsync):
        (WebKit::WebPageProxy::firstRectForCharacterRangeAsync):
        (WebKit::WebPageProxy::takeSnapshot):
        (WebKit::WebPageProxy::installActivityStateChangeCompletionHandler):
        (WebKit::WebPageProxy::getLoadDecisionForIcon):
        (WebKit::WebPageProxy::insertAttachment):
        (WebKit::WebPageProxy::updateAttachmentAttributes):
        (WebKit::WebPageProxy::getApplicationManifest):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::initializeNewWebProcess):
        (WebKit::WebProcessPool::updateProcessAssertions):
        (WebKit::WebProcessPool::reinstateNetworkProcessAssertionState):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::shutDown):
        (WebKit::WebProcessProxy::fetchWebsiteData):
        (WebKit::WebProcessProxy::deleteWebsiteData):
        (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins):
        (WebKit::WebProcessProxy::setIsHoldingLockedFiles):
        (WebKit::WebProcessProxy::startBackgroundActivityForFullscreenInput):
        (WebKit::WebProcessProxy::endBackgroundActivityForFullscreenInput):
        * UIProcess/WebProcessProxy.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView presentViewControllerForCurrentFocusedElement]):
        (-[WKContentView dismissAllInputViewControllers:]):
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::requestFocusedElementInformation):
        (WebKit::WebPageProxy::selectWithGesture):
        (WebKit::WebPageProxy::updateSelectionWithTouches):
        (WebKit::WebPageProxy::applyAutocorrection):
        (WebKit::WebPageProxy::selectTextWithGranularityAtPoint):
        (WebKit::WebPageProxy::selectPositionAtBoundaryWithDirection):
        (WebKit::WebPageProxy::moveSelectionAtBoundaryWithDirection):
        (WebKit::WebPageProxy::selectPositionAtPoint):
        (WebKit::WebPageProxy::beginSelectionInDirection):
        (WebKit::WebPageProxy::updateSelectionWithExtentPoint):
        (WebKit::WebPageProxy::updateSelectionWithExtentPointAndBoundary):
        (WebKit::WebPageProxy::requestDictationContext):
        (WebKit::WebPageProxy::getSelectionContext):
        (WebKit::WebPageProxy::selectWithTwoTouches):
        (WebKit::WebPageProxy::applicationDidEnterBackground):
        (WebKit::WebPageProxy::requestRectsForGranularityWithSelectionOffset):
        (WebKit::WebPageProxy::requestRectsAtSelectionOffsetWithText):
        (WebKit::WebPageProxy::moveSelectionByOffset):
        (WebKit::WebPageProxy::focusNextFocusedElement):
        (WebKit::WebPageProxy::computePagesForPrintingAndDrawToPDF):

2019-10-30  Carlos Garcia Campos  <cgarcia@igalia.com>

        REGRESSION(2.27.2): [GTK] Overview item remove button broken
        https://bugs.webkit.org/show_bug.cgi?id=203461

        Reviewed by Adrian Perez de Castro.

        This is a regression of the switch to new custom protocols implementation. Epiphany is passing NULL as content
        type of ephy-resource requests, in which case we should try to guess the mime type, but we are not doing it.

        * UIProcess/API/glib/WebKitURISchemeRequest.cpp:
        (webkitURISchemeRequestReadCallback): Use MIMETypeRegistry to guess the mime type when content type is nullptr,
        like NetworkDataTask does.

2019-10-29  Andy Estes  <aestes@apple.com>

        [Quick Look] Clean up LegacyPreviewLoaderClients
        https://bugs.webkit.org/show_bug.cgi?id=203472

        Reviewed by Brady Eidson.

        Replaced QuickLookDocumentData with ShareableResource.

        Removed messages WebPageProxy::DidRequestPasswordForQuickLookDocumentInMainFrame and
        WebPage::DidReceivePasswordForQuickLookDocument, replacing them with async message
        WebPageProxy::RequestPasswordForQuickLookDocumentInMainFrame.

        * Shared/ios/QuickLookDocumentData.cpp: Removed.
        * Shared/ios/QuickLookDocumentData.h: Removed.
        * SourcesCocoa.txt:
        * UIProcess/API/APILoaderClient.h:
        * UIProcess/API/APINavigationClient.h:
        (API::NavigationClient::didFinishLoadForQuickLookDocumentInMainFrame):
        * UIProcess/Cocoa/NavigationState.h:
        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::NavigationClient::didFinishLoadForQuickLookDocumentInMainFrame):
        * UIProcess/ProvisionalPageProxy.cpp:
        (WebKit::ProvisionalPageProxy::requestPasswordForQuickLookDocumentInMainFrame):
        (WebKit::ProvisionalPageProxy::didReceiveMessage):
        (WebKit::ProvisionalPageProxy::didRequestPasswordForQuickLookDocumentInMainFrame): Deleted.
        * UIProcess/ProvisionalPageProxy.h:
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::didFinishLoadForQuickLookDocumentInMainFrame):
        (WebKit::WebPageProxy::requestPasswordForQuickLookDocumentInMainFrame):
        (WebKit::WebPageProxy::requestPasswordForQuickLookDocumentInMainFrameShared):
        (WebKit::WebPageProxy::didRequestPasswordForQuickLookDocumentInMainFrame): Deleted.
        (WebKit::WebPageProxy::didRequestPasswordForQuickLookDocumentInMainFrameShared): Deleted.
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebCoreSupport/ios/WebPreviewLoaderClient.cpp:
        (WebKit::WebPreviewLoaderClient::WebPreviewLoaderClient):
        (WebKit::WebPreviewLoaderClient::didReceiveBuffer):
        (WebKit::WebPreviewLoaderClient::didFinishLoading):
        (WebKit::WebPreviewLoaderClient::didFail):
        (WebKit::WebPreviewLoaderClient::didRequestPassword):
        (WebKit::passwordCallbacks): Deleted.
        (WebKit::WebPreviewLoaderClient::~WebPreviewLoaderClient): Deleted.
        (WebKit::WebPreviewLoaderClient::didReceiveDataArray): Deleted.
        (WebKit::WebPreviewLoaderClient::didReceivePassword): Deleted.
        * WebProcess/WebCoreSupport/ios/WebPreviewLoaderClient.h:
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::didStartLoadForQuickLookDocumentInMainFrame):
        (WebKit::WebPage::didFinishLoadForQuickLookDocumentInMainFrame):
        (WebKit::WebPage::requestPasswordForQuickLookDocumentInMainFrame):
        (WebKit::WebPage::didReceivePasswordForQuickLookDocument): Deleted.

2019-10-29  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthn] Add more information to _WKWebAuthenticationPanel
        https://bugs.webkit.org/show_bug.cgi?id=202561
        <rdar://problem/55973910>

        Reviewed by Youenn Fablet and Brent Fulgham.

        This change adds transports and type to _WKWebAuthenticationPanel such that
        clients can know what transport the current ceremony demands and the type of
        the current ceremony. These extra information allow clients to give users
        more specific instructions to interact with authenticators.

        To pass transports to client, the way how them is collected is changed significantly:
        1) The timing is moved to runPanel before the client delegate call.
        2) NfcService::isAvailable is added for AuthenticatorManager to determine if NFC
        is available in the current device.
        3) AuthenticatorManager::filterTransports is added to filter transports requested
        by RP to ones that are available. This process is handled by each service naturally
        before.
        4) AuthenticatorManager::startRequest is now being splitted into AuthenticatorManager::handleRequest,
        AuthenticatorManager::runPanel and AuthenticatorManager::getTransports.

        To pass type to _WKWebAuthenticationPanel, ClientDataType is moved from
        WebCore::AuthenticatorCoordinator to WebCore::WebAuthenticationConstants in
        order to be reused to indicate the ceremony type.

        * UIProcess/API/APIWebAuthenticationPanel.cpp:
        (API::WebAuthenticationPanel::create):
        (API::WebAuthenticationPanel::WebAuthenticationPanel):
        * UIProcess/API/APIWebAuthenticationPanel.h:
        * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.h:
        * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm:
        (-[_WKWebAuthenticationPanel relyingPartyID]):
        (wkWebAuthenticationTransport):
        (-[_WKWebAuthenticationPanel transports]):
        (wkWebAuthenticationType):
        (-[_WKWebAuthenticationPanel type]):
        * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
        (WebKit::WebCore::collectTransports):
        (WebKit::WebCore::getClientDataType):
        (WebKit::AuthenticatorManager::handleRequest):
        (WebKit::AuthenticatorManager::filterTransports const):
        (WebKit::AuthenticatorManager::startDiscovery):
        (WebKit::AuthenticatorManager::initTimeOutTimer):
        (WebKit::AuthenticatorManager::runPanel):
        (WebKit::AuthenticatorManager::getTransports const):
        (WebKit::AuthenticatorManager::respondReceivedInternal): Deleted.
        (WebKit::AuthenticatorManager::startRequest): Deleted.
        * UIProcess/WebAuthentication/AuthenticatorManager.h:
        (WebKit::AuthenticatorManager::respondReceivedInternal):
        * UIProcess/WebAuthentication/Cocoa/NfcService.h:
        * UIProcess/WebAuthentication/Cocoa/NfcService.mm:
        (WebKit::NfcService::isAvailable):
        (WebKit::NfcService::platformStartDiscovery):
        * UIProcess/WebAuthentication/Mock/MockAuthenticatorManager.cpp:
        (WebKit::MockAuthenticatorManager::filterTransports const):
        * UIProcess/WebAuthentication/Mock/MockAuthenticatorManager.h:

2019-10-29  Wenson Hsieh  <wenson_hsieh@apple.com>

        REGRESSION (r251693): [iOS] Unable to change selection in a focused element if the element's bounds change
        https://bugs.webkit.org/show_bug.cgi?id=203582

        Reviewed by Tim Horton.

        The refactoring in r251693 broke the ability to change selection in an editable area by tapping in iOS Safari,
        in the case where the editable element's bounds change after focus. This is because the aforementioned change
        now compares position informations' element context against the focused element information's element context to
        check whether or not the position information request was inside the focused element. However, if the bounds of
        the focused element change in between the position information request and when the element is initially
        focused, the `operator==` comparison will fail, causing us to prevent text selection.

        To fix this, only check whether or not the two element contexts refer to the same element in the DOM by
        comparing page, document and element identifiers, but not the element's bounding rect.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _didGetTapHighlightForRequest:color:quads:topLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:nodeHasBuiltInClickHandling:]):
        (-[WKContentView gestureRecognizerShouldBegin:]):
        (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):

2019-10-07  Jer Noble  <jer.noble@apple.com>

        Implement the Remote Playback API.
        https://bugs.webkit.org/show_bug.cgi?id=162971

        Reviewed by Youenn Fablet.

        Add a preference to enable the Remote Playback API. Pass the playbackTargetPickerWasDismissed()
        notification on to Page.

        * Shared/WebPreferencesDefinitions.h:
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesGetRemotePlaybackEnabled):
        (WKPreferencesSetRemotePlaybackEnabled):
        * UIProcess/API/C/WKPreferencesRef.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::playbackTargetPickerWasDismissed):
        * UIProcess/WebPageProxy.h:
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::mockMediaPlaybackTargetPickerDismissPopup):
        * WebProcess/WebCoreSupport/WebChromeClient.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::updatePreferences):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/mac/WebPageMac.mm:
        (WebKit::WebPage::playbackTargetPickerWasDismissed):

2019-10-29  Per Arne Vollan  <pvollan@apple.com>

        REGRESSION: WebContent getting killed due to syscall filter violation
        https://bugs.webkit.org/show_bug.cgi?id=203575

        Reviewed by Alexey Proskuryakov.

        The sandbox profile on macOS needs to open up for a syscall.

        No new tests, covered by existing tests.

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

2019-10-29  Brent Fulgham  <bfulgham@apple.com>

        [iOS] Clean up sandbox to group similar rules together 
        https://bugs.webkit.org/show_bug.cgi?id=203525
        <rdar://problem/56686416>

        Reviewed by Per Arne Vollan.

        Clean up the sandbox rules by grouping rules by feature areas to make future editing easier.
        This change should have no impact on behavior.

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

2019-10-29  Myles C. Maxfield  <mmaxfield@apple.com>

        REGRESSION (r251413): Nightly build crashes on launch due to -[WKPreferences _setShouldAllowDesignSystemUIFonts:]: unrecognized selector
        https://bugs.webkit.org/show_bug.cgi?id=203549

        Reviewed by Simon Fraser.

        r251413 deleted an SPI that new Safari stopped calling. However,
        old Safari continues to call it. The solution is just to add stub
        implementations so old Safari doesn't fail to link at runtime.

        * UIProcess/API/Cocoa/WKPreferences.mm:
        (-[WKPreferences _shouldAllowDesignSystemUIFonts]):
        (-[WKPreferences _setShouldAllowDesignSystemUIFonts:]):
        * UIProcess/API/Cocoa/WKPreferencesPrivate.h:

2019-10-27  Wenson Hsieh  <wenson_hsieh@apple.com>

        Add enterkeyhint support
        https://bugs.webkit.org/show_bug.cgi?id=189546
        <rdar://problem/51021148>

        Reviewed by Tim Horton.

        This patch adds support for the enterkeyhint HTML attribute on iOS.

        Tests:  EnterKeyHintTests.EnterKeyHintInContentEditableElement
                EnterKeyHintTests.EnterKeyHintInTextInput
                EnterKeyHintTests.EnterKeyHintInTextArea

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

        Add a new flag to FocusedElementInformation to indicate the EnterKeyHint type that should be used when bringing
        up an input view for the focused element.

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

        Map the given EnterKeyHint type to a UIReturnKeyType. If an unsupported (i.e. "previous") or default
        EnterKeyHint value is used, then we fall back to existing behavior which deduces the default enterkeyhint value
        from the input type if the focused element is inside an actionable form; otherwise, we avoid setting any value
        for the `returnKeyType`, defaulting to `UIReturnKeyDefault`.

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

2019-10-29  Kate Cheney  <katherine_cheney@apple.com>

        Layout Test http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration-database.html is a flaky failure
        https://bugs.webkit.org/show_bug.cgi?id=203542#add_comment
        <rdar://problem/56689764>

        Reviewed by John Wilander.

        This test was a flaky failure due to its calling
        scheduleStatisticsProcessingRequestIfNecessary() after logging a cross
        site load with link decoration. This call is currently unecessary
        because this function is not yet used to classify resources, and is
        causing the test to execute a callback before it is ready.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:

2019-10-29  Truitt Savell  <tsavell@apple.com>

        Unreviewed, rolling out r251639.

        Caused flakey API failures for GetDisplayMediaTest.Constraints

        Reverted changeset:

        "Enforce user gesture for getUserMedia in case a previous
        getUserMedia call was denied"
        https://bugs.webkit.org/show_bug.cgi?id=203362
        https://trac.webkit.org/changeset/251639

2019-10-29  Truitt Savell  <tsavell@apple.com>

        Unreviewed, rolling out r251646.

        Caused flakey API failures for GetDisplayMediaTest.Constraints

        Reverted changeset:

        "Unreviewed build fix for !ENABLE(MEDIA_STREAM) builds"
        https://bugs.webkit.org/show_bug.cgi?id=203362
        https://trac.webkit.org/changeset/251646

2019-10-29  Chris Dumez  <cdumez@apple.com>

        Unreviewed, rolling out r251594.

        Caused an API test failure

        Reverted changeset:

        "mp4 video element broken with service worker"
        https://bugs.webkit.org/show_bug.cgi?id=184447
        https://trac.webkit.org/changeset/251594        

2019-10-29  Chris Dumez  <cdumez@apple.com>

        Notification permissions are not remembered for origins without port
        https://bugs.webkit.org/show_bug.cgi?id=203537
        <rdar://problem/55281080>

        Reviewed by Brady Eidson.

        When WKSecurityOriginCreate() gets called with a port that is invalid, then pass
        WTF::nullopt to construct the security origin instead of the invalid port.

        The issue is that the port for security origins is optional internally. However,
        our API (WKSecurityOriginGetPort() & WKSecurityOrigin.port) will return 0 when
        there is no port. As a result, clients such as Safari sometimes pass 0 as port to construct
        a new WKSecurityOriginRef().

        This was causing issues with regards to notifications because Safari would construct
        origins whose string representation looks like "https://www.apple.com:0" and it would
        not match the "https://www.apple.com" we expect internally.

        * Shared/API/c/WKSecurityOriginRef.cpp:
        (WKSecurityOriginCreate):

2019-10-29  Adrian Perez de Castro  <aperez@igalia.com>

        Unreviewed. Update OptionsWPE.cmake and NEWS for the 2.27.2 release

        * wpe/NEWS: Add release notes for 2.27.2.

2019-10-28  Wenson Hsieh  <wenson_hsieh@apple.com>

        Replace InteractionInformationAtPosition.nodeAtPositionIsFocusedElement with an element context
        https://bugs.webkit.org/show_bug.cgi?id=203498

        Reviewed by Tim Horton.

        Refactors InteractionInformationAtPosition, such that it doesn't need a special flag to indicate whether there
        is a focused element at the position. This is a followup to webkit.org/b/203264; no new tests, as there should
        be no change in behavior.

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

        Add an elementContext to FocusedElementInformation to represent the focused element; then, instead of checking
        whether there is a focused element underneath the request position, simply check that the position information's
        element context matches the FocusedElementInformation's element context.

        Additionally, rename elementRect in FocusedElementInformation to interactionRect, to draw a distinction between
        this rect and the new ElementContext's boundingRect.

        * Shared/ios/InteractionInformationAtPosition.h:
        * Shared/ios/InteractionInformationAtPosition.mm:
        (WebKit::InteractionInformationAtPosition::encode const):
        (WebKit::InteractionInformationAtPosition::decode):

        Remove the nodeAtPositionIsFocusedElement flag.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _didGetTapHighlightForRequest:color:quads:topLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:nodeHasBuiltInClickHandling:]):
        (-[WKContentView _zoomToRevealFocusedElement]):
        (-[WKContentView _selectionClipRect]):
        (-[WKContentView gestureRecognizerShouldBegin:]):
        (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):

        In various places that consult nodeAtPositionIsFocusedElement, instead check that the position information's
        hit-tested element context is the same as the focused element, via FocusedElementInformation.

        (-[WKContentView _didCommitLoadForMainFrame]):

        Nuke the cached position information data upon navigation; without this tweak, we will fail when running several
        iOS layout tests back-to-back, that tap in exactly the same location.

        (rectToRevealWhenZoomingToFocusedElement):
        (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:activityStateChanges:userObject:]):
        (-[WKContentView _elementDidBlur]):
        (-[WKContentView rectForFocusedFormControlView:]):
        (-[WKContentView _didChangeFocusedElementRect:toRect:]): Deleted.

        Remove code to invalidate cached position information when changing the focused element rect.

        * UIProcess/ios/forms/WKFormPopover.mm:
        (-[WKRotatingPopover presentPopoverAnimated:]):
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::positionInformation):
        (WebKit::WebPage::getFocusedElementInformation):

2019-10-28  Adrian Perez de Castro  <aperez@igalia.com>

        [GTK][WPE] Fix various non-unified build issues introduced since r251436
        https://bugs.webkit.org/show_bug.cgi?id=203492

        Reviewed by Alex Christensen and Mark Lam.

        * UIProcess/InspectorTargetProxy.h: Add forward declaration of ProvisionalPageProxy.
        * UIProcess/Plugins/PluginProcessProxy.cpp: Add missin inclusion of
        WebProcessProxyMessages.h
        * UIProcess/ProcessThrottler.cpp: Add missing inclusion of wtf/CompletionHandler.h
        * UIProcess/ProvisionalPageProxy.h: Add missing inclusion of WebCore/FrameIdentifier.h
        * UIProcess/WebPageInspectorController.h: Add missing inclusion of WebCore/PageIdentifier.h
        * WebProcess/WebPage/WebPageInspectorTargetController.cpp: Add missing inclusion of
        WebPageInspectorTargetFrontendChannel.h

2019-10-28  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Fix sandbox violations
        https://bugs.webkit.org/show_bug.cgi?id=203505

        Reviewed by Brent Fulgham.

        Running layout tests shows that allowing mach lookup is needed for a set of services which was previously denied.
        This patch add rules for allowing these services again. The service 'com.apple.logd.events' is still denied, since
        it has not been observed to be in use.

        No new tests, covered by existing tests.

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

2019-10-28  Alex Christensen  <achristensen@webkit.org>

        Unreviewed, rolling out r251675.

        Broke some builds

        Reverted changeset:

        "Remove unused WKWebsiteDataStore setter SPI"
        https://bugs.webkit.org/show_bug.cgi?id=203114
        https://trac.webkit.org/changeset/251675

2019-10-28  Wenson Hsieh  <wenson_hsieh@apple.com>

        Add bindings support for the enterkeyhint HTML attribute
        https://bugs.webkit.org/show_bug.cgi?id=203440

        Reviewed by Ryosuke Niwa.

        Add a new runtime switch for the enterkeyhint attribute, and enable it by default on macOS and iOS.

        * Shared/WebPreferences.yaml:
        * Shared/WebPreferencesDefaultValues.h:

2019-10-28  Alex Christensen  <achristensen@webkit.org>

        Remove unused _WKProcessPoolConfiguration SPI
        https://bugs.webkit.org/show_bug.cgi?id=203066

        Reviewed by Youenn Fablet.

        After rdar://problem/56260478 this is not used, so away it goes!

        * NetworkProcess/NetworkProcess.h:
        (WebKit::NetworkProcess::suppressesConnectionTerminationOnSystemChange const): Deleted.
        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
        (WebKit::NetworkProcessCreationParameters::decode):
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
        * NetworkProcess/cocoa/NetworkSessionCocoa.h:
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
        (WebKit::globalCTDataConnectionServiceType): Deleted.
        (WebKit::NetworkSessionCocoa::ctDataConnectionServiceType const): Deleted.
        (WebKit::NetworkSessionCocoa::setCTDataConnectionServiceType): Deleted.
        * NetworkProcess/ios/NetworkConnectionToWebProcessIOS.mm:
        (WebKit::NetworkConnectionToWebProcess::paymentCoordinatorCTDataConnectionServiceType):
        * UIProcess/API/APIProcessPoolConfiguration.cpp:
        (API::ProcessPoolConfiguration::copy):
        * UIProcess/API/APIProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
        (-[_WKProcessPoolConfiguration suppressesConnectionTerminationOnSystemChange]): Deleted.
        (-[_WKProcessPoolConfiguration setSuppressesConnectionTerminationOnSystemChange:]): Deleted.
        (-[_WKProcessPoolConfiguration CTDataConnectionServiceType]): Deleted.
        (-[_WKProcessPoolConfiguration setCTDataConnectionServiceType:]): Deleted.
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeNetworkProcess):
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::paymentCoordinatorCTDataConnectionServiceType):

2019-10-28  Alex Christensen  <achristensen@webkit.org>

        Remove unused WKWebsiteDataStore setter SPI
        https://bugs.webkit.org/show_bug.cgi?id=203114

        Reviewed by Anders Carlsson.

        They have been replaced by _WKWebsiteDataStoreConfiguration SPI which was adopted in rdar://problem/56349165

        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _setBoundInterfaceIdentifier:]): Deleted.
        (-[WKWebsiteDataStore _boundInterfaceIdentifier]): Deleted.
        (-[WKWebsiteDataStore _setAllowsCellularAccess:]): Deleted.
        (-[WKWebsiteDataStore _allowsCellularAccess]): Deleted.
        (-[WKWebsiteDataStore _setProxyConfiguration:]): Deleted.
        (-[WKWebsiteDataStore _proxyConfiguration]): Deleted.
        * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        (WebKit::WebsiteDataStore::setBoundInterfaceIdentifier): Deleted.
        (WebKit::WebsiteDataStore::setAllowsCellularAccess): Deleted.
        (WebKit::WebsiteDataStore::setProxyConfiguration): Deleted.

2019-10-28  Brady Eidson  <beidson@apple.com>

        Expose _printOperationWithPrintInfo: SPI as API
        <rdar://problem/36557179> and https://bugs.webkit.org/show_bug.cgi?id=203496

        Reviewed by Andy Estes.

        * UIProcess/API/Cocoa/WKWebView.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView printOperationWithPrintInfo:]):
        (-[WKWebView _printOperationWithPrintInfo:]):

2019-10-28  Kate Cheney  <katherine_cheney@apple.com>

        Layout Test http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration.html is a flaky failure
        https://bugs.webkit.org/show_bug.cgi?id=203491
        <rdar://problem/56674176>

        Reviewed by Chris Dumez.

        No new tests, this change is tested by the existing resourceLoadStatistics
        tests.

        This test started flaking when a new memory store was being created
        between tests to maintain consistency. The call to grandfatherExistingWebsiteData
        from populateMemoryStoreFromDisk in the persistent storage was
        async, causing a race condition that led to occasional failures.
        Adding a completion handler and changing the callsite of
        populateMemoryStoreFromDisk should fix this problem.

        * NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.cpp:
        (WebKit::ResourceLoadStatisticsPersistentStorage::ResourceLoadStatisticsPersistentStorage):
        * NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.h:
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
        The persistent store in the databaseEnabled case was never being used
        and is unnecessary.

        (WebKit::WebResourceLoadStatisticsStore::populateMemoryStoreFromDisk):
        Since persistent storage only exists when using the memory store,
        populateMemoryStoreFromDisk should check if
        m_persistentStorage has been initialized.

        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::setUseITPDatabase):
        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::setResourceLoadStatisticsEnabled):
        (WebKit::NetworkSession::recreateResourceLoadStatisticStore):
        * NetworkProcess/NetworkSession.h:

2019-10-28  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] 3 editing/pasteboard/smart-paste-paragraph-* tests are flaky
        https://bugs.webkit.org/show_bug.cgi?id=203264
        <rdar://problem/56512107>

        Reviewed by Tim Horton.

        Fixes several flaky layout tests that exercise a corner case in our logic for caching position information
        responses in the UI process. When focusing an element via a tap, we send a position information request for the
        tap location in -_webTouchEventsRecognized:. After the web process computes the information and hands it back to
        the UI process, we cache this in WKContentView's _positionInformation.

        However, at the time of computing the request, the tapped element has not been focused yet, so the value of the
        position information's nodeAtPositionIsFocusedElement flag is false. After the tap is recognized, we'll then
        focus the element, such that if a subsequent position information request were to arrive at the same location,
        it would have a nodeAtPositionIsFocusedElement flag set to true.

        In this state, if the user taps _exactly_ at the same location again, UIKit (through text interaction gestures)
        will ask us for information at the same point; we will end up using the cached information, for which
        nodeAtPositionIsFocusedElement is false, causing us to incorrectly prevent the text interaction. In this
        particular case, we fail to select text via a double tap gesture.

        To address this, we invalidate the cached position information in the UI process whenever the focused element
        rect changes (e.g. when the focused element changes); the only exception to this is when the previously cached
        position information was not over the focused element, and the new focused element rect is empty, in which case
        the value of nodeAtPositionIsFocusedElement is guaranteed to have not changed.

        While this may potentially leads to an additional synchronous position information request when tapping at the
        same location after focusing an element, this is very difficult to achieve in practice, since the tap location
        would need to be _exactly_ at the same location.

        No new test, since this is exercised by existing flaky layout tests.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:activityStateChanges:userObject:]):
        (-[WKContentView _elementDidBlur]):

        Also, add a FIXME about how we clear out surprisingly little of _focusedElementInformation when blurring the
        focused element.

        (-[WKContentView _didChangeFocusedElementRect:toRect:]):

2019-10-28  John Wilander  <wilander@apple.com>

        Storage Access API: Make the API work with the experimental 3rd-party cookie blocking
        https://bugs.webkit.org/show_bug.cgi?id=203428
        <rdar://problem/56626949>

        Reviewed by Alex Christensen.

        Tests: http/tests/storageAccess/deny-due-to-no-interaction-under-general-third-party-cookie-blocking.html
               http/tests/storageAccess/grant-with-prompt-under-general-third-party-cookie-blocking.html
               http/tests/storageAccess/has-storage-access-under-general-third-party-cookie-blocking-with-cookie.html
               http/tests/storageAccess/has-storage-access-under-general-third-party-cookie-blocking-without-cookie.html

        This patch adds Storage Access API support for the experimental 3rd-party cookie blocking that
        landed in <https://trac.webkit.org/changeset/251467>.

        There are three policies at play because it can be changed with the experimental setting:
        1. The underlying cookie policy.
        2. Shipping ITP.
        3. The off by default, experimental 3rd-party cookie blocking.

        To support them all, a CookieAccess enum was added to encode how the API should respond.
        The enum has these values:
        CannotRequest - This third-party cannot request storage access based on the current policy.
        BasedOnCookiePolicy – This third-party should be treated according to the underlying cookie policy.
        OnlyIfGranted – This third-party can and must get access through the Storage Access API.

        Here's the truth table I used to work through the logic for both
        document.hasStorageAccess() and document.requestStorageAccess():

        Access  | Is        | User        | Has    | 3rd-party    |        |
        granted | prevalent | interaction | cookie | cookie block | RESULT |
        -------------------------------------------------------------------
        |       |           |             |        |              | false  |
        -------------------------------------------------------------------
        |       |           |             |        | true         | false  |
        -------------------------------------------------------------------
        |       |           |             | true   |              | true   |
        -------------------------------------------------------------------
        |       |           |             | true   | true         | false  |
        -------------------------------------------------------------------
        |       |           | true        |        |              | false  |
        -------------------------------------------------------------------
        |       |           | true        |        | true         | false  |
        -------------------------------------------------------------------
        |       |           | true        | true   |              | true   |
        -------------------------------------------------------------------
        |       |           | true        | true   | true         | false  |
        -------------------------------------------------------------------
        |       | true      | !care       | !care  | !care        | false  |
        -------------------------------------------------------------------
        | true  | !care     | !care       | !care  | !care        | true   |
        -------------------------------------------------------------------

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        (WebKit::ResourceLoadStatisticsDatabaseStore::cookieAccess const):
        (WebKit::ResourceLoadStatisticsDatabaseStore::hasStorageAccess):
        (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccess):
        (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccessUnderOpener):
            Extra checks removed since there's no harm in granting access
            to a third-party that already has access by way of the underlying
            cookie policy. Also, this is a temporary compatibility fix.
        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
        (WebKit::ResourceLoadStatisticsMemoryStore::cookieAccess const):
        (WebKit::ResourceLoadStatisticsMemoryStore::hasStorageAccess):
        (WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccess):
        (WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccessUnderOpener):
            Extra checks removed since there's no harm in granting access
            to a third-party that already has access by way of the underlying
            cookie policy. Also, this is a temporary compatibility fix.
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
        (WebKit::ResourceLoadStatisticsStore::setIsThirdPartyCookieBlockingEnabled):
        (WebKit::ResourceLoadStatisticsStore::isThirdPartyCookieBlockingEnabled const):
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::setIsThirdPartyCookieBlockingEnabled):
            This is now the single path to control this setting in both ITP
            and the network storage session. See comment below.
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::setShouldBlockThirdPartyCookiesForTesting):
        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::setResourceLoadStatisticsEnabled):
        (WebKit::NetworkSession::setIsThirdPartyCookieBlockingEnabled):
            Restructured these so that they are initiated like the rest of the
            parameters and only have a single path for changes so that a
            reset to consistent state resets all the state.
        * NetworkProcess/NetworkSession.h:
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):

2019-10-28  Alex Christensen  <achristensen@webkit.org>

        Remove unused NetworkProcessCreationParameters.urlSchemesRegisteredAsCanDisplayOnlyIfCanRequest
        https://bugs.webkit.org/show_bug.cgi?id=203393

        Reviewed by Chris Dumez.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::initializeNetworkProcess):
        (WebKit::NetworkProcess::registerURLSchemeAsCanDisplayOnlyIfCanRequest const): Deleted.
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
        (WebKit::NetworkProcessCreationParameters::decode):
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):
        (WebKit::WebProcessPool::registerURLSchemeAsCanDisplayOnlyIfCanRequest):

2019-10-28  Carlos Alberto Lopez Perez  <clopez@igalia.com>

        [GTK][WPE] Enable CSS typed OM
        https://bugs.webkit.org/show_bug.cgi?id=192875

        Reviewed by Carlos Garcia Campos.

        Enable the runtime feature by default on GTK/WPE when building with
        experimental features enabled.

        Covered by existing tests.

        * Shared/WebPreferences.yaml:
        * Shared/WebPreferencesDefaultValues.h:

2019-10-28  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Simplify the Input Method implementation
        https://bugs.webkit.org/show_bug.cgi?id=203149

        Reviewed by Adrian Perez de Castro.

        * Shared/NativeWebKeyboardEvent.h: Stop using WebCore::CompositionResults.
        (WebKit::NativeWebKeyboardEvent::text const):
        (WebKit::NativeWebKeyboardEvent::handledByInputMethod const):
        (WebKit::NativeWebKeyboardEvent::fakedForComposition const):
        * Shared/gtk/NativeWebKeyboardEventGtk.cpp: Ditto.
        (WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent):
        * Shared/gtk/WebEventFactory.cpp:
        (WebKit::WebEventFactory::createWebKeyboardEvent): Ditto.
        * Shared/gtk/WebEventFactory.h:
        * UIProcess/API/gtk/PageClientImpl.cpp:
        (WebKit::PageClientImpl::doneWithKeyEvent): Updated to use the new name.
        * UIProcess/API/gtk/WebKitWebViewBase.cpp: Stop using WebCore::CompositionResults.
        (webkitWebViewBaseKeyPressEvent):
        (webkitWebViewBaseKeyReleaseEvent):
        * UIProcess/API/gtk/WebKitWebViewBasePrivate.h: Remove unused function.
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::setComposition): Use EditingRange instead of two integers and remove replacement range
        that is unused.
        (WebKit::WebPageProxy::confirmComposition): Remove unused selection range parameters.
        * UIProcess/WebPageProxy.h:
        * UIProcess/gtk/InputMethodFilter.cpp:
        (WebKit::InputMethodFilter::handleKeyboardEvent):
        (WebKit::InputMethodFilter::handleKeyboardEventWithCompositionResults):
        (WebKit::InputMethodFilter::confirmComposition):
        (WebKit::InputMethodFilter::updatePreedit):
        (WebKit::InputMethodFilter::confirmCurrentComposition):
        (WebKit::InputMethodFilter::sendCompositionAndPreeditWithFakeKeyEvents):
        (WebKit::InputMethodFilter::logHandleKeyboardEventForTesting):
        (WebKit::InputMethodFilter::logHandleKeyboardEventWithCompositionResultsForTesting):
        * UIProcess/gtk/InputMethodFilter.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::targetFrameForEditing): Receive a reference instead of a pointer.
        (WebKit::WebPage::confirmComposition): Remove the unused code to handle the selection range.
        (WebKit::WebPage::setComposition): Remove the unused code to handle the replacement range.
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2019-10-27  Fujii Hironori  <Hironori.Fujii@sony.com>

        Unreviewed build fix for !ENABLE(MEDIA_STREAM) builds
        https://bugs.webkit.org/show_bug.cgi?id=203362
        <rdar://problem/56648232>

        * UIProcess/UserMediaPermissionRequestProxy.h: Enclosed isUserGesturePriviledged with #if ENABLE(MEDIA_STREAM).

2019-10-21  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthn] Warn users when multiple NFC tags present
        https://bugs.webkit.org/show_bug.cgi?id=200932
        <rdar://problem/54890736>

        Reviewed by Brent Fulgham.

        This patch utilizes -[_WKWebAuthenticationPanelDelegate panel:updateWebAuthenticationPanel:] to
        inform clients about multiple physical tags are presenting such that clients can instruct users
        to select only one of them physically. Given a physical tag could have multiple different
        interfaces, which NearField will treat them into different NFTags, the tagID is then used to
        identify if there are actually multiple physical tags.

        This patch also adds the ability to restart polling of a partiuclar NFReaderSession to NfcConnection
        and the ability to restart the whole session to NfcService. The former is used to recover from errors
        in the discovery stages, and the latter is used to recover from errors returned from authenticators
        in the request stages. For the latter, given NfcConnection is not awared of the syntax of FIDO2/U2F
        protocol, and CtapAuthenticator/U2fAuthenticator are not awared the transport of the underneath driver.
        A generic restartDiscovery process is added to each service and it is up to the actual service to
        implement the actual process such that AuthenticatorManager can arbitrarily call it after exceptions
        are returned to restart the whole NFC session. To achieve restartDiscovery, NfcConnection is made
        RefCounted as well such that both the NfcService and the CtapNfcDriver could hold it at the same time.
        CtapNfcDriver uses the connection to complete requests as before while NfcService has the new capability
        to use it to stop the current session when restartDiscovery kicks off.

        * Platform/spi/Cocoa/NearFieldSPI.h:
        * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
        (WebKit::AuthenticatorManager::serviceStatusUpdated):
        (WebKit::AuthenticatorManager::respondReceived):
        (WebKit::AuthenticatorManager::restartDiscovery):
        * UIProcess/WebAuthentication/AuthenticatorManager.h:
        * UIProcess/WebAuthentication/AuthenticatorTransportService.cpp:
        (WebKit::AuthenticatorTransportService::startDiscovery):
        (WebKit::AuthenticatorTransportService::restartDiscovery):
        * UIProcess/WebAuthentication/AuthenticatorTransportService.h:
        (WebKit::AuthenticatorTransportService::restartDiscoveryInternal):
        * UIProcess/WebAuthentication/Cocoa/NfcConnection.h:
        * UIProcess/WebAuthentication/Cocoa/NfcConnection.mm:
        (WebKit::NfcConnection::create):
        (WebKit::NfcConnection::NfcConnection):
        (WebKit::NfcConnection::~NfcConnection):
        (WebKit::NfcConnection::stop const):
        (WebKit::NfcConnection::didDetectTags):
        (WebKit::NfcConnection::restartPolling):
        (WebKit::NfcConnection::startPolling):
        (WebKit::NfcConnection::didDetectTags const): Deleted.
        * UIProcess/WebAuthentication/Cocoa/NfcService.h:
        * UIProcess/WebAuthentication/Cocoa/NfcService.mm:
        (WebKit::NfcService::NfcService):
        (WebKit::NfcService::didConnectTag):
        (WebKit::NfcService::didDetectMultipleTags const):
        (WebKit::NfcService::setConnection):
        (WebKit::NfcService::restartDiscoveryInternal):
        (WebKit::NfcService::platformStartDiscovery):
        (WebKit::NfcService::setDriver): Deleted.
        * UIProcess/WebAuthentication/Mock/MockNfcService.h:
        * UIProcess/WebAuthentication/Mock/MockNfcService.mm:
        (-[WKMockNFTag tagID]):
        (-[WKMockNFTag initWithNFTag:]):
        (-[WKMockNFTag dealloc]):
        (-[WKMockNFTag initWithType:]):
        (-[WKMockNFTag initWithType:tagID:]):
        (WebKit::MockNfcService::receiveStopPolling):
        (WebKit::MockNfcService::receiveStartPolling):
        (WebKit::MockNfcService::platformStartDiscovery):
        (WebKit::MockNfcService::detectTags):
        (WebKit::MockNfcService::detectTags const): Deleted.
        * UIProcess/WebAuthentication/fido/CtapNfcDriver.cpp:
        (WebKit::CtapNfcDriver::CtapNfcDriver):
        * UIProcess/WebAuthentication/fido/CtapNfcDriver.h:
        * UIProcess/WebAuthentication/fido/U2fAuthenticator.cpp:

2019-10-26  youenn fablet  <youenn@apple.com>

        Enforce user gesture for getUserMedia in case a previous getUserMedia call was denied
        https://bugs.webkit.org/show_bug.cgi?id=203362

        Reviewed by Eric Carlson.

        In case the request has user gesture priviledge, do not look at denied request history.

        * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
        (WebKit::UserMediaPermissionRequestManagerProxy::getRequestAction):
        * UIProcess/UserMediaPermissionRequestProxy.h:
        (WebKit::UserMediaPermissionRequestProxy::isUserGesturePriviledged const):

2019-10-26  Chris Lord  <clord@igalia.com>

        Put OffscreenCanvas behind a build flag
        https://bugs.webkit.org/show_bug.cgi?id=203146

        Reviewed by Ryosuke Niwa.

        Split the ImageBitmapOffscreenCanvas setting into two separate
        settings so OffscreenCanvas can be disabled at build time.

        * Configurations/FeatureDefines.xcconfig:
        * Shared/WebPreferences.yaml:
        * Shared/WebPreferencesDefaultValues.h:
        * WebProcess/InjectedBundle/InjectedBundle.cpp:
        (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
        * WebProcess/WebPage/WebInspectorUI.cpp:
        (WebKit::WebInspectorUI::WebInspectorUI):

2019-10-25  Chris Dumez  <cdumez@apple.com>

        REGRESSION(r251599): Crash in MobileSafari tests (ASSERTION FAILED: m_pendingRequestToSuspendID)
        https://bugs.webkit.org/show_bug.cgi?id=203437
        <rdar://problem/56633399>

        Reviewed by Geoffrey Garen.

        * UIProcess/ProcessThrottler.cpp:
        (WebKit::ProcessThrottler::updateAssertionIfNeeded):
        Start the timer before sending the PrepareToSuspend IPC. The reason is that if the process has been
        terminated, the completion handler may run synchronously and cancel the request to suspend / stop
        the timer. Therefore, re-starting the timer after would be a mistake.

2019-10-25  David Kilzer  <ddkilzer@apple.com>

        Unused arguments in MESSAGE_CHECK_CONTEXTID() macros
        <https://webkit.org/b/203389>
        <rdar://problem/55935374>

        Reviewed by Alex Christensen.

        * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
        (#define MESSAGE_CHECK_CONTEXTID):
        - Rename macro argument from `contextID` to `identifier`
          and change `contextId`to `identifier` in the body of
          the macro so that the argument is always used.
        (WebKit::PlaybackSessionManagerProxy::setUpPlaybackControlsManagerWithID):
        (WebKit::PlaybackSessionManagerProxy::currentTimeChanged):
        (WebKit::PlaybackSessionManagerProxy::bufferedTimeChanged):
        (WebKit::PlaybackSessionManagerProxy::seekableRangesVectorChanged):
        (WebKit::PlaybackSessionManagerProxy::canPlayFastReverseChanged):
        (WebKit::PlaybackSessionManagerProxy::audioMediaSelectionOptionsChanged):
        (WebKit::PlaybackSessionManagerProxy::legibleMediaSelectionOptionsChanged):
        (WebKit::PlaybackSessionManagerProxy::audioMediaSelectionIndexChanged):
        (WebKit::PlaybackSessionManagerProxy::legibleMediaSelectionIndexChanged):
        (WebKit::PlaybackSessionManagerProxy::externalPlaybackPropertiesChanged):
        (WebKit::PlaybackSessionManagerProxy::wirelessVideoPlaybackDisabledChanged):
        (WebKit::PlaybackSessionManagerProxy::mutedChanged):
        (WebKit::PlaybackSessionManagerProxy::volumeChanged):
        (WebKit::PlaybackSessionManagerProxy::durationChanged):
        (WebKit::PlaybackSessionManagerProxy::playbackStartedTimeChanged):
        (WebKit::PlaybackSessionManagerProxy::rateChanged):
        (WebKit::PlaybackSessionManagerProxy::pictureInPictureSupportedChanged):
        (WebKit::PlaybackSessionManagerProxy::pictureInPictureActiveChanged):
        (WebKit::PlaybackSessionManagerProxy::handleControlledElementIDResponse const):
        - Change `contextID` to `contextId` to match local variable name
          now that MESSAGE_CHECK_CONTEXTID() doesn't paper over this
          typo for us.

        * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
        (#define MESSAGE_CHECK_CONTEXTID):
        - Rename macro argument from `contextID` to `identifier`
          and change `contextId`to `identifier` in the body of
          the macro so that the argument is always used.

        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
        (#define MESSAGE_CHECK_CONTEXTID):
        - Rename macro argument and variable in the body of the
          macro from `id` to `identifier` for consistency.

2019-10-25  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Fix sandbox violations seen while running layout tests
        https://bugs.webkit.org/show_bug.cgi?id=203419

        Reviewed by Brent Fulgham.

        Deny mach lookup to 'com.apple.logd' and 'com.apple.logd.events' and suppress logs, since these are
        believed to be unneeded in the WebContent process. Allow sysctl write to 'vm.footprint_suspend'.
        Deny mach lookup to 'com.apple.system.notification_center' and suppress logs, since allowing this
        is not believed to be needed in the WebContent process.

        No new tests, covered by existing tests.

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

2019-10-25  Matt Lewis  <jlewis3@apple.com>

        Rolling out r251579,r251162,r251512,r251500, and r251498 for build failures
        and test failures

        Unreviewed rollout.

        * Platform/spi/Cocoa/NearFieldSPI.h:
        * UIProcess/API/APIWebAuthenticationPanel.cpp:
        (API::WebAuthenticationPanel::create):
        (API::WebAuthenticationPanel::WebAuthenticationPanel):
        * UIProcess/API/APIWebAuthenticationPanel.h:
        * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.h:
        * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm:
        (-[_WKWebAuthenticationPanel relyingPartyID]):
        (wkWebAuthenticationTransport): Deleted.
        (-[_WKWebAuthenticationPanel transports]): Deleted.
        (wkWebAuthenticationType): Deleted.
        (-[_WKWebAuthenticationPanel type]): Deleted.
        * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
        (WebKit::WebCore::collectTransports):
        (WebKit::AuthenticatorManager::handleRequest):
        (WebKit::AuthenticatorManager::respondReceived):
        (WebKit::AuthenticatorManager::respondReceivedInternal):
        (WebKit::AuthenticatorManager::startDiscovery):
        (WebKit::AuthenticatorManager::initTimeOutTimer):
        (WebKit::AuthenticatorManager::runPanel):
        (WebKit::AuthenticatorManager::startRequest):
        (WebKit::AuthenticatorManager::invokePendingCompletionHandler):
        (WebKit::WebCore::getClientDataType): Deleted.
        (WebKit::AuthenticatorManager::serviceStatusUpdated): Deleted.
        (WebKit::AuthenticatorManager::filterTransports const): Deleted.
        (WebKit::AuthenticatorManager::getTransports const): Deleted.
        (WebKit::AuthenticatorManager::restartDiscovery): Deleted.
        * UIProcess/WebAuthentication/AuthenticatorManager.h:
        (WebKit::AuthenticatorManager::respondReceivedInternal): Deleted.
        * UIProcess/WebAuthentication/AuthenticatorTransportService.cpp:
        (WebKit::AuthenticatorTransportService::startDiscovery):
        (WebKit::AuthenticatorTransportService::restartDiscovery): Deleted.
        * UIProcess/WebAuthentication/AuthenticatorTransportService.h:
        (WebKit::AuthenticatorTransportService::restartDiscoveryInternal): Deleted.
        * UIProcess/WebAuthentication/Cocoa/NfcConnection.h:
        * UIProcess/WebAuthentication/Cocoa/NfcConnection.mm:
        (WebKit::NfcConnection::NfcConnection):
        (WebKit::NfcConnection::~NfcConnection):
        (WebKit::NfcConnection::didDetectTags const):
        (WebKit::NfcConnection::create): Deleted.
        (WebKit::NfcConnection::stop const): Deleted.
        (WebKit::NfcConnection::didDetectTags): Deleted.
        (WebKit::NfcConnection::restartPolling): Deleted.
        (WebKit::NfcConnection::startPolling): Deleted.
        * UIProcess/WebAuthentication/Cocoa/NfcService.h:
        * UIProcess/WebAuthentication/Cocoa/NfcService.mm:
        (WebKit::NfcService::NfcService):
        (WebKit::NfcService::didConnectTag):
        (WebKit::NfcService::setDriver):
        (WebKit::NfcService::platformStartDiscovery):
        (WebKit::NfcService::isAvailable): Deleted.
        (WebKit::NfcService::didDetectMultipleTags const): Deleted.
        (WebKit::NfcService::setConnection): Deleted.
        (WebKit::NfcService::restartDiscoveryInternal): Deleted.
        * UIProcess/WebAuthentication/Mock/MockAuthenticatorManager.cpp:
        (WebKit::MockAuthenticatorManager::filterTransports const): Deleted.
        * UIProcess/WebAuthentication/Mock/MockAuthenticatorManager.h:
        * UIProcess/WebAuthentication/Mock/MockNfcService.h:
        * UIProcess/WebAuthentication/Mock/MockNfcService.mm:
        (-[WKMockNFTag initWithNFTag:]):
        (-[WKMockNFTag dealloc]):
        (-[WKMockNFTag initWithType:]):
        (WebKit::MockNfcService::platformStartDiscovery):
        (WebKit::MockNfcService::detectTags const):
        (-[WKMockNFTag tagID]): Deleted.
        (-[WKMockNFTag initWithType:tagID:]): Deleted.
        (WebKit::MockNfcService::receiveStopPolling): Deleted.
        (WebKit::MockNfcService::receiveStartPolling): Deleted.
        * UIProcess/WebAuthentication/fido/CtapNfcDriver.cpp:
        (WebKit::CtapNfcDriver::CtapNfcDriver):
        * UIProcess/WebAuthentication/fido/CtapNfcDriver.h:
        * UIProcess/WebAuthentication/fido/U2fAuthenticator.cpp:

2019-10-24  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS 13] fast/forms/ios/accessory-bar-navigation.html is a flaky failure
        https://bugs.webkit.org/show_bug.cgi?id=203294
        <rdar://problem/54520848>

        Reviewed by Tim Horton.

        Add an SPI declaration (as well as an internal-SKD-only header import) for UIKeyboardPreferencesController.
        See Tools/ChangeLog for more details.

        * Platform/spi/ios/UIKitSPI.h:

2019-10-24  Ryosuke Niwa  <rniwa@webkit.org>

        Add exclusion rules to text manipulation SPI
        https://bugs.webkit.org/show_bug.cgi?id=203398
        <rdar://problem/56567256>

        Reviewed by Wenson Hsieh.

        Added SPI to specify the configuration for the text manipulation (see r251574), in particular, the set of rules
        governing which content should be excluded or included in text manipulations.

        Test: TextManipulation.StartTextManipulationExitEarlyWithoutDelegate

        * SourcesCocoa.txt:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _startTextManipulationsWithConfiguration:completion:]): Takes _WKTextManipulationConfiguration
        as an argument. Also fixed a bug that we weren't calling the completion handler when the delegate was not set.
        (-[WKWebView _completeTextManipulation:completion:]):
        (-[WKWebView _startTextManipulationsWithCompletionHandler:]): Deleted.
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/API/Cocoa/_WKTextManipulationConfiguration.h: Added.
        * UIProcess/API/Cocoa/_WKTextManipulationConfiguration.mm: Added.
        * UIProcess/API/Cocoa/_WKTextManipulationExclusionRule.h: Added.
        * UIProcess/API/Cocoa/_WKTextManipulationExclusionRule.mm: Added.
        (-[_WKTextManipulationExclusionRule initExclusion:forElement:]): Added.
        (-[_WKTextManipulationExclusionRule initExclusion:forAttribute:value:]): Added.
        (-[_WKTextManipulationExclusionRule elementName]): Added.
        (-[_WKTextManipulationExclusionRule attributeName]): Added.
        (-[_WKTextManipulationExclusionRule attributeValue]): Added.
        * UIProcess/API/Cocoa/_WKTextManipulationToken.h: Added excluded boolean property.
        * UIProcess/API/Cocoa/_WKTextManipulationToken.mm: Removed the superflous import of RetainPtr.h
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::startTextManipulations):
        (WebKit::WebPageProxy::completeTextManipulation):
        * UIProcess/WebPageProxy.h:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::startTextManipulations):
        (WebKit::WebPage::completeTextManipulation):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2019-10-25  Chris Dumez  <cdumez@apple.com>

        [iOS][WK2] Use sendWithAsyncReply() to simplify the prepareToSuspend logic
        https://bugs.webkit.org/show_bug.cgi?id=203422

        Reviewed by Alex Christensen.

        Use sendWithAsyncReply() to simplify the prepareToSuspend logic and make it easier to
        understand.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::processWillSuspendImminentlyForTestingSync):
        (WebKit::NetworkProcess::prepareToSuspend):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _processWillSuspendImminentlyForTesting]):
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::sendPrepareToSuspend):
        (WebKit::NetworkProcessProxy::processReadyToSuspend): Deleted.
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/Network/NetworkProcessProxy.messages.in:
        * UIProcess/ProcessThrottler.cpp:
        (WebKit::ProcessThrottler::processReadyToSuspend):
        (WebKit::ProcessThrottler::sendPrepareToSuspendIPC):
        * UIProcess/ProcessThrottler.h:
        * UIProcess/ProcessThrottlerClient.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::sendPrepareToSuspend):
        (WebKit::WebProcessProxy::processReadyToSuspend): Deleted.
        * UIProcess/WebProcessProxy.h:
        * UIProcess/WebProcessProxy.messages.in:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::prepareToSuspend):
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:

2019-10-25  youenn fablet  <youenn@apple.com>

        WebProcess should unregister its interest for a SWServerRegistration when all its corresponding ServiceWorkerRegistrations are destroyed
        https://bugs.webkit.org/show_bug.cgi?id=203410

        Reviewed by Chris Dumez.

        A SWServerRegistration is keeping a list of web processes that should be notified of change to its state.
        Previously, WebProcesses were registering their interest to a SWServerRegistration on construction of a ServiceWorkerRegistration,
        and unregistering their interest on destruction of a ServiceWorkerRegistration.

        This does not work in case two ServiceWorkerRegistrations are created for the same SWServerRegistration in the same WebProcess.
        In that case, when one of the two ServiceWorkerRegistration is destroyed, the WebProcess will no longer be notified of changes to the SWServerRegistration,
        thus breaking the second ServiceWorkerRegistration behavior.

        We introduce a map at WebProcess level to keep track of the number of ServiceWorkerRegistration created for a given SWServerRegistration.

        Covered by re-enabled tests.

        * WebProcess/Storage/WebSWClientConnection.cpp:
        (WebKit::WebSWClientConnection::addServiceWorkerRegistrationInServer):
        (WebKit::WebSWClientConnection::removeServiceWorkerRegistrationInServer):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::addServiceWorkerRegistration):
        (WebKit::WebProcess::removeServiceWorkerRegistration):
        * WebProcess/WebProcess.h:

2019-10-25  youenn fablet  <youenn@apple.com>

        mp4 video element broken with service worker
        https://bugs.webkit.org/show_bug.cgi?id=184447
        <rdar://problem/39313155>

        Reviewed by Chris Dumez.

        Make a response as range-requested as per https://fetch.spec.whatwg.org/#http-network-or-cache-fetch step 15.

        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::checkRedirection):
        (WebKit::NetworkLoadChecker::validateResponse):
        * NetworkProcess/NetworkLoadChecker.h:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::didReceiveResponse):
        (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):

2019-10-25  Chris Dumez  <cdumez@apple.com>

        [iOS] Regression(r251067) WebProcesses with service workers no longer keep their network process alive
        https://bugs.webkit.org/show_bug.cgi?id=203388
        <rdar://problem/56600074>

        Reviewed by Geoffrey Garen.

        Historically, WebProcessProxy::didSetAssertionState() used to return early for service worker processes
        because we did not want service worker processes to prevent the network process from suspending. The
        WebProcesses using the service worker process would prevent the network process from suspending when
        they are visible, so it would work fine.

        However, after r251067, there is no longer a concept of service worker process per se. Service workers
        will now sometimes run in regular WebProcesses where we have pages. In such cases, didSetAssertionState()
        would still return early and fail to keep its network process alive, even when the page(s) in this process
        are visible on screen.

        To address the issue, we now only return early if the process has a service worker but no page.
        This should restore pre-existing behavior.

        Note that this was causing hangs such as <rdar://problem/56245136> because the WebProcess would be
        stuck on sync IPC to a suspended network process.

        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::didSetAssertionState):

2019-10-25  Chris Dumez  <cdumez@apple.com>

        Standardize "PageID=" vs "pageID =" in release logging
        https://bugs.webkit.org/show_bug.cgi?id=203002

        Reviewed by Geoffrey Garen.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _didCommitLayerTree:]):
        (-[WKWebView _updateVisibleContentRects]):
        (-[WKWebView _cancelAnimatedResize]):
        (-[WKWebView _didCompleteAnimatedResize]):
        (-[WKWebView _beginAnimatedResizeWithUpdates:]):
        (-[WKWebView _endAnimatedResize]):
        (-[WKWebView _resizeWhileHidingContentWithUpdates:]):
        * UIProcess/ProvisionalPageProxy.cpp:
        (WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
        (WebKit::ProvisionalPageProxy::processDidTerminate):
        (WebKit::ProvisionalPageProxy::cancel):
        (WebKit::ProvisionalPageProxy::loadData):
        (WebKit::ProvisionalPageProxy::loadRequest):
        (WebKit::ProvisionalPageProxy::goToBackForwardItem):
        (WebKit::ProvisionalPageProxy::didCreateMainFrame):
        (WebKit::ProvisionalPageProxy::didStartProvisionalLoadForFrame):
        (WebKit::ProvisionalPageProxy::didFailProvisionalLoadForFrame):
        (WebKit::ProvisionalPageProxy::didCommitLoadForFrame):
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::loadResource):
        (WebKit::WebLoaderStrategy::scheduleLoad):
        (WebKit::WebLoaderStrategy::tryLoadingUsingURLSchemeHandler):
        (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
        (WebKit::WebLoaderStrategy::loadResourceSynchronously):
        * WebProcess/Network/WebResourceLoader.cpp:
        (WebKit::WebResourceLoader::willSendRequest):
        (WebKit::WebResourceLoader::didReceiveResponse):
        (WebKit::WebResourceLoader::didReceiveData):
        (WebKit::WebResourceLoader::didFinishResourceLoad):
        (WebKit::WebResourceLoader::serviceWorkerDidNotHandle):
        (WebKit::WebResourceLoader::didFailResourceLoad):
        (WebKit::WebResourceLoader::didBlockAuthenticationChallenge):
        (WebKit::WebResourceLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied):
        (WebKit::WebResourceLoader::didReceiveResource):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDidFailProvisionalLoad):
        (WebKit::WebFrameLoaderClient::dispatchDidFailLoad):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::freezeLayerTree):
        (WebKit::WebPage::unfreezeLayerTree):

2019-10-24  Chris Dumez  <cdumez@apple.com>

        Simplify ProcessThrottler implementation
        https://bugs.webkit.org/show_bug.cgi?id=203370

        Reviewed by Alex Christensen.

        Simplify ProcessThrottler implementation by:
        - Getting rid of CancelPrepareToSuspend IPC. Instead a regular ProcessDidResume IPC is sent to
          the child process.
        - Getting rid of the ProcessWillSuspendImminently IPC and send a regular ProcessDidResume IPC
          with a 'isSuspensionImminent' flag instead.
        - Whether the suspension is imminent or not, the child process now always responds with
          a ProcessReadyToSuspend IPC. This simplifies our logic as the idea is that treating imminent
          and non-imminent suspension should share as much of the same logic as possible.
        - All PrepareToSuspend IPCs now have an associated identifier and the child process sends back
          this identifier when responding with a ProcessReadyToSuspend IPC. This allows the
          ProcessThrottler to easily ignore outdated requests to suspend, without requiring the
          m_suspendMessageCount data member we had.

        This patch also adds more logging to ProcessThrottler and the suspension logic in the child
        processes. All ProcessThrottler logging now also shows the child process's PID for clarity.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::processWillSuspendImminentlyForTestingSync):
        (WebKit::NetworkProcess::prepareToSuspend):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _processWillSuspendImminentlyForTesting]):
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::sendPrepareToSuspend):
        (WebKit::NetworkProcessProxy::processReadyToSuspend):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/Network/NetworkProcessProxy.messages.in:
        * UIProcess/ProcessThrottler.cpp:
        (WebKit::generatePrepareToSuspendRequestID):
        (WebKit::ProcessThrottler::ProcessThrottler):
        (WebKit::m_backgroundCounter):
        (WebKit::ProcessThrottler::expectedAssertionState):
        (WebKit::ProcessThrottler::updateAssertionStateNow):
        (WebKit::ProcessThrottler::setAssertionState):
        (WebKit::ProcessThrottler::updateAssertionIfNeeded):
        (WebKit::ProcessThrottler::didConnectToProcess):
        (WebKit::ProcessThrottler::prepareToSuspendTimeoutTimerFired):
        (WebKit::ProcessThrottler::processReadyToSuspend):
        (WebKit::ProcessThrottler::clearPendingRequestToSuspend):
        (WebKit::ProcessThrottler::sendPrepareToSuspendIPC):
        (WebKit::ProcessThrottler::uiAssertionWillExpireImminently):
        * UIProcess/ProcessThrottler.h:
        * UIProcess/ProcessThrottlerClient.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::sendPrepareToSuspend):
        (WebKit::WebProcessProxy::processReadyToSuspend):
        * UIProcess/WebProcessProxy.h:
        * UIProcess/WebProcessProxy.messages.in:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::prepareToSuspend):
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:

2019-10-23  Ryosuke Niwa  <rniwa@webkit.org>

        Add a mechanism to find and manipulate text by paragraphs
        https://bugs.webkit.org/show_bug.cgi?id=203286

        Reviewed by Wenson Hsieh.

        This patch introduces a new SPI to find paragraphs of text and let client replace the content of each paragraph.
        For now, this SPI is limited to find & replace contents of main frame's document.

        WKWebView's _startTextManipulationsWithCompletionHandler sends StartTextManipulations message to WebContent process
        to find all paragraphs in the main frame. WebContent process will send back DidFindTextManipulationItem message
        for each paragraph, which in turn calls back _WKTextManipulationDelegate's _webView: didFindTextManipulationItem:.

        Upon receiving this delegate callback, the client can invoke WKWebView's _completeTextManipulation to replace
        the content. It will send CompleteTextManipulation to WebContent process, which will invoke completeManipulation
        on main frame's document's TextManipulationController.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _textManipulationDelegate]): Aded.
        (-[WKWebView _setTextManipulationDelegate:]): Aded.
        (-[WKWebView _startTextManipulationsWithCompletionHandler:]):
        (-[WKWebView _completeTextManipulation:completion:]):
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/API/Cocoa/_WKTextManipulationDelegate.h: Added.
        * UIProcess/API/Cocoa/_WKTextManipulationItem.h: Added.
        * UIProcess/API/Cocoa/_WKTextManipulationItem.mm: Added.
        (-[_WKTextManipulationItem initWithIdentifier:tokens:]):
        (-[_WKTextManipulationItem identifier]):
        (-[_WKTextManipulationItem tokens]):
        * UIProcess/API/Cocoa/_WKTextManipulationToken.h: Added.
        * UIProcess/API/Cocoa/_WKTextManipulationToken.mm: Added.
        (-[_WKTextManipulationToken init]):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::startTextManipulations):
        (WebKit::WebPageProxy::didFindTextManipulationItem):
        (WebKit::WebPageProxy::completeTextManipulation):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::startTextManipulations):
        (WebKit::WebPage::completeTextManipulation):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2019-10-24  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r251558.

        This broke internal builds

        Reverted changeset:

        "Add a mechanism to find and manipulate text by paragraphs"
        https://bugs.webkit.org/show_bug.cgi?id=203286
        https://trac.webkit.org/changeset/251558

2019-10-24  Alex Christensen  <achristensen@webkit.org>

        REGRESSION(r251409) Service worker connection should not be established without service worker entitlement
        https://bugs.webkit.org/show_bug.cgi?id=203385
        <rdar://problem/37790257>

        Reviewed by Chris Dumez.

        r251409 introduced a new call to establishSWServerConnection that should have an entitlement check.
        This was caught by a unit test in CI that is not easy to reproduce in WebKit's test.  See the radar.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess):

2019-10-24  Brent Fulgham  <bfulgham@apple.com>

        [iOS] Mismatch in com.apple.coremedia.audiodeviceclock declarations
        https://bugs.webkit.org/show_bug.cgi?id=203367
        <rdar://problem/56581166>

        Reviewed by Per Arne Vollan.

        The 'common.sb' sandbox allows access to "com.apple.coremedia.audiodeviceclock.xpc", but
        the WebContent sandbox blocked access to "com.apple.coremedia.audiodeviceclock". This means
        we aren't blocking that endpoint.

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

2019-10-24  Brent Fulgham  <bfulgham@apple.com>

        [iOS] Mismatch in com.apple.MediaPlayer.RemotePlayerService declarations
        https://bugs.webkit.org/show_bug.cgi?id=203368
        <rdar://problem/56581152>

        Reviewed by Per Arne Vollan.

        The 'common.sb' sandbox allows access to the xpc-service-name "com.apple.MediaPlayer.RemotePlayerService",
        but we block access to the global-name "com.apple.MediaPlayer.RemoteService". We aren't blocking
        the right thing.

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

2019-10-24  Brady Eidson  <beidson@apple.com>

        Expose pageZoom as API.
        https://bugs.webkit.org/show_bug.cgi?id=203381

        Reviewed by Andy Estes.

        No new tests (No behavior change, identical to SPI)

        * UIProcess/API/Cocoa/WKWebView.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView setPageZoom:]):
        (-[WKWebView pageZoom]):
        (-[WKWebView _pageZoomFactor]):
        (-[WKWebView _setPageZoomFactor:]):

2019-10-23  Ryosuke Niwa  <rniwa@webkit.org>

        Add a mechanism to find and manipulate text by paragraphs
        https://bugs.webkit.org/show_bug.cgi?id=203286

        Reviewed by Wenson Hsieh.

        This patch introduces a new SPI to find paragraphs of text and let client replace the content of each paragraph.
        For now, this SPI is limited to find & replace contents of main frame's document.

        WKWebView's _startTextManipulationsWithCompletionHandler sends StartTextManipulations message to WebContent process
        to find all paragraphs in the main frame. WebContent process will send back DidFindTextManipulationItem message
        for each paragraph, which in turn calls back _WKTextManipulationDelegate's _webView: didFindTextManipulationItem:.

        Upon receiving this delegate callback, the client can invoke WKWebView's _completeTextManipulation to replace
        the content. It will send CompleteTextManipulation to WebContent process, which will invoke completeManipulation
        on main frame's document's TextManipulationController.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _textManipulationDelegate]): Aded.
        (-[WKWebView _setTextManipulationDelegate:]): Aded.
        (-[WKWebView _startTextManipulationsWithCompletionHandler:]):
        (-[WKWebView _completeTextManipulation:completion:]):
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/API/Cocoa/_WKTextManipulationDelegate.h: Added.
        * UIProcess/API/Cocoa/_WKTextManipulationItem.h: Added.
        * UIProcess/API/Cocoa/_WKTextManipulationItem.mm: Added.
        (-[_WKTextManipulationItem initWithIdentifier:tokens:]):
        (-[_WKTextManipulationItem identifier]):
        (-[_WKTextManipulationItem tokens]):
        * UIProcess/API/Cocoa/_WKTextManipulationToken.h: Added.
        * UIProcess/API/Cocoa/_WKTextManipulationToken.mm: Added.
        (-[_WKTextManipulationToken init]):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::startTextManipulations):
        (WebKit::WebPageProxy::didFindTextManipulationItem):
        (WebKit::WebPageProxy::completeTextManipulation):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::startTextManipulations):
        (WebKit::WebPage::completeTextManipulation):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2019-10-24  Brent Fulgham  <bfulgham@apple.com>

        Unreviewed fix after r251511.

        Some syctl names were omitted from the initial checkin.

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

2019-10-24  Brady Eidson  <beidson@apple.com>

        Formalize PDF snapshot API.
        https://bugs.webkit.org/show_bug.cgi?id=203374

        Reviewed by Tim Horton.

        Covered by API tests and MiniBrowser usage.

        * SourcesCocoa.txt:
        * UIProcess/API/Cocoa/WKPDFConfiguration.h: Added.
        * UIProcess/API/Cocoa/WKPDFConfiguration.mm: Added.
        (-[WKPDFConfiguration init]):
        (-[WKPDFConfiguration copyWithZone:]):

        * UIProcess/API/Cocoa/WKWebView.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView createPDFWithConfiguration:completionHandler:]):
        (-[WKWebView _takePDFSnapshotWithConfiguration:completionHandler:]):

        * UIProcess/Cocoa/SOAuthorization/SubFrameSOAuthorizationSession.h: Unified build strikes again.

        * WebKit.xcodeproj/project.pbxproj:

2019-10-24  Brent Fulgham  <bfulgham@apple.com>

        [iOS] Remove 'deny' rules that do not have a corresponding 'allow' rule
        https://bugs.webkit.org/show_bug.cgi?id=203352

        Reviewed by Per Arne Vollan.

        Now that we no longer import 'common.sb', and have removed entries that allowed
        services that we block, we can remove the 'deny' command. This is safe because
        everything is denied by default.

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

2019-10-24  Alex Christensen  <achristensen@webkit.org>

        Pass CORS-enabled schemes through WebProcess instead of having them NetworkProcess-global
        https://bugs.webkit.org/show_bug.cgi?id=202891

        Reviewed by Youenn Fablet.

        No change in behavior.  Now the LegacySchemeRegistry is not used as much in the NetworkProcess, a step towards no use at all.
        This functionality is currently only available through the glib API webkit_security_manager_register_uri_scheme_as_cors_enabled
        but it has been requested in bug 201180 and bug 199064.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess):
        (WebKit::NetworkConnectionToWebProcess::loadPing):
        (WebKit::NetworkConnectionToWebProcess::registerURLSchemesAsCORSEnabled):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        (WebKit::NetworkConnectionToWebProcess::schemeRegistry):
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::NetworkLoadChecker):
        (WebKit::NetworkLoadChecker::doesNotNeedCORSCheck const):
        * NetworkProcess/NetworkLoadChecker.h:
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::initializeNetworkProcess):
        (WebKit::NetworkProcess::registerURLSchemeAsCORSEnabled const): Deleted.
        * NetworkProcess/NetworkProcess.messages.in:
        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
        (WebKit::NetworkProcessCreationParameters::decode):
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::m_shouldCaptureExtraNetworkLoadMetrics):
        * NetworkProcess/NetworkSchemeRegistry.cpp: Added.
        (WebKit::NetworkSchemeRegistry::registerURLSchemeAsCORSEnabled):
        (WebKit::NetworkSchemeRegistry::shouldTreatURLSchemeAsCORSEnabled):
        * NetworkProcess/NetworkSchemeRegistry.h: Added.
        (WebKit::NetworkSchemeRegistry::create):
        * NetworkProcess/PingLoad.cpp:
        (WebKit::PingLoad::PingLoad):
        Use nullptr, indicating that the PingLoad constructor that is used in ad click attribution should not check the custom scheme registry.
        This is Ok because ad click attribution is only used for HTTP family schemes.
        (WebKit::m_blobFiles):
        * NetworkProcess/PingLoad.h:
        * Sources.txt:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):
        (WebKit::WebProcessPool::registerURLSchemeAsCORSEnabled):
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::initializeWebProcess):
        (WebKit::WebProcess::registerURLSchemeAsCORSEnabled):
        (WebKit::WebProcess::ensureNetworkProcessConnection):
        (WebKit::WebProcess::registerURLSchemeAsCORSEnabled const): Deleted.
        * WebProcess/WebProcess.h:

2019-10-24  Carlos Alberto Lopez Perez  <clopez@igalia.com>

        [GTK][WPE] Enable runtime setting with experimental features for Server Timing API
        https://bugs.webkit.org/show_bug.cgi?id=203295

        Reviewed by Carlos Garcia Campos.

        Enable the runtime ServerTiming by default when GTK or WPE is built
        with experimental features enabled.

        No new tests, no change in behaviour for WTR.

        * Shared/WebPreferences.yaml:
        * Shared/WebPreferencesDefaultValues.h:

2019-10-23  Chris Dumez  <cdumez@apple.com>

        WebBackForwardCache::removeEntriesMatching() may re-enter and crash
        https://bugs.webkit.org/show_bug.cgi?id=203341
        <rdar://problem/56553939>

        Reviewed by Geoffrey Garen.

        When WebBackForwardCache::removeEntriesMatching() was clearing the WebBackForwardListItem's
        WebBackForwardCacheEntry, it could destroyed a SuspendedPageProxy which could shutdown a
        WebProcess. Upon shutting down, we would try to remove WebBackForwardCache entries associated
        with a given process, re-enter removeEntriesMatching() and crash.

        To address the issue, I made WebBackForwardCache::removeEntriesMatching() safe to re-enter.
        We now clear the WebBackForwardListItems' WebBackForwardCacheEntries only after we're done
        updating m_itemsWithCachedPage.

        * UIProcess/WebBackForwardCache.cpp:
        (WebKit::WebBackForwardCache::removeEntriesMatching):

2019-10-23  Megan Gardner  <megan_gardner@apple.com>

        Rename force-press-related functions to refer to context menus, and fix a former force-press test
        https://bugs.webkit.org/show_bug.cgi?id=202663
        <rdar://problem/52699530>

        Reviewed by Dean Jackson.

        Add plumbing for contextMenu tests to function again, and rename all 
        relevant fuctions to more correctly reflect that this does not specifically
        require a force press to activate any longer.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _didShowContextMenu]):
        (-[WKWebView _didDismissContextMenu]):
        (-[WKWebView _didShowForcePressPreview]): Deleted.
        (-[WKWebView _didDismissForcePressPreview]): Deleted.
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _contextMenuInteraction:configurationForMenuAtLocation:completion:]):
        (-[WKContentView _presentedViewControllerForPreviewItemController:]):
        (-[WKContentView _previewItemController:didDismissPreview:committing:]):
        (-[WKContentView _previewItemControllerDidCancelPreview:]):

2019-10-23  Tim Horton  <timothy_horton@apple.com>

        macCatalyst: Should dispatch contextmenu event on right click
        https://bugs.webkit.org/show_bug.cgi?id=203316
        <rdar://problem/54617376>

        Reviewed by Wenson Hsieh.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::isContextClick):
        (WebKit::handleContextMenuEvent):
        (WebKit::WebPage::contextMenuForKeyEvent):
        (WebKit::handleMouseEvent):
        * WebProcess/WebPage/WebPage.h:

2019-10-23  Brent Fulgham  <bfulgham@apple.com>

        [iOS] Stop including 'common.sb' 
        https://bugs.webkit.org/show_bug.cgi?id=203318

        Reviewed by Per Arne Vollan.

        Replace the 'import' of common.sb with the equivalent statements. This is the
        first step in a task to remove uneeded sandbox rules.

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

2019-10-23  Kate Cheney  <katherine_cheney@apple.com>

        Implement dumpResourceLoadStatistics in SQLite ITP Database
        https://bugs.webkit.org/show_bug.cgi?id=203224
        <rdar://problem/56482165>

        Reviewed by John Wilander. 

        This patch implements dumpResourceLoadStatistics() in the ITP database
        store. This function required a boolean flag isScheduledForWebsiteDataRemoval that
        now must be stored in the database, resulting in a small schema change.

        Because of the schema change, this patch also compares any existing 
        database file against the new schema, and deletes the existing file if the schema is 
        not current. 

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        The logic for topFrameLinkDecorationsFromQuery was the opposite
        of all other "xyzFrom" queries. When merging data from the memory 
        store, the load statistic being inserted holds a list of topFrames 
        which it has been redirected to from. I think it makes more sense
        to also organize the table this way.

        (WebKit::ObservedDomainsTableSchemaV1):
        (WebKit::ObservedDomainsTableSchemaV1Alternate):
        For support on both iOS and MacOS, there are two CREATE TABLE queries
        to compare to, depending on whether the query result contains quotes
        around the table name.

        (WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore):
        (WebKit::ResourceLoadStatisticsDatabaseStore::openITPDatabase):
        (WebKit::ResourceLoadStatisticsDatabaseStore::openAndDropOldDatabaseIfNecessary):
        The code to check for the current schema was adapted from SQLiteIDBBackingStore.cpp

        (WebKit::ResourceLoadStatisticsDatabaseStore::prepareStatements):
        (WebKit::ResourceLoadStatisticsDatabaseStore::insertObservedDomain):
        (WebKit::ResourceLoadStatisticsDatabaseStore::ensureAndMakeDomainList):
        The previous naming of the list parameter in this function was
        confusing because it is used by many different relationships not just
        subframes under top frames.

        (WebKit::ResourceLoadStatisticsDatabaseStore::insertDomainRelationshipList):
        topFrameLinkDecorationsFrom were never inserted into the database.

        (WebKit::ResourceLoadStatisticsDatabaseStore::insertDomainRelationships):
        (WebKit::ResourceLoadStatisticsDatabaseStore::merge):
        (WebKit::ResourceLoadStatisticsDatabaseStore::mergeStatistic):
        Since the statement to get all data for a given domain is now used in
        multiple places, I stored the query as a constexpr auto.

        (WebKit::ResourceLoadStatisticsDatabaseStore::logCrossSiteLoadWithLinkDecoration):
        Matched the memory store functionality, which calls the boolean
        "gotLinkDecorationFromPrevalentResource." I thought isScheduledForWebsiteDataRemoval 
        would be more clear of a name, because this flag gets cleared even when
        prevalent top frame link decorations for this domain still exist in the table.

        (WebKit::ResourceLoadStatisticsDatabaseStore::dumpResourceLoadStatistics):
        (WebKit::ResourceLoadStatisticsDatabaseStore::setIsScheduledForWebsiteDataRemoval):
        (WebKit::ResourceLoadStatisticsDatabaseStore::prevalentDomains): Deleted.
        (WebKit::ResourceLoadStatisticsDatabaseStore::domains):
        To match memory store functionality, the check for website data to
        delete should check all domains, not just prevalent ones.

        (WebKit::ResourceLoadStatisticsDatabaseStore::hasHadUnexpiredRecentUserInteraction):
        (WebKit::ResourceLoadStatisticsDatabaseStore::shouldRemoveAllWebsiteDataFor):
        This now needs to check if the resource is prevalent, because it is
        no longer guaranteed.

        (WebKit::ResourceLoadStatisticsDatabaseStore::shouldRemoveAllButCookiesFor):
        (WebKit::ResourceLoadStatisticsDatabaseStore::registrableDomainsToRemoveWebsiteDataFor):
        (WebKit::ResourceLoadStatisticsDatabaseStore::getDomainStringFromDomainID):
        (WebKit::ResourceLoadStatisticsDatabaseStore::getSubStatisticStatement):
        (WebKit::ResourceLoadStatisticsDatabaseStore::appendSubStatisticList):
        (WebKit::ResourceLoadStatisticsDatabaseStore::resourceToString):
        This functionality matches the toString function in
        ResourceLoadStatistics.cpp.

        (WebKit::CompletionHandler<void):
        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:

2019-10-23  Yury Semikhatsky  <yurys@chromium.org>

        Web Inspector: notify inspector when provisional page is created, committed and destroyed
        https://bugs.webkit.org/show_bug.cgi?id=202704

        Reviewed by Devin Rousso.

        Target.targetCreated event is now generated for provisional pages as well as for regular
        ones. This is the first step toward reattaching inspector earlier during PSON. In the future
        if debugging is in progress the provisional target (page) will be paused until a signal from
        inspector frontend. This will enable the frontend configure all agents before navigation starts.

        * Sources.txt:
        * UIProcess/API/APIWebAuthenticationPanel.cpp:
        (API::WebAuthenticationPanel::WebAuthenticationPanel): Added explicit namespace specifier
        to the constructor's argument as otherwise compilation fails due to conflict between API::String
        and WTF::String.

        * UIProcess/InspectorTargetProxy.cpp:
        (WebKit::InspectorTargetProxy::create):
        (WebKit::InspectorTargetProxy::connect):
        (WebKit::InspectorTargetProxy::disconnect):
        (WebKit::InspectorTargetProxy::sendMessageToTargetBackend):
        (WebKit::InspectorTargetProxy::didCommitProvisionalTarget):
        (WebKit::InspectorTargetProxy::isProvisional const):
        (WebKit::InspectorTargetProxy::previousTargetID const):
        * UIProcess/InspectorTargetProxy.h: Target proxy can start as a provisional target (with a pointer to
        ProvisionalPageProxy) and later either be committed or destroyed.

        * UIProcess/ProvisionalPageProxy.cpp:
        (WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
        (WebKit::ProvisionalPageProxy::~ProvisionalPageProxy):
        (WebKit::ProvisionalPageProxy::didReceiveMessage): Forward inspector messages to parent page's WebPageInspectorController.
        Since each WebPage has a unique identifier the target ids will be globally unique and there is no risk of collisions.

        * UIProcess/ProvisionalPageProxy.h:
        (WebKit::ProvisionalPageProxy::page const):
        * UIProcess/WebPageInspectorController.cpp:
        (WebKit::getTargetID):
        (WebKit::WebPageInspectorController::WebPageInspectorController):
        (WebKit::WebPageInspectorController::clearTargets):
        (WebKit::WebPageInspectorController::createInspectorTarget):
        (WebKit::WebPageInspectorController::destroyInspectorTarget):
        (WebKit::WebPageInspectorController::didCreateProvisionalPage):
        (WebKit::WebPageInspectorController::didDestroyProvisionalPage):
        (WebKit::WebPageInspectorController::didCommitProvisionalPage):
        (WebKit::WebPageInspectorController::addTarget):
        * UIProcess/WebPageInspectorController.h:
        * UIProcess/WebPageInspectorTargetAgent.cpp: Removed. Merged this agent into InspectorTargetAgent.
        * UIProcess/WebPageInspectorTargetAgent.h: Removed.
        * UIProcess/WebPageProxy.cpp:
        (WebKit::m_resetRecentCrashCountTimer):
        (WebKit::WebPageProxy::finishAttachingToWebProcess):
        (WebKit::WebPageProxy::commitProvisionalPage):
        * UIProcess/WebPageProxy.h: Moved the target management logic into WebPageInspectorController.
        WebPageProxy/ProvisionalPageProxy are expected to notifiy it about key lifecycle events and also
        forward to it messages from inspector in the inspected WebProcess. How it translates to Target
        events is inspector's business.

        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebPage/WebPageInspectorTarget.cpp:
        (WebKit::WebPageInspectorTarget::identifier const):
        (WebKit::WebPageInspectorTarget::connect):
        (WebKit::WebPageInspectorTarget::disconnect):
        (WebKit::WebPageInspectorTarget::toTargetID):
        * WebProcess/WebPage/WebPageInspectorTarget.h: Made the target own frontend channel instance as it's the
        only place where the page specific channel is used.

        * WebProcess/WebPage/WebPageInspectorTargetController.cpp:
        (WebKit::WebPageInspectorTargetController::removeTarget):
        (WebKit::WebPageInspectorTargetController::connectInspector):
        (WebKit::WebPageInspectorTargetController::disconnectInspector):
        * WebProcess/WebPage/WebPageInspectorTargetController.h:
        * WebProcess/WebPage/WebPageInspectorTargetFrontendChannel.cpp:
        (WebKit::WebPageInspectorTargetFrontendChannel::WebPageInspectorTargetFrontendChannel):
        (WebKit::WebPageInspectorTargetFrontendChannel::sendMessageToFrontend):
        * WebProcess/WebPage/WebPageInspectorTargetFrontendChannel.h: The channel's lifetime is managed by owning
        target. No need to reference count it.

2019-10-22  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthn] Supply FrameInfo in -[WKUIDelegatePrivate _webView:runWebAuthenticationPanel:initiatedByFrame:completionHandler:]
        https://bugs.webkit.org/show_bug.cgi?id=202563
        <rdar://problem/55973968>

        Reviewed by Brent Fulgham.

        This patch makes WKFrameInfo available to clients via the above SPI. To do so,
        SecuirtyOrigin of the caller document is passed from WebContent Process.

        * UIProcess/API/APIUIClient.h:
        (API::UIClient::runWebAuthenticationPanel):
        * UIProcess/API/C/WKPage.cpp:
        (WKPageSetPageUIClient):
        * UIProcess/Cocoa/UIDelegate.h:
        * UIProcess/Cocoa/UIDelegate.mm:
        (WebKit::UIDelegate::UIClient::runWebAuthenticationPanel):
        * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
        (WebKit::AuthenticatorManager::runPanel):
        * UIProcess/WebAuthentication/WebAuthenticationRequestData.h:
        * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp:
        (WebKit::WebAuthenticatorCoordinatorProxy::makeCredential):
        (WebKit::WebAuthenticatorCoordinatorProxy::getAssertion):
        (WebKit::WebAuthenticatorCoordinatorProxy::handleRequest):
        * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.h:
        * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.messages.in:
        * WebProcess/WebAuthentication/WebAuthenticatorCoordinator.cpp:
        (WebKit::WebAuthenticatorCoordinator::makeCredential):
        (WebKit::WebAuthenticatorCoordinator::getAssertion):
        * WebProcess/WebAuthentication/WebAuthenticatorCoordinator.h:

2019-10-23  Andy Estes  <aestes@apple.com>

        [Quick Look] Rename PreviewLoader{,Client} to LegacyPreviewLoader{,Client}
        https://bugs.webkit.org/show_bug.cgi?id=203306

        Reviewed by Tim Horton.

        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
        * WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm:
        (WebKit::WebFrameLoaderClient::createPreviewLoaderClient):
        * WebProcess/WebCoreSupport/ios/WebPreviewLoaderClient.h:

2019-10-22  Fujii Hironori  <Hironori.Fujii@sony.com>

        Unreviewed build fix for non-unified source builds
        https://bugs.webkit.org/show_bug.cgi?id=203055
        <rdar://problem/56504295>

        * WebProcess/Storage/WebServiceWorkerProvider.cpp: Added #include <WebCore/RuntimeEnabledFeatures.h>.

2019-10-22  John Wilander  <wilander@apple.com>

        Resource Load Statistics (experimental): Block all third-party cookies
        https://bugs.webkit.org/show_bug.cgi?id=203266
        <rdar://problem/56512858>

        Reviewed by Alex Christensen.

        This change updates the experimental change in
        <https://trac.webkit.org/changeset/251213> to block all
        third-party cookies, regardless of user interaction with
        the first-party website.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::setShouldBlockThirdPartyCookiesForTesting):
        * 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):

2019-10-22  Tim Horton  <timothy_horton@apple.com>

        Make it possible to not include IPC Messages headers in other headers
        https://bugs.webkit.org/show_bug.cgi?id=203074

        * Scripts/webkit/messages_unittest.py:
        (GeneratedFileContentsTest.assertHeaderEqual):
        (GeneratedFileContentsTest.assertImplementationEqual):
        (UnsupportedPrecompilerDirectiveTest.test_error_at_else):
        (UnsupportedPrecompilerDirectiveTest.test_error_at_elif):
        Fix the message generator unit tests.

2019-10-22  Alex Christensen  <achristensen@webkit.org>

        Re-enable legacy TLS by default, keep runtime switch
        https://bugs.webkit.org/show_bug.cgi?id=203253

        Reviewed by Geoffrey Garen.

        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeNetworkProcess):
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::parameters):

2019-10-22  Alex Christensen  <achristensen@webkit.org>

        Revert r243010 on pre-Catalina macOS
        https://bugs.webkit.org/show_bug.cgi?id=203265
        <rdar://problem/55570995>

        Reviewed by Per Arne Vollan.

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

2019-10-22  Tim Horton  <timothy_horton@apple.com>

        Update xcfilelists

        * DerivedSources-output.xcfilelist:

2019-10-22  Tim Horton  <timothy_horton@apple.com>

        Make it possible to not include IPC Messages headers in other headers
        https://bugs.webkit.org/show_bug.cgi?id=203074

        Reviewed by Geoffrey Garen.

        Make the Messages generator generate a new -MessagesReplies.h file, which
        only includes headers for and definitions of DelayedReply/AsyncReply types,
        which need to be mentioned as arguments to message hander methods, and
        thus must be available in various headers throughout the project.

        In order to do this, we have to de-nest them from the primary message
        class, but we then 'using' them back into place inside the message class
        so that most of the code doesn't need to change.

        This helps to wildly decrease the header load of WebPage.h and WebPageProxy.h,
        especially, because the number of headers needed for types in their replies
        is much smaller than the number needed for all message receivers.

        Also, only invoke the Messages generator once per source file, and
        only parse the source file once, generating all three output files
        in one invocation.

        And then clean up all the missing indirect includes that we lost by doing this.

        All-in-all this is worth roughly 8% on the WebKit2 Build Time Benchmark.

        * CMakeLists.txt:
        * DerivedSources-input.xcfilelist:
        * DerivedSources.make:
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkResourceLoader.cpp:
        * NetworkProcess/NetworkResourceLoader.h:
        * PluginProcess/PluginControllerProxy.cpp:
        * PluginProcess/PluginControllerProxy.h:
        * PluginProcess/WebProcessConnection.h:
        * Scripts/Makefile:
        * Scripts/generate-message-receiver.py:
        (main):
        * Scripts/generate-messages-header.py: Removed.
        * Scripts/webkit/LegacyMessageReceiver-expected.cpp:
        * Scripts/webkit/LegacyMessages-expected.h:
        * Scripts/webkit/LegacyMessagesReplies-expected.h: Added.
        * Scripts/webkit/MessageReceiver-expected.cpp:
        * Scripts/webkit/MessageReceiverSuperclass-expected.cpp:
        * Scripts/webkit/Messages-expected.h:
        * Scripts/webkit/MessagesReplies-expected.h: Added.
        * Scripts/webkit/MessagesRepliesSuperclassReplies-expected.h: Added.
        * Scripts/webkit/MessagesSuperclass-expected.h:
        * Scripts/webkit/messages.py:
        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
        * UIProcess/Downloads/DownloadProxy.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/Plugins/PluginProcessManager.cpp:
        * UIProcess/Plugins/PluginProcessManager.h:
        * UIProcess/Plugins/PluginProcessProxy.h:
        * UIProcess/ProvisionalPageProxy.h:
        * UIProcess/SuspendedPageProxy.h:
        * UIProcess/WebPageProxy.cpp:
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebProcessPool.cpp:
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebProcessProxy.h:
        * UIProcess/ios/WKContentView.mm:
        * UIProcess/ios/WKContentViewInteraction.mm:
        * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        * WebProcess/Storage/WebSWContextManagerConnection.h:
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        * WebProcess/cocoa/VideoFullscreenManager.h:
        * WebProcess/cocoa/VideoFullscreenManager.mm:

2019-10-22  Chris Dumez  <cdumez@apple.com>

        Simplify "Unexpectedly Resumed" assertion handling
        https://bugs.webkit.org/show_bug.cgi?id=203254

        Reviewed by Geoffrey Garen.

        When the WebContent process gets resumed from suspension, it now unconditionally takes a
        process assertion on behalf on the UIProcess and sends a ProcessDidResume IPC to the
        UIProcess. The UIProcess then sends a DidHandleProcessWasResumed IPC back after handing
        the ProcessDidResume IPC allowing the WebContent process to release its assertion on
        behalf on the UIProcess.

        The previous code was racy because it relied on the m_processIsSuspended flag, which was
        queried and set from different threads. Also, the 'unexpectedly resumed' naming was
        confusing since we'd often take this assertion whenever the WebProcess got resumed,
        wether unexpected or not, simply because the processTaskStateDidChange IPC won the race
        with the ProcessDidResume IPC from the UIProcess.

        * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
        (WebKit::WebProcessProxy::processWasResumed):
        (WebKit::WebProcessProxy::processWasUnexpectedlyUnsuspended): Deleted.
        * UIProcess/WebProcessProxy.h:
        * UIProcess/WebProcessProxy.messages.in:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::processDidResume):
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::processTaskStateDidChange):
        (WebKit::WebProcess::didHandleProcessWasResumed):

2019-10-22  youenn fablet  <youenn@apple.com>

        Remove mayHaveServiceWorkerRegisteredForOrigin
        https://bugs.webkit.org/show_bug.cgi?id=203055

        Reviewed by Alex Christensen.

        This optimization was used for ensuring we would not create a storage process when no service worker registration is stored on disk.
        Now that we do not have a storage process and we are doing registration matching direclty in network process, we can safely remove that optimization.
        We also move the throttle state handling in WK2 layer. This allows us to not create a network process connection to update throttle state until
        there is a network process connection. This allows continuing passing an API test checking network process connections after crashes.

        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::creationParameters):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess):
        (WebKit::WebProcessPool::updateServiceWorkerUserAgent):
        * UIProcess/WebProcessPool.h:
        * WebProcess/Network/NetworkProcessConnection.h:
        * WebProcess/Storage/WebSWClientConnection.h:
        * WebProcess/Storage/WebServiceWorkerProvider.cpp:
        (WebKit::WebServiceWorkerProvider::serviceWorkerConnection):
        (WebKit::WebServiceWorkerProvider::updateThrottleState):
        * WebProcess/Storage/WebServiceWorkerProvider.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_textAutoSizingAdjustmentTimer):
        (WebKit::WebPage::updateThrottleState):

2019-10-22  Yury Semikhatsky  <yurys@chromium.org>

        [GTK] Web Inspector: add an option for disabling minification and concatenation of inspector UI in release build
        https://bugs.webkit.org/show_bug.cgi?id=203201

        Reviewed by Carlos Garcia Campos.

        Allow passing COMBINE_INSPECTOR_RESOURCES and COMBINE_TEST_RESOURCES as cmake arguments. This
        enables to avoid minification of Web Inspector scripts in release binaries which is very
        convenient during inspector UI development.

        * InspectorGResources.cmake:

2019-10-22  Adrian Perez de Castro  <aperez@igalia.com>

        [GTK][WPE] Fix non-unified builds after r251326
        https://bugs.webkit.org/show_bug.cgi?id=203244

        Reviewed by Youenn Fablet.

        * Shared/UserData.cpp: Add missing inclusion of WebCoreArgumentCoders.h
        * UIProcess/Automation/SimulatedInputDispatcher.cpp: Add missing inclusion of wtf/Variant.h
        * UIProcess/ProvisionalPageProxy.h: Add missing inclusion of WebCore/ResourceRequest.h
        * UIProcess/WebTextChecker.cpp: Add missing inclusion of WebPageProxy.h
        * WebProcess/Databases/WebDatabaseProvider.cpp: Add missing inclusion of WebIDBConnectionToServer.h

2019-10-22  youenn fablet  <youenn@apple.com>

        WebSWServerToContextConnection should not assert when failing loads at destruction time
        https://bugs.webkit.org/show_bug.cgi?id=203243

        Reviewed by Alex Christensen.

        On WebSWServerToContextConnection destruction, we move the fetch task map and fail the tasks.
        At destruction of the tasks, which happens synchronously, they will try to unregister themselves
        and the assertion that the task is in the map will fail.
        To fix that, add a specific contextClosed method that will clear the task connection weak pointer.

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

2019-10-22  youenn fablet  <youenn@apple.com>

        ServiceWorkerFetchTask can use the NetworkConnectionToWebProcess sessionID
        https://bugs.webkit.org/show_bug.cgi?id=202208

        Reviewed by Alex Christensen.

        No need to store the sessionID in ServiceWorkerFetchTask since we can get it from its loader.

        * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp:
        (WebKit::ServiceWorkerFetchTask::ServiceWorkerFetchTask):
        * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h:
        * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
        (WebKit::WebSWServerConnection::createFetchTask):

2019-10-22  youenn fablet  <youenn@apple.com>

        Remove the ability to fallback to custom scheme handlers after a service worker did not handle the load
        https://bugs.webkit.org/show_bug.cgi?id=203239

        Reviewed by Alex Christensen.

        We remove the ability for service workers to intercept custom scheme handlers.
        We can then remove the ability for loads that are not handled by service workers to go through custom scheme handlers.

        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::scheduleLoad):
        (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
        * WebProcess/Network/WebResourceLoader.cpp:
        (WebKit::WebResourceLoader::serviceWorkerDidNotHandle):

2019-10-22  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Update OptionsGTK.cmake and NEWS for 2.27.2 release

        * gtk/NEWS: Add release notes for 2.27.2.

2019-10-21  Yusuke Suzuki  <ysuzuki@apple.com>

        [JSC] Thread JSGlobalObject* instead of ExecState*
        https://bugs.webkit.org/show_bug.cgi?id=202392

        Reviewed by Geoffrey Garen.

        * WebProcess/InjectedBundle/API/glib/WebKitFrame.cpp:
        (webkit_frame_get_js_value_for_dom_object_in_script_world):
        * WebProcess/InjectedBundle/InjectedBundle.cpp:
        (WebKit::InjectedBundle::reportException):
        (WebKit::InjectedBundle::createWebDataFromUint8Array):
        * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
        (WebKit::callMethod):
        * WebProcess/Plugins/Netscape/JSNPMethod.h:
        * WebProcess/Plugins/Netscape/JSNPObject.cpp:
        (WebKit::JSNPObject::callMethod):
        (WebKit::JSNPObject::callObject):
        (WebKit::JSNPObject::callConstructor):
        (WebKit::callNPJSObject):
        (WebKit::constructWithConstructor):
        (WebKit::JSNPObject::getOwnPropertySlot):
        (WebKit::JSNPObject::put):
        (WebKit::JSNPObject::deleteProperty):
        (WebKit::JSNPObject::deletePropertyByIndex):
        (WebKit::JSNPObject::getOwnPropertyNames):
        (WebKit::JSNPObject::propertyGetter):
        (WebKit::JSNPObject::methodGetter):
        (WebKit::JSNPObject::throwInvalidAccessError):
        * WebProcess/Plugins/Netscape/JSNPObject.h:
        * WebProcess/Plugins/Netscape/NPJSObject.cpp:
        (WebKit::identifierFromIdentifierRep):
        (WebKit::NPJSObject::hasMethod):
        (WebKit::NPJSObject::invoke):
        (WebKit::NPJSObject::invokeDefault):
        (WebKit::NPJSObject::hasProperty):
        (WebKit::NPJSObject::getProperty):
        (WebKit::NPJSObject::setProperty):
        (WebKit::NPJSObject::removeProperty):
        (WebKit::NPJSObject::enumerate):
        (WebKit::NPJSObject::construct):
        * WebProcess/Plugins/Netscape/NPJSObject.h:
        * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
        (WebKit::NPRuntimeObjectMap::convertNPVariantToJSValue):
        (WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant):
        (WebKit::NPRuntimeObjectMap::evaluate):
        (WebKit::NPRuntimeObjectMap::moveGlobalExceptionToExecState):
        (WebKit::NPRuntimeObjectMap::globalExec const): Deleted.
        * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.h:
        * WebProcess/Plugins/PluginView.cpp:
        (WebKit::PluginView::performJavaScriptURLRequest):
        * WebProcess/WebPage/WebFrame.cpp:
        (WebKit::WebFrame::jsContext):
        (WebKit::WebFrame::jsContextForWorld):
        (WebKit::WebFrame::frameForContext):
        (WebKit::WebFrame::jsWrapperForWorld):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::freezeLayerTree):
        (WebKit::WebPage::unfreezeLayerTree):
        (WebKit::WebPage::runJavaScript):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::networkProcessConnectionClosed):

2019-10-22  Carlos Alberto Lopez Perez  <clopez@igalia.com>

        [GTK][WPE] Enable service workers by default
        https://bugs.webkit.org/show_bug.cgi?id=200815

        Reviewed by Carlos Garcia Campos.

        Flip the run-time switch to be enabled by default and not only
        when building with experimental features enabled.

        * Shared/WebPreferencesDefaultValues.h:

2019-10-22  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] C++ comments used in C header files
        https://bugs.webkit.org/show_bug.cgi?id=203191

        Reviewed by Žan Doberšek.

        * UIProcess/API/gtk/WebKitAutocleanups.h:
        * UIProcess/API/gtk/WebKitDefines.h:
        * UIProcess/API/gtk/WebKitForwardDeclarations.h:
        * UIProcess/API/gtk/WebKitWebViewBase.h:
        * UIProcess/API/wpe/WebKitAutocleanups.h:
        * UIProcess/API/wpe/WebKitDefines.h:
        * WebProcess/InjectedBundle/API/gtk/WebKitWebEditor.h:
        * WebProcess/InjectedBundle/API/gtk/WebKitWebExtensionAutocleanups.h:
        * WebProcess/InjectedBundle/API/wpe/WebKitWebEditor.h:
        * WebProcess/InjectedBundle/API/wpe/WebKitWebExtensionAutocleanups.h:

2019-10-22  Wenson Hsieh  <wenson_hsieh@apple.com>

        imported/w3c/web-platform-tests/clipboard-apis/async-navigator-clipboard-basics.https.html is flaky
        https://bugs.webkit.org/show_bug.cgi?id=203181

        Reviewed by Ryosuke Niwa.

        Add a changeCount argument to informationForItemAtIndex and allPasteboardItemInfo, and also make then return
        optional values; also, adjust changeCount to be an `int64_t` in a few places. See WebCore ChangeLog for more
        details.

        * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
        (WebKit::WebPasteboardProxy::pasteboardCopy):
        (WebKit::WebPasteboardProxy::getPasteboardChangeCount):
        (WebKit::WebPasteboardProxy::addPasteboardTypes):
        (WebKit::WebPasteboardProxy::setPasteboardTypes):
        (WebKit::WebPasteboardProxy::setPasteboardURL):
        (WebKit::WebPasteboardProxy::setPasteboardColor):
        (WebKit::WebPasteboardProxy::setPasteboardStringForType):
        (WebKit::WebPasteboardProxy::setPasteboardBufferForType):
        (WebKit::WebPasteboardProxy::writeCustomData):
        (WebKit::WebPasteboardProxy::allPasteboardItemInfo):
        (WebKit::WebPasteboardProxy::informationForItemAtIndex):
        * UIProcess/WebPasteboardProxy.cpp:
        (WebKit::WebPasteboardProxy::allPasteboardItemInfo):
        (WebKit::WebPasteboardProxy::informationForItemAtIndex):
        * UIProcess/WebPasteboardProxy.h:
        * UIProcess/WebPasteboardProxy.messages.in:
        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit::PDFPlugin::writeItemsToPasteboard):
        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
        (WebKit::WebPlatformStrategies::changeCount):
        (WebKit::WebPlatformStrategies::addTypes):
        (WebKit::WebPlatformStrategies::setTypes):
        (WebKit::WebPlatformStrategies::setBufferForType):
        (WebKit::WebPlatformStrategies::setURL):
        (WebKit::WebPlatformStrategies::setColor):
        (WebKit::WebPlatformStrategies::setStringForType):
        (WebKit::WebPlatformStrategies::writeCustomData):
        (WebKit::WebPlatformStrategies::allPasteboardItemInfo):
        (WebKit::WebPlatformStrategies::informationForItemAtIndex):
        * WebProcess/WebCoreSupport/WebPlatformStrategies.h:

2019-10-21  Daniel Bates  <dabates@apple.com>

        Add some PencilKit extension points
        https://bugs.webkit.org/show_bug.cgi?id=202962
        <rdar://problem/56269759>

        Reviewed by Andy Estes.

        This is the WebKit part corresponding to <rdar://problem/56261392>.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView setupInteraction]): Call extension point.
        (-[WKContentView cleanupInteraction]): Ditto.

2019-10-21  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r251381.

        This broke an internal build.

        Reverted changeset:

        "Add some PencilKit extension points"
        https://bugs.webkit.org/show_bug.cgi?id=202962
        https://trac.webkit.org/changeset/251381

2019-10-21  Myles C. Maxfield  <mmaxfield@apple.com>

        [Cocoa] Move ui-serif, ui-monospaced, and ui-rounded out from behind SPI
        https://bugs.webkit.org/show_bug.cgi?id=203129

        Reviewed by Tim Horton.

        * Shared/WebPreferences.yaml:
        * UIProcess/API/Cocoa/WKPreferences.mm:
        (-[WKPreferences _shouldAllowDesignSystemUIFonts]): Deleted.
        (-[WKPreferences _setShouldAllowDesignSystemUIFonts:]): Deleted.
        * UIProcess/API/Cocoa/WKPreferencesPrivate.h:

2019-10-21  youenn fablet  <youenn@apple.com>

        Move service worker registration matching for navigation loads to network process
        https://bugs.webkit.org/show_bug.cgi?id=203144

        Reviewed by Chris Dumez.

        Create a WebSWServerConnection whenever receiving a load request in NetworkProcess.
        This connection is used to check for service worker registration in case of navigation loads.
        Similarly, we create a WebSWClientConnection whenever WebProcess needs it, including when receiving WebSWClientConnection messages from NetworkProcess.
        This for instance happens when service worker registration import is complete to fill the shared registration origin store.

        Delay loads until SWServer has finished importing its registrations.
        This is needed since we might otherwise not intercept loads that could be intercepted.
        Waiting for importing registrations was previously ensured by WebProcess getting a matching registration in DocumentLoader.

        NetworkResourceLoader is now checking for service worker interception in case of redirections for navigations.
        This is needed as redirections could end up using a new registration.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess):
        (WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad):
        (WebKit::NetworkConnectionToWebProcess::establishSWServerConnection):
        (WebKit::NetworkConnectionToWebProcess::swConnection):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::continueWillSendRequest):
        (WebKit::NetworkResourceLoader::startWithServiceWorker):
        (WebKit::NetworkResourceLoader::serviceWorkerDidNotHandle):
        * NetworkProcess/NetworkResourceLoader.h:
        * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp:
        (WebKit::ServiceWorkerFetchTask::ServiceWorkerFetchTask):
        (WebKit::ServiceWorkerFetchTask::start):
        (WebKit::ServiceWorkerFetchTask::startFetch):
        (WebKit::ServiceWorkerFetchTask::continueFetchTaskWith):
        * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h:
        (WebKit::ServiceWorkerFetchTask::takeRequest):
        * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
        (WebKit::WebSWServerConnection::controlClient):
        (WebKit::WebSWServerConnection::createFetchTask):
        * NetworkProcess/ServiceWorker/WebSWServerConnection.h:
        * WebProcess/Network/NetworkProcessConnection.cpp:
        (WebKit::NetworkProcessConnection::didReceiveMessage):
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::scheduleLoad):
        * WebProcess/Storage/WebSWClientConnection.cpp:
        (WebKit::WebSWClientConnection::WebSWClientConnection):
        (WebKit::WebSWClientConnection::registrationReady):
        (WebKit::WebSWClientConnection::documentIsControlled):
        * WebProcess/Storage/WebSWClientConnection.h:
        * WebProcess/Storage/WebSWClientConnection.messages.in:

2019-10-21  Sihui Liu  <sihui_liu@apple.com>

        Remove IDBBackingStoreTemporaryFileHandler
        https://bugs.webkit.org/show_bug.cgi?id=203128

        Reviewed by Alex Christensen.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::createIDBServer):
        (WebKit::NetworkProcess::accessToTemporaryFileComplete): Deleted.
        * NetworkProcess/NetworkProcess.h:

2019-10-21  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Update cookie blocking in NetworkStorageSession after first user interaction
        https://bugs.webkit.org/show_bug.cgi?id=203195
        <rdar://problem/56464567>

        Reviewed by Alex Christensen and Chris Dumez.

        This change makes sure that the state of cookie blocking in
        WebCore:: NetworkStorageSession is immediately updated if the logged
        user interaction was new for this domain. It adds a completion
        handler to WebResourceLoadStatisticsStore::logUserInteraction() so
        that the call properly waits for everything to be updated.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        (WebKit::CompletionHandler<void):
        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
        (WebKit::ResourceLoadStatisticsMemoryStore::logUserInteraction):
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):

2019-10-21  Dean Jackson  <dino@apple.com>

        Dispatch AR event on the originating anchor element
        https://bugs.webkit.org/show_bug.cgi?id=203198
        <rdar://55743929>

        Reviewed by Simon Fraser.

        Use the ElementContext on SystemPreviewInfo.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _triggerSystemPreviewActionOnElement:frame:page:]):
        (-[WKWebView _triggerSystemPreviewActionOnFrame:page:]): Deleted.
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
        * UIProcess/SystemPreviewController.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::systemPreviewActionTriggered):

2019-10-21  Dean Jackson  <dino@apple.com>

        Move ElementContext from WebKit to WebCore
        https://bugs.webkit.org/show_bug.cgi?id=203210
        <rdar://problem/56475682>

        Reviewed by Simon Fraser.

        * Scripts/webkit/messages.py:
        * Shared/DocumentEditingContext.h:
        * Shared/DocumentEditingContext.mm:
        (IPC::ArgumentCoder<WebKit::DocumentEditingContextRequest>::decode):
        * Shared/ElementContext.cpp: Removed.
        * Shared/ElementContext.h: Removed.
        * Shared/WebPreferencesDefaultValues.cpp:
        (WebKit::defaultCSSOMViewScrollingAPIEnabled):
        * Shared/WebsitePoliciesData.cpp:
        (WebKit::WebsitePoliciesData::decode):
        * Shared/ios/InteractionInformationAtPosition.h:
        * Sources.txt:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _requestTextInputContextsInRect:completionHandler:]):
        * UIProcess/API/Cocoa/_WKTextInputContext.mm:
        (-[_WKTextInputContext _initWithTextInputContext:]):
        (-[_WKTextInputContext _textInputContext]):
        * UIProcess/API/Cocoa/_WKTextInputContextInternal.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::textInputContextsInRect):
        (WebKit::WebPageProxy::focusTextInputContext):
        * UIProcess/WebPageProxy.h:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::textInputContextsInRect):
        (WebKit::WebPage::focusTextInputContext):
        (WebKit::WebPage::elementForContext const):
        (WebKit::WebPage::contextForElement const):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::startInteractionWithElementContextOrPosition):

2019-10-21  Alex Christensen  <achristensen@webkit.org>

        ServiceWorker tests should use TCPServer instead of WKURLSchemeHandler
        https://bugs.webkit.org/show_bug.cgi?id=203141

        Reviewed by Youenn Fablet.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::initializeNetworkProcess):
        (WebKit::NetworkProcess::addWebsiteDataStore):
        (WebKit::NetworkProcess::swServerForSession):
        (WebKit::NetworkProcess::addServiceWorkerSession):
        * NetworkProcess/NetworkProcess.h:
        * Shared/WebsiteDataStoreParameters.cpp:
        (WebKit::WebsiteDataStoreParameters::encode const):
        (WebKit::WebsiteDataStoreParameters::decode):
        * Shared/WebsiteDataStoreParameters.h:
        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
        (-[_WKWebsiteDataStoreConfiguration registerURLSchemeServiceWorkersCanHandleForTesting:]): Deleted.
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::initializeNewWebProcess):
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::parameters):
        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
        (WebKit::WebsiteDataStoreConfiguration::copy):
        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
        (WebKit::WebsiteDataStoreConfiguration::serviceWorkerRegisteredSchemes const): Deleted.
        (WebKit::WebsiteDataStoreConfiguration::registerServiceWorkerScheme): Deleted.

2019-10-21  Tim Horton  <timothy_horton@apple.com>

        macCatalyst: Swipe navigation gestures do not work
        https://bugs.webkit.org/show_bug.cgi?id=203205
        <rdar://problem/54617473>

        Reviewed by Wenson Hsieh.

        * UIProcess/ios/ViewGestureControllerIOS.mm:
        (-[WKSwipeTransitionController gestureRecognizerForInteractiveTransition:WithTarget:action:]):
        Use a different gesture recognizer for swipe in macCatalyst that behaves
        more like the macOS implementation, based on scrolling instead of the
        gesture coming from a screen edge.

2019-10-21  Daniel Bates  <dabates@apple.com>

        Add some PencilKit extension points
        https://bugs.webkit.org/show_bug.cgi?id=202962
        <rdar://problem/56269759>

        Reviewed by Andy Estes.

        This is the WebKit part corresponding to <rdar://problem/56261392>.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView setupInteraction]): Call extension point.
        (-[WKContentView cleanupInteraction]): Ditto.

2019-10-21  Chris Dumez  <cdumez@apple.com>

        Add more release logging for "Unexpectedly resumed" assertion
        https://bugs.webkit.org/show_bug.cgi?id=203196

        Reviewed by Geoffrey Garen.

        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::processDidResume):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::processTaskStateDidChange):

2019-10-21  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Objects category in emoji picker is empty
        https://bugs.webkit.org/show_bug.cgi?id=203189

        Reviewed by Adrian Perez de Castro.

        There's a typo in the first emopi name of objects section.

        * UIProcess/API/gtk/WebKitEmojiChooser.cpp:
        (webkitEmojiChooserSetupEmojiSections): uted speaker -> muted speaker

2019-10-21  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] IconDatabase is not thread safe yet
        https://bugs.webkit.org/show_bug.cgi?id=202980

        Reviewed by Adrian Perez de Castro.

        Current implementation is safer, but we still need to protect members used by both threads.

        * UIProcess/API/glib/IconDatabase.cpp:
        (WebKit::IconDatabase::populatePageURLToIconURLMap):
        (WebKit::IconDatabase::clearLoadedIconsTimerFired):
        (WebKit::IconDatabase::checkIconURLAndSetPageURLIfNeeded):
        (WebKit::IconDatabase::loadIconForPageURL):
        (WebKit::IconDatabase::iconURLForPageURL):
        (WebKit::IconDatabase::setIconForPageURL):
        (WebKit::IconDatabase::clear):
        * UIProcess/API/glib/IconDatabase.h:

2019-10-21  Tim Horton  <timothy_horton@apple.com>

        Clean up some includes to improve WebKit2 build speed
        https://bugs.webkit.org/show_bug.cgi?id=203071

        Reviewed by Wenson Hsieh.

        This is worth about 6% on WebKit2, and unlocks another 8% improvement
        down the line (but which is less mechanical).

        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
        * NetworkProcess/NetworkSocketChannel.h:
        * NetworkProcess/WebStorage/StorageArea.h:
        * NetworkProcess/WebStorage/StorageManager.cpp:
        * NetworkProcess/WebStorage/StorageManagerSet.cpp:
        * Platform/IPC/Connection.h:
        * Shared/API/APIURL.h:
        * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h:
        * Shared/WebCoreArgumentCoders.cpp:
        * Shared/WebCoreArgumentCoders.h:
        * UIProcess/API/APIAttachment.h:
        * UIProcess/API/Cocoa/_WKInspector.mm:
        * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h:
        * UIProcess/TextCheckerCompletion.cpp:
        * UIProcess/TextCheckerCompletion.h:
        * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
        (WebKit::WebUserContentControllerProxy::addNetworkProcess):
        (WebKit::WebUserContentControllerProxy::removeNetworkProcess):
        * UIProcess/UserContent/WebUserContentControllerProxy.h:
        (WebKit::WebUserContentControllerProxy::addNetworkProcess): Deleted.
        (WebKit::WebUserContentControllerProxy::removeNetworkProcess): Deleted.
        * WebProcess/Automation/WebAutomationSessionProxy.h:
        * WebProcess/Network/NetworkProcessConnection.cpp:
        * WebProcess/Network/NetworkProcessConnection.h:
        * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        * WebProcess/Plugins/Plugin.cpp:
        * WebProcess/Plugins/Plugin.h:
        * WebProcess/WebProcess.cpp:

2019-10-20  Brent Fulgham  <bfulgham@apple.com>

        Improve serialization logic
        https://bugs.webkit.org/show_bug.cgi?id=203039
        <rdar://problem/55631691>

        Reviewed by Alex Christensen.

        Check that the SecItemRequestData only contains relevant types for
        CFNetwork uses. 

        * Platform/spi/Cocoa/SecItemSPI.h: Added.
        * Shared/mac/SecItemRequestData.cpp:
        (WebKit::arrayContainsInvalidType): Added.
        (WebKit::dictionaryContainsInvalidType): Added.
        (WebKit::validTypeIDs): Added.
        (WebKit::isValidType): Added.
        (WebKit::SecItemRequestData::decode): Check types during decode.
        * Shared/mac/SecItemRequestData.h:
        * WebKit.xcodeproj/project.pbxproj:

2019-10-19  Adrian Perez de Castro  <aperez@igalia.com>

        [GTK][WPE] Fix non-unified builds after r250857
        https://bugs.webkit.org/show_bug.cgi?id=203145

        Reviewed by Carlos Garcia Campos.

        * UIProcess/WebProcessProxy.cpp: Add missing inclusion of the WebBackForwardCache.h header.

2019-10-18  Tim Horton  <timothy_horton@apple.com>

        macCatalyst: Cursor should send mouse events, not touch events
        https://bugs.webkit.org/show_bug.cgi?id=203175
        <rdar://problem/56321134>

        Reviewed by Simon Fraser.

        * Platform/spi/ios/UIKitSPI.h:
        * Shared/NativeWebMouseEvent.h:
        * Shared/ios/NativeWebMouseEventIOS.mm:
        (WebKit::NativeWebMouseEvent::NativeWebMouseEvent):
        Add a NativeWebMouseEvent constructor that doesn't actually wrap a native event,
        for creating totally-synthetic events.

        * UIProcess/ios/WKMouseGestureRecognizer.h: Added.
        * UIProcess/ios/WKMouseGestureRecognizer.mm: Added.
        (webEventModifiersForUIKeyModifierFlags):
        (-[WKMouseGestureRecognizer initWithTarget:action:]):
        (-[WKMouseGestureRecognizer setView:]):
        (-[WKMouseGestureRecognizer lastMouseEvent]):
        (-[WKMouseGestureRecognizer lastMouseLocation]):
        (-[WKMouseGestureRecognizer mouseTouch]):
        (-[WKMouseGestureRecognizer _wantsHoverEvents]):
        (-[WKMouseGestureRecognizer reset]):
        (-[WKMouseGestureRecognizer _shouldReceiveTouch:forEvent:recognizerView:]):
        (-[WKMouseGestureRecognizer _shouldReceivePress:]):
        (-[WKMouseGestureRecognizer createMouseEventWithType:]):
        (-[WKMouseGestureRecognizer touchesBegan:withEvent:]):
        (-[WKMouseGestureRecognizer touchesMoved:withEvent:]):
        (-[WKMouseGestureRecognizer touchesEnded:withEvent:]):
        (-[WKMouseGestureRecognizer touchesCancelled:withEvent:]):
        (-[WKMouseGestureRecognizer _hoverEntered:withEvent:]):
        (-[WKMouseGestureRecognizer _hoverMoved:withEvent:]):
        (-[WKMouseGestureRecognizer _hoverExited:withEvent:]):
        (-[WKMouseGestureRecognizer _hoverCancelled:withEvent:]):
        (-[WKMouseGestureRecognizer locationInView:]):
        (-[WKMouseGestureRecognizer canPreventGestureRecognizer:]):
        (-[WKMouseGestureRecognizer canBePreventedByGestureRecognizer:]):
        Instead of just using UIHoverGestureRecognizer, introduce a new gesture
        recognizer that does what it did, but also supports cases where the button
        is pressed (so, mousedown and mouseup instead of just mousemove),
        and synthesizes mouse events for all state transitions. These events
        should look roughly identical to what a non-macCatalyst app would get
        in AppKit's mouseUp/mouseDown/mouseMoved NSResponder methods.

        * SourcesCocoa.txt:
        * 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 _mouseGestureRecognizerChanged:]):
        (webEventFlagsForUIKeyModifierFlags): Deleted.
        (-[WKContentView _hoverGestureRecognizerChanged:]): Deleted.
        * WebKit.xcodeproj/project.pbxproj:
        Make use of WKMouseGestureRecognizer to plumb the synthesized events directly
        to the macOS-style "handleMouseEvent" codepath, instead of going through
        the touch events path (and then subsequently generating synthetic clicks).
        Also, ensure that other gesture recognizers ignore the mouse "touch" entirely
        by returning NO in shouldReceiveTouch.

2019-10-18  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthn] Warn users when no credentials are found
        https://bugs.webkit.org/show_bug.cgi?id=203147
        <rdar://problem/55931123>

        Reviewed by Brent Fulgham.

        This patch returns _WKWebAuthenticationPanelUpdateNoCredentialsFound to client via
        -[_WKWebAuthenticationPanelDelegate panel:updateWebAuthenticationPanel:] when either
        CtapAuthenticator receives kCtap2ErrNoCredentials or U2fAuthenticator exhausts the
        allow list.

        This patch also enhances CtapAuthenticator::tryDowngrade to check if the CTAP command
        can be converted to U2F commands to ensure kCtap2ErrNoCredentials is returned if it
        is the case. Otherwise, after downgrading, U2fAuthenticator will return NotSupportedError
        given it can't convert the commands.

        * UIProcess/API/APIUIClient.h:
        * UIProcess/API/APIWebAuthenticationPanelClient.h:
        (API::WebAuthenticationPanelClient::updatePanel const):
        * UIProcess/WebAuthentication/Authenticator.h:
        * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
        (WebKit::AuthenticatorManager::authenticatorStatusUpdated):
        * UIProcess/WebAuthentication/AuthenticatorManager.h:
        * UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.h:
        * UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.mm:
        (WebKit::WebAuthenticationPanelClient::WebAuthenticationPanelClient):
        (WebKit::wkWebAuthenticationPanelUpdate):
        (WebKit::WebAuthenticationPanelClient::updatePanel const):
        * UIProcess/WebAuthentication/WebAuthenticationFlags.h: Renamed from Source/WebKit/UIProcess/WebAuthentication/WebAuthenticationPanelFlags.h.
        * UIProcess/WebAuthentication/WebAuthenticationRequestData.h:
        * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp:
        * UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp:
        (WebKit::CtapAuthenticator::continueGetAssertionAfterResponseReceived):
        (WebKit::CtapAuthenticator::tryDowngrade):
        * UIProcess/WebAuthentication/fido/U2fAuthenticator.cpp:
        (WebKit::U2fAuthenticator::issueSignCommand):
        * WebKit.xcodeproj/project.pbxproj:

2019-10-18  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Clipboard API] Refactor Pasteboard::read() to take an optional item index
        https://bugs.webkit.org/show_bug.cgi?id=203161

        Reviewed by Tim Horton.

        * Shared/mac/PasteboardTypes.mm:
        (WebKit::PasteboardTypes::forEditing):
        (WebKit::PasteboardTypes::forSelection):

        Support "com.apple.webarchive" alongside the private "Apple Web Archive pasteboard type".

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

2019-10-18  Ryosuke Niwa  <rniwa@webkit.org>

        [iOS] REGRESSION(r251269): fast/events/ios/rotation/do-not-shrink-to-fit-content-after-rotation.html and fast/events/ios/rotation/layout-viewport-during-safari-type-rotation.html fail
        https://bugs.webkit.org/show_bug.cgi?id=203162
        <rdar://problem/56418459>

        Reviewed by Simon Fraser.

        Synchronously update the rendering before the orientation change and other viewport size updates.

        Otherwise, resize event will be dispatched in the middle of orientation animation,
        and would result in non-determistic results.

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

2019-10-18  Chris Dumez  <cdumez@apple.com>

        [iOS] "Unexpectedly Resumed" process assertion may cause us to get terminated
        https://bugs.webkit.org/show_bug.cgi?id=203046
        <rdar://problem/56179592>

        Reviewed by Geoffrey Garen.

        This patch implements the following to avoid getting terminated:
        1. Schedule the task to release the assertion on a background thread instead of
           the main thread so that we end up releasing the task even if the main thread
           is somehow hung.
        2. Add an invalidation handler to the process assertion which releases the assertion
           upon expiration.

        * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
        (WebKit::WebProcessProxy::processWasUnexpectedlyUnsuspended):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::processDidResume):
        * WebProcess/WebProcess.h:
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::processTaskStateDidChange):

2019-10-18  Jer Noble  <jer.noble@apple.com>

        Add experimental HDR MediaCapabilities support.
        https://bugs.webkit.org/show_bug.cgi?id=203113

        Reviewed by Eric Carlson.

        Add experimental hdrMediaCapabilitiesEnabled preference.

        * Shared/WebPreferences.yaml:

2019-10-18  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthn] Implement AuthenticatorCancel
        https://bugs.webkit.org/show_bug.cgi?id=191523
        <rdar://problem/55920204>

        Reviewed by Brent Fulgham.

        This patch implement two ways to cancel a pending WebAuthn ceremony:
        1) Via navigation activities. Activities include i) main frame navigation, ii) main frame reload,
        iii) main frame destruction, iv) sub frame navigation, and v) sub frame destruction. All the above
        activities will cancel any pending WebAuthn ceremony that is associated with the frame. To prove
        the association, a GlobalFrameIdentifier is bridged into WebAuthenticationRequestData. Navigation
        cancel is done in WebPageProxy::didStartProvisionalLoadForFrameShared, and destruction cancel is done
        in WebProcessProxy::didDestroyFrame and WebPageProxy::resetState.
        2) Via UI. This path is simply bridged -[_WKWebAuthenticationPanel cancel] into AuthenticatorManager.
        Noted, this patch follows the spec to wait until time out to notify RPs.
        References: i) Step 20 of https://www.w3.org/TR/webauthn/#createCredential, ii) Step 18 of
        https://www.w3.org/TR/webauthn/#getAssertion

        As for what the cancel actually does, it:
        1) stops any HID/NFC scanning;
        2) sends CTAPHID_CANCEL to any HID authenticators that have been added. Reference:
        https://fidoalliance.org/specs/fido-v2.0-ps-20190130/fido-client-to-authenticator-protocol-v2.0-ps-20190130.html#usb-hid-cancel
        Sending CTAPHID_CANCEL, however, is not trivial. An abstract class FidoAuthenticator is crafted to
        do this labor for both CtapAuthenticator and U2fAuthenticator during the time of destructions.
        Noted: The CtapHidDriver is the only CtapDriver implements the cancel method. Since the message
        is sent during state reset, lifecycle of the HidConenction and HidService which manage the underlying
        IOHIDDeviceRef is very hard to hold. This is required for the regular async sender. Therefore,
        HidConnection::sendSync is crafted to send the message synchronously to get rid of the tediousness
        of managing those lifecycles.

        P.S. Vector::grow doesn't initialize POD types. Therefore, this patch also appends it with memset
        for FidoHidPacket.

        P.S.S. This patch also simplifies AuthenticatorCoordinatorClient by: i) moving code from AuthenticatorCoordinatorClient
        to WebAuthenticatorCoordinatorClient, and ii) using sendWithAsyncReply. The latter allows us to
        get rid of the complex mechanism of ensuring the right reply is returned.

        * DerivedSources.make:
        * Sources.txt:
        * UIProcess/API/APIWebAuthenticationPanel.cpp:
        (API::WebAuthenticationPanel::create):
        (API::WebAuthenticationPanel::WebAuthenticationPanel):
        (API::WebAuthenticationPanel::cancel const):
        * UIProcess/API/APIWebAuthenticationPanel.h:
        * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm:
        (-[_WKWebAuthenticationPanel cancel]):
        * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
        (WebKit::AuthenticatorManager::cancelRequest):
        (WebKit::AuthenticatorManager::clearState):
        (WebKit::AuthenticatorManager::runPanel):
        (WebKit::AuthenticatorManager::resetState):
        * UIProcess/WebAuthentication/AuthenticatorManager.h:
        * UIProcess/WebAuthentication/Cocoa/HidConnection.h:
        (WebKit::HidConnection::isInitialized const):
        (WebKit::HidConnection::setIsInitialized):
        * UIProcess/WebAuthentication/Cocoa/HidConnection.mm:
        (WebKit::HidConnection::~HidConnection):
        (WebKit::HidConnection::initialize):
        (WebKit::HidConnection::terminate):
        (WebKit::HidConnection::sendSync):
        (WebKit::HidConnection::send):
        (WebKit::HidConnection::registerDataReceivedCallback):
        * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
        (WebKit::MockHidConnection::initialize):
        (WebKit::MockHidConnection::terminate):
        (WebKit::MockHidConnection::sendSync):
        (WebKit::MockHidConnection::send):
        (WebKit::MockHidConnection::feedReports):
        * UIProcess/WebAuthentication/Mock/MockHidConnection.h:
        * UIProcess/WebAuthentication/WebAuthenticationRequestData.h:
        * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp:
        (WebKit::WebAuthenticatorCoordinatorProxy::makeCredential):
        (WebKit::WebAuthenticatorCoordinatorProxy::getAssertion):
        (WebKit::WebAuthenticatorCoordinatorProxy::handleRequest):
        (WebKit::WebAuthenticatorCoordinatorProxy::isUserVerifyingPlatformAuthenticatorAvailable):
        (WebKit::WebAuthenticatorCoordinatorProxy::requestReply): Deleted.
        * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.h:
        * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.messages.in:
        * UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp:
        (WebKit::CtapAuthenticator::CtapAuthenticator):
        (WebKit::CtapAuthenticator::makeCredential):
        (WebKit::CtapAuthenticator::getAssertion):
        (WebKit::CtapAuthenticator::tryDowngrade):
        * UIProcess/WebAuthentication/fido/CtapAuthenticator.h:
        * UIProcess/WebAuthentication/fido/CtapDriver.h:
        (WebKit::CtapDriver::cancel):
        * UIProcess/WebAuthentication/fido/CtapHidDriver.cpp:
        (WebKit::CtapHidDriver::Worker::write):
        (WebKit::CtapHidDriver::Worker::read):
        (WebKit::CtapHidDriver::Worker::returnMessage):
        (WebKit::CtapHidDriver::Worker::reset):
        (WebKit::CtapHidDriver::Worker::cancel):
        (WebKit::CtapHidDriver::continueAfterChannelAllocated):
        (WebKit::CtapHidDriver::continueAfterResponseReceived):
        (WebKit::CtapHidDriver::returnResponse):
        (WebKit::CtapHidDriver::reset):
        (WebKit::CtapHidDriver::cancel):
        * UIProcess/WebAuthentication/fido/CtapHidDriver.h:
        * UIProcess/WebAuthentication/fido/FidoAuthenticator.cpp: Copied from Source/WebKit/UIProcess/API/APIWebAuthenticationPanel.cpp.
        (WebKit::FidoAuthenticator::FidoAuthenticator):
        (WebKit::FidoAuthenticator::~FidoAuthenticator):
        (WebKit::FidoAuthenticator::driver const):
        (WebKit::FidoAuthenticator::releaseDriver):
        * UIProcess/WebAuthentication/fido/FidoAuthenticator.h: Copied from Source/WebKit/UIProcess/API/APIWebAuthenticationPanel.cpp.
        * UIProcess/WebAuthentication/fido/FidoService.cpp:
        (WebKit::FidoService::continueAfterGetInfo):
        * UIProcess/WebAuthentication/fido/U2fAuthenticator.cpp:
        (WebKit::U2fAuthenticator::U2fAuthenticator):
        (WebKit::U2fAuthenticator::issueCommand):
        * UIProcess/WebAuthentication/fido/U2fAuthenticator.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
        (WebKit::WebPageProxy::resetState):
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::didDestroyFrame):
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebAuthentication/WebAuthenticatorCoordinator.cpp:
        (WebKit::WebAuthenticatorCoordinator::WebAuthenticatorCoordinator):
        (WebKit::WebAuthenticatorCoordinator::makeCredential):
        (WebKit::WebAuthenticatorCoordinator::getAssertion):
        (WebKit::WebAuthenticatorCoordinator::isUserVerifyingPlatformAuthenticatorAvailable):
        (WebKit::WebAuthenticatorCoordinator::~WebAuthenticatorCoordinator): Deleted.
        * WebProcess/WebAuthentication/WebAuthenticatorCoordinator.h:
        * WebProcess/WebAuthentication/WebAuthenticatorCoordinator.messages.in: Removed.
        * WebProcess/WebPage/WebFrame.cpp:
        (WebKit::WebFrame::fromCoreFrame):
        * WebProcess/WebPage/WebFrame.h:

2019-10-18  Zan Dobersek  <zdobersek@igalia.com>

        Avoid crashes on GCC-compiled binaries by avoiding a use-after-move
        that's the result of differring call conventions.

        Rubber-stamped by Carlos Garcia Campos.

        * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
        (WebKit::WebSWServerConnection::startFetch): Copy the SW identifier from
        the ServiceWorkerFetchTask before it's moved into the lambda.

2019-10-17  Mark Lam  <mark.lam@apple.com>

        Use constexpr in more places and remove some unnecessary external linkage.
        https://bugs.webkit.org/show_bug.cgi?id=203115

        Reviewed by Yusuke Suzuki.

        * UIProcess/API/APIContentRuleListStore.h:
        * WebProcess/Plugins/Netscape/mac/PluginProxyMac.mm:

2019-10-17  Antoine Quint  <graouts@apple.com>

        [Web Animations] Enable the Web Animations JavaScript API by default
        https://bugs.webkit.org/show_bug.cgi?id=203075

        Reviewed by Antti Koivisto.

        * Shared/WebPreferences.yaml:

2019-10-17  Carlos Alberto Lopez Perez  <clopez@igalia.com>

        [GTK][WPE] File and Directory Entries API is not enabled
        https://bugs.webkit.org/show_bug.cgi?id=202796

        Reviewed by Adrian Perez de Castro.

        Enable by default the DirectoryUpload runtime setting that is
        used to enable the APIs of the File and Directory Entries API.

        Enable also the DataTransferItemsEnabled runtime setting that
        exposes the DataTransferItem API. This makes the manual tests
        available at https://w3c-test.org/entries-api mostly pass on
        platform GTK (those tests need also the DataTransferItem API
        to enable the drag-and-drop).

        The bug <https://webkit.org/b/98940> for DataTransferItem API
        remains open because the layout test editing/pasteboard/data-transfer-items.html
        is still not passing completely. However other manual tests for
        DataTransferItem pass after enabling it.

        * Shared/WebPreferencesDefaultValues.h:

2019-10-17  Devin Rousso  <drousso@apple.com>

        Web Inspector: rework frontend agent construction to allow commands/events to be controlled by the related target's type
        https://bugs.webkit.org/show_bug.cgi?id=200384
        <rdar://problem/53850352>

        Reviewed by Joseph Pecoraro.

        * WebProcess/WebPage/RemoteWebInspectorUI.h:
        (WebKit::WebInspectorUI::backendCommandsURL const): Added.
        (WebKit::WebInspectorUI::debuggableType const): Added.
        (WebKit::WebInspectorUI::backendCommandsURL): Deleted.
        (WebKit::WebInspectorUI::debuggableType): Deleted.
        * WebProcess/WebPage/WebInspectorUI.h:
        (WebKit::WebInspectorUI::backendCommandsURL const): Added.
        (WebKit::WebInspectorUI::debuggableType const): Added.
        * UIProcess/WebPageDebuggable.h:
        (WebKit::WebPageDebuggable::type const):
        * UIProcess/glib/RemoteInspectorClient.cpp:
        (WebKit::RemoteInspectorClient::RemoteInspectorClient):
        * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.h:
        * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm:
        (debuggableTypeString):
        Split the `Web` debuggable type into `Page` (WebCore::Page) and `WebPage` (WebKit::WebPageProxy).

2019-10-16  Emilio Cobos Álvarez  <emilio@crisal.io>

        Pass network cache directory in WebsiteDataStore::parameters() for non-Cocoa platforms.
        https://bugs.webkit.org/show_bug.cgi?id=203043

        This was causing various errors in the network process that were
        visible in debug builds.

        Reviewed by Alex Christensen.

        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::parameters):

2019-10-16  Chris Dumez  <cdumez@apple.com>

        Rename PageCache to BackForwardCache
        https://bugs.webkit.org/show_bug.cgi?id=203048

        Reviewed by Alex Christensen.

        Rename PageCache to BackForwardCache for clarity and consistency with the UIProcess's WebBackForwardCache.

        * Shared/CacheModel.cpp:
        (WebKit::calculateMemoryCacheSizes):
        * Shared/CacheModel.h:
        * Shared/WebPreferences.yaml:
        * UIProcess/API/APINavigationClient.h:
        (API::NavigationClient::willGoToBackForwardListItem):
        * UIProcess/API/APIProcessPoolConfiguration.cpp:
        (API::ProcessPoolConfiguration::copy):
        * UIProcess/API/APIProcessPoolConfiguration.h:
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetPageCacheEnabled):
        (WKPreferencesGetPageCacheEnabled):
        (WKPreferencesSetPageCacheSupportsPlugins):
        (WKPreferencesGetPageCacheSupportsPlugins):
        * UIProcess/API/Cocoa/WKPreferences.mm:
        (-[WKPreferences _setUsesPageCache:]):
        (-[WKPreferences _usesPageCache]):
        (-[WKPreferences _setPageCacheSupportsPlugins:]):
        (-[WKPreferences _pageCacheSupportsPlugins]):
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
        (-[_WKProcessPoolConfiguration pageCacheEnabled]):
        (-[_WKProcessPoolConfiguration setPageCacheEnabled:]):
        * UIProcess/API/glib/WebKitSettings.cpp:
        (webkit_settings_get_enable_page_cache):
        (webkit_settings_set_enable_page_cache):
        * UIProcess/Cocoa/NavigationState.h:
        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::setNavigationDelegate):
        (WebKit::NavigationState::NavigationClient::willGoToBackForwardListItem):
        (WebKit::NavigationState::NavigationClient::didStartProvisionalNavigation):
        (WebKit::NavigationState::NavigationClient::didReceiveServerRedirectForProvisionalNavigation):
        (WebKit::NavigationState::NavigationClient::didFailProvisionalNavigationWithError):
        (WebKit::NavigationState::NavigationClient::didCommitNavigation):
        (WebKit::NavigationState::NavigationClient::didFinishDocumentLoad):
        (WebKit::NavigationState::NavigationClient::didFinishNavigation):
        (WebKit::NavigationState::NavigationClient::didFailNavigationWithError):
        (WebKit::NavigationState::NavigationClient::didSameDocumentNavigation):
        * UIProcess/ViewGestureController.cpp:
        (WebKit::ViewGestureController::didReachMainFrameLoadTerminalState):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::shouldUseBackForwardCache const):
        (WebKit::WebPageProxy::willGoToBackForwardListItem):
        (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
        (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrameShared):
        (WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared):
        (WebKit::WebPageProxy::didCommitLoadForFrame):
        (WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
        (WebKit::WebPageProxy::didFinishLoadForFrame):
        (WebKit::WebPageProxy::didFailLoadForFrame):
        (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::updateBackForwardCacheCapacity):
        * WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.cpp:
        (WKBundleBackForwardListItemIsInBackForwardCache):
        * WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.h:
        * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
        (WebKit::toBackForwardListItemState):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::WebFrameLoaderClient):
        (WebKit::WebFrameLoaderClient::shouldGoToHistoryItem const):
        (WebKit::WebFrameLoaderClient::transitionToCommittedFromCachedFrame):
        (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
        (WebKit::WebFrameLoaderClient::didRestoreFromBackForwardCache):
        (WebKit::WebFrameLoaderClient::createPlugin):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
        * WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm:
        (WebKit::WebFrameLoaderClient::forceLayoutOnRestoreFromBackForwardCache):
        * WebProcess/WebPage/VisitedLinkTableController.cpp:
        * WebProcess/WebPage/WebBackForwardListProxy.cpp:
        (WebKit::WebBackForwardListProxy::removeItem):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::suspendForProcessSwap):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::initializeWebProcess):
        (WebKit::WebProcess::setCacheModel):
        (WebKit::WebProcess::deleteWebsiteData):
        (WebKit::WebProcess::setBackForwardCacheCapacity):
        (WebKit::WebProcess::clearCachedPage):
        * WebProcess/WebProcess.h:

2019-10-16  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Remove ubiquity client rule from sandbox
        https://bugs.webkit.org/show_bug.cgi?id=201347

        Reviewed by Brent Fulgham.

        This rule is most likely not needed, since we have already blocked all of its associated mach services,
        and no issues have been reported.

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

2019-10-16  Tim Horton  <timothy_horton@apple.com>

        iOS: inputmode=none is not respected with a hardware keyboard attached
        https://bugs.webkit.org/show_bug.cgi?id=203061

        Reviewed by Daniel Bates.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView shouldShowAutomaticKeyboardUI]):
        We can resolve this FIXME, as the underlying bug was fixed in <rdar://problem/52706523>.
        This now means that we will respect inputmode=none even when a hardware
        keyboard is attached, significantly improving the experience on sites that use it
        by avoiding an intermittent input bar.

2019-10-16  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Remove send-signal from mach-lookup rule
        https://bugs.webkit.org/show_bug.cgi?id=201203

        Reviewed by Brent Fulgham.

        The send-signal can be removed, since crashes have not been reported from this rule.

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

2019-10-16  Dean Jackson  <dino@apple.com>

        Add Swift modulemap for WebKit Private APIs
        https://bugs.webkit.org/show_bug.cgi?id=203059

        Reviewed by Tim Horton.

        Provide a Swift modulemap for WebKit_Private, and
        ensure WKPreferencesPrivate.h is exposed.

        Renamed OSX.modulemap to macOS.modulemap while here.

        * Configurations/WebKit.xcconfig:
        * Modules/iOS.private.modulemap: Added.
        * Modules/macOS.modulemap: Renamed from Source/WebKit/Modules/OSX.modulemap.
        * Modules/macOS.private.modulemap: Added.
        * Shared/API/Cocoa/WebKitPrivate.h: Include WKPreferencesPrivate.h.

2019-10-16  John Wilander  <wilander@apple.com>

        Resource Load Statistics (experimental): Block all third-party cookies on websites without prior user interaction
        https://bugs.webkit.org/show_bug.cgi?id=203017
        <rdar://problem/56262708>

        Reviewed by Alex Christensen.

        This enhancement is off by default and controlled by an internal feature flag.

        The functional change is in WebCore::NetworkStorageSession::shouldBlockCookies() which is
        called from:
        - NetworkDataTaskCocoa::NetworkDataTaskCocoa()
        - NetworkDataTaskCocoa::willPerformHTTPRedirection

        shouldBlockCookies() now checks if the first-party website has received user interaction
        and if not, blocks all third-party cookies, regardless of the status of those third-party
        domains (prevalent or not).

        The changes to ResourceLoadStatisticsDatabaseStore and ResourceLoadStatisticsMemoryStore
        are about communicating which domains have received user interaction (prevalent or not)
        to the network storage session so that it can enforce the new restriction.

        The C API change and piping through the WebsiteDataStore is test infrastructure.

        Bundled cleanup task: Remove the two month old feature flag for NSURLSession switching.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        (WebKit::CompletionHandler<void):
        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
        (WebKit::ResourceLoadStatisticsMemoryStore::clear):
        (WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlocking):
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::callUpdatePrevalentDomainsToBlockCookiesForHandler):
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
        (WebKit::RegistrableDomainsToBlockCookiesFor::isolatedCopy const):
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::initializeNetworkProcess):
        (WebKit::NetworkProcess::setShouldBlockThirdPartyCookiesForTesting):
        * NetworkProcess/NetworkProcess.messages.in:
        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::NetworkSession):
        * NetworkProcess/NetworkSession.h:
        (WebKit::NetworkSession::setResourceLoadStatisticsLogTestingEvent):
        (WebKit::NetworkSession::shouldIsolateSessionsForPrevalentTopFrames const): Deleted.
        * NetworkProcess/NetworkSessionCreationParameters.cpp:
        (WebKit::NetworkSessionCreationParameters::encode const):
        (WebKit::NetworkSessionCreationParameters::decode):
        * NetworkProcess/NetworkSessionCreationParameters.h:
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
        * Shared/WebPreferences.yaml:
        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreSetResourceLoadStatisticsShouldBlockThirdPartyCookiesForTesting):
        (WKWebsiteDataStoreStatisticsResetToConsistentState):
        * UIProcess/API/C/WKWebsiteDataStoreRef.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::setShouldBlockThirdPartyCookiesForTesting):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::parameters):
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::setResourceLoadStatisticsShouldBlockThirdPartyCookiesForTesting):
        * UIProcess/WebsiteData/WebsiteDataStore.h:

2019-10-16  Kate Cheney  <katherine_cheney@apple.com>

        WKWebsiteDataStoreStatisticsResetToConsistentState() should call store.setUseITPDatabase(false)
        https://bugs.webkit.org/show_bug.cgi?id=203020
        <rdar://problem/56314484>

        Reviewed by Chris Dumez.

        The resourceLoadStatisticsStore should be reset between tests to use
        a memory store, and any test that needs to use the database store
        can use the setUseITPDatabase function.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::setUseITPDatabase):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreSetUseITPDatabase):
        (WKWebsiteDataStoreStatisticsResetToConsistentState):
        * UIProcess/API/C/WKWebsiteDataStoreRef.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::setUseITPDatabase):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::setUseITPDatabase):
        * UIProcess/WebsiteData/WebsiteDataStore.h:

2019-10-16  Chris Dumez  <cdumez@apple.com>

        [WK2] Handle back/forward cache entry expiration in the UIProcess instead of the WebProcess
        https://bugs.webkit.org/show_bug.cgi?id=203034
        <rdar://problem/56332453>

        Reviewed by Antti Koivisto.

        Handle back/forward cache entry expiration in the UIProcess instead of the WebProcess,
        now that back/forward cache management is done in the UIProcess.

        * UIProcess/WebBackForwardCacheEntry.cpp:
        (WebKit::WebBackForwardCacheEntry::WebBackForwardCacheEntry):
        (WebKit::WebBackForwardCacheEntry::takeSuspendedPage):
        (WebKit::WebBackForwardCacheEntry::expirationTimerFired):
        * UIProcess/WebBackForwardCacheEntry.h:
        Add a Timer to WebBackForwardCacheEntry to make the entry expire after 30 minutes, which is what used
        to happen on WebContent process side. One difference in behavior is that when the entry expires we
        now remove it from the cache right away to free-up memory, instead of simply refusing to use it later
        on.

        * WebProcess/WebPage/WebPage.cpp:
        Disable back forward cache expiration in the WebContent process when using modern
        WebKit.

2019-10-16  Chris Dumez  <cdumez@apple.com>

        [iOS] Stop terminating the prewarmed process on application suspension
        https://bugs.webkit.org/show_bug.cgi?id=203033

        Reviewed by Alex Christensen.

        Stop terminating the prewarmed process on application suspension. Having no prewarmed process when the
        application resumes means the next cross-site load will be significantly slower. If the system needs
        memory, this process can be jetsammed.

        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::applicationIsAboutToSuspend):

2019-10-16  Chris Dumez  <cdumez@apple.com>

        Drop unused WKPageSetResourceCachingDisabled() SPI
        https://bugs.webkit.org/show_bug.cgi?id=203035

        Reviewed by Alex Christensen.

        * UIProcess/API/C/WKPage.cpp:
        (WKPageGetResourceCachingDisabled): Deleted.
        (WKPageSetResourceCachingDisabled): Deleted.
        * UIProcess/API/C/WKPagePrivate.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::setResourceCachingDisabled): Deleted.
        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::isResourceCachingDisabled const): Deleted.
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::setResourceCachingDisabled): Deleted.
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2019-10-16  Wenson Hsieh  <wenson_hsieh@apple.com>

        Unreviewed, fix the internal macOS 10.13 and 10.14 builds after r251171

        * Platform/spi/mac/ApplicationServicesSPI.h: Guard SPI declarations that use AXClientType with HAVE(AX_CLIENT_TYPE).

2019-10-15  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] Add user messages API
        https://bugs.webkit.org/show_bug.cgi?id=202847

        Reviewed by Adrian Perez de Castro.

        We have never exposed an API to send/receive messages to/from Web extensions, to allow applications use their own
        IPC. Now, with PSON enabled, it's a lot more difficult to implement the custom IPC on the application side,
        because applications need to keep track of all the web processes launched, and the changes of web process in the
        web view to send the messages to the right extension. That's already done internally by WebKit, so it would be
        easier to provide a simple API so that apps don't need to worry about the web process being used. This patch adds
        WebKitUserMessage, a simple message API consisting on a message name, parameters and file descriptors. Messages
        can be sent from a WebKitWebContext to all the WebKitWebExtensions, or from a WebKitWebExtension to its
        WebKitWebContext, or from a WebKitWebView to its WebKitWebPage (and vice versa).

        * PlatformGTK.cmake:
        * PlatformWPE.cmake:
        * Shared/API/glib/WebKitUserMessage.cpp: Added.
        (webkitUserMessageDispose):
        (webkitUserMessageGetProperty):
        (webkitUserMessageSetProperty):
        (webkit_user_message_class_init):
        (webkitUserMessageCreate):
        (webkitUserMessageGetMessage):
        (webkit_user_message_new):
        (webkit_user_message_new_with_fd_list):
        (webkit_user_message_get_name):
        (webkit_user_message_get_parameters):
        (webkit_user_message_get_fd_list):
        (webkit_user_message_send_reply):
        * Shared/API/glib/WebKitUserMessagePrivate.h: Added.
        * Shared/glib/ArgumentCodersGLib.cpp: Added.
        (IPC::encode):
        (IPC::decode):
        * Shared/glib/ArgumentCodersGLib.h: Added.
        * Shared/glib/UserMessage.cpp: Added.
        (WebKit::UserMessage::encode const):
        (WebKit::UserMessage::decode):
        * Shared/glib/UserMessage.h: Added.
        (WebKit::UserMessage::UserMessage):
        * SourcesGTK.txt:
        * SourcesWPE.txt:
        * UIProcess/API/glib/WebKitWebContext.cpp:
        (webkitWebContextConstructed):
        (webkit_web_context_class_init):
        (webkit_web_context_send_message_to_all_extensions):
        * UIProcess/API/glib/WebKitWebView.cpp:
        (webkit_web_view_class_init):
        (webkitWebViewDidReceiveUserMessage):
        (webkit_web_view_send_message_to_page):
        (webkit_web_view_send_message_to_page_finish):
        * UIProcess/API/glib/WebKitWebViewPrivate.h:
        * UIProcess/API/gtk/WebKitUserMessage.h: Added.
        * UIProcess/API/gtk/WebKitWebContext.h:
        * UIProcess/API/gtk/WebKitWebView.h:
        * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
        * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
        * UIProcess/API/gtk/webkit2.h:
        * UIProcess/API/wpe/APIViewClient.h:
        (API::ViewClient::didReceiveUserMessage):
        * UIProcess/API/wpe/PageClientImpl.cpp:
        (WebKit::PageClientImpl::sendMessageToWebView):
        * UIProcess/API/wpe/PageClientImpl.h:
        * UIProcess/API/wpe/WPEView.cpp:
        (WKWPE::View::didReceiveUserMessage):
        * UIProcess/API/wpe/WPEView.h:
        * UIProcess/API/wpe/WebKitUserMessage.h: Added.
        * UIProcess/API/wpe/WebKitWebContext.h:
        * UIProcess/API/wpe/WebKitWebView.h:
        * UIProcess/API/wpe/docs/wpe-1.0-sections.txt:
        * UIProcess/API/wpe/docs/wpe-docs.sgml:
        * UIProcess/API/wpe/webkit.h:
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebProcessProxy.h:
        * UIProcess/WebProcessProxy.messages.in:
        * UIProcess/glib/WebProcessProxyGLib.cpp:
        (WebKit::WebProcessProxy::sendMessageToWebContextWithReply):
        (WebKit::WebProcessProxy::sendMessageToWebContext):
        * UIProcess/gtk/WebPageProxyGtk.cpp:
        (WebKit::WebPageProxy::sendMessageToWebViewWithReply):
        (WebKit::WebPageProxy::sendMessageToWebView):
        * UIProcess/wpe/WebPageProxyWPE.cpp:
        (WebKit::WebPageProxy::sendMessageToWebViewWithReply):
        (WebKit::WebPageProxy::sendMessageToWebView):
        * WebProcess/InjectedBundle/API/glib/WebKitExtensionManager.h:
        (WebKit::WebKitExtensionManager::extension const):
        * WebProcess/InjectedBundle/API/glib/WebKitWebExtension.cpp:
        (webkitWebExtensionDidReceiveUserMessage):
        (webkit_web_extension_send_message_to_context):
        (webkit_web_extension_send_message_to_context_finish):
        * WebProcess/InjectedBundle/API/glib/WebKitWebExtensionPrivate.h:
        * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
        (webkit_web_page_class_init):
        (webkitWebPageDidReceiveUserMessage):
        (webkit_web_page_send_message_to_view):
        (webkit_web_page_send_message_to_view_finish):
        * WebProcess/InjectedBundle/API/glib/WebKitWebPagePrivate.h:
        * WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.h:
        * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.h:
        * WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h:
        * WebProcess/InjectedBundle/API/wpe/WebKitWebExtension.h:
        * WebProcess/InjectedBundle/API/wpe/WebKitWebPage.h:
        * WebProcess/InjectedBundle/API/wpe/docs/wpe-webextensions-1.0-sections.txt:
        * WebProcess/InjectedBundle/API/wpe/webkit-web-extension.h:
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/glib/WebPageGLib.cpp: Added.
        (WebKit::WebPage::sendMessageToWebExtensionWithReply):
        (WebKit::WebPage::sendMessageToWebExtension):
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:
        * WebProcess/glib/WebProcessGLib.cpp:
        (WebKit::WebProcess::sendMessageToWebExtension):

2019-10-15  Wenson Hsieh  <wenson_hsieh@apple.com>

        Fix the internal macOS build after r251171
        https://bugs.webkit.org/show_bug.cgi?id=203022

        Reviewed by Dan Bernstein.

        Attempts to include <HIServices/AccessibilityPriv.h> in WebKit result in:

        ```
        fatal error: 'HIServices/AccessibilityPriv.h' file not found
        ```

        At least on macOS 10.15, it appears that HIServices.framework exists within the ApplicationServices framework.
        To fix this build error, we can instead turn AccessibilityPrivSPI.h into an SPI header for ApplicationServices,
        ApplicationServicesSPI.h, and use it in several places where we currently directly import <ApplicationServices/
        ApplicationServicesPriv.h>.

        * Platform/IPC/cocoa/ConnectionCocoa.mm:

        Bring some more constants that were defined in the !USE(APPLE_INTERNAL_SDK) case into the ApplicationServices
        SPI header.

        * Platform/spi/mac/ApplicationServicesSPI.h: Renamed from Source/WebKit/Platform/spi/mac/AccessibilityPrivSPI.h.
        * Shared/mac/AuxiliaryProcessMac.mm:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:

2019-10-15  Kate Cheney  <katherine_cheney@apple.com>

        REGRESSION (~244100) [Mac WK2 Debug] Layout Test http/tests/resourceLoadStatistics/prune-statistics.html is a flaky failure (197285)
        https://bugs.webkit.org/show_bug.cgi?id=197285
        <rdar://problem/50208370>

        Reviewed by Chris Dumez.

        This patch fixes a flaky failure which was being caused by other
        resourceLoadStatistics tests scheduling processing checks which
        were called during execution of prune-statistics.html.
        Now, any pending processing checks are cancelled between tests.

        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):

2019-10-15  Chris Dumez  <cdumez@apple.com>

        [iOS] Maintain the last Back/Forward cache entry when the application gets suspended
        https://bugs.webkit.org/show_bug.cgi?id=203014

        Reviewed by Geoffrey Garen.

        Previously, we would clear all back/forward cache entries when the application is about to
        be suspended. This means that we would lose fast-back when coming back to the application.
        To be memory-friendly but maintain the fast-back when coming back to the application, we now
        maintain the last back/forward cache entry when the application gets suspended.

        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::applicationIsAboutToSuspend):
        (WebKit::WebProcessPool::notifyProcessPoolsApplicationIsAboutToSuspend):
        * UIProcess/WebBackForwardCache.cpp:
        (WebKit::WebBackForwardCache::pruneToSize):
        * UIProcess/WebBackForwardCache.h:
        * UIProcess/WebProcessPool.h:
        * UIProcess/ios/ProcessAssertionIOS.mm:
        (-[WKProcessAssertionBackgroundTaskManager init]):
        (-[WKProcessAssertionBackgroundTaskManager _releaseBackgroundTask]):

        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::initializeWebProcess):
        A WebProcess no longer clears its PageCache on suspension on iOS. We let the UIProcess's
        back/forward cache control when PageCache entries should get destroyed. The back/forward
        cache will properly wake up a suspended process to clear one of its PageCache entries if
        needed.

2019-10-15  Andres Gonzalez  <andresg_22@apple.com>

        AX: Make AXIsolatedTree compile again
        https://bugs.webkit.org/show_bug.cgi?id=202702
        <rdar://problem/56084968>

        Reviewed by Joanmarie Diggs.

        Re-submitting r251045 with a fix for internal builds.

        * Platform/spi/mac/AccessibilityPrivSPI.h:
        * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
        (-[WKAccessibilityWebPageObjectBase isolatedTreeRootObject]):

2019-10-15  Chris Dumez  <cdumez@apple.com>

        Webview's drawing area may stay frozen on cross-site back/forward navigation
        https://bugs.webkit.org/show_bug.cgi?id=203004

        Reviewed by Tim Horton.

        Whenever the UIScene becomes foreground / background, the WebPageProxy notifies its currently associated
        WebPage in the committed WebProcess so that it can freeze / unfreeze its layer tree with the
        BackgroundApplication reason. The issue is that if a WebPage gets suspended on cross-site navigation
        (because the UIScene is in the background when the load commits), then the suspended WebPage kept its
        a BackgroundApplication freeze. When the UIScene becomes foreground, the WebPage only notifies its
        committed page so the suspended page keeps its BackgroundApplication freeze still. If the user now
        navigates back, it will restore the suspended WebPage and the view will stay frozen.

        To address the issue, we now have the WebPage drop its BackgroundApplication freeze reason, whenever
        it transitions from committed to suspended.

        * UIProcess/ios/WKApplicationStateTrackingView.mm:
        (-[WKApplicationStateTrackingView didMoveToWindow]):
        Fix logging, [self isBackground] needs to be called *after* _applicationStateTracker has been
        initialized, or it will return YES unconditionally.

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

2019-10-15  Peng Liu  <peng.liu6@apple.com>

        [Picture-in-Picture Web API] Implement HTMLVideoElement.requestPictureInPicture() / Document.exitPictureInPicture()
        https://bugs.webkit.org/show_bug.cgi?id=201024

        Reviewed by Eric Carlson.

        Add configurations for Picture-in-Picture API and add a preference option for it.

        * Configurations/FeatureDefines.xcconfig:
        * Shared/WebPreferences.yaml:

2019-10-15  youenn fablet  <youenn@apple.com>

        Move headers to keep from a HTTPHeaderNameSet to an OptionSet
        https://bugs.webkit.org/show_bug.cgi?id=202977

        Reviewed by Anders Carlsson.

        * NetworkProcess/NetworkResourceLoadParameters.cpp:
        (WebKit::NetworkResourceLoadParameters::decode):
        * NetworkProcess/NetworkResourceLoadParameters.h:

2019-10-15  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthn] Rename -[WKUIDelegatePrivate webView:runWebAuthenticationPanel:initiatedByFrame:completionHandler:] to -[WKUIDelegatePrivate _webView:runWebAuthenticationPanel:initiatedByFrame:completionHandler:]
        https://bugs.webkit.org/show_bug.cgi?id=202564
        <rdar://problem/55974027>

        Reviewed by Brent Fulgham.

        Rename the SPI to a proper SPI style.

        * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
        * UIProcess/Cocoa/UIDelegate.mm:
        (WebKit::UIDelegate::setDelegate):
        (WebKit::UIDelegate::UIClient::runWebAuthenticationPanel):

2019-10-15  youenn fablet  <youenn@apple.com>

        Scheduling a service worker job in server should wait for finishing the registration import
        https://bugs.webkit.org/show_bug.cgi?id=202975

        Reviewed by Chris Dumez.

        * WebProcess/Storage/WebSWClientConnection.cpp:
        (WebKit::WebSWClientConnection::scheduleJobInServer):
        We should not schedule a job until the registrations are fully imported.
        Covered by ServiceWorkerBasic API test flakily hitting debug asserts.

2019-10-15  Alex Christensen  <achristensen@webkit.org>

        Unreviewed, rolling out r251138.

        Broke API tests

        Reverted changeset:

        "Pass CORS-enabled schemes through WebProcess instead of
        having them NetworkProcess-global"
        https://bugs.webkit.org/show_bug.cgi?id=202891
        https://trac.webkit.org/changeset/251138

2019-10-15  Chris Dumez  <cdumez@apple.com>

        Stop using inheritance for WebBackForwardCacheEntry
        https://bugs.webkit.org/show_bug.cgi?id=202989

        Reviewed by Alex Christensen.

        Stop using inheritance for WebBackForwardCacheEntry. This simplifies the code a bit.

        * Sources.txt:
        * UIProcess/WebBackForwardCache.cpp:
        (WebKit::WebBackForwardCache::addEntry):
        (): Deleted.
        * UIProcess/WebBackForwardCacheEntry.cpp: Copied from Source/WebKit/UIProcess/WebBackForwardCacheEntry.h.
        (WebKit::WebBackForwardCacheEntry::WebBackForwardCacheEntry):
        (WebKit::WebBackForwardCacheEntry::~WebBackForwardCacheEntry):
        (WebKit::WebBackForwardCacheEntry::takeSuspendedPage):
        (WebKit::WebBackForwardCacheEntry::process const):
        * UIProcess/WebBackForwardCacheEntry.h:
        (WebKit::WebBackForwardCacheEntry::suspendedPage const):
        (WebKit::WebBackForwardCacheEntry::processIdentifier const):
        (WebKit::WebBackForwardCacheEntry::WebBackForwardCacheEntry): Deleted.
        * WebKit.xcodeproj/project.pbxproj:

2019-10-15  Alex Christensen  <achristensen@webkit.org>

        Pass CORS-enabled schemes through WebProcess instead of having them NetworkProcess-global
        https://bugs.webkit.org/show_bug.cgi?id=202891

        Reviewed by Youenn Fablet.

        No change in behavior.  Now the LegacySchemeRegistry is not used as much in the NetworkProcess, a step towards no use at all.
        This functionality is currently only available through the glib API webkit_security_manager_register_uri_scheme_as_cors_enabled
        but it has been requested in bug 201180 and bug 199064.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess):
        (WebKit::NetworkConnectionToWebProcess::loadPing):
        (WebKit::NetworkConnectionToWebProcess::registerURLSchemesAsCORSEnabled):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        (WebKit::NetworkConnectionToWebProcess::schemeRegistry):
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::NetworkLoadChecker):
        (WebKit::NetworkLoadChecker::doesNotNeedCORSCheck const):
        * NetworkProcess/NetworkLoadChecker.h:
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::initializeNetworkProcess):
        (WebKit::NetworkProcess::registerURLSchemeAsCORSEnabled const): Deleted.
        * NetworkProcess/NetworkProcess.messages.in:
        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
        (WebKit::NetworkProcessCreationParameters::decode):
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::m_shouldCaptureExtraNetworkLoadMetrics):
        * NetworkProcess/NetworkSchemeRegistry.cpp: Added.
        (WebKit::NetworkSchemeRegistry::registerURLSchemeAsCORSEnabled):
        (WebKit::NetworkSchemeRegistry::shouldTreatURLSchemeAsCORSEnabled):
        * NetworkProcess/NetworkSchemeRegistry.h: Added.
        (WebKit::NetworkSchemeRegistry::create):
        * NetworkProcess/PingLoad.cpp:
        (WebKit::PingLoad::PingLoad):
        Use nullptr, indicating that the PingLoad constructor that is used in ad click attribution should not check the custom scheme registry.
        This is Ok because ad click attribution is only used for HTTP family schemes.
        (WebKit::m_blobFiles):
        * NetworkProcess/PingLoad.h:
        * Sources.txt:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):
        (WebKit::WebProcessPool::registerURLSchemeAsCORSEnabled):
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::initializeWebProcess):
        (WebKit::WebProcess::registerURLSchemeAsCORSEnabled):
        (WebKit::WebProcess::ensureNetworkProcessConnection):
        (WebKit::WebProcess::registerURLSchemeAsCORSEnabled const): Deleted.
        * WebProcess/WebProcess.h:

2019-10-15  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Fix several GTK tests in /WebKit2Gtk/TestUIClient crashing since r241988

        Show a warning message and return nullptr from WebKitWebView::create if the new web view is not related to the
        given one. Also make it clear in the documentation that the new web view should be related to the given one.

        * UIProcess/API/glib/WebKitWebView.cpp:
        (webkit_web_view_class_init):
        (webkitWebViewCreateNewPage):

2019-10-15  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Fix GTK test /webkit/Authentication/authentication-storage after r249962

        * UIProcess/API/glib/WebKitWebView.cpp:
        (webkitWebViewHandleAuthenticationChallenge): Do not use webkit_settings_get_enable_private_browsing().

2019-10-15  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Fix GTK test /webkit/WebKitSettings/webkit-settings after r249962.

        Legacy private browsing was removed in r249962, so webkit_settings_set_enable_private_browsing() is now no-op.

        * UIProcess/API/glib/WebKitSettings.cpp:
        (webKitSettingsSetProperty): Only call webkit_settings_set_enable_private_browsing() when trying to enable it.
        (webkit_settings_set_enable_private_browsing): Show a warning to let users know that it does nothing now.

2019-10-15  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] WebKitWebContext should identify web views by their WebPageProxy identifier
        https://bugs.webkit.org/show_bug.cgi?id=202924

        Reviewed by Adrian Perez de Castro.

        Instead of the WebPage identifier, since it maps WebPageProxy to WebKitWebView.

        * UIProcess/API/glib/WebKitWebContext.cpp:
        (webkitWebContextCreatePageForWebView):
        (webkitWebContextWebViewDestroyed):
        (webkitWebContextGetWebViewForPage):

2019-10-15  youenn fablet  <youenn@apple.com>

        Handle service worker loads through NetworkResourceLoader
        https://bugs.webkit.org/show_bug.cgi?id=202309

        Unreviewed.
        Fix !ENABLE(SERVICE_WORKER) builds.

        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::continueWillSendRequest):
        (WebKit::NetworkResourceLoader::continueDidReceiveResponse):
        (WebKit::NetworkResourceLoader::serviceWorkerDidNotHandle):

2019-10-14  Youenn Fablet  <youenn@apple.com>

        Handle service worker loads through NetworkResourceLoader
        https://bugs.webkit.org/show_bug.cgi?id=202309

        Reviewed by Alex Christensen.

        Remove ServiceWorkerFetchClient.
        Instead we use the normal NetworkResourceLoader/WebResourceLoader communication channel.
        We pass additional parameters, in particular service worker mode and registration identifier.

        Based on that information, network process will decide whether to load from service worker or network.
        The first advantage is that in case of service worker not handling the load, going to the network is faster.
        This will also allow us to do the registration matching in network process when receiving a navigation request.

        ServiceWorkerFetchTask is now beefed up to do the link between service worker and NetworkResourceLoader/WebResourceLoader.
        To support the same console logging, we add a new message called DidFailServiceWorkerLoad.

        To support API tests, we continue to go to the service worker before trying to go to URL scheme handlers.
        This adds some burden as we need to go to network process/service worker process and, in case load is not handled
        by service worker, we go back to the web process to do the load through URL scheme handlers.
        For that purpose we use ServiceWorkersMode::Only.

        * CMakeLists.txt:
        * DerivedSources-input.xcfilelist:
        * DerivedSources-output.xcfilelist:
        * DerivedSources.make:
        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad):
        * NetworkProcess/NetworkResourceLoadParameters.cpp:
        (WebKit::NetworkResourceLoadParameters::encode const):
        (WebKit::NetworkResourceLoadParameters::decode):
        * NetworkProcess/NetworkResourceLoadParameters.h:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::abort):
        (WebKit::NetworkResourceLoader::didFailLoading):
        (WebKit::NetworkResourceLoader::continueWillSendRequest):
        (WebKit::NetworkResourceLoader::continueDidReceiveResponse):
        (WebKit::NetworkResourceLoader::startWithServiceWorker):
        (WebKit::NetworkResourceLoader::serviceWorkerDidNotHandle):
        * NetworkProcess/NetworkResourceLoader.h:
        * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp:
        (WebKit::ServiceWorkerFetchTask::ServiceWorkerFetchTask):
        (WebKit::ServiceWorkerFetchTask::~ServiceWorkerFetchTask):
        (WebKit::ServiceWorkerFetchTask::sendToServiceWorker):
        (WebKit::ServiceWorkerFetchTask::sendToClient):
        (WebKit::ServiceWorkerFetchTask::start):
        (WebKit::ServiceWorkerFetchTask::startFetch):
        (WebKit::ServiceWorkerFetchTask::didReceiveRedirectResponse):
        (WebKit::ServiceWorkerFetchTask::didReceiveResponse):
        (WebKit::ServiceWorkerFetchTask::didReceiveData):
        (WebKit::ServiceWorkerFetchTask::didReceiveFormData):
        (WebKit::ServiceWorkerFetchTask::didFinish):
        (WebKit::ServiceWorkerFetchTask::didFail):
        (WebKit::ServiceWorkerFetchTask::didNotHandle):
        (WebKit::ServiceWorkerFetchTask::cancelFromClient):
        (WebKit::ServiceWorkerFetchTask::continueDidReceiveFetchResponse):
        (WebKit::ServiceWorkerFetchTask::continueFetchTaskWith):
        (WebKit::ServiceWorkerFetchTask::timeoutTimerFired):
        * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h:
        (WebKit::ServiceWorkerFetchTask::fetchIdentifier const):
        (WebKit::ServiceWorkerFetchTask::serviceWorkerIdentifier const):
        * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
        (WebKit::WebSWServerConnection::cancelFetch):
        (WebKit::WebSWServerConnection::createFetchTask):
        (WebKit::WebSWServerConnection::startFetch):
        * NetworkProcess/ServiceWorker/WebSWServerConnection.h:
        * NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in:
        * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
        (WebKit::WebSWServerToContextConnection::startFetch):
        (WebKit::WebSWServerToContextConnection::continueDidReceiveFetchResponse):
        (WebKit::WebSWServerToContextConnection::didReceiveFetchTaskMessage):
        (WebKit::WebSWServerToContextConnection::registerFetch):
        (WebKit::WebSWServerToContextConnection::unregisterFetch):
        (WebKit::WebSWServerToContextConnection::fetchTaskTimedOut):
        * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
        (WebKit::WebSWServerToContextConnection::ipcConnection const):
        * Sources.txt:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/Network/NetworkProcessConnection.cpp:
        (WebKit::NetworkProcessConnection::didReceiveMessage):
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::scheduleLoad):
        * WebProcess/Network/WebResourceLoader.cpp:
        (WebKit::WebResourceLoader::didFailServiceWorkerLoad):
        (WebKit::WebResourceLoader::serviceWorkerDidNotHandle):
        * WebProcess/Network/WebResourceLoader.h:
        * WebProcess/Network/WebResourceLoader.messages.in:
        * WebProcess/Storage/ServiceWorkerClientFetch.cpp: Removed.
        * WebProcess/Storage/ServiceWorkerClientFetch.h: Removed.
        * WebProcess/Storage/ServiceWorkerClientFetch.messages.in: Removed.
        * WebProcess/Storage/WebSWClientConnection.cpp:
        * WebProcess/Storage/WebSWClientConnection.h:
        * WebProcess/Storage/WebServiceWorkerProvider.cpp:
        * WebProcess/Storage/WebServiceWorkerProvider.h:

2019-10-14  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] White pages in AC mode: Cannot get default EGL display: EGL_BAD_PARAMETER
        https://bugs.webkit.org/show_bug.cgi?id=202362

        Reviewed by Carlos Alberto Lopez Perez.

        * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
        (WebKit::DrawingAreaCoordinatedGraphics::updatePreferences): Disable accelerated compositing mode when we failed
        to reate the shared display for compositing.
        * WebProcess/glib/WebProcessGLib.cpp:
        (WebKit::WebProcess::platformInitializeWebProcess): Destroy the wpe display when initialization fails.

2019-10-14  Chris Dumez  <cdumez@apple.com>

        [WK2] Have WebBackForwardCache class coordinate page caching in all WebProcesses
        https://bugs.webkit.org/show_bug.cgi?id=202929
        <rdar://problem/56250421>

        Reviewed by Alex Christensen.

        Have WebBackForwardCache class coordinate page caching in all WebProcesses. To achieve this, the
        following changes were made:
        1. Whenever HistoryItem::m_cachedPage changes in WebCore, we notify the client that the HistoryItem
           has changed. I added a "hasCachedPage" boolean to the item info being passed the the UIProcess
           that is set based on whether or not HistoryItem::m_cachedPage is null.
        2. The WebBackForwardCache now contains WebBackForwardCacheEntry objects instead of SuspendedPage
           objects. A WebBackForwardCacheEntry may have a SuspendedPage or not. As a result, we can now
           add the the back/forward cache CachedPage entries from the WebContent process, which do not have
           a SuspendedPageProxy in the UIProcess.
        3. Now that WebBackForwardCache is aware of all CachedPages, it can properly enforce a cache capacity
           across call processes. Whenever a WebBackForwardCacheEntry is pruned from the cache and this entry
           does not have a SuspendedPageProxy, we send an IPC to the WebContent process to remove this
           cached page from the PageCache in WebCore.

        Previously, as soon as we would cache a page in the WebContent process, we would send an IPC to the
        UIProcess so that it would clear the PageCache in any previous WebContent process. This was a stop-gap
        measure to avoid blowing up memory in a multi-process model by keeping a PageCache around in all
        WebContent process. This would make sure only one process could have a PageCache at any point in time.
        This logic is now dropped since the WebBackForwardCache can keep track of all cached pages across all
        processes and enforce a cross-process limit on the number of cached pages. This means we can now have
        PageCache entries across several WebContent processes, as long as we do not exceed the maximum number
        of cached pages.

        * Platform/Logging.h:
        Add new BackForwardCache logging channel.

        * Shared/SessionState.cpp:
        (WebKit::BackForwardListItemState::encode const):
        (WebKit::BackForwardListItemState::decode):
        * Shared/SessionState.h:
        Add new bit to BackForwardListItemState to indicate whether a HistoryItem has an associated
        CachedPage or not.

        * Shared/WebBackForwardListItem.cpp:
        (WebKit::WebBackForwardListItem::~WebBackForwardListItem):
        (WebKit::WebBackForwardListItem::wasRemovedFromBackForwardList):
        (WebKit::WebBackForwardListItem::removeFromBackForwardCache):
        (WebKit::WebBackForwardListItem::setBackForwardCacheEntry):
        (WebKit::WebBackForwardListItem::suspendedPage const):
        (WebKit::WebBackForwardListItem::loggingString):
        * Shared/WebBackForwardListItem.h:
        (WebKit::WebBackForwardListItem::backForwardCacheEntry const):
        WebBackForwardListItem now own a WebBackForwardCacheEntry instead of simply a
        SuspendedPage. The WebBackForwardCacheEntry may have a SuspendedPage or not.
        Now, whenever a HistoryItem has a CachedPage in WebCore, its corresponding
        WebBackForwardListItem in the UIProcess has an associated WebBackForwardCacheEntry
        whether we have a SuspendedPageProxy for it in the UIProcess or not.

        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const):
        (WebKit::WebProcessCreationParameters::decode):
        * Shared/WebProcessCreationParameters.h:
        Pass the PageCache capacity to the WebContent process on creation, so that it matches the
        capacity of the WebBackForwardCache in the UIProcess.

        * UIProcess/ProvisionalPageProxy.cpp:
        (WebKit::ProvisionalPageProxy::goToBackForwardItem):
        * UIProcess/SuspendedPageProxy.cpp:
        (WebKit::messageNamesToIgnoreWhileSuspended):
        (WebKit::SuspendedPageProxy::suspensionTimedOut):
        * UIProcess/SuspendedPageProxy.h:
        Stop storing the WebBackForwardListItem on the SuspendedPageProxy. This avoids having to
        keep this pointer up to date. We do not really need it as we can now ask the WebBackForwardCache
        to clear an entry by giving it a SuspendedPageProxy to match. Given how many entries we have at
        most in the cache (2), iterating over them to find the one with a given suspended page is cheap.

        * UIProcess/WebBackForwardCache.cpp:
        (WebKit::WebBackForwardCache::WebBackForwardCache):
        (WebKit::WebBackForwardCache::~WebBackForwardCache):

        (WebKit::WebBackForwardCache::setCapacity):
        Send an IPC of each WebProcess whenever the capacity of the WebBackForwardCache changes, in order
        to update the capacity of the PageCache in those processes.

        (WebKit::WebBackForwardCache::addEntry):
        (WebKit::WebBackForwardCache::removeEntry):
        (WebKit::WebBackForwardCache::takeSuspendedPage):
        (WebKit::WebBackForwardCache::removeEntriesForProcess):
        (WebKit::WebBackForwardCache::removeEntriesForSession):
        (WebKit::WebBackForwardCache::removeEntriesMatching):
        (WebKit::WebBackForwardCache::clear):

        * UIProcess/WebBackForwardCache.h:
        Use a Vector instead of a ListHashSet to store the entries. Given that we have at most 2 entries, using
        a Vector will likely be more efficient and definitely use less memory.

        * UIProcess/WebBackForwardCacheEntry.h: Added.
        (WebKit::WebBackForwardCacheEntry::backForwardCache const):
        (WebKit::WebBackForwardCacheEntry::WebBackForwardCacheEntry):
        Add new WebBackForwardCacheEntry abstraction to match the concept of WebCore::CachedPage in the UIProcess.
        A WebBackForwardCacheEntry may have a SuspendedPageProxy associated with it in the UIProcess or not.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        Drop didSaveToPageCache as it is no longer necessary.

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::initializeNewWebProcess):
        (WebKit::WebProcessPool::disconnectProcess):
        * UIProcess/WebProcessPool.h:

        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::updateBackForwardItem):
        Whenever we get a BackForwardItem from the WebContent process, we now check it now has
        an associated CachedPage or not. If it does, we make sure we add a corresponding
        entry in the WebBackForwardCache so that the UIProcess knows about it. If it no longer
        has a CachedPage and we don't have a SuspendedPageProxy for this item in the UIProcess,
        then we remove the corresponding entry from the back/forward cache. Note that we don't
        drop SuspendedPageProxy objects in the UIProcess simply because their corresponding
        CachedPage in the WebProcess is gone, to maintain previous behavior. This is an
        optimization that is useful on iOS, where we do not have a WebProcessCache, since we
        can reuse processes from SuspendedPageProxies on navigation.

        * UIProcess/WebProcessProxy.h:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
        (WebKit::toBackForwardListItemState):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::initializeWebProcess):
        (WebKit::WebProcess::setBackForwardCacheCapacity):
        (WebKit::WebProcess::clearCachedPage):
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:

2019-10-14  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Clipboard API] Refactor custom pasteboard writing codepaths to handle multiple items
        https://bugs.webkit.org/show_bug.cgi?id=202916

        Reviewed by Tim Horton.

        Change more function and method signatures from `const PasteboardCustomData&` to
        `const Vector<PasteboardCustomData>&`.

        * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
        (WebKit::WebPasteboardProxy::writeCustomData):
        * UIProcess/WebPasteboardProxy.cpp:
        (WebKit::WebPasteboardProxy::writeCustomData):
        * UIProcess/WebPasteboardProxy.h:
        * UIProcess/WebPasteboardProxy.messages.in:
        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
        (WebKit::WebPlatformStrategies::writeCustomData):
        * WebProcess/WebCoreSupport/WebPlatformStrategies.h:

2019-10-14  Per Arne Vollan  <pvollan@apple.com>

        REGRESSION(251087): Several API tests are failing
        https://bugs.webkit.org/show_bug.cgi?id=202961

        Reviewed by Brent Fulgham.

        WebPageProxy::maybeInitializeSandboxExtensionHandle returns early if the WebContent process is currently launching,
        since the audit token is needed to create the sandbox extension. The audit token will not be available until the
        process has finished launching. In the same way, the method should return early if the WebContent process has
        terminated.

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

2019-10-14  Matt Mokary  <mmokary@apple.com>

        FindController::findString always updates foundStringMatchIndex even if match is the same as before
        https://bugs.webkit.org/show_bug.cgi?id=201775
        <rdar://problem/55352425>

        Reviewed by Tim Horton.

        Allow an update to a find string without changing current match index, as is often the desired behavior when
        modifying a query rather than moving forward or backward through a match set.

        * Shared/WebFindOptions.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (toFindOptions):
        * UIProcess/API/Cocoa/_WKFindOptions.h:
        * WebProcess/WebPage/FindController.cpp:
        (WebKit::FindController::findString):
        Do not change match index if NoIndexChange bit is set. Otherwise, no change in behavior.

2019-10-14  David Quesada  <david_quesada@apple.com>

        Remove WebCore::IOSApplication::isWebApp()
        https://bugs.webkit.org/show_bug.cgi?id=181259

        Reviewed by Alex Christensen.

        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::defaultApplicationCacheDirectory):
            Remove the wording "this is not supported as of right now", as it seems to be supported
            since r247686, which added SPI on _WKWebsiteDataStoreConfiguration to set the application
            cache directory.

2019-10-14  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Clipboard API] Support writing multiple PasteboardCustomData with SharedBuffers to the pasteboard
        https://bugs.webkit.org/show_bug.cgi?id=202851

        Reviewed by Darin Adler.

        See WebCore ChangeLog for more details.

        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<PasteboardCustomData::Entry>::encode):
        (IPC::ArgumentCoder<PasteboardCustomData::Entry>::decode):

        Add helpers to encode and decode PasteboardCustomData::Entry.

        (IPC::ArgumentCoder<PasteboardCustomData>::encode):
        (IPC::ArgumentCoder<PasteboardCustomData>::decode):
        * Shared/WebCoreArgumentCoders.h:

        Add support for encoding and decoding PasteboardCustomData by encoding and decoding each of its items (see
        above).

        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::requestDOMPasteAccess):
        * UIProcess/WebPasteboardProxy.h:
        * UIProcess/WebPasteboardProxy.messages.in:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView canPerformActionForWebView:withSender:]):
        (allPasteboardItemOriginsMatchOrigin):
        (-[WKContentView _didHandleAdditionalDragItemsRequest:]):

        Tweak several methods to use the new methods on PasteboardCustomData instead of accessing the member variables
        directly.

        (-[WKContentView cleanUpDragSourceSessionState]):
        (-[WKContentView _prepareToDragPromisedAttachment:]):
        (-[WKContentView _itemsForBeginningOrAddingToSessionWithRegistrationLists:stagedDragSource:]):
        (-[WKContentView dragInteraction:itemsForBeginningSession:]):
        (-[WKContentView _itemsForBeginningOrAddingToSessionWithRegistrationList:stagedDragSource:]): Deleted.

        Adjust these methods to handle multiple staged item providers (for now, it remains that iOS drag and drop
        codepaths will still only write a single item to the pasteboard).

2019-10-14  Per Arne Vollan  <pvollan@apple.com>

        [macOS] Sandbox extensions should be created with audit tokens, not PIDs
        https://bugs.webkit.org/show_bug.cgi?id=201828

        Reviewed by Brent Fulgham.

        Stop issuing mach/read sandbox extensions by PID in the UI process, and use audit tokens instead.
        The audit tokens for the WebContent processes are retrieved from the IPC connection to the process.

        * Shared/Cocoa/SandboxExtensionCocoa.mm:
        (WebKit::SandboxExtensionImpl::create):
        (WebKit::SandboxExtensionImpl::sandboxExtensionForType):
        (WebKit::SandboxExtensionImpl::SandboxExtensionImpl):
        (WebKit::SandboxExtension::createHandleForMachLookupByAuditToken):
        (WebKit::SandboxExtension::createHandleForReadByAuditToken):
        (WebKit::SandboxExtension::createHandleForMachLookupByPid): Deleted.
        (WebKit::SandboxExtension::createHandleForReadByPid): Deleted.
        * Shared/SandboxExtension.h:
        * UIProcess/Cocoa/WebPageProxyCocoa.mm:
        (WebKit::WebPageProxy::createSandboxExtensionsIfNeeded):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
        (WebKit::WebPageProxy::loadRequestWithNavigationShared):
        (WebKit::WebPageProxy::loadFile):
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::shouldSendPendingMessage):
        (WebKit::WebProcessProxy::didFinishLaunching):
        * UIProcess/ios/WebProcessProxyIOS.mm:
        (WebKit::WebProcessProxy::unblockAccessibilityServerIfNeeded):

2019-10-14  Myles C. Maxfield  <mmaxfield@apple.com>

        [Cocoa] REGRESSION (r245672): Contenteditable with optical sizing freezes Safari
        https://bugs.webkit.org/show_bug.cgi?id=202262

        Reviewed by Tim Horton.

        r250640 didn't go far enough. We need to apply the same fix everywhere [NSFontDescriptor fontDescriptorWithFontAttributes:] is called.

        * Shared/Cocoa/ArgumentCodersCocoa.mm:
        (IPC::decodeFontInternal):
        * Shared/Cocoa/CoreTextHelpers.h: Added.
        * Shared/Cocoa/CoreTextHelpers.mm: Added.
        (fontDescriptorWithFontAttributes):
        * SourcesCocoa.txt:
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::updateFontManagerIfNeeded):
        * UIProcess/mac/WebPopupMenuProxyMac.mm:
        (WebKit::WebPopupMenuProxyMac::showPopupMenu):
        * WebKit.xcodeproj/project.pbxproj:

2019-10-14  Truitt Savell  <tsavell@apple.com>

        Unreviewed, rolling out r251045.

        Broke internal builds

        Reverted changeset:

        "AX: Make AXIsolatedTree compile again"
        https://bugs.webkit.org/show_bug.cgi?id=202702
        https://trac.webkit.org/changeset/251045

2019-10-14  youenn fablet  <youenn@apple.com>

        Reuse existing web processes for running service workers
        https://bugs.webkit.org/show_bug.cgi?id=202195

        Unreviewed.

        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::disableServiceWorkers):
        (WebKit::WebProcessProxy::enableServiceWorkers):
        Fix case where ENABLE_SERVICE_WORKER is not defined.

2019-10-14  Philippe Normand  <pnormand@igalia.com>

        [GTK][WebInspector] Support for saving data
        https://bugs.webkit.org/show_bug.cgi?id=202894

        Reviewed by Carlos Garcia Campos.

        Implement the WebInspectorProxy::platformSave() method. This
        allows users to save the inspector performance measurements, for
        instance.

        * UIProcess/gtk/WebInspectorProxyGtk.cpp:
        (WebKit::WebInspectorProxy::platformSave):
        * WebProcess/WebPage/gtk/WebInspectorUIGtk.cpp:
        (WebKit::WebInspectorUI::canSave):

2019-10-14  youenn fablet  <youenn@apple.com>

        Reuse existing web processes for running service workers
        https://bugs.webkit.org/show_bug.cgi?id=202195

        Reviewed by Chris Dumez.

        When network process asks for a service worker context connection,
        we now iterate through existing web processes and reuse one if both session
        and registrable domain match.
        We then ask the web process to create a context connection to the network process.

        When network process no longer needs the connection, it instructs the UIProcess
        that will update its state so that the web process is no longer considered as running
        service workers.
        UIProcess then instructs the web process to stop its service workers and its connection.

        Later on, the same web process may be reused for running service workers in which case
        a new connection will replace the stopped connection.

        Similarly, on network process crash, all web process running service workers are updated
        so that they are no longer considered as running service workers.

        Add a boolean state to WebProcessPool to control whether creating a separate service worker process.

        We no longer terminate the web process when stopping service workers or when network process crash.
        We use the enableTermination/disableTermination at context connection start/stop time.
        We consider that the context connection is similar to running a page in the process and creating/removing a page
        calls disableTermination/enableTermination.

        NetworkProcess is handling the management of service worker processes by checking for clients.
        In case there is no client, the process is terminated.
        This removes the need for the WebProcessPool service worker process timer.
        This patch removes this timer.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
        (WebKit::NetworkConnectionToWebProcess::establishSWContextConnection):
        (WebKit::NetworkConnectionToWebProcess::closeSWContextConnection):
        (WebKit::NetworkConnectionToWebProcess::serverToContextConnectionNoLongerNeeded):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * NetworkProcess/NetworkHTTPSUpgradeChecker.cpp:
        * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
        (WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection):
        (WebKit::WebSWServerToContextConnection::~WebSWServerToContextConnection):
        (WebKit::WebSWServerToContextConnection::messageSenderConnection const):
        (WebKit::WebSWServerToContextConnection::connectionIsNoLongerNeeded):
        (WebKit::WebSWServerToContextConnection::startFetch):
        * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
        * UIProcess/API/C/WKContext.cpp:
        (WKContextSetUseSeparateServiceWorkerProcess):
        * UIProcess/API/C/WKContextPrivate.h:
        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _setUseSeparateServiceWorkerProcess:]):
        (-[WKProcessPool _webPageContentProcessCount]):
        * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::workerContextConnectionNoLongerNeeded):
        * 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::terminateNetworkProcess):
        (WebKit::WebProcessPool::setUseSeparateServiceWorkerProcess):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::createForServiceWorkers):
        (WebKit::WebProcessProxy::canTerminateAuxiliaryProcess):
        (WebKit::WebProcessProxy::didStartProvisionalLoadForMainFrame):
        (WebKit::WebProcessProxy::disableServiceWorkers):
        (WebKit::WebProcessProxy::enableServiceWorkers):
        * UIProcess/WebProcessProxy.h:
        (WebKit::WebProcessProxy::isMatchingRegistrableDomain const):
        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        (WebKit::m_userAgent):
        (WebKit::WebSWContextManagerConnection::terminateWorker):
        (WebKit::WebSWContextManagerConnection::syncTerminateWorker):
        (WebKit::WebSWContextManagerConnection::close):
        * WebProcess/Storage/WebSWContextManagerConnection.h:
        * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::networkProcessConnectionClosed):
        (WebKit::WebProcess::registerServiceWorkerClients):

2019-10-12  Chris Dumez  <cdumez@apple.com>

        Back/Forward cache does not work after doing a favorite navigation
        https://bugs.webkit.org/show_bug.cgi?id=202762
        <rdar://problem/56126911>

        Reviewed by Antti Koivisto.

        When a process-swap was forced by the client, we would always close the page in the previous
        process after navigating. This would prevent leveraging the back/forward cache when navigating
        back after such a process-swap. The reason we were doing this is that other pages may have
        opener link to this page and closing the page was an easy way to break this opener link.

        To address the issue, we no longer close the previous page when a process-swap is forced by the
        client. Instead, we make sure to disconnect the frames' openees from their opener then the opener
        enters the page cache.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::suspendCurrentPageIfPossible):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::suspendForProcessSwap):

2019-10-12  Chris Dumez  <cdumez@apple.com>

        Clearing Website data for a given session should not shut down cached processes for other sessions
        https://bugs.webkit.org/show_bug.cgi?id=202865
        <rdar://problem/56202912>

        Reviewed by Antti Koivisto.

        When clearing Website data for a given data store, we now only clear cached processes
        (either if BackForwardCache or WebProcessCache) if they are associated with this
        particular data store. It is very wasteful otherwise.

        * UIProcess/ProvisionalPageProxy.cpp:
        (WebKit::ProvisionalPageProxy::~ProvisionalPageProxy):
        * UIProcess/SuspendedPageProxy.cpp:
        (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
        ProvisionalPageProxy & SuspendedPageProxy's destructors no longer call
        WebProcessProxy::maybeShutdown() asynchronously. We now call maybeShutdown()
        synchronously in WebProcessProxy::decrementSuspendedPageCount() and
        WebProcessProxy::removeProvisionalPageProxy() instead. This makes things a
        lot more predictable.

        * UIProcess/WebBackForwardCache.cpp:
        (WebKit::WebBackForwardCache::removeEntriesForSession):
        Add new removeEntriesForSession() method to clear only back / forward cache
        entries associated with a particular session.

        (WebKit::WebBackForwardCache::clear):
        Stop taking a parameter indicating if we allow the processes to enter the
        process cache. Now that we call maybeShutdown() synchronously when destroying
        a SuspendedPageProxy, we can simply allow the processes to enter the process
        cache unconditionally. If the caller does not want this processes in the page
        cache, they can clear the process cache afterwards.

        * UIProcess/WebBackForwardCache.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
        Now that destroying a SuspendedPageProxy or a ProvisionalPageProxy may shutdown
        their process synchronously, add a scope here to prevent shutdown of the process
        for the duration of this scope, since we're about to use it for a navigation and
        we don't want it to get shutdown, even if there is no longer anything using it.

        (WebKit::WebPageProxy::continueNavigationInNewProcess):
        Add new assertion and rename parameter for consistency.

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

        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::addProvisionalPageProxy):
        Add new assertion.

        (WebKit::WebProcessProxy::removeProvisionalPageProxy):
        Call maybeShutDown() if this was the last provisional page.

        (WebKit::WebProcessProxy::maybeShutDown):
        Drop parameter indicating if we want to allow the process to enter the process
        cache and allow caching unconditionally.

        (WebKit::WebProcessProxy::canTerminateAuxiliaryProcess):
        Prevent termination if there is a ScopePreventingShutdown.

        (WebKit::WebProcessProxy::decrementSuspendedPageCount):
        Call maybeShutDown() if this was the last suspended page.

        * UIProcess/WebProcessProxy.h:
        (WebKit::WebProcessProxy::ScopePreventingShutdown::ScopePreventingShutdown):
        (WebKit::WebProcessProxy::ScopePreventingShutdown::~ScopePreventingShutdown):
        (WebKit::WebProcessProxy::makeScopePreventingShutdown):
        Add new facility to prevent shutdown of a process for the duration of the scope.

        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::removeData):
        When removing website data, only clear cached processes if they are associated with
        the current data store.

2019-10-12  Chris Fleizach  <cfleizach@apple.com>

        AX: Make AXIsolatedTree compile again
        https://bugs.webkit.org/show_bug.cgi?id=202702
        <rdar://problem/56084968>

        Reviewed by Joanmarie Diggs.

        * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
        (-[WKAccessibilityWebPageObjectBase isolatedTreeRootObject]):

2019-10-11  Rob Buis  <rbuis@igalia.com>

        Cleanup RuntimeEnabledFeatures includes
        https://bugs.webkit.org/show_bug.cgi?id=202857

        Reviewed by Eric Carlson.

        These classes must have had made use of runtime flags before
        but are not using them anymore.

        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
        * UIProcess/WebAuthentication/Cocoa/LocalService.mm:
        * UIProcess/WebProcessPool.cpp:

2019-10-11  Chris Dumez  <cdumez@apple.com>

        Move SuspendedPage logic from WebProcessPool to new WebBackForwardCache class
        https://bugs.webkit.org/show_bug.cgi?id=202660

        Reviewed by Antti Koivisto.

        Move SuspendedPage logic from WebProcessPool to new WebBackForwardCache class. This is
        a first step towards implementing back / forward cache handling in the UIProcess.

        The following changes were made:
        1. SuspendedPageProxy objects are now normally owned by their associated WebBackForwardListItem
           (Similarly to CachedPage objects being owned by their HistoryItem in WebCore) instead of the
           WebProcessPool.
        2. A new WebBackForwardCache class is introduced to cap the number of cached pages and clear
           them (similary to the PageCache in WebCore).

        * Shared/WebBackForwardListItem.cpp:
        (WebKit::WebBackForwardListItem::~WebBackForwardListItem):
        (WebKit::WebBackForwardListItem::wasRemovedFromBackForwardList):
        (WebKit::WebBackForwardListItem::setSuspendedPage):
        (WebKit::WebBackForwardListItem::takeSuspendedPage):
        (WebKit::WebBackForwardListItem::suspendedPage const):
        * Shared/WebBackForwardListItem.h:
        * Sources.txt:
        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _maximumSuspendedPageCount]):
        * UIProcess/RemoteLayerTree/mac/ScrollingTreeOverflowScrollingNodeRemoteMac.cpp:
        * UIProcess/SuspendedPageProxy.cpp:
        (WebKit::SuspendedPageProxy::findReusableSuspendedPageProcess):
        (WebKit::SuspendedPageProxy::SuspendedPageProxy):
        (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
        (WebKit::SuspendedPageProxy::setBackForwardListItem):
        (WebKit::SuspendedPageProxy::clearBackForwardListItem):
        (WebKit::SuspendedPageProxy::backForwardCache const):
        (WebKit::SuspendedPageProxy::suspensionTimedOut):
        * UIProcess/SuspendedPageProxy.h:
        * UIProcess/WebAuthentication/Mock/MockHidConnection.h:
        * UIProcess/WebAuthentication/Mock/MockHidService.h:
        * UIProcess/WebBackForwardCache.cpp: Added.
        (WebKit::WebBackForwardCache::removeOldestEntry):
        (WebKit::WebBackForwardCache::setCapacity):
        (WebKit::WebBackForwardCache::addEntry):
        (WebKit::WebBackForwardCache::removeEntry):
        (WebKit::WebBackForwardCache::takeEntry):
        (WebKit::WebBackForwardCache::removeEntriesForProcess):
        (WebKit::WebBackForwardCache::removeEntriesForPage):
        (WebKit::WebBackForwardCache::removeEntriesMatching):
        (WebKit::WebBackForwardCache::clear):
        * UIProcess/WebBackForwardCache.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Mock/MockHidService.h.
        (WebKit::WebBackForwardCache::capacity const):
        (WebKit::WebBackForwardCache::size const):
        * UIProcess/WebBackForwardList.cpp:
        (WebKit::WebBackForwardList::didRemoveItem):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::suspendCurrentPageIfPossible):
        (WebKit::WebPageProxy::backForwardCache const):
        (WebKit::WebPageProxy::shouldUseBackForwardCache const):
        (WebKit::WebPageProxy::close):
        (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
        (WebKit::WebPageProxy::resetState):
        (WebKit::WebPageProxy::enterAcceleratedCompositingMode):
        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::process const):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::m_webProcessCache):
        (WebKit::WebProcessPool::disconnectProcess):
        (WebKit::WebProcessPool::processForRegistrableDomain):
        (WebKit::WebProcessPool::handleMemoryPressureWarning):
        (WebKit::WebProcessPool::updateBackForwardCacheCapacity):
        (WebKit::WebProcessPool::setCacheModel):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::removeData):
        (WebKit::WebsiteDataStore::setMockWebAuthenticationConfiguration):
        * WebKit.xcodeproj/project.pbxproj:

2019-10-11  Alex Christensen  <achristensen@webkit.org>

        Only use CFNetwork SPI for metrics where needed
        https://bugs.webkit.org/show_bug.cgi?id=202825

        Reviewed by Joseph Pecoraro.

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (stringForSSLProtocolVersion):
        (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):

2019-10-11  Kate Cheney  <katherine_cheney@apple.com>

        Get StorageAccess API features working on SQLite database implementation (195422)
        https://bugs.webkit.org/show_bug.cgi?id=195422
        <rdar://problem/54213519>

        Reviewed by Brent Fulgham.

        This patch migrates the http/tests/storageAccess/ Layout tests to
        use the ITP database and uncovered 3 bugs in the process.

        1. It was previously blocking cookies to a third party domain which
        was not marked as prevalent. Now it ensures that the user is prompted
        using the storage acess API regarding that third party domain.

        2. It was not requesting storage access if cookies had previously been
        blocked. Now it will only return early from
        ResourceLoadStatisticsDatabaseStore::requestStorageAccessUnderOpener
        if cookie access is allowed, and request storage access otherwise.

        3. hasUserGrantedStorageAccessThroughPrompt was returning true even
        if the result was not previously granted storage access.

        All of these fixes match behavior in
        ResourceLoadStatisticsMemoryStore.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccess):
        (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccessUnderOpener):
        (WebKit::ResourceLoadStatisticsDatabaseStore::hasUserGrantedStorageAccessThroughPrompt):

2019-10-11  Dean Jackson  <dino@apple.com>

        REGRESSION: fast/events/touch/ios/long-press-on-image.html is failing
        https://bugs.webkit.org/show_bug.cgi?id=202845

        Reviewed by Antoine Quint.

        Update _contentsOfUserInterfaceItem so that it returns more information
        on a context menu.

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

2019-10-11  Alex Christensen  <achristensen@webkit.org>

        Use sendWithAsyncReply for cookie getting/clearing functions
        https://bugs.webkit.org/show_bug.cgi?id=202841

        Reviewed by Carlos Garcia Campos.

        No change in behavior.  This just simplifies the message sending a bit.

        * NetworkProcess/Cookies/WebCookieManager.cpp:
        (WebKit::WebCookieManager::getHostnamesWithCookies):
        (WebKit::WebCookieManager::deleteAllCookies):
        (WebKit::WebCookieManager::deleteCookie):
        (WebKit::WebCookieManager::deleteAllCookiesModifiedSince):
        (WebKit::WebCookieManager::getAllCookies):
        (WebKit::WebCookieManager::getCookies):
        (WebKit::WebCookieManager::setCookie):
        (WebKit::WebCookieManager::setCookies):
        (WebKit::WebCookieManager::setHTTPCookieAcceptPolicy):
        (WebKit::WebCookieManager::getHTTPCookieAcceptPolicy):
        * NetworkProcess/Cookies/WebCookieManager.h:
        * NetworkProcess/Cookies/WebCookieManager.messages.in:
        * NetworkProcess/Cookies/mac/WebCookieManagerMac.mm:
        * UIProcess/API/APIHTTPCookieStore.cpp:
        (API::HTTPCookieStore::cookies):
        (API::HTTPCookieStore::setCookies):
        (API::HTTPCookieStore::deleteCookie):
        (API::HTTPCookieStore::setHTTPCookieAcceptPolicy):
        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _setCookieAcceptPolicy:]):
        * UIProcess/API/glib/WebKitCookieManager.cpp:
        (webkit_cookie_manager_set_accept_policy):
        (webkit_cookie_manager_get_accept_policy):
        (webkit_cookie_manager_add_cookie):
        (webkit_cookie_manager_get_cookies):
        (webkit_cookie_manager_delete_cookie):
        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::addSingleCookie):
        * UIProcess/AuxiliaryProcessProxy.h:
        (WebKit::AuxiliaryProcessProxy::sendWithAsyncReply):
        * UIProcess/WebCookieManagerProxy.cpp:
        (WebKit::WebCookieManagerProxy::processPoolDestroyed):
        (WebKit::WebCookieManagerProxy::processDidClose):
        (WebKit::WebCookieManagerProxy::getHostnamesWithCookies):
        (WebKit::WebCookieManagerProxy::deleteCookie):
        (WebKit::WebCookieManagerProxy::deleteAllCookiesModifiedSince):
        (WebKit::WebCookieManagerProxy::setCookies):
        (WebKit::WebCookieManagerProxy::getAllCookies):
        (WebKit::WebCookieManagerProxy::getCookies):
        (WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy):
        (WebKit::WebCookieManagerProxy::getHTTPCookieAcceptPolicy):
        (WebKit::WebCookieManagerProxy::didGetHostnamesWithCookies): Deleted.
        (WebKit::WebCookieManagerProxy::didSetCookies): Deleted.
        (WebKit::WebCookieManagerProxy::didGetCookies): Deleted.
        (WebKit::WebCookieManagerProxy::didDeleteCookies): Deleted.
        (WebKit::WebCookieManagerProxy::didGetHTTPCookieAcceptPolicy): Deleted.
        (WebKit::WebCookieManagerProxy::didSetHTTPCookieAcceptPolicy): Deleted.
        * UIProcess/WebCookieManagerProxy.h:
        * UIProcess/WebCookieManagerProxy.messages.in:

2019-10-10  Alex Christensen  <achristensen@webkit.org>

        Remove unused WebProcessPool::requestNetworkingStatistics
        https://bugs.webkit.org/show_bug.cgi?id=202818

        Reviewed by Chris Dumez.

        Its only use was removed in rdar://problem/56160996

        * NetworkProcess/Downloads/DownloadManager.h:
        (WebKit::DownloadManager::isDownloading const):
        (WebKit::DownloadManager::activeDownloadCount const): Deleted.
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::getNetworkProcessStatistics): Deleted.
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * Shared/Authentication/AuthenticationManager.h:
        (WebKit::AuthenticationManager::outstandingAuthenticationChallengeCount const): Deleted.
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::didReceiveMessage):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::getStatistics):
        (WebKit::WebProcessPool::requestNetworkingStatistics): Deleted.
        * UIProcess/WebProcessPool.h:

2019-10-10  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [WinCairo] Move remote communication handling from RemoteInspectorServer to RemoteInspector.
        https://bugs.webkit.org/show_bug.cgi?id=202763

        Reviewed by Ross Kirsling.

        Remove deleted method invocations.

        * UIProcess/win/WebProcessPoolWin.cpp:
        (WebKit::initializeRemoteInspectorServer):
        (WebKit::WebProcessPool::platformInitialize):

2019-10-10  Youenn Fablet  <youenn@apple.com>

        Do not timeout a load intercepted by service worker that receives a response
        https://bugs.webkit.org/show_bug.cgi?id=202787

        Reviewed by Chris Dumez.

        Stop making ServiceWorkerFetchTask ref counted since it is not needed and
        can potentially make ServiceWorkerFetchTask oulive its WebSWServerToContextConnection member.

        Stop the ServiceWorkerFetchTask timeout timer whenever receiving a response so that the load will not timeout in that case.
        This ensures that a load that is starting in a service worker will not be failing.
        Instead the load will go to network process.

        Removed m_didReachTerminalState which is not needed as WebSWServerToContextConnection unregisters the ServiceWorkerFetchTask
        as an IPC listener for all terminating messages.

        * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp:
        (WebKit::ServiceWorkerFetchTask::didReceiveRedirectResponse):
        (WebKit::ServiceWorkerFetchTask::didReceiveResponse):
        (WebKit::ServiceWorkerFetchTask::didReceiveData):
        (WebKit::ServiceWorkerFetchTask::didReceiveFormData):
        (WebKit::ServiceWorkerFetchTask::didFinish):
        (WebKit::ServiceWorkerFetchTask::didFail):
        (WebKit::ServiceWorkerFetchTask::didNotHandle):
        (WebKit::ServiceWorkerFetchTask::timeoutTimerFired):
        * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h:
        * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
        (WebKit::WebSWServerToContextConnection::startFetch):
        (WebKit::WebSWServerToContextConnection::fetchTaskTimedOut):
        Use a Vector instead of a HasSet for performance reasons.
        Update according fetch map using unique_ptr instead of Ref<>.
        * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:

2019-10-10  Rob Buis  <rbuis@igalia.com>

        SpeculativeLoad should use CompletionHandler
        https://bugs.webkit.org/show_bug.cgi?id=202795

        Reviewed by Chris Dumez.

        SpeculativeLoad should use CompletionHandler, as remarked in
        Bug 201641 review.

        * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:

2019-10-10  Wenson Hsieh  <wenson_hsieh@apple.com>

        Support programmatic paste requests on macOS
        https://bugs.webkit.org/show_bug.cgi?id=202773
        <rdar://problem/48957166>

        Reviewed by Tim Horton.

        Adds support for programmatic paste requests on macOS, as well as some testing SPI in WKWebView to allow
        WebKitTestRunner to grab the NSMenu used for the DOM paste request. This patch adopts the same strategy taken to
        allow programmatic paste on iOS, by allowing programmatic pastes coming from the page to show platform UI which
        the user must then interact with in order to proceed with the paste. See below for more details.

        * Shared/WebPreferencesDefaultValues.h:

        Make this available on both iOS and macOS (iOS family is omitted for now, since callout bar UI is not generally
        present on non-iOS iOS-family platforms such as Apple Watch).

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

        This selector is called when the user taps the Paste option in the presented NSMenu.

        (-[WKWebView _activeMenu]):

        Returns the currently active NSMenu. Only for testing purposes.

        * UIProcess/API/Cocoa/WKWebViewInternal.h:
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/API/mac/WKView.mm:
        (-[WKView _web_grantDOMPasteAccess]):

        Same exercise as above, only for WKView instead of WKWebView.

        * UIProcess/Cocoa/WebViewImpl.h:
        (WebKit::WebViewImpl::domPasteMenu const):
        * UIProcess/Cocoa/WebViewImpl.mm:
        (-[WKDOMPasteMenuDelegate initWithWebViewImpl:]):
        (-[WKDOMPasteMenuDelegate menuDidClose:]):
        (-[WKDOMPasteMenuDelegate numberOfItemsInMenu:]):
        (-[WKDOMPasteMenuDelegate confinementRectForMenu:onScreen:]):

        Adds a new object, whose purpose is to be a delegate for the NSMenu that is presented when requesting DOM paste
        access. This object is used instead of WKWebView, since API clients may end up making the WKWebView the delegate
        for a different menu, in which case some implementations (either theirs or ours) of NSMenuDelegate methods would
        not be called. Avoiding this would require the client to be aware that WKWebView conforms to NSMenuDelegate,
        which is only declared privately.

        (WebKit::WebViewImpl::handleProcessSwapOrExit):

        On process swap or exit, automatically bail out of any pending DOM paste request by denying it.

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

        Handle the DOM paste request by showing an NSMenu near the mouse cursor with a single option to paste.

        * UIProcess/mac/PageClientImplMac.h:
        * UIProcess/mac/PageClientImplMac.mm:
        (WebKit::PageClientImpl::requestDOMPasteAccess):

2019-10-10  youenn fablet  <youenn@apple.com>

        Remove unified plan runtime flag
        https://bugs.webkit.org/show_bug.cgi?id=202721

        Reviewed by Geoffrey Garen.

        * Shared/WebPreferences.yaml:
        * UIProcess/API/glib/WebKitSettings.cpp:
        (webKitSettingsConstructed): Remove ability to disable unified plan.

2019-10-10  Adrian Perez de Castro  <aperez@igalia.com>

        Remove a "The " in "The The HTTP headers of the response"
        https://bugs.webkit.org/show_bug.cgi?id=194851

        Reviewed by Carlos Garcia Campos.

        * Shared/API/glib/WebKitURIResponse.cpp:
        (webkit_uri_response_class_init): Fix typo in description of the WebKitURIResponse::http-headers property.

2019-10-10  youenn fablet  <youenn@apple.com>

        [Mac] Allow SYS___pthread_markcancel call
        https://bugs.webkit.org/show_bug.cgi?id=202723

        Reviewed by Alex Christensen.

        Allow this pthread call as libwebrtc uses it on the Mac as well.

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

2019-10-09  youenn fablet  <youenn@apple.com>

        A service worker process should not be created when enqueuing a service worker job
        https://bugs.webkit.org/show_bug.cgi?id=202578
        <rdar://problem/55979690>

        Reviewed by Chris Dumez.

        Remove the calls to create service worker context connection.
        They are now done at SWServer level when trying to either run a service worker or install one.

        * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
        (WebKit::WebSWServerConnection::startFetch):
        (WebKit::WebSWServerConnection::postMessageToServiceWorker):
        (WebKit::WebSWServerConnection::scheduleJobInServer):

2019-10-09  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Clipboard API] Refactor Pasteboard item reading functions to work on both iOS and macOS
        https://bugs.webkit.org/show_bug.cgi?id=202647

        Reviewed by Tim Horton.

        Refactor iOS-specific pasteboard functions to be platform-agnostic. See WebCore ChangeLog for more details.

        * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
        (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):
        * UIProcess/WebPasteboardProxy.cpp:
        (WebKit::WebPasteboardProxy::allPasteboardItemInfo):
        (WebKit::WebPasteboardProxy::informationForItemAtIndex):
        (WebKit::WebPasteboardProxy::getPasteboardItemsCount):
        (WebKit::WebPasteboardProxy::readStringFromPasteboard):
        (WebKit::WebPasteboardProxy::readURLFromPasteboard):
        (WebKit::WebPasteboardProxy::readBufferFromPasteboard):
        * UIProcess/WebPasteboardProxy.h:
        * UIProcess/WebPasteboardProxy.messages.in:
        * UIProcess/wpe/WebPasteboardProxyWPE.cpp:
        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
        (WebKit::WebPlatformStrategies::informationForItemAtIndex):
        (WebKit::WebPlatformStrategies::readBufferFromPasteboard):
        (WebKit::WebPlatformStrategies::readURLFromPasteboard):
        (WebKit::WebPlatformStrategies::readStringFromPasteboard):
        (WebKit::WebPlatformStrategies::writeToPasteboard):
        (WebKit::WebPlatformStrategies::updateSupportedTypeIdentifiers):
        * WebProcess/WebCoreSupport/WebPlatformStrategies.h:

2019-10-09  John Wilander  <wilander@apple.com>

        IsLoggedIn: Add as experimental feature
        https://bugs.webkit.org/show_bug.cgi?id=202707
        <rdar://problem/56095064>

        Reviewed by Brent Fulgham and Chris Dumez.

        IsLoggedIn was proposed to the WebAppSec WG at TPAC 2019.
        So far there is only an explainer posted to the mailing list:
        https://lists.w3.org/Archives/Public/public-webappsec/2019Sep/0004.html

        * Shared/WebPreferences.yaml:

2019-10-09  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthn] Move the mock testing entrance to Internals
        https://bugs.webkit.org/show_bug.cgi?id=202560
        <rdar://problem/55973793>

        Reviewed by Chris Dumez.

        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreSetWebAuthenticationMockConfiguration): Deleted.
        * UIProcess/API/C/WKWebsiteDataStoreRef.h:
        * UIProcess/WebAuthentication/AuthenticatorTransportService.cpp:
        (WebKit::AuthenticatorTransportService::createMock):
        * UIProcess/WebAuthentication/AuthenticatorTransportService.h:
        * UIProcess/WebAuthentication/Mock/MockAuthenticatorManager.cpp:
        (WebKit::MockAuthenticatorManager::MockAuthenticatorManager):
        * UIProcess/WebAuthentication/Mock/MockAuthenticatorManager.h:
        * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
        (WebKit::MockHidConnection::send):
        (WebKit::MockHidConnection::registerDataReceivedCallbackInternal):
        (WebKit::MockHidConnection::parseRequest):
        (WebKit::MockHidConnection::feedReports):
        (WebKit::MockHidConnection::shouldContinueFeedReports):
        * UIProcess/WebAuthentication/Mock/MockHidConnection.h:
        * UIProcess/WebAuthentication/Mock/MockHidService.cpp:
        (WebKit::MockHidService::MockHidService):
        * UIProcess/WebAuthentication/Mock/MockHidService.h:
        * UIProcess/WebAuthentication/Mock/MockLocalConnection.h:
        * UIProcess/WebAuthentication/Mock/MockLocalConnection.mm:
        (WebKit::MockLocalConnection::MockLocalConnection):
        * UIProcess/WebAuthentication/Mock/MockLocalService.h:
        * UIProcess/WebAuthentication/Mock/MockLocalService.mm:
        (WebKit::MockLocalService::MockLocalService):
        * UIProcess/WebAuthentication/Mock/MockNfcService.h:
        * UIProcess/WebAuthentication/Mock/MockNfcService.mm:
        (WebKit::MockNfcService::MockNfcService):
        (WebKit::MockNfcService::platformStartDiscovery):
        (WebKit::MockNfcService::detectTags const):
        * UIProcess/WebAuthentication/Mock/MockWebAuthenticationConfiguration.h: Removed.
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::setMockWebAuthenticationConfiguration):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::setMockWebAuthenticationConfiguration):
        * WebProcess/WebCoreSupport/WebChromeClient.h:

2019-10-09  Simon Fraser  <simon.fraser@apple.com>

        Rename WheelEventTestTrigger and improve naming in related code
        https://bugs.webkit.org/show_bug.cgi?id=202772

        Reviewed by Tim Horton.

        Change the "test trigger" terminology to "monitor wheel events"; after all, tests
        call monitorWheelEvents() and callAfterScrollingCompletes(), and this is not triggering
        a test.

        * UIProcess/API/C/WKPage.cpp:
        (WKPageClearWheelEventTestMonitor):
        (WKPageClearWheelEventTestTrigger): Deleted.
        * UIProcess/API/C/WKPage.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::clearWheelEventTestMonitor):
        (WebKit::WebPageProxy::clearWheelEventTestTrigger): Deleted.
        * UIProcess/WebPageProxy.h:
        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
        (WKBundlePageStartMonitoringScrollOperations):
        (WKBundlePageRegisterScrollOperationCompletionCallback):
        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit::PDFPlugin::createScrollbar):
        * WebProcess/WebPage/EventDispatcher.cpp:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::clearWheelEventTestMonitor):
        (WebKit::WebPage::clearWheelEventTestTrigger): Deleted.
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2019-10-09  Andy Estes  <aestes@apple.com>

        [Cocoa] IPC::decode should gracefully handle a nil allowed class
        https://bugs.webkit.org/show_bug.cgi?id=202753

        Reviewed by Geoffrey Garen.

        If IPC::decode is called with a nil allowed class, an NSInvalidArgumentException will be
        thrown when trying to create an NSArray literal with a nil value. Depending on who calls
        IPC::decode, this exception might or might not be caught, leading to dropped messages or
        crashes.

        One case of this happening is tracked by rdar://problem/55839467. In this case, the nil
        allowed class was due to a build misconfiguration, and the exception caused the UI process
        to not respond to a synchronous IPC message, hanging the WebContent process.

        rdar://problem/55839467 was resolved by fixing the build misconfiguration, but this patch
        improves IPC::decode so that a nil allowed class results in a message decoding failure
        rather than a maybe-caught NSException.

        * Shared/Cocoa/ArgumentCodersCocoa.h:
        (IPC::decode):

2019-10-09  youenn fablet  <youenn@apple.com>

        Remove testRunner.setWebRTCUnifiedPlanEnabled
        https://bugs.webkit.org/show_bug.cgi?id=202700

        Reviewed by Eric Carlson.

        * WebProcess/InjectedBundle/InjectedBundle.cpp:
        (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):

2019-10-09  Carlos Garcia Campos  <cgarcia@igalia.com>

        REGRESSION(r250597): [GTK][WPE] 2.27.1 shows HTML content as text/plain in custom protocols when passing a charset in content type
        https://bugs.webkit.org/show_bug.cgi?id=202633

        Reviewed by Žan Doberšek.

        This is a regression of the switch to use the new custom protocols implementation. Before r250597, we extracted
        the mime type and charset from content type in the network process, but we are now sending the response directly
        from the UI process, so we need to do that when building our response. Rename the mime_type parameter as
        content_type to avoid confusion, since it's documented as the content type.

        * UIProcess/API/glib/WebKitURISchemeRequest.cpp:
        (webkitURISchemeRequestReadCallback):
        (webkit_uri_scheme_request_finish):
        * UIProcess/API/gtk/WebKitURISchemeRequest.h:
        * UIProcess/API/wpe/WebKitURISchemeRequest.h:

2019-10-09  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] about:gpu should also show the client EGL extensions
        https://bugs.webkit.org/show_bug.cgi?id=202690

        Reviewed by Carlos Alberto Lopez Perez.

        We are showing the extensions supported by the display.

        * UIProcess/API/glib/WebKitProtocolHandler.cpp:
        (WebKit::WebKitProtocolHandler::handleGPU):

2019-10-09  Carlos Garcia Campos  <cgarcia@igalia.com>

        CustomProtocols: convert log messages in WebURLSchemeTaskProxy to RELEASE_LOG
        https://bugs.webkit.org/show_bug.cgi?id=202686

        Reviewed by Alex Christensen.

        Instead of using WTFLogAlways, since those messages are confusing on stdout.

        * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp:
        (WebKit::WebURLSchemeTaskProxy::didPerformRedirection):
        (WebKit::WebURLSchemeTaskProxy::didReceiveResponse):
        (WebKit::WebURLSchemeTaskProxy::didReceiveData):

2019-10-09  Carlos Garcia Campos  <cgarcia@igalia.com>

        [WPE][GTK] WebKitSecurityManager should consider webkit:// to be a local URI scheme
        https://bugs.webkit.org/show_bug.cgi?id=202638

        Reviewed by Michael Catanzaro.

        * UIProcess/API/glib/WebKitProtocolHandler.cpp:
        (WebKit::WebKitProtocolHandler::WebKitProtocolHandler):

2019-10-08  Antti Koivisto  <antti@apple.com>

        [CSS Shadow Parts] Enable by default
        https://bugs.webkit.org/show_bug.cgi?id=202644

        Reviewed by Ryosuke Niwa.

        * Shared/WebPreferences.yaml:

        Flip the switch.

2019-10-08  Andy Estes  <aestes@apple.com>

        [iOS] Add a fast path that avoids hit testing during context menu interactions on elements
        https://bugs.webkit.org/show_bug.cgi?id=202510
        <rdar://problem/55939313>

        Reviewed by Tim Horton.

        When computing position information for an element, we can store sufficient context
        information in InteractionInformationAtPosition such that the same element could be
        retrieved again without hit testing. The existing TextInputContext can already store an
        element's page identifier, document identifier, and element identifier, which is sufficient
        context for such a task.

        This patch renames TextInputContext to ElementContext and uses it when populating new
        InteractionInformationAtPosition structs in elementPositionInformation(). When a context
        menu interaction occurs, WebPage::startInteractionWithElementContextOrPosition() uses this
        context to look up the interaction element by its identifier triplet, falling back to hit
        testing if this lookup fails.

        * Scripts/webkit/messages.py:
        * Shared/DocumentEditingContext.h:
        * Shared/DocumentEditingContext.mm:
        (IPC::ArgumentCoder<WebKit::DocumentEditingContextRequest>::decode):
        * Shared/ElementContext.cpp: Renamed from Source/WebKit/Shared/TextInputContext.cpp.
        (IPC::ArgumentCoder<WebKit::ElementContext>::encode):
        (IPC::ArgumentCoder<WebKit::ElementContext>::decode):
        * Shared/ElementContext.h: Renamed from Source/WebKit/Shared/TextInputContext.h.
        (WebKit::operator==):
        * Shared/ios/InteractionInformationAtPosition.h:
        * Shared/ios/InteractionInformationAtPosition.mm:
        (WebKit::InteractionInformationAtPosition::encode const):
        (WebKit::InteractionInformationAtPosition::decode):
        * Sources.txt:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _requestTextInputContextsInRect:completionHandler:]):
        * UIProcess/API/Cocoa/_WKTextInputContext.mm:
        (-[_WKTextInputContext _initWithTextInputContext:]):
        (-[_WKTextInputContext _textInputContext]):
        * UIProcess/API/Cocoa/_WKTextInputContextInternal.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::textInputContextsInRect):
        (WebKit::WebPageProxy::focusTextInputContext):
        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView actionSheetAssistant:willStartInteractionWithElement:]):
        (-[WKContentView assignLegacyDataForContextMenuInteraction]):
        (-[WKContentView continueContextMenuInteraction:]):
        (-[WKContentView continueContextMenuInteractionWithDataDetectors:]):
        (-[WKContentView _presentedViewControllerForPreviewItemController:]):
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::startInteractionWithPositionInformation):
        (WebKit::WebPageProxy::startInteractionWithElementAtPosition): Deleted.
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::textInputContextsInRect):
        (WebKit::WebPage::focusTextInputContext):
        (WebKit::WebPage::elementForContext const):
        (WebKit::WebPage::contextForElement const):
        (WebKit::WebPage::elementForTextInputContext): Deleted.
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::elementPositionInformation):
        (WebKit::WebPage::startInteractionWithElementContextOrPosition):
        (WebKit::WebPage::requestDocumentEditingContext):
        (WebKit::WebPage::startInteractionWithElementAtPosition): Deleted.

2019-10-08  Adrian Perez de Castro  <aperez@igalia.com>

        Unreviewed. Update OptionsWPE.cmake and NEWS for the 2.27.1 release

        * wpe/NEWS: Add release notes for 2.27.1

2019-10-08  Kate Cheney  <katherine_cheney@apple.com>

        Implement Telemetry and Dumping Routines for SQLite backend (195088)
        https://bugs.webkit.org/show_bug.cgi?id=195088
        <rdar://problem/54213407>

        Reviewed by John Wilander.

        Implemented database telemetry calculating for ITP. Mimicked
        ResourceLoadStatisticsMemoryStore telemetry logging behavior using
        SQLite Queries as opposed to vector sorting/manipulation. Once fully
        integrated, this will simplify analysis of ITP data by transitioning
        ITP data storage from a plist to a SQLite database.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        (WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore):
        Added SQL queries to be initialized in the constructor. These queries
        are needed to mimic the telemetry calculations done in
        ResourceLoadStatisticsMemoryStore.
        
        (WebKit::resetStatement):
        To reduce code duplication, this function holds common code to reset
        a SQL query.

        (WebKit::ResourceLoadStatisticsDatabaseStore::prepareStatements):
        Added SQL queries needed for telemetry calculations to be prepared.
        
        (WebKit::joinSubStatisticsForSorting):
        This function returns the query string for sorting resources that is
        shared by many queries.

        (WebKit::ResourceLoadStatisticsDatabaseStore::getMedianOfPrevalentResourcesWithUserInteraction const):
        Implemented a function to take the median days since user interaction
        from all prevalent resources in the database with user interaction
        (sorted by max count of subframes, subresources and unique redirects under
        the top frame domain).

        (WebKit::ResourceLoadStatisticsDatabaseStore::getNumberOfPrevalentResources const):
        Executes a SQL query to get the number of prevalent resources to log as
        telemetry.

        (WebKit::ResourceLoadStatisticsDatabaseStore::getNumberOfPrevalentResourcesWithUI const):
        Executes a SQL query to get the number of prevalent resources with user
        interaction to log as telemetry.

        (WebKit::ResourceLoadStatisticsDatabaseStore::getTopPrevelentResourceDaysSinceUI const):
        Prepares and executes a SQL query to get the days since user
        interaction from the top prevalent resource to be recorded as
        telemetry data.

        (WebKit::ResourceLoadStatisticsDatabaseStore::getMedianStatisticOfPrevalentResourceWithoutUserInteraction const):
        Implemented a function which takes a statistic and returns the value
        of that statistic for the median prevalent resource without user
        interaction to be recorded as telemetry data.

        (WebKit::ResourceLoadStatisticsDatabaseStore::getNumberOfPrevalentResourcesInTopResources const):
        Returns the count of prevalent resources in the top x resources
        sorted by sum of substatistics again to be logged as telemetry.

        (WebKit::ResourceLoadStatisticsDatabaseStore::calculateTelemetryData const):
        Function which executes all functions which populate the struct with
        telemetry data. This struct will then be passed to
        WebResourceLoadStatisticsTelemetry to be logged.

        (WebKit::ResourceLoadStatisticsDatabaseStore::calculateAndSubmitTelemetry const):
        Initializes the telemetry struct and calls the function to populate
        it, then passes it to the WebResourceLoadStatisticsTelemetry object
        to be recorded.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
        Describe PrevalentResourceDatabaseTelemetry Struct to be passed and
        logged as telemetry data.

        * NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.cpp:
        (WebKit::databaseSubmitTopLists):
        Logging telemetry data by looping through 2D array of statistics for
        the top 1, 3, 10, 50, and 100 prevalent resources sorted by the sum
        of substatistics under the top frame domain. This matches the logging
        already done in ResourceLoadStatisticsMemoryStore.

        (WebKit::WebResourceLoadStatisticsTelemetry::submitTelemetry):
        Submits data to the webPageProxy logs and plists.

        * NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.h:
        Added new submitTopList function to accomodate database telemetry
        logging.
        
        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::notifyPageStatisticsTelemetryFinished):
        * NetworkProcess/NetworkSession.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::notifyResourceLoadStatisticsTelemetryFinished):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/Network/NetworkProcessProxy.messages.in:
        Updated the current testing for telemetry which only tested 3
        statistics. With this patch it now tests 10 statistics.

2019-10-08  Adrian Perez de Castro  <aperez@igalia.com>

        [GTK][WPE] Fix non-unified builds after r250486
        https://bugs.webkit.org/show_bug.cgi?id=202636

        Reviewed by Youenn Fablet.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp: Add missing inclusion of the
        Logging.h header.

2019-10-08  Brady Eidson  <beidson@apple.com>

        Service Worker Fetch events should time out.
        https://bugs.webkit.org/show_bug.cgi?id=202188

        Reviewed by Alex Christensen.

        When we start a fetch task in the server, we also start a timeout on that fetch task.
        
        "Time out" means the fetch task must continue to make progress at the given frequency (once every 60 seconds by default)

        If any given fetch task times out in a service worker instance, that instance loses the right to handle fetches.
        
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::setServiceWorkerFetchTimeoutForTesting):
        (WebKit::NetworkProcess::resetServiceWorkerFetchTimeoutForTesting):
        * NetworkProcess/NetworkProcess.h:
        (WebKit::NetworkProcess::serviceWorkerFetchTimeout const):
        * NetworkProcess/NetworkProcess.messages.in:

        * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp:
        (WebKit::ServiceWorkerFetchTask::ServiceWorkerFetchTask):
        (WebKit::ServiceWorkerFetchTask::didReceiveRedirectResponse): 
        (WebKit::ServiceWorkerFetchTask::didReceiveResponse): 
        (WebKit::ServiceWorkerFetchTask::didReceiveData): 
        (WebKit::ServiceWorkerFetchTask::didReceiveFormData): 
        (WebKit::ServiceWorkerFetchTask::didFinish): 
        (WebKit::ServiceWorkerFetchTask::didFail): 
        (WebKit::ServiceWorkerFetchTask::didNotHandle): 
        * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h:
        (WebKit::ServiceWorkerFetchTask::create):
        (WebKit::ServiceWorkerFetchTask::serviceWorkerIdentifier const):
        (WebKit::ServiceWorkerFetchTask::wasHandled const):
        (WebKit::ServiceWorkerFetchTask::ServiceWorkerFetchTask): Deleted.

        * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
        (WebKit::WebSWServerConnection::startFetch):
        * NetworkProcess/ServiceWorker/WebSWServerConnection.h:

        * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
        (WebKit::WebSWServerToContextConnection::startFetch):
        (WebKit::WebSWServerToContextConnection::fetchTaskTimedOut):
        * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:

        * UIProcess/API/C/WKContext.cpp:
        (WKContextSetServiceWorkerFetchTimeoutForTesting):
        (WKContextResetServiceWorkerFetchTimeoutForTesting):
        * UIProcess/API/C/WKContext.h:

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::setServiceWorkerTimeoutForTesting):
        (WebKit::WebProcessPool::resetServiceWorkerTimeoutForTesting):
        * UIProcess/WebProcessPool.h:

2019-10-08  Ross Kirsling  <ross.kirsling@sony.com>

        Unreviewed. Restabilize non-unified build.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:

2019-10-08  Dean Jackson  <dino@apple.com>

        Sort Internal and Experimental features by human readable name
        https://bugs.webkit.org/show_bug.cgi?id=202667

        Reviewed by Zalan Bujtas.

        Sort the statically generated vectors of internal and
        experimental features by their human readable name, rather than
        the feature key, so that looking at them in the Settings app
        doesn't make people who like alphabetical order angry.

        * Scripts/GeneratePreferences.rb: Add an extra sort call to the list generation.

2019-10-08  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Clipboard API] Introduce bindings for the async Clipboard API
        https://bugs.webkit.org/show_bug.cgi?id=202622
        <rdar://problem/56038126>

        Reviewed by Ryosuke Niwa.

        Adds a new experimental feature flag. See WebCore ChangeLog for more details.

        * Shared/WebPreferences.yaml:

2019-10-08  Alexander Mikhaylenko  <alexm@gnome.org>

        [GTK] Navigation gesture improvements
        https://bugs.webkit.org/show_bug.cgi?id=202645

        Reviewed by Carlos Garcia Campos.

        Measure velocity threshold in pixels per second rather than distance (range [0-1])
        per second. The value is the same as it was on touchpads, since a fixed distance is
        used, but is now consistent on touchscreens, regardless of the webview width.

        Add a threshold for cancelling gesture when the page is more than halfway
        through, so that it's symmetric with the first half.

        Align the moving page to pixel grid on hidpi devices correctly. Just
        rounding the position doesn't work correctly, since the cairo context is
        pre-scaled. Multiplying by scale factor, rounding and then dividing by
        scale factor fixes this.

        * UIProcess/ViewGestureController.h:
        * UIProcess/gtk/ViewGestureControllerGtk.cpp:
        (WebKit::ViewGestureController::SwipeProgressTracker::reset):
        (WebKit::ViewGestureController::SwipeProgressTracker::handleEvent):
        (WebKit::ViewGestureController::SwipeProgressTracker::shouldCancel):
        (WebKit::ViewGestureController::draw):

2019-10-08  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Remove unused WebKitSoupRequestGeneric after r250597

        * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.h:

2019-10-08  Adrian Perez de Castro  <aperez@igalia.com>

        [WPE][GTK] Build fails with ENABLE_WEBDRIVER=OFF
        https://bugs.webkit.org/show_bug.cgi?id=202658

        Reviewed by Carlos Garcia Campos.

        * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp: Add missing
        ENABLE(WEBDRIVER_MOUSE_INTERACTIONS) and ENABLE(WEBDRIVER_KEYBOARD_INTERACTIONS)
        preprocessor guards.
        * UIProcess/Automation/wpe/WebAutomationSessionWPE.cpp: Ditto.

2019-10-07  Ryosuke Niwa  <rniwa@webkit.org>

        Add IDL for requestIdleCallback
        https://bugs.webkit.org/show_bug.cgi?id=202653

        Reviewed by Geoffrey Garen.

        * Shared/WebPreferences.yaml:

2019-10-07  Kate Cheney  <katherine_cheney@apple.com>

        Domain relationships in the ITP Database should be inserted in a single query and ignore repeat insert attempts. (202604)
        https://bugs.webkit.org/show_bug.cgi?id=202604
        <rdar://problem/55995831>

        Reviewed by Chris Dumez. 
        
        This patch addresses two clean-ups for the ITP SQLite Database Store.
        First, by using INSERT OR IGNORE as opposed to INSERT, it eliminates
        the need to check if a relationship already exists in the database
        before inserting it. Second, instead of looping through domain lists
        and inserting each relationship as a separate query, this patch now
        converts lists to a string which SQLite can use to insert multiple
        rows into a database using a single query.

        Some Exists queries could not be deleted because they were being
        used for testing.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        (WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore):
        (WebKit::ResourceLoadStatisticsDatabaseStore::prepareStatements):
        Removed old insert queries and replaced them with queries able to
        insert string-lists of domains in a single query. Also reorganized
        the queries by functionality to make them easier to find and edit.

        (WebKit::ResourceLoadStatisticsDatabaseStore::createUniqueIndices):
        (WebKit::ResourceLoadStatisticsDatabaseStore::createSchema):
        In order to properly take advantage of the INSERT OR IGNORE
        functionality, unique indices must be established so the SQLite table
        is aware of what patterns to look for when ignoring a new insert.

        (WebKit::ResourceLoadStatisticsDatabaseStore::ensureAndmakeDomainList):
        (WebKit::ResourceLoadStatisticsDatabaseStore::insertDomainRelationshipList):
        (WebKit::ResourceLoadStatisticsDatabaseStore::insertDomainRelationships):
        Looping through the domain list is no longer needed with the new query
        changes. Additionally, ensuring a domain is in the Observed Domains
        table of the database must be done before utilizing any inserting of 
        relationships because the relationship queries rely on fetching the
        topFrame domainID from the ObservedDomains table.

        (WebKit::ResourceLoadStatisticsDatabaseStore::grantStorageAccess):
        (WebKit::ResourceLoadStatisticsDatabaseStore::logFrameNavigation):
        (WebKit::ResourceLoadStatisticsDatabaseStore::logCrossSiteLoadWithLinkDecoration):
        (WebKit::ResourceLoadStatisticsDatabaseStore::setSubframeUnderTopFrameDomain):
        (WebKit::ResourceLoadStatisticsDatabaseStore::setSubresourceUnderTopFrameDomain):
        (WebKit::ResourceLoadStatisticsDatabaseStore::setSubresourceUniqueRedirectTo):
        (WebKit::ResourceLoadStatisticsDatabaseStore::setSubresourceUniqueRedirectFrom):
        (WebKit::ResourceLoadStatisticsDatabaseStore::setTopFrameUniqueRedirectTo):
        (WebKit::ResourceLoadStatisticsDatabaseStore::setTopFrameUniqueRedirectFrom):
        With the ensure check being done once in the ensureAndmakeDomainList
        function, these functions no longer have to make that check before
        inserting.
        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:

        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::mergeStatisticForTesting):
        (WebKit::WebResourceLoadStatisticsStore::isRelationshipOnlyInDatabaseOnce):
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
        Changes in WeResourceLoadStatisticsStore were for testing only. This
        patch updated the merge statistic testing to also test this change by
        having a topFrameDomain list with more than one domain.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::mergeStatisticForTesting):
        (WebKit::NetworkProcess::isRelationshipOnlyInDatabaseOnce):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreSetStatisticsMergeStatistic):
        (WKWebsiteDataStoreIsStatisticsOnlyInDatabaseOnce):
        * UIProcess/API/C/WKWebsiteDataStoreRef.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::mergeStatisticForTesting):
        (WebKit::NetworkProcessProxy::isRelationshipOnlyInDatabaseOnce):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::mergeStatisticForTesting):
        (WebKit::WebsiteDataStore::isRelationshipOnlyInDatabaseOnce):
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        Added a new function for testing that there are no repeat inserts
        into the database. Updated mergeStatistics to test the list-insert
        functionality.

2019-10-07  Yusuke Suzuki  <ysuzuki@apple.com>

        [JSC] Change signature of HostFunction to (JSGlobalObject*, CallFrame*)
        https://bugs.webkit.org/show_bug.cgi?id=202569

        Reviewed by Saam Barati.

        * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
        (WebKit::callMethod):
        * WebProcess/Plugins/Netscape/JSNPObject.cpp:
        (WebKit::callNPJSObject):
        (WebKit::constructWithConstructor):
        * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.h:

2019-10-07  Megan Gardner  <megan_gardner@apple.com>

        Switch to WKShareSheet for WKPDFView
        https://bugs.webkit.org/show_bug.cgi?id=202338

        Reviewed by Tim Horton.

        Switch to WKShareSheet from the share sheet in UIWKSelectionAssistant, since this is the only instance
        of UIWKSelectionAssistant any more. This will keep all our share sheet code together, and allow
        us to eliminate this class that will be completely unused with this change.

        * Platform/spi/ios/UIKitSPI.h:
        * UIProcess/ios/WKPDFView.h:
        * UIProcess/ios/WKPDFView.mm:
        (-[WKPDFView dealloc]):
        (-[WKPDFView actionSheetAssistant:shareElementWithURL:rect:]):
        (-[WKPDFView shareSheetDidDismiss:]):

2019-10-07  Per Arne Vollan  <pvollan@apple.com>

        [macOS] Layering violation in AuxiliaryProcessProxy::didFinishLaunching
        https://bugs.webkit.org/show_bug.cgi?id=201617

        Reviewed by Brent Fulgham.

        The commit <https://trac.webkit.org/changeset/249649> introduced a layering violation in AuxiliaryProcessProxy::didFinishLaunching
        where we inspect the pending message queue looking for a local file load message which needs the PID to create a sandbox extension
        for the WebContent process. The layering violation can be fixed by creating a virtual method in AuxiliaryProcessProxy and override
        the method in the WebProcessProxy to do the work needed to replace the message with a load request message containing a sandbox
        extension created using the PID of the WebContent process. No new tests have been created, since this is covered by existing tests.

        * UIProcess/AuxiliaryProcessProxy.cpp:
        (WebKit::AuxiliaryProcessProxy::didFinishLaunching):
        * UIProcess/AuxiliaryProcessProxy.h:
        (WebKit::AuxiliaryProcessProxy::shouldSendPendingMessage):
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::shouldSendPendingMessage):
        * UIProcess/WebProcessProxy.h:

2019-10-07  Dean Jackson  <dino@apple.com>

        Provide options for DTTZ to happen in more situations
        https://bugs.webkit.org/show_bug.cgi?id=202634
        <rdar://problem/55732762>

        Reviewed by Antoine Quint.

        Add two options that can be enabled to trigger double tap zooming 
        in more places.

        Firstly, an option to keep listening for a double-tap-to-zoom if the
        first tap found a click handler on the body or document element. The
        tap will still be dispatched. This is probably the most common case
        for disabling a DTTZ.

        Secondly, an option to always keep listening for a double-tap-to-zoom,
        even if there was a clickable (non-root) element under the first tap.

        * Shared/WebPreferences.yaml: Add ZoomOnDoubleTapWhenRoot and AlwaysZoomOnDoubleTap.
        * UIProcess/PageClient.h: The message from the WebProcess now tells the UIProcess if
        the tapped element was a root-level (document or body).
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/ios/PageClientImplIOS.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::handleSmartMagnificationInformationForPotentialTap):
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _endPotentialTapAndEnableDoubleTapGesturesIfNecessary]):
        (-[WKContentView _handleSmartMagnificationInformationForPotentialTap:renderRect:fitEntireRect:viewportMinimumScale:viewportMaximumScale:nodeIsRootLevel:]):
        Handle the two new options.

        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::handleSmartMagnificationInformationForPotentialTap):
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::potentialTapAtPosition): Check if the tap was on a root-level element.

2019-10-07  Matt Mokary  <mmokary@apple.com>

        foundStringMatchIndex in FindController::findString gets reset on page scroll
        https://bugs.webkit.org/show_bug.cgi?id=201773
        <rdar://problem/55351892>

        Reviewed by Tim Horton.

        Decouple hiding of the find indicator from resetting match index, and only reset match index when there is not
        an active match.

        * WebProcess/WebPage/FindController.cpp:
        (WebKit::FindController::updateFindUIAfterPageScroll):
        (WebKit::FindController::hideFindUI):
        (WebKit::FindController::hideFindIndicator):
        (WebKit::FindController::resetMatchIndex):
        * WebProcess/WebPage/FindController.h:
        * WebProcess/WebPage/ios/FindControllerIOS.mm:
        (WebKit::FindController::hideFindIndicator):
        (WebKit::FindController::resetMatchIndex):

2019-10-07  youenn fablet  <youenn@apple.com>

        WebPageProxy::updatePlayingMediaDidChange should protect from a null m_userMediaPermissionRequestManager
        https://bugs.webkit.org/show_bug.cgi?id=202628
        <rdar://problem/55935091>

        Reviewed by Eric Carlson.

        On process swap on navigation or process crash, m_userMediaPermissionRequestManager is made null.
        At the same time, the media state is set back to not playing.
        Future calls of updatePlayingMediaDidChange should not have any capture state change until getUserMedia/getDisplayMedia
        is called, which would create m_userMediaPermissionRequestManager.
        But this assumption is not always true given that the media state is computed as process-wide in MediaStreamTrack::captureState on iOS.
        The above behavior is fixed as part of https://bugs.webkit.org/show_bug.cgi?id=202627.
        Since the call to updatePlayingMediaDidChange is triggered straight from IPC, it should not be trusted and a null check should be added.

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

2019-10-04  Dean Jackson  <dino@apple.com>

        Use a better name than allowFastClicksEverywhere
        https://bugs.webkit.org/show_bug.cgi?id=202607
        <rdar://problem/55997133>

        Reviewed by Tim Horton.

        This preference name is quite confusing. Change it to
        PreferFasterClickOverDoubleTap.

        * Shared/WebPreferences.yaml:
        * Shared/WebPreferencesDefaultValues.h:
        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::preferFasterClickOverDoubleTap const):
        (WebKit::WebPageProxy::allowsFastClicksEverywhere const): Deleted.
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _handleSmartMagnificationInformationForPotentialTap:renderRect:fitEntireRect:viewportMinimumScale:viewportMaximumScale:]):
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::effectiveContentModeAfterAdjustingPolicies):

2019-10-04  Ross Kirsling  <ross.kirsling@sony.com>

        Socket-based RWI should base64-encode backend commands on client, not server
        https://bugs.webkit.org/show_bug.cgi?id=202605

        Reviewed by Don Olmstead.

        * UIProcess/socket/RemoteInspectorClient.cpp:
        (WebKit::RemoteInspectorClient::setBackendCommands):

2019-10-04  Jiewen Tan  <jiewen_tan@apple.com>

        Unreviewed, build fix after r250729

        * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm:
        * UIProcess/API/Cocoa/_WKWebAuthenticationPanelInternal.h:

2019-10-04  Keith Rollin  <krollin@apple.com>

        Fix determination of the top-level resource
        https://bugs.webkit.org/show_bug.cgi?id=202491
        <rdar://problem/50780648>

        Reviewed by Youenn Fablet.

        When loading the resources associated with a page, the Networking
        process needs to know the main resource for the main frame. It uses
        this information to keep track of page loads and the resources that
        are loaded in those pages. By keeping track of this information,
        WebKit can track and report difficult (slow or incomplete) resource
        loads and their impact on the overall page.

        The initial determination of the top resource only looked at whether
        the resource was the "main" resource of a frame or not. However, this
        determination was insufficient, and would confuse the tracking
        mechanism when sub-frames also had main frames. Therefore, augment the
        test by also looking to see if the hosting frame is the main frame.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::startTrackingResourceLoad):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::start):

2019-10-04  Ross Kirsling  <ross.kirsling@sony.com>

        Unreviewed WinCairo build fix for r250717.

        * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h:
        (WebKit::LayerTreeHost::invalidate): Deleted.

2019-10-04  Alex Christensen  <achristensen@webkit.org>

        Stop sending list of display-isolated schemes to NetworkProcess
        https://bugs.webkit.org/show_bug.cgi?id=202557

        Reviewed by Youenn Fablet.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::initializeNetworkProcess):
        (WebKit::NetworkProcess::registerURLSchemeAsDisplayIsolated const): Deleted.
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
        (WebKit::NetworkProcessCreationParameters::decode):
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):
        (WebKit::WebProcessPool::registerURLSchemeAsDisplayIsolated):

2019-10-04  Alex Christensen  <achristensen@webkit.org>

        Rename SchemeRegistry to LegacySchemeRegistry
        https://bugs.webkit.org/show_bug.cgi?id=202586

        Reviewed by Tim Horton.

        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::doesNotNeedCORSCheck const):
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::registerURLSchemeAsSecure const):
        (WebKit::NetworkProcess::registerURLSchemeAsBypassingContentSecurityPolicy const):
        (WebKit::NetworkProcess::registerURLSchemeAsLocal const):
        (WebKit::NetworkProcess::registerURLSchemeAsNoAccess const):
        (WebKit::NetworkProcess::registerURLSchemeAsDisplayIsolated const):
        (WebKit::NetworkProcess::registerURLSchemeAsCORSEnabled const):
        (WebKit::NetworkProcess::registerURLSchemeAsCanDisplayOnlyIfCanRequest const):
        * Shared/AuxiliaryProcess.cpp:
        (WebKit::AuxiliaryProcess::registerURLSchemeServiceWorkersCanHandle const):
        * UIProcess/API/Cocoa/WKWebView.mm:
        (+[WKWebView handlesURLScheme:]):
        * UIProcess/API/glib/WebKitSecurityManager.cpp:
        (registerSecurityPolicyForURIScheme):
        (checkSecurityPolicyForURIScheme):
        * WebProcess/Plugins/WebPluginInfoProvider.cpp:
        (WebKit::WebPluginInfoProvider::webVisiblePluginInfo):
        * WebProcess/Storage/WebServiceWorkerProvider.cpp:
        (WebKit::WebServiceWorkerProvider::handleFetch):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::canHandleRequest):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::registerURLSchemeAsEmptyDocument):
        (WebKit::WebProcess::registerURLSchemeAsSecure const):
        (WebKit::WebProcess::registerURLSchemeAsBypassingContentSecurityPolicy const):
        (WebKit::WebProcess::setDomainRelaxationForbiddenForURLScheme const):
        (WebKit::WebProcess::registerURLSchemeAsLocal const):
        (WebKit::WebProcess::registerURLSchemeAsNoAccess const):
        (WebKit::WebProcess::registerURLSchemeAsDisplayIsolated const):
        (WebKit::WebProcess::registerURLSchemeAsCORSEnabled const):
        (WebKit::WebProcess::registerURLSchemeAsAlwaysRevalidated const):
        (WebKit::WebProcess::registerURLSchemeAsCachePartitioned const):
        (WebKit::WebProcess::registerURLSchemeAsCanDisplayOnlyIfCanRequest const):
        * WebProcess/WebStorage/StorageAreaImpl.cpp:

2019-10-04  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthn] Implement _WKWebAuthenticationPanel SPI
        https://bugs.webkit.org/show_bug.cgi?id=202559
        <rdar://problem/55932094>

        Reviewed by Brent Fulgham.

        This patch implements _WKWebAuthenticationPanel SPI. Here is the structure:
        1) API::WebAuthenticationPanel is the APIObject of _WKWebAuthenticationPanel. It is owned by AuthenticatorManager.
        The lifetime of _WKWebAuthenticationPanel on the other hand is managed by clients. This binding is the surface
        where clients could interact with WebKit's WebAuthentication implementation.
        2) API::WebAuthenticationPanelClient is a base class representing _WKWebAuthenticationPanelDelegate. Its subclass
        WebKit::WebAuthenticationPanelClient implements bridges to _WKWebAuthenticationPanelDelegate methods. It is owned by
        API::WebAuthenticationPanel. A weak pointer of WebKit::WebAuthenticationPanelClient is kept in _WKWebAuthenticationPanel
        to get the _WKWebAuthenticationPanelDelegate set by clients or nil otherwise. This binding is the surface where WebKit
        interacts with clients.
        3) WebAuthenticationPanelFlags is the mirror of enums within _WKWebAuthenticationPanel.

        Implementation wise, this patch implements:
        1) -[WKUIDelegatePrivate webView:runWebAuthenticationPanel:initiatedByFrame:completionHandler:], this is bridged from
        the regular UIDelegate route. Noted, WKFrameInfo is nil for now, a follow up on Bug 202563 will take care of it. This
        will be called from AuthenticatorManager::runPanel() which gates the start of discovery on the callback. For clients
        that don't implement the delegate, the callback will always be called with _WKWebAuthenticationPanelResultUnavailable
        to allow WebKit run on non-UI mode. A specific C API hack is added to always return _WKWebAuthenticationPanelResultPresented
        in WebKitTestRunner for layout tests.
        2) -[_WKWebAuthenticationPanelDelegate panel:updateWebAuthenticationPanel:] will be implemented in Bug 200932.
        3) -[_WKWebAuthenticationPanelDelegate panel:dismissWebAuthenticationPanelWithResult:], this is bridged from
        API::WebAuthenticationPanel/API::WebAuthenticationPanelClient. This will be called whenever AuthenticatorManager::m_pendingCompletionHandler
        is invoked. Depending on the respond, _WKWebAuthenticationResult will be returned accordingly. To facilitate that,
        invokePendingCompletionHandler is crafted to bundle those two operations.
        4) -[_WKWebAuthenticationPanel cancel] will be implemented in Bug 191523.

        Besides the above, this patch also silents the NFC action sheet.

        * Platform/spi/Cocoa/NearFieldSPI.h:
        * Shared/API/APIObject.h:
        * Shared/Cocoa/APIObject.mm:
        (API::Object::newObject):
        * Sources.txt:
        * SourcesCocoa.txt:
        * UIProcess/API/APIUIClient.h:
        (API::UIClient::runWebAuthenticationPanel):
        * UIProcess/API/APIWebAuthenticationPanel.cpp: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm.
        (API::WebAuthenticationPanel::create):
        (API::WebAuthenticationPanel::WebAuthenticationPanel):
        (API::WebAuthenticationPanel::setClient):
        * UIProcess/API/APIWebAuthenticationPanel.h: Copied from Source/WebKit/UIProcess/WebAuthentication/WebAuthenticationRequestData.h.
        * UIProcess/API/APIWebAuthenticationPanelClient.h: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKWebAuthenticationPanelInternal.h.
        (API::WebAuthenticationPanelClient::dismissPanel const):
        * UIProcess/API/C/WKPage.cpp:
        (WKPageSetPageUIClient):
        * UIProcess/API/C/WKPageUIClient.h:
        * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm:
        (-[_WKWebAuthenticationPanel dealloc]):
        (-[_WKWebAuthenticationPanel relyingPartyID]):
        (-[_WKWebAuthenticationPanel delegate]):
        (-[_WKWebAuthenticationPanel setDelegate:]):
        (-[_WKWebAuthenticationPanel _apiObject]):
        (-[_WKWebAuthenticationPanel _initWithRelayingPartyID:]): Deleted.
        * UIProcess/API/Cocoa/_WKWebAuthenticationPanelInternal.h:
        * UIProcess/Cocoa/UIDelegate.h:
        * UIProcess/Cocoa/UIDelegate.mm:
        (WebKit::UIDelegate::setDelegate):
        (WebKit::webAuthenticationPanelResult):
        (WebKit::UIDelegate::UIClient::runWebAuthenticationPanel):
        * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
        (WebKit::WebCore::isFeatureEnabled):
        (WebKit::WebCore::getRpId):
        (WebKit::AuthenticatorManager::handleRequest):
        (WebKit::AuthenticatorManager::respondReceived):
        (WebKit::AuthenticatorManager::startDiscovery):
        (WebKit::AuthenticatorManager::initTimeOutTimer):
        (WebKit::AuthenticatorManager::timeOutTimerFired):
        (WebKit::AuthenticatorManager::runPanel):
        (WebKit::AuthenticatorManager::startRequest):
        (WebKit::AuthenticatorManager::invokePendingCompletionHandler):
        (WebKit::AuthenticatorManagerInternal::collectTransports): Deleted.
        (WebKit::AuthenticatorManagerInternal::processGoogleLegacyAppIdSupportExtension): Deleted.
        * UIProcess/WebAuthentication/AuthenticatorManager.h:
        (WebKit::AuthenticatorManager::pendingCompletionHandler): Deleted.
        * UIProcess/WebAuthentication/Cocoa/NfcConnection.mm:
        (WebKit::NfcConnection::NfcConnection):
        * UIProcess/WebAuthentication/Cocoa/NfcService.mm:
        (WebKit::NfcService::platformStartDiscovery):
        * UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.h: Copied from Source/WebKit/UIProcess/WebAuthentication/WebAuthenticationRequestData.h.
        * UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.mm: Copied from Source/WebKit/UIProcess/WebAuthentication/Mock/MockAuthenticatorManager.cpp.
        (WebKit::WebAuthenticationPanelClient::WebAuthenticationPanelClient):
        (WebKit::wkWebAuthenticationResult):
        (WebKit::WebAuthenticationPanelClient::dismissPanel const):
        * UIProcess/WebAuthentication/Mock/MockAuthenticatorManager.cpp:
        (WebKit::MockAuthenticatorManager::respondReceivedInternal):
        * UIProcess/WebAuthentication/WebAuthenticationPanelFlags.h: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKWebAuthenticationPanelInternal.h.
        * UIProcess/WebAuthentication/WebAuthenticationRequestData.h:
        * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp:
        (WebKit::WebAuthenticatorCoordinatorProxy::makeCredential):
        (WebKit::WebAuthenticatorCoordinatorProxy::getAssertion):
        * WebKit.xcodeproj/project.pbxproj:

2019-10-04  Alex Christensen  <achristensen@webkit.org>

        Move WKProcessPool._registerURLSchemeServiceWorkersCanHandle to _WKWebsiteDataStoreConfiguration
        https://bugs.webkit.org/show_bug.cgi?id=202553

        Reviewed by Youenn Fablet.

        It was only used for testing, and all the tests that use it still pass with the new SPI.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::initializeNetworkProcess):
        (WebKit::NetworkProcess::addWebsiteDataStore):
        (WebKit::NetworkProcess::swServerForSession):
        (WebKit::NetworkProcess::addServiceWorkerSession):
        * NetworkProcess/NetworkProcess.h:
        * Shared/AuxiliaryProcess.cpp:
        (WebKit::AuxiliaryProcess::registerURLSchemeServiceWorkersCanHandle const): Deleted.
        * Shared/AuxiliaryProcess.h:
        * Shared/AuxiliaryProcess.messages.in:
        * Shared/WebsiteDataStoreParameters.cpp:
        (WebKit::WebsiteDataStoreParameters::encode const):
        (WebKit::WebsiteDataStoreParameters::decode):
        * Shared/WebsiteDataStoreParameters.h:
        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _registerURLSchemeServiceWorkersCanHandle:]): Deleted.
        * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
        (-[_WKWebsiteDataStoreConfiguration registerURLSchemeServiceWorkersCanHandleForTesting:]):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):
        (WebKit::WebProcessPool::initializeNewWebProcess):
        (WebKit::WebProcessPool::registerURLSchemeServiceWorkersCanHandle): Deleted.
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::parameters):
        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
        (WebKit::WebsiteDataStoreConfiguration::copy):
        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
        (WebKit::WebsiteDataStoreConfiguration::serviceWorkerRegisteredSchemes const):
        (WebKit::WebsiteDataStoreConfiguration::registerServiceWorkerScheme):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::initializeWebProcess):

2019-10-04  youenn fablet  <youenn@apple.com>

        Allow to suspend RTCPeerConnection when not connected
        https://bugs.webkit.org/show_bug.cgi?id=202403

        Reviewed by Chris Dumez.

        Implement suspend/resume of sockets by doing the following:
        - For UDP sockets, we simulate as if being sent data is queued when being suspended.
        the webrtc backend will then stop sending packets until the queue is emptied.
        At resume time, we do as if the queue is emptied and packets sent (even though packets are not sent).
        For incoming traffic, we ignore it when being suspended.
        - For TCP sockets, we close them at suspend time. We then notify at resume time that an error happeneded
        for these sockets to the webrtc backend. We cannot simulate packet dropping like in the UDP case.

        To manage resume/suspend, each socket now has a isSuspended state and a socket group.
        The socket group is per peer connection.
        A peer connection will notify the factory that it is suspended/resumed.
        The factory will iterate through all sockets and will suspend/resume each socket of the socket group.

        * WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
        (WebKit::RTCSocketFactory::RTCSocketFactory):
        (WebKit::RTCSocketFactory::CreateUdpSocket):
        (WebKit::RTCSocketFactory::CreateServerTcpSocket):
        (WebKit::RTCSocketFactory::CreateClientTcpSocket):
        (WebKit::RTCSocketFactory::CreateAsyncResolver):
        (WebKit::RTCSocketFactory::suspend):
        (WebKit::RTCSocketFactory::resume):
        (WebKit::LibWebRTCProvider::createSocketFactory):
        * WebProcess/Network/webrtc/LibWebRTCProvider.h:
        * WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
        (WebKit::LibWebRTCSocket::LibWebRTCSocket):
        (WebKit::LibWebRTCSocket::~LibWebRTCSocket):
        (WebKit::LibWebRTCSocket::signalReadPacket):
        (WebKit::LibWebRTCSocket::signalSentPacket):
        (WebKit::LibWebRTCSocket::SendTo):
        (WebKit::LibWebRTCSocket::Close):
        (WebKit::LibWebRTCSocket::SetOption):
        (WebKit::LibWebRTCSocket::resume):
        (WebKit::LibWebRTCSocket::suspend):
        * WebProcess/Network/webrtc/LibWebRTCSocket.h:
        * WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp:
        (WebKit::LibWebRTCSocketFactory::createServerTcpSocket):
        (WebKit::LibWebRTCSocketFactory::createUdpSocket):
        (WebKit::LibWebRTCSocketFactory::createClientTcpSocket):
        (WebKit::LibWebRTCSocketFactory::createNewConnectionSocket):
        (WebKit::LibWebRTCSocketFactory::addSocket):
        (WebKit::LibWebRTCSocketFactory::removeSocket):
        (WebKit::LibWebRTCSocketFactory::forSocketInGroup):
        * WebProcess/Network/webrtc/LibWebRTCSocketFactory.h:

2019-10-04  Alex Christensen  <achristensen@webkit.org>

        Simplify sandbox enabling macros
        https://bugs.webkit.org/show_bug.cgi?id=202536

        Reviewed by Brent Fulgham.

        ENABLE_WEB_PROCESS_SANDBOX was always on for Cocoa platforms and only used in WebProcessCocoa.mm, so it did nothing.
        ENABLE_MANUAL_SANDBOXING was on for sdk=macosx* which I made more explicit in the code by using PLATFORM(MAC) || PLATFORM(MAACCATALYST)
        ENABLE_MANUAL_NETWORK_SANDBOXING was always off and hiding dead code we do not intend to use because iOS sandboxes are always on and never manual.

        * Configurations/FeatureDefines.xcconfig:
        * NetworkProcess/ios/NetworkProcessIOS.mm:
        (WebKit::NetworkProcess::initializeSandbox):
        * Shared/ios/AuxiliaryProcessIOS.mm:
        (WebKit::AuxiliaryProcess::initializeSandbox):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::initializeSandbox):

2019-10-04  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Update OptionsGTK.cmake and NEWS for 2.27.1 release

        * gtk/NEWS: Add release notes for 2.27.1.

2019-10-04  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Crash in WebChromeClient::createDisplayRefreshMonitor
        https://bugs.webkit.org/show_bug.cgi?id=202551

        Reviewed by Žan Doberšek.

        The crash happens when the drawing area is destroyed due to a page close. The layer tree host is invalidated
        causing a layer flush that ends up trying to create a display refresh monitor, which requires the drawing
        area. We need to null-check the drawing area in WebChromeClient::createDisplayRefreshMonitor() but we should
        also ensure that layer flush is not performed after layer tree host is destroyed.

        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::createDisplayRefreshMonitor const): Null-check drawing area before using it.
        * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
        (WebKit::CompositingCoordinator::CompositingCoordinator): Receive a WebPage instead of a WebCore::Page and
        create the root layer here.
        (WebKit::CompositingCoordinator::~CompositingCoordinator): Do not purge backing stores again, invalidate should
        always be called right before the object is destroyed.
        (WebKit::CompositingCoordinator::flushPendingLayerChanges): Get WebCore::Page from WebPage.
        (WebKit::CompositingCoordinator::timestamp const): Ditto.
        (WebKit::CompositingCoordinator::syncDisplayState): Ditto.
        (WebKit::CompositingCoordinator::notifyFlushRequired): Do not continue if m_rootLayer is nullptr.
        (WebKit::CompositingCoordinator::deviceScaleFactor const): Get WebCore::Page from WebPage.
        (WebKit::CompositingCoordinator::pageScaleFactor const): Ditto.
        (WebKit::CompositingCoordinator::createGraphicsLayer): Call attachLayer() instead of duplicating the code.
        (WebKit::CompositingCoordinator::setVisibleContentsRect): Get WebCore::Page from WebPage.
        * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
        * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
        (WebKit::DrawingAreaCoordinatedGraphics::discardPreviousLayerTreeHost): Do not call LayerTreeHost::invalidate()
        that has been removed.
        * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
        (WebKit::LayerTreeHost::LayerTreeHost): Construct the coordinator after the sceneIntegration.
        (WebKit::LayerTreeHost::~LayerTreeHost): Invalidate everything here now. We don't really need invalidate()
        method since LayerTreeHost is not refcounted and we always called invalidate right before deleting the object.
        (WebKit::LayerTreeHost::layerFlushTimerFired): This can't happen on invalid state anymore.
        * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h:

2019-10-04  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] REGRESSION(r250673): connection to network process is broken after r250673
        https://bugs.webkit.org/show_bug.cgi?id=202575

        Reviewed by Carlos Alberto Lopez Perez.

        The file descriptor is now closed when the IPC::Attachment is destroyed in NetworkProcessConnectionInfo
        destructor. In case of unix domain sockets we need to transfer the ownership of the fd to
        NetworkProcessConnection, but NetworkProcessConnectionInfo is ow keeping the ownership.

        * WebProcess/Network/NetworkProcessConnectionInfo.h:
        (WebKit::NetworkProcessConnectionInfo::releaseIdentifier): Use IPC::Attachment::releaseFileDescriptor() in case
        of unix domain sockets.
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::ensureNetworkProcessConnection): Use NetworkProcessConnectionInfo::releaseIdentifier() when
        passing the identifier to NetworkProcessConnection.

2019-10-04  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Fix GTK distcheck

        * webkitglib-symbols.map: Remove symbols that are no longer in lib.

2019-10-03  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] WebAutomation: make setWindowRect synchronous
        https://bugs.webkit.org/show_bug.cgi?id=202530

        Reviewed by Carlos Alberto Lopez Perez.

        Move/resize window is asynchronous in GTK, but automation expects it to be synchronous so that get window rect
        after setting it always returns the value set. Use a nested run loop to wait for the configure events after the
        move/resize.

        * UIProcess/API/glib/WebKitUIClient.cpp:
        (UIClient::windowConfigureEventCallback):
        (UIClient::setWindowFrameTimerFired):

2019-10-03  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Address review comments after r250646.

        I forgot to include the documentation improvements suggested.

        * UIProcess/API/glib/WebKitWebContext.cpp:
        (webkit_web_context_class_init):

2019-10-03  Christopher Reid  <chris.reid@sony.com>

        [WinCairo] Remote inspector client target list is racy
        https://bugs.webkit.org/show_bug.cgi?id=202169

        Reviewed by Ross Kirsling.

        Original patch by Basuke Suzuki.

        Use LoaderClient to defer javascript target update calls to until after the page finished load.

        * UIProcess/socket/RemoteInspectorProtocolHandler.cpp:
        * UIProcess/socket/RemoteInspectorProtocolHandler.h:

2019-10-03  Ross Kirsling  <ross.kirsling@sony.com>

        Socket RWI client should acquire backend commands from server
        https://bugs.webkit.org/show_bug.cgi?id=202421

        Reviewed by Devin Rousso.

        * UIProcess/socket/RemoteInspectorClient.cpp:
        (WebKit::RemoteInspectorClient::dispatchMap):
        (WebKit::RemoteInspectorClient::setBackendCommands):
        * UIProcess/socket/RemoteInspectorClient.h:
        Receive "BackendCommands" message from server (which is already base64-encoded) and hand it over to RWIProxy.

        * UIProcess/win/WebProcessPoolWin.cpp:
        (WebKit::backendCommandsPath):
        (WebKit::initializeRemoteInspectorServer):
        On Windows, initialize server with the path to InspectorBackendCommands.js from the CFBundle.

2019-10-03  Alex Christensen  <achristensen@webkit.org>

        Replace _WKProcessPoolConfiguration.suppressesConnectionTerminationOnSystemChange with SPI on _WKWebsiteDataStoreConfiguration
        https://bugs.webkit.org/show_bug.cgi?id=202544

        Reviewed by Tim Horton.

        The _WKProcessPoolConfiguration SPI was originally introduced in rdar://problem/40650244
        Keep both working during the transition period, but we need it to not be on the process pool.

        * NetworkProcess/NetworkSessionCreationParameters.cpp:
        (WebKit::NetworkSessionCreationParameters::encode const):
        (WebKit::NetworkSessionCreationParameters::decode):
        * NetworkProcess/NetworkSessionCreationParameters.h:
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
        (-[_WKWebsiteDataStoreConfiguration suppressesConnectionTerminationOnSystemChange]):
        (-[_WKWebsiteDataStoreConfiguration setSuppressesConnectionTerminationOnSystemChange:]):
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::parameters):
        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
        (WebKit::WebsiteDataStoreConfiguration::copy):
        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
        (WebKit::WebsiteDataStoreConfiguration::suppressesConnectionTerminationOnSystemChange const):
        (WebKit::WebsiteDataStoreConfiguration::setSuppressesConnectionTerminationOnSystemChange):

2019-10-03  Per Arne Vollan  <pvollan@apple.com>

        REGRESSION(249649): Unable to open local files in MiniBrowser on macOS
        https://bugs.webkit.org/show_bug.cgi?id=201798

        Reviewed by Brent Fulgham.

        The commit <https://trac.webkit.org/changeset/249649> introduced a MiniBrowser regression on macOS where MiniBrowser
        is not able to open local files. The change set r249649 fixed a problem where the WebContent process PID was not ready
        to be used when creating a sandbox extension. This happened in the cases where the WebContent process had not finished
        launching when the load started. The WebContent process is also creating sandbox extensions for the Networking process
        for the files being loaded, and also needs to be passing the audit token of the Networking process when creating these.
        This patch implements getting the audit token for the Networking process when the WebProcess is sending a message to
        the UI process to establish the Networking process connection. The audit token is stored in the NetworkProcessConnection
        object, and passed to the NetworkLoadParameters object when the load is started. Finally, when encoding the Network
        resources load parameters, the audit token is used to create an extension for the Networking process.

        API test: WKWebView.LoadFileWithLoadRequest

        * NetworkProcess/NetworkLoadParameters.h:
        * NetworkProcess/NetworkResourceLoadParameters.cpp:
        (WebKit::NetworkResourceLoadParameters::encode const):
        * Platform/IPC/ArgumentCoders.cpp:
        (IPC::ArgumentCoder<audit_token_t>::encode):
        (IPC::ArgumentCoder<audit_token_t>::decode):
        * Platform/IPC/ArgumentCoders.h:
        * Shared/Cocoa/SandboxExtensionCocoa.mm:
        (WebKit::SandboxExtensionImpl::create):
        (WebKit::SandboxExtensionImpl::sandboxExtensionForType):
        (WebKit::SandboxExtensionImpl::SandboxExtensionImpl):
        (WebKit::SandboxExtension::createHandleForMachLookupByPid):
        (WebKit::SandboxExtension::createHandleForReadByPid):
        (WebKit::SandboxExtension::createHandleForReadByAuditToken):
        * Shared/SandboxExtension.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::openNetworkProcessConnection):
        * UIProcess/WebProcessProxy.messages.in:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/Network/NetworkProcessConnection.h:
        (WebKit::NetworkProcessConnection::setNetworkProcessAuditToken):
        (WebKit::NetworkProcessConnection::networkProcessAuditToken const):
        * WebProcess/Network/NetworkProcessConnectionInfo.h: Added.
        (WebKit::NetworkProcessConnectionInfo::identifier):
        (WebKit::NetworkProcessConnectionInfo::encode const):
        (WebKit::NetworkProcessConnectionInfo::decode):
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
        (WebKit::WebLoaderStrategy::loadResourceSynchronously):
        (WebKit::WebLoaderStrategy::startPingLoad):
        (WebKit::WebLoaderStrategy::preconnectTo):
        * WebProcess/WebProcess.cpp:
        (WebKit::getNetworkProcessConnection):
        (WebKit::WebProcess::ensureNetworkProcessConnection):

2019-10-03  Konstantin Tokarev  <annulen@yandex.ru>

        CMake-built WebKit.framework should launch XPC services successfully
        https://bugs.webkit.org/show_bug.cgi?id=202490

        Reviewed by Carlos Alberto Lopez Perez.

        target_link_options() requires CMake 3.10, however we can avoid
        raising required CMake version by moving it to PlatformMac.cmake,
        also avoid introduction of new CMake variable.

        * CMakeLists.txt:
        * PlatformMac.cmake:

2019-10-03  Jiewen Tan  <jiewen_tan@apple.com>

        Support googleLegacyAppidSupport extension
        https://bugs.webkit.org/show_bug.cgi?id=202427
        <rdar://problem/55887473>

        Reviewed by Brent Fulgham.

        * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
        (WebKit::AuthenticatorManagerInternal::collectTransports):
        (WebKit::AuthenticatorManagerInternal::processGoogleLegacyAppIdSupportExtension):
        (WebKit::AuthenticatorManager::handleRequest):
        * UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp:
        (WebKit::CtapAuthenticator::makeCredential):
        (WebKit::CtapAuthenticator::processGoogleLegacyAppIdSupportExtension):
        * UIProcess/WebAuthentication/fido/CtapAuthenticator.h:
        * UIProcess/WebAuthentication/fido/U2fAuthenticator.cpp:
        (WebKit::U2fAuthenticator::continueRegisterCommandAfterResponseReceived):

2019-10-03  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthn] Implement dummy _WKWebAuthenticationPanel SPI
        https://bugs.webkit.org/show_bug.cgi?id=202507
        <rdar://problem/55918793>

        Reviewed by Brent Fulgham.

        This patch implements dummy _WKWebAuthenticationPanel SPI to unblock Safari.

        Here are the illustrations for each SPI:
        1) -[WKUIDelegatePrivate webView:runWebAuthenticationPanel:initiatedByFrame:completionHandler:] is used at the beginning of
        any WebAuthn ceremonies. A WKFrameInfo is provided for more info of the initiating frame so clients could decide either show
        the RP ID or the origin of the frame which may or may not be the RP ID. A callback of _WKWebAuthenticationPanelResult is
        provided such that clients could inform WebKit to continue the ceremony or not. Case like rate limiting of a modular dialog
        could result in _WKWebAuthenticationPanelResultDidNotPresent. Then WebKit will abort the operation.
        _WKWebAuthenticationPanelResultUnavailable tells WebKit the client has no UI implemented and therefore WebKit will operate
        in a non UI mode which basically will only enable HID authenticators, and is the current behavior of macOS Safari.
        2) -[_WKWebAuthenticationPanelDelegate panel:updateWebAuthenticationPanel:] is primarily to instruct users to do some
        actionable thing to recover from some error state. However, it could be used for pure info as well. For
        _WKWebAuthenticationPanelInfoMultipleNFCTagPresents, users can be instructed to only hold one NFC tag to the scanner. For
        _WKWebAuthenticationPanelInfoNoCredentialsFound, users can potentially switch to another security key that could hit a match.
        3) -[_WKWebAuthenticationPanelDelegate panel:dismissWebAuthenticationPanelWithResult:] is to dismiss UI.
        _WKWebAuthenticationResult is provided such that client could show different animations as a hint to the user. The reasons for
        failure could either be timeout or InvalidStateError which will be reported to the page as well. InvalidStateError signals a
        credential matching an entry of the exclude list (excludeCredentials) is found on the authenticator.
        4) -[_WKWebAuthenticationPanel cancel] is the way clients tell WebKit a user cancel.

        * SourcesCocoa.txt:
        * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
        * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.h: Added.
        * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm: Added.
        (-[_WKWebAuthenticationPanel _initWithRelayingPartyID:]):
        (-[_WKWebAuthenticationPanel relyingPartyID]):
        (-[_WKWebAuthenticationPanel cancel]):
        * UIProcess/API/Cocoa/_WKWebAuthenticationPanelInternal.h: Added.
        * WebKit.xcodeproj/project.pbxproj:

2019-10-03  Zan Dobersek  <zdobersek@igalia.com>

        [GTK][WPE] Enable async scrolling
        https://bugs.webkit.org/show_bug.cgi?id=202449

        Reviewed by Carlos Garcia Campos.

        For WPE, explicitly enable the threaded scrolling preference on the
        WebPreferences object. For GTK, the same preference is enabled in
        parallel with the forced-compositing preference, as the async scrolling
        feature depends on always-on AC mode.

        To help with quick evaluation of potential issues around async scrolling
        the feature can still be disabled via the WEBKIT_DISABLE_ASYNC_SCROLLING
        environment variable, though this only works in DEVELOPER_MODE builds.

        * Shared/WebPreferencesDefaultValues.h: Default-enable async frame and
        overflow scrolling on Nicosia-using ports.
        * UIProcess/API/glib/WebKitSettings.cpp:
        (webkit_settings_set_hardware_acceleration_policy):
        * UIProcess/API/wpe/WPEView.cpp:
        (WKWPE::m_backend):
        * UIProcess/gtk/WebPreferencesGtk.cpp:
        (WebKit::WebPreferences::platformInitializeStore):
        * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
        (WebKit::DrawingAreaCoordinatedGraphics::DrawingAreaCoordinatedGraphics):
        (WebKit::DrawingAreaCoordinatedGraphics::updatePreferences):
        (WebKit::DrawingAreaCoordinatedGraphics::supportsAsyncScrolling):
        * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h:

2019-10-03  Zan Dobersek  <zdobersek@igalia.com>

        [Nicosia] Enable runtime checks and triggers for async non-main-frame scrolling
        https://bugs.webkit.org/show_bug.cgi?id=202509

        Reviewed by Carlos Garcia Campos.

        * WebProcess/WebCoreSupport/WebChromeClient.h:
        Allow the non-main-frame compositing trigger for the Nicosia-using ports
        as well. This will enable non-main-frame compositing if the related
        setting is also enabled.

2019-10-03  Alexander Mikhaylenko  <alexm@gnome.org>

        [GTK] Don't hardcode swipe navigation gesture style
        https://bugs.webkit.org/show_bug.cgi?id=202447

        Reviewed by Carlos Garcia Campos.

        Use GTK foreign drawing to draw swipe gesture dimming and shadow instead of
        hardcoded opacity and gradient values.

        Have separate elements for dimming and shadow. Additionally, add border
        and outline. Dimming layer opacity always matches progress, shadow opacity
        is 1 except when the page is almost completely retracted. Border and outline
        opacity is always 1. Outline is drawn above the top page. For determining
        shadow, border and outline width, 'min-width' property is used.

        Each element also has .right or .left style class depending on text direction.

        Creating patterns is relatively expensive, so do it once a gesture
        starts and clear them once it ends. Style changes are currently not
        handled, since it's unlikely anything would change while the gesture
        is done. Dimming layer is created with the same width as webview and is
        clipped when drawing.

        Translate existing dimming and shadow into css as is, add subtle border and
        outline. Since it's controlled via css, downstreams can override the style.

        Set WebKitWebView css name to 'webkitwebview', and only apply styles for
        elements directly preceded by it, otherwise the selectors are too generic.

        * PlatformGTK.cmake: Add gtk.css to gresource bundle.
        * Resources/gtk/gtk-theme.css: Added.
        (webkitwebview > dimming):
        (webkitwebview > shadow):
        (webkitwebview > shadow.right):
        (webkitwebview > shadow.left):
        (webkitwebview > border):
        (webkitwebview > outline):
        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (webkit_web_view_base_class_init): Set css name to 'webkitwebview'.
        * UIProcess/ViewGestureController.h:
        * UIProcess/gtk/ViewGestureControllerGtk.cpp:
        (WebKit::ViewGestureController::createStyleContext):
        (WebKit::createElementPattern):
        (WebKit::elementWidth):
        (WebKit::ViewGestureController::beginSwipeGesture): Create helper patterns.
        (WebKit::ViewGestureController::draw): Rework drawing to use the patterns.
        (WebKit::ViewGestureController::removeSwipeSnapshot): Clear the patterns.

2019-10-03  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Make PSON optional
        https://bugs.webkit.org/show_bug.cgi?id=200967

        Reviewed by Michael Catanzaro.

        It's not possible to enable PSON by default and keep backwards compatibility, applications might need to use new
        API to monitor the page ID changes in the Web view. So, this patch adds a construct only property to
        WebKitWebContext to enable PSON.

        * UIProcess/API/glib/WebKitWebContext.cpp:
        (webkitWebContextGetProperty):
        (webkitWebContextSetProperty):
        (webkitWebContextConstructed):
        (webkit_web_context_class_init):

2019-10-03  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] Add WebKitWebView:page-id property
        https://bugs.webkit.org/show_bug.cgi?id=201642

        Reviewed by Michael Catanzaro.

        The page ID of a WebKitWebView can now change, so we need a way to get notified when it changes.

        * UIProcess/API/glib/WebKitWebView.cpp:
        (webkitWebViewGetProperty): Add getter for page-id.
        (webkit_web_view_class_init): Add page-id property
        (webkitWebViewDidChangePageID): Emit notify::page-id.
        * UIProcess/API/glib/WebKitWebViewPrivate.h:
        * UIProcess/API/gtk/PageClientImpl.cpp:
        (WebKit::PageClientImpl::didChangeWebPageID const): Call webkitWebViewDidChangePageID().
        * UIProcess/API/gtk/PageClientImpl.h:
        * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
        * UIProcess/API/wpe/APIViewClient.h:
        (API::ViewClient::didChangePageID): Added virtual method.
        * UIProcess/API/wpe/PageClientImpl.cpp:
        (WebKit::PageClientImpl::didChangeWebPageID const): Call WKWPE::View::didChangePageID().
        * UIProcess/API/wpe/PageClientImpl.h:
        * UIProcess/API/wpe/WPEView.cpp:
        (WKWPE::View::didChangePageID): Call API::ViewClient::didChangePageID().
        * UIProcess/API/wpe/WPEView.h:
        * UIProcess/PageClient.h:
        (WebKit::PageClient::didChangeWebPageID const): Added virtual method.
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::swapToWebProcess): Call PageClient::didChangeWebPageID().

2019-10-02  Andy Estes  <aestes@apple.com>

        [iOS] When hit testing for a context menu interaction, do not consider whether the element is contenteditable
        https://bugs.webkit.org/show_bug.cgi?id=202498
        <rdar://problem/54723131>

        Reviewed by Tim Horton.

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::startInteractionWithElementAtPosition): Changed to call
        WebCore::Frame::nodeRespondingToInteraction.

2019-10-02  Myles C. Maxfield  <mmaxfield@apple.com>

        REGRESSION (r245672): <select> dropdown with text-rendering: optimizeLegibility freezes Safari
        https://bugs.webkit.org/show_bug.cgi?id=202198

        Reviewed by Tim Horton.

        NSFont has a bug where passing "auto" to kCTFontOpticalSizeAttribute
        causes an exception to be thrown. We don't catch the exception, so we
        pop up back to the runloop, which confuses the UI process.

        The solution is twofold: 1) Workaround the bug by passing the font size
        to kCTFontOpticalSizeAttribute instead, and 2) catch any exceptions that
        this part of the code might throw.

        * UIProcess/mac/WebPopupMenuProxyMac.mm:
        (WebKit::WebPopupMenuProxyMac::showPopupMenu):

2019-10-02  Alex Christensen  <achristensen@webkit.org>

        [CMake] Don't link WebKit.framework with SecItemShim
        ​https://bugs.webkit.org/show_bug.cgi?id=202490

        * PlatformMac.cmake:
        Otherwise everything that uses the Security framework crashes immediately.
        We only need it in the NetworkProcess.

2019-10-02  Alex Christensen  <achristensen@webkit.org>

        CMake-built WebKit.framework should launch XPC services successfully
        https://bugs.webkit.org/show_bug.cgi?id=202490

        Rubber-stamped by Tim Horton.

        * CMakeLists.txt:
        * PlatformMac.cmake:

2019-10-02  Kate Cheney  <katherine_cheney@apple.com>

        Updated resource load statistics are never merged into the SQLite Database backend (202372).
        https://bugs.webkit.org/show_bug.cgi?id=202372
        <rdar://problem/55854542>

        Reviewed by Brent Fulgham. 

        This patch has a lot of changes to the test infrastructure to be able 
        to test the mergeStatistics function. Merging functionality mimics
        that of the ResourceLoadStatisticsMemoryStore and the merge() function in
        ResourceLoadStatistics.cpp.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        (WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore):
        Added new SQLite queries that are needed to merge new statistics.

        (WebKit::ResourceLoadStatisticsDatabaseStore::prepareStatements):
        Added new prepare statements for new SQLite queries.

        (WebKit::ResourceLoadStatisticsDatabaseStore::insertObservedDomain):
        Updated to use domainID() instead of confirmDomainDoesNotExist which 
        was deleted. Changed the insert bind parameters
        to utilize new enum of Observed Domain table indices which will help
        reduce errors in the future if the database schema changes.

        (WebKit::ResourceLoadStatisticsDatabaseStore::relationshipExists const):
        Changed {public} to {private} in logging statement to avoid leaking
        sensitive information when logging the query error.

        (WebKit::ResourceLoadStatisticsDatabaseStore::confirmDomainDoesNotExist const): Deleted.
        This function essentially does the exact same thing as domainID and
        we can reduce code duplication by deleting it and transitioning all
        other functions to use domainID instead.

        (WebKit::ResourceLoadStatisticsDatabaseStore::domainID const):
        Changed {public} to {private} in logging statement to avoid leaking
        sensitive information when logging the query error.
        
        (WebKit::ResourceLoadStatisticsDatabaseStore::insertDomainRelationships):
        In order to reuse this code for the merge statistics function, I added
        a check before each insert call to ensure the relationship does not
        already exist in the database. This was not needed before because it
        was only called on an empty database.

        (WebKit::ResourceLoadStatisticsDatabaseStore::merge):
        (WebKit::ResourceLoadStatisticsDatabaseStore::mergeStatistic):
        (WebKit::ResourceLoadStatisticsDatabaseStore::mergeStatistics):
        Merges new statistic.

        (WebKit::ResourceLoadStatisticsDatabaseStore::incrementRecordsDeletedCountForDomains):
        (WebKit::ResourceLoadStatisticsDatabaseStore::recursivelyFindNonPrevalentDomainsThatRedirectedToThisDomain):
        (WebKit::ResourceLoadStatisticsDatabaseStore::markAsPrevalentIfHasRedirectedToPrevalent):
        (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccess):
        (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccessUnderOpener):
        (WebKit::ResourceLoadStatisticsDatabaseStore::grandfatherDataForDomains):
        (WebKit::ResourceLoadStatisticsDatabaseStore::ensurePrevalentResourcesForDebugMode):
        (WebKit::ResourceLoadStatisticsDatabaseStore::setUserInteraction):
        (WebKit::ResourceLoadStatisticsDatabaseStore::clearUserInteraction):
        (WebKit::ResourceLoadStatisticsDatabaseStore::hasHadUserInteraction):
        (WebKit::ResourceLoadStatisticsDatabaseStore::setPrevalentResource):
        (WebKit::ResourceLoadStatisticsDatabaseStore::setDomainsAsPrevalent):
        (WebKit::ResourceLoadStatisticsDatabaseStore::predicateValueForDomain const):
        (WebKit::ResourceLoadStatisticsDatabaseStore::clearPrevalentResource):
        Changed {public} to {private} in logging statement to avoid leaking
        sensitive information when logging the query error.

        (WebKit::ResourceLoadStatisticsDatabaseStore::setGrandfathered):
        Fix a bug uncovered by the new test cases.
        
        (WebKit::ResourceLoadStatisticsDatabaseStore::ensureResourceStatisticsForRegistrableDomain):
        (WebKit::ResourceLoadStatisticsDatabaseStore::clearDatabaseContents):
        (WebKit::ResourceLoadStatisticsDatabaseStore::cookieTreatmentForOrigin const):
        (WebKit::ResourceLoadStatisticsDatabaseStore::clearExpiredUserInteractions):
        (WebKit::ResourceLoadStatisticsDatabaseStore::clearGrandfathering):
        (WebKit::ResourceLoadStatisticsDatabaseStore::pruneStatisticsIfNeeded):
        (WebKit::ResourceLoadStatisticsDatabaseStore::updateLastSeen):
        Changed {public} to {private} in logging statement to avoid leaking
        sensitive information when logging the query error.
        
        (WebKit::ResourceLoadStatisticsDatabaseStore::updateDataRecordsRemoved):
        A new function that utilizes a query needed for the merging of two
        statistics.
        
        (WebKit::ResourceLoadStatisticsDatabaseStore::confirmDomainDoesNotExist const): Deleted.
        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
        
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
        (WebKit::ResourceLoadStatisticsMemoryStore::mergeStatistics):
        (WebKit::ResourceLoadStatisticsMemoryStore::wasAccessedAsFirstPartyDueToUserInteraction const): Deleted.
        Removed the check for updating times accessed due to first party 
        interaction, which is data no longer needed in updated ITP. 

        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
        Added the mergeStatistics function (previously only in the memory
        store) to the parent class now that it is used by both stores.
        
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
        This function now calls mergeStatistics on the database store if
        enabled.

        (WebKit::WebResourceLoadStatisticsStore::mergeStatisticForTesting):
        This function builds a vector from the sample data to test the
        mergeStatistics() function of the database store.

        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::mergeStatisticForTesting):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreSetStatisticsMergeStatistic):
        Fixed bug where isGrandfathered function in WKWebsiteDataStoreRef
        was calling hasHadUserInteraction by mistake.

        * UIProcess/API/C/WKWebsiteDataStoreRef.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::mergeStatisticForTesting):
        * UIProcess/Network/NetworkProcessProxy.h:
        This code is for testing the mergeStatistics() function.

        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::isGrandfathered):
        (WebKit::WebsiteDataStore::mergeStatisticForTesting):
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        Added this function which contacts the networkProcess to retrieve the
        grandfathered value for a domain. This was not included before because
        of a bug in WKWebsiteDataStoreRef.

2019-10-02  Dean Jackson  <dino@apple.com>

        Provide originating website URL to AR QuickLook
        https://bugs.webkit.org/show_bug.cgi?id=202451

        Reviewed by Antoine Quint.

        Declare the setAdditionalParameters method and
        call it with the originating page URL if available.

        * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:

2019-10-02  Keith Rollin  <krollin@apple.com>

        Properly mark canceled resources in NetworkActivityTracker
        https://bugs.webkit.org/show_bug.cgi?id=202440
        <rdar://problem/55843651>

        Reviewed by Brent Fulgham.

        The nw_activity facility tracking resource loads did not originally
        have support for reporting resources that were canceled. It now has
        that support (since late MacOS 14-aligned SDKs), so add support for it
        in NetworkActivityTracker and use it in places where we were
        previously reporting the status of canceled resources as "None".

        * NetworkProcess/NetworkActivityTracker.h:
        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::stopAllNetworkActivityTracking):
        (WebKit::NetworkConnectionToWebProcess::stopAllNetworkActivityTrackingForPage):
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::cleanup):
        * NetworkProcess/cocoa/NetworkActivityTrackerCocoa.mm:
        (WebKit::NetworkActivityTracker::complete):

2019-10-02  Zan Dobersek  <zdobersek@igalia.com>

        Unreviewed build fix for non-Mac ports after r250600.

        * UIProcess/WebProcessPool.cpp:
        Make the CoreGraphicsSPI.h header include exclusive to the Mac port.

2019-10-02  Antoine Quint  <graouts@apple.com>

        Unreviewed build fix for macOS, broken by r250595.

        * UIProcess/WebProcessPool.cpp:

2019-10-02  youenn fablet  <youenn@apple.com>

        Use strongly typed identifiers for webrtc sockets
        https://bugs.webkit.org/show_bug.cgi?id=202400

        Reviewed by Chris Dumez.

        Refactoring to use LibWebRTCSocketIdentifier instead of uint64_t.

        * NetworkProcess/webrtc/LibWebRTCSocketClient.cpp:
        (WebKit::LibWebRTCSocketClient::LibWebRTCSocketClient):
        * NetworkProcess/webrtc/LibWebRTCSocketClient.h:
        * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
        (WebKit::NetworkRTCProvider::createSocket):
        (WebKit::NetworkRTCProvider::createUDPSocket):
        (WebKit::NetworkRTCProvider::createServerTCPSocket):
        (WebKit::NetworkRTCProvider::createClientTCPSocket):
        (WebKit::NetworkRTCProvider::wrapNewTCPConnection):
        (WebKit::NetworkRTCProvider::addSocket):
        (WebKit::NetworkRTCProvider::takeSocket):
        (WebKit::NetworkRTCProvider::newConnection):
        (WebKit::NetworkRTCProvider::didReceiveNetworkRTCSocketMessage):
        (WebKit::NetworkRTCProvider::closeListeningSockets):
        (WebKit::NetworkRTCProvider::callSocket):
        * NetworkProcess/webrtc/NetworkRTCProvider.h:
        * NetworkProcess/webrtc/NetworkRTCProvider.messages.in:
        * NetworkProcess/webrtc/NetworkRTCSocket.cpp:
        (WebKit::NetworkRTCSocket::NetworkRTCSocket):
        * NetworkProcess/webrtc/NetworkRTCSocket.h:
        * Scripts/webkit/messages.py:
        * WebProcess/Network/NetworkProcessConnection.cpp:
        (WebKit::NetworkProcessConnection::didReceiveMessage):
        * WebProcess/Network/webrtc/LibWebRTCNetwork.h:
        (WebKit::LibWebRTCNetwork::socket):
        * WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
        (WebKit::LibWebRTCSocket::LibWebRTCSocket):
        * WebProcess/Network/webrtc/LibWebRTCSocket.h:
        * WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp:
        (WebKit::LibWebRTCSocketFactory::createServerTcpSocket):
        (WebKit::LibWebRTCSocketFactory::createUdpSocket):
        (WebKit::LibWebRTCSocketFactory::createClientTcpSocket):
        (WebKit::LibWebRTCSocketFactory::createNewConnectionSocket):
        * WebProcess/Network/webrtc/LibWebRTCSocketFactory.h:
        (WebKit::LibWebRTCSocketFactory::socket):
        (WebKit::LibWebRTCSocketFactory::resolver):
        (WebKit::LibWebRTCSocketFactory::takeResolver):
        (WebKit::LibWebRTCSocketFactory::disableNonLocalhostConnections):
        * WebProcess/Network/webrtc/WebRTCSocket.cpp:
        (WebKit::WebRTCSocket::signalOnNetworkThread):
        (WebKit::WebRTCSocket::WebRTCSocket):
        (WebKit::WebRTCSocket::signalSentPacket):
        (WebKit::WebRTCSocket::signalConnect):
        (WebKit::WebRTCSocket::signalClose):
        (WebKit::WebRTCSocket::signalNewConnection):
        * WebProcess/Network/webrtc/WebRTCSocket.h:
        * WebProcess/Network/webrtc/WebRTCSocket.messages.in:

2019-10-02  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] Stop using legacy custom protocol implementation
        https://bugs.webkit.org/show_bug.cgi?id=202407

        Reviewed by Žan Doberšek.

        Use the new approach, which is simpler and doesn't require to go to the network process to load custom
        protocols.

        * NetworkProcess/CustomProtocols/soup/LegacyCustomProtocolManagerSoup.cpp: Removed.
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::m_messagePortChannelRegistry):
        * NetworkProcess/soup/WebKitSoupRequestInputStream.cpp: Removed.
        * NetworkProcess/soup/WebKitSoupRequestInputStream.h: Removed.
        * PlatformGTK.cmake:
        * PlatformWPE.cmake:
        * SourcesGTK.txt:
        * SourcesWPE.txt:
        * UIProcess/API/glib/WebKitCustomProtocolManagerClient.cpp: Removed.
        * UIProcess/API/glib/WebKitCustomProtocolManagerClient.h: Removed.
        * UIProcess/API/glib/WebKitURISchemeRequest.cpp:
        (webkitURISchemeRequestCreate):
        (webkit_uri_scheme_request_get_scheme):
        (webkit_uri_scheme_request_get_uri):
        (webkit_uri_scheme_request_get_path):
        (webkit_uri_scheme_request_get_web_view):
        (webkitURISchemeRequestReadCallback):
        (webkit_uri_scheme_request_finish_error):
        * UIProcess/API/glib/WebKitURISchemeRequestPrivate.h:
        * UIProcess/API/glib/WebKitWebContext.cpp:
        (webkitWebContextConstructed):
        (webkitWebContextDispose):
        (webkit_web_context_register_uri_scheme):
        (webkitWebContextCreatePageForWebView):
        * UIProcess/API/glib/WebKitWebContextPrivate.h:
        * UIProcess/WebURLSchemeTask.h:
        (WebKit::WebURLSchemeTask::request const):
        * UIProcess/soup/WebProcessPoolSoup.cpp:

2019-10-02  Zan Dobersek  <zdobersek@igalia.com>

        [Nicosia] Enable async scrolling at build-time for Nicosia-using ports
        https://bugs.webkit.org/show_bug.cgi?id=202397

        Reviewed by Carlos Garcia Campos.

        * Shared/WebEvent.h:
        Enable WebWheelEvent phasing for WPE, as required by the
        ASYNC_SCROLLING code.

2019-10-01  Tim Horton  <timothy_horton@apple.com>

        Clean up some includes to make the build a bit faster
        https://bugs.webkit.org/show_bug.cgi?id=202444

        Reviewed by Geoff Garen.

        * UIProcess/API/Cocoa/_WKThumbnailView.mm:

2019-10-01  Alex Christensen  <achristensen@webkit.org>

        Progress towards a functioning CMake build on Mac
        https://bugs.webkit.org/show_bug.cgi?id=202443

        Rubber-stamped by Tim Horton.

        * CMakeLists.txt:
        * PlatformMac.cmake:

2019-10-01  John Wilander  <wilander@apple.com>

        Storage Access API: document.hasStorageAccess() should return true when the cookie policy allows access
        https://bugs.webkit.org/show_bug.cgi?id=202435
        <rdar://problem/55718526>

        Reviewed by Brent Fulgham.

        WebKit's Storage Access API implementation has so far only looked at whether ITP is
        blocking cookie access or not. However, the default cookie policy is still in
        effect underneath ITP. document.hasStorageAccess() should return true if the
        third-party:
        a) is not classified by ITP, and
        b) has cookies which implies it can use cookies as third-party according to the
        default cookie policy.

        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
        (WebKit::ResourceLoadStatisticsMemoryStore::hasStorageAccess):
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::hasCookies):
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::hasStorageAccess):
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::registrableDomainsWithWebsiteData):

2019-10-01  Antti Koivisto  <antti@apple.com>

        [CSS Shadow Parts] Parse 'part' attribute
        https://bugs.webkit.org/show_bug.cgi?id=202409

        Reviewed by Ryosuke Niwa.

        * Shared/WebPreferences.yaml:

        Add experimental feature, default to disabled for now.

2019-10-01  Alex Christensen  <achristensen@webkit.org>

        Progress towards successful CMake build on Mac
        https://bugs.webkit.org/show_bug.cgi?id=202426

        Rubber-stamped by Tim Horton.

        * Platform/cocoa/PaymentAuthorizationPresenter.h:
        * Platform/cocoa/PaymentAuthorizationPresenter.mm:
        * Platform/cocoa/PaymentAuthorizationViewController.h:
        * Platform/cocoa/PaymentAuthorizationViewController.mm:
        * Platform/cocoa/WKPaymentAuthorizationDelegate.mm:
        * PlatformMac.cmake:
        * Shared/SandboxExtension.h:
        (WebKit::SandboxExtension::createHandleForReadByPid):
        * SourcesCocoa.txt:
        * UIProcess/API/Cocoa/WKWebView.mm:
        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _hasRegisteredServiceWorker]):
        * UIProcess/API/mac/WKView.mm:
        * UIProcess/Cocoa/SOAuthorization/PopUpSOAuthorizationSession.mm:
        * UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm:
        * UIProcess/Cocoa/WKFullKeyboardAccessWatcher.mm:
        * UIProcess/Cocoa/WKShareSheet.mm:
        (-[WKShareSheet delegate]):
        (-[WKShareSheet setDelegate:]):
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        * UIProcess/Cocoa/WebViewImpl.h:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebCoreSupport/WebResourceLoadObserver.cpp:
        * WebProcess/WebCoreSupport/ios/WebPreviewLoaderClient.h:
        * WebProcess/WebPage/Cocoa/WebRemoteObjectRegistry.cpp:

2019-10-01  Tim Horton  <timothy_horton@apple.com>

        Clean up some includes to make the build a bit faster
        https://bugs.webkit.org/show_bug.cgi?id=202417

        Reviewed by Jer Noble.

        * WebProcess/Plugins/Netscape/NetscapePlugin.h:
        * WebProcess/Plugins/Plugin.h:
        Fix the build.

2019-10-01  Alex Christensen  <achristensen@webkit.org>

        Fix GTK build after r250558
        https://bugs.webkit.org/show_bug.cgi?id=202390

        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp:
        (webkit_dom_dom_window_confirm):

2019-10-01  Alex Christensen  <achristensen@webkit.org>

        Fix an internal build.

        Ignore some deprecation warnings.  We'll adopt new SPI soon.

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):

2019-10-01  youenn fablet  <youenn@apple.com>

        Remove races condition when validating capture sandbox extension revocation
        https://bugs.webkit.org/show_bug.cgi?id=202133
        <rdar://problem/55660905>

        Reviewed by Eric Carlson.

        * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
        (WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy):
        Explicitly ask the page to stop capture.
        This will make sure capture is stopped when revoking sandbox extensions.

2019-09-30  Alex Christensen  <achristensen@webkit.org>

        Resurrect Mac CMake build
        https://bugs.webkit.org/show_bug.cgi?id=202384

        Rubber-stamped by Tim Horton.

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        * PlatformMac.cmake:
        * Shared/API/Cocoa/_WKRemoteObjectRegistry.mm:
        * UIProcess/API/Cocoa/WKWebView.mm:
        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
        * WebKit2Prefix.h:

2019-09-30  Christopher Reid  <chris.reid@sony.com>

        [WinCairo] Move Remote Inspector Server initialization out of WebView
        https://bugs.webkit.org/show_bug.cgi?id=202369

        Reviewed by Ross Kirsling.
        
        Move Remote Inspector Server initialization to Windows WebProcessPool initialization.

        * UIProcess/win/WebProcessPoolWin.cpp:
        * UIProcess/win/WebView.cpp:

2019-09-30  Alex Christensen  <achristensen@webkit.org>

        Move DownloadMonitor test speed multiplier from WebProcessPool to WebsiteDataStoreConfiguration
        https://bugs.webkit.org/show_bug.cgi?id=202339

        Reviewed by Youenn Fablet.

        This was only used for some unit tests, which still are accelerated so they pass in the same amount of time as before.
        I need this value to not be process-global in the NetworkProcess.

        * NetworkProcess/Downloads/Download.cpp:
        (WebKit::Download::Download):
        * NetworkProcess/Downloads/Download.h:
        (WebKit::Download::Download):
        (WebKit::Download::testSpeedMultiplier const):
        * NetworkProcess/Downloads/DownloadManager.cpp:
        (WebKit::DownloadManager::resumeDownload):
        * NetworkProcess/Downloads/DownloadManager.h:
        * NetworkProcess/Downloads/DownloadMonitor.cpp:
        (WebKit::DownloadMonitor::applicationDidEnterBackground):
        (WebKit::DownloadMonitor::testSpeedMultiplier const):
        (WebKit::DownloadMonitor::timerFired):
        (WebKit::DownloadMonitor::speedMultiplier const): Deleted.
        * NetworkProcess/Downloads/DownloadMonitor.h:
        * NetworkProcess/NetworkDataTaskBlob.cpp:
        (WebKit::NetworkDataTaskBlob::download):
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::initializeNetworkProcess):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
        (WebKit::NetworkProcessCreationParameters::decode):
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::NetworkSession):
        * NetworkProcess/NetworkSession.h:
        (WebKit::NetworkSession::testSpeedMultiplier const):
        * NetworkProcess/NetworkSessionCreationParameters.cpp:
        (WebKit::NetworkSessionCreationParameters::encode const):
        (WebKit::NetworkSessionCreationParameters::decode):
        * NetworkProcess/NetworkSessionCreationParameters.h:
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]):
        * UIProcess/API/APIProcessPoolConfiguration.cpp:
        (API::ProcessPoolConfiguration::copy):
        * UIProcess/API/APIProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
        (-[_WKProcessPoolConfiguration downloadMonitorSpeedMultiplierForTesting]): Deleted.
        (-[_WKProcessPoolConfiguration setDownloadMonitorSpeedMultiplierForTesting:]): Deleted.
        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
        (-[_WKWebsiteDataStoreConfiguration testSpeedMultiplier]):
        (-[_WKWebsiteDataStoreConfiguration setTestSpeedMultiplier:]):
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeNetworkProcess):
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::parameters):
        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
        (WebKit::WebsiteDataStoreConfiguration::copy):
        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
        (WebKit::WebsiteDataStoreConfiguration::testSpeedMultiplier const):
        (WebKit::WebsiteDataStoreConfiguration::setTestSpeedMultiplier):

2019-09-30  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] IconDatabase is not thread-safe
        https://bugs.webkit.org/show_bug.cgi?id=201303

        Reviewed by Žan Doberšek.

        Rewrite the IconDatabase implementation. Now that we are the only users of this code, we can simply it a lot and
        design it specifically for our API, which implementation has been simplified a lot too. There's no change in
        the database schema nor in behavior from the API point of view.

        * UIProcess/API/glib/IconDatabase.cpp:
        (WebKit::IconDatabase::IconDatabase):
        (WebKit::IconDatabase::~IconDatabase):
        (WebKit::IconDatabase::createTablesIfNeeded):
        (WebKit::IconDatabase::populatePageURLToIconURLMap):
        (WebKit::IconDatabase::clearStatements):
        (WebKit::IconDatabase::pruneTimerFired):
        (WebKit::IconDatabase::startPruneTimer):
        (WebKit::IconDatabase::clearLoadedIconsTimerFired):
        (WebKit::IconDatabase::startClearLoadedIconsTimer):
        (WebKit::IconDatabase::iconIDForIconURL):
        (WebKit::IconDatabase::setIconIDForPageURL):
        (WebKit::IconDatabase::iconData):
        (WebKit::IconDatabase::addIcon):
        (WebKit::IconDatabase::updateIconTimestamp):
        (WebKit::IconDatabase::deleteIcon):
        (WebKit::IconDatabase::checkIconURLAndSetPageURLIfNeeded):
        (WebKit::IconDatabase::loadIconForPageURL):
        (WebKit::IconDatabase::iconURLForPageURL):
        (WebKit::IconDatabase::setIconForPageURL):
        (WebKit::IconDatabase::clear):
        * UIProcess/API/glib/IconDatabase.h:
        (WebKit::IconDatabase::create):
        * UIProcess/API/glib/WebKitFaviconDatabase.cpp:
        (webkitFaviconDatabaseCreate):
        (webkitFaviconDatabaseIsOpen):
        (webkitFaviconDatabaseOpen):
        (webkitFaviconDatabaseClose):
        (webkitFaviconDatabaseGetLoadDecisionForIcon):
        (webkitFaviconDatabaseSetIconForPageURL):
        (webkitFaviconDatabaseGetFaviconInternal):
        (webkit_favicon_database_get_favicon):
        (webkit_favicon_database_get_favicon_finish):
        (webkit_favicon_database_get_favicon_uri):
        (webkit_favicon_database_clear):
        * UIProcess/API/glib/WebKitFaviconDatabasePrivate.h:
        * UIProcess/API/glib/WebKitWebContext.cpp:
        (webkitWebContextDispose):
        (webkit_web_context_set_favicon_database_directory):
        (webkitWebContextCreatePageForWebView):
        (webkitWebContextWebViewDestroyed):
        * UIProcess/API/glib/WebKitWebView.cpp:
        (webkitWebViewRequestFavicon):
        (webkitWebViewGetLoadDecisionForIcon):
        (webkitWebViewSetIcon):

2019-09-30  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] Add about:gpu
        https://bugs.webkit.org/show_bug.cgi?id=202305

        Reviewed by Žan Doberšek.

        A builtin protocol handler to show information about hardware acceleration. This is useful information we need
        from people reporting issues in accelerated compositing mode.

        * SourcesGTK.txt:
        * SourcesWPE.txt:
        * UIProcess/API/glib/WebKitProtocolHandler.cpp: Added.
        (WebKit::WebKitProtocolHandler::WebKitProtocolHandler):
        (WebKit::WebKitProtocolHandler::handleRequest):
        (WebKit::webkitPortName):
        (WebKit::hardwareAccelerationPolicy):
        (WebKit::webGLEnabled):
        (WebKit::openGLAPI):
        (WebKit::nativeInterface):
        (WebKit::WebKitProtocolHandler::handleGPU):
        * UIProcess/API/glib/WebKitProtocolHandler.h: Added.
        * UIProcess/API/glib/WebKitWebContext.cpp:
        (webkitWebContextConstructed):

2019-09-30  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r250291.
        https://bugs.webkit.org/show_bug.cgi?id=202359

        it is failing
        TestWebKitAPI.ProcessSwap.GetUserMediaCaptureState (Requested
        by youenn on #webkit).

        Reverted changeset:

        "Delay capture sandbox extension revocation to after the page
        close message is sent"
        https://bugs.webkit.org/show_bug.cgi?id=202133
        https://trac.webkit.org/changeset/250291

2019-09-29  Zan Dobersek  <zdobersek@igalia.com>

        ScrollingTreeScrollingNode: use LayerRepresentation for scroll container, scrolled contents layers
        https://bugs.webkit.org/show_bug.cgi?id=202256
        <rdar://problem/55772092>

        Reviewed by Simon Fraser.

        * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
        (WebKit::RemoteScrollingCoordinatorProxy::establishLayerTreeScrollingRelations):
        Use static casts to retrieve the CALayer pointers from the
        LayerRepresentation objects due to the explicit operators.

2019-09-29  Zan Dobersek  <zdobersek@igalia.com>

        Tighten up LayerRepresentation operators
        https://bugs.webkit.org/show_bug.cgi?id=202344

        Reviewed by Simon Fraser.

        With LayerRepresentation operators now being explicit, we require
        to manually specify conversion to CALayer pointers or
        GraphicsLayer::PlatformLayerID values.

        * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
        (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
        * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
        (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
        * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
        (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateBeforeChildren):
        * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
        (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateBeforeChildren):
        * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp:
        (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::commitStateBeforeChildren):
        * UIProcess/RemoteLayerTree/mac/ScrollingTreeOverflowScrollingNodeRemoteMac.cpp:
        (WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::commitStateBeforeChildren):

2019-09-27  Adrian Perez de Castro  <aperez@igalia.com>

        [GTK][WPE] Fixes for non-unified builds after r249714
        https://bugs.webkit.org/show_bug.cgi?id=202304

        Reviewed by Youenn Fablet.

        * NetworkProcess/NetworkLoadChecker.h: Add missing inclusion of the pal/SessionID.h header.
        * NetworkProcess/NetworkResourceLoadMap.cpp: Add missing inclusion of the
        NetworkResourceLoader.h header.
        * UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.cpp:
        (WKWebsiteDataStoreConfigurationCreate): Add missing namespace to usage of the
        WebKit::IsPersistent::Yes value.
        * UIProcess/WebPageProxy.cpp: Add missing inclusion of the LegacyGlobalSettings.h header.

2019-09-27  Tim Horton  <timothy_horton@apple.com>

        Adopt new UIWebGeolocationPolicyDecider SPI to pass a view instead of a window
        https://bugs.webkit.org/show_bug.cgi?id=202329
        <rdar://problem/25963823>

        Reviewed by Wenson Hsieh.

        * Platform/spi/ios/UIKitSPI.h:
        * UIProcess/ios/WKGeolocationProviderIOS.mm:
        (-[WKGeolocationProviderIOS geolocationAuthorizationGranted]):
        * UIProcess/ios/WKGeolocationProviderIOSObjCSecurityOrigin.mm:
        (WebKit::decidePolicyForGeolocationRequestFromOrigin):
        Switch to newer SPI that takes a UIView instead of a UIWindow, so that
        UIWebGeolocationPolicyDecider can find the correct presenting view controller.

2019-09-27  Zalan Bujtas  <zalan@apple.com>

        [iPadOS] Can’t use RalphLauren.com on iPad because hover menus don’t stay up
        https://bugs.webkit.org/show_bug.cgi?id=202331
        <rdar://problem/55629493>

        Reviewed by Tim Horton.

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::handleSyntheticClick):
        (WebKit::nodeTriggersFastPath): Deleted.

2019-09-27  Alex Christensen  <achristensen@webkit.org>

        Move shouldUseTestingNetworkSession from NetworkProcessCreationParameters to NetworkSessionCreationParameters
        https://bugs.webkit.org/show_bug.cgi?id=202327

        Reviewed by Tim Horton.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::initializeNetworkProcess):
        (WebKit::NetworkProcess::ensureSession):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
        (WebKit::NetworkProcessCreationParameters::decode):
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::NetworkSession):
        * NetworkProcess/NetworkSessionCreationParameters.cpp:
        (WebKit::NetworkSessionCreationParameters::encode const):
        (WebKit::NetworkSessionCreationParameters::decode):
        * NetworkProcess/NetworkSessionCreationParameters.h:
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
        * NetworkProcess/curl/RemoteNetworkingContextCurl.cpp:
        (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
        * NetworkProcess/mac/RemoteNetworkingContext.mm:
        (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
        * NetworkProcess/soup/RemoteNetworkingContextSoup.cpp:
        (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
        * UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.cpp:
        (WKWebsiteDataStoreConfigurationSetPerOriginStorageQuota):
        (WKWebsiteDataStoreConfigurationSetNetworkCacheSpeculativeValidationEnabled):
        (WKWebsiteDataStoreConfigurationGetTestingSessionEnabled):
        (WKWebsiteDataStoreConfigurationSetTestingSessionEnabled):
        * UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::parameters):
        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
        (WebKit::WebsiteDataStoreConfiguration::copy):
        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
        (WebKit::WebsiteDataStoreConfiguration::testingSessionEnabled const):
        (WebKit::WebsiteDataStoreConfiguration::setTestingSessionEnabled):

2019-09-27  Alex Christensen  <achristensen@webkit.org>

        Move legacy custom protocol registration from process pool to NetworkProcessProxy
        https://bugs.webkit.org/show_bug.cgi?id=202315

        Reviewed by Tim Horton.

        Legacy custom protocol registration is a global thing, which is why it's legacy and we're trying to get rid of it.
        In the meantime, we don't want it to be in the set of things the NetworkProcess depends on the WebProcessPool for, which should be an empty set.

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):
        (WebKit::WebProcessPool::registerGlobalURLSchemeAsHavingCustomProtocolHandlers):
        (WebKit::WebProcessPool::unregisterGlobalURLSchemeAsHavingCustomProtocolHandlers):
        (WebKit::WebProcessPool::registerSchemeForCustomProtocol): Deleted.
        (WebKit::WebProcessPool::unregisterSchemeForCustomProtocol): Deleted.
        * UIProcess/WebProcessPool.h:

2019-09-27  Alex Christensen  <achristensen@webkit.org>

        Layout Test http/tests/cache-storage/cache-records-persistency.https.html is failing
        https://bugs.webkit.org/show_bug.cgi?id=202323

        Reviewed by Tim Horton.

        This reverts most of r250351.
        It turns out NetworkProcessProxy::addSession has some side effects in the UIProcess that are useful for NetworkProcess resumption after crashes.  Let's keep that.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::initializeNetworkProcess):
        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
        (WebKit::NetworkProcessCreationParameters::decode):
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):

2019-09-27  Jer Noble  <jer.noble@apple.com>

        Unreviewed build-fix: wrap the AssertionServicesSPI.h in an IOS_FAMILY check.

        * WebProcess/cocoa/WebProcessCocoa.mm:

2019-09-27  Said Abou-Hallawa  <sabouhallawa@apple.com>

        [iOS]: When inserting a photo and then inserting auto-corrected text, the photo is removed
        https://bugs.webkit.org/show_bug.cgi?id=202294

        Reviewed by Wenson Hsieh.

        WebPage::applyAutocorrectionInternal() calls wordRangeFromPosition() to
        calculate the range of the word to be replaced with the auto-corrected
        word. But if the text of the range does not match the original text,
        applyAutocorrectionInternal() tries to correct the range by moving it
        forward such that the length of the text range matches the length of the
        original text.

        Another case, which should correct the range also, is: the range does not
        have a text but it is not collapsed. In this case, we should set the range
        back to the selection range so non-text nodes is removed.

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

2019-09-27  John Wilander  <wilander@apple.com>

        Storage Access API: document.hasStorageAccess() should return false by default
        https://bugs.webkit.org/show_bug.cgi?id=202281
        <rdar://problem/55718526>

        Reviewed by Alex Christensen.

        document.hasStorageAccess() should return false by default so that it only
        returns true if the context has asked for and been granted storage access.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        (WebKit::ResourceLoadStatisticsDatabaseStore::hasStorageAccess):
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
        (WebKit::ResourceLoadStatisticsMemoryStore::hasStorageAccess):

2019-09-27  Jer Noble  <jer.noble@apple.com>

        [iOS] Lock screen controls can fail to play web content
        https://bugs.webkit.org/show_bug.cgi?id=202279

        Reviewed by Chris Dumez.

        When playback is paused from the lock screen via Now Playing controls, the WebProcess,
        UIProcess, and Network Process will all be suspended. MediaRemote will take an assertion
        and wake up the WebProcess when a remote control command to "play" is sent via the Now
        Playing controls. However, if a synchronous message to the (suspended) Network or UIProcess
        is issued before the notification that the process was unexpectedly unsuspended can be
        issued (which will subsequently unsuspend the UIProcess and Network process), we can get
        into a deadlocked state where the main thread is blocked on the sync message to a suspended
        process.

        To work around this problem, move all the processing from ProcessTaskStateObserver to a
        WorkQueue / background thread. This requires making the ProcessTaskStateObserver thread-safe,
        though its only current client is a Singleton (the WebProcess class), and so the risk of
        thread safety issues is currently minimal. Regardless, access to the Client pointer must be
        guarded by a Lock, and the Client itself must become ref-counted, so that the
        ProcessTaskStateObserver can ref its Client (the WebProcess) during callback processing.

        Unfortunately, sendWithAsyncReply() is not thread safe, nor is ProcessAssertion, so instead
        just use send() and set a 5-second timeout before expiring the assertion, and just use
        BKSProcessStateAssertion directly.

        * Shared/Cocoa/ProcessTaskStateObserver.h:
        (WebKit::ProcessTaskStateObserver::Client::ref):
        (WebKit::ProcessTaskStateObserver::Client::deref):
        (WebKit::ProcessTaskStateObserver::setClient): Deleted.
        (WebKit::ProcessTaskStateObserver::client): Deleted.
        * Shared/Cocoa/ProcessTaskStateObserver.mm:
        (-[WKProcessTaskStateObserverDelegate process:taskStateDidChange:]):
        (WebKit::ProcessTaskStateObserver::create):
        (WebKit::ProcessTaskStateObserver::ProcessTaskStateObserver):
        (WebKit::ProcessTaskStateObserver::~ProcessTaskStateObserver):
        (WebKit::ProcessTaskStateObserver::invalidate):
        (WebKit::ProcessTaskStateObserver::client):
        (WebKit::ProcessTaskStateObserver::setTaskState):
        * WebProcess/WebProcess.cpp:
        (WebKit::m_taskStateObserver):
        * WebProcess/WebProcess.h:
        * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
        (WebKit::WebProcessProxy::processWasUnexpectedlyUnsuspended):
        * UIProcess/WebProcessProxy.h:
        * UIProcess/WebProcessProxy.messages.in:
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::processTaskStateDidChange):

2019-09-27  Alex Christensen  <achristensen@webkit.org>

        Move service worker process termination delay disabling from process pool to website data store
        https://bugs.webkit.org/show_bug.cgi?id=202308

        Reviewed by Chris Dumez.

        It's only there for a test, which still works quickly.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::initializeNetworkProcess):
        (WebKit::NetworkProcess::addWebsiteDataStore):
        (WebKit::NetworkProcess::destroySession):
        (WebKit::NetworkProcess::fetchWebsiteData):
        (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
        (WebKit::NetworkProcess::registrableDomainsWithWebsiteData):
        (WebKit::NetworkProcess::swServerForSession):
        (WebKit::NetworkProcess::addServiceWorkerSession):
        (WebKit::NetworkProcess::disableServiceWorkerProcessTerminationDelay): Deleted.
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * Shared/WebsiteDataStoreParameters.cpp:
        (WebKit::WebsiteDataStoreParameters::encode const):
        (WebKit::WebsiteDataStoreParameters::decode):
        * Shared/WebsiteDataStoreParameters.h:
        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _disableServiceWorkerProcessTerminationDelay]): Deleted.
        * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
        (-[_WKWebsiteDataStoreConfiguration serviceWorkerProcessTerminationDelayEnabled]):
        (-[_WKWebsiteDataStoreConfiguration setServiceWorkerProcessTerminationDelayEnabled:]):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):
        (WebKit::WebProcessPool::disableServiceWorkerProcessTerminationDelay): Deleted.
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::parameters):
        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
        (WebKit::WebsiteDataStoreConfiguration::copy):
        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
        (WebKit::WebsiteDataStoreConfiguration::serviceWorkerProcessTerminationDelayEnabled const):
        (WebKit::WebsiteDataStoreConfiguration::setServiceWorkerProcessTerminationDelayEnabled):

2019-09-27  Alex Christensen  <achristensen@webkit.org>

        Enable and disable ResourceLoadStatistics only by session
        https://bugs.webkit.org/show_bug.cgi?id=202298

        Reviewed by Chris Dumez.

        This is needed to keep per-session things per-session and per-process-pool things per-process-pool.
        This was a strange case where we would take the current session's value and apply it globally.
        This has no change in behavior because it is globally enabled and disabled by API clients anyways.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::setResourceLoadStatisticsEnabled):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::setResourceLoadStatisticsEnabled): Deleted.
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):

2019-09-27  Alex Christensen  <achristensen@webkit.org>

        Remove unused WebProcessPool::setCanHandleHTTPSServerTrustEvaluation
        https://bugs.webkit.org/show_bug.cgi?id=202285

        Reviewed by Youenn Fablet.

        The SPI to set this was deprecated in r250377 with a replacement that was adopted in rdar://problem/55731135
        I removed a layout test using the old SPI and replaced it with a more precise API test verifying the behavior of the new SPI
        before and after the introduction of NSURLSession's _strictTrustEvaluate:queue:completionHandler:

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::initializeNetworkProcess):
        (WebKit::NetworkProcess::setCanHandleHTTPSServerTrustEvaluation): Deleted.
        * NetworkProcess/NetworkProcess.h:
        (WebKit::NetworkProcess::canHandleHTTPSServerTrustEvaluation const): Deleted.
        * NetworkProcess/NetworkProcess.messages.in:
        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
        (WebKit::NetworkProcessCreationParameters::decode):
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
        (canNSURLSessionTrustEvaluate): Deleted.
        * UIProcess/API/C/WKContext.cpp:
        (WKContextSetCanHandleHTTPSServerTrustEvaluation):
        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _setCanHandleHTTPSServerTrustEvaluation:]):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):
        (WebKit::WebProcessPool::setCanHandleHTTPSServerTrustEvaluation): Deleted.
        * UIProcess/WebProcessPool.h:

2019-09-27  Alex Christensen  <achristensen@webkit.org>

        Remove unused APIProcessPoolConfiguration::diskCacheSpeculativeValidationEnabled
        https://bugs.webkit.org/show_bug.cgi?id=202290

        Reviewed by Carlos Garcia Campos.

        The SPI to set this was deprecated in r250377 with a replacement that was adopted in rdar://problem/55731135

        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
        (WebKit::NetworkProcessCreationParameters::decode):
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
        * UIProcess/API/APIProcessPoolConfiguration.cpp:
        (API::ProcessPoolConfiguration::copy):
        * UIProcess/API/APIProcessPoolConfiguration.h:
        * UIProcess/API/C/WKContext.cpp:
        (WKContextSetDiskCacheSpeculativeValidationEnabled):
        * UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.cpp:
        (WKWebsiteDataStoreConfigurationGetNetworkCacheSpeculativeValidationEnabled):
        (WKWebsiteDataStoreConfigurationSetNetworkCacheSpeculativeValidationEnabled):
        * UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
        (-[_WKProcessPoolConfiguration diskCacheSpeculativeValidationEnabled]):
        (-[_WKProcessPoolConfiguration setDiskCacheSpeculativeValidationEnabled:]):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):

2019-09-27  Zan Dobersek  <zdobersek@igalia.com>

        [CoordinatedGraphics] support bounds origin
        https://bugs.webkit.org/show_bug.cgi?id=198998

        Reviewed by Carlos Garcia Campos.

        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
        (WebKit::CoordinatedGraphicsScene::updateSceneState):
        Apply bounds origin value to the TextureMapperLayer object.

2019-09-27  Youenn Fablet  <youenn@apple.com>

        Make IsNSURLSessionWebSocketEnabled an experimental flag
        https://bugs.webkit.org/show_bug.cgi?id=202135
        <rdar://problem/55694721>

        Reviewed by Geoff Garen.

        Add C API to switch off this feature in WTR.

        * Shared/WebPreferences.yaml:
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetIsNSURLSessionWebSocketEnabled):
        (WKPreferencesGetIsNSURLSessionWebSocketEnabled):
        * UIProcess/API/C/WKPreferencesRefPrivate.h:

2019-09-27  Jiewen Tan  <jiewen_tan@apple.com>

        SubFrameSOAuthorizationSession should ensure messages are posted in the right order to the parent frame
        https://bugs.webkit.org/show_bug.cgi?id=202061
        <rdar://problem/55485666>

        Reviewed by Youenn Fablet.

        This patch ensures messages that signal the process of SOAuthorization interception are posted in
        the right order to the parent frame. Before this patch, there are chances that SOAuthorizationDidCancel
        could be posted to the parent before SOAuthorizationDidStart. There are few causes that lead to
        this race condition:
        1) SubFrameSOAuthorizationSession::beforeStart posts SOAuthorizationDidStart in the next runloop. So
        extension could have the chance to invoke SubFrameSOAuthorizationSession::fallBackToWebPathInternal
        before SOAuthorizationDidStart is posted.
        2) Even if the order is right in the UI process, it is not guaranteed that Web process will strictly
        follow the order as the loading process is async.

        To fix the issue:
        1) SubFrameSOAuthorizationSession::beforeStart now posts SOAuthorizationDidStart in the same runloop.
        2) Observer is introduced in FrameLoadState such that SubFrameSOAuthorizationSession could know if
        the loading is finished. With this new capacity, SubFrameSOAuthorizationSession can ensure it only
        posts next message when the previous message has been posted.

        Implementation wise, a deque to queue requests is provided to maintain order.
        1) When new request is added to the deque, SubFrameSOAuthorizationSession will only load the request
        if it is the only element in the deque. Otherwise, it does nothing.
        2) When SubFrameSOAuthorizationSession receives didFinishLoad, it pops the head of the queue and loads
        the next request in the queue if any.
        The above design should guarantee all requests are loaded in sequence.

        * UIProcess/Cocoa/SOAuthorization/SubFrameSOAuthorizationSession.h:
        * UIProcess/Cocoa/SOAuthorization/SubFrameSOAuthorizationSession.mm:
        (WebKit::SubFrameSOAuthorizationSession::SubFrameSOAuthorizationSession):
        (WebKit::SubFrameSOAuthorizationSession::~SubFrameSOAuthorizationSession):
        (WebKit::SubFrameSOAuthorizationSession::fallBackToWebPathInternal):
        (WebKit::SubFrameSOAuthorizationSession::completeInternal):
        (WebKit::SubFrameSOAuthorizationSession::beforeStart):
        (WebKit::SubFrameSOAuthorizationSession::didFinishLoad):
        (WebKit::SubFrameSOAuthorizationSession::appendRequestToLoad):
        (WebKit::SubFrameSOAuthorizationSession::loadRequestToFrame):
        (WebKit::SubFrameSOAuthorizationSession::loadDataToFrame): Deleted.
        (WebKit::SubFrameSOAuthorizationSession::postDidCancelMessageToParent): Deleted.
        * UIProcess/FrameLoadState.cpp:
        (WebKit::FrameLoadState::addObserver):
        (WebKit::FrameLoadState::removeObserver):
        (WebKit::FrameLoadState::didFinishLoad):
        * UIProcess/FrameLoadState.h:

2019-09-26  Kate Cheney  <katherine_cheney@apple.com>

        Resource Load Statistics: Downgrade all third-party referrer headers
        https://bugs.webkit.org/show_bug.cgi?id=201353
        <rdar://problem/54895650>
        
        Majority of this patch was written by John Wilander <wilander@apple.com>.

        Reviewed by Brent Fulgham. 

        When tracking protections are enabled, we should downgrade all third-party
        referrers to their origins. Note that this downgrade will be specific to
        Cocoa so other ports will have to adopt as they see fit.

        Cocoa already does this downgrade in ephemeral sessions (shipping).

        The majority of these changes are test infrastructure. The functional
        change is in WebKit::NetworkDataTaskCocoa and WebKit::NetworkSession.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::setShouldDowngradeReferrerForTesting):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::isResourceLoadStatisticsEnabled const):
        (WebKit::NetworkSession::setShouldDowngradeReferrerForTesting):
        (WebKit::NetworkSession::shouldDowngradeReferrer const):
        * NetworkProcess/NetworkSession.h:
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        (WebKit::NetworkDataTaskCocoa::isThirdPartyRequest const):
        (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
        (WebKit::NetworkDataTaskCocoa::restrictRequestReferrerToOriginIfNeeded):
        (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
        (WebKit::NetworkDataTaskCocoa::isThirdPartyRequest): Deleted.
        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreSetResourceLoadStatisticsShouldDowngradeReferrerForTesting):
        (WKWebsiteDataStoreStatisticsResetToConsistentState):
        * UIProcess/API/C/WKWebsiteDataStoreRef.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::setShouldDowngradeReferrerForTesting):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::setResourceLoadStatisticsShouldDowngradeReferrerForTesting):
        * UIProcess/WebsiteData/WebsiteDataStore.h:

2019-09-26  Eric Carlson  <eric.carlson@apple.com>

        REGRESSION (iOS 13): Trying to record just audio using HTML Media Capture crashes Safari
        https://bugs.webkit.org/show_bug.cgi?id=202039
        <rdar://problem/55566628>

        Reviewed by Jer Noble.

        * UIProcess/ios/forms/WKFileUploadPanel.mm:
        (-[WKFileUploadPanel _mediaTypesForPickerSourceType:]): UIImagePickerController doesn't 
        support audio-only recording, so show the video recorder for "audio/*".

2019-09-26  Tim Horton  <timothy_horton@apple.com>

        Add some logging to help diagnose blank or stuck WKWebViews
        https://bugs.webkit.org/show_bug.cgi?id=202297
        <rdar://problem/55763610>

        Reviewed by Wenson Hsieh.

        Our current logging is insufficient to rule out some of the potential
        causes of stuck/blank WKWebViews in <rdar://problem/53399054>. Add
        some new logging, and improve some existing logging, to aid in diagnosis.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _willInvokeUIScrollViewDelegateCallback]):
        (-[WKWebView _didInvokeUIScrollViewDelegateCallback]):
        Rename _delayUpdateVisibleContentRects to be more specific that it
        was due to us being underneath a UIScrollView delegate callback.

        (-[WKWebView _processWillSwapOrDidExit]):
        (-[WKWebView _didCommitLayerTree:]):
        Add a log when we receive an incoming commit while visible content rect
        updates are being deferred. Also, include the current transaction ID
        and the transaction ID that _needsResetViewState... is waiting for, to
        help rule out a class of potential problems.

        Add a log when we receive an incoming commit more than 5 seconds after
        a visible content rect update.

        (-[WKWebView _updateVisibleContentRects]):
        Keep track of when we defer visual content rect updates for any reason,
        and log the first time we do an update after deferring them. This will make
        it MUCH easier at-a-glance to tell if one of the "bailing" messages
        represents a long-term state (a problem), or is expected.

        Keep track of how long it's been since we sent a visible content rect update
        and didn't get a commit back from the Web Content process; if it's been
        more than 5 seconds, start logging.

        (-[WKWebView _cancelAnimatedResize]):
        (-[WKWebView _didCompleteAnimatedResize]):
        (-[WKWebView _beginAnimatedResizeWithUpdates:]):
        (-[WKWebView _endAnimatedResize]):
        (-[WKWebView _resizeWhileHidingContentWithUpdates:]):
        Turn animated resize logging into release logging. It is a common culprit
        for many kinds of bugs, while also not being high volume, so this is well worth it.
        
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::freezeLayerTree):
        (WebKit::WebPage::unfreezeLayerTree):
        Show the current value of m_layerTreeFreezeReasons in addition to the old value and delta,
        so you don't have to manually compute the current value when reading logs.

2019-09-26  Dean Jackson  <dino@apple.com>

        ContextMenu on a link in an email no longer shows web preview
        https://bugs.webkit.org/show_bug.cgi?id=201120
        <rdar://54353617>

        Reviewed by Wenson Hsieh.

        Only go down the image path if we are not also a link.

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

2019-09-26  Chris Dumez  <cdumez@apple.com>

        Stop using testRunner.overridePreference() to turn on Page Cache
        https://bugs.webkit.org/show_bug.cgi?id=202274

        Reviewed by Alex Christensen.

        * WebProcess/InjectedBundle/InjectedBundle.cpp:
        (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):

2019-09-26  Andy Estes  <aestes@apple.com>

        Crash under WebPage::beginPrinting when m_printContext becomes null due to synchronous layout
        https://bugs.webkit.org/show_bug.cgi?id=202171
        <rdar://problem/49731211>

        Reviewed by Tim Horton.

        Speculatively fix a null pointer dereference crash in WebPage::beginPrinting.

        WebPage::beginPrinting creates a PrintContext, stores it in m_printContext, then calls
        PrintContext::begin which forces a synchronous, paginated layout. If a post-layout task
        executes script, that might result in the WebPage being closed and m_printContext being set
        to nullptr.

        Guard against this in WebPage::beginPrinting by adding a null check before calling
        PrintContext::computePageRects.

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

2019-09-26  Kate Cheney  <katherine_cheney@apple.com>

        Enable LayoutTests using ResourceLoadStatistics SQLite backend (195420)
        https://bugs.webkit.org/show_bug.cgi?id=195420
        <rdar://problem/54213551>

        Reviewed by Brent Fulgham.

        Changed all RELEASE_LOG_ERROR() calls involving domain strings to
        RELEASE_LOG_ERROR_IF_ALLOWED() to prevent leaking information about
        the domain strings only if sessionID.isAlwaysOnLoggingAllowed().

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        (WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore):
        Added autovacuuming to the constructor to avoid manually calling
        runVacuumCommand(). Changed constructor to take in sessionID so it
        can use RELEASE_LOG_ERROR_IF_ALLOWED which requires the sessionID.

        (WebKit::ResourceLoadStatisticsDatabaseStore::prepareStatements):
        Added 2 statements that were not being prepared.

        (WebKit::ResourceLoadStatisticsDatabaseStore::relationshipExists const):
        Corrected incorrect capitalization. Added check for nullopt in case
        domainID is for a domain not in the database yet.

        (WebKit::ResourceLoadStatisticsDatabaseStore::domainID const):
        Changed return value to Optional<unsigned>. Some tests were directly
        checking for subframes under top frame domains on domains that had
        not been inserted yet. Now, domainID() won't crash but will return
        a nullopt value which can be checked to know that the tests failed.

        (WebKit::ResourceLoadStatisticsDatabaseStore::insertDomainRelationships):
        Added a check to assure domainID exists and updated the domainID
        interactions to work as Optionals.

        (WebKit::ResourceLoadStatisticsDatabaseStore::populateFromMemoryStore):
        Moved the prepareStatements() call after the vacuum command in the case
        where the database is empty. Otherwise called it before returning.

        (WebKit::ResourceLoadStatisticsDatabaseStore::recursivelyFindNonPrevalentDomainsThatRedirectedToThisDomain):
        Added a space to the SQL commands to correct the syntax.

        (WebKit::ResourceLoadStatisticsDatabaseStore::findNotVeryPrevalentResources):
        Corrected a bug in the SQL command for querying
        subframeUnderTopFrameDomain. The old query was asking for subresource.

        (WebKit::ResourceLoadStatisticsDatabaseStore::reclassifyResources):
        Spelling fix.

        (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccess):
        Changed string concatenation to binding.

        (WebKit::ResourceLoadStatisticsDatabaseStore::grandfatherDataForDomains):
        The grandfathering.html test was failing because domains were being
        "set" to grandfathered in the database before being inserted. This fix
        ensures all domains before setting the grandfathering flag.

        (WebKit::ResourceLoadStatisticsDatabaseStore::logFrameNavigation):
        Multiple tests were failing because the query to insert the relationship
        for the source domain relies on the target domain being in the
        ObservedDomains table. This patch ensures all domains are added before
        performing the query.

        (WebKit::ResourceLoadStatisticsDatabaseStore::setUserInteraction):
        Added a != SQLITE_OK check to make sure an error is logged if the
        statement fails to bind.

        (WebKit::ResourceLoadStatisticsDatabaseStore::clearUserInteraction):
        Changed string concatenation to binding.

        (WebKit::ResourceLoadStatisticsDatabaseStore::hasHadUserInteraction):   
        The SQL statement was being bound to a value and not being reset. This
        patch resets the statement after binding. Additionally, the step()
        function was being compared to SQLITE_DONE instead of SQLITE_ROW,
        causing an error if the query returned results. The
        ASSERT_NOT_REACHED() was causing null searches to crash instead of
        returning false (i.e. if a domain is not in the database it should
        return that it has no user interaction instead of crashing).

        (WebKit::ResourceLoadStatisticsDatabaseStore::setPrevalentResource): 
        Updated domainID call to act as an Optional. 
        
        (WebKit::ResourceLoadStatisticsDatabaseStore::predicateValueForDomain const):
        The SQL statement was being bound to a value and not being reset. This
        patch resets the statement after binding. SQLITE_DONE changed to
        SQLITE_ROW to return non-empty query results. ASSERT_NOT_REACHED()
        removed for the same reasons as above. 

        (WebKit::ResourceLoadStatisticsDatabaseStore::ensureResourceStatisticsForRegistrableDomain):
        Fixed the release log statement which was logging the wrong function 
        name.

        (WebKit::ResourceLoadStatisticsDatabaseStore::clearDatabaseContents): 
        Clears the database and rebuilds the tables on a clear command to
        match the functionality in the Memory Store.

        (WebKit::ResourceLoadStatisticsDatabaseStore::clear):                   
        Call the clearDatabaseContents function to match the functionality 
        in the Memory Store. 

        (WebKit::ResourceLoadStatisticsDatabaseStore::hasUserGrantedStorageAccessThroughPrompt const):
        Updated domainID call to act as an Optional. 

        (WebKit::ResourceLoadStatisticsDatabaseStore::hasHadUnexpiredRecentUserInteraction):
        Tests were failing because shouldRemoveAllWebsiteDataFor() was not 
        checking for expired user interaction. Matched functionality in the
        Memory Store.

        (WebKit::ResourceLoadStatisticsDatabaseStore::shouldRemoveAllWebsiteDataFor):
        Tests were failing because shouldRemoveAllWebsiteDataFor() was not 
        checking for expired user interaction. Matched functionality in the
        Memory Store. 

        (WebKit::ResourceLoadStatisticsDatabaseStore::registrableDomainsToRemoveWebsiteDataFor):
        Spelling fix. 

        (WebKit::ResourceLoadStatisticsDatabaseStore::pruneStatisticsIfNeeded): 
        Last seen should be sorted in ascending order because you want to 
        prune the older statistics first, which will have a lower lastSeen
        field (secondsSinceEpoch() will be lower for older values).

        (WebKit::ResourceLoadStatisticsDatabaseStore::shouldRemoveAllWebsiteDataFor const): Deleted.
        Deleted const specifier because the function needs to clear the
        database. 

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:      
        Declared new functions. Updated spelling error (registerable --> 
        registrable). Updated constructor to take sessionID. 

        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: 
        (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
        ITP database flag now is stored in the NetworkProcess.
        * NetworkProcess/NetworkProcess.cpp: 

        (WebKit::NetworkProcess::initializeNetworkProcess): 
        Set the ITP database flag which is now stored in the Network Process. 

        (WebKit::NetworkProcess::setUseITPDatabase): 
        * NetworkProcess/NetworkProcess.h:
        (WebKit::NetworkProcess::isITPDatabaseEnabled const):
        * NetworkProcess/NetworkProcess.messages.in:
        Passed the setUseITPDatabase flag to the initialization function 
        of the statistics store to enable the database backend.

        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::NetworkSession):
        SandboxExtension::consumePermanently was not getting called on the 
        WebKitTestRunner resourceLoadStatistics path. This was preventing
        the database file from opening. 

        (WebKit::NetworkSession::recreateResourceLoadStatisticStore):
        Destroy old WebResourceLoadStatisticsStore and create a new one using
        the ITP database.

        * NetworkProcess/NetworkSession.h:
        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreSetUseITPDatabase):
        * UIProcess/API/C/WKWebsiteDataStoreRef.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::setUseITPDatabase):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::setUseITPDatabase):
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        Passed the setUseITPDatabase flag to the initialization function
        of the statistics store to enable the database backend. 

2019-09-26  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS 13] Tapping on a non-editable text selection should toggle callout bar visibility instead of clearing selection
        https://bugs.webkit.org/show_bug.cgi?id=202254
        <rdar://problem/54410263>

        Reviewed by Megan Gardner.

        In iOS 13, tapping a text selection should toggle callout bar visibility (i.e. "selection commands" in UIKit).
        This currently does not work for non-editable text, since the synthetic click gesture simultaneously fires
        alongside the text interaction assistant's non-editable tap gesture, which dispatches a click to the page which
        then clears the selection.

        To remedy this and match platform behavior, we avoid recognizing clicks that occur over the text selection, but
        only in the case where the bounding rect of the text selection doesn't cover a large portion of the visible
        content rect of the web view. This ensures that the user doesn't get stuck in a state where it's impossible to
        dismiss a very large text selection (e.g. after selecting all the content on the page).

        Tests:  editing/selection/ios/clear-selection-after-tap-in-large-selected-non-editable-text.html
                editing/selection/ios/toggle-callout-bar-after-tap-in-selected-non-editable-text.html

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

        Check the last known selection rects (on _lastSelectionDrawingInfo) to see if the tapped point lies within at
        least one of the selection rects.

        (-[WKContentView gestureRecognizerShouldBegin:]):

2019-09-26  Patrick Griffis  <pgriffis@igalia.com>

        [GTK] Fix logic of dark theme detection
        https://bugs.webkit.org/show_bug.cgi?id=202276

        - If GTK_THEME is set it has a higher priority to GtkSettings.
        - GTK_THEME may be a -dark theme or :dark variant, handle both.

        Reviewed by Michael Catanzaro.

        * UIProcess/API/gtk/PageClientImpl.cpp:
        (WebKit::PageClientImpl::effectiveAppearanceIsDark const):

2019-09-25  Alex Christensen  <achristensen@webkit.org>

        Add replacement SPI on _WKWebsiteDataStoreConfiguration for enabling speculative cache validation and IPC-free server trust evaluation
        https://bugs.webkit.org/show_bug.cgi?id=202251

        Reviewed by Tim Horton.

        These are two performance optimizations that are currently per-ProcessPool that need to be per-WebsiteDataStore.
        This makes replacement SPI and deprecates the old SPI.  I'm going to adopt the new SPI then remove the old SPI.

        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::NetworkSession):
        * NetworkProcess/NetworkSessionCreationParameters.cpp:
        (WebKit::NetworkSessionCreationParameters::encode const):
        (WebKit::NetworkSessionCreationParameters::decode):
        * NetworkProcess/NetworkSessionCreationParameters.h:
        * NetworkProcess/cocoa/NetworkSessionCocoa.h:
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
        * UIProcess/API/C/WKContextPrivate.h:
        * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
        (-[_WKWebsiteDataStoreConfiguration networkCacheSpeculativeValidationEnabled]):
        (-[_WKWebsiteDataStoreConfiguration setNetworkCacheSpeculativeValidationEnabled:]):
        (-[_WKWebsiteDataStoreConfiguration fastServerTrustEvaluationEnabled]):
        (-[_WKWebsiteDataStoreConfiguration setFastServerTrustEvaluationEnabled:]):
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::parameters):
        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
        (WebKit::WebsiteDataStoreConfiguration::copy):
        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
        (WebKit::WebsiteDataStoreConfiguration::fastServerTrustEvaluationEnabled const):
        (WebKit::WebsiteDataStoreConfiguration::setFastServerTrustEvaluationEnabled):
        (WebKit::WebsiteDataStoreConfiguration::networkCacheSpeculativeValidationEnabled const):
        (WebKit::WebsiteDataStoreConfiguration::setNetworkCacheSpeculativeValidationEnabled):

2019-09-25  Wenson Hsieh  <wenson_hsieh@apple.com>

        Fix failing layout tests after trac.webkit.org/r250183
        https://bugs.webkit.org/show_bug.cgi?id=202053
        <rdar://problem/54542190>

        Reviewed by Tim Horton.

        Followup to r250183: move the implementation of -gestureRecognizer:shouldReceiveTouch: out of
        ENABLE(TOUCH_EVENTS) and into ENABLE(POINTER_EVENTS) instead. This logic is necessary in order for scrolling
        via pan gestures to work on iOS, in the case where ENABLE(POINTER_EVENTS) is on but ENABLE(TOUCH_EVENTS) is off.
        This is because the new swipe gesture recognizers added in r250183 will otherwise always take priority over the
        scroll view's pan gestures.

        Fixes the following layout tests:
        - fast/scrolling/ios/reconcile-layer-position-recursive.html
        - fast/scrolling/ios/click-events-during-momentum-scroll-in-main-frame.html
        - fast/scrolling/ios/click-events-after-long-press-during-momentum-scroll-in-main-frame.html

        * UIProcess/ios/WKContentViewInteraction.mm:

2019-09-25  Megan Gardner  <megan_gardner@apple.com>

        Update selections after scrolling for iframes and hide selections while iframes and overflow scrolls are scrolling.
        https://bugs.webkit.org/show_bug.cgi?id=202125

        Reviewed by Tim Horton.

        Add additional calls into UIKit differentiate between main frame scrolling and overflow/iframe scrolling.
        Add piping for iframe specific scrolling.

        * Platform/spi/ios/UIKitSPI.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _willStartScrollingOrZooming]):
        (-[WKContentView _didEndScrollingOrZooming]):
        * WebProcess/WebCoreSupport/WebEditorClient.cpp:
        (WebKit::WebEditorClient::subFrameScrollPositionChanged):
        * WebProcess/WebCoreSupport/WebEditorClient.h:
        * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
        (WebKit::WebEditorClient::subFrameScrollPositionChanged):

2019-09-25  Wenson Hsieh  <wenson_hsieh@apple.com>

        Page temporarily jumps to an excessively small viewport scale while loading usatoday.com
        https://bugs.webkit.org/show_bug.cgi?id=202224
        <rdar://problem/52906640>

        Reviewed by Tim Horton.

        Tweaks the content-aware shrink-to-fit algorithm to bail in the case where the content width is extremely large,
        such that it bails instead of attempting to fit the entire content of the page. See WebCore ChangeLog for more
        details.

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

2019-09-25  Alex Christensen  <achristensen@webkit.org>

        Don't fall back to default session if session can't be found for cookie operations
        https://bugs.webkit.org/show_bug.cgi?id=202222

        Reviewed by Geoff Garen.

        Apparently, during teardown of private browsing sessions, there is sometimes a race condition and cookies from a torn-down session are requested.
        In this case, just fail like we do all other operations in this file.  Otherwise, it's a breach of privacy.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::storageSession):
        (WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
        (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
        (WebKit::NetworkConnectionToWebProcess::cookiesEnabled):
        (WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue):
        (WebKit::NetworkConnectionToWebProcess::getRawCookies):
        (WebKit::NetworkConnectionToWebProcess::deleteCookie):
        * NetworkProcess/NetworkConnectionToWebProcess.h:

2019-09-25  Alex Christensen  <achristensen@webkit.org>

        Remove duplicate WebsiteDataStoreConfiguration copying code
        https://bugs.webkit.org/show_bug.cgi?id=202215

        Reviewed by Tim Horton.

        WKWebsiteDataStore's _initWithConfiguration was duplicating the functionality of WebsiteDataStoreConfiguration::copy.
        The former should just call the latter.
        This move has the side effect of making _WKWebsiteDataStoreConfiguration's paths readable, which I think is desirable so I added a unit test verifying it is so.

        * UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.cpp:
        (WKWebsiteDataStoreConfigurationCreate):
        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _initWithConfiguration:]):
        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
        (-[_WKWebsiteDataStoreConfiguration init]):
        (-[_WKWebsiteDataStoreConfiguration initNonPersistentConfiguration]):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::mayHaveRegisteredServiceWorkers):
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::createNonPersistent):
        (WebKit::WebsiteDataStore::defaultDataStore):
        (WebKit::WebsiteDataStore::defaultDataStoreConfiguration): Deleted.
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
        (WebKit::WebsiteDataStoreConfiguration::WebsiteDataStoreConfiguration):
        (WebKit::WebsiteDataStoreConfiguration::copy):
        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
        (WebKit::WebsiteDataStoreConfiguration::create):
        (WebKit::WebsiteDataStoreConfiguration::isPersistent const):
        (WebKit::WebsiteDataStoreConfiguration::setPersistent): Deleted.

2019-09-25  Alex Christensen  <achristensen@webkit.org>

        Replace WebsiteDataStoreParameters::privateSessionParameters with re-initializing all sessions immediately upon NetworkProcess resumption
        https://bugs.webkit.org/show_bug.cgi?id=202211

        Reviewed by Tim Horton.

        Re-adding an ephemeral session after a NetworkProcess crash based on guessing that all its parameters are empty was added in r227590 with a test.
        That test passes even when that re-adding code is removed because we re-add all sessions with parameters from the UIProcess when we restart a NetworkProcess.
        I move the addition of non-default sessions to the initialization message instead of messages after the initialization message to remove race conditions that
        might cause loads to happen before the NetworkProcess has received its second message from the UIProcess.  I also add a unit test to verify that session
        resumption also works with non-default persistent WebsiteDataStores.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::initializeNetworkProcess):
        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
        (WebKit::NetworkProcessCreationParameters::decode):
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::startNetworkLoad):
        * NetworkProcess/NetworkSessionCreationParameters.cpp:
        (WebKit::NetworkSessionCreationParameters::privateSessionParameters): Deleted.
        * NetworkProcess/NetworkSessionCreationParameters.h:
        * Shared/WebsiteDataStoreParameters.cpp:
        (WebKit::WebsiteDataStoreParameters::privateSessionParameters): Deleted.
        * Shared/WebsiteDataStoreParameters.h:
        (WebKit::WebsiteDataStoreParameters::legacyPrivateSessionParameters): Deleted.
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):

2019-09-25  Alex Christensen  <achristensen@webkit.org>

        Replace _WKProcessPoolConfiguration.CTDataConnectionServiceType with _WKWebsiteDataStoreConfiguration.dataConnectionServiceType
        https://bugs.webkit.org/show_bug.cgi?id=202174

        Reviewed by Tim Horton.

        _WKProcessPoolConfiguration.CTDataConnectionServiceType is used in one place and needs a replacement so we can
        start a NetworkProcess without a WKProcessPool.  Since this SPI only does something in the low-level networking code,
        I verified that the new SPI sets the String the way the old one does, and the old one keeps working in the interim.

        * NetworkProcess/NetworkSessionCreationParameters.cpp:
        (WebKit::NetworkSessionCreationParameters::encode const):
        (WebKit::NetworkSessionCreationParameters::decode):
        * NetworkProcess/NetworkSessionCreationParameters.h:
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _initWithConfiguration:]):
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
        (-[_WKWebsiteDataStoreConfiguration dataConnectionServiceType]):
        (-[_WKWebsiteDataStoreConfiguration setDataConnectionServiceType:]):
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::parameters):
        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
        (WebKit::WebsiteDataStoreConfiguration::copy):
        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
        (WebKit::WebsiteDataStoreConfiguration::dataConnectionServiceType const):
        (WebKit::WebsiteDataStoreConfiguration::setDataConnectionServiceType):

2019-09-25  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r250336.
        https://bugs.webkit.org/show_bug.cgi?id=202210

        it is creating failures on iOS bots (Requested by youenn on
        #webkit).

        Reverted changeset:

        "Make IsNSURLSessionWebSocketEnabled an experimental flag"
        https://bugs.webkit.org/show_bug.cgi?id=202135
        https://trac.webkit.org/changeset/250336

2019-09-25  Youenn Fablet  <youenn@apple.com>

        Creation of a service worker connection for a service worker job should be based on the job scope
        https://bugs.webkit.org/show_bug.cgi?id=202185

        Reviewed by Alex Christensen.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::swServerForSession):
        Assert that registrable domain is not empty.
        * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
        (WebKit::WebSWServerConnection::scheduleJobInServer):
        Use the scope URL instead of the script URL which may be empty in case of an unregister job.

2019-09-25  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iPadOS] [DataActivation] Focus moves away after focusing input fields on www.att.com
        https://bugs.webkit.org/show_bug.cgi?id=202167
        <rdar://problem/55185021>

        Reviewed by Tim Horton.

        When using the data activation page on www.att.com, one of the sections on the page contains several select
        elements; in the case where the user agent:

        1. contains the string "iPad", and
        2. does not contain the string "Safari"

        ...www.att.com's data activation page will opt into a mode where it adds blur event listeners to the select
        elements; in this blur event listener, www.att.com proceeds to programmatically focus a non-editable div element
        after a 1 second timeout. The reasons for this behavior remain unclear to me, though it's worth noting that the
        blur event handler name is "screenReaderFocus", which suggests that this is in place to ensure compatibility
        with screen readers.

        In iOS 12, dismissing the popover would blur the focused select menu with an animation. Since the animation
        would take a slightly less than 1 second, www.att.com's logic would have the effect of moving focus to the div
        element shortly after dismissing the select menu. However, after r243808, we no longer attempt to blur the
        focused select element when dismissing the popover. This means that the select element is only blurred the next
        time the user activates another focused element, such as one of the input fields on the page, or a different
        select element. Consequently, the logic to move focus into a div element now occurs only after a different
        element has already been focused; this results in focus moving away from newly focused elements after 1 second
        in the case where a select element has previously focused.

        To mitigate this, restore iOS 12 behavior behind a site- and app-specific quirk. See comments below for more
        details.

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

        Add a new behavioral quirk flag to FocusedElementInformation to determine whether we should use "legacy" select
        popover dismissal behavior (i.e. blurring the focused select element when dismissing the select popover, as well
        as dismissing the popover with animation).

        * Shared/WebPreferences.yaml:

        Enable site-specific quirks by default in WKWebView. With regards to this bug, this change allows for
        site-specific hacks (namely, legacy select popover dismissal) in DataActivation. However, this also fixes
        various known bugs that are otherwise addressed in Safari only, via site-specific quirks.

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

        For apps linked on or before iOS 13 and macOS 10.15, revert the default of value of NeedsSiteSpecificQuirks to
        false. This is done here instead of in a default value function in WebPreferencesDefaultValues to prevent the
        default values of NeedsSiteSpecificQuirks in the web process and UI process from going out of sync, since the
        web process is not necessarily linked against the same SDK as the application.

        * UIProcess/Cocoa/VersionChecks.h:

        Add a new DYLD version check for the first version of iOS and macOS where site-specific quirks are enabled by
        default.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView endEditingAndUpdateFocusAppearanceWithReason:]):
        (-[WKContentView _elementDidBlur]):
        (-[WKContentView _shouldUseLegacySelectPopoverDismissalBehavior]):

        We only use "legacy" select popover dismissal behavior in the case where the site-specific quirk flag is on, a
        select popover is used (i.e. the device is an iPad and a select element is focused), and the application bundle
        is "com.apple.DataActivation".

        * UIProcess/ios/forms/WKFormSelectPopover.mm:
        (-[WKSelectTableViewController shouldDismissWithAnimation]):

        Keyed off of _shouldUseLegacySelectPopoverDismissalBehavior.

        (-[WKSelectPopover controlEndEditing]):
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::getFocusedElementInformation):

2019-09-25  Jonathan Bedard  <jbedard@apple.com>

        Unreviewed, rolling out r250324.

        Broke many mac wk2 layout tests

        Reverted changeset:

        "Enable LayoutTests using ResourceLoadStatistics SQLite
        backend (195420)"
        https://bugs.webkit.org/show_bug.cgi?id=195420
        https://trac.webkit.org/changeset/250324

2019-09-25  Youenn Fablet  <youenn@apple.com>

        Make IsNSURLSessionWebSocketEnabled an experimental flag
        https://bugs.webkit.org/show_bug.cgi?id=202135

        Reviewed by Geoffrey Garen.

        * Shared/WebPreferences.yaml:

2019-09-24  Chris Dumez  <cdumez@apple.com>

        [iOS] Regression(r249703) frequent 'kill() returned unexpected error' log messages
        https://bugs.webkit.org/show_bug.cgi?id=202173

        Reviewed by Geoffrey Garen.

        The kill(pid, 0) command actually fails with an EPERM error when there is a process
        running with the given pid, and this is causing us to log a lot of errors. The good
        news is that we merely want to know that there is no process with the given PID and
        we correctly get a ESRCH error in this case. I renamed the function from
        isRunningProcessPID() to wasTerminated() and only check for ESRCH error now. I no
        longer log any error otherwise since this is expected.

        Also, for performance reason, I no longer call kill(pid, 0) from inside
        AuxiliaryProcessProxy::state() as it gets called a lot. I instead only call it from
        AuxiliaryProcessProxy::wasTerminated() and call it from
        WebProcessPool::tryTakePrewarmedProcess().

        * UIProcess/AuxiliaryProcessProxy.cpp:
        (WebKit::AuxiliaryProcessProxy::state const):
        (WebKit::AuxiliaryProcessProxy::wasTerminated const):
        (WebKit::AuxiliaryProcessProxy::isRunningProcessPID): Deleted.
        * UIProcess/AuxiliaryProcessProxy.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::tryTakePrewarmedProcess):

2019-09-24  Christopher Reid  <chris.reid@sony.com>

        [WinCairo] Start RemoteInspectorServer
        https://bugs.webkit.org/show_bug.cgi?id=199938
        <rdar://problem/53323048>

        Reviewed by Fujii Hironori.

        Enable the remote inspector client on WinCairo.
        The inspector server will run if the WEBKIT_INSPECTOR_SERVER environment variable is set.
        WEBKIT_INSPECTOR_SERVER needs to be set in the form of <ip>:port e.g. WEBKIT_INSPECTOR_SERVER=127.0.0.1:1234.

        Updated the protocol handler to update the target list with DOM manipulation.

        * UIProcess/socket/RemoteInspectorClient.cpp:
        * UIProcess/socket/RemoteInspectorClient.h:
        * UIProcess/socket/RemoteInspectorProtocolHandler.cpp:
        * UIProcess/socket/RemoteInspectorProtocolHandler.h:
        * UIProcess/win/WebView.cpp:

2019-09-24  Kate Cheney  <katherine_cheney@apple.com>

        Enable LayoutTests using ResourceLoadStatistics SQLite backend (195420)
        https://bugs.webkit.org/show_bug.cgi?id=195420
        <rdar://problem/54213551>

        Reviewed by Brent Fulgham.

        Changed all RELEASE_LOG_ERROR() calls involving domain strings to
        RELEASE_LOG_ERROR_IF_ALLOWED() to prevent leaking information about
        the domain strings only if sessionID.isAlwaysOnLoggingAllowed().

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        (WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore):
        Added autovacuuming to the constructor to avoid manually calling
        runVacuumCommand(). Changed constructor to take in sessionID so it
        can use RELEASE_LOG_ERROR_IF_ALLOWED which requires the sessionID.

        (WebKit::ResourceLoadStatisticsDatabaseStore::prepareStatements):
        Added 2 statements that were not being prepared.

        (WebKit::ResourceLoadStatisticsDatabaseStore::relationshipExists const):
        Corrected incorrect capitalization. Added check for nullopt in case
        domainID is for a domain not in the database yet.

        (WebKit::ResourceLoadStatisticsDatabaseStore::domainID const):
        Changed return value to Optional<unsigned>. Some tests were directly
        checking for subframes under top frame domains on domains that had
        not been inserted yet. Now, domainID() won't crash but will return
        a nullopt value which can be checked to know that the tests failed.

        (WebKit::ResourceLoadStatisticsDatabaseStore::insertDomainRelationships):
        Added a check to assure domainID exists and updated the domainID
        interactions to work as Optionals.

        (WebKit::ResourceLoadStatisticsDatabaseStore::populateFromMemoryStore):
        Moved the prepareStatements() call after the vacuum command in the case
        where the database is empty. Otherwise called it before returning.

        (WebKit::ResourceLoadStatisticsDatabaseStore::recursivelyFindNonPrevalentDomainsThatRedirectedToThisDomain):
        Added a space to the SQL commands to correct the syntax.

        (WebKit::ResourceLoadStatisticsDatabaseStore::findNotVeryPrevalentResources):
        Corrected a bug in the SQL command for querying
        subframeUnderTopFrameDomain. The old query was asking for subresource.

        (WebKit::ResourceLoadStatisticsDatabaseStore::reclassifyResources):
        Spelling fix.

        (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccess):
        Changed string concatenation to binding.

        (WebKit::ResourceLoadStatisticsDatabaseStore::grandfatherDataForDomains):
        The grandfathering.html test was failing because domains were being
        "set" to grandfathered in the database before being inserted. This fix
        ensures all domains before setting the grandfathering flag.

        (WebKit::ResourceLoadStatisticsDatabaseStore::logFrameNavigation):
        Multiple tests were failing because the query to insert the relationship
        for the source domain relies on the target domain being in the
        ObservedDomains table. This patch ensures all domains are added before
        performing the query.

        (WebKit::ResourceLoadStatisticsDatabaseStore::setUserInteraction):
        Added a != SQLITE_OK check to make sure an error is logged if the
        statement fails to bind.

        (WebKit::ResourceLoadStatisticsDatabaseStore::clearUserInteraction):
        Changed string concatenation to binding.

        (WebKit::ResourceLoadStatisticsDatabaseStore::hasHadUserInteraction):   
        The SQL statement was being bound to a value and not being reset. This
        patch resets the statement after binding. Additionally, the step()
        function was being compared to SQLITE_DONE instead of SQLITE_ROW,
        causing an error if the query returned results. The
        ASSERT_NOT_REACHED() was causing null searches to crash instead of
        returning false (i.e. if a domain is not in the database it should
        return that it has no user interaction instead of crashing).

        (WebKit::ResourceLoadStatisticsDatabaseStore::setPrevalentResource): 
        Updated domainID call to act as an Optional. 
        
        (WebKit::ResourceLoadStatisticsDatabaseStore::predicateValueForDomain const):
        The SQL statement was being bound to a value and not being reset. This
        patch resets the statement after binding. SQLITE_DONE changed to
        SQLITE_ROW to return non-empty query results. ASSERT_NOT_REACHED()
        removed for the same reasons as above. 

        (WebKit::ResourceLoadStatisticsDatabaseStore::ensureResourceStatisticsForRegistrableDomain):
        Fixed the release log statement which was logging the wrong function 
        name.

        (WebKit::ResourceLoadStatisticsDatabaseStore::clearDatabaseContents): 
        Clears the database and rebuilds the tables on a clear command to
        match the functionality in the Memory Store.

        (WebKit::ResourceLoadStatisticsDatabaseStore::clear):                   
        Call the clearDatabaseContents function to match the functionality 
        in the Memory Store. 

        (WebKit::ResourceLoadStatisticsDatabaseStore::hasUserGrantedStorageAccessThroughPrompt const):
        Updated domainID call to act as an Optional. 

        (WebKit::ResourceLoadStatisticsDatabaseStore::hasHadUnexpiredRecentUserInteraction):
        Tests were failing because shouldRemoveAllWebsiteDataFor() was not 
        checking for expired user interaction. Matched functionality in the
        Memory Store.

        (WebKit::ResourceLoadStatisticsDatabaseStore::shouldRemoveAllWebsiteDataFor):
        Tests were failing because shouldRemoveAllWebsiteDataFor() was not 
        checking for expired user interaction. Matched functionality in the
        Memory Store. 

        (WebKit::ResourceLoadStatisticsDatabaseStore::registrableDomainsToRemoveWebsiteDataFor):
        Spelling fix. 

        (WebKit::ResourceLoadStatisticsDatabaseStore::pruneStatisticsIfNeeded): 
        Last seen should be sorted in ascending order because you want to 
        prune the older statistics first, which will have a lower lastSeen
        field (secondsSinceEpoch() will be lower for older values).

        (WebKit::ResourceLoadStatisticsDatabaseStore::shouldRemoveAllWebsiteDataFor const): Deleted.
        Deleted const specifier because the function needs to clear the
        database. 

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:      
        Declared new functions. Updated spelling error (registerable --> 
        registrable). Updated constructor to take sessionID. 

        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: 
        (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
        ITP database flag now is stored in the NetworkProcess.
        * NetworkProcess/NetworkProcess.cpp: 

        (WebKit::NetworkProcess::initializeNetworkProcess): 
        Set the ITP database flag which is now stored in the Network Process. 

        (WebKit::NetworkProcess::addWebsiteDataStore):
        SandboxExtension::consumePermanently was not getting called on the 
        WebKitTestRunner resourceLoadStatistics path. This was preventing
        the database file from opening. 

        (WebKit::NetworkProcess::setUseITPDatabase): 
        * NetworkProcess/NetworkProcess.h:
        (WebKit::NetworkProcess::isITPDatabaseEnabled const):
        * NetworkProcess/NetworkProcess.messages.in:
        Passed the setUseITPDatabase flag to the initialization function 
        of the statistics store to enable the database backend.

        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::recreateResourceLoadStatisticStore):
        Destroy old WebResourceLoadStatisticsStore and create a new one using
        the ITP database.

        * NetworkProcess/NetworkSession.h:
        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreSetUseITPDatabase):
        * UIProcess/API/C/WKWebsiteDataStoreRef.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::setUseITPDatabase):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::setUseITPDatabase):
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        Passed the setUseITPDatabase flag to the initialization function
        of the statistics store to enable the database backend. 

2019-09-24  Alex Christensen  <achristensen@webkit.org>

        Make iOS WebProcessPool directory getters static
        https://bugs.webkit.org/show_bug.cgi?id=202157

        Reviewed by Tim Horton.

        No change in behavior.  This just cuts another dependency the NetworkProcessProxy has on its owning WebProcessPool.

        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::cookieStorageDirectory):
        (WebKit::WebProcessPool::platformResolvePathsForSandboxExtensions):
        (WebKit::WebProcessPool::parentBundleDirectory):
        (WebKit::WebProcessPool::networkingCachesDirectory):
        (WebKit::WebProcessPool::webContentCachesDirectory):
        (WebKit::WebProcessPool::containerTemporaryDirectory):
        (WebKit::WebProcessPool::cookieStorageDirectory const): Deleted.
        (WebKit::WebProcessPool::parentBundleDirectory const): Deleted.
        (WebKit::WebProcessPool::networkingCachesDirectory const): Deleted.
        (WebKit::WebProcessPool::webContentCachesDirectory const): Deleted.
        (WebKit::WebProcessPool::containerTemporaryDirectory const): Deleted.
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):
        * UIProcess/WebProcessPool.h:

2019-09-24  Patrick Griffis  <pgriffis@igalia.com>

        [GTK][WPE] Minor code cleanup in BubblewrapLauncher
        https://bugs.webkit.org/show_bug.cgi?id=201906

        This just cleans up string handling and some
        whitespace fixes.

        Reviewed by Carlos Garcia Campos.

        * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
        (WebKit::XDGDBusProxyLauncher::setAddress):
        (WebKit::XDGDBusProxyLauncher::launch):
        (WebKit::XDGDBusProxyLauncher::makeProxyPath):
        (WebKit::XDGDBusProxyLauncher::dbusAddressToPath):

2019-09-24  Zalan Bujtas  <zalan@apple.com>

        [iPadOs] The second click event is missing on double tap when dblclick handler is not present
        https://bugs.webkit.org/show_bug.cgi?id=202006
        <rdar://problem/51706828>

        Reviewed by Wenson Hsieh.

        While double tapping,
        1. the first tap triggers a click event through the normal _singleTapIdentified/_singleTapRecognized codepath.
        2. and the second tap should trigger either
          a second single click event or
          a second single click followed by a dblclick event when dblclick handler is present.
        However the second click is dropped on the floor when the node under the cursor does not have a dblclick handler (see handleDoubleTapForDoubleClickAtPoint()) -so we end up sending one click event.

        This patch fixes this case by sending the second tap through the normal single tap flow when the dblclick handler is not present.

        * Shared/ios/InteractionInformationAtPosition.h:
        * Shared/ios/InteractionInformationAtPosition.mm:
        (WebKit::InteractionInformationAtPosition::encode const):
        (WebKit::InteractionInformationAtPosition::decode):
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView setupInteraction]):
        (-[WKContentView gestureRecognizerShouldBegin:]):
        (WebKit::WebPage::positionInformation):
        (WebKit::WebPage::requestPositionInformation):

2019-09-24  Alex Christensen  <achristensen@webkit.org>

        Move HSTS storage directory to LegacyGlobalSettings
        https://bugs.webkit.org/show_bug.cgi?id=202059

        Reviewed by Tim Horton.

        I continue my lamentation begun in r245075.
        Remove the glib setting of it on the WebKitWebContext because they use it on the WebsiteDataStore.  We should do that too when we can.

        * UIProcess/API/APIProcessPoolConfiguration.cpp:
        (API::ProcessPoolConfiguration::copy):
        * UIProcess/API/APIProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
        (-[_WKProcessPoolConfiguration setHSTSStorageDirectory:]):
        (-[_WKProcessPoolConfiguration hstsStorageDirectory]):
        * UIProcess/LegacyGlobalSettings.h:
        (WebKit::LegacyGlobalSettings::setHSTSStorageDirectory):
        (WebKit::LegacyGlobalSettings::hstsStorageDirectory const):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):

2019-09-24  Keith Rollin  <krollin@apple.com>

        Coalesce or remove PLATFORM(MAC) || PLATFORM(IOS_FAMILY)
        https://bugs.webkit.org/show_bug.cgi?id=202119
        <rdar://problem/55638792>

        Reviewed by Alex Christensen.

        After refactoring and other code evolution, some platform checks have
        ended up looking like PLATFORM(MAC) || PLATFORM(IOS_FAMILY) (or
        vice-versa). These can be converted into the equivalent
        PLATFORM(COCOA). Where the instance occurs in a Cocoa-only file, the
        check can be removed altogether (along with any "#else" branches).

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
        * WebProcess/WebCoreSupport/WebChromeClient.h:

2019-09-24  Wenson Hsieh  <wenson_hsieh@apple.com>

        FocusPreservationTests.ChangingFocusedNodeResetsFocusPreservationState triggers a debug assertion
        https://bugs.webkit.org/show_bug.cgi?id=202145
        <rdar://problem/51273128>

        Reviewed by Tim Horton.

        Fixes an assertion in -tableView:cellForRowAtIndexPath: to only require the cell to have a non-zero
        width in the case where the table view itself has a non-empty width. When run under TestWebKitAPI,
        this assertion currently fires because the view controller used to show the popover isn't actually
        presented, so the view controller's view (i.e. the UITableView) ends up being empty. This causes all
        of its table view cells to subsequently become empty upon reuse.

        * UIProcess/ios/forms/WKFormSelectPopover.mm:
        (-[WKSelectTableViewController tableView:cellForRowAtIndexPath:]):

2019-09-24  Alex Christensen  <achristensen@webkit.org>

        Require a WebsiteDataStore when creating or resuming downloads
        https://bugs.webkit.org/show_bug.cgi?id=202081

        Reviewed by Youenn Fablet.

        No change in behavior, but I'll have to move Safari to the new SPI.
        This makes it so there are no cases where we guess we need to use the default session,
        and it allows downloads to function correctly once there is a NetworkProcess singleton.
        Removing the unused WebProcessPool& in the callbacks will allow us to eventually have
        downloads only associated with a WebsiteDataStore and not a WebProcessPool.

        * UIProcess/API/APIDownloadClient.h:
        (API::DownloadClient::didStart):
        (API::DownloadClient::didReceiveAuthenticationChallenge):
        (API::DownloadClient::didReceiveResponse):
        (API::DownloadClient::didReceiveData):
        (API::DownloadClient::decideDestinationWithSuggestedFilename):
        (API::DownloadClient::didCreateDestination):
        (API::DownloadClient::didFinish):
        (API::DownloadClient::didFail):
        (API::DownloadClient::didCancel):
        (API::DownloadClient::processDidCrash):
        (API::DownloadClient::willSendRequest):
        * UIProcess/API/C/WKContext.cpp:
        (WKContextSetDownloadClient):
        (WKContextDownloadURLRequest):
        (WKContextResumeDownload):
        * UIProcess/API/C/WKContext.h:
        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _setDownloadDelegate:]):
        (-[WKProcessPool _downloadURLRequest:originatingWebView:]):
        (-[WKProcessPool _resumeDownloadFromData:path:originatingWebView:]):
        (-[WKProcessPool _downloadURLRequest:websiteDataStore:originatingWebView:]):
        (-[WKProcessPool _resumeDownloadFromData:websiteDataStore:path:originatingWebView:]):
        * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
        * UIProcess/API/glib/WebKitDownloadClient.cpp:
        * UIProcess/API/glib/WebKitWebContext.cpp:
        (webkitWebContextDispose):
        (webkitWebContextStartDownload):
        * UIProcess/Cocoa/DownloadClient.h:
        * UIProcess/Cocoa/DownloadClient.mm:
        (WebKit::DownloadClient::didStart):
        (WebKit::DownloadClient::didReceiveResponse):
        (WebKit::DownloadClient::didReceiveData):
        (WebKit::DownloadClient::didReceiveAuthenticationChallenge):
        (WebKit::DownloadClient::didCreateDestination):
        (WebKit::DownloadClient::processDidCrash):
        (WebKit::DownloadClient::decideDestinationWithSuggestedFilename):
        (WebKit::DownloadClient::didFinish):
        (WebKit::DownloadClient::didFail):
        (WebKit::DownloadClient::didCancel):
        (WebKit::DownloadClient::willSendRequest):
        * UIProcess/Downloads/DownloadProxy.cpp:
        (WebKit::DownloadProxy::create):
        (WebKit::DownloadProxy::DownloadProxy):
        (WebKit::DownloadProxy::invalidate):
        (WebKit::DownloadProxy::processDidClose):
        (WebKit::DownloadProxy::didStart):
        (WebKit::DownloadProxy::didReceiveAuthenticationChallenge):
        (WebKit::DownloadProxy::willSendRequest):
        (WebKit::DownloadProxy::didReceiveResponse):
        (WebKit::DownloadProxy::didReceiveData):
        (WebKit::DownloadProxy::decideDestinationWithSuggestedFilenameAsync):
        (WebKit::DownloadProxy::didCreateDestination):
        (WebKit::DownloadProxy::didFinish):
        (WebKit::DownloadProxy::didFail):
        (WebKit::DownloadProxy::didCancel):
        * UIProcess/Downloads/DownloadProxy.h:
        * UIProcess/Downloads/DownloadProxyMap.cpp:
        (WebKit::DownloadProxyMap::createDownloadProxy):
        * UIProcess/Downloads/DownloadProxyMap.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::createDownloadProxy):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::receivedPolicyDecision):
        (WebKit::WebPageProxy::contextMenuItemSelected):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::WebProcessPool):
        (WebKit::WebProcessPool::setDownloadClient):
        (WebKit::WebProcessPool::download):
        (WebKit::WebProcessPool::resumeDownload):
        (WebKit::WebProcessPool::createDownloadProxy):
        * UIProcess/WebProcessPool.h:

2019-09-24  Youenn Fablet  <youenn@apple.com>

        Delay capture sandbox extension revocation to after the page close message is sent
        https://bugs.webkit.org/show_bug.cgi?id=202133

        Reviewed by Eric Carlson.

        This ensures that the sandbox extension is removed once no longer useful
        and makes our WebProcess assertions fine.

        * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
        (WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy):

2019-09-23  Chris Dumez  <cdumez@apple.com>

        Drop unnecessary SessionID.h header includes
        https://bugs.webkit.org/show_bug.cgi?id=202129

        Reviewed by Alex Christensen.

        * NetworkProcess/AdClickAttributionManager.h:
        * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
        * NetworkProcess/NetworkLoadParameters.h:
        * NetworkProcess/RemoteNetworkingContext.h:
        * NetworkProcess/cache/CacheStorageEngine.cpp:
        * NetworkProcess/cache/CacheStorageEngine.h:
        * NetworkProcess/cache/NetworkCache.h:
        * NetworkProcess/webrtc/NetworkRTCProvider.h:
        * Shared/ApplePay/WebPaymentCoordinatorProxy.h:
        * Shared/Authentication/AuthenticationManager.h:
        * Shared/WebCoreArgumentCoders.cpp:
        * Shared/WebProcessCreationParameters.h:
        * UIProcess/API/APIPageConfiguration.h:
        * WebProcess/Cache/WebCacheStorageProvider.h:
        * WebProcess/Databases/WebDatabaseProvider.cpp:
        * WebProcess/InjectedBundle/InjectedBundle.cpp:
        * WebProcess/InjectedBundle/InjectedBundle.h:
        * WebProcess/Network/WebSocketChannel.h:
        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        * WebProcess/Storage/WebServiceWorkerProvider.cpp:
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
        * WebProcess/WebCoreSupport/curl/WebFrameNetworkingContext.h:
        * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
        * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
        * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h:
        * WebProcess/WebPage/WebFrame.h:

2019-09-23  Chris Dumez  <cdumez@apple.com>

        PlugInClient::didStartFromOrigin() does not need a sessionID
        https://bugs.webkit.org/show_bug.cgi?id=202127

        Reviewed by Geoffrey Garen.

        * WebProcess/WebCoreSupport/WebPlugInClient.cpp:
        (WebKit::WebPlugInClient::didStartFromOrigin):
        * WebProcess/WebCoreSupport/WebPlugInClient.h:

2019-09-23  Chris Dumez  <cdumez@apple.com>

        FrameSpecificStorageAccessIdentifier does not need a sessionID
        https://bugs.webkit.org/show_bug.cgi?id=202093

        Reviewed by Geoffrey Garen.

        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::requestStorageAccess):

2019-09-23  Tim Horton  <timothy_horton@apple.com>

        macOS: <datalist> dropdown shadow is cropped, looks nothing like NSComboBox
        https://bugs.webkit.org/show_bug.cgi?id=199350

        Reviewed by Wenson Hsieh.

        Improve the appearance of the macOS <datalist> dropdown, adopting the
        roundly-cornered and backdrop-ful appearance of the current NSComboBox style.

        Use the proper window shadow instead of our own inside the window, both
        so that we match the system and so that it doesn't get clipped.

        Allow vertical rubber-banding, because NSComboBox does.

        Don't highlight on hover, because NSComboBox doesn't. Do use NSTableView's
        selection mechanism instead of rolling our own for highlights driven by
        keyboard-based navigation.

        Make use of NSTableCellView, since it has some smarts around pixel alignment
        that we don't need to duplicate (and things are blurry on 1x displays without).

        Also rename some classes to make it a bit more clear what's going on:
        WKDataListSuggestionCell -> WKDataListSuggestionView (it's a NSView, not an NSCell)
        WKDataListSuggestionsView -> WKDataListSuggestionsController (it's not a view at all)

        * Platform/spi/mac/AppKitSPI.h:
        * UIProcess/mac/WebDataListSuggestionsDropdownMac.mm:
        (WebKit::WebDataListSuggestionsDropdownMac::show):
        (-[WKDataListSuggestionWindow initWithContentRect:styleMask:backing:defer:]):
        (-[WKDataListSuggestionWindow canBecomeKeyWindow]):
        (-[WKDataListSuggestionWindow hasKeyAppearance]):
        (-[WKDataListSuggestionWindow shadowOptions]):
        (-[WKDataListSuggestionView initWithFrame:]):
        (-[WKDataListSuggestionView setText:]):
        (-[WKDataListSuggestionView setBackgroundStyle:]):
        (-[WKDataListSuggestionTableRowView drawSelectionInRect:]):
        (-[WKDataListSuggestionTableView initWithElementRect:]):
        (-[WKDataListSuggestionTableView layout]):
        (-[WKDataListSuggestionTableView reload]):
        (-[WKDataListSuggestionsController initWithInformation:inView:]):
        (-[WKDataListSuggestionsController currentSelectedString]):
        (-[WKDataListSuggestionsController updateWithInformation:]):
        (-[WKDataListSuggestionsController moveSelectionByDirection:]):
        (-[WKDataListSuggestionsController invalidate]):
        (-[WKDataListSuggestionsController dropdownRectForElementRect:]):
        (-[WKDataListSuggestionsController showSuggestionsDropdown:]):
        (-[WKDataListSuggestionsController tableView:rowViewForRow:]):
        (-[WKDataListSuggestionsController tableView:viewForTableColumn:row:]):
        (-[WKDataListSuggestionCell initWithFrame:]): Deleted.
        (-[WKDataListSuggestionCell setText:]): Deleted.
        (-[WKDataListSuggestionCell setActive:]): Deleted.
        (-[WKDataListSuggestionCell drawRect:]): Deleted.
        (-[WKDataListSuggestionCell mouseEntered:]): Deleted.
        (-[WKDataListSuggestionCell mouseExited:]): Deleted.
        (-[WKDataListSuggestionCell acceptsFirstResponder]): Deleted.
        (-[WKDataListSuggestionTable initWithElementRect:]): Deleted.
        (-[WKDataListSuggestionTable setVisibleRect:]): Deleted.
        (-[WKDataListSuggestionTable currentActiveRow]): Deleted.
        (-[WKDataListSuggestionTable setActiveRow:]): Deleted.
        (-[WKDataListSuggestionTable reload]): Deleted.
        (-[WKDataListSuggestionTable acceptsFirstResponder]): Deleted.
        (-[WKDataListSuggestionTable enclosingScrollView]): Deleted.
        (-[WKDataListSuggestionTable removeFromSuperviewWithoutNeedingDisplay]): Deleted.
        (-[WKDataListSuggestionsView initWithInformation:inView:]): Deleted.
        (-[WKDataListSuggestionsView currentSelectedString]): Deleted.
        (-[WKDataListSuggestionsView updateWithInformation:]): Deleted.
        (-[WKDataListSuggestionsView moveSelectionByDirection:]): Deleted.
        (-[WKDataListSuggestionsView invalidate]): Deleted.
        (-[WKDataListSuggestionsView dropdownRectForElementRect:]): Deleted.
        (-[WKDataListSuggestionsView showSuggestionsDropdown:]): Deleted.
        (-[WKDataListSuggestionsView selectedRow:]): Deleted.
        (-[WKDataListSuggestionsView numberOfRowsInTableView:]): Deleted.
        (-[WKDataListSuggestionsView tableView:heightOfRow:]): Deleted.
        (-[WKDataListSuggestionsView tableView:viewForTableColumn:row:]): Deleted.

2019-09-23  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] Drop animation when dragging images from Photos to WebKit2 Mail compose is incorrect
        https://bugs.webkit.org/show_bug.cgi?id=201674
        <rdar://problem/51250952>

        Reviewed by Tim Horton.

        Our current logic for handling dropped content in editable elements on iOS works like this in the ideal case:

        (1)     UIKit asks us for a targeted preview for each UIDragItem. We don't know (and can't determine this
                synchronously without blocking on the web process) so we simply retarget the preview to animate to the
                last known caret location.

        (2)     Soonafter, UIKit hands us a drop preview update block, which may be used to retarget the drop preview
                once, as long as the drop animation is less than 90% complete. We stash these update blocks for now.

        (3)     -dropInteraction:performDrop: is then called, and we start loading item provider data right away.

        (4)     When the data has finished loading, we perform the drop in the web process. After any inserted images
                have finished loading, we take snapshots (of the dropped content as well as surrounding web content
                minus the dropped content), and deliver these images to the UI process via TextIndicatorData.

        (5)     Upon receiving the TextIndicatorData sent in (4), we use the image data to create updated targeted drag
                previews, and use these to invoke the preview update blocks we stored earlier in (2). We also obscure
                the entire web view with a snapshot of the view minus any dropped content, such that the updated drop
                previews may animate into place without also showing the final content.

        (6)     When the drop animation ends, we remove the unselected content snapshot view added in (5) simultaneously
                as the targeted previews disappear, revealing the actual dropped content on the page. The drop is now
                complete.

        However, note that the drag update block we invoke in (5) doesn't work if the drop animation is already more
        than 90% complete. Since the lifecycle of the drop animation is distinct from that of item provider loading, if
        the delay between (3) and (4) exceeds 90% of the total drop animation time, we'll fail to update the targeted
        previews, such that the user only sees the initial drag preview fly on top of the caret and disappear. While we
        typically win this race for data dragged from other WebKit apps, we almost always lose when dragging from Photos
        and end up with a janky drop animation. This is especially true for any images that aren't locally available,
        and need to be fetched from iCloud. An additional problem is that in step (5), we use the same final snapshot to
        update the drop preview of every item, since we don't have a snapshot for the fragment corresponding to each
        individual dropped item.

        To address these issues for Mail in the case where the user drops images with known sizes (i.e. -[NSItemProvider
        preferredPresentationSize] is specified), we introduce an alternate codepath for handling dropped images that
        performs the drop immediately upon receiving -dropInteraction:performDrop: in the UI process. Since the data has
        yet to arrive, we instead handle the drop by inserting placeholder image elements at the drag caret position,
        which initially have no source but are sized to fit their expected final image sizes. After doing so, we
        snapshot the page (minus the dropped content range, as usual) and deliver this snapshot to the UI process, along
        with the rects (in root view coordinates) of each placeholder image that was inserted. In the UI process, we
        then take this snapshot and obscure the content view with it, and also use each of the placeholder rects to
        provide an updated target for each drag preview, such that the drop previews now animate to their final
        locations on the page.

        When the data eventually arrives, we handle the drop by detecting the placeholder elements we inserted earlier,
        and using the dropped data to update the source attribute and attachment backing for each of these placeholder
        elements instead of attempting to insert new content.

        Note that this codepath is currently only enabled for SPI clients that set -[WKWebView _editable] to YES, since
        it involves us performing the editing action for the drop (thus changing the DOM) prior to the preventable drop
        event, and prior to us having any data at all. However, the drop event can't come before the editing action,
        since we need to have already loaded data from the item providers to expose it via the dataTransfer of the drop
        event. This contradiction means that this image placeholder hack is only for _editable SPI clients that, at the
        very least, will not require preventing default behavior when dropping only images with predetermined sizes.

        Covered by 2 new API tests. See comments below for more detail.

        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/DragDropInteractionState.h:
        * UIProcess/ios/DragDropInteractionState.mm:
        (WebKit::DragDropInteractionState::setDefaultDropPreview):

        Add a way to keep track of default drop previews that we observed during each call to
        -dropInteraction:previewForDroppingItem:withDefault:. In the image placeholder drop scenario, we use these
        default drop previews later on to create retargeted drop previews after the placeholders have been inserted.

        (WebKit::DragDropInteractionState::defaultDropPreview const):
        (WebKit::DragDropInteractionState::deliverDelayedDropPreview):

        Add an alternate version of deliverDelayedDropPreview that is used when inserting image placeholders. Rather
        than use text indicator data of the final dropped content on the page, use the root-view-coordinate rects of
        each of the placeholder elements to reposition the default drop previews.

        There's additional logic here to handle the case where the final image is taller than the height of the
        unobscured content rect, in which case we clip the drop preview using UIDragPreviewParameter's visiblePath to
        prevent the drop preview from being shown outside of the bounds of the web view.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _deliverDelayedDropPreviewIfPossible:]):
        (sizesOfPlaceholderElementsToInsertWhenDroppingItems):

        Collects the list of expected image sizes for the dropped item providers, or an empty list in the case where
        any of the item providers may not be represented as inline images or do not have predetermined sizes.

        (-[WKContentView _handleDropByInsertingImagePlaceholders:session:]):

        If possible, handles the drop by inserting image placeholders instead of waiting for the data to finish loading
        before dropping. Returns whether or not we decided to proceed with the image placeholder drop.

        (-[WKContentView dropInteraction:performDrop:]):
        (-[WKContentView dropInteraction:item:willAnimateDropWithAnimator:]):

        Fixes a bug where the unselected content snapshot view could linger around on the web view forever after a drop
        where the data doesn't load in time for the drop to finish by keeping track of whether there is an actively
        animating drag item, and only applying the unselected content snapshot if so.

        (-[WKContentView dropInteraction:previewForDroppingItem:withDefault:]):

        Stash the default drop preview away here.

        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::insertDroppedImagePlaceholders):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::insertDroppedImagePlaceholders):

        See WebCore ChangeLog for more information.

        (WebKit::WebPage::didFinishLoadingImageForElement):

        If the image that finished loading is a dropped image placeholder, allow DragController to "finalize" it by
        stripping away some styles that were temporarily added.

2019-09-23  Alex Christensen  <achristensen@webkit.org>

        REGRESSION(250143) Disk cache should be enabled for Safari
        https://bugs.webkit.org/show_bug.cgi?id=202117

        Reviewed by Brady Eidson.

        r250143 made it so in Safari, when setCacheModel is called for the first time in NetworkProcess::initializeNetworkProcess,
        it didn't have a path to check available disk space.  This resulted in disabling the disk cache in Safari, which caused a
        huge performance regression.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::initializeNetworkProcess):
        (WebKit::NetworkProcess::setCacheModel):
        * NetworkProcess/NetworkProcess.h:
        (WebKit::NetworkProcess::setCacheModel):
        * NetworkProcess/NetworkProcess.messages.in:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):
        (WebKit::WebProcessPool::setCacheModel):

2019-09-16  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthn] LocalAuthenticator tests are failing on internal bots
        https://bugs.webkit.org/show_bug.cgi?id=201844
        <rdar://problem/54278693>

        Reviewed by Brent Fulgham.

        This patch adds a way for mock tests to select a credential in getAssertion
        ceremonies such that a test can ensure it always uses the credential it manages.
        Credentials managed by other test could be deleted at anytime.

        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreSetWebAuthenticationMockConfiguration):
        * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
        (WebKit::LocalAuthenticator::getAssertion):
        * UIProcess/WebAuthentication/Cocoa/LocalConnection.h:
        * UIProcess/WebAuthentication/Cocoa/LocalConnection.mm:
        (WebKit::LocalConnection::selectCredential const):
        * UIProcess/WebAuthentication/Mock/MockLocalConnection.h:
        * UIProcess/WebAuthentication/Mock/MockLocalConnection.mm:
        (WebKit::MockLocalConnection::selectCredential const):
        * UIProcess/WebAuthentication/Mock/MockWebAuthenticationConfiguration.h:

2019-09-23  David Quesada  <david_quesada@apple.com>

        [iOS] REGRESSION(r250151): Occasional assertion failures in ShareableBitmap::~ShareableBitmap()
        https://bugs.webkit.org/show_bug.cgi?id=202112
        rdar://problem/55624598

        Reviewed by Chris Dumez.

        * Shared/cg/ShareableBitmapCG.cpp:
        (WebKit::ShareableBitmap::releaseDataProviderData):
        It is possible and valid for a UIImage created from a ShareableBitmap's CGImage representation
        to be deallocated on a background thread. When this happens, releaseDataProviderData() should
        ensure it's running on the main thread before deref'ing the ShareableBitmap. Otherwise the
        bitmap can be deallocated on the background thread, violating an assertion added in r250151.

2019-09-23  Joseph Pecoraro  <pecoraro@apple.com>

        Web Inspector: Improve the Uncaught Exception View file a bug link
        https://bugs.webkit.org/show_bug.cgi?id=201717

        Reviewed by Devin Rousso.

        * UIProcess/WebInspectorProxy.cpp:
        (WebKit::WebInspectorProxy::bringInspectedPageToFront):
        * UIProcess/WebInspectorProxy.h:
        * UIProcess/WebInspectorProxy.messages.in:
        Provide a way to bring the inspected page to the foreground.

        * WebProcess/WebPage/WebInspectorUI.cpp:
        (WebKit::WebInspectorUI::openInNewTab):
        Use it when opening a new tab beside the inspected page.

2019-09-23  Brent Fulgham  <bfulgham@apple.com>

        Unreviewed build fix after r250169 and r250236.

        * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
        (WebKit::NetworkDataTaskCurl::createCurlRequest):
        * UIProcess/API/C/curl/WKWebsiteDataStoreRefCurl.cpp:
        (WKWebsiteDataStoreEnableDefaultNetworkProxySettings):
        (WKWebsiteDataStoreEnableCustomNetworkProxySettings):
        (WKWebsiteDataStoreDisableNetworkProxySettings):

2019-09-23  David Kilzer  <ddkilzer@apple.com>

        clang-tidy: Fix unnecessary copy/ref churn of for loop variables in WebKit
        <https://webkit.org/b/202096>

        Reviewed by Darin Adler.

        Fix unwanted copying/ref churn of loop variables by making them
        const references.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        (WebKit::domainsToString):
        * UIProcess/ios/WKActionSheetAssistant.mm:
        (-[WKActionSheetAssistant presentationRectForElementUsingClosestIndicatedRect]):
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _singleTapDidReset:]):
        * UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm:
        (-[WKDataListSuggestionsControl textSuggestions]):

2019-09-23  Chris Dumez  <cdumez@apple.com>

        WebPage::sessionID() does not need to get the sessionID from there WebCore Page
        https://bugs.webkit.org/show_bug.cgi?id=202094

        Reviewed by Youenn Fablet.

        WebPage::sessionID() does not need to get the sessionID from there WebCore Page, it can
        simply get the sessionID from the WebProcess singleton, now that we have a single session
        per WebProcess. This will avoid potential crashes trying to dereference m_page to get the
        sessionID, since m_page can be null.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::sessionID const):
        * WebProcess/WebPage/WebPage.h:
        (WebKit::WebPage::sessionID const): Deleted.

2019-09-23  Youenn Fablet  <youenn@apple.com>

        Simplify UserMediaPermissionRequestManager management of UserMediaRequest
        https://bugs.webkit.org/show_bug.cgi?id=201688

        Reviewed by Eric Carlson.

        Instead of having two maps to go from ID to request and request to ID,
        Make request own its ID and keep a single ID to request map.
        Rename it to m_ongoingUserMediaRequests.

        Rename requests that are not processed because the document cannot start media as m_pendingUserMediaRequests.
        In case the request is cancelled following the stopping of active dom objects, we just remove it from m_pendingUserMediaRequests
        instead of denying the request. This matches Chrome and Firefox behavior.

        * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
        (WebKit::UserMediaPermissionRequestManager::startUserMediaRequest):
        (WebKit::UserMediaPermissionRequestManager::sendUserMediaRequest):
        (WebKit::UserMediaPermissionRequestManager::cancelUserMediaRequest):
        (WebKit::UserMediaPermissionRequestManager::mediaCanStart):
        (WebKit::UserMediaPermissionRequestManager::userMediaAccessWasGranted):
        (WebKit::UserMediaPermissionRequestManager::userMediaAccessWasDenied):
        (WebKit::UserMediaPermissionRequestManager::addDeviceChangeObserver):
        (WebKit::generateRequestID): Deleted.
        (WebKit::UserMediaPermissionRequestManager::removeMediaRequestFromMaps): Deleted.
        * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:

2019-09-23  Patrick Griffis  <pgriffis@igalia.com>

        [GTK][WPE] Don't use prgname in dbus-proxy socket path
        https://bugs.webkit.org/show_bug.cgi?id=201979

        The path length for the socket is limited to 108 bytes so it is easy for a long
        prgname to cause it to get truncated and fail. Since we only allow the socket
        path into the sandbox the unique directory isn't necessary.

        Reviewed by Michael Catanzaro.

        * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
        (WebKit::XDGDBusProxyLauncher::setAddress):

2019-09-23  Michael Catanzaro  <mcatanzaro@igalia.com>

        [SOUP] Stop setting G_TLS_GNUTLS_PRIORITY
        https://bugs.webkit.org/show_bug.cgi?id=172154

        Reviewed by Carlos Garcia Campos.

        Nowadays, I maintain glib-networking. WebKit doesn't need to override its defaults to be
        secure anymore. By overriding glib-networking's default priority, WebKit is force-reenabling
        TLS 1.0 and TLS 1.1 even when glib-networking has disabled them.

        * NetworkProcess/EntryPoint/unix/NetworkProcessMain.cpp:
        (main):
        * WebProcess/EntryPoint/unix/WebProcessMain.cpp:
        (main):

2019-09-21  Dan Bernstein  <mitz@apple.com>

        Fix an assertion failure introduced in r250186.

        * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
        (WebKit::PluginProcessProxy::platformGetLaunchOptionsWithAttributes): Corrected the
          assertion.

2019-09-21  Chris Dumez  <cdumez@apple.com>

        Reduce use of SessionID::defaultSessionID() in WebKit
        https://bugs.webkit.org/show_bug.cgi?id=202080

        Reviewed by Alex Christensen.

        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::convertMainResourceLoadToDownload):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
        * WebProcess/WebPage/WebFrame.cpp:
        (WebKit::WebFrame::convertMainResourceLoadToDownload):
        * WebProcess/WebPage/WebFrame.h:

2019-09-21  Chris Dumez  <cdumez@apple.com>

        Drop unnecessary NetworkProcess::m_sessionByConnection
        https://bugs.webkit.org/show_bug.cgi?id=202088

        Reviewed by Alex Christensen.

        * NetworkProcess/NetworkProcess.cpp:
        * NetworkProcess/NetworkProcess.h:

2019-09-21  Chris Dumez  <cdumez@apple.com>

        WebIDBConnectionToClient does not need to be RefCounted or a SessionID
        https://bugs.webkit.org/show_bug.cgi?id=202089

        Reviewed by Alex Christensen.

        WebIDBConnectionToClient does not need to be RefCounted, the ref() / deref() virtual function
        it implemented from its interface were dead code. We now stop subclassing RefCounted and have
        the NetworkConnectionToWebProcess fully own the WebIDBConnectionToClient. Instead of the
        WebIDBConnectionToClient having 3 data members for the NetworkProcess, the sessionID and the IPC
        connection, use a single data member to its NetworkConnectionToWebProcess parent. It can get
        everything it needs from its parent.

        * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
        (WebKit::WebIDBConnectionToClient::WebIDBConnectionToClient):
        (WebKit::WebIDBConnectionToClient::idbServer):
        (WebKit::WebIDBConnectionToClient::disconnectedFromWebProcess):
        (WebKit::WebIDBConnectionToClient::messageSenderConnection const):
        (WebKit::WebIDBConnectionToClient::connectionToClient):
        (WebKit::WebIDBConnectionToClient::deleteDatabase):
        (WebKit::WebIDBConnectionToClient::openDatabase):
        (WebKit::WebIDBConnectionToClient::abortTransaction):
        (WebKit::WebIDBConnectionToClient::commitTransaction):
        (WebKit::WebIDBConnectionToClient::didFinishHandlingVersionChangeTransaction):
        (WebKit::WebIDBConnectionToClient::createObjectStore):
        (WebKit::WebIDBConnectionToClient::deleteObjectStore):
        (WebKit::WebIDBConnectionToClient::renameObjectStore):
        (WebKit::WebIDBConnectionToClient::clearObjectStore):
        (WebKit::WebIDBConnectionToClient::createIndex):
        (WebKit::WebIDBConnectionToClient::deleteIndex):
        (WebKit::WebIDBConnectionToClient::renameIndex):
        (WebKit::WebIDBConnectionToClient::putOrAdd):
        (WebKit::WebIDBConnectionToClient::getRecord):
        (WebKit::WebIDBConnectionToClient::getAllRecords):
        (WebKit::WebIDBConnectionToClient::getCount):
        (WebKit::WebIDBConnectionToClient::deleteRecord):
        (WebKit::WebIDBConnectionToClient::openCursor):
        (WebKit::WebIDBConnectionToClient::iterateCursor):
        (WebKit::WebIDBConnectionToClient::establishTransaction):
        (WebKit::WebIDBConnectionToClient::databaseConnectionPendingClose):
        (WebKit::WebIDBConnectionToClient::databaseConnectionClosed):
        (WebKit::WebIDBConnectionToClient::abortOpenAndUpgradeNeeded):
        (WebKit::WebIDBConnectionToClient::didFireVersionChangeEvent):
        (WebKit::WebIDBConnectionToClient::openDBRequestCancelled):
        (WebKit::WebIDBConnectionToClient::confirmDidCloseFromServer):
        (WebKit::WebIDBConnectionToClient::getAllDatabaseNames):
        * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer):
        * NetworkProcess/NetworkConnectionToWebProcess.h:

2019-09-21  Chris Dumez  <cdumez@apple.com>

        Regression(iOS 13) web views do not deal properly with their window's UIScene changing
        https://bugs.webkit.org/show_bug.cgi?id=202070
        <rdar://problem/55580699>

        Reviewed by Tim Horton.

        Web views do not deal properly with their window's UIScene changing. If a Safari window is in the
        background for 1 minute, its UIScene will be detached and the window will get a new UIScene if
        the user later switches to this window. Our web views listen to UIScene notifications to determine
        their visibility and currently stop receiving visibility updates once the window’s UIScene has
        changed. This causes view freezes because our WebContent process does not know its view is visible
        and keeps its layer tree frozen.

        Previously, when our view would be added to a window, we would get this window's UIScene and listen
        for UISceneDidEnterBackgroundNotification / UISceneWillEnterForegroundNotification for this UIScene
        object. Instead, we now listen to these notifications for ALL the application's UIScenes. Our handler
        then checks if the notification's UIScene object matches the current window's UIScene before
        forwarding the notification to the rest of WebKit.

        * UIProcess/ApplicationStateTracker.mm:
        (WebKit::ApplicationStateTracker::ApplicationStateTracker):
        (WebKit::ApplicationStateTracker::~ApplicationStateTracker):

2019-09-21  Dan Bernstein  <mitz@apple.com>

        Safari 13 may launch leftover 32-bit plug-in process from Safari 12’s WebKit, which crashes
        https://bugs.webkit.org/show_bug.cgi?id=202077
        <rdar://problem/55547063>

        Reviewed by Sam Weinig.

        * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
        (WebKit::getPluginArchitecture): Removed support for i386 plug-ins.

        * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
        (WebKit::serviceName): Assert that the requested process type is not Plugin32.

        * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
        (WebKit::PluginProcessProxy::platformGetLaunchOptionsWithAttributes): Assert that the
          plug-in architecture is x86_64.

2019-09-21  Antoine Quint  <graouts@apple.com>

        [Pointer Events] touch-action set to pan-x or pan-y alone should disable scrolling altogether if the intial gesture is in the disallowed direction
        https://bugs.webkit.org/show_bug.cgi?id=202053
        <rdar://problem/54542190>

        Reviewed by Tim Horton.

        Although the Pointer Events specification does not specify this clearly (see https://github.com/w3c/pointerevents/issues/303), setting "touch-action" to a value
        that only allows scrolling a specific direction ("pan-x" or "pan-y") should disable scrolling in the specified direction if the panning gesture initially is directed
        in the opposite direction. In practice, this means that setting "touch-action: pan-y" on an element should disable scrolling if the user initially pans horizontally,
        even if later on in the gesture the user pans vertically. This allows for sites that want to offer a programmatic horizontal scroller to disable vertical scrolling
        if the user pans horizontally.

        In order to support this, we add four UISwipeGestureRecognizers, one for each direction, and we selectively allows touches to be recognizer for them based on the
        "touch-action" value specified at the initial touch location for a given gesture. In the case of "touch-action: pan-y" we only allow the left and right swipe recognizers
        to be enabled, and in the case of "touch-action: pan-x" we only allow the up and down swipe recognizers to be enabled. If any of those gesture recognizers is recognized,
        scrolling will be disabled for the duration of this gesture. If a UIScrollView panning gesture recognizer is recognized prior to a swipe, they won't have a chance to be
        recognized.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView setupInteraction]):
        (-[WKContentView cleanupInteraction]):
        (-[WKContentView _removeDefaultGestureRecognizers]):
        (-[WKContentView _addDefaultGestureRecognizers]):
        (-[WKContentView gestureRecognizer:shouldReceiveTouch:]):

2019-09-19  Andy Estes  <aestes@apple.com>

        [Apple Pay] Clean up handling of summary items and payment method updates
        https://bugs.webkit.org/show_bug.cgi?id=202018
        <rdar://problem/55470632>

        Reviewed by Tim Horton.

        Now that PaymentMethodUpdate knows how to convert itself to a
        PKPaymentRequestPaymentMethodUpdate, PaymentAuthorizationPresenter can merely pass the
        converted update directly to the platform delegate rather than passing the individual
        components and relying on the delegate to instantiate the platform update itself. Added
        FIXMEs for applying a similar treatment to ShippingContactUpdate and ShippingMethodUpdate.

        * Platform/cocoa/PaymentAuthorizationPresenter.h:
        * Platform/cocoa/PaymentAuthorizationPresenter.mm:
        (WebKit::PaymentAuthorizationPresenter::completePaymentMethodSelection):
        (WebKit::PaymentAuthorizationPresenter::completeShippingContactSelection):
        (WebKit::PaymentAuthorizationPresenter::completeShippingMethodSelection):
        * Platform/cocoa/WKPaymentAuthorizationDelegate.h:
        * Platform/cocoa/WKPaymentAuthorizationDelegate.mm:
        (-[WKPaymentAuthorizationDelegate completePaymentMethodSelection:]):
        (-[WKPaymentAuthorizationDelegate completeShippingContactSelection:]):
        (-[WKPaymentAuthorizationDelegate completeShippingMethodSelection:]):
        (-[WKPaymentAuthorizationDelegate _didSelectPaymentMethod:completion:]):
        (-[WKPaymentAuthorizationDelegate _didSelectShippingContact:completion:]):
        (-[WKPaymentAuthorizationDelegate _didSelectShippingMethod:completion:]):
        (-[WKPaymentAuthorizationDelegate completeShippingContactSelection:summaryItems:shippingMethods:errors:]): Deleted.
        * Shared/ApplePay/WebPaymentCoordinatorProxy.h:
        * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h:
        * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
        (WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest):
        (WebKit::toPKPaymentSummaryItemType): Deleted.
        (WebKit::toPKPaymentSummaryItem): Deleted.
        (WebKit::toPKPaymentSummaryItems): Deleted.
        * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
        (IPC::ArgumentCoder<WebCore::PaymentMethodUpdate>::encode):
        (IPC::ArgumentCoder<WebCore::PaymentMethodUpdate>::decode):

2019-09-20  Keith Rollin  <krollin@apple.com>

        Remove some support for < iOS 13
        https://bugs.webkit.org/show_bug.cgi?id=202027
        <rdar://problem/55547109>

        Reviewed by Alex Christensen.

        Remove some support for iOS versions less than 13.0.

        Update conditionals that reference __IPHONE_OS_VERSION_MIN_REQUIRED
        and __IPHONE_OS_VERSION_MAX_ALLOWED, assuming that they both have
        values >= 130000. This means that expressions like
        "__IPHONE_OS_VERSION_MIN_REQUIRED < 101300" are always False and
        "__IPHONE_OS_VERSION_MIN_REQUIRED >= 101300" are always True.

        After version checks have been removed, there are some cases where the
        preprocessor conditional looks like "#if PLATFORM(MAC) ||
        PLATFORM(IOS_FAMILY)". These can be collapsed into "#if
        PLATFORM(COCOA)". This additional cleanup will be performed in a
        subsequent patch.

        This removal is part of a series of patches effecting the removal of
        dead code for old versions of iOS. This particular pass involves
        changes in which Joe Pecoraro was involved. These changes are isolated
        from other similar changes in order to facilitate the reviewing
        process.

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):

2019-09-20  Alex Christensen  <achristensen@webkit.org>

        Remove unnecessary abstractions around WebsiteDataStore
        https://bugs.webkit.org/show_bug.cgi?id=201655

        Reviewed by Chris Dumez.

        * PlatformFTW.cmake:
        * PlatformWin.cmake:
        * Sources.txt:
        * SourcesCocoa.txt:
        * SourcesGTK.txt:
        * SourcesWPE.txt:
        * UIProcess/API/APIHTTPCookieStore.cpp:
        * UIProcess/API/APIHTTPCookieStore.h:
        * UIProcess/API/APIPageConfiguration.cpp:
        (API::PageConfiguration::websiteDataStore):
        (API::PageConfiguration::setWebsiteDataStore):
        * UIProcess/API/APIPageConfiguration.h:
        * UIProcess/API/APIProcessPoolConfiguration.cpp:
        * UIProcess/API/APIWebsiteDataStore.cpp: Removed.
        * UIProcess/API/APIWebsiteDataStore.h: Removed.
        * UIProcess/API/APIWebsitePolicies.cpp:
        (API::WebsitePolicies::WebsitePolicies):
        (API::WebsitePolicies::setWebsiteDataStore):
        (API::WebsitePolicies::data):
        * UIProcess/API/APIWebsitePolicies.h:
        * UIProcess/API/C/WKAPICast.h:
        * UIProcess/API/C/WKContext.cpp:
        (WKContextSetCacheModel):
        (WKContextGetCacheModel):
        * UIProcess/API/C/WKFramePolicyListener.cpp:
        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreGetTypeID):
        (WKWebsiteDataStoreGetDefaultDataStore):
        (WKWebsiteDataStoreCreateNonPersistentDataStore):
        (WKWebsiteDataStoreCreateWithConfiguration):
        (WKWebsiteDataStoreGetHTTPCookieStore):
        (WKWebsiteDataStoreSetResourceLoadStatisticsDebugModeWithCompletionHandler):
        (WKWebsiteDataStoreSetResourceLoadStatisticsPrevalentResourceForDebugMode):
        (WKWebsiteDataStoreSetStatisticsLastSeen):
        (WKWebsiteDataStoreSetStatisticsPrevalentResource):
        (WKWebsiteDataStoreSetStatisticsVeryPrevalentResource):
        (WKWebsiteDataStoreDumpResourceLoadStatistics):
        (WKWebsiteDataStoreIsStatisticsPrevalentResource):
        (WKWebsiteDataStoreIsStatisticsVeryPrevalentResource):
        (WKWebsiteDataStoreIsStatisticsRegisteredAsSubresourceUnder):
        (WKWebsiteDataStoreIsStatisticsRegisteredAsSubFrameUnder):
        (WKWebsiteDataStoreIsStatisticsRegisteredAsRedirectingTo):
        (WKWebsiteDataStoreSetStatisticsHasHadUserInteraction):
        (WKWebsiteDataStoreIsStatisticsHasHadUserInteraction):
        (WKWebsiteDataStoreSetStatisticsGrandfathered):
        (WKWebsiteDataStoreIsStatisticsGrandfathered):
        (WKWebsiteDataStoreSetStatisticsSubframeUnderTopFrameOrigin):
        (WKWebsiteDataStoreSetStatisticsSubresourceUnderTopFrameOrigin):
        (WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectTo):
        (WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectFrom):
        (WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectTo):
        (WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectFrom):
        (WKWebsiteDataStoreSetStatisticsCrossSiteLoadWithLinkDecoration):
        (WKWebsiteDataStoreSetStatisticsTimeToLiveUserInteraction):
        (WKWebsiteDataStoreStatisticsProcessStatisticsAndDataRecords):
        (WKWebsiteDataStoreStatisticsUpdateCookieBlocking):
        (WKWebsiteDataStoreStatisticsSubmitTelemetry):
        (WKWebsiteDataStoreSetStatisticsNotifyPagesWhenDataRecordsWereScanned):
        (WKWebsiteDataStoreSetStatisticsIsRunningTest):
        (WKWebsiteDataStoreSetStatisticsShouldClassifyResourcesBeforeDataRecordsRemoval):
        (WKWebsiteDataStoreSetStatisticsNotifyPagesWhenTelemetryWasCaptured):
        (WKWebsiteDataStoreSetStatisticsMinimumTimeBetweenDataRecordsRemoval):
        (WKWebsiteDataStoreSetStatisticsGrandfatheringTime):
        (WKWebsiteDataStoreSetStatisticsMaxStatisticsEntries):
        (WKWebsiteDataStoreSetStatisticsPruneEntriesDownTo):
        (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore):
        (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
        (WKWebsiteDataStoreStatisticsClearThroughWebsiteDataRemoval):
        (WKWebsiteDataStoreStatisticsDeleteCookiesForTesting):
        (WKWebsiteDataStoreStatisticsHasLocalStorage):
        (WKWebsiteDataStoreSetStatisticsCacheMaxAgeCap):
        (WKWebsiteDataStoreStatisticsHasIsolatedSession):
        (WKWebsiteDataStoreStatisticsResetToConsistentState):
        (WKWebsiteDataStoreRemoveAllFetchCaches):
        (WKWebsiteDataStoreRemoveFetchCacheForOrigin):
        (WKWebsiteDataStoreRemoveAllIndexedDatabases):
        (WKWebsiteDataStoreRemoveLocalStorage):
        (WKWebsiteDataStoreRemoveAllServiceWorkerRegistrations):
        (WKWebsiteDataStoreGetFetchCacheOrigins):
        (WKWebsiteDataStoreGetFetchCacheSizeForOrigin):
        (WKWebsiteDataStoreCopyServiceWorkerRegistrationDirectory):
        (WKWebsiteDataStoreSetServiceWorkerRegistrationDirectory):
        (WKWebsiteDataStoreClearAllDeviceOrientationPermissions):
        (WKWebsiteDataStoreSetWebAuthenticationMockConfiguration):
        (WKWebsiteDataStoreClearAdClickAttributionsThroughWebsiteDataRemoval):
        * UIProcess/API/C/WKWebsitePolicies.cpp:
        * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm: Removed.
        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (+[WKWebsiteDataStore defaultDataStore]):
        (+[WKWebsiteDataStore nonPersistentDataStore]):
        (-[WKWebsiteDataStore dealloc]):
        (-[WKWebsiteDataStore httpCookieStore]):
        (-[WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]):
        (-[WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:]):
        (+[WKWebsiteDataStore _defaultDataStoreExists]):
        (+[WKWebsiteDataStore _deleteDefaultDataStoreForTesting]):
        (-[WKWebsiteDataStore _initWithConfiguration:]):
        (-[WKWebsiteDataStore _fetchDataRecordsOfTypes:withOptions:completionHandler:]):
        (-[WKWebsiteDataStore _resourceLoadStatisticsEnabled]):
        (-[WKWebsiteDataStore _setResourceLoadStatisticsEnabled:]):
        (-[WKWebsiteDataStore _resourceLoadStatisticsDebugMode]):
        (-[WKWebsiteDataStore _setResourceLoadStatisticsDebugMode:]):
        (-[WKWebsiteDataStore _cacheStorageDirectory]):
        (-[WKWebsiteDataStore _setCacheStorageDirectory:]):
        (-[WKWebsiteDataStore _serviceWorkerRegistrationDirectory]):
        (-[WKWebsiteDataStore _setServiceWorkerRegistrationDirectory:]):
        (-[WKWebsiteDataStore _setBoundInterfaceIdentifier:]):
        (-[WKWebsiteDataStore _boundInterfaceIdentifier]):
        (-[WKWebsiteDataStore _setAllowsCellularAccess:]):
        (-[WKWebsiteDataStore _allowsCellularAccess]):
        (-[WKWebsiteDataStore _setProxyConfiguration:]):
        (-[WKWebsiteDataStore _sourceApplicationBundleIdentifier]):
        (-[WKWebsiteDataStore _setSourceApplicationBundleIdentifier:]):
        (-[WKWebsiteDataStore _sourceApplicationSecondaryIdentifier]):
        (-[WKWebsiteDataStore _setSourceApplicationSecondaryIdentifier:]):
        (-[WKWebsiteDataStore _proxyConfiguration]):
        (-[WKWebsiteDataStore _indexedDBDatabaseDirectory]):
        (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldSubmitTelemetry:]):
        (-[WKWebsiteDataStore _setResourceLoadStatisticsTestingCallback:]):
        (-[WKWebsiteDataStore _getAllStorageAccessEntriesFor:completionHandler:]):
        (-[WKWebsiteDataStore _scheduleCookieBlockingUpdate:]):
        (-[WKWebsiteDataStore _setPrevalentDomain:completionHandler:]):
        (-[WKWebsiteDataStore _getIsPrevalentDomain:completionHandler:]):
        (-[WKWebsiteDataStore _clearPrevalentDomain:completionHandler:]):
        (-[WKWebsiteDataStore _processStatisticsAndDataRecords:]):
        (-[WKWebsiteDataStore _hasRegisteredServiceWorker]):
        (-[WKWebsiteDataStore _delegate]):
        (-[WKWebsiteDataStore set_delegate:]):
        * UIProcess/API/Cocoa/WKWebsiteDataStoreInternal.h:
        * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp: Removed.
        * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
        (webkitWebsiteDataManagerSetProperty):
        (webkitWebsiteDataManagerGetDataStore):
        (webkit_website_data_manager_get_local_storage_directory):
        (webkit_website_data_manager_get_disk_cache_directory):
        (webkit_website_data_manager_get_offline_application_cache_directory):
        (webkit_website_data_manager_get_indexeddb_directory):
        (webkit_website_data_manager_get_websql_directory):
        (webkit_website_data_manager_get_hsts_cache_directory):
        (webkit_website_data_manager_fetch):
        (webkit_website_data_manager_remove):
        (webkit_website_data_manager_clear):
        (webkitWebsiteDataManagerCreate): Deleted.
        * UIProcess/API/glib/WebKitWebsiteDataManagerPrivate.h:
        * UIProcess/API/win/APIWebsiteDataStoreWin.cpp: Removed.
        * UIProcess/Cocoa/NavigationState.mm:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::NetworkProcessProxy):
        (WebKit::NetworkProcessProxy::websiteDataStoreFromSessionID):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/WebFramePolicyListenerProxy.cpp:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::WebPageProxy):
        (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::m_webProcessCache):
        (WebKit::WebProcessPool::ensureNetworkProcess):
        (WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess):
        (WebKit::WebProcessPool::tryTakePrewarmedProcess):
        (WebKit::WebProcessPool::processDidFinishLaunching):
        (WebKit::WebProcessPool::processForRegistrableDomain):
        (WebKit::WebProcessPool::createWebPage):
        (WebKit::WebProcessPool::mayHaveRegisteredServiceWorkers):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::defaultApplicationCacheDirectory):
        (WebKit::WebsiteDataStore::defaultCacheStorageDirectory):
        (WebKit::WebsiteDataStore::defaultNetworkCacheDirectory):
        (WebKit::WebsiteDataStore::defaultMediaCacheDirectory):
        (WebKit::WebsiteDataStore::defaultIndexedDBDatabaseDirectory):
        (WebKit::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory):
        (WebKit::WebsiteDataStore::defaultLocalStorageDirectory):
        (WebKit::WebsiteDataStore::defaultMediaKeysStorageDirectory):
        (WebKit::WebsiteDataStore::defaultWebSQLDatabaseDirectory):
        (WebKit::WebsiteDataStore::defaultResourceLoadStatisticsDirectory):
        (WebKit::WebsiteDataStore::defaultJavaScriptConfigurationDirectory):
        (WebKit::WebsiteDataStore::tempDirectoryFileSystemRepresentation):
        (WebKit::WebsiteDataStore::cacheDirectoryFileSystemRepresentation):
        (WebKit::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation):
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::globalDefaultDataStore):
        (WebKit::WebsiteDataStore::defaultDataStore):
        (WebKit::WebsiteDataStore::deleteDefaultDataStoreForTesting):
        (WebKit::WebsiteDataStore::defaultDataStoreExists):
        (WebKit::WebsiteDataStore::defaultDataStoreConfiguration):
        (WebKit::WebsiteDataStore::isAssociatedProcessPool const):
        (WebKit::WebsiteDataStore::defaultMediaCacheDirectory):
        (WebKit::WebsiteDataStore::defaultJavaScriptConfigurationDirectory):
        (WebKit::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory):
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
        * UIProcess/WebsiteData/win/WebsiteDataStoreWin.cpp:
        (WebKit::WebsiteDataStore::defaultApplicationCacheDirectory):
        (WebKit::WebsiteDataStore::defaultCacheStorageDirectory):
        (WebKit::WebsiteDataStore::defaultNetworkCacheDirectory):
        (WebKit::WebsiteDataStore::defaultIndexedDBDatabaseDirectory):
        (WebKit::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory):
        (WebKit::WebsiteDataStore::defaultLocalStorageDirectory):
        (WebKit::WebsiteDataStore::defaultMediaKeysStorageDirectory):
        (WebKit::WebsiteDataStore::defaultWebSQLDatabaseDirectory):
        (WebKit::WebsiteDataStore::defaultResourceLoadStatisticsDirectory):
        (WebKit::WebsiteDataStore::cacheDirectoryFileSystemRepresentation):
        (WebKit::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation):
        * UIProcess/glib/WebProcessProxyGLib.cpp:
        (WebKit::WebProcessProxy::platformGetLaunchOptions):
        * UIProcess/glib/WebsiteDataStoreGLib.cpp: Copied from Source/WebKit/UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp.
        (API::WebsiteDataStore::defaultApplicationCacheDirectory): Deleted.
        (API::WebsiteDataStore::defaultNetworkCacheDirectory): Deleted.
        (API::WebsiteDataStore::defaultCacheStorageDirectory): Deleted.
        (API::WebsiteDataStore::defaultIndexedDBDatabaseDirectory): Deleted.
        (API::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory): Deleted.
        (API::WebsiteDataStore::defaultLocalStorageDirectory): Deleted.
        (API::WebsiteDataStore::defaultMediaKeysStorageDirectory): Deleted.
        (API::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory): Deleted.
        (API::WebsiteDataStore::defaultWebSQLDatabaseDirectory): Deleted.
        (API::WebsiteDataStore::defaultHSTSDirectory): Deleted.
        (API::WebsiteDataStore::defaultResourceLoadStatisticsDirectory): Deleted.
        (API::WebsiteDataStore::cacheDirectoryFileSystemRepresentation): Deleted.
        (API::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation): Deleted.
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
        (WebKit::WebMediaKeyStorageManager::setWebsiteDataStore):

2019-09-20  Chris Dumez  <cdumez@apple.com>

        REGRESSION (iOS 13): rAF stops firing when navigating away cross-origin and then back
        https://bugs.webkit.org/show_bug.cgi?id=201767
        <rdar://problem/55350854>

        Reviewed by Tim Horton.

        This is a follow-up to r249961 to address crashes when navigating back cross-origin to a page
        that uses requestAnimationFrame. r249961 took care of moving RemoteLayerTreeDisplayRefreshMonitor
        objects from one RemoteLayerTreeDrawingArea to another but failed to tell those monitors
        about their new drawingArea. As a result, RemoteLayerTreeDrawingArea::willDestroyDisplayRefreshMonitor()
        would not get called on the new drawing area when it should have.

        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.h:
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm:
        (WebKit::RemoteLayerTreeDisplayRefreshMonitor::updateDrawingArea):
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
        (WebKit::RemoteLayerTreeDrawingArea::adoptDisplayRefreshMonitorsFromDrawingArea):

2019-09-20  Keith Rollin  <krollin@apple.com>

        Remove some support for < iOS 13
        https://bugs.webkit.org/show_bug.cgi?id=201967
        <rdar://problem/55504738>

        Reviewed by Andy Estes.

        Remove some support for iOS versions less than 13.0.

        Update conditionals that reference __IPHONE_OS_VERSION_MIN_REQUIRED
        and __IPHONE_OS_VERSION_MAX_ALLOWED, assuming that they both have
        values >= 130000. This means that expressions like
        "__IPHONE_OS_VERSION_MIN_REQUIRED < 101300" are always False and
        "__IPHONE_OS_VERSION_MIN_REQUIRED >= 101300" are always True.

        After version checks have been removed, there are some cases where the
        preprocessor conditional looks like "#if PLATFORM(MAC) ||
        PLATFORM(IOS_FAMILY)". These can be collapsed into "#if
        PLATFORM(COCOA)". This additional cleanup will be performed in a
        subsequent patch.

        This removal is part of a series of patches effecting the removal of
        dead code for old versions of iOS. This particular pass involves
        changes in which Andy Estes was involved. These changes are isolated
        from other similar changes in order to facilitate the reviewing
        process.

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
        * UIProcess/ios/forms/WKFileUploadPanel.mm:
        (-[WKFileUploadPanel _uploadItemFromMediaInfo:successBlock:failureBlock:]):

2019-09-20  Tim Horton  <timothy_horton@apple.com>

        Sanitize suggested filenames used for saving PDFs
        https://bugs.webkit.org/show_bug.cgi?id=202034
        <rdar://problem/53183075>

        Reviewed by Chris Dumez.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::didFinishLoadingDataForCustomContentProvider):
        (WebKit::WebPageProxy::saveDataToFileInDownloadsFolder):
        (WebKit::WebPageProxy::savePDFToFileInDownloadsFolder):
        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::savePDFToTemporaryFolderAndOpenWithNativeApplicationRaw): Deleted.
        * UIProcess/mac/WebPageProxyMac.mm:
        (WebKit::WebPageProxy::savePDFToTemporaryFolderAndOpenWithNativeApplication):
        (WebKit::WebPageProxy::savePDFToTemporaryFolderAndOpenWithNativeApplicationRaw): Deleted.
        Sanitize suggested filenames to ensure that they comprise only one path component
        when concatenated with their destination directory.

2019-09-20  Chris Dumez  <cdumez@apple.com>

        Add release logging for when a view is added / removed from a window
        https://bugs.webkit.org/show_bug.cgi?id=202050

        Reviewed by Tim Horton.

        Add release logging for when a view is added / removed from a window to help determine the
        view's visibility in the logs.

        * UIProcess/ios/WKApplicationStateTrackingView.mm:
        (-[WKApplicationStateTrackingView willMoveToWindow:]):
        (-[WKApplicationStateTrackingView didMoveToWindow]):

2019-09-20  Chris Dumez  <cdumez@apple.com>

        ApplicationStateTracker::m_isBackground initialization does not account for UIScenes
        https://bugs.webkit.org/show_bug.cgi?id=202048

        Reviewed by Geoffrey Garen.

        ApplicationStateTracker::m_isBackground initialization does not account for UIScenes, it merely checks
        the visibility state of the whole app. It should instead check the visibility state of the window's
        UIScene.

        This patch also refactors the code a little bit to reduce #ifdef'ing.

        * UIProcess/ApplicationStateTracker.mm:
        (WebKit::ApplicationStateTracker::ApplicationStateTracker):

2019-09-20  Chris Dumez  <cdumez@apple.com>

        Document no longer needs to store a SessionID
        https://bugs.webkit.org/show_bug.cgi?id=202024

        Reviewed by Geoffrey Garen.

        Document no longer needs to store a SessionID, now that we have a single
        session per WebProcess. It can simply get its sessionID from its Page.

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

2019-09-20  Chris Dumez  <cdumez@apple.com>

        [iOS] ASSERTION FAILED: Unsafe to ref/deref of ShareableBitmap from different threads
        https://bugs.webkit.org/show_bug.cgi?id=201712
        <rdar://problem/55289916>

        Reviewed by Tim Horton.

        Make sure ShareableBitmap objects are always ref'd / deref'd on the main thread by dispatching to
        the main thread in ShareableBitmap::releaseBitmapContextData() before calling deref().

        * Shared/ShareableBitmap.cpp:
        (WebKit::ShareableBitmap::ShareableBitmap):
        (WebKit::ShareableBitmap::~ShareableBitmap):
        * Shared/cg/ShareableBitmapCG.cpp:
        (WebKit::ShareableBitmap::createGraphicsContext):
        (WebKit::ShareableBitmap::releaseBitmapContextData):

2019-09-20  Alex Christensen  <achristensen@webkit.org>

        Begin moving WebsiteDataStore setters to WebsiteDataStoreConfiguration
        https://bugs.webkit.org/show_bug.cgi?id=202025

        Reviewed by Chris Dumez.

        Most of these were only needed before initNonPersistentConfiguration existed.

        * UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.cpp:
        (WKWebsiteDataStoreConfigurationGetPerOriginStorageQuota):
        (WKWebsiteDataStoreConfigurationSetPerOriginStorageQuota):
        * UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.h:
        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreSetPerOriginStorageQuota):
        * UIProcess/API/C/WKWebsiteDataStoreRef.h:
        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _initWithConfiguration:]):
        (-[WKWebsiteDataStore _perOriginStorageQuota]):
        (-[WKWebsiteDataStore _setPerOriginStorageQuota:]):
        * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
        (-[_WKWebsiteDataStoreConfiguration perOriginStorageQuota]):
        (-[_WKWebsiteDataStoreConfiguration setPerOriginStorageQuota:]):
        (-[_WKWebsiteDataStoreConfiguration boundInterfaceIdentifier]):
        (-[_WKWebsiteDataStoreConfiguration setBoundInterfaceIdentifier:]):
        (-[_WKWebsiteDataStoreConfiguration allowsCellularAccess]):
        (-[_WKWebsiteDataStoreConfiguration setAllowsCellularAccess:]):
        (-[_WKWebsiteDataStoreConfiguration proxyConfiguration]):
        (-[_WKWebsiteDataStoreConfiguration setProxyConfiguration:]):
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::parameters):
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::WebsiteDataStore):
        (WebKit::WebsiteDataStore::setSourceApplicationSecondaryIdentifier):
        (WebKit::WebsiteDataStore::setSourceApplicationBundleIdentifier):
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        (WebKit::WebsiteDataStore::setBoundInterfaceIdentifier):
        (WebKit::WebsiteDataStore::boundInterfaceIdentifier):
        (WebKit::WebsiteDataStore::sourceApplicationBundleIdentifier const):
        (WebKit::WebsiteDataStore::sourceApplicationSecondaryIdentifier const):
        (WebKit::WebsiteDataStore::setAllowsCellularAccess):
        (WebKit::WebsiteDataStore::allowsCellularAccess):
        (WebKit::WebsiteDataStore::setProxyConfiguration):
        (WebKit::WebsiteDataStore::proxyConfiguration):
        (WebKit::WebsiteDataStore::setPerOriginStorageQuota): Deleted.
        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
        (WebKit::WebsiteDataStoreConfiguration::copy):
        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
        (WebKit::WebsiteDataStoreConfiguration::boundInterfaceIdentifier const):
        (WebKit::WebsiteDataStoreConfiguration::setBoundInterfaceIdentifier):
        (WebKit::WebsiteDataStoreConfiguration::allowsCellularAccess const):
        (WebKit::WebsiteDataStoreConfiguration::setAllowsCellularAccess):
        (WebKit::WebsiteDataStoreConfiguration::proxyConfiguration const):
        (WebKit::WebsiteDataStoreConfiguration::setProxyConfiguration):

2019-09-20  Alex Christensen  <achristensen@webkit.org>

        Introduce LegacyGlobalSettings for settings the NetworkProcess needs from a WebProcessPool
        https://bugs.webkit.org/show_bug.cgi?id=201970

        Reviewed by Geoff Garen.

        I'm starting by moving the cache model to this new abstraction.
        We were using it in tests to disable the page cache, which should be done with a boolean on the pool configuration, not by changing the cache model.
        We were also using it in WKContextSetCacheModel which has several clients that won't change quickly, so this abstraction is used to maintain existing behavior.
        I need this so I can make a NetworkProcess not depend on anything from a WebProcessPool when starting.

        * Sources.txt:
        * UIProcess/API/APIProcessPoolConfiguration.cpp:
        (API::ProcessPoolConfiguration::copy):
        * UIProcess/API/APIProcessPoolConfiguration.h:
        * UIProcess/API/C/WKContext.cpp:
        (WKContextSetCacheModel):
        (WKContextGetCacheModel):
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
        (-[_WKProcessPoolConfiguration pageCacheEnabled]):
        (-[_WKProcessPoolConfiguration setPageCacheEnabled:]):
        * UIProcess/LegacyGlobalSettings.cpp: Added.
        (WebKit::LegacyGlobalSettings::singleton):
        (WebKit::LegacyGlobalSettings::setCacheModel):
        * UIProcess/LegacyGlobalSettings.h: Added.
        (WebKit::LegacyGlobalSettings::cacheModel const):
        * UIProcess/WebProcessCache.cpp:
        (WebKit::WebProcessCache::updateCapacity):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):
        (WebKit::WebProcessPool::initializeNewWebProcess):
        (WebKit::WebProcessPool::updateMaxSuspendedPageCount):
        (WebKit::WebProcessPool::setCacheModel):
        * UIProcess/WebProcessPool.h:
        * WebKit.xcodeproj/project.pbxproj:

2019-09-20  Alex Christensen  <achristensen@webkit.org>

        Deprecate unused C API aliases for WebsiteDataStore
        https://bugs.webkit.org/show_bug.cgi?id=202029

        Reviewed by Chris Dumez.

        This is a piece of r249768.

        * UIProcess/API/C/WKApplicationCacheManager.cpp:
        (WKApplicationCacheManagerGetTypeID):
        (WKApplicationCacheManagerGetApplicationCacheOrigins):
        (WKApplicationCacheManagerDeleteEntriesForOrigin):
        (WKApplicationCacheManagerDeleteAllEntries):
        * UIProcess/API/C/WKApplicationCacheManager.h:
        * UIProcess/API/C/WKKeyValueStorageManager.cpp:
        (WKKeyValueStorageManagerGetTypeID):
        (WKKeyValueStorageManagerGetOriginKey):
        (WKKeyValueStorageManagerGetCreationTimeKey):
        (WKKeyValueStorageManagerGetModificationTimeKey):
        (WKKeyValueStorageManagerGetKeyValueStorageOrigins):
        (WKKeyValueStorageManagerGetStorageDetailsByOrigin):
        (WKKeyValueStorageManagerDeleteEntriesForOrigin):
        (WKKeyValueStorageManagerDeleteAllEntries):
        * UIProcess/API/C/WKKeyValueStorageManager.h:
        * UIProcess/API/C/WKResourceCacheManager.cpp:
        (WKResourceCacheManagerGetTypeID):
        (WKResourceCacheManagerGetCacheOrigins):
        (WKResourceCacheManagerClearCacheForOrigin):
        (WKResourceCacheManagerClearCacheForAllOrigins):
        (toWebsiteDataTypes): Deleted.
        * UIProcess/API/C/WKResourceCacheManager.h:

2019-09-20  Alex Christensen  <achristensen@webkit.org>

        Remove functionality to disable TLS fallback
        https://bugs.webkit.org/show_bug.cgi?id=201998

        Reviewed by Geoff Garen.

        Since r249019 it is not used.  It was a useful experiment and I'm glad we didn't see any regressions.

        * NetworkProcess/NetworkSessionCreationParameters.cpp:
        (WebKit::NetworkSessionCreationParameters::privateSessionParameters):
        (WebKit::NetworkSessionCreationParameters::encode const):
        (WebKit::NetworkSessionCreationParameters::decode):
        * NetworkProcess/NetworkSessionCreationParameters.h:
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _setAllowsTLSFallback:]):
        (-[WKWebsiteDataStore _allowsTLSFallback]):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::parameters):
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::setAllowsTLSFallback): Deleted.
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        (WebKit::WebsiteDataStore::allowsTLSFallback const): Deleted.

2019-09-20  Alex Christensen  <achristensen@webkit.org>

        Remove unused storage paths on APIProcessPoolConfiguration
        https://bugs.webkit.org/show_bug.cgi?id=202028

        Reviewed by Chris Dumez.

        This is a piece of r249768.
        There is no way to set these paths and they have been replaced by WebsiteDataStore paths.
        There was one remaining use of the global disk cache directory in NetworkProcess::setCacheModel,
        which I replaced with the default session's disk cache directory, which is equivalent.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::setCacheModel):
        * NetworkProcess/NetworkProcess.h:
        (WebKit::NetworkProcess::diskCacheDirectory const): Deleted.
        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
        (WebKit::NetworkProcessCreationParameters::decode):
        (WebKit::NetworkProcessCreationParameters::NetworkProcessCreationParameters): Deleted.
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::NetworkSession):
        * NetworkProcess/cache/NetworkCache.cpp:
        (WebKit::NetworkCache::Cache::open):
        (WebKit::NetworkCache::Cache::Cache):
        * NetworkProcess/cache/NetworkCache.h:
        (WebKit::NetworkCache::Cache::storageDirectory):
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
        * UIProcess/API/APIProcessPoolConfiguration.cpp:
        (API::ProcessPoolConfiguration::copy):
        (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration): Deleted.
        (API::ProcessPoolConfiguration::ProcessPoolConfiguration): Deleted.
        (API::ProcessPoolConfiguration::~ProcessPoolConfiguration): Deleted.
        * UIProcess/API/APIProcessPoolConfiguration.h:
        * UIProcess/API/glib/WebKitWebContext.cpp:
        (webkitWebContextConstructed):
        (webkit_web_context_set_disk_cache_directory):
        (websiteDataStoreConfigurationForWebProcessPoolConfiguration): Deleted.
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):
        (WebKit::WebProcessPool::resolvePathsForSandboxExtensions):
        (WebKit::WebProcessPool::webProcessDataStoreParameters):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::processPools const):
        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:

2019-09-20  Keith Rollin  <krollin@apple.com>

        Remove some support for < iOS 13
        https://bugs.webkit.org/show_bug.cgi?id=202032
        <rdar://problem/55548468>

        Reviewed by Alex Christensen.

        Remove some support for iOS versions less than 13.0.

        Update conditionals that reference __IPHONE_OS_VERSION_MIN_REQUIRED
        and __IPHONE_OS_VERSION_MAX_ALLOWED, assuming that they both have
        values >= 130000. This means that expressions like
        "__IPHONE_OS_VERSION_MIN_REQUIRED < 101300" are always False and
        "__IPHONE_OS_VERSION_MIN_REQUIRED >= 101300" are always True.

        This removal is part of a series of patches effecting the removal of
        dead code for old versions of iOS. This particular pass involves
        changes in which Dan Bates was involved. These changes are isolated
        from other similar changes in order to facilitate the reviewing
        process.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _interpretKeyEvent:isCharEvent:]):

2019-09-20  Keith Rollin  <krollin@apple.com>

        Remove some support for < iOS 13
        https://bugs.webkit.org/show_bug.cgi?id=201973
        <rdar://problem/55506966>

        Reviewed by Alex Christensen.

        Remove some support for iOS versions less than 13.0.

        Update conditionals that reference __IPHONE_OS_VERSION_MIN_REQUIRED
        and __IPHONE_OS_VERSION_MAX_ALLOWED, assuming that they both have
        values >= 130000. This means that expressions like
        "__IPHONE_OS_VERSION_MIN_REQUIRED < 101300" are always False and
        "__IPHONE_OS_VERSION_MIN_REQUIRED >= 101300" are always True.

        This removal is part of a series of patches effecting the removal of
        dead code for old versions of iOS. This particular pass involves
        changes in which Chris Dumez was involved. These changes are isolated
        from other similar changes in order to facilitate the reviewing
        process.

        * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
        (WebKit::Download::resume):

2019-09-20  Chris Dumez  <cdumez@apple.com>

        Unreviewed, fix confusing release logging under WebPageProxy::loadRequestWithNavigationShared().

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

2019-09-20  Chris Dumez  <cdumez@apple.com>

        Regression(r248832): Unable to quicklook HTML files in Mail
        https://bugs.webkit.org/show_bug.cgi?id=202012
        <rdar://problem/55285295>

        Reviewed by Per Arne Vollan.

        Follow-up to fix bug in r250110. Now that loadFile() calls
        maybeInitializeSandboxExtensionHandle(), it no longer needs to
        call assumeReadAccessToBaseURL(). This is because maybeInitializeSandboxExtensionHandle()
        already take care of it.

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

2019-09-20  Joonghun Park  <pjh0718@gmail.com>

        Unreviewed. Remove duplicated HashMap iteration since r248734.

        ASSERT statement already exists for |storageNamespaceID|,
        so |HashMap.get| for the parameter is not needed.

        * NetworkProcess/WebStorage/StorageManager.cpp:
        (WebKit::StorageManager::destroySessionStorageNamespace):

2019-09-20  Joonghun Park  <pjh0718@gmail.com>

        Unreviewed. Fix Build warning below since r248734.

        warning: unused variable ‘foo’ [-Wunused-variable]

        * NetworkProcess/WebStorage/StorageManager.cpp:
        (WebKit::StorageManager::destroySessionStorageNamespace):
        * NetworkProcess/WebStorage/StorageManagerSet.cpp:
        (WebKit::StorageManagerSet::add):
        (WebKit::StorageManagerSet::waitUntilTasksFinished):

2019-09-19  Brent Fulgham  <bfulgham@apple.com>

        [FTW, WinCairo] Support running tests in Release mode
        https://bugs.webkit.org/show_bug.cgi?id=202021

        Reviewed by Don Olmstead.

        In Bug 201597, we added new features to better lock down JSC features in the
        potentially untrusted WebContent process.

        Unfortunately, this change included XPC Dictionary items used at startup to
        lock down JSC features before entering the main execution of the process. These
        changes were not done for the WinCairo or FTW ports.

        We need to pass the state of the JIT and whether to enable certain JSC features
        at process launch. Since the XPC mechanisms we use on macOS and iOS do not exist
        on Windows, I am implementing them as command-line flags.

            -configure-jsc-for-testing: Sets the JSC in testing mode.
            -disable-jit: Disables the JIT.

        See r249808 for the equivalent changes on macOS and iOS.

        * PlatformFTW.cmake: Add some missing header files needed when building tests.
        * Shared/win/AuxiliaryProcessMainWin.cpp:
        (WebKit::AuxiliaryProcessMainBase::parseCommandLine):
        * UIProcess/Launcher/win/ProcessLauncherWin.cpp:
        (WebKit::ProcessLauncher::launchProcess):

2019-09-19  Chris Dumez  <cdumez@apple.com>

        Add better logging for when the view visibility state changes
        https://bugs.webkit.org/show_bug.cgi?id=202008

        Reviewed by Geoffrey Garen.

        * UIProcess/ApplicationStateTracker.mm:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::updateActivityState):
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::applicationDidEnterBackground):
        (WebKit::WebPageProxy::applicationWillEnterForeground):

2019-09-19  Chris Dumez  <cdumez@apple.com>

        Regression(r248832): Unable to quicklook HTML files in Mail
        https://bugs.webkit.org/show_bug.cgi?id=202012
        <rdar://problem/55285295>

        Reviewed by Geoff Garen and Brent Fulgham.

        r248832 inadvertently reverted the fix for Mail that landed in r247400 by not using
        the same logic to initialize the sandbox extension if the process had already
        finished launching or not. In particular, the new code path that happens on process
        launch unconditionally used '/' as resource directory for the sandbox extension if
        the client did not provide one. The logic in maybeInitializeSandboxExtensionHandle()
        would use the file URL's base URL as resource directory when creating a sandbox
        extension for '/' would fail (which it often does).

        To address the issue, have the logic that runs on process launch call
        maybeInitializeSandboxExtensionHandle() so avoid duplicating code and make sure
        both cases now have the Mail fix.

        * UIProcess/AuxiliaryProcessProxy.cpp:
        (WebKit::AuxiliaryProcessProxy::didFinishLaunching):
        * UIProcess/AuxiliaryProcessProxy.h:
        (WebKit::AuxiliaryProcessProxy::isLaunching const):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
        (WebKit::WebPageProxy::loadRequestWithNavigationShared):
        (WebKit::WebPageProxy::loadFile):
        * UIProcess/WebPageProxy.h:
        * WebProcess/WebPage/WebPage.messages.in:

2019-09-19  Tim Horton  <timothy_horton@apple.com>

        macCatalyst apps crash under TextCheckingControllerProxy::replaceRelativeToSelection when spell checking
        https://bugs.webkit.org/show_bug.cgi?id=202010
        <rdar://problem/54974971>

        Reviewed by Beth Dakin.

        * WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.mm:
        (WebKit::TextCheckingControllerProxy::replaceRelativeToSelection):
        relativeReplacementRange is in the coordinate space of the document's text,
        not the replacement string. We need to adjust into replacement string
        coordinates before slicing the replacement, or we'll throw an exception
        trying to read past the end of the string, in the case where the
        replacement string is shorter than the replaced string (by more than 2 characters).

2019-09-19  Yury Semikhatsky  <yurys@chromium.org>

        WebStorageNamespaceProvider / StorageNamespaceImpl no longer need SessionIDs
        https://bugs.webkit.org/show_bug.cgi?id=201922
        <rdar://problem/55505906>

        Reviewed by Chris Dumez.

        Fix GTK Debug compilation after https://trac.webkit.org/changeset/250083:
        ../../Source/WebKit/WebProcess/WebStorage/WebStorageNamespaceProvider.cpp:75:55: error: no member named 'singleton' in namespace 'WebCore::Process'
        ASSERT_UNUSED(sessionID, sessionID == WebProcess::singleton().sessionID());
                                          ~~~~~~~~~~~~^

        * WebProcess/WebStorage/WebStorageNamespaceProvider.cpp:

2019-09-19  Chris Dumez  <cdumez@apple.com>

        WorkerGlobalScope does not need a SessionID
        https://bugs.webkit.org/show_bug.cgi?id=201991

        Reviewed by Alex Christensen.

        WorkerGlobalScope does not need a SessionID, now that we have a single session
        per WebProcess.

        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        (WebKit::WebSWContextManagerConnection::installServiceWorker):
        * WebProcess/Storage/WebServiceWorkerProvider.cpp:
        (WebKit::WebServiceWorkerProvider::serviceWorkerConnection):
        (WebKit::WebServiceWorkerProvider::existingServiceWorkerConnection):
        (WebKit::WebServiceWorkerProvider::serviceWorkerConnectionForSession): Deleted.
        (WebKit::WebServiceWorkerProvider::existingServiceWorkerConnectionForSession): Deleted.
        * WebProcess/Storage/WebServiceWorkerProvider.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::updateThrottleState):

2019-09-19  Brent Fulgham  <bfulgham@apple.com>

        Create InjectedBundle SPI to better support NSSecureCoding
        https://bugs.webkit.org/show_bug.cgi?id=201810
        <rdar://problem/55265713>

        The encoding/decoding routines used by WebKit’s InjectedBundles are based on NSCoding.
        While we have changed WebKit internals to use NSSecureCoding, there are a number of
        injected bundles that need to serialize custom classes between the InjectedBundle and
        the relevant WebKit UIProcess.

        We need to lock down this communications channel by enforcing NSSecureCoding.

        This patch creates new SPI to allow the UIProcess to specify classes that it will accept
        in messages from the WebContet Process (and Injected Bundle).

        It adds the following property to the WKProcessPoolConfiguration:

            @property (nonatomic, copy) NSSet<Class> *customClassesForParameterCoder;

        If no custom classes are specified, the standard serialization primitives are supported:
            NSArray, NSData, NSDate, NSDictionary, NSNull, NSNumber, NSSet, NSString,
            NSTimeZone, NSURL, and NSUUID.

        Reviewed by Brady Eidson.

        * UIProcess/API/APIProcessPoolConfiguration.cpp:
        (API::ProcessPoolConfiguration::copy): Copy any custom classes.
        * UIProcess/API/APIProcessPoolConfiguration.h:
        * UIProcess/API/C/WKContextConfigurationRef.cpp:
        (WKContextConfigurationCopyCustomClassesForParameterCoder): Added.
        (WKContextConfigurationSetCustomClassesForParameterCoder): Added.
        * UIProcess/API/C/WKContextConfigurationRef.h:
        * UIProcess/API/Cocoa/WKProcessGroup.h:
        * UIProcess/API/Cocoa/WKProcessGroup.mm:
        (toStringVector): Added.
        (-[WKProcessGroup initWithInjectedBundleURL:andCustomClassesForParameterCoder:]):
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _setInputDelegate:]): Restrict serialization to allowed classes.
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
        (-[_WKProcessPoolConfiguration customClassesForParameterCoder]): Added.
        (-[_WKProcessPoolConfiguration setCustomClassesForParameterCoder:]): Added.
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitialize): Register any custom classes
        provided in the configuraton.
        (WebKit::WebProcessPool::initializeClassesForParameterCoding): Added.
        (WebKit::WebProcessPool::allowedClassesForParameterCoding const): Added.
        * UIProcess/WebProcessPool.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::elementDidFocus): Restrict serialization to allowed
        classes only.

2019-09-18  Chris Dumez  <cdumez@apple.com>

        AddPlugInAutoStartOriginHash / PlugInDidReceiveUserInteraction IPC should not need to pass a SessionID
        https://bugs.webkit.org/show_bug.cgi?id=201962

        Reviewed by Geoffrey Garen.

        AddPlugInAutoStartOriginHash / PlugInDidReceiveUserInteraction IPC from the WebProcess to the UIProcess
        should not need to pass a SessionID, since the UIProcess already knows the SessionID of a given WebProcess.

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::addPlugInAutoStartOriginHash): Deleted.
        (WebKit::WebProcessPool::plugInDidReceiveUserInteraction): Deleted.
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebProcessPool.messages.in:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::addPlugInAutoStartOriginHash):
        (WebKit::WebProcessProxy::plugInDidReceiveUserInteraction):
        * UIProcess/WebProcessProxy.h:
        * UIProcess/WebProcessProxy.messages.in:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::plugInDidStartFromOrigin):
        (WebKit::WebProcess::plugInDidReceiveUserInteraction):

2019-09-18  Chris Dumez  <cdumez@apple.com>

        WebStorageNamespaceProvider / StorageNamespaceImpl no longer need SessionIDs
        https://bugs.webkit.org/show_bug.cgi?id=201922

        Reviewed by Geoffrey Garen.

        WebStorageNamespaceProvider / StorageNamespaceImpl no longer need SessionIDs, now that
        we have a single session per WebProcess.

        * WebProcess/WebStorage/StorageAreaMap.cpp:
        (WebKit::StorageAreaMap::connect):
        * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
        (WebKit::StorageNamespaceImpl::createSessionStorageNamespace):
        (WebKit::StorageNamespaceImpl::createLocalStorageNamespace):
        (WebKit::StorageNamespaceImpl::createTransientLocalStorageNamespace):
        (WebKit::StorageNamespaceImpl::StorageNamespaceImpl):
        (WebKit::StorageNamespaceImpl::sessionID const):
        (WebKit::StorageNamespaceImpl::copy):
        * WebProcess/WebStorage/StorageNamespaceImpl.h:
        (): Deleted.
        * WebProcess/WebStorage/WebStorageNamespaceProvider.cpp:
        (WebKit::WebStorageNamespaceProvider::createSessionStorageNamespace):
        (WebKit::WebStorageNamespaceProvider::createLocalStorageNamespace):
        (WebKit::WebStorageNamespaceProvider::createTransientLocalStorageNamespace):

2019-09-18  Chris Dumez  <cdumez@apple.com>

        Decrease use of sessionID in WebLoaderStrategy
        https://bugs.webkit.org/show_bug.cgi?id=201961

        Reviewed by Geoffrey Garen.

        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::loadResource):
        (WebKit::WebLoaderStrategy::scheduleLoad):
        (WebKit::WebLoaderStrategy::tryLoadingUsingURLSchemeHandler):
        (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
        (WebKit::WebLoaderStrategy::loadResourceSynchronously):
        * WebProcess/Network/WebLoaderStrategy.h:

2019-09-18  Chris Dumez  <cdumez@apple.com>

        WebSocketStream does not need a SessionID
        https://bugs.webkit.org/show_bug.cgi?id=201960

        Reviewed by Geoffrey Garen.

        WebSocketStream does not need a SessionID, now that we have a single session per WebProcess.

        * WebProcess/Network/WebSocketProvider.cpp:
        (WebKit::WebSocketProvider::createSocketStreamHandle):
        * WebProcess/Network/WebSocketStream.cpp:
        (WebKit::WebSocketStream::create):
        (WebKit::WebSocketStream::WebSocketStream):
        * WebProcess/Network/WebSocketStream.h:

2019-09-18  Chris Dumez  <cdumez@apple.com>

        LibWebRTCProvider does not need sessionIDs anymore
        https://bugs.webkit.org/show_bug.cgi?id=201959

        Reviewed by Geoffrey Garen.

        LibWebRTCProvider does not need sessionIDs anymore, now that we have a single session per WebProcess.

        * WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
        (WebKit::LibWebRTCProvider::registerMDNSName):
        (WebKit::LibWebRTCProvider::createSocketFactory):
        * WebProcess/Network/webrtc/LibWebRTCProvider.h:

2019-09-18  Yury Semikhatsky  <yurys@chromium.org>

        [GTK] Compilation errors when GL is disabled
        https://bugs.webkit.org/show_bug.cgi?id=200223

        Fix following compilation error when building with ENABLE_OPENGL=OFF
        ../../Source/WebKit/UIProcess/glib/WebProcessPoolGLib.cpp:123:51: error: use of undeclared identifier 'WaylandCompositor'
        parameters.waylandCompositorDisplayName = WaylandCompositor::singleton().displayName();
                                                  ^
        Reviewed by Philippe Normand.

        * UIProcess/glib/WebProcessPoolGLib.cpp:
        (WebKit::WebProcessPool::platformInitializeWebProcess): only make a call when using EGL, this matches
        guards in WaylandCompositor.h. The condition was changed in r245807.

2019-09-18  Timothy Hatcher  <timothy@apple.com>

        Eagerly create and add the m_layerHostingView to WKWebView.
        https://bugs.webkit.org/show_bug.cgi?id=201942

        Reviewed by Tim Horton.

        Some apps will add subviews to WKWebView, and by the time we add our m_layerHostingView view we might be
        adding it behind a view that should have been added behind our layer hosting view subview. This affected
        the Spark email app, due to changes in order of loading delegate calls and when compositing is enabled.
        Instead of delayed creation of m_layerHostingView, always create it and add it to to the WKWebView.
        This ensures proper ordering of subviews when clients add a view behind all existing subviews.

        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::WebViewImpl): Create and add m_layerHostingView here.
        (WebKit::WebViewImpl::setAcceleratedCompositingRootLayer): Remove creation and removal of m_layerHostingView.
        Just set the sublayers of m_layerHostingView's layer here.

2019-09-18  Joseph Pecoraro  <pecoraro@apple.com>

        Web Inspector: Can't drag undocked Inspector window by its title text
        https://bugs.webkit.org/show_bug.cgi?id=190886
        <rdar://problem/44574547>

        Reviewed by Tim Horton.

        * UIProcess/mac/WKInspectorWKWebView.mm:
        (-[WKInspectorWKWebView _opaqueRectForWindowMoveWhenInTitlebar]):
        Legendary.

2019-09-18  Chris Dumez  <cdumez@apple.com>

        BlobRegistry no longer needs SessionIDs
        https://bugs.webkit.org/show_bug.cgi?id=201936

        Reviewed by Geoffrey Garen.

        BlobRegistry no longer needs SessionIDs, now that we have a single session per WebProcess.

        * NetworkProcess/NetworkProcessPlatformStrategies.cpp:
        (WebKit::NetworkProcessPlatformStrategies::createBlobRegistry):
        * WebProcess/FileAPI/BlobRegistryProxy.cpp:
        (WebKit::BlobRegistryProxy::registerFileBlobURL):
        (WebKit::BlobRegistryProxy::registerBlobURL):
        (WebKit::BlobRegistryProxy::registerBlobURLOptionallyFileBacked):
        (WebKit::BlobRegistryProxy::unregisterBlobURL):
        (WebKit::BlobRegistryProxy::registerBlobURLForSlice):
        (WebKit::BlobRegistryProxy::writeBlobsToTemporaryFiles):
        * WebProcess/FileAPI/BlobRegistryProxy.h:

2019-09-18  Benjamin Nham  <nham@apple.com>

        NetworkLoadParameters shouldn't store sessionID
        https://bugs.webkit.org/show_bug.cgi?id=201921

        Reviewed by Chris Dumez.

        Now that there's a single session id per WebProcess, we don't need to
        store the session id in NetworkLoadParameters anymore. Clients can just
        directly ask NetworkConnectionToWebProcess for the WebProcess's session
        ID instead.

        * NetworkProcess/AdClickAttributionManager.cpp:
        (WebKit::AdClickAttributionManager::fireConversionRequest):
        * NetworkProcess/Downloads/DownloadManager.cpp:
        (WebKit::DownloadManager::startDownload):
        * NetworkProcess/NetworkCORSPreflightChecker.cpp:
        (WebKit::NetworkCORSPreflightChecker::startPreflight):
        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::preconnectTo):
        * NetworkProcess/NetworkLoadParameters.h:
        * NetworkProcess/NetworkResourceLoadMap.h:
        * NetworkProcess/NetworkResourceLoadParameters.cpp:
        (WebKit::NetworkResourceLoadParameters::encode const):
        (WebKit::NetworkResourceLoadParameters::decode):
        * NetworkProcess/NetworkResourceLoadParameters.h:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::m_shouldCaptureExtraNetworkLoadMetrics):
        (WebKit::NetworkResourceLoader::startNetworkLoad):
        (WebKit::NetworkResourceLoader::convertToDownload):
        * NetworkProcess/NetworkResourceLoader.h:
        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::NetworkSession):
        * NetworkProcess/PingLoad.cpp:
        (WebKit::PingLoad::PingLoad):
        (WebKit::PingLoad::loadRequest):
        (WebKit::PingLoad::didReceiveChallenge):
        * NetworkProcess/PingLoad.h:
        * NetworkProcess/PreconnectTask.cpp:
        (WebKit::PreconnectTask::PreconnectTask):
        * NetworkProcess/PreconnectTask.h:
        * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
        (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
        (WebKit::WebLoaderStrategy::loadResourceSynchronously):
        (WebKit::WebLoaderStrategy::startPingLoad):
        (WebKit::WebLoaderStrategy::preconnectTo):

2019-09-18  Andy Estes  <aestes@apple.com>

        [Apple Pay] Tell websites why a session was cancelled
        https://bugs.webkit.org/show_bug.cgi?id=201912
        <rdar://problem/55469706>

        Reviewed by Brady Eidson.

        Remembered the error passed to -[WKPaymentAuthorizationDelegate _willFinishWithError:] and
        sent it to the WebContent process in Messages::WebPaymentCoordinator::DidCancelPaymentSession.

        * Platform/cocoa/PaymentAuthorizationPresenter.h:
        * Platform/cocoa/WKPaymentAuthorizationDelegate.mm:
        (-[WKPaymentAuthorizationDelegate _didFinish]):
        (-[WKPaymentAuthorizationDelegate _willFinishWithError:]):
        * Shared/ApplePay/WebPaymentCoordinatorProxy.cpp:
        (WebKit::WebPaymentCoordinatorProxy::didCancelPaymentSession):
        (WebKit::WebPaymentCoordinatorProxy::presenterDidFinish):
        * Shared/ApplePay/WebPaymentCoordinatorProxy.h:
        (WebKit::WebPaymentCoordinatorProxy::didCancelPaymentSession):
        * Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
        * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
        (IPC::ArgumentCoder<WebCore::PaymentSessionError>::encode):
        (IPC::ArgumentCoder<WebCore::PaymentSessionError>::decode):
        * Shared/WebCoreArgumentCoders.h:
        * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
        (WebKit::WebPaymentCoordinator::networkProcessConnectionClosed):
        (WebKit::WebPaymentCoordinator::didCancelPaymentSession):
        * WebProcess/ApplePay/WebPaymentCoordinator.h:
        * WebProcess/ApplePay/WebPaymentCoordinator.messages.in:

2019-09-18  Chris Dumez  <cdumez@apple.com>

        WebSWContextManagerConnection::installServiceWorker IPC no longer need a sessionID
        https://bugs.webkit.org/show_bug.cgi?id=201882

        Reviewed by Geoffrey Garen.

        WebSWContextManagerConnection::installServiceWorker IPC no longer need a sessionID now that we have a single
        sessionID per WebProcess.

        * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
        (WebKit::WebSWServerToContextConnection::installServiceWorkerContext):
        * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        (WebKit::ServiceWorkerFrameLoaderClient::ServiceWorkerFrameLoaderClient):
        (WebKit::ServiceWorkerFrameLoaderClient::sessionID const):
        (WebKit::WebSWContextManagerConnection::WebSWContextManagerConnection):
        (WebKit::WebSWContextManagerConnection::installServiceWorker):
        * WebProcess/Storage/WebSWContextManagerConnection.h:
        * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::establishWorkerContextConnectionToNetworkProcess):

2019-09-18  Chris Dumez  <cdumez@apple.com>

        Stop passing sessionIDs to NetworkProcessConnection methods
        https://bugs.webkit.org/show_bug.cgi?id=201886

        Reviewed by Geoffrey Garen.

        Stop passing sessionIDs to NetworkProcessConnection methods. This is no longer
        necessary now that we have a single session per WebProcess.

        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::tryStoreAsCacheEntry):
        * WebProcess/Databases/WebDatabaseProvider.cpp:
        (WebKit::WebDatabaseProvider::idbConnectionToServerForSession):
        * WebProcess/FileAPI/BlobRegistryProxy.cpp:
        (WebKit::BlobRegistryProxy::writeBlobsToTemporaryFiles):
        * WebProcess/Network/NetworkProcessConnection.cpp:
        (WebKit::NetworkProcessConnection::writeBlobsToTemporaryFiles):
        (WebKit::NetworkProcessConnection::didCacheResource):
        (WebKit::NetworkProcessConnection::idbConnectionToServer):
        (WebKit::NetworkProcessConnection::idbConnectionToServerForSession): Deleted.
        * WebProcess/Network/NetworkProcessConnection.h:
        * WebProcess/Network/NetworkProcessConnection.messages.in:

2019-09-18  Chris Dumez  <cdumez@apple.com>

        CacheStorageProvider::createCacheStorageConnection() does not need to take in a SessionID
        https://bugs.webkit.org/show_bug.cgi?id=201920

        Reviewed by Geoffrey Garen.

        CacheStorageProvider::createCacheStorageConnection() does not need to take in a SessionID.
        This sessionID is no longer used now that we have a session per WebProcess.

        * NetworkProcess/NetworkProcessPlatformStrategies.cpp:
        (WebKit::NetworkProcessPlatformStrategies::createBlobRegistry):
        * WebProcess/Cache/WebCacheStorageConnection.cpp:
        (WebKit::WebCacheStorageConnection::sessionID const): Deleted.
        * WebProcess/Cache/WebCacheStorageConnection.h:
        * WebProcess/Cache/WebCacheStorageProvider.cpp:
        (WebKit::WebCacheStorageProvider::createCacheStorageConnection):
        * WebProcess/Cache/WebCacheStorageProvider.h:
        * WebProcess/FileAPI/BlobRegistryProxy.cpp:
        (WebKit::BlobRegistryProxy::blobSize):
        * WebProcess/FileAPI/BlobRegistryProxy.h:

2019-09-18  Chris Dumez  <cdumez@apple.com>

        Drop FrameLoaderClient::sessionID()
        https://bugs.webkit.org/show_bug.cgi?id=201916

        Reviewed by Geoffrey Garen.

        Drop FrameLoaderClient::sessionID(). The Frame can get the sessionID from its page (Which is
        what the FrameLoaderClient::sessionID() ended up doing) and other call sites at WebKit2 layer
        can get the sessionID from the WebProcess singleton.

        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::scheduleLoad):
        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        (WebKit::ServiceWorkerFrameLoaderClient::ServiceWorkerFrameLoaderClient):
        (WebKit::WebSWContextManagerConnection::installServiceWorker):
        * WebProcess/Storage/WebSWContextManagerConnection.h:
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:

2019-09-18  Chris Dumez  <cdumez@apple.com>

        WebServiceWorkerProvider::handleFetch() does not need to take in a sessionID
        https://bugs.webkit.org/show_bug.cgi?id=201917

        Reviewed by Geoffrey Garen.

        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::scheduleLoad):
        * WebProcess/Storage/WebServiceWorkerProvider.cpp:
        (WebKit::WebServiceWorkerProvider::handleFetch):
        * WebProcess/Storage/WebServiceWorkerProvider.h:

2019-09-18  Chris Dumez  <cdumez@apple.com>

        WebSWServerToContextConnection::PostMessageToServiceWorkerClient IPC no longer needs to take a sessionID
        https://bugs.webkit.org/show_bug.cgi?id=201883

        Reviewed by Geoffrey Garen.

        WebSWServerToContextConnection::PostMessageToServiceWorkerClient IPC no longer needs to take a sessionID,
        now that we have a single session per WebProcess.

        * NetworkProcess/NetworkProcess.cpp:
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
        (WebKit::WebSWServerToContextConnection::postMessageToServiceWorkerClient):
        * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
        * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerClient):
        * WebProcess/Storage/WebSWContextManagerConnection.h:

2019-09-18  Carlos Alberto Lopez Perez  <clopez@igalia.com>

        [GTK][WPE] bubblewrap sandbox should be disabled when running inside docker
        https://bugs.webkit.org/show_bug.cgi?id=201914

        Reviewed by Michael Catanzaro.

        Detect if running inside Docker by checking the file /.dockerenv
        In that case, disable the sandbox.

        * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
        (WebKit::isInsideDocker):
        (WebKit::ProcessLauncher::launchProcess):

2019-09-17  Ross Kirsling  <ross.kirsling@sony.com>

        Unreviewed WinCairo build fix following r249985.

        * Shared/WebProcessDataStoreParameters.h:

2019-09-17  Dean Jackson  <dino@apple.com>

        Remove the "Show Link Previews" and "Hide Link Previews" action menus in the preview platter
        https://bugs.webkit.org/show_bug.cgi?id=201864
        <rdar://55190038>

        Reviewed by Simon Fraser.

        * UIProcess/ios/WKActionSheetAssistant.mm: Remove the toggle action from the
        default values.
        (-[WKActionSheetAssistant defaultActionsForLinkSheet:]):
        * UIProcess/ios/WKContentViewInteraction.mm: No longer try to add a toggle when
        it isn't there.
        (-[WKContentView assignLegacyDataForContextMenuInteraction]):
        (menuWithShowLinkPreviewAction): Deleted.

2019-09-17  Chris Dumez  <cdumez@apple.com>

        Stop calling Page::setSessionID() from WebKit2
        https://bugs.webkit.org/show_bug.cgi?id=201888

        Reviewed by Alex Christensen.

        Stop calling Page::setSessionID() from WebKit2 since Page's sessionID can never change when
        using WebKit2 (We process-swap and create a new Page in a new process when changing data
        store). Instead, we now pass the sessionID ID when constructing the Page, as part of the
        PageConfiguration structure.

        * Shared/WebsitePoliciesData.cpp:
        (WebKit::WebsitePoliciesData::applyToDocumentLoader):
        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        (WebKit::WebSWContextManagerConnection::installServiceWorker):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_textAutoSizingAdjustmentTimer):
        (WebKit::WebPage::setSessionID): Deleted.
        * WebProcess/WebPage/WebPage.h:

2019-09-17  Mark Lam  <mark.lam@apple.com>

        Use constexpr instead of const in symbol definitions that are obviously constexpr.
        https://bugs.webkit.org/show_bug.cgi?id=201879

        Rubber-stamped by Joseph Pecoraro.

        * WebProcess/Plugins/Netscape/JSNPObject.h:

2019-09-17  Ross Kirsling  <ross.kirsling@sony.com>

        Unreviewed restabilization of non-unified build.

        * UIProcess/WebProcessProxy.cpp:
        * WebProcess/Network/WebLoaderStrategy.cpp:
        * WebProcess/WebCoreSupport/WebResourceLoadObserver.cpp:

2019-09-17  Chris Dumez  <cdumez@apple.com>

        WebProcess class methods should not need to take a sessionID
        https://bugs.webkit.org/show_bug.cgi?id=201881

        Reviewed by Geoffrey Garen.

        WebProcess class methods should not need to take a sessionID given that we have a single
        session per WebProcess now.

        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const):
        (WebKit::WebProcessCreationParameters::decode):
        * Shared/WebProcessCreationParameters.h:
        * Shared/WebProcessDataStoreParameters.h:
        (WebKit::WebProcessDataStoreParameters::encode const):
        (WebKit::WebProcessDataStoreParameters::decode):
        * UIProcess/Plugins/PlugInAutoStartProvider.cpp:
        (WebKit::PlugInAutoStartProvider::addAutoStartOriginHash):
        (WebKit::PlugInAutoStartProvider::autoStartOriginHashesCopy const):
        (WebKit::PlugInAutoStartProvider::setAutoStartOriginsTableWithItemsPassingTest):
        (WebKit::PlugInAutoStartProvider::didReceiveUserInteraction):
        * UIProcess/Plugins/PlugInAutoStartProvider.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::webProcessDataStoreParameters):
        (WebKit::WebProcessPool::initializeNewWebProcess):
        * UIProcess/WebProcessPool.h:
        (WebKit::WebProcessPool::sendToAllProcesses):
        (WebKit::WebProcessPool::sendToAllProcessesForSession):
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::fetchWebsiteData):
        (WebKit::WebProcessProxy::deleteWebsiteData):
        (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins):
        (WebKit::WebProcessProxy::establishServiceWorkerContext):
        * WebProcess/Plugins/PluginView.cpp:
        (WebKit::PluginView::pluginDidReceiveUserInteraction):
        * WebProcess/WebCoreSupport/WebPlugInClient.cpp:
        (WebKit::WebPlugInClient::didStartFromOrigin):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::close):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::initializeWebProcess):
        (WebKit::WebProcess::setWebsiteDataStoreParameters):
        (WebKit::WebProcess::removeWebPage):
        (WebKit::WebProcess::isPlugInAutoStartOriginHash):
        (WebKit::WebProcess::shouldPlugInAutoStartFromOrigin):
        (WebKit::WebProcess::plugInDidStartFromOrigin):
        (WebKit::WebProcess::didAddPlugInAutoStartOriginHash):
        (WebKit::WebProcess::resetPlugInAutoStartOriginHashes):
        (WebKit::WebProcess::plugInDidReceiveUserInteraction):
        (WebKit::WebProcess::fetchWebsiteData):
        (WebKit::WebProcess::deleteWebsiteData):
        (WebKit::WebProcess::deleteWebsiteDataForOrigins):
        (WebKit::WebProcess::establishWorkerContextConnectionToNetworkProcess):
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:

2019-09-17  Chris Dumez  <cdumez@apple.com>

        WebMDNSRegister no longer needs to be provided sessionIDs
        https://bugs.webkit.org/show_bug.cgi?id=201876

        Reviewed by Geoffrey Garen.

        WebMDNSRegister no longer needs to be provided sessionIDs, now that we
        have one session per WebProcess.

        * NetworkProcess/webrtc/NetworkMDNSRegister.cpp:
        (WebKit::NetworkMDNSRegister::registerMDNSName):
        (WebKit::NetworkMDNSRegister::sessionID const):
        * NetworkProcess/webrtc/NetworkMDNSRegister.h:
        * NetworkProcess/webrtc/NetworkMDNSRegister.messages.in:
        * WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
        (WebKit::LibWebRTCProvider::registerMDNSName):
        (WebKit::LibWebRTCProvider::createSocketFactory):
        * WebProcess/Network/webrtc/WebMDNSRegister.cpp:
        (WebKit::WebMDNSRegister::registerMDNSName):
        * WebProcess/Network/webrtc/WebMDNSRegister.h:

2019-09-17  Chris Dumez  <cdumez@apple.com>

        WebSWServerConnection does not need to store a sessionID
        https://bugs.webkit.org/show_bug.cgi?id=201878

        Reviewed by Geoffrey Garen.

        WebSWServerConnection does not need to store a sessionID, it can simply get it from its SWServer.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::establishSWServerConnection):
        * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
        (WebKit::WebSWServerConnection::WebSWServerConnection):
        (WebKit::WebSWServerConnection::startFetch):
        (WebKit::WebSWServerConnection::sessionID const):
        * NetworkProcess/ServiceWorker/WebSWServerConnection.h:

2019-09-17  Chris Dumez  <cdumez@apple.com>

        WebPaymentCoordinatorProxy does not need sessionIDs
        https://bugs.webkit.org/show_bug.cgi?id=201875

        Reviewed by Geoffrey Garen.

        WebPaymentCoordinatorProxy does not need sessionIDs so let's stop passing them around.

        * Shared/ApplePay/WebPaymentCoordinatorProxy.cpp:
        (WebKit::WebPaymentCoordinatorProxy::canMakePaymentsWithActiveCard):
        (WebKit::WebPaymentCoordinatorProxy::showPaymentUI):
        * Shared/ApplePay/WebPaymentCoordinatorProxy.h:
        * Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in:
        * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
        (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard):
        (WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest):
        * Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
        (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
        * Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
        (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
        * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
        (WebKit::WebPaymentCoordinator::canMakePaymentsWithActiveCard):
        (WebKit::WebPaymentCoordinator::showPaymentUI):

2019-09-17  Chris Dumez  <cdumez@apple.com>

        There should be a single CacheStorageConnection per WebProcess
        https://bugs.webkit.org/show_bug.cgi?id=201874

        Reviewed by Geoffrey Garen.

        There should be a single CacheStorageConnection per WebProcess now that we have a single session
        per WebProcess. This invariant allows us to simplify the code.

        * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
        (WebKit::CacheStorageEngineConnection::~CacheStorageEngineConnection):
        (WebKit::CacheStorageEngineConnection::open):
        (WebKit::CacheStorageEngineConnection::remove):
        (WebKit::CacheStorageEngineConnection::caches):
        (WebKit::CacheStorageEngineConnection::retrieveRecords):
        (WebKit::CacheStorageEngineConnection::deleteMatchingRecords):
        (WebKit::CacheStorageEngineConnection::putRecords):
        (WebKit::CacheStorageEngineConnection::reference):
        (WebKit::CacheStorageEngineConnection::dereference):
        (WebKit::CacheStorageEngineConnection::clearMemoryRepresentation):
        (WebKit::CacheStorageEngineConnection::engineRepresentation):
        (WebKit::CacheStorageEngineConnection::sessionID const):
        * NetworkProcess/cache/CacheStorageEngineConnection.h:
        * NetworkProcess/cache/CacheStorageEngineConnection.messages.in:
        * WebProcess/Cache/WebCacheStorageConnection.cpp:
        (WebKit::WebCacheStorageConnection::WebCacheStorageConnection):
        (WebKit::WebCacheStorageConnection::open):
        (WebKit::WebCacheStorageConnection::remove):
        (WebKit::WebCacheStorageConnection::retrieveCaches):
        (WebKit::WebCacheStorageConnection::retrieveRecords):
        (WebKit::WebCacheStorageConnection::batchDeleteOperation):
        (WebKit::WebCacheStorageConnection::batchPutOperation):
        (WebKit::WebCacheStorageConnection::reference):
        (WebKit::WebCacheStorageConnection::dereference):
        (WebKit::WebCacheStorageConnection::clearMemoryRepresentation):
        (WebKit::WebCacheStorageConnection::engineRepresentation):
        (WebKit::WebCacheStorageConnection::updateQuotaBasedOnSpaceUsage):
        (WebKit::WebCacheStorageConnection::sessionID const):
        * WebProcess/Cache/WebCacheStorageConnection.h:
        * WebProcess/Cache/WebCacheStorageProvider.cpp:
        (WebKit::WebCacheStorageProvider::createCacheStorageConnection):
        * WebProcess/Cache/WebCacheStorageProvider.h:

2019-09-17  Chris Dumez  <cdumez@apple.com>

        Unreviewed attempt to fix internal build after r249962.

        * UIProcess/API/C/WKPreferencesRef.h:

2019-09-17  Chris Dumez  <cdumez@apple.com>

        REGRESSION (r249923): ASSERTION FAILED: sessionID == WebProcess::singleton().sessionID() in WebCore::SWClientConnection *WebKit::WebServiceWorkerProvider::existingServiceWorkerConnectionForSession(PAL::SessionID)
        https://bugs.webkit.org/show_bug.cgi?id=201859
        <rdar://problem/55426742>

        Reviewed by Alex Christensen.

        Drop support for the WKPreferencesSetPrivateBrowsingEnabled() C API (Mark as deprecated and make it a no-op) as it
        was changing a WebContent process's sessionID, which is no longer supported. This was also using the legacy private
        browsing session, which we're trying to get rid of. There is suitable C API to do private browsing (WKWebsiteDataStoreRef).

        * Shared/WebPreferences.yaml:
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetPrivateBrowsingEnabled):
        (WKPreferencesGetPrivateBrowsingEnabled):
        * UIProcess/API/C/WKPreferencesRef.h:
        * UIProcess/API/C/mac/WKPagePrivateMac.mm:
        (WKPageIsURLKnownHSTSHost):
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::isURLKnownHSTSHost const):
        * UIProcess/WebPreferences.cpp:
        (WebKit::WebPreferences::addPage):
        (WebKit::WebPreferences::removePage):
        (WebKit::WebPreferences::updateBoolValueForKey):
        * UIProcess/WebPreferences.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):
        * UIProcess/WebProcessPool.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::updatePreferences):

2019-09-17  Chris Dumez  <cdumez@apple.com>

        REGRESSION (iOS 13): rAF stops firing when navigating away cross-origin and then back
        https://bugs.webkit.org/show_bug.cgi?id=201767
        <rdar://problem/55350854>

        Reviewed by Geoffrey Garen.

        When navigating back and restoring a SuspendedPage, WebPage::reinitializeWebPage() ends up
        reconstructing a new DrawingArea to match the identifier of the DrawingAreaProxy that the
        UIProcess created. The issue is that when reconstructing the DrawingArea, we were losing
        the DisplayRefreshMonitors that had been registered on the previous drawing area. To
        address the issue, we now make sure to transfer the DisplayRefreshMonitors over from the
        old to the new drawing area. This patch is kept as small as possible to faciliate cherry
        picking to a branch. However, I think we should consider refactoring the code so that
        we no longer need to re-create the DrawingArea in the WebProcess in this case.

        * WebProcess/WebPage/DrawingArea.h:
        (WebKit::DrawingArea::adoptDisplayRefreshMonitorsFromDrawingArea):
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
        (WebKit::RemoteLayerTreeDrawingArea::adoptDisplayRefreshMonitorsFromDrawingArea):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::reinitializeWebPage):

2019-09-17  Truitt Savell  <tsavell@apple.com>

        Unreviewed, rolling out r249950.

        Broke the iOS build.

        Reverted changeset:

        "Remove the "Show Link Previews" and "Hide Link Previews"
        action menus in the preview platter"
        https://bugs.webkit.org/show_bug.cgi?id=201864
        https://trac.webkit.org/changeset/249950

2019-09-17  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Initial view loading is slow
        https://bugs.webkit.org/show_bug.cgi?id=201451

        Reviewed by Sergio Villar Senin.

        The problem is that now we are always calling DrawingAreaProxy::waitForBackingStoreUpdateOnNextPaint() after a
        new process is launched and we used to do that only when launching a new process after a crash. This makes
        m_hasReceivedFirstUpdate useless, because it's always set to true right after a process is launched. Then, we
        wait up to half a second (which is usually the case for the initial load) until the first update. We only want
        to do that when recovering from a crash or when swapping processes to avoid flashing effect.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::launchProcess): Add ProcessLaunchReason parameter and pass it to
        finishAttachingToWebProcess instead of IsProcessSwap.
        (WebKit::WebPageProxy::swapToWebProcess): Pass ProcessLaunchReason::ProcessSwap to
        finishAttachingToWebProcess().
        (WebKit::WebPageProxy::finishAttachingToWebProcess): Do not call
        DrawingAreaProxy::waitForBackingStoreUpdateOnNextPaint() when process launch reason is ProcessLaunchReason::InitialProcess.
        (WebKit::WebPageProxy::launchProcessForReload): Pass ProcessLaunchReason::Reload to launchProcess().
        * UIProcess/WebPageProxy.h: Remove IsProcessSwap and add ProcessLaunchReason instead that is passed to
        launchProcess and finishAttachingToWebProcess.

2019-09-17  Carlos Garcia Campos  <cgarcia@igalia.com>

        REGRESSION(r249275): [GTK][WPE] WebPage injected bundle messages no longer work
        https://bugs.webkit.org/show_bug.cgi?id=201865

        Reviewed by Žan Doberšek.

        We use them to implement the web resources API. This is another regression of r249275 because we are using the
        page proxy identifier when we really want to the web page identifier.

        * UIProcess/API/glib/WebKitWebContext.cpp:
        (webkitWebContextGetWebViewForPage): Use WebPageProxy::webPageID() instead of WebPageProxy::identifier().

2019-09-17  Dean Jackson  <dino@apple.com>

        Remove the "Show Link Previews" and "Hide Link Previews" action menus in the preview platter
        https://bugs.webkit.org/show_bug.cgi?id=201864
        <rdar://55190038>

        Reviewed by Simon Fraser.

        * UIProcess/ios/WKActionSheetAssistant.mm: Remove the toggle action from the
        default values.
        (-[WKActionSheetAssistant defaultActionsForLinkSheet:]):
        * UIProcess/ios/WKContentViewInteraction.mm: No longer try to add a toggle when
        it isn't there.
        (-[WKContentView assignLegacyDataForContextMenuInteraction]):
        (menuWithShowLinkPreviewAction): Deleted.

2019-09-17  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthn] Use WebPreferences instead of RuntimeEnabledFeatures in UIProcess
        https://bugs.webkit.org/show_bug.cgi?id=198176
        <rdar://problem/55285709>

        Reviewed by Youenn Fablet.

        This patch does the following two things:
        1) It merges WebAuthenticationRequestData::creationOptions and requestOptions into a variant, and therefore
        merges code paths that involve WebAuthenticationRequestData.
        2) It teaches WebAuthenticationRequestData to store a WebPreferences such that AuthenticatorManager could utilize
        runtime feature flags to turn features on or off.

        * UIProcess/WebAuthentication/Authenticator.cpp:
        (WebKit::Authenticator::handleRequest):
        * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
        (WebKit::AuthenticatorManager::handleRequest):
        (WebKit::AuthenticatorManager::clearState):
        (WebKit::AuthenticatorManager::authenticatorAdded):
        (WebKit::AuthenticatorManager::startDiscovery):
        (WebKit::AuthenticatorManager::makeCredential): Deleted.
        (WebKit::AuthenticatorManager::getAssertion): Deleted.
        * UIProcess/WebAuthentication/AuthenticatorManager.h:
        * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
        (WebKit::LocalAuthenticator::makeCredential):
        (WebKit::LocalAuthenticator::continueMakeCredentialAfterUserConsented):
        (WebKit::LocalAuthenticator::continueMakeCredentialAfterAttested):
        (WebKit::LocalAuthenticator::getAssertion):
        (WebKit::LocalAuthenticator::continueGetAssertionAfterUserConsented):
        * UIProcess/WebAuthentication/Cocoa/LocalService.mm:
        (WebKit::LocalService::isAvailable):
        Don't check RuntimeEnabledFeatures given it is for WebCore.
        * UIProcess/WebAuthentication/WebAuthenticationRequestData.h:
        (): Deleted.
        * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp:
        (WebKit::WebAuthenticatorCoordinatorProxy::makeCredential):
        (WebKit::WebAuthenticatorCoordinatorProxy::getAssertion):
        (WebKit::WebAuthenticatorCoordinatorProxy::handleRequest):
        * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.h:
        * UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp:
        (WebKit::CtapAuthenticator::makeCredential):
        (WebKit::CtapAuthenticator::continueMakeCredentialAfterResponseReceived const):
        (WebKit::CtapAuthenticator::getAssertion):
        * UIProcess/WebAuthentication/fido/U2fAuthenticator.cpp:
        (WebKit::U2fAuthenticator::makeCredential):
        (WebKit::U2fAuthenticator::checkExcludeList):
        (WebKit::U2fAuthenticator::issueRegisterCommand):
        (WebKit::U2fAuthenticator::getAssertion):
        (WebKit::U2fAuthenticator::issueSignCommand):
        (WebKit::U2fAuthenticator::continueRegisterCommandAfterResponseReceived):
        (WebKit::U2fAuthenticator::continueSignCommandAfterResponseReceived):

2019-09-17  Carlos Garcia Campos  <cgarcia@igalia.com>

        Keeps running obsolete WebProcess-es for too long
        https://bugs.webkit.org/show_bug.cgi?id=201492

        Reviewed by Chris Dumez.

        That's how the web process cache is expected to work, but it's true that it probably only makes sense to use it
        when cache model is primary web browser.

        * UIProcess/WebProcessCache.cpp:
        (WebKit::WebProcessCache::updateCapacity): Disable the web process cache when cache model is not primary web browser.

2019-09-17  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Crash closing web view while hardware acceleration is enabled
        https://bugs.webkit.org/show_bug.cgi?id=200856

        Reviewed by Michael Catanzaro.

        The crash happens when destroying the WaylandCompositor::Surface because the web view GL context is used to
        release the texture, but the GL context is no longer valid after web view
        unrealize. AcceleratedBackingStoreWayland should handle the web view unrealize to destroy the GL context. It
        will be created on demand again after the web view is realized.

        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (webkitWebViewBaseRealize): Notify AcceleratedBackingStore.
        (webkitWebViewBaseUnrealize): Ditto.
        * UIProcess/gtk/AcceleratedBackingStore.h:
        (WebKit::AcceleratedBackingStore::realize): Added.
        (WebKit::AcceleratedBackingStore::unrealize): Added.
        * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
        (WebKit::AcceleratedBackingStoreWayland::realize): In case of using WaylandCompositor, call
        WaylandCompositor::bindWebPage() to bind the WebPageProxy to the Wayland surface.
        (WebKit::AcceleratedBackingStoreWayland::unrealize): Destroy GL resources and the GL context.
        (WebKit::AcceleratedBackingStoreWayland::tryEnsureGLContext): Do not try to create the GL context if the web
        view is not realized.
        (WebKit::AcceleratedBackingStoreWayland::displayBuffer): Remove the code to initialize the texture.
        (WebKit::AcceleratedBackingStoreWayland::paint): And add it here.
        * UIProcess/gtk/AcceleratedBackingStoreWayland.h:
        * UIProcess/gtk/WaylandCompositor.cpp:
        (WebKit::WaylandCompositor::Surface::setWebPage): Return early if given page is the current one already.
        (WebKit::WaylandCompositor::bindWebPage): Set the surface WebPageProxy.
        (WebKit::WaylandCompositor::unbindWebPage): Unset the surface WebPageProxy.
        * UIProcess/gtk/WaylandCompositor.h:
        * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
        (WebKit::DrawingAreaCoordinatedGraphics::enterAcceleratedCompositingMode): When restoring a previous layer tree
        host, always call resumeRendering() to balance the suspendRendering() called in exitAcceleratedCompositingMode().

2019-09-16  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r249910.

        Caused layout test failures and timeouts on Catalina

        Reverted changeset:

        "REGRESSION(249649): Unable to open local files in MiniBrowser
        on macOS"
        https://bugs.webkit.org/show_bug.cgi?id=201798
        https://trac.webkit.org/changeset/249910

2019-09-16  Chris Dumez  <cdumez@apple.com>

        Drop sessionID / websiteDataStoreID from WebPageCreationParameters
        https://bugs.webkit.org/show_bug.cgi?id=201847

        Reviewed by Youenn Fablet.

        Drop sessionID / websiteDataStoreID from WebPageCreationParameters now that we have
        one session per WebProcess.

        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:
        (WebKit::WebPageCreationParameters::WebPageCreationParameters): Deleted.
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::creationParameters):
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::createWindow):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_textAutoSizingAdjustmentTimer):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::createWebPage):

2019-09-16  Dean Jackson  <dino@apple.com>

        Provide a prototype for AR QuickLook to trigger processing in the originating page
        https://bugs.webkit.org/show_bug.cgi?id=201371

        Hopefully fix the public iOS 13 build.

        * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:

2019-09-16  David Kilzer  <ddkilzer@apple.com>

        [WebAuthn] Name instance variables consistently in WKMockNFTag
        <https://webkit.org/b/201845>

        Reviewed by Jiewen Tan.

        * UIProcess/WebAuthentication/Mock/MockNfcService.mm:
        Make all @synthesize instance variables use a leading underscore
        for their name.

2019-09-16  Dean Jackson  <dino@apple.com>

        REGRESSION: iPad: Safari becomes unresponsive after context menu on 1-800-MY-APPLE phone number, tapping 'Add to Contacts'
        https://bugs.webkit.org/show_bug.cgi?id=201816
        <rdar://55105827>

        Reviewed by Darin Adler.

        When generating the DataDetectorsContext for a position, we should
        also provide the source rectangle for the link in root view coordinates.
        This allows DataDetectors to show any modal dialogs in the right
        position.

        * UIProcess/ios/WKContentViewInteraction.mm: Use either the bounds of the positionInformation
        or the text bounding rectangle.
        (-[WKContentView dataDetectionContextForPositionInformation:]):

2019-09-16  Chris Dumez  <cdumez@apple.com>

        NetworkProcessConnection does not need HashMaps of sessionIDs for Service Workers and IDB
        https://bugs.webkit.org/show_bug.cgi?id=201830

        Reviewed by Geoffrey Garen.

        NetworkProcessConnection does not need HashMaps of sessionIDs for Service Workers and IDB, since
        we now have one sessionID per WebContent process.

        * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
        * NetworkProcess/ServiceWorker/WebSWServerConnection.h:
        * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
        (WebKit::WebIDBConnectionToServer::create):
        (WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer):
        * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
        * WebProcess/Databases/WebDatabaseProvider.cpp:
        (WebKit::WebDatabaseProvider::idbConnectionToServerForSession):
        * WebProcess/Network/NetworkProcessConnection.cpp:
        (WebKit::NetworkProcessConnection::didReceiveMessage):
        (WebKit::NetworkProcessConnection::didClose):
        (WebKit::NetworkProcessConnection::idbConnectionToServerForSession):
        (WebKit::NetworkProcessConnection::serviceWorkerConnectionForSession):
        * WebProcess/Network/NetworkProcessConnection.h:
        (WebKit::NetworkProcessConnection::existingIDBConnectionToServer const):
        (WebKit::NetworkProcessConnection::existingServiceWorkerConnectionForSession):
        * WebProcess/Storage/WebServiceWorkerProvider.cpp:
        (WebKit::WebServiceWorkerProvider::serviceWorkerConnectionForSession):
        (WebKit::WebServiceWorkerProvider::existingServiceWorkerConnectionForSession):
        (WebKit::WebServiceWorkerProvider::handleFetch):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::networkProcessConnectionClosed):

2019-09-16  Brent Fulgham  <bfulgham@apple.com>

        [FTW] Correct lifespan of other SharedBitmaps
        https://bugs.webkit.org/show_bug.cgi?id=201800

        Reviewed by Dean Jackson.

        The pop-up menu code creates its own SharedBitmap in the WebContent process,
        which needs to release its handle before destruction, otherwise the UIProcess
        will be unable to access the GPU texture (since it will have been cleaned up).

        Since WebPopupMenuProxyWin has its own HWND and WinProc, it needs its own
        swapChain to handle syncing of content to the screen.

        This patch also audits other uses of SharedBitmap to make sure a similar
        problem doesn't exist elsewhere.

        * Shared/ShareableBitmap.h:
        * Shared/win/ShareableBitmapDirect2D.cpp:
        (WebKit::ShareableBitmap::paint):
        (WebKit::ShareableBitmap::createDirect2DSurface):
        * UIProcess/win/WebPopupMenuProxyWin.cpp:
        (WebKit::WebPopupMenuProxyWin::showPopupMenu): Add Direct2D code paths.
        (WebKit::WebPopupMenuProxyWin::paint): Update for Direct2D.
        (WebKit::WebPopupMenuProxyWin::setupSwapChain): Added.
        (WebKit::WebPopupMenuProxyWin::configureBackingStore): Added.
        * UIProcess/win/WebPopupMenuProxyWin.h:
        * UIProcess/win/WebView.cpp:
        (WebKit::WebView::setupSwapChain): Move some implementation code to the
        Direct2DUtilities file.
        * UIProcess/win/WebView.h:
        (WebKit::WebView::d3dDevice const):
        (WebKit::WebView::d3dImmediateContext const):
        (WebKit::WebView::d3dDevice): Deleted.
        * WebProcess/WebCoreSupport/WebPopupMenu.cpp:
        (WebKit::WebPopupMenu::show):
        * WebProcess/WebPage/FindController.cpp:
        (WebKit::FindController::getImageForFindMatch): Prevent WebContent process from
        destroying SharedBitmap before the UIProcess can receive it.

2019-09-16  Chris Dumez  <cdumez@apple.com>

        Simplify WebResourceLoadObserver now that we have one WebProcess per session
        https://bugs.webkit.org/show_bug.cgi?id=201821

        Reviewed by Brent Fulgham.

        Simplify WebResourceLoadObserver now that we have one WebProcess per session.
        No need to pass sessionIDs around or store statistics per sessionID.
        Also, only initialize the WebResourceLoadObserver if both ITP is enabled and
        we're not in a WebContent process used for an ephemeral session.

        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::resourceLoadStatisticsUpdated):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * WebProcess/WebCoreSupport/WebResourceLoadObserver.cpp:
        (WebKit::WebResourceLoadObserver::requestStorageAccessUnderOpener):
        (WebKit::WebResourceLoadObserver::ensureResourceStatisticsForRegistrableDomain):
        (WebKit::WebResourceLoadObserver::scheduleNotificationIfNeeded):
        (WebKit::WebResourceLoadObserver::statisticsForURL):
        (WebKit::WebResourceLoadObserver::takeStatistics):
        (WebKit::WebResourceLoadObserver::clearState):
        (WebKit::WebResourceLoadObserver::logFontLoad):
        (WebKit::WebResourceLoadObserver::logCanvasRead):
        (WebKit::WebResourceLoadObserver::logCanvasWriteOrMeasure):
        (WebKit::WebResourceLoadObserver::logNavigatorAPIAccessed):
        (WebKit::WebResourceLoadObserver::logScreenAPIAccessed):
        (WebKit::WebResourceLoadObserver::logSubresourceLoading):
        (WebKit::WebResourceLoadObserver::logWebSocketLoading):
        (WebKit::WebResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
        * WebProcess/WebCoreSupport/WebResourceLoadObserver.h:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::setWebsiteDataStoreParameters):

2019-09-16  David Kilzer  <ddkilzer@apple.com>

        Fix build failure in MockNfcService.mm
        <https://webkit.org/b/201839>

        Reviewed by Brady Eidson.

        * UIProcess/WebAuthentication/Mock/MockNfcService.mm:
        Specify instance variable names for @synthesized variables that
        need to be manually released in -dealloc under MRR.

2019-09-16  Per Arne Vollan  <pvollan@apple.com>

        REGRESSION(249649): Unable to open local files in MiniBrowser on macOS
        https://bugs.webkit.org/show_bug.cgi?id=201798

        Reviewed by Brent Fulgham.

        The commit <https://trac.webkit.org/changeset/249649> introduced a MiniBrowser regression on macOS where
        MiniBrowser is not able to open local files. The change set r249649 fixed a problem where the WebContent
        process PID was not ready to be used when creating a sandbox extension. This happened in the cases where
        the WebContent process had not finished launching when the load started. The WebContent process is also
        creating sandbox extensions for the Networking process for the files being loaded, and also needs to be
        passing the PID of the Networking process when creating these. This patch is addressing this by getting
        the PID of the Networking process when the WebContent process is initially getting the connection to the
        Networking process. The PID is then stored in the NetworkProcessConnection class, from where it is passed
        to the NetworkLoadParameters, and used when creating the sandbox extension for the Networking process.

        * NetworkProcess/NetworkLoadParameters.h:
        * NetworkProcess/NetworkResourceLoadParameters.cpp:
        (WebKit::NetworkResourceLoadParameters::encode const):
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::~NetworkProcessProxy):
        (WebKit::NetworkProcessProxy::openNetworkProcessConnection):
        (WebKit::NetworkProcessProxy::networkProcessCrashed):
        (WebKit::NetworkProcessProxy::didFinishLaunching):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::loadRequestWithNavigationShared):
        * UIProcess/WebProcessProxy.messages.in:
        * WebProcess/Network/NetworkProcessConnection.cpp:
        (WebKit::NetworkProcessConnection::NetworkProcessConnection):
        * WebProcess/Network/NetworkProcessConnection.h:
        (WebKit::NetworkProcessConnection::create):
        (WebKit::NetworkProcessConnection::networkProcessPID const):
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
        * WebProcess/WebProcess.cpp:
        (WebKit::getNetworkProcessConnection):
        (WebKit::WebProcess::ensureNetworkProcessConnection):

2019-09-16  David Kilzer  <ddkilzer@apple.com>

        [WebAuthn] REGRESSION (r249059): Leak of WKMockNFTag objects and WKMockNFTag instance variables
        <https://webkit.org/b/201813>

        Reviewed by Darin Adler.

        * UIProcess/WebAuthentication/Mock/MockNfcService.mm:
        (-[WKMockNFTag dealloc]): Add method and release instance
        variables to fix leaks.
        (WebKit::MockNfcService::detectTags const): Use adoptNS() to fix
        leaks of WKMockNFTag objects.

2019-09-16  David Kilzer  <ddkilzer@apple.com>

        REGRESSION (r243113): Leak of multiple instance variable blocks when deallocating _WKAttributedStringNavigationDelegate
        <https://webkit.org/b/201812>

        Reviewed by Timothy Hatcher.

        * UIProcess/API/Cocoa/NSAttributedString.mm:
        (-[_WKAttributedStringNavigationDelegate dealloc]): Add method
        to release instance variable blocks to fix potential leaks.

2019-09-16  Adrian Perez de Castro  <aperez@igalia.com>

        Unreviewed build fix.

        * NetworkProcess/NetworkConnectionToWebProcess.h: Add missing forward
        declaration of the NetworkSession class.

2019-09-16  Chris Dumez  <cdumez@apple.com>

        Store sessionID on the NetworkConnectionToWebProcess now that there is one session per WebProcess
        https://bugs.webkit.org/show_bug.cgi?id=201789

        Reviewed by Alex Christensen.

        Store sessionID on the NetworkConnectionToWebProcess now that there is one session per WebProcess.
        As a result, we no longer need to pass the sessionID in each IPC from the WebProcess to the
        NetworkProcess.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::create):
        (WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess):
        (WebKit::NetworkConnectionToWebProcess::~NetworkConnectionToWebProcess):
        (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
        (WebKit::NetworkConnectionToWebProcess::didReceiveSyncMessage):
        (WebKit::NetworkConnectionToWebProcess::didClose):
        (WebKit::NetworkConnectionToWebProcess::createSocketStream):
        (WebKit::NetworkConnectionToWebProcess::createSocketChannel):
        (WebKit::NetworkConnectionToWebProcess::networkSession):
        (WebKit::NetworkConnectionToWebProcess::resolveBlobReferences):
        (WebKit::NetworkConnectionToWebProcess::storageSession):
        (WebKit::NetworkConnectionToWebProcess::startDownload):
        (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
        (WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
        (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
        (WebKit::NetworkConnectionToWebProcess::cookiesEnabled):
        (WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue):
        (WebKit::NetworkConnectionToWebProcess::getRawCookies):
        (WebKit::NetworkConnectionToWebProcess::deleteCookie):
        (WebKit::NetworkConnectionToWebProcess::registerFileBlobURL):
        (WebKit::NetworkConnectionToWebProcess::registerBlobURL):
        (WebKit::NetworkConnectionToWebProcess::registerBlobURLFromURL):
        (WebKit::NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked):
        (WebKit::NetworkConnectionToWebProcess::registerBlobURLForSlice):
        (WebKit::NetworkConnectionToWebProcess::unregisterBlobURL):
        (WebKit::NetworkConnectionToWebProcess::blobSize):
        (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
        (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForFrame):
        (WebKit::NetworkConnectionToWebProcess::clearPageSpecificDataForResourceLoadStatistics):
        (WebKit::NetworkConnectionToWebProcess::logUserInteraction):
        (WebKit::NetworkConnectionToWebProcess::hasStorageAccess):
        (WebKit::NetworkConnectionToWebProcess::requestStorageAccess):
        (WebKit::NetworkConnectionToWebProcess::requestStorageAccessUnderOpener):
        (WebKit::NetworkConnectionToWebProcess::startTrackingResourceLoad):
        (WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer):
        (WebKit::NetworkConnectionToWebProcess::unregisterSWConnection):
        (WebKit::NetworkConnectionToWebProcess::establishSWServerConnection):
        (WebKit::NetworkConnectionToWebProcess::establishSWContextConnection):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        (WebKit::NetworkConnectionToWebProcess::sessionID const):
        (WebKit::NetworkConnectionToWebProcess::startDownload):
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::start):
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::openNetworkProcessConnection):
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::sessionID const):
        * UIProcess/WebProcessProxy.h:
        * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
        (WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer):
        * WebProcess/FileAPI/BlobRegistryProxy.cpp:
        (WebKit::BlobRegistryProxy::registerFileBlobURL):
        (WebKit::BlobRegistryProxy::registerBlobURL):
        (WebKit::BlobRegistryProxy::registerBlobURLOptionallyFileBacked):
        (WebKit::BlobRegistryProxy::unregisterBlobURL):
        (WebKit::BlobRegistryProxy::registerBlobURLForSlice):
        (WebKit::BlobRegistryProxy::blobSize):
        * WebProcess/Network/NetworkProcessConnection.cpp:
        (WebKit::NetworkProcessConnection::writeBlobsToTemporaryFiles):
        * WebProcess/Network/WebSocketChannel.cpp:
        (WebKit::WebSocketChannel::connect):
        * WebProcess/Network/WebSocketStream.cpp:
        (WebKit::WebSocketStream::WebSocketStream):
        * WebProcess/Storage/WebSWClientConnection.cpp:
        (WebKit::WebSWClientConnection::WebSWClientConnection):
        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        (WebKit::m_userAgent):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::detachedFromParent2):
        (WebKit::WebFrameLoaderClient::dispatchWillChangeDocument):
        * WebProcess/WebCoreSupport/WebResourceLoadObserver.cpp:
        (WebKit::WebResourceLoadObserver::requestStorageAccessUnderOpener):
        (WebKit::WebResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
        * WebProcess/WebPage/WebCookieJar.cpp:
        (WebKit::WebCookieJar::cookies const):
        (WebKit::WebCookieJar::setCookies):
        (WebKit::WebCookieJar::cookiesEnabled const):
        (WebKit::WebCookieJar::cookieRequestHeaderFieldValue const):
        (WebKit::WebCookieJar::getRawCookies const):
        (WebKit::WebCookieJar::deleteCookie):
        * WebProcess/WebPage/WebFrame.cpp:
        (WebKit::WebFrame::startDownload):
        (WebKit::WebFrame::convertMainResourceLoadToDownload):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::close):
        (WebKit::WebPage::hasStorageAccess):
        (WebKit::WebPage::requestStorageAccess):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::createWebPage):
        (WebKit::WebProcess::removeWebPage):
        * WebProcess/WebProcess.h:
        (WebKit::WebProcess::sessionID const):

2019-09-16  Carlos Garcia Campos  <cgarcia@igalia.com>

        REGRESSION(r249142): [GTK] Epiphany delayed page loads continue indefinitely
        https://bugs.webkit.org/show_bug.cgi?id=201544

        Reviewed by Michael Catanzaro.

        WebPageProxy::loadAlternateHTML() is an exception, because it's an API request but always sets the navigationID
        to 0. We always want to reset the pending API request URL when alternate HTML load starts.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared): Check also that it's an API alternate HTML load
        to reset the pending API request URL.

2019-09-15  David Kilzer  <ddkilzer@apple.com>

        REGRESSION (r248592): Leak of CFDictionaryRef in WebKit::NetworkRTCProvider::proxyInfoFromSession()
        <https://webkit.org/b/201811>

        Reviewed by Youenn Fablet.

        * NetworkProcess/webrtc/NetworkRTCProvider.mm:
        (WebKit::NetworkRTCProvider::proxyInfoFromSession): Use
        RetainPtr<> to fix the leak.

2019-09-14  Adrian Perez de Castro  <aperez@igalia.com>

        [GTK][WPE] Check for a Snap sandbox a bit harder
        https://bugs.webkit.org/show_bug.cgi?id=201793

        Reviewed by Michael Catanzaro.

        * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
        (WebKit::isInsideSnap): Check whether the SNAP_NAME and SNAP_REVISION
        environment variables are defined as well.

2019-09-14  Youenn Fablet  <youenn@apple.com>

        Add release logging in WebLoaderStrategy to check that a load is going through service worker
        https://bugs.webkit.org/show_bug.cgi?id=201761

        Reviewed by Chris Dumez.

        This allows identifying whether a load remains pending on the service worker fetch path.

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

2019-09-13  Youenn Fablet  <youenn@apple.com>

        [MacOS/iOS] imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-abort.https.html is sometimes crashing in Debug
        https://bugs.webkit.org/show_bug.cgi?id=201686

        Reviewed by Alexey Proskuryakov.

        A load might be cancelled shortly after being started in network process.
        In that case, NetworkDataTaskCocoa might be destroyed, thus removed from the ID to task map
        but some handlers might still be called until the NSURLSessionTask is finished cancelling.
        This happens for authentication challenges.
        In case where the NSURLSessionTask is cancelling, return early instead of processing the challenge.

        Covered by LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-abort.https.html and LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-abort.https.html no longer crashing in debug.

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):

2019-09-11  Dean Jackson  <dino@apple.com>

        Provide a prototype for AR QuickLook to trigger processing in the originating page
        https://bugs.webkit.org/show_bug.cgi?id=201371
        <rdar://54904781>

        Reviewed by Simon Fraser.

        Provide a way for a Web page to know if an action in the AR scene
        was performed, if and only if the system AR library calls a delegate with
        particular parameters. Post a message to the originating frame so
        the page can detect the action.

        * Scripts/webkit/messages.py: Include the right header for SystemPreviewInfo.

        * Shared/WebCoreArgumentCoders.cpp: Use SystemPreviewInfo.
        (IPC::ArgumentCoder<ResourceRequest>::encode):
        (IPC::ArgumentCoder<ResourceRequest>::decode):

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _triggerSystemPreviewActionOnFrame:page:]): New helper/test function
        to trigger the system preview action.
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:

        * UIProcess/Cocoa/DownloadClient.mm: Use new type.
        (WebKit::DownloadClient::didStart):

        * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm: Implement the delegate so that
        we can detect an action. When it happens, tell the WebPageProxy to send a message.

        * UIProcess/Downloads/DownloadProxy.h: Use SystemPreviewInfo type.
        (WebKit::DownloadProxy::systemPreviewDownloadInfo const):
        (WebKit::DownloadProxy::systemPreviewDownloadRect const): Deleted.

        * UIProcess/SystemPreviewController.h:
        (WebKit::SystemPreviewController::previewInfo const):

        * UIProcess/WebPageProxy.cpp: Send it over to the Web Process.
        (WebKit::WebPageProxy::systemPreviewActionTriggered const):
        * UIProcess/WebPageProxy.h:

        * WebProcess/WebPage/WebPage.cpp: Check the destination still exists, and then talk
        to the Document.
        (WebKit::WebPage::systemPreviewActionTriggered):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2019-09-13  Youenn Fablet  <youenn@apple.com>

        Partition processes running service workers by session ID
        https://bugs.webkit.org/show_bug.cgi?id=201643

        Reviewed by Chris Dumez.

        Remove the management of server context connections from NetworkProcess.
        The WebProcessPool service worker process map is now keyed by both registrable domain and sessionID.
        Update WebProcessPool to only expose the number of service worker processes instead of the full map.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::didClose):
        (WebKit::NetworkConnectionToWebProcess::establishSWContextConnection):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::swServerForSession):
        * NetworkProcess/NetworkProcess.h:
        (WebKit::NetworkProcess::swServerForSessionIfExists):
        * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
        (WebKit::WebSWServerConnection::startFetch):
        (WebKit::WebSWServerConnection::postMessageToServiceWorker):
        (WebKit::WebSWServerConnection::scheduleJobInServer):
        (WebKit::WebSWServerConnection::updateThrottleState):
        (WebKit::WebSWServerConnection::contextConnectionCreated):
        * NetworkProcess/ServiceWorker/WebSWServerConnection.h:
        * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
        (WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection):
        (WebKit::WebSWServerToContextConnection::~WebSWServerToContextConnection):
        (WebKit::WebSWServerToContextConnection::connectionIsNoLongerNeeded):
        * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _webPageContentProcessCount]):
        (-[WKProcessPool _serviceWorkerProcessCount]):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess):
        (WebKit::WebProcessPool::disconnectProcess):
        * UIProcess/WebProcessPool.h:
        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        (WebKit::WebSWContextManagerConnection::WebSWContextManagerConnection):
        (WebKit::m_userAgent):
        * WebProcess/Storage/WebSWContextManagerConnection.h:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::establishWorkerContextConnectionToNetworkProcess):

2019-09-13  Alex Christensen  <achristensen@webkit.org>

        AuxiliaryProcessProxy::sendWithAsyncReply should queue up messages if sent while the process is starting like it does messages without replies
        https://bugs.webkit.org/show_bug.cgi?id=201746

        Reviewed by Youenn Fablet.

        * UIProcess/AuxiliaryProcessProxy.cpp:
        (WebKit::AuxiliaryProcessProxy::sendMessage):
        (WebKit::AuxiliaryProcessProxy::didFinishLaunching):
        * UIProcess/AuxiliaryProcessProxy.h:
        (WebKit::AuxiliaryProcessProxy::sendWithAsyncReply):

2019-09-13  Youenn Fablet  <youenn@apple.com>

        Use WebProcess processIdentifier to identify Service Worker connections
        https://bugs.webkit.org/show_bug.cgi?id=201459

        Reviewed by Chris Dumez.

        Make WebSWServerConnection be stored in NetworkConnectionToWebProcess.
        They are now keyed by session IDs hence why WebSWClientConnection is using the session ID as message connection ID.
        Creation no longer requires a sync IPC since the connection is uniquely identified by its session ID and its process ID.
        These IDs are stable over network process crash.
        Within NetworkProcess, a server connection is managed by a SWServer which is session ID specific.
        In that case, the process identifier uniquely identifies the connection.

        Move WebSWServerToContextConnection be owned by NetworkConnectionToWebProcess.
        Instead of creating it when webprocess is connecting to network process, use a dedicated IPC message.
        This is similar to WebSWServerConnection once WebProcess asks to create it.
        This will allow existing WebProcess, in cache or running pages, to run service workers as well.
        A context connection map is kept in Network Process to reuse context connections since these connections are not sessionID specific.

        Migrate from a single boolean to a HashSet to track whether some connections are in the process of being created.
        Previously if two requests to create connections were done shortly one after the other on different registrable
        domains, the second request would not be processed.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
        (WebKit::NetworkConnectionToWebProcess::didReceiveSyncMessage):
        (WebKit::NetworkConnectionToWebProcess::didClose):
        (WebKit::NetworkConnectionToWebProcess::establishSWServerConnection):
        (WebKit::NetworkConnectionToWebProcess::establishSWContextConnection):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::didReceiveMessage):
        (WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
        (WebKit::NetworkProcess::forEachSWServer):
        (WebKit::NetworkProcess::needsServerToContextConnectionForRegistrableDomain const):
        (WebKit::NetworkProcess::createServerToContextConnection):
        (WebKit::NetworkProcess::postMessageToServiceWorkerClient):
        (WebKit::NetworkProcess::registerSWServerConnection):
        (WebKit::NetworkProcess::unregisterSWServerConnection):
        (WebKit::NetworkProcess::registerSWContextConnection):
        (WebKit::NetworkProcess::unregisterSWContextConnection):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
        (WebKit::WebSWServerConnection::WebSWServerConnection):
        (WebKit::WebSWServerConnection::postMessageToServiceWorkerClient):
        * NetworkProcess/ServiceWorker/WebSWServerConnection.h:
        * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
        (WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection):
        (WebKit::WebSWServerToContextConnection::~WebSWServerToContextConnection):
        (WebKit::WebSWServerToContextConnection::postMessageToServiceWorkerClient):
        (WebKit::WebSWServerToContextConnection::connectionMayNoLongerBeNeeded):
        * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
        * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::openNetworkProcessConnection):
        (WebKit::NetworkProcessProxy::establishWorkerContextConnectionToNetworkProcess):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/Network/NetworkProcessProxy.messages.in:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::establishServiceWorkerContext):
        * UIProcess/WebProcessProxy.h:
        * WebProcess/Network/NetworkProcessConnection.cpp:
        (WebKit::NetworkProcessConnection::didReceiveMessage):
        (WebKit::NetworkProcessConnection::didClose):
        (WebKit::NetworkProcessConnection::serviceWorkerConnectionForSession):
        * WebProcess/Network/NetworkProcessConnection.h:
        * WebProcess/Storage/WebSWClientConnection.cpp:
        (WebKit::WebSWClientConnection::WebSWClientConnection):
        (WebKit::WebSWClientConnection::~WebSWClientConnection):
        (WebKit::WebSWClientConnection::messageSenderConnection const):
        (WebKit::WebSWClientConnection::scheduleJobInServer):
        (WebKit::WebSWClientConnection::finishFetchingScriptInServer):
        (WebKit::WebSWClientConnection::addServiceWorkerRegistrationInServer):
        (WebKit::WebSWClientConnection::removeServiceWorkerRegistrationInServer):
        (WebKit::WebSWClientConnection::postMessageToServiceWorker):
        (WebKit::WebSWClientConnection::registerServiceWorkerClient):
        (WebKit::WebSWClientConnection::unregisterServiceWorkerClient):
        (WebKit::WebSWClientConnection::didResolveRegistrationPromise):
        (WebKit::WebSWClientConnection::matchRegistration):
        (WebKit::WebSWClientConnection::runOrDelayTaskForImport):
        (WebKit::WebSWClientConnection::whenRegistrationReady):
        (WebKit::WebSWClientConnection::getRegistrations):
        (WebKit::WebSWClientConnection::startFetch):
        (WebKit::WebSWClientConnection::cancelFetch):
        (WebKit::WebSWClientConnection::continueDidReceiveFetchResponse):
        (WebKit::WebSWClientConnection::connectionToServerLost):
        (WebKit::WebSWClientConnection::clear):
        (WebKit::WebSWClientConnection::syncTerminateWorker):
        (WebKit::WebSWClientConnection::updateThrottleState):
        (WebKit::WebSWClientConnection::storeRegistrationsOnDiskForTesting):
        * WebProcess/Storage/WebSWClientConnection.h:
        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        (WebKit::WebSWContextManagerConnection::WebSWContextManagerConnection):
        (WebKit::m_userAgent):
        (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerClient):
        * WebProcess/Storage/WebSWContextManagerConnection.h:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::establishWorkerContextConnectionToNetworkProcess):
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:

2019-09-12  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r249801.

        Caused two servier worker layout tests to become flaky.

        Reverted changeset:

        "Use WebProcess processIdentifier to identify Service Worker
        connections"
        https://bugs.webkit.org/show_bug.cgi?id=201459
        https://trac.webkit.org/changeset/249801

2019-09-12  Chris Dumez  <cdumez@apple.com>

        Pass sessionID to WebProcess with other WebProcessDataStoreParameters
        https://bugs.webkit.org/show_bug.cgi?id=201730

        Reviewed by Alex Christensen.

        Pass sessionID to WebProcess with other WebProcessDataStoreParameters and store
        it on the WebProcess object. In follow-up patches, I will use this sessionID
        more and leverage the fact that we have one sessionID per Webprocess to simplify
        the WebKit2-layer code.

        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const):
        (WebKit::WebProcessCreationParameters::decode):
        * Shared/WebProcessCreationParameters.h:
        * Shared/WebProcessDataStoreParameters.h:
        (WebKit::WebProcessDataStoreParameters::encode const):
        (WebKit::WebProcessDataStoreParameters::decode):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::tryTakePrewarmedProcess):
        (WebKit::WebProcessPool::webProcessDataStoreParameters):
        (WebKit::WebProcessPool::initializeNewWebProcess):
        (WebKit::WebProcessPool::sendWebProcessDataStoreParameters): Deleted.
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::setWebsiteDataStore):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::initializeWebProcess):
        (WebKit::WebProcess::setWebsiteDataStoreParameters):
        * WebProcess/WebProcess.h:
        (WebKit::WebProcess::sessionID const):

2019-09-12  Chris Dumez  <cdumez@apple.com>

        [WKTR] Drop TestRunner.setPrivateBrowsingEnabled_DEPRECATED()
        https://bugs.webkit.org/show_bug.cgi?id=201546

        Reviewed by Alex Christensen.

        Drop TestRunner.setPrivateBrowsingEnabled_DEPRECATED() from WebKitTestRunner as it does not do
        the right thing for WebKit2 and tests have been rewritten to not use it.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession): Deleted.
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
        (WKBundleSetPrivateBrowsingEnabled): Deleted.
        * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
        * WebProcess/InjectedBundle/InjectedBundle.cpp:
        (WebKit::InjectedBundle::setPrivateBrowsingEnabled): Deleted.
        * WebProcess/InjectedBundle/InjectedBundle.h:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::ensureLegacyPrivateBrowsingSessionInNetworkProcess): Deleted.
        * WebProcess/WebProcess.h:
        * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
        (WebKit::StorageNamespaceImpl::setSessionIDForTesting):

2019-09-12  Adrian Perez de Castro  <aperez@igalia.com>

        [GTK][WPE] webkit_settings_set_user_agent() allows content forbidden in HTTP headers
        https://bugs.webkit.org/show_bug.cgi?id=201077

        Reviewed by Carlos Garcia Campos.

        * UIProcess/API/glib/WebKitSettings.cpp:
        (webkit_settings_set_user_agent): Check the passed string using the new
        WebCore::isValidUserAgentHeaderValue() function, and return early without
        changing the setting if the string is not usable in the User-Agent HTTP
        header.

2019-09-12  Mark Lam  <mark.lam@apple.com>

        Harden JSC against the abuse of runtime options.
        https://bugs.webkit.org/show_bug.cgi?id=201597
        <rdar://problem/55167068>

        Reviewed by Filip Pizlo.

        Linux parts contributed by Carlos Garcia Campos <cgarcia@igalia.com>.

        1. Add plumbing to allow WK2 tests to configureJSCForTesting().
        2. Removed the call enable Options::useBigInt in WebInspectorUI.
           WebInspectorUI doesn't really need it for now.

        * PluginProcess/unix/PluginProcessMainUnix.cpp:
        * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h:
        (WebKit::XPCServiceInitializer):
        * Shared/unix/AuxiliaryProcessMain.cpp:
        (WebKit::AuxiliaryProcessMainBase::parseCommandLine):
        * Shared/unix/AuxiliaryProcessMain.h:
        (WebKit::AuxiliaryProcessMain):
        * UIProcess/API/APIProcessPoolConfiguration.cpp:
        (API::ProcessPoolConfiguration::copy):
        * UIProcess/API/APIProcessPoolConfiguration.h:
        * UIProcess/API/C/WKContextConfigurationRef.cpp:
        (WKContextConfigurationSetShouldConfigureJSCForTesting):
        * UIProcess/API/C/WKContextConfigurationRef.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
        (-[_WKProcessPoolConfiguration configureJSCForTesting]):
        (-[_WKProcessPoolConfiguration setConfigureJSCForTesting:]):
        * UIProcess/Launcher/ProcessLauncher.h:
        (WebKit::ProcessLauncher::Client::shouldConfigureJSCForTesting const):
        * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
        (WebKit::ProcessLauncher::launchProcess):
        * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
        (WebKit::ProcessLauncher::launchProcess):
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::shouldConfigureJSCForTesting const):
        * UIProcess/WebProcessProxy.h:
        * WebProcess/WebPage/WebInspectorUI.cpp:
        (WebKit::WebInspectorUI::WebInspectorUI):

2019-09-12  Michael Catanzaro  <mcatanzaro@igalia.com>

        Fix accidental copies in NetworkLoadChecker.cpp
        https://bugs.webkit.org/show_bug.cgi?id=199528

        Reviewed by Youenn Fablet.

        Coverity noticed that we are copying a ResourceRequest and a ContentExtensionResultOrError
        in NetworkLoadChecker::checkRequest by mistake, when the intent was to move them as rvalue
        references.

        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::checkRequest):
        * NetworkProcess/NetworkLoadChecker.h:

2019-09-12  Joseph Pecoraro  <pecoraro@apple.com>

        Web Inspector: Crashes when intercept response continues with original content
        https://bugs.webkit.org/show_bug.cgi?id=201707
        <rdar://problem/55261857>

        Reviewed by David Kilzer.

        * WebProcess/Network/WebResourceLoader.cpp:
        (WebKit::WebResourceLoader::didReceiveData):
        Copy the data for the callback since the deferral may run it much later.

2019-09-12  Youenn Fablet  <youenn@apple.com>

        Use typed identifiers for IDB connection identifiers
        https://bugs.webkit.org/show_bug.cgi?id=201682

        Reviewed by Chris Dumez.

        Remove no longer needed conversion from process identifier to idb connection identifier.

        * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
        * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
        (WebKit::WebIDBConnectionToServer::identifier const):
        * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:

2019-09-12  Charlie Turner  <cturner@igalia.com>

        [GTK] Allow CacheStore::destroyEngine to destroy default engine for soup.
        https://bugs.webkit.org/show_bug.cgi?id=201690

        Reviewed by Carlos Garcia Campos.

        * NetworkProcess/cache/CacheStorageEngine.cpp:
        (WebKit::CacheStorage::Engine::destroyEngine): As we do for
        NetworkProcess::destroySession, also allow destroying the engine
        for the default session for the same reason.

2019-09-12  Youenn Fablet  <youenn@apple.com>

        Use WebProcess processIdentifier to identify Service Worker connections
        https://bugs.webkit.org/show_bug.cgi?id=201459

        Reviewed by Chris Dumez.

        Make WebSWServerConnection be stored in NetworkConnectionToWebProcess.
        They are now keyed by session IDs hence why WebSWClientConnection is using the session ID as message connection ID.
        Creation no longer requires a sync IPC since the connection is uniquely identified by its session ID and its process ID.
        These IDs are stable over network process crash.
        Within NetworkProcess, a server connection is managed by a SWServer which is session ID specific.
        In that case, the process identifier uniquely identifies the connection.

        Move WebSWServerToContextConnection be owned by NetworkConnectionToWebProcess.
        Instead of creating it when webprocess is connecting to network process, use a dedicated IPC message.
        This is similar to WebSWServerConnection once WebProcess asks to create it.
        This will allow existing WebProcess, in cache or running pages, to run service workers as well.
        A context connection map is kept in Network Process to reuse context connections since these connections are not sessionID specific.

        Migrate from a single boolean to a HashSet to track whether some connections are in the process of being created.
        Previously if two requests to create connections were done shortly one after the other on different registrable
        domains, the second request would not be processed.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
        (WebKit::NetworkConnectionToWebProcess::didReceiveSyncMessage):
        (WebKit::NetworkConnectionToWebProcess::didClose):
        (WebKit::NetworkConnectionToWebProcess::establishSWServerConnection):
        (WebKit::NetworkConnectionToWebProcess::establishSWContextConnection):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::didReceiveMessage):
        (WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
        (WebKit::NetworkProcess::forEachSWServer):
        (WebKit::NetworkProcess::needsServerToContextConnectionForRegistrableDomain const):
        (WebKit::NetworkProcess::createServerToContextConnection):
        (WebKit::NetworkProcess::postMessageToServiceWorkerClient):
        (WebKit::NetworkProcess::registerSWServerConnection):
        (WebKit::NetworkProcess::unregisterSWServerConnection):
        (WebKit::NetworkProcess::registerSWContextConnection):
        (WebKit::NetworkProcess::unregisterSWContextConnection):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
        (WebKit::WebSWServerConnection::WebSWServerConnection):
        (WebKit::WebSWServerConnection::postMessageToServiceWorkerClient):
        * NetworkProcess/ServiceWorker/WebSWServerConnection.h:
        * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
        (WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection):
        (WebKit::WebSWServerToContextConnection::~WebSWServerToContextConnection):
        (WebKit::WebSWServerToContextConnection::postMessageToServiceWorkerClient):
        (WebKit::WebSWServerToContextConnection::connectionMayNoLongerBeNeeded):
        * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
        * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::openNetworkProcessConnection):
        (WebKit::NetworkProcessProxy::establishWorkerContextConnectionToNetworkProcess):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/Network/NetworkProcessProxy.messages.in:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::establishServiceWorkerContext):
        * UIProcess/WebProcessProxy.h:
        * WebProcess/Network/NetworkProcessConnection.cpp:
        (WebKit::NetworkProcessConnection::didReceiveMessage):
        (WebKit::NetworkProcessConnection::didClose):
        (WebKit::NetworkProcessConnection::serviceWorkerConnectionForSession):
        * WebProcess/Network/NetworkProcessConnection.h:
        * WebProcess/Storage/WebSWClientConnection.cpp:
        (WebKit::WebSWClientConnection::WebSWClientConnection):
        (WebKit::WebSWClientConnection::~WebSWClientConnection):
        (WebKit::WebSWClientConnection::messageSenderConnection const):
        (WebKit::WebSWClientConnection::scheduleJobInServer):
        (WebKit::WebSWClientConnection::finishFetchingScriptInServer):
        (WebKit::WebSWClientConnection::addServiceWorkerRegistrationInServer):
        (WebKit::WebSWClientConnection::removeServiceWorkerRegistrationInServer):
        (WebKit::WebSWClientConnection::postMessageToServiceWorker):
        (WebKit::WebSWClientConnection::registerServiceWorkerClient):
        (WebKit::WebSWClientConnection::unregisterServiceWorkerClient):
        (WebKit::WebSWClientConnection::didResolveRegistrationPromise):
        (WebKit::WebSWClientConnection::matchRegistration):
        (WebKit::WebSWClientConnection::runOrDelayTaskForImport):
        (WebKit::WebSWClientConnection::whenRegistrationReady):
        (WebKit::WebSWClientConnection::getRegistrations):
        (WebKit::WebSWClientConnection::startFetch):
        (WebKit::WebSWClientConnection::cancelFetch):
        (WebKit::WebSWClientConnection::continueDidReceiveFetchResponse):
        (WebKit::WebSWClientConnection::connectionToServerLost):
        (WebKit::WebSWClientConnection::clear):
        (WebKit::WebSWClientConnection::syncTerminateWorker):
        (WebKit::WebSWClientConnection::updateThrottleState):
        (WebKit::WebSWClientConnection::storeRegistrationsOnDiskForTesting):
        * WebProcess/Storage/WebSWClientConnection.h:
        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        (WebKit::WebSWContextManagerConnection::WebSWContextManagerConnection):
        (WebKit::m_userAgent):
        (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerClient):
        * WebProcess/Storage/WebSWContextManagerConnection.h:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::establishWorkerContextConnectionToNetworkProcess):
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:

2019-09-11  Keith Rollin  <krollin@apple.com>

        Log timeoutValue passed on to CFNetwork
        https://bugs.webkit.org/show_bug.cgi?id=201701
        <rdar://problem/55279683>

        Reviewed by Chris Dumez.

        We occasionally see cases where resource-loads into CFNetwork take a
        long time. Rather than timing out after the default of 60s, they stay
        pending for many minutes. To better understand why this is happening,
        log the timeoutValue we pass to CFNetwork when loading resources.

        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::startNetworkLoad):

2019-09-11  Youenn Fablet  <youenn@apple.com>

        Protect UserMediaRequest when stopping it
        https://bugs.webkit.org/show_bug.cgi?id=201687
        <rdar://problem/55241215>

        Reviewed by Eric Carlson.

        By removing the request from the map, we may destroy the request.
        To make sure it stays alive, take the request from the map.

        * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
        (WebKit::UserMediaPermissionRequestManager::cancelUserMediaRequest):

2019-09-11  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r249768.

        Caused 4 API tests to assert, perf test failures, and layout
        test crashes under ASan

        Reverted changeset:

        "Remove unnecessary abstractions around WebsiteDataStore"
        https://bugs.webkit.org/show_bug.cgi?id=201655
        https://trac.webkit.org/changeset/249768

2019-09-11  Simon Fraser  <simon.fraser@apple.com>

        REGRESSION (iOS 13): Top fixed element on apple.com flickers in size while pinching in
        https://bugs.webkit.org/show_bug.cgi?id=201668
        rdar://problem/51934041

        Reviewed by Frédéric Wang.

        The UI process can have transient state that pushes scrolling-tree-managed layers into custom
        locations while pinch-zooming. We have to apply this state both when the visible rects
        in the UI process change (existing code in -[WKContentView didUpdateVisibleRect:...]) and when
        we get new layers from the web process (added in RemoteLayerTreeDrawingAreaProxy::commitLayerTree()
        in this patch).

        Move some code into WebPageProxy to create functions that we can call from both places.

        For manual testing, visit a page with fixed banners, pinch in slightly, then pinch out and,
        while keeping your fingers down, move the contents around.

        * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
        (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/WKContentView.mm:
        (-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::unconstrainedLayoutViewportRect const):
        (WebKit::WebPageProxy::adjustLayersForLayoutViewport):

2019-09-11  Antti Koivisto  <antti@apple.com>

        REGRESSION (245006): can't scroll in "read more" view in Eventbrite app
        https://bugs.webkit.org/show_bug.cgi?id=201683
        <rdar://problem/54582602>

        Reviewed by Simon Fraser.

        Content <body> has 'overflow:hidden'.

        * UIProcess/Cocoa/VersionChecks.h:
        * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
        (WebKit::RemoteScrollingCoordinatorProxy::hasScrollableMainFrame const):

        Fix by adding an app specific LinkedOnOrAfter quirk that always allows main frame scrolling.

2019-09-11  Alex Christensen  <achristensen@webkit.org>

        Remove unnecessary abstractions around WebsiteDataStore
        https://bugs.webkit.org/show_bug.cgi?id=201655

        Reviewed by Chris Dumez.

        This patch does four things to simplify WebsiteDataStore code:
        1. It removes API::WebsiteDataStore, which was just an unnecessary wrapper around WebKit::WebsiteDataStore.
        2. It deprecates the unused aliases of WebsiteDataStore, WKApplicationCacheManagerRef and WKKeyValueStorageManagerRef
        3. It removes the unused APIProcessPoolConfiguration properties that have been moved to WebsiteDataStore.
        4. It makes WKWebsiteDataStore._delegate weak instead of strong, as already annotated in WKWebsiteDataStorePrivate.h
        There should be no change in behavior from this patch.

        * PlatformFTW.cmake:
        * PlatformWin.cmake:
        * Sources.txt:
        * SourcesCocoa.txt:
        * SourcesGTK.txt:
        * SourcesWPE.txt:
        * UIProcess/API/APIHTTPCookieStore.cpp:
        * UIProcess/API/APIHTTPCookieStore.h:
        * UIProcess/API/APIPageConfiguration.cpp:
        (API::PageConfiguration::websiteDataStore):
        (API::PageConfiguration::setWebsiteDataStore):
        * UIProcess/API/APIPageConfiguration.h:
        * UIProcess/API/APIProcessPoolConfiguration.cpp:
        (API::ProcessPoolConfiguration::ProcessPoolConfiguration):
        (API::ProcessPoolConfiguration::copy):
        (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration): Deleted.
        * UIProcess/API/APIProcessPoolConfiguration.h:
        * UIProcess/API/APIWebsiteDataStore.cpp: Removed.
        * UIProcess/API/APIWebsiteDataStore.h: Removed.
        * UIProcess/API/APIWebsitePolicies.cpp:
        (API::WebsitePolicies::data):
        * UIProcess/API/APIWebsitePolicies.h:
        * UIProcess/API/C/WKAPICast.h:
        * UIProcess/API/C/WKApplicationCacheManager.cpp:
        (WKApplicationCacheManagerGetTypeID):
        (WKApplicationCacheManagerGetApplicationCacheOrigins):
        (WKApplicationCacheManagerDeleteEntriesForOrigin):
        (WKApplicationCacheManagerDeleteAllEntries):
        * UIProcess/API/C/WKApplicationCacheManager.h:
        * UIProcess/API/C/WKFramePolicyListener.cpp:
        (useWithPolicies):
        * UIProcess/API/C/WKKeyValueStorageManager.cpp:
        (WKKeyValueStorageManagerGetTypeID):
        (WKKeyValueStorageManagerGetOriginKey):
        (WKKeyValueStorageManagerGetCreationTimeKey):
        (WKKeyValueStorageManagerGetModificationTimeKey):
        (WKKeyValueStorageManagerGetKeyValueStorageOrigins):
        (WKKeyValueStorageManagerGetStorageDetailsByOrigin):
        (WKKeyValueStorageManagerDeleteEntriesForOrigin):
        (WKKeyValueStorageManagerDeleteAllEntries):
        * UIProcess/API/C/WKKeyValueStorageManager.h:
        * UIProcess/API/C/WKResourceCacheManager.cpp:
        (WKResourceCacheManagerGetTypeID):
        (WKResourceCacheManagerGetCacheOrigins):
        (WKResourceCacheManagerClearCacheForOrigin):
        (WKResourceCacheManagerClearCacheForAllOrigins):
        (toWebsiteDataTypes): Deleted.
        * UIProcess/API/C/WKResourceCacheManager.h:
        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreGetTypeID):
        (WKWebsiteDataStoreGetDefaultDataStore):
        (WKWebsiteDataStoreCreateNonPersistentDataStore):
        (WKWebsiteDataStoreCreateWithConfiguration):
        (WKWebsiteDataStoreGetHTTPCookieStore):
        (WKWebsiteDataStoreSetResourceLoadStatisticsDebugModeWithCompletionHandler):
        (WKWebsiteDataStoreSetResourceLoadStatisticsPrevalentResourceForDebugMode):
        (WKWebsiteDataStoreSetStatisticsLastSeen):
        (WKWebsiteDataStoreSetStatisticsPrevalentResource):
        (WKWebsiteDataStoreSetStatisticsVeryPrevalentResource):
        (WKWebsiteDataStoreDumpResourceLoadStatistics):
        (WKWebsiteDataStoreIsStatisticsPrevalentResource):
        (WKWebsiteDataStoreIsStatisticsVeryPrevalentResource):
        (WKWebsiteDataStoreIsStatisticsRegisteredAsSubresourceUnder):
        (WKWebsiteDataStoreIsStatisticsRegisteredAsSubFrameUnder):
        (WKWebsiteDataStoreIsStatisticsRegisteredAsRedirectingTo):
        (WKWebsiteDataStoreSetStatisticsHasHadUserInteraction):
        (WKWebsiteDataStoreIsStatisticsHasHadUserInteraction):
        (WKWebsiteDataStoreSetStatisticsGrandfathered):
        (WKWebsiteDataStoreIsStatisticsGrandfathered):
        (WKWebsiteDataStoreSetStatisticsSubframeUnderTopFrameOrigin):
        (WKWebsiteDataStoreSetStatisticsSubresourceUnderTopFrameOrigin):
        (WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectTo):
        (WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectFrom):
        (WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectTo):
        (WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectFrom):
        (WKWebsiteDataStoreSetStatisticsCrossSiteLoadWithLinkDecoration):
        (WKWebsiteDataStoreSetStatisticsTimeToLiveUserInteraction):
        (WKWebsiteDataStoreStatisticsProcessStatisticsAndDataRecords):
        (WKWebsiteDataStoreStatisticsUpdateCookieBlocking):
        (WKWebsiteDataStoreStatisticsSubmitTelemetry):
        (WKWebsiteDataStoreSetStatisticsNotifyPagesWhenDataRecordsWereScanned):
        (WKWebsiteDataStoreSetStatisticsIsRunningTest):
        (WKWebsiteDataStoreSetStatisticsShouldClassifyResourcesBeforeDataRecordsRemoval):
        (WKWebsiteDataStoreSetStatisticsNotifyPagesWhenTelemetryWasCaptured):
        (WKWebsiteDataStoreSetStatisticsMinimumTimeBetweenDataRecordsRemoval):
        (WKWebsiteDataStoreSetStatisticsGrandfatheringTime):
        (WKWebsiteDataStoreSetStatisticsMaxStatisticsEntries):
        (WKWebsiteDataStoreSetStatisticsPruneEntriesDownTo):
        (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore):
        (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
        (WKWebsiteDataStoreStatisticsClearThroughWebsiteDataRemoval):
        (WKWebsiteDataStoreStatisticsDeleteCookiesForTesting):
        (WKWebsiteDataStoreStatisticsHasLocalStorage):
        (WKWebsiteDataStoreSetStatisticsCacheMaxAgeCap):
        (WKWebsiteDataStoreStatisticsHasIsolatedSession):
        (WKWebsiteDataStoreStatisticsResetToConsistentState):
        (WKWebsiteDataStoreRemoveAllFetchCaches):
        (WKWebsiteDataStoreRemoveFetchCacheForOrigin):
        (WKWebsiteDataStoreRemoveAllIndexedDatabases):
        (WKWebsiteDataStoreRemoveLocalStorage):
        (WKWebsiteDataStoreRemoveAllServiceWorkerRegistrations):
        (WKWebsiteDataStoreGetFetchCacheOrigins):
        (WKWebsiteDataStoreGetFetchCacheSizeForOrigin):
        (WKWebsiteDataStoreCopyServiceWorkerRegistrationDirectory):
        (WKWebsiteDataStoreSetServiceWorkerRegistrationDirectory):
        (WKWebsiteDataStoreSetPerOriginStorageQuota):
        (WKWebsiteDataStoreClearAllDeviceOrientationPermissions):
        (WKWebsiteDataStoreSetWebAuthenticationMockConfiguration):
        (WKWebsiteDataStoreClearAdClickAttributionsThroughWebsiteDataRemoval):
        * UIProcess/API/C/WKWebsitePolicies.cpp:
        * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm: Removed.
        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (+[WKWebsiteDataStore defaultDataStore]):
        (+[WKWebsiteDataStore nonPersistentDataStore]):
        (-[WKWebsiteDataStore dealloc]):
        (-[WKWebsiteDataStore httpCookieStore]):
        (-[WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]):
        (-[WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:]):
        (+[WKWebsiteDataStore _defaultDataStoreExists]):
        (+[WKWebsiteDataStore _deleteDefaultDataStoreForTesting]):
        (-[WKWebsiteDataStore _initWithConfiguration:]):
        (-[WKWebsiteDataStore _fetchDataRecordsOfTypes:withOptions:completionHandler:]):
        (-[WKWebsiteDataStore _resourceLoadStatisticsEnabled]):
        (-[WKWebsiteDataStore _setResourceLoadStatisticsEnabled:]):
        (-[WKWebsiteDataStore _resourceLoadStatisticsDebugMode]):
        (-[WKWebsiteDataStore _setResourceLoadStatisticsDebugMode:]):
        (-[WKWebsiteDataStore _perOriginStorageQuota]):
        (-[WKWebsiteDataStore _setPerOriginStorageQuota:]):
        (-[WKWebsiteDataStore _cacheStorageDirectory]):
        (-[WKWebsiteDataStore _setCacheStorageDirectory:]):
        (-[WKWebsiteDataStore _serviceWorkerRegistrationDirectory]):
        (-[WKWebsiteDataStore _setServiceWorkerRegistrationDirectory:]):
        (-[WKWebsiteDataStore _setBoundInterfaceIdentifier:]):
        (-[WKWebsiteDataStore _boundInterfaceIdentifier]):
        (-[WKWebsiteDataStore _setAllowsCellularAccess:]):
        (-[WKWebsiteDataStore _allowsCellularAccess]):
        (-[WKWebsiteDataStore _setProxyConfiguration:]):
        (-[WKWebsiteDataStore _sourceApplicationBundleIdentifier]):
        (-[WKWebsiteDataStore _setSourceApplicationBundleIdentifier:]):
        (-[WKWebsiteDataStore _sourceApplicationSecondaryIdentifier]):
        (-[WKWebsiteDataStore _setSourceApplicationSecondaryIdentifier:]):
        (-[WKWebsiteDataStore _setAllowsTLSFallback:]):
        (-[WKWebsiteDataStore _allowsTLSFallback]):
        (-[WKWebsiteDataStore _proxyConfiguration]):
        (-[WKWebsiteDataStore _indexedDBDatabaseDirectory]):
        (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldSubmitTelemetry:]):
        (-[WKWebsiteDataStore _setResourceLoadStatisticsTestingCallback:]):
        (-[WKWebsiteDataStore _getAllStorageAccessEntriesFor:completionHandler:]):
        (-[WKWebsiteDataStore _scheduleCookieBlockingUpdate:]):
        (-[WKWebsiteDataStore _setPrevalentDomain:completionHandler:]):
        (-[WKWebsiteDataStore _getIsPrevalentDomain:completionHandler:]):
        (-[WKWebsiteDataStore _clearPrevalentDomain:completionHandler:]):
        (-[WKWebsiteDataStore _processStatisticsAndDataRecords:]):
        (-[WKWebsiteDataStore _hasRegisteredServiceWorker]):
        (-[WKWebsiteDataStore _delegate]):
        (-[WKWebsiteDataStore set_delegate:]):
        * UIProcess/API/Cocoa/WKWebsiteDataStoreInternal.h:
        * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp: Removed.
        * UIProcess/API/win/APIWebsiteDataStoreWin.cpp:
        (API::WebsiteDataStore::defaultApplicationCacheDirectory): Deleted.
        (API::WebsiteDataStore::defaultCacheStorageDirectory): Deleted.
        (API::WebsiteDataStore::defaultNetworkCacheDirectory): Deleted.
        (API::WebsiteDataStore::defaultIndexedDBDatabaseDirectory): Deleted.
        (API::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory): Deleted.
        (API::WebsiteDataStore::defaultLocalStorageDirectory): Deleted.
        (API::WebsiteDataStore::defaultMediaKeysStorageDirectory): Deleted.
        (API::WebsiteDataStore::defaultWebSQLDatabaseDirectory): Deleted.
        (API::WebsiteDataStore::defaultResourceLoadStatisticsDirectory): Deleted.
        (API::WebsiteDataStore::cacheDirectoryFileSystemRepresentation): Deleted.
        (API::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation): Deleted.
        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::addSingleCookie):
        (WebKit::WebAutomationSession::deleteAllCookies):
        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::NetworkProcessProxy):
        (WebKit::NetworkProcessProxy::websiteDataStoreFromSessionID):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/WebFramePolicyListenerProxy.cpp:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::WebPageProxy):
        (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::m_webProcessCache):
        (WebKit::WebProcessPool::ensureNetworkProcess):
        (WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess):
        (WebKit::WebProcessPool::resolvePathsForSandboxExtensions):
        (WebKit::WebProcessPool::tryTakePrewarmedProcess):
        (WebKit::WebProcessPool::sendWebProcessDataStoreParameters):
        (WebKit::WebProcessPool::processDidFinishLaunching):
        (WebKit::WebProcessPool::processForRegistrableDomain):
        (WebKit::WebProcessPool::createWebPage):
        (WebKit::WebProcessPool::mayHaveRegisteredServiceWorkers):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::defaultApplicationCacheDirectory):
        (WebKit::WebsiteDataStore::defaultCacheStorageDirectory):
        (WebKit::WebsiteDataStore::defaultNetworkCacheDirectory):
        (WebKit::WebsiteDataStore::defaultMediaCacheDirectory):
        (WebKit::WebsiteDataStore::defaultIndexedDBDatabaseDirectory):
        (WebKit::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory):
        (WebKit::WebsiteDataStore::defaultLocalStorageDirectory):
        (WebKit::WebsiteDataStore::defaultMediaKeysStorageDirectory):
        (WebKit::WebsiteDataStore::defaultWebSQLDatabaseDirectory):
        (WebKit::WebsiteDataStore::defaultResourceLoadStatisticsDirectory):
        (WebKit::WebsiteDataStore::defaultJavaScriptConfigurationDirectory):
        (WebKit::WebsiteDataStore::tempDirectoryFileSystemRepresentation):
        (WebKit::WebsiteDataStore::cacheDirectoryFileSystemRepresentation):
        (WebKit::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation):
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::globalDefaultDataStore):
        (WebKit::WebsiteDataStore::defaultDataStore):
        (WebKit::WebsiteDataStore::deleteDefaultDataStoreForTesting):
        (WebKit::WebsiteDataStore::defaultDataStoreExists):
        (WebKit::WebsiteDataStore::defaultDataStoreConfiguration):
        (WebKit::WebsiteDataStore::isAssociatedProcessPool const):
        (WebKit::WebsiteDataStore::processPools const):
        (WebKit::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory):
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
        (WebKit::WebsiteDataStoreConfiguration::WebsiteDataStoreConfiguration):
        * UIProcess/WebsiteData/win/WebsiteDataStoreWin.cpp:
        (WebKit::WebsiteDataStore::defaultApplicationCacheDirectory):
        (WebKit::WebsiteDataStore::defaultCacheStorageDirectory):
        (WebKit::WebsiteDataStore::defaultNetworkCacheDirectory):
        (WebKit::WebsiteDataStore::defaultIndexedDBDatabaseDirectory):
        (WebKit::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory):
        (WebKit::WebsiteDataStore::defaultLocalStorageDirectory):
        (WebKit::WebsiteDataStore::defaultMediaKeysStorageDirectory):
        (WebKit::WebsiteDataStore::defaultWebSQLDatabaseDirectory):
        (WebKit::WebsiteDataStore::defaultResourceLoadStatisticsDirectory):
        (WebKit::WebsiteDataStore::cacheDirectoryFileSystemRepresentation):
        (WebKit::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation):
        * UIProcess/glib/WebsiteDataStoreGLib.cpp: Copied from Source/WebKit/UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp.
        (API::WebsiteDataStore::defaultApplicationCacheDirectory): Deleted.
        (API::WebsiteDataStore::defaultNetworkCacheDirectory): Deleted.
        (API::WebsiteDataStore::defaultCacheStorageDirectory): Deleted.
        (API::WebsiteDataStore::defaultIndexedDBDatabaseDirectory): Deleted.
        (API::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory): Deleted.
        (API::WebsiteDataStore::defaultLocalStorageDirectory): Deleted.
        (API::WebsiteDataStore::defaultMediaKeysStorageDirectory): Deleted.
        (API::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory): Deleted.
        (API::WebsiteDataStore::defaultWebSQLDatabaseDirectory): Deleted.
        (API::WebsiteDataStore::defaultHSTSDirectory): Deleted.
        (API::WebsiteDataStore::defaultResourceLoadStatisticsDirectory): Deleted.
        (API::WebsiteDataStore::cacheDirectoryFileSystemRepresentation): Deleted.
        (API::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation): Deleted.
        * WebKit.xcodeproj/project.pbxproj:

2019-09-11  Antoine Quint  <graouts@apple.com>

        REGRESSION: Scrubbing on ted.com does not work well
        https://bugs.webkit.org/show_bug.cgi?id=201635
        <rdar://problem/51463649>

        Reviewed by Dean Jackson.

        This website uses custom media controls that simply don't work well on iOS when the User-Agent string is the desktop one, so we default to the mobile UA.

        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::desktopClassBrowsingRecommendedForRequest):

2019-09-10  Tim Horton  <timothy_horton@apple.com>

        REGRESSION (r233780): After swiping to navigate back, pinching to zoom in on webcontent snaps back to zoomed out when letting go
        https://bugs.webkit.org/show_bug.cgi?id=201671
        <rdar://problem/50488372>

        Reviewed by Simon Fraser.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::didCommitLoad):
        Reset m_lastTransactionIDWithScaleChange, since it is not guaranteed
        to only march forward. Otherwise, we can get stuck with a very large
        m_lastTransactionIDWithScaleChange, and will not allow stable-state
        user-driven zooms until the current transactionID exceeds it.

2019-09-10  Chris Dumez  <cdumez@apple.com>

        Nullptr crash in Page::sessionID() via WebKit::WebFrameLoaderClient::detachedFromParent2()
        https://bugs.webkit.org/show_bug.cgi?id=201625

        Reviewed by Ryosuke Niwa.

        This is based on a patch from Ryosuke Niwa.

        The crash was caused by WebFrameLoaderClient::sessionID() calling WebPage::sessionID() without
        checking the nullity of WebPage::m_page which can be null. Added a null check.

        Because passing a wrong session to RemoveStorageAccessForFrame could result in a leak, this patch
        also replaces m_hasFrameSpecificStorageAccess boolean with an optioanl struct which stores
        session ID, frame ID, and page ID even after WebCore::Frame or WebCore::Page had been cleared
        or before WebFrameLoaderClient::m_frame is set.

        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::sessionID const):
        (WebKit::WebFrameLoaderClient::setHasFrameSpecificStorageAccess):
        (WebKit::WebFrameLoaderClient::detachedFromParent2):
        (WebKit::WebFrameLoaderClient::dispatchWillChangeDocument):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
        * WebProcess/WebPage/WebFrame.h:
        (WebKit::WebFrame::frameLoaderClient const):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::requestStorageAccess):

2019-09-10  Brady Eidson  <beidson@apple.com>

        Add SPI to save a PDF from the contents of a WKWebView.
        <rdar://problem/48955900> and https://bugs.webkit.org/show_bug.cgi?id=195765

        Reviewed by Tim Horton.

        This is refactoring a combination of "snapshotFirstPage" PDF printing code and the
        "takeSnapshot" API code to capture the on-screen visible page to a PDF at full fidelity.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _takePDFSnapshotWithConfiguration:completionHandler:]):
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::drawToPDF):
        (WebKit::WebPageProxy::drawToPDFCallback):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:

        * UIProcess/ios/WKContentView.mm:
        (-[WKContentView _wk_pageCountForPrintFormatter:]):

        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::drawToPDFCallback): Move to cross platform WebPageProxy.

        * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
        (WebKit::WebPage::pdfSnapshotAtSize):

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::pdfSnapshotAtSize): Instead of assuming 1 page capped at 200 inches,
          paginate every 200 inches.
        (WebKit::WebPage::drawToPDF):
        (WebKit::paintSnapshotAtSize): Deleted.
        (WebKit::WebPage::pdfSnapshotAtSize): Deleted.
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2019-09-10  Chris Dumez  <cdumez@apple.com>

        Hangs on Swiss.com due to the web process being blocked on StorageAreaMap::LoadValuesIfNeeded
        https://bugs.webkit.org/show_bug.cgi?id=201644
        <rdar://problem/54942761>

        Reviewed by Geoffrey Garen.

        Mark the StorageManagerSet::GetValues sync IPC from the WebContent process to the Network
        process with a UnboundedSynchronousIPCScope so that it will process critical sync IPC
        from the UIProcess (such as WebPage::GetPositionInformation) while waiting for a reply.

        * WebProcess/WebStorage/StorageAreaMap.cpp:
        (WebKit::StorageAreaMap::loadValuesIfNeeded):

2019-09-10  David Quesada  <david_quesada@apple.com>

        Remove a leftover reference to the StorageProcess
        https://bugs.webkit.org/show_bug.cgi?id=192759

        Reviewed by Alex Christensen.

        * WebKit.xcodeproj/project.pbxproj:
            Remove com.apple.WebKit.Storage.sb as an input file to the "Copy iOS Sandbox Profiles
            for Manual Sandboxing" build phase. The file no longer exists.

2019-09-10  Adrian Perez de Castro  <aperez@igalia.com>

        [GTK][WPE] Fixes for non-unified builds after r249022
        https://bugs.webkit.org/show_bug.cgi?id=201610

        Reviewed by Joseph Pecoraro.

        * NetworkProcess/NetworkCORSPreflightChecker.h: Add missing inclusion of the WebPageProxyIdentifier.h header.
        * NetworkProcess/NetworkLoadChecker.h: Add missing inclusion of the WebPageProxyIdentifier.h header.

2019-09-10  Youenn Fablet  <youenn@apple.com>

        UserMediaProcessManager is revoking sandbox extensions too aggressively
        https://bugs.webkit.org/show_bug.cgi?id=201638

        Reviewed by Eric Carlson.

        Sandbox revocation was sometimes happening when a page is being closed while another page from the same process is starting capture.
        In that case, revocation might happen while it should not.
        To prevent this, we do not revoke sandbox extensions if there are pending captures for a page of the process.
        Whenever a page does not have any pending capture, sandbox extensions may be revoked.

        Covered by OnDeviceChangeCrash API test in debug mode.

        * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
        (WebKit::UserMediaPermissionRequestManagerProxy::finishGrantingRequest):
        * UIProcess/UserMediaPermissionRequestManagerProxy.h:
        (WebKit::UserMediaPermissionRequestManagerProxy::hasPendingCapture const):
        * UIProcess/UserMediaProcessManager.cpp:
        (WebKit::UserMediaProcessManager::revokeSandboxExtensionsIfNeeded):

2019-09-09  Chris Dumez  <cdumez@apple.com>

        [iOS] We sometimes attempt to use a terminated prewarmed WebContent process
        https://bugs.webkit.org/show_bug.cgi?id=201614
        <rdar://problem/54714507>

        Reviewed by Geoffrey Garen.

        On iOS, it is possible for our processes to get terminated (e.g. jetsammed) while the UIProcess
        is suspended. Upon resuming, it takes a little while for the UIProcess to get the notification
        that the mac connection to its child process has been severed and the UIProcess may try to use
        it for a load. This is especially problematic for prewarmed process because the client will end
        up showing a crash banner and reloading when we could have used a new process rather the prewarmed
        one if we had known it was dead.

        This patch makes 2 improvements:
        1. It makes AuxiliaryProcessProxy::state() return Terminated if we still have a connection but
           the PID is not the PID of a running process. I also added a check in tryTakePrewarmedProcess()
           to not use the prewarmed process if it state() is Terminated.
        2. When the UIProcess is about to get suspended, have the process pools terminate their non-critical
           processes (i.e. prewarmed + the ones used for PageCache). This makes WebKit friendlier with
           other apps on the system when suspended with regards to memory. Also, it makes it less likely
           useful WebContent processes will get jetsammed.

        * UIProcess/AuxiliaryProcessProxy.cpp:
        (WebKit::AuxiliaryProcessProxy::state const):
        (WebKit::AuxiliaryProcessProxy::isRunningProcessPID):
        * UIProcess/AuxiliaryProcessProxy.h:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::applicationIsAboutToSuspend):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::tryTakePrewarmedProcess):
        * UIProcess/WebProcessPool.h:
        * UIProcess/ios/ProcessAssertionIOS.mm:
        (-[WKProcessAssertionBackgroundTaskManager init]):
        (-[WKProcessAssertionBackgroundTaskManager _releaseBackgroundTask]):

2019-09-09  Chris Dumez  <cdumez@apple.com>

        REGRESSION: http/tests/resourceLoadStatistics/do-not-capture-statistics-for-simple-top-navigations.html is frequently timing out on iOS EWS bots
        https://bugs.webkit.org/show_bug.cgi?id=201550

        Reviewed by Alex Christensen.

        * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
        (WKBundleResourceLoadStatisticsNotifyObserver):
        * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:

2019-09-09  Alex Christensen  <achristensen@webkit.org>

        Disable TLS 1.0 and 1.1 in WebSockets
        https://bugs.webkit.org/show_bug.cgi?id=201573

        Reviewed by Youenn Fablet.

        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
        (WebKit::NetworkProcessCreationParameters::decode):
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _allowAnyTLSCertificateForWebSocketTesting]):
        * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeNetworkProcess):

2019-09-09  Tim Horton  <timothy_horton@apple.com>

        Clarify some macCatalyst feature flags
        https://bugs.webkit.org/show_bug.cgi?id=201619
        <rdar://problem/54615618>

        Reviewed by Megan Gardner.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView setupInteraction]):
        (-[WKContentView cleanupInteraction]):
        (-[WKContentView _removeDefaultGestureRecognizers]):
        (-[WKContentView _addDefaultGestureRecognizers]):
        (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
        (-[WKContentView _showShareSheet:inRect:completionHandler:]):
        We prefer specific flags over platform checks.

2019-09-09  Chris Dumez  <cdumez@apple.com>

        Stop using testRunner.setPrivateBrowsingEnabled_DEPRECATED() in http/tests/adClickAttribution/conversion-disabled-in-ephemeral-session.html
        https://bugs.webkit.org/show_bug.cgi?id=201596

        Reviewed by Alex Christensen.

        Allow WKFramePolicyListenerUseWithPolicies() C API to switch to a persistent non-default session.
        This is important since WebKitTestRunner is not using the default session anymore and I need to
        be able to switch it back to its normal session after going to an ephemeral one.

        * UIProcess/API/C/WKFramePolicyListener.cpp:
        (useWithPolicies):

2019-09-09  Alex Christensen  <achristensen@webkit.org>

        Deprecate unused SPI to preconnect to a server
        https://bugs.webkit.org/show_bug.cgi?id=201558

        Reviewed by Youenn Fablet.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::preconnectTo): Deleted.
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * UIProcess/API/C/WKContext.cpp:
        (WKContextPreconnectToServer):
        * UIProcess/API/C/WKContextPrivate.h:
        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _preconnectToServer:]):
        * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::preconnectToServer): Deleted.
        * UIProcess/WebProcessPool.h:

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

        Unreviewed Windows build fix.

        * WebProcess/WebPage/WebPage.h:

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

        [macOS] Pid is sometimes invalid when creating sandbox extensions by pid.
        https://bugs.webkit.org/show_bug.cgi?id=201543
        <rdar://problem/54733465>

        Reviewed by Brent Fulgham.

        There is a race condition when starting a load of a local file, where the WebContent process has not finished
        launching yet, and its pid is not available. When we try to create a sandbox extension by using the pid of the
        WebContent process, it is not available in the cases where the WebContent process has just launched and has not
        finished launching yet. This patch creates a new dummy Web page message, 'LoadRequestWaitingForPID', which will
        be sent instead of a normal 'LoadRequest' message, and only when the WebContent process has not finished
        launching. When the WebContent process has finished launching, and we are about to actually send the pending
        messages, we can detect that a 'LoadRequestWaitingForPID' has been appended for sending, and replace it with a
        normal 'LoadReqest' message where we have created the sandbox extension issue with a valid pid. The message
        'LoadRequestWaitingForPID' is never intended to reach the WebContent process, it is just there to replace with
        a normal 'LoadRequest' message with a new sandbox extension. In the implementation of the message handler on
        the WebContent process side, we assert that the method is never called. This patch makes sure the ordering of
        the Web page messages are the same, even when we modify the message.

        * UIProcess/AuxiliaryProcessProxy.cpp:
        (WebKit::AuxiliaryProcessProxy::didFinishLaunching):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
        (WebKit::WebPageProxy::loadRequestWithNavigationShared):
        (WebKit::WebPageProxy::loadFile):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::fileLoadRequest):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2019-09-09  Youenn Fablet  <youenn@apple.com>

        Remove ServiceWorkerProcessProxy
        https://bugs.webkit.org/show_bug.cgi?id=201506

        Reviewed by Chris Dumez.

        Instead of using a specific ServiceWorkerProcessProxy, move the logic directly in WebProcessProxy.
        This will allow us in the future to run a service worker in a process that already runs a web page,
        thus saving the need to spin off a new process.

        This patch adds a new WebProcessProxy::createForServiceWorkers method instead of creating a
        ServiceWorkerProcessProxy. The behavior is then similar: a process running a service worker cannot run a page.

        * Sources.txt:
        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _hasRegisteredServiceWorker]):
        * UIProcess/BackgroundProcessResponsivenessTimer.cpp:
        (WebKit::BackgroundProcessResponsivenessTimer::shouldBeActive const):
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::openNetworkProcessConnection):
        * UIProcess/ServiceWorkerProcessProxy.cpp: Removed.
        * UIProcess/ServiceWorkerProcessProxy.h: Removed.
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess):
        (WebKit::WebProcessPool::disconnectProcess):
        (WebKit::WebProcessPool::processForRegistrableDomain):
        (WebKit::WebProcessPool::createWebPage):
        (WebKit::WebProcessPool::updateServiceWorkerUserAgent):
        (WebKit::WebProcessPool::mayHaveRegisteredServiceWorkers):
        (WebKit::WebProcessPool::updateProcessAssertions):
        (WebKit::WebProcessPool::isServiceWorkerPageID const):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::createForServiceWorkers):
        (WebKit::WebProcessProxy::getLaunchOptions):
        (WebKit::WebProcessProxy::didBecomeUnresponsive):
        (WebKit::WebProcessProxy::canBeAddedToWebProcessCache const):
        (WebKit::WebProcessProxy::didSetAssertionState):
        (WebKit::WebProcessProxy::didExceedCPULimit):
        (WebKit::WebProcessProxy::establishServiceWorkerContext):
        (WebKit::WebProcessProxy::setServiceWorkerUserAgent):
        (WebKit::WebProcessProxy::updateServiceWorkerPreferencesStore):
        * UIProcess/WebProcessProxy.h:
        (WebKit::WebProcessProxy::isRunningServiceWorkers const):
        (WebKit::WebProcessProxy::hasServiceWorkerPageProxy):
        * UIProcess/glib/WebProcessPoolGLib.cpp:
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        * WebKit.xcodeproj/project.pbxproj:

2019-09-09  Youenn Fablet  <youenn@apple.com>

        Use WebProcess processIdentifier to identify IDB connections between WebProcess and NetworkProcess
        https://bugs.webkit.org/show_bug.cgi?id=201419

        Reviewed by Alex Christensen.

        We change from an identifier generated by NetworkProcess to WebProcess identifier.
        A WebProcess identifier is unique globally and is stable even in case of NetworkProcess crash.
        This removes the need for a sync IPC and makes things more easy to handle in case of NetworkProcess crash.

        * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
        (WebKit::WebIDBConnectionToClient::create):
        (WebKit::WebIDBConnectionToClient::WebIDBConnectionToClient):
        (WebKit::WebIDBConnectionToClient::getAllDatabaseNames):
        * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
        * NetworkProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
        (WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer):
        (WebKit::WebIDBConnectionToServer::identifier const):
        (WebKit::WebIDBConnectionToServer::coreConnectionToServer):
        (WebKit::WebIDBConnectionToServer::getAllDatabaseNames):
        * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
        * WebProcess/Network/NetworkProcessConnection.cpp:
        (WebKit::NetworkProcessConnection::didReceiveMessage):
        (WebKit::NetworkProcessConnection::didClose):
        (WebKit::NetworkProcessConnection::idbConnectionToServerForSession):
        * WebProcess/Network/NetworkProcessConnection.h:
        (WebKit::NetworkProcessConnection::existingIDBConnectionToServer const):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::networkProcessConnectionClosed):

2019-09-09  Youenn Fablet  <youenn@apple.com>

        Move checkProcessLocalPortForActivity from provider to registry
        https://bugs.webkit.org/show_bug.cgi?id=201400

        Reviewed by Alex Christensen.

        Implement registry callback at NetworkProcess level.
        Remove NetworkMessagePortChannelProvider since only a registry is now needed.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        * NetworkProcess/NetworkMessagePortChannelProvider.cpp: Removed.
        * NetworkProcess/NetworkMessagePortChannelProvider.h: Removed.
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::createMessagePortChannelRegistry):
        (WebKit::m_messagePortChannelRegistry):
        (WebKit::m_messagePortChannelProvider): Deleted.
        * NetworkProcess/NetworkProcess.h:
        (WebKit::NetworkProcess::messagePortChannelRegistry):
        * Sources.txt:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebCoreSupport/WebMessagePortChannelProvider.cpp:
        (WebKit::WebMessagePortChannelProvider::checkProcessLocalPortForActivity): Deleted.
        * WebProcess/WebCoreSupport/WebMessagePortChannelProvider.h:

2019-09-08  David Quesada  <david_quesada@apple.com>

        Remove some unused constants in VersionChecks.h
        https://bugs.webkit.org/show_bug.cgi?id=201599

        Reviewed by Youenn Fablet.

        * UIProcess/Cocoa/VersionChecks.h:
            Remove two macros that are unused as of r244512.

2019-09-08  Wenson Hsieh  <wenson_hsieh@apple.com>

        [macCatalyst] The last typed character in password fields shouldn't be echoed
        https://bugs.webkit.org/show_bug.cgi?id=201595
        <rdar://problem/55166367>

        Reviewed by Tim Horton.

        Disable password echoing on macCatalyst, to better match behavior on macOS.

        * Shared/WebPreferencesDefaultValues.h:

2019-09-07  Chris Dumez  <cdumez@apple.com>

        Rewrite http/tests/workers/service/serviceworker-private-browsing.https.html as an API test
        https://bugs.webkit.org/show_bug.cgi?id=201574

        Reviewed by Alex Christensen.

        Update Service Workers so that they obey the "secureContextChecksEnabled" preference.
        This was needed to allow my service worker to access self.caches in my API test.

        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        (WebKit::WebSWContextManagerConnection::updatePreferencesStore):

2019-09-07  Tim Horton  <timothy_horton@apple.com>

        Marking up a note on iOS results in a PDF with no contents
        https://bugs.webkit.org/show_bug.cgi?id=201530
        <rdar://problem/53686019>

        Unreviewed follow-up.

        * UIProcess/ios/WKContentView.mm:
        (-[WKContentView _waitForDrawToPDFCallback]):
        Remove an ASSERT_NOT_REACHED that fires if the synchronous wait for printing
        times out. This is a totally legitimite situation that can occur if the process
        crashes; there's no need for an assert there.

2019-09-07  Alex Christensen  <achristensen@webkit.org>

        Null check m_client in NetworkDataTask::didReceiveResponse
        https://bugs.webkit.org/show_bug.cgi?id=201587
        <rdar://problem/54743444>

        Reviewed by Chris Dumez.

        clearClient can be called at any time.  We null check it everyhere else we use it,
        and we are seeing crashes at this call site.  Let's not crash.

        * NetworkProcess/NetworkDataTask.cpp:
        (WebKit::NetworkDataTask::didReceiveResponse):

2019-09-07  Alex Christensen  <achristensen@webkit.org>

        Remove WebsiteDataStore::legacyDefaultDataStoreConfiguration
        https://bugs.webkit.org/show_bug.cgi?id=200054

        Reviewed by Carlos Garcia Campos.

        Its last needed use was removed in rdar://problem/47030981
        This changes WKContextConfigurationCreateWithLegacyOptions to be equal to WKContextConfigurationCreate,
        but it has no remaining clients so it is only being retained for binary compabibility.
        This also changes WKContextCreateWithInjectedBundlePath and WKContextCreate to be equal to WKContextCreateWithConfiguration,
        and after rdar://problem/47030981 there are no meaningful clients of those functions, also.
        There is one existing client of WKContextCreateWithInjectedBundlePath in rdar://problem/50323967 but our current implementation
        is compatible enough for them because it uses their injected bundle still.

        * UIProcess/API/APIProcessPoolConfiguration.cpp:
        (API::ProcessPoolConfiguration::copy):
        (API::ProcessPoolConfiguration::createWithLegacyOptions): Deleted.
        * UIProcess/API/APIProcessPoolConfiguration.h:
        * UIProcess/API/APIWebsiteDataStore.cpp:
        (API::WebsiteDataStore::createLegacy): Deleted.
        (API::WebsiteDataStore::legacyDefaultDataStoreConfiguration): Deleted.
        * UIProcess/API/APIWebsiteDataStore.h:
        * UIProcess/API/C/WKContext.cpp:
        (WKContextCreate):
        (WKContextCreateWithInjectedBundlePath):
        (WKContextGetWebsiteDataStore):
        * UIProcess/API/C/WKContextConfigurationRef.cpp:
        (WKContextConfigurationCreate):
        (WKContextConfigurationCreateWithLegacyOptions):
        * UIProcess/API/C/WKContextConfigurationRef.h:
        * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
        (API::WebsiteDataStore::legacyDefaultApplicationCacheDirectory): Deleted.
        (API::WebsiteDataStore::legacyDefaultNetworkCacheDirectory): Deleted.
        (API::WebsiteDataStore::legacyDefaultWebSQLDatabaseDirectory): Deleted.
        (API::WebsiteDataStore::legacyDefaultIndexedDBDatabaseDirectory): Deleted.
        (API::WebsiteDataStore::legacyDefaultLocalStorageDirectory): Deleted.
        (API::WebsiteDataStore::legacyDefaultMediaCacheDirectory): Deleted.
        (API::WebsiteDataStore::legacyDefaultMediaKeysStorageDirectory): Deleted.
        (API::WebsiteDataStore::legacyDefaultDeviceIdHashSaltsStorageDirectory): Deleted.
        (API::WebsiteDataStore::legacyDefaultJavaScriptConfigurationDirectory): Deleted.
        * UIProcess/API/Cocoa/WKProcessGroup.mm:
        (-[WKProcessGroup initWithInjectedBundleURL:]):
        * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
        (API::WebsiteDataStore::legacyDefaultApplicationCacheDirectory): Deleted.
        (API::WebsiteDataStore::legacyDefaultNetworkCacheDirectory): Deleted.
        (API::WebsiteDataStore::legacyDefaultWebSQLDatabaseDirectory): Deleted.
        (API::WebsiteDataStore::legacyDefaultIndexedDBDatabaseDirectory): Deleted.
        (API::WebsiteDataStore::legacyDefaultLocalStorageDirectory): Deleted.
        (API::WebsiteDataStore::legacyDefaultMediaCacheDirectory): Deleted.
        (API::WebsiteDataStore::legacyDefaultMediaKeysStorageDirectory): Deleted.
        (API::WebsiteDataStore::legacyDefaultDeviceIdHashSaltsStorageDirectory): Deleted.
        (API::WebsiteDataStore::legacyDefaultJavaScriptConfigurationDirectory): Deleted.
        * UIProcess/API/win/APIWebsiteDataStoreWin.cpp:
        (API::WebsiteDataStore::legacyDefaultApplicationCacheDirectory): Deleted.
        (API::WebsiteDataStore::legacyDefaultNetworkCacheDirectory): Deleted.
        (API::WebsiteDataStore::legacyDefaultWebSQLDatabaseDirectory): Deleted.
        (API::WebsiteDataStore::legacyDefaultIndexedDBDatabaseDirectory): Deleted.
        (API::WebsiteDataStore::legacyDefaultLocalStorageDirectory): Deleted.
        (API::WebsiteDataStore::legacyDefaultMediaCacheDirectory): Deleted.
        (API::WebsiteDataStore::legacyDefaultMediaKeysStorageDirectory): Deleted.
        (API::WebsiteDataStore::legacyDefaultDeviceIdHashSaltsStorageDirectory): Deleted.
        (API::WebsiteDataStore::legacyDefaultJavaScriptConfigurationDirectory): Deleted.
        * UIProcess/WebInspectorUtilities.cpp:
        (WebKit::inspectorProcessPool):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::m_webProcessCache):
        (WebKit::legacyWebsiteDataStoreConfiguration): Deleted.
        * UIProcess/WebProcessPool.h:

2019-09-07  Alex Christensen  <achristensen@webkit.org>

        Fix Windows build
        https://bugs.webkit.org/show_bug.cgi?id=201517

        * WebProcess/WebCoreSupport/WebResourceLoadObserver.cpp:

2019-09-07  Alex Christensen  <achristensen@webkit.org>

        Remove calls to WKContextGetWebsiteDataStore missed in r249614
        https://bugs.webkit.org/show_bug.cgi?id=200050

        It turns out I didn't need to introduce another way of clearing all cookies between tests.
        I just needed to make the call to WKHTTPCookieStoreDeleteAllCookies use the right WebsiteDataStore.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::clearCachedCredentials):
        * NetworkProcess/NetworkSession.h:
        (WebKit::NetworkSession::clearCredentials):
        (WebKit::NetworkSession::clearCookies): Deleted.
        * NetworkProcess/cocoa/NetworkSessionCocoa.h:
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::clearCookies): Deleted.

2019-09-07  Alex Christensen  <achristensen@webkit.org>

        Fix Windows build.
        https://bugs.webkit.org/show_bug.cgi?id=200050

        * PlatformWin.cmake:

2019-09-07  Alex Christensen  <achristensen@webkit.org>

        Fix Windows build.
        https://bugs.webkit.org/show_bug.cgi?id=201517

        * WebProcess/WebCoreSupport/WebResourceLoadObserver.cpp:

2019-09-07  Alex Christensen  <achristensen@webkit.org>

        Deprecate WKContextGetWebsiteDataStore
        https://bugs.webkit.org/show_bug.cgi?id=200050

        Reviewed by Geoff Garen.

        The last use of it was removed in rdar://problem/47030981
        In order to remove its use in WebKitTestRunner, I needed to make WKWebsiteDataStoreConfigurationRef
        to replace the WKContextConfigurationRef members that should've been associated with the WebsiteDataStore the whole time.
        There is one use of WKContextGetWebsiteDataStore in TestWebKitAPI still I'll investigate later.

        * Shared/API/c/WKBase.h:
        * Sources.txt:
        * UIProcess/API/APIWebsiteDataStore.cpp:
        (API::WebsiteDataStore::create):
        * UIProcess/API/APIWebsiteDataStore.h:
        * UIProcess/API/C/WKAPICast.h:
        * UIProcess/API/C/WKContext.cpp:
        (WKContextGetApplicationCacheManager):
        (WKContextGetKeyValueStorageManager):
        (WKContextGetResourceCacheManager):
        * UIProcess/API/C/WKContext.h:
        * UIProcess/API/C/WKContextConfigurationRef.cpp:
        (WKContextConfigurationCopyDiskCacheDirectory):
        (WKContextConfigurationSetDiskCacheDirectory):
        (WKContextConfigurationCopyApplicationCacheDirectory):
        (WKContextConfigurationSetApplicationCacheDirectory):
        (WKContextConfigurationCopyIndexedDBDatabaseDirectory):
        (WKContextConfigurationSetIndexedDBDatabaseDirectory):
        (WKContextConfigurationCopyLocalStorageDirectory):
        (WKContextConfigurationSetLocalStorageDirectory):
        (WKContextConfigurationCopyWebSQLDatabaseDirectory):
        (WKContextConfigurationSetWebSQLDatabaseDirectory):
        (WKContextConfigurationCopyMediaKeysStorageDirectory):
        (WKContextConfigurationSetMediaKeysStorageDirectory):
        (WKContextConfigurationCopyResourceLoadStatisticsDirectory):
        (WKContextConfigurationSetResourceLoadStatisticsDirectory):
        * UIProcess/API/C/WKContextConfigurationRef.h:
        * UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.cpp: Added.
        (WKWebsiteDataStoreConfigurationGetTypeID):
        (WKWebsiteDataStoreConfigurationCreate):
        (WKWebsiteDataStoreConfigurationCopyApplicationCacheDirectory):
        (WKWebsiteDataStoreConfigurationSetApplicationCacheDirectory):
        (WKWebsiteDataStoreConfigurationCopyNetworkCacheDirectory):
        (WKWebsiteDataStoreConfigurationSetNetworkCacheDirectory):
        (WKWebsiteDataStoreConfigurationCopyIndexedDBDatabaseDirectory):
        (WKWebsiteDataStoreConfigurationSetIndexedDBDatabaseDirectory):
        (WKWebsiteDataStoreConfigurationCopyLocalStorageDirectory):
        (WKWebsiteDataStoreConfigurationSetLocalStorageDirectory):
        (WKWebsiteDataStoreConfigurationCopyWebSQLDatabaseDirectory):
        (WKWebsiteDataStoreConfigurationSetWebSQLDatabaseDirectory):
        (WKWebsiteDataStoreConfigurationCopyMediaKeysStorageDirectory):
        (WKWebsiteDataStoreConfigurationSetMediaKeysStorageDirectory):
        (WKWebsiteDataStoreConfigurationCopyResourceLoadStatisticsDirectory):
        (WKWebsiteDataStoreConfigurationSetResourceLoadStatisticsDirectory):
        * UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.h: Added.
        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreCreateWithConfiguration):
        * UIProcess/API/C/WKWebsiteDataStoreRef.h:
        * WebKit.xcodeproj/project.pbxproj:

2019-09-06  Mark Lam  <mark.lam@apple.com>

        Harden protection of the Gigacage Config parameters.
        https://bugs.webkit.org/show_bug.cgi?id=201570
        <rdar://problem/55134229>

        Reviewed by Saam Barati.

        Just renaming a function name here.

        * WebProcess/WebProcess.cpp:

2019-09-06  Wenson Hsieh  <wenson_hsieh@apple.com>

        Incorrect selection rect revealed after pasting images in a contenteditable element
        https://bugs.webkit.org/show_bug.cgi?id=201549
        <rdar://problem/50956429>

        Reviewed by Simon Fraser.

        Tweak some existing logic to use the new visibleImageElementsInRangeWithNonLoadedImages helper function. See
        WebCore for more details.

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

2019-09-06  Chris Dumez  <cdumez@apple.com>

        Move the ResourceLoadObserver logic to WebKit2
        https://bugs.webkit.org/show_bug.cgi?id=201517

        Reviewed by Brent Fulgham.

        Move the ResourceLoadObserver logic to WebKit2 since it is not used by WebKit1. This allows us to simplify
        code.

        In a follow-up patch, I will simplify the code even further by leveraging the fact that a WebContent process
        is always associated with a single WebsiteDataStore / sessionID:
        - No need for a HashMap of sessionIDs
        - No need to even allocate the ResourceLoadObserver if the WebProcess is associated with an ephemeral session.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::resourceLoadStatisticsUpdated):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * Sources.txt:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebCoreSupport/WebResourceLoadObserver.cpp: Copied from Source/WebCore/loader/ResourceLoadObserver.cpp.
        (WebKit::is3xxRedirect):
        (WebKit::WebResourceLoadObserver::WebResourceLoadObserver):
        (WebKit::WebResourceLoadObserver::shouldLog const):
        (WebKit::WebResourceLoadObserver::requestStorageAccessUnderOpener):
        (WebKit::WebResourceLoadObserver::ensureResourceStatisticsForRegistrableDomain):
        (WebKit::WebResourceLoadObserver::scheduleNotificationIfNeeded):
        (WebKit::WebResourceLoadObserver::updateCentralStatisticsStore):
        (WebKit::WebResourceLoadObserver::statisticsForURL):
        (WebKit::WebResourceLoadObserver::takeStatistics):
        (WebKit::WebResourceLoadObserver::clearState):
        (WebKit::WebResourceLoadObserver::nonNullOwnerURL const):
        (WebKit::WebResourceLoadObserver::logFontLoad):
        (WebKit::WebResourceLoadObserver::logCanvasRead):
        (WebKit::WebResourceLoadObserver::logCanvasWriteOrMeasure):
        (WebKit::WebResourceLoadObserver::logNavigatorAPIAccessed):
        (WebKit::WebResourceLoadObserver::logScreenAPIAccessed):
        (WebKit::WebResourceLoadObserver::logSubresourceLoading):
        (WebKit::WebResourceLoadObserver::logWebSocketLoading):
        (WebKit::WebResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
        * WebProcess/WebCoreSupport/WebResourceLoadObserver.h: Added.
        * WebProcess/WebProcess.cpp:

2019-09-06  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthn] Make WebAuthn default off and let clients turn it on at will
        https://bugs.webkit.org/show_bug.cgi?id=201439
        <rdar://problem/54998154>

        Reviewed by Youenn Fablet.

        This patch makes WebAuthn default off such that clients that have the right entitlements
        could turn it on and we don't risk at turning on a Web API that does nothing by default.

        This patch doesn't add any SPI to turn the feature on as it is currently doable via
        - [WKPreferencesPrivate _setEnabled:forExperimentalFeature:].

        * Shared/WebPreferences.yaml:
        * Shared/WebPreferencesDefaultValues.cpp:
        (WebKit::defaultWebAuthenticationEnabled): Deleted.
        * Shared/WebPreferencesDefaultValues.h:

2019-09-06  Alex Christensen  <achristensen@webkit.org>

        Deprecate all WKCookieManagerRef functions
        https://bugs.webkit.org/show_bug.cgi?id=201473

        Reviewed by Chris Dumez.

        Their use was removed in rdar://problem/55039275
        Created replacement C API that more closely resembles the public ObjC API for WebKitTestRunner.

        * Shared/API/c/WKBase.h:
        * Sources.txt:
        * UIProcess/API/APIHTTPCookieStore.cpp:
        (API::HTTPCookieStore::deleteAllCookies):
        (API::HTTPCookieStore::setHTTPCookieAcceptPolicy):
        (API::HTTPCookieStore::deleteCookiesInDefaultUIProcessCookieStore):
        (API::HTTPCookieStore::setHTTPCookieAcceptPolicyInDefaultUIProcessCookieStore):
        * UIProcess/API/APIHTTPCookieStore.h:
        * UIProcess/API/C/WKAPICast.h:
        * UIProcess/API/C/WKContext.cpp:
        (WKContextSetStorageAccessAPIEnabled):
        * UIProcess/API/C/WKContext.h:
        * UIProcess/API/C/WKCookieManager.cpp:
        (WKCookieManagerGetTypeID):
        (WKCookieManagerSetClient):
        (WKCookieManagerGetHostnamesWithCookies):
        (WKCookieManagerDeleteCookiesForHostname):
        (WKCookieManagerDeleteAllCookies):
        (WKCookieManagerDeleteAllCookiesModifiedAfterDate):
        (WKCookieManagerSetHTTPCookieAcceptPolicy):
        (WKCookieManagerGetHTTPCookieAcceptPolicy):
        (WKCookieManagerSetStorageAccessAPIEnabled):
        (WKCookieManagerStartObservingCookieChanges):
        (WKCookieManagerStopObservingCookieChanges):
        * UIProcess/API/C/WKCookieManager.h:
        * UIProcess/API/C/WKHTTPCookieStoreRef.cpp: Added.
        (WKHTTPCookieStoreGetTypeID):
        (WKHTTPCookieStoreDeleteAllCookies):
        (WKHTTPCookieStoreSetHTTPCookieAcceptPolicy):
        * UIProcess/API/C/WKHTTPCookieStoreRef.h: Added.
        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreGetHTTPCookieStore):
        * UIProcess/API/C/WKWebsiteDataStoreRef.h:
        * UIProcess/API/Cocoa/APIHTTPCookieStoreCocoa.mm:
        (API::HTTPCookieStore::deleteCookiesInDefaultUIProcessCookieStore):
        (API::toNSHTTPCookieAcceptPolicy):
        (API::HTTPCookieStore::setHTTPCookieAcceptPolicyInDefaultUIProcessCookieStore):
        * UIProcess/WebCookieManagerProxy.cpp:
        (WebKit::WebCookieManagerProxy::setStorageAccessAPIEnabled): Deleted.
        * UIProcess/WebCookieManagerProxy.h:
        * WebKit.xcodeproj/project.pbxproj:

2019-09-06  Darryl Pogue  <darryl@dpogue.ca>

        REGRESSION(iOS 12): Keyboard dismissal leaves WKWebView viewport-fit=cover content offscreen
        https://bugs.webkit.org/show_bug.cgi?id=192564

        Reviewed by Tim Horton.

        The new keyboard height was being read into a variable after the scrollview had already been
        adjusted. This worked when the keyboard was opening, because the scrollview is adjusted with
        the correct value a second time when the keyboard animation has finished. However, when the
        keyboard is closed, the adjustment was being made before the correct height was stored,
        leading to the scrollview being positioned as if the keyboard were still open.

        * UIProcess/ios/WKScrollView.mm:
        (-[WKScrollView _adjustForAutomaticKeyboardInfo:animated:lastAdjustment:]):

2019-09-06  Tim Horton  <timothy_horton@apple.com>

        Marking up a note on iOS results in a PDF with no contents
        https://bugs.webkit.org/show_bug.cgi?id=201530
        <rdar://problem/53686019>

        Reviewed by Andy Estes.

        * Platform/IPC/Connection.cpp:
        (IPC::Connection::Connection):
        (IPC::Connection::waitForMessage):
        (IPC::Connection::connectionDidClose):
        * Platform/IPC/Connection.h:
        If the main thread is blocked when the Web Content process dies, and
        something eventually calls waitForAndDispatchImmediately without
        returning control to the main run loop, we will wait for the full timeout,
        because a) the code to mark the connection invalid is dispatched
        to the main thread, and b) the secondary thread that is informed of
        the Web Content process dying did not yet have a "waiting for" message
        to mark as interrupted (because it wasn't waiting yet).

        Fix this race by adding a bit that is set under the waitForMessage lock
        on the secondary thread when the connection is invalidated, identically
        to m_shouldWaitForSyncReplies, which solves the same problem for sync
        messages.

        Read the new bit when we are about to start waiting, and bail if it is set.
        It's OK to not read it inside the loop because we are guaranteed to have
        waitForMessage set at that point, so the normal interruption bit will work.

        * UIProcess/ios/WKContentView.mm:
        (-[WKContentView _processDidExit]):
        Reset _isPrintingToPDF; the Web Content process is never going to get
        back to us if it crashes.

        (-[WKContentView _wk_pageCountForPrintFormatter:]):
        Do not bail from starting a printing operation if one is already occurring.
        This fixes the original bug, because Markup ends up invalidating the page
        count at least one extra time before asking for the printed document.
        Instead of maintaining the fragile requirement that you cannot recompute
        the page count while printing, just let it happen. In order to make this
        work safely, synchronously wait for the previous printed result before
        continuing with the next print.

        We could do more coalescing here if need be, but calls to -_recalcPageCount
        are not high in volume.

2019-09-06  Alex Christensen  <achristensen@webkit.org>

        Fix unused argument warning from GCC.

        * Platform/IPC/ArgumentCoders.h:
        (IPC::TupleDecoder<0>::decode):
        There was indeed an unused argument.

2019-09-06  Alex Christensen  <achristensen@webkit.org>

        When disabling legacy private browsing for testing, change the SessionID back to what it was, not the defaultSessionID
        https://bugs.webkit.org/show_bug.cgi?id=201480

        Reviewed by Youenn Fablet.

        * WebProcess/InjectedBundle/InjectedBundle.cpp:
        (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
        * WebProcess/InjectedBundle/InjectedBundle.h:

2019-09-06  Patrick Griffis  <pgriffis@igalia.com>

        [GTK][WPE] Do not enable the sandbox in Snap
        https://bugs.webkit.org/show_bug.cgi?id=201486

        Reviewed by Carlos Garcia Campos.

        Running inside of Snap adds its own complications and is simply
        not supported for now.

        Also update isInsideFlatpak() for consistency.

        * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
        (WebKit::isInsideFlatpak):
        (WebKit::isInsideSnap):
        (WebKit::ProcessLauncher::launchProcess):

2019-09-05  Joseph Pecoraro  <pecoraro@apple.com>

        Web Inspector: Crashes when intercept response is a 404
        https://bugs.webkit.org/show_bug.cgi?id=201514

        Reviewed by Alex Christensen.

        * WebProcess/Network/WebResourceLoader.cpp:
        (WebKit::WebResourceLoader::didReceiveResponse):
        Ensure the WebResourceLoader stays around during intercepts.

        (WebKit::WebResourceLoader::didReceiveData):
        (WebKit::WebResourceLoader::didFinishResourceLoad):
        (WebKit::WebResourceLoader::didFailResourceLoad):
        Only perform the work if the m_coreLoader is still alive.

2019-09-05  Fujii Hironori  <Hironori.Fujii@sony.com>

        [Win] Add support for MouseEvent.buttons
        https://bugs.webkit.org/show_bug.cgi?id=201445

        Reviewed by Brent Fulgham.

        * Shared/win/WebEventFactory.cpp:
        (WebKit::WebEventFactory::createWebMouseEvent):
        Set m_buttons.

2019-09-05  Chris Dumez  <cdumez@apple.com>

        REGRESSION: http/tests/adClickAttribution/second-attribution-converted-with-higher-priority.html and http/tests/adClickAttribution/second-attribution-converted-with-lower-priority.html are flaky timeouts
        https://bugs.webkit.org/show_bug.cgi?id=201440
        <rdar://problem/54998427>

        Reviewed by Alex Christensen.

        Add private WKBundlePage API to query if the WebPage is currently suspended or not.

        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
        (WKBundlePageIsSuspended):
        * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:

2019-09-05  Sihui Liu  <sihui_liu@apple.com>

        Remove StorageArea pointers in StorageManagerSet when removing StorageManagers that own them
        https://bugs.webkit.org/show_bug.cgi?id=201324

        Reviewed by Alex Christensen.

        * NetworkProcess/WebStorage/LocalStorageNamespace.cpp:
        (WebKit::LocalStorageNamespace::storageAreaIdentifiers const):
        * NetworkProcess/WebStorage/LocalStorageNamespace.h:
        * NetworkProcess/WebStorage/SessionStorageNamespace.cpp:
        (WebKit::SessionStorageNamespace::storageAreaIdentifiers const):
        * NetworkProcess/WebStorage/SessionStorageNamespace.h:
        * NetworkProcess/WebStorage/StorageManager.cpp:
        (WebKit::StorageManager::allStorageAreaIdentifiers const):
        * NetworkProcess/WebStorage/StorageManager.h:
        * NetworkProcess/WebStorage/StorageManagerSet.cpp:
        (WebKit::StorageManagerSet::remove):
        * NetworkProcess/WebStorage/TransientLocalStorageNamespace.cpp:
        (WebKit::TransientLocalStorageNamespace::storageAreaIdentifiers const):
        * NetworkProcess/WebStorage/TransientLocalStorageNamespace.h:

2019-09-05  Carlos Garcia Campos  <cgarcia@igalia.com>

        REGRESSION(r249275): [GTK][WPE] wrong page ID returned by webkit_web_view_get_page_id()
        https://bugs.webkit.org/show_bug.cgi?id=201504

        Reviewed by Michael Catanzaro.

        We want to return the page identifier not the web page proxy id.

        * UIProcess/API/glib/WebKitWebView.cpp:
        (webkit_web_view_get_page_id):

2019-09-05  Pablo Saavedra  <psaavedra@igalia.com>

        Build failure after r249501 for ports with SERVICE_WORKER set OFF
        https://bugs.webkit.org/show_bug.cgi?id=201503

        Reviewed by Youenn Fablet.

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

2019-09-04  Wenson Hsieh  <wenson_hsieh@apple.com>

        MobileSafari may crash when invoking the C++ lambda in -[WKContentView _shareForWebView:]
        https://bugs.webkit.org/show_bug.cgi?id=201479
        <rdar://problem/51511834>

        Reviewed by Tim Horton.

        Fix the crash by making -_shareForWebView: robust in the case where there are no selection rects
        known in the UI process when -[WKContentView _share:] is invoked.

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

2019-09-04  Ryosuke Niwa  <rniwa@webkit.org>

        Replace defaultCustomPasteboardDataEnabled by an equivalent macro
        https://bugs.webkit.org/show_bug.cgi?id=201477

        Reviewed by Wenson Hsieh.

        r227282 introduced defaultCustomPasteboardDataEnabled() to disable the custom pasteboard data on
        apps linked against old SDKs. However, this had a bug that the check inside WebContent process
        would always return true because WebContent process is always linked against the latest SDKs.
        Because WebPreferences values aren't propagated from UI process to WebContent process unless
        there is a value change, it meant that custom pasteboard data is always enabled.

        This patch replaces this function with a simple macro which always enables the custom pasteboard
        data on iOS family and macOS as it has always been the case before and after r227282.

        * Shared/WebPreferences.yaml:
        * Shared/WebPreferencesDefaultValues.cpp:
        (WebKit::defaultCustomPasteboardDataEnabled): Deleted.
        * Shared/WebPreferencesDefaultValues.h:

2019-09-04  Wenson Hsieh  <wenson_hsieh@apple.com>

        -[WKContentView selectedText] returns an empty string when selecting more than 200 characters
        https://bugs.webkit.org/show_bug.cgi?id=201471
        <rdar://problem/55039227>

        Reviewed by Tim Horton.

        The fix for <rdar://problem/54308019> is contingent on -[WKContentView selectedText] returning a non-empty
        result in the case where text is selected. However, in WebKit, if more than 200 characters are selected,
        -selectedText ends up returning nothing.

        This is due to logic added in trac.webkit.org/r167624 that was intended to return the selected text in
        PostLayoutData's wordAtSelection, up to a maximum of 200 characters, likely for performance and/or security
        reasons. However, instead of truncating at 200 characters, the change simply drops wordAtSelection altogether.
        This patch fixes this issue by taking the first 200 characters of the selected text.

        Test: EditorStateTests.SelectedText

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

2019-09-04  Joseph Pecoraro  <pecoraro@apple.com>

        Web Inspector: Local Overrides - Provide substitution content for resource loads (URL based)
        https://bugs.webkit.org/show_bug.cgi?id=201262
        <rdar://problem/13108764>

        Reviewed by Devin Rousso.

        * Sources.txt:
        * WebKit.xcodeproj/project.pbxproj:
        New sources.

        * WebProcess/Network/WebResourceLoader.h:
        * WebProcess/Network/WebResourceLoader.cpp:
        (WebKit::WebResourceLoader::didReceiveResponse):
        (WebKit::WebResourceLoader::didReceiveData):
        (WebKit::WebResourceLoader::didFinishResourceLoad):
        (WebKit::WebResourceLoader::didFailResourceLoad):
        On receiving a response, check with the inspector if an active
        frontend will override the response content.

        * WebProcess/Network/WebResourceInterceptController.h:
        * WebProcess/Network/WebResourceInterceptController.cpp:
        (WebKit::WebResourceInterceptController::isIntercepting const):
        (WebKit::WebResourceInterceptController::beginInterceptingResponse):
        (WebKit::WebResourceInterceptController::continueResponse):
        (WebKit::WebResourceInterceptController::interceptedResponse):
        (WebKit::WebResourceInterceptController::defer):
        Buffer networking callbacks for an ongoing intercept.

        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::havePerformedSecurityChecks const):
        Handle new response source.

2019-09-04  Chris Dumez  <cdumez@apple.com>

        Unreviewed minor follow-up fix after r249501 to address crashes in debug.

        * NetworkProcess/cache/NetworkCache.h:
        (WTF::HashTraits<WebKit::NetworkCache::GlobalFrameID>::constructDeletedValue):
        (WTF::HashTraits<WebKit::NetworkCache::GlobalFrameID>::isDeletedValue):

2019-09-04  Chris Dumez  <cdumez@apple.com>

        Expose WebPageProxy identifier to the Network Process
        https://bugs.webkit.org/show_bug.cgi?id=201467

        Reviewed by Geoffrey Garen.

        Expose WebPageProxy identifier to the Network Process (similarly to WebPage / WebFrame identifiers)
        so that it can use it whenever it IPCs the UIProcess. The IPCs from the network process were the
        last one requiring the UIProcess to lookup a WebPageProxy object from a WebPageIdentifier (rather
        than a WebPageProxyIdentifier).

        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
        * NetworkProcess/NetworkCORSPreflightChecker.cpp:
        (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
        * NetworkProcess/NetworkCORSPreflightChecker.h:
        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
        (WebKit::NetworkConnectionToWebProcess::requestStorageAccess):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * NetworkProcess/NetworkLoad.cpp:
        (WebKit::NetworkLoad::didReceiveChallenge):
        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::NetworkLoadChecker):
        (WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
        * NetworkProcess/NetworkLoadChecker.h:
        * NetworkProcess/NetworkLoadParameters.h:
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::didCommitCrossSiteLoadWithDataTransfer):
        (WebKit::NetworkProcess::logDiagnosticMessage):
        (WebKit::NetworkProcess::logDiagnosticMessageWithResult):
        (WebKit::NetworkProcess::logDiagnosticMessageWithValue):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * NetworkProcess/NetworkResourceLoadParameters.cpp:
        (WebKit::NetworkResourceLoadParameters::encode const):
        (WebKit::NetworkResourceLoadParameters::decode):
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::m_shouldCaptureExtraNetworkLoadMetrics):
        (WebKit::NetworkResourceLoader::retrieveCacheEntry):
        (WebKit::NetworkResourceLoader::startNetworkLoad):
        (WebKit::NetworkResourceLoader::didReceiveResponse):
        * NetworkProcess/NetworkResourceLoader.h:
        * NetworkProcess/PingLoad.cpp:
        (WebKit::PingLoad::PingLoad):
        (WebKit::PingLoad::didReceiveChallenge):
        * 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::SpeculativeLoad):
        * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
        (WebKit::NetworkCache::logSpeculativeLoadingDiagnosticMessage):
        * Shared/Authentication/AuthenticationManager.cpp:
        (WebKit::AuthenticationManager::shouldCoalesceChallenge const):
        (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
        * Shared/Authentication/AuthenticationManager.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
        (WebKit::NetworkProcessProxy::logDiagnosticMessage):
        (WebKit::NetworkProcessProxy::logDiagnosticMessageWithResult):
        (WebKit::NetworkProcessProxy::logDiagnosticMessageWithValue):
        (WebKit::NetworkProcessProxy::requestStorageAccessConfirm):
        (WebKit::NetworkProcessProxy::didCommitCrossSiteLoadWithDataTransfer):
        (WebKit::NetworkProcessProxy::didCommitCrossSiteLoadWithDataTransferFromPrevalentResource):
        (WebKit::NetworkProcessProxy::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/Network/NetworkProcessProxy.messages.in:
        * UIProcess/ServiceWorkerProcessProxy.cpp:
        (WebKit::ServiceWorkerProcessProxy::start):
        * UIProcess/ServiceWorkerProcessProxy.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::didCommitLoadForFrame):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::isServiceWorkerPageID const):
        (WebKit::WebProcessPool::didCommitCrossSiteLoadWithDataTransfer):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebProcessProxy.cpp:
        * UIProcess/WebProcessProxy.h:
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::scheduleLoad):
        (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
        (WebKit::WebLoaderStrategy::loadResourceSynchronously):
        (WebKit::WebLoaderStrategy::preconnectTo):
        * WebProcess/Network/WebResourceLoader.h:
        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        (WebKit::ServiceWorkerFrameLoaderClient::ServiceWorkerFrameLoaderClient):
        (WebKit::ServiceWorkerFrameLoaderClient::createDocumentLoader):
        (WebKit::WebSWContextManagerConnection::WebSWContextManagerConnection):
        (WebKit::WebSWContextManagerConnection::installServiceWorker):
        * WebProcess/Storage/WebSWContextManagerConnection.h:
        (isType):
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::webPageProxyID const):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::requestStorageAccess):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::establishWorkerContextConnectionToNetworkProcess):
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:

2019-09-04  Tim Horton  <timothy_horton@apple.com>

        macCatalyst: Re-enable iOS WKWebView printing API
        https://bugs.webkit.org/show_bug.cgi?id=201392
        <rdar://problem/54690252>

        Reviewed by Wenson Hsieh.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _webViewPrintFormatter]):
        * UIProcess/API/Cocoa/WKWebViewInternal.h:
        * UIProcess/_WKWebViewPrintFormatter.mm:
        * UIProcess/_WKWebViewPrintFormatterInternal.h:
        * UIProcess/ios/WKContentView.mm:
        _WKWwebViewPrintFormatter was disabled during bringup because requisite
        UIKit bits were missing, but they are not anymore (and have not been for
        quite some time), so remove these unnecessary platform ifdefs.

2019-09-04  Patrick Griffis  <pgriffis@igalia.com>

        [WPE][GTK] Fix sandbox parsing DISPLAY on X11
        https://bugs.webkit.org/show_bug.cgi?id=201462

        Reviewed by Michael Catanzaro.

        On some setups the DISPLAY env var was incorrectly parsed.

        * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
        (WebKit::bindX11):

2019-09-04  Brian Burg  <bburg@apple.com>

        Selenium test 'interactions_tests.py::testContextClick' is hanging
        https://bugs.webkit.org/show_bug.cgi?id=201161
        <rdar://problem/54728541>

        Reviewed by Chris Dumez.

        A web page should not show native context menus if user interactions are being simulated for WebDriver.
        Showing a native context menu spawns a nested run loop. Since there's no way to interact
        with native UI via WebDriver, the test will hang until the context menu is manually dismissed.

        To fix this, pretend to show the context menu in UIProcess and dismiss it immediately.
        This is necessary to trigger oncontextmenu events appropriately and resume handling mouse events.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::showContextMenu): Hook into isControlledByAutomation here.
        We could short circuit this on the WebProcess side, but the check would be more crude
        and suppress context menus even if user interaction isn't being simulated. This would be
        problematic for a user who wants to interrupt their test session and interact with it.
        The main use case for this is right clicking on the test page and choose "Inspect".

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

        Abstract out WebSocketChannel message queue
        https://bugs.webkit.org/show_bug.cgi?id=201359

        Reviewed by Alex Christensen.

        Make use of newly added NetworkSendQueue.

        * WebProcess/Network/WebSocketChannel.cpp:
        (WebKit::WebSocketChannel::createMessageQueue):
        (WebKit::WebSocketChannel::WebSocketChannel):
        (WebKit::WebSocketChannel::send):
        (WebKit::WebSocketChannel::disconnect):
        * WebProcess/Network/WebSocketChannel.h:

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

        Move MessageRegistry to NetworkProcess
        https://bugs.webkit.org/show_bug.cgi?id=201299

        Reviewed by Alex Christensen.

        Move message registry to NetworkProcess.
        Take benefit of this move to use async reply IPC as much as possible.
        This also allows to remove the IPC message to UIProcess when doing postMessage with service workers.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::createNewMessagePortChannel):
        (WebKit::NetworkConnectionToWebProcess::entangleLocalPortInThisProcessToRemote):
        (WebKit::NetworkConnectionToWebProcess::messagePortDisentangled):
        (WebKit::NetworkConnectionToWebProcess::messagePortClosed):
        (WebKit::NetworkConnectionToWebProcess::nextMessageBatchIdentifier):
        (WebKit::NetworkConnectionToWebProcess::takeAllMessagesForPort):
        (WebKit::NetworkConnectionToWebProcess::didDeliverMessagePortMessages):
        (WebKit::NetworkConnectionToWebProcess::postMessageToRemote):
        (WebKit::NetworkConnectionToWebProcess::checkRemotePortForActivity):
        (WebKit::NetworkConnectionToWebProcess::checkProcessLocalPortForActivity):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * NetworkProcess/NetworkMessagePortChannelProvider.cpp: Added.
        (WebKit::NetworkMessagePortChannelProvider::NetworkMessagePortChannelProvider):
        (WebKit::NetworkMessagePortChannelProvider::createNewMessagePortChannel):
        (WebKit::NetworkMessagePortChannelProvider::entangleLocalPortInThisProcessToRemote):
        (WebKit::NetworkMessagePortChannelProvider::messagePortDisentangled):
        (WebKit::NetworkMessagePortChannelProvider::messagePortClosed):
        (WebKit::NetworkMessagePortChannelProvider::takeAllMessagesForPort):
        (WebKit::NetworkMessagePortChannelProvider::postMessageToRemote):
        (WebKit::NetworkMessagePortChannelProvider::checkRemotePortForActivity):
        (WebKit::NetworkMessagePortChannelProvider::checkProcessLocalPortForActivity):
        * NetworkProcess/NetworkMessagePortChannelProvider.h: Added.
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::m_messagePortChannelProvider):
        (WebKit::NetworkProcess::webProcessConnection const):
        * NetworkProcess/NetworkProcess.h:
        (WebKit::NetworkProcess::messagePortChannelRegistry):
        * Sources.txt:
        * UIProcess/Downloads/DownloadProxyMap.cpp:
        * UIProcess/WebPageProxy.cpp:
        * UIProcess/WebProcessPool.cpp:
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebProcessPool.messages.in:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::~WebProcessProxy):
        (WebKit::WebProcessProxy::shutDown):
        * UIProcess/WebProcessProxy.h:
        * UIProcess/WebProcessProxy.messages.in:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/Network/NetworkProcessConnection.cpp:
        (WebKit::NetworkProcessConnection::initializeSWClientConnection):
        (WebKit::NetworkProcessConnection::messagesAvailableForPort):
        (WebKit::NetworkProcessConnection::checkProcessLocalPortForActivity):
        * WebProcess/Network/NetworkProcessConnection.h:
        * WebProcess/Network/NetworkProcessConnection.messages.in:
        * WebProcess/Storage/WebSWClientConnection.cpp:
        (WebKit::WebSWClientConnection::postMessageToServiceWorker):
        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerClient):
        * WebProcess/WebCoreSupport/WebMessagePortChannelProvider.cpp:
        (WebKit::networkProcessConnection):
        (WebKit::WebMessagePortChannelProvider::createNewMessagePortChannel):
        (WebKit::WebMessagePortChannelProvider::entangleLocalPortInThisProcessToRemote):
        (WebKit::WebMessagePortChannelProvider::messagePortDisentangled):
        (WebKit::WebMessagePortChannelProvider::messagePortClosed):
        (WebKit::WebMessagePortChannelProvider::takeAllMessagesForPort):
        (WebKit::WebMessagePortChannelProvider::postMessageToRemote):
        (WebKit::WebMessagePortChannelProvider::checkRemotePortForActivity):
        * WebProcess/WebCoreSupport/WebMessagePortChannelProvider.h:
        * WebProcess/WebProcess.cpp:
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:

2019-09-03  Per Arne Vollan  <pvollan@apple.com>

        [macOS] Unable to open local file from favorites bar
        https://bugs.webkit.org/show_bug.cgi?id=201444

        Reviewed by Brent Fulgham.

        The sandbox extension handle should be created providing the pid of the receiving process.

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

2019-09-03  Chris Dumez  <cdumez@apple.com>

        FrameLoader::FrameProgressTracker::progressCompleted() does not need a pageID
        https://bugs.webkit.org/show_bug.cgi?id=201431

        Reviewed by Antti Koivisto.

        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::pageLoadCompleted):
        * WebProcess/Network/WebLoaderStrategy.h:

2019-09-03  Tim Horton  <timothy_horton@apple.com>

        Null deref under -[WKWebView _addUpdateVisibleContentRectPreCommitHandler]'s handler block
        https://bugs.webkit.org/show_bug.cgi?id=201436
        <rdar://problem/40640475>

        Reviewed by Simon Fraser.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView dealloc]):
        (-[WKWebView _addUpdateVisibleContentRectPreCommitHandler]):
        We crash sending a message to a deallocated WKWebView inside the handler block
        passed to +[CATransaction addCommitHandler:]. This seems impossible, because
        we carefully retain it, but it's possible that it could be the result of
        the handler block being installed under -dealloc (in which case retaining
        the WKWebView wouldn't actually extend its lifetime). -[WKWebView dealloc]
        is fairly sizable, and it's hard to follow all paths from it, so instead
        add a RELEASE_LOG_FAULT, so we'll get simulated crash logs, and bail,
        so we'll stop actually crashing (if this is the cause).

        This is just a speculative fix, but a hopeful one, since intentionally calling
        -_addUpdateVisibleContentRectPreCommitHandler: from dealloc yields a similar-looking
        crash under the handler block.

2019-09-03  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthn] Enable WebAuthn by default for MobileSafari and SafariViewService
        https://bugs.webkit.org/show_bug.cgi?id=201369
        <rdar://problem/54903724>

        Reviewed by Brent Fulgham.

        Communications to security keys require entitlements, which are not guaranteed to be present in third party
        WKWebView clients. Therefore, only enable WebAuthn by default for MobileSafari and SafariViewService.

        * Shared/WebPreferences.yaml:
        * Shared/WebPreferencesDefaultValues.cpp:
        (WebKit::defaultWebAuthenticationEnabled):
        * Shared/WebPreferencesDefaultValues.h:

2019-09-03  Chris Dumez  <cdumez@apple.com>

        Rename WebPage::pageID() to WebPage::identifier()
        https://bugs.webkit.org/show_bug.cgi?id=201428

        Reviewed by Antti Koivisto.

        * Shared/API/Cocoa/WKBrowsingContextHandle.mm:
        (-[WKBrowsingContextHandle _initWithPage:]):
        * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
        (WebKit::WebPaymentCoordinator::WebPaymentCoordinator):
        (WebKit::WebPaymentCoordinator::showPaymentUI):
        (WebKit::WebPaymentCoordinator::messageSenderDestinationID const):
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::loadResourceSynchronously):
        (WebKit::WebLoaderStrategy::preconnectTo):
        * WebProcess/Notifications/WebNotificationManager.cpp:
        (WebKit::WebNotificationManager::show):
        (WebKit::WebNotificationManager::cancel):
        (WebKit::WebNotificationManager::clearNotifications):
        (WebKit::WebNotificationManager::didDestroyNotification):
        * WebProcess/WebAuthentication/WebAuthenticatorCoordinator.cpp:
        (WebKit::WebAuthenticatorCoordinator::WebAuthenticatorCoordinator):
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::windowRect):
        (WebKit::WebChromeClient::focusedFrameChanged):
        (WebKit::WebChromeClient::createWindow):
        (WebKit::WebChromeClient::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
        (WebKit::WebChromeClient::toolbarsVisible):
        (WebKit::WebChromeClient::statusbarVisible):
        (WebKit::WebChromeClient::menubarVisible):
        (WebKit::WebChromeClient::wrapCryptoKey const):
        (WebKit::WebChromeClient::unwrapCryptoKey const):
        (WebKit::WebChromeClient::signedPublicKeyAndChallengeString const):
        * WebProcess/WebCoreSupport/WebColorChooser.cpp:
        (WebKit::WebColorChooser::WebColorChooser):
        (WebKit::WebColorChooser::reattachColorChooser):
        (WebKit::WebColorChooser::setSelectedColor):
        (WebKit::WebColorChooser::endChooser):
        * WebProcess/WebCoreSupport/WebDataListSuggestionPicker.cpp:
        (WebKit::WebDataListSuggestionPicker::handleKeydownWithIdentifier):
        (WebKit::WebDataListSuggestionPicker::close):
        (WebKit::WebDataListSuggestionPicker::displayWithActivationType):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::pageID const):
        (WebKit::WebFrameLoaderClient::dispatchDidFailProvisionalLoad):
        (WebKit::WebFrameLoaderClient::dispatchDidFailLoad):
        * WebProcess/WebCoreSupport/WebPopupMenu.cpp:
        (WebKit::WebPopupMenu::show):
        (WebKit::WebPopupMenu::hide):
        * WebProcess/WebCoreSupport/WebSearchPopupMenu.cpp:
        (WebKit::WebSearchPopupMenu::saveRecentSearches):
        (WebKit::WebSearchPopupMenu::loadRecentSearches):
        * WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm:
        (WebKit::WebFrameLoaderClient::createPreviewLoaderClient):
        * WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.mm:
        (WebKit::TextCheckingControllerProxy::TextCheckingControllerProxy):
        (WebKit::TextCheckingControllerProxy::~TextCheckingControllerProxy):
        * WebProcess/WebPage/Cocoa/WebRemoteObjectRegistry.cpp:
        (WebKit::WebRemoteObjectRegistry::WebRemoteObjectRegistry):
        (WebKit::WebRemoteObjectRegistry::close):
        * WebProcess/WebPage/EventDispatcher.cpp:
        (WebKit::EventDispatcher::addScrollingTreeForPage):
        (WebKit::EventDispatcher::removeScrollingTreeForPage):
        (WebKit::EventDispatcher::clearQueuedTouchEventsForPage):
        (WebKit::EventDispatcher::getQueuedTouchEventsForPage):
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
        (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
        (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
        * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm:
        (WebKit::RemoteScrollingCoordinator::RemoteScrollingCoordinator):
        (WebKit::RemoteScrollingCoordinator::~RemoteScrollingCoordinator):
        * WebProcess/WebPage/RemoteWebInspectorUI.cpp:
        (WebKit::RemoteWebInspectorUI::sendMessageToBackend):
        (WebKit::RemoteWebInspectorUI::changeSheetRect):
        (WebKit::RemoteWebInspectorUI::startWindowDrag):
        (WebKit::RemoteWebInspectorUI::bringToFront):
        (WebKit::RemoteWebInspectorUI::closeWindow):
        (WebKit::RemoteWebInspectorUI::reopen):
        (WebKit::RemoteWebInspectorUI::resetState):
        (WebKit::RemoteWebInspectorUI::openInNewTab):
        (WebKit::RemoteWebInspectorUI::save):
        (WebKit::RemoteWebInspectorUI::append):
        (WebKit::RemoteWebInspectorUI::showCertificate):
        * WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
        (WebKit::ViewGestureGeometryCollector::ViewGestureGeometryCollector):
        (WebKit::ViewGestureGeometryCollector::~ViewGestureGeometryCollector):
        * WebProcess/WebPage/WebBackForwardListProxy.cpp:
        (WebKit::WebBackForwardListProxy::itemAtIndex):
        (WebKit::WebBackForwardListProxy::backListCount const):
        (WebKit::WebBackForwardListProxy::forwardListCount const):
        * WebProcess/WebPage/WebInspector.cpp:
        (WebKit::WebInspector::openLocalInspectorFrontend):
        (WebKit::WebInspector::closeFrontendConnection):
        (WebKit::WebInspector::bringToFront):
        (WebKit::WebInspector::elementSelectionChanged):
        (WebKit::WebInspector::timelineRecordingChanged):
        (WebKit::WebInspector::setMockCaptureDevicesEnabledOverride):
        (WebKit::WebInspector::updateDockingAvailability):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::WebPage):
        (WebKit::m_textAutoSizingAdjustmentTimer):
        (WebKit::WebPage::messageSenderDestinationID const):
        (WebKit::WebPage::close):
        (WebKit::WebPage::goToBackForwardItem):
        (WebKit::WebPage::setFixedLayoutSize):
        (WebKit::WebPage::freezeLayerTree):
        (WebKit::WebPage::unfreezeLayerTree):
        (WebKit::WebPage::restoreSessionInternal):
        (WebKit::WebPage::setCurrentHistoryItemForReattach):
        (WebKit::WebPage::updateIsInWindow):
        (WebKit::WebPage::setActivityState):
        (WebKit::WebPage::mainFrameDidLayout):
        (WebKit::WebPage::didCommitLoad):
        (WebKit::WebPage::hasStorageAccess):
        (WebKit::WebPage::requestStorageAccess):
        (WebKit::WebPage::textInputContextsInRect):
        (WebKit::WebPage::elementForTextInputContext):
        * WebProcess/WebPage/WebPage.h:
        (WebKit::WebPage::identifier const):
        (WebKit::WebPage::pageID const): Deleted.
        * WebProcess/WebPage/WebPageInspectorTarget.cpp:
        (WebKit::WebPageInspectorTarget::identifier const):
        * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
        (-[WKAccessibilityWebPageObjectBase setWebPage:]):
        * WebProcess/WebPage/mac/WebPageMac.mm:
        (WebKit::WebPage::executeKeypressCommandsInternal):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::transformObjectsToHandles):
        * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
        (WebKit::StorageNamespaceImpl::copy):
        * WebProcess/WebStorage/WebStorageNamespaceProvider.cpp:
        (WebKit::WebStorageNamespaceProvider::createSessionStorageNamespace):
        * WebProcess/cocoa/PlaybackSessionManager.mm:
        (WebKit::PlaybackSessionManager::PlaybackSessionManager):
        (WebKit::PlaybackSessionManager::~PlaybackSessionManager):
        (WebKit::PlaybackSessionManager::invalidate):
        * WebProcess/cocoa/VideoFullscreenManager.mm:
        (WebKit::VideoFullscreenManager::VideoFullscreenManager):
        (WebKit::VideoFullscreenManager::~VideoFullscreenManager):
        (WebKit::VideoFullscreenManager::invalidate):

2019-09-03  Antoine Quint  <graouts@apple.com>

        [iOS] Treat a two-finger single tap as if the user tapped with the Cmd key pressed
        https://bugs.webkit.org/show_bug.cgi?id=201420
        <rdar://problem/53207786>

        Reviewed by Simon Fraser.

        Set the metaKey modifier to true when generating a click event based on a two-finger single tap. This is important so that sites like Google and DuckDuckGo
        correctly open links in their search results page in a new tab in Safari on iOS. This currently doesn't work because those sites will call preventDefault()
        if the metaKey flag isn't set on a "click" event, and if it is set, they let the browser handle the navigation themselves.

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

2019-08-28  Brent Fulgham  <bfulgham@apple.com>

        [macOS] Correct sandbox violation in Flash plugin
        https://bugs.webkit.org/show_bug.cgi?id=201228
        <rdar://problem/54347503>

        Reviewed by Alex Christensen.

        * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:

2019-09-03  Carlos Garcia Campos  <cgarcia@igalia.com>

        [WPE][GTK] Deprecate nonfunctional process limit APIs
        https://bugs.webkit.org/show_bug.cgi?id=193749

        Reviewed by Žan Doberšek.

        * UIProcess/API/glib/WebKitWebContext.cpp:
        (webkitWebContextConstructed):
        (webkit_web_context_set_process_model):
        (webkit_web_context_get_process_model):
        (webkit_web_context_set_web_process_count_limit):
        (webkit_web_context_get_web_process_count_limit):
        * UIProcess/API/gtk/WebKitWebContext.h:
        * UIProcess/API/wpe/WebKitWebContext.h:

2019-09-02  Youenn Fablet  <youenn@apple.com>

        Make NetworkConnectionToWebProcess keyed by their WebProcess identifier
        https://bugs.webkit.org/show_bug.cgi?id=201300

        Reviewed by Alex Christensen.

        Make sure to create each NetworkConnectionToWebProcess for a given WebProcess.
        Pass the process identifier at creation time.
        This will allow to have the message registry be moved to NetworkProcess
        so as to check port activity between processes.
        This identifier might also be used in the future for other connections like
        service worker context/client/server identifiers.

        No observable change of behavior.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::create):
        (WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        (WebKit::NetworkConnectionToWebProcess::webProcessIdentifier const):
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::removeNetworkConnectionToWebProcess):
        (WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
        (WebKit::NetworkProcess::actualPrepareToSuspend):
        (WebKit::NetworkProcess::resume):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * Platform/IPC/Connection.h:
        (IPC::Connection::sendWithAsyncReply):
        Allow to pass send options.
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::NetworkProcessProxy):
        (WebKit::NetworkProcessProxy::getNetworkProcessConnection):
        Make use of async reply to simplify the handling of lambdas.
        (WebKit::NetworkProcessProxy::openNetworkProcessConnection):
        (WebKit::NetworkProcessProxy::didFinishLaunching):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/Network/NetworkProcessProxy.messages.in:

2019-09-02  Youenn Fablet  <youenn@apple.com>

        Introduce WorkerMessagePortChannelRegistry
        https://bugs.webkit.org/show_bug.cgi?id=201333

        Reviewed by Alex Christensen.

        By introducing WorkerMessagePortChannelRegistry, we are making
        sure UIMessagePortChannelProvider is only called from the main thread.
        This will help when moving the registry to network process.

        * UIProcess/UIMessagePortChannelProvider.cpp:
        (WebKit::UIMessagePortChannelProvider::takeAllMessagesForPort):
        (WebKit::UIMessagePortChannelProvider::checkRemotePortForActivity):
        * UIProcess/UIMessagePortChannelProvider.h:
        * WebProcess/WebCoreSupport/WebMessagePortChannelProvider.cpp:
        (WebKit::WebMessagePortChannelProvider::takeAllMessagesForPort):
        (WebKit::WebMessagePortChannelProvider::didTakeAllMessagesForPort):
        (WebKit::WebMessagePortChannelProvider::didCheckRemotePortForActivity):
        (WebKit::WebMessagePortChannelProvider::checkRemotePortForActivity):
        * WebProcess/WebCoreSupport/WebMessagePortChannelProvider.h:

2019-09-01  Youenn Fablet  <youenn@apple.com>

        Abstract out LibWebRTCSocketClient so that rtc sockets can be implemented without libwebrtc sockets
        https://bugs.webkit.org/show_bug.cgi?id=201302

        Reviewed by Alex Christensen.

        Introduce NetworkRTCProvider::Socket to be able to implement RTC socket support with non libwebrtc API

        * NetworkProcess/webrtc/LibWebRTCSocketClient.h:
        * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
        (WebKit::NetworkRTCProvider::createSocket):
        (WebKit::NetworkRTCProvider::createUDPSocket):
        (WebKit::NetworkRTCProvider::createServerTCPSocket):
        (WebKit::NetworkRTCProvider::proxyInfoFromSession):
        (WebKit::NetworkRTCProvider::createClientTCPSocket):
        (WebKit::NetworkRTCProvider::wrapNewTCPConnection):
        (WebKit::NetworkRTCProvider::addSocket):
        (WebKit::NetworkRTCProvider::takeSocket):
        (WebKit::NetworkRTCProvider::newConnection):
        (WebKit::NetworkRTCProvider::closeListeningSockets):
        (WebKit::NetworkRTCProvider::callSocket):
        * NetworkProcess/webrtc/NetworkRTCProvider.h:
        * NetworkProcess/webrtc/NetworkRTCProvider.mm:
        (WebKit::NetworkRTCProvider::createClientTCPSocket):
        * NetworkProcess/webrtc/NetworkRTCSocket.cpp:
        (WebKit::NetworkRTCSocket::sendTo):
        (WebKit::NetworkRTCSocket::close):
        (WebKit::NetworkRTCSocket::setOption):

2019-09-01  Fujii Hironori  <Hironori.Fujii@sony.com>

        [Cairo] out-of-bounds read in ShareableBitmap::paint if a fractional device scale factor is used
        https://bugs.webkit.org/show_bug.cgi?id=196340

        Reviewed by Brent Fulgham.

        In ShareableBitmap::paint, srcRectScaled can be out-of-bounds of
        the surface if a fractional device scale factor is used.

        * Shared/cairo/ShareableBitmapCairo.cpp:
        (WebKit::ShareableBitmap::paint): Use cairoSurfaceSetDeviceScale
        to set a device scale factor to the surface instead of multiplying
        srcRect with a device scale factor.

2019-09-01  Fujii Hironori  <Hironori.Fujii@sony.com>

        Unreviewed, rolling out r249366.

        WinCairo WebKit2 crashes in some websites and the device scale
        factor is not correct in high DPI.

        Reverted changeset:

        "[WinCairo, FTW] Properly handle device scale factor"
        https://bugs.webkit.org/show_bug.cgi?id=201361
        https://trac.webkit.org/changeset/249366

2019-09-01  Wenson Hsieh  <wenson_hsieh@apple.com>

        Long presses that interrupt accelerated scrolling dispatch clicks on apps linked against iOS 12 or earlier
        https://bugs.webkit.org/show_bug.cgi?id=201346
        <rdar://problem/54885784>

        Reviewed by Dean Jackson.

        For apps that are linked on or after iOS 13, we add a context menu interaction to the content view, which
        requires us to disable (or avoid adding) the highlight long press gesture recognizer. However, for apps that are
        linked on the iOS 12 SDK or prior, this gesture is still present, and fires when long pressing for (roughly) up
        to 0.75 seconds if a tap gesture was not recognized instead. Firing this gesture sends a click event to the
        page; this brings back some form of <rdar://problem/53889373>, but only when holding for slightly longer than a
        normal tap, and also only in apps linked on iOS 12 or earlier. To fix this, we apply a similar solution as in
        r248433 and detect whether a long press gesture interrupted scroll view deceleration in
        -gestureRecognizerShouldBegin:. If so, we return NO to avoid clicking. See per-method comments below for more
        details.

        Testing this bug as-is was tricky, since there's no way in layout tests to simulate being linked on or before a
        given SDK version. Luckily, recall that:
        1. This bug occurs when the highlight gesture recognizer is enabled and added to the content view.
        2. The highlight gesture recognizer only needs to be disabled or removed when context menu interaction is added.
        As such, we should be able to restore the highlight gesture recognizer by suppressing the context menu
        interaction in an app linked-on-or-after iOS 13, by setting allowsLinkPreview to NO. Unfortunately, this doesn't
        quite work, since we currently always avoid adding the highlight gesture recognizer if the app is linked on
        iOS 13 or later.

        However, this means that the highlight gesture recognizer is absent from the content view in apps linked against
        iOS 13 that disable link previews, even though its absence is not required. This means that long pressing a
        clickable element in a web view that disables link previews does not show a tap highlight on iOS 13, whereas it
        would on iOS 12; this is a regression, albeit a very subtle one. To fix this subtle issue and make it possible
        to write a test for this bug, we refactor some logic for creating and configuring the highlight long press
        gesture, such that we now unconditionally add the highlight gesture, but only enable it in apps linked on or
        after iOS 13 if link previews (i.e. context menu interaction) are not allowed.

        Test: fast/scrolling/ios/click-events-after-long-press-during-momentum-scroll-in-overflow.html

        * SourcesCocoa.txt:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView setAllowsLinkPreview:]):
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView setupInteraction]):

        Refactor our gesture setup logic to always create and add the long press and highlight long press gestures, but
        conditionally disable them based on whether or not (1) the context menu is available, and (2) WKWebView's
        allowsLinkPreview property.

        (-[WKContentView _didChangeLinkPreviewAvailability]):
        (-[WKContentView _updateLongPressAndHighlightLongPressGestures]):

        Add a new helper to update the enabled state of the long press and highlight long press gestures, by consulting
        -_shouldUseContextMenu and -allowsLinkPreview. This is called when setting up the gestures, as well as whenever
        -allowsLinkPreview changes.

        (-[WKContentView gestureRecognizerShouldBegin:]):

        Factor out logic to ascend the view hierarchy in search of a UIScrollView that was interrupted while
        decelerating into a local lambda function; use this for both the highlight gesture and the single tap gesture,
        to determine whether they should begin.

        * UIProcess/ios/WKHighlightLongPressGestureRecognizer.h: Added.
        * UIProcess/ios/WKHighlightLongPressGestureRecognizer.mm: Added.

        In order to remember the UIScrollView (if any) tracked by the highlight long press gesture, we subclass
        _UIWebHighlightLongPressGestureRecognizer. While UILongPressGestureRecognizer does have SPI to ask for a list of
        UITouches, by the time the gesture has been recognized and the gesture delegates are invoked, these UITouches
        no longer correspond to UIViews. As such, the only time we have access to the list of UITouches with their
        UIViews is during the touches* subclass hooks.

        (-[WKHighlightLongPressGestureRecognizer reset]):

        Clear out the tracked UIScrollView here, when the gesture is reset (i.e. after ending, or being canceled).

        (-[WKHighlightLongPressGestureRecognizer touchesBegan:withEvent:]):

        Remember the last touched UIScrollView here.

        (-[WKHighlightLongPressGestureRecognizer lastTouchedScrollView]):
        * WebKit.xcodeproj/project.pbxproj:

2019-08-30  Brent Fulgham  <bfulgham@apple.com>

        [WinCairo, FTW] Properly handle device scale factor
        https://bugs.webkit.org/show_bug.cgi?id=201361

        Reviewed by Don Olmstead.

        Update the WebView and WebProcess to correctly handle
        the device scale factor.

        * UIProcess/win/WebView.cpp:
        (WebKit::WebView::WebView): Tell the page the current device scale factor.
        * WebProcess/win/WebProcessMainWin.cpp:
        (WebKit::WebProcessMainWin): Tell the process to be aware of device scale.

2019-08-31  Chris Dumez  <cdumez@apple.com>

        DocumentStorageAccess::hasStorageAccess() / requestStorageAccess() don't need to know about pageID / frameID
        https://bugs.webkit.org/show_bug.cgi?id=201364

        Reviewed by John Wilander.

        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::hasStorageAccess):
        (WebKit::WebChromeClient::requestStorageAccess):
        * WebProcess/WebCoreSupport/WebChromeClient.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::hasStorageAccess):
        (WebKit::WebPage::requestStorageAccess):
        * WebProcess/WebPage/WebPage.h:

2019-08-30  Chris Dumez  <cdumez@apple.com>

        WebPage::fromCorePage() to take and return a C++ reference
        https://bugs.webkit.org/show_bug.cgi?id=201367

        Reviewed by Antti Koivisto.

        * WebProcess/InjectedBundle/InjectedBundle.cpp:
        (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
        * WebProcess/WebPage/VisitedLinkTableController.cpp:
        (WebKit::VisitedLinkTableController::addVisitedLink):
        * WebProcess/WebPage/WebFrame.cpp:
        (WebKit::WebFrame::page const):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::fromCorePage):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPageOverlay.cpp:
        (WebKit::WebPageOverlay::willMoveToPage):
        (WebKit::WebPageOverlay::didMoveToPage):
        * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
        (WebKit::StorageNamespaceImpl::copy):
        * WebProcess/WebStorage/StorageNamespaceImpl.h:
        * WebProcess/WebStorage/WebStorageNamespaceProvider.cpp:
        (WebKit::WebStorageNamespaceProvider::createSessionStorageNamespace):

2019-08-30  Chris Dumez  <cdumez@apple.com>

        [PSON] We no longer need to throw away suspended pages in a process before using it for a navigation
        https://bugs.webkit.org/show_bug.cgi?id=201344

        Reviewed by Antti Koivisto.

        We no longer need to throw away suspended pages in a process before using it for a navigation, now that
        Bug 201225 has been fixed. WebPage objects (suspended or live) in the process now have distinct
        identifiers and can coexist.

        * Shared/API/Cocoa/RemoteObjectRegistry.h:
        * Shared/API/Cocoa/RemoteObjectRegistry.mm:
        (WebKit::RemoteObjectRegistry::RemoteObjectRegistry):
        * UIProcess/Cocoa/UIRemoteObjectRegistry.cpp:
        (WebKit::UIRemoteObjectRegistry::UIRemoteObjectRegistry):
        * WebProcess/WebPage/Cocoa/WebRemoteObjectRegistry.cpp:
        (WebKit::WebRemoteObjectRegistry::WebRemoteObjectRegistry):
        (WebKit::WebRemoteObjectRegistry::close):

2019-08-30  Chris Dumez  <cdumez@apple.com>

        Assertion hit when saving to PDF from printing dialog
        https://bugs.webkit.org/show_bug.cgi?id=201351

        Reviewed by Tim Horton.

        [WKPrintingView knowsPageRange:] may get called from a background thread and ends up calling
        WeakPtr::get() which asserts because it is generally unsafe to get the raw pointer from a
        WeakPtr to an object owned by another thread. However, the methods here merely want to null
        check it so add a thread-safe method (pageIsClosed()) to WebFrameProxy for it.

        * UIProcess/WebFrameProxy.h:
        (WebKit::WebFrameProxy::pageIsClosed const):
        * UIProcess/mac/WKPrintingView.mm:
        (-[WKPrintingView knowsPageRange:]):

2019-08-30  Alex Christensen  <achristensen@webkit.org>

        Remove HAVE_CFNETWORK_WITH_AUTO_ADDED_HTTP_HEADER_SUPPRESSION_SUPPORT conditional
        https://bugs.webkit.org/show_bug.cgi?id=201280

        Reviewed by Youenn Fablet.

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):

2019-08-30  Alex Christensen  <achristensen@webkit.org>

        Remove HAVE_CFNETWORK_WITH_IGNORE_HSTS conditional
        https://bugs.webkit.org/show_bug.cgi?id=201279

        Reviewed by Darin Adler.

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (ignoreHSTS):
        (updateIgnoreStrictTransportSecuritySettingIfNecessary):
        (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
        (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):

2019-08-30  Alex Christensen  <achristensen@webkit.org>

        Allow process cache to cache processes when using a non-default persistent WebsiteDataStore
        https://bugs.webkit.org/show_bug.cgi?id=201329

        Reviewed by Chris Dumez.

        Treat all persistent sessions the same when deciding whether to clear all cached web processes using a particular website data store.
        This removes a huge performance regression on warm plt when switching to using a non-default persistent session.
        I also removed a call to removeSession which is redundant with the one in the WebsiteDataStore destructor, which is where it should be.

        * UIProcess/WebProcessCache.cpp:
        (WebKit::WebProcessCache::canCacheProcess const):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
        (WebKit::WebProcessPool::pageEndUsingWebsiteDataStore):

2019-08-30  Wenson Hsieh  <wenson_hsieh@apple.com>

        Caret does not appear in text field inside a transformed, overflow: hidden container
        https://bugs.webkit.org/show_bug.cgi?id=201317
        <rdar://problem/54859264>

        Reviewed by Simon Fraser.

        Adjust isTransparentOrFullyClipped to use the new methods in RenderLayer and RenderObject. See WebCore ChangeLog
        for more details.

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

2019-08-30  Simon Fraser  <simon.fraser@apple.com>

        Add system tracing points for compositing updates, and touch-event dispatching
        https://bugs.webkit.org/show_bug.cgi?id=201327

        Reviewed by Alex Christensen.
        
        TraceScope in EventDispatcher::dispatchTouchEvents().

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

2019-08-30  Brent Fulgham  <bfulgham@apple.com>

        [FTW] Use DirectX SharedResource as basis for SharedBitmap
        https://bugs.webkit.org/show_bug.cgi?id=201157

        Reviewed by Alex Christensen.

        Currently an ID2D1Bitmap is used as the backing store for the SharedBitmap that is the
        base type for sharing data between the WebContent Process and the UIProcess. However, this
        involves moving GPU memory to local memory, copying that memory into the SharedMemory member
        of the SharedBitmap, then building a new GPU bitmap on the UIProcess side from that SharedMemory.

        Profiling indicates that this is the single largest place FTW WebKit spends its time.

        Instead, we should use Direct2D's ability to render to an IDXGISurface, which can be shared
        between multiple processes. This should avoid the GPU->CPU copy, the Direct2D-allocated
        CPU->Shared Memory copy, and the shared memory to GPU copy.

        Reviewed by Alex Christensen.

        * Platform/SharedMemory.h:
        * Platform/win/SharedMemoryWin.cpp:
        (WebKit::SharedMemory::Handle::encodeHandle): Added.
        (WebKit::SharedMemory::Handle::encode const): Use new helper function.
        (WebKit::SharedMemory::Handle::decodeHandle): Added.
        (WebKit::SharedMemory::Handle::decode): Use new helper function.
        * PlatformFTW.cmake: Add D3X11 libraries.
        * Shared/ShareableBitmap.cpp:
        (WebKit::ShareableBitmap::Configuration::encode const): Encode shared resource handle for DX texture.
        (WebKit::ShareableBitmap::Configuration::decode): Ditto (but decode).
        (WebKit::ShareableBitmap::ShareableBitmap): Create SharedResource (if needed).
        (WebKit::ShareableBitmap::~ShareableBitmap): Add cleanup code for SharedResoure.
        (WebKit::ShareableBitmap::numBytesForSize): Only allocate a small memory store when using GPU textures.
        * Shared/ShareableBitmap.h:
        (WebKit::ShareableBitmap::dxSurface):
        * Shared/win/ShareableBitmapDirect2D.cpp:
        (WebKit::ShareableBitmap::createSharedResource): Added.
        (WebKit::ShareableBitmap::disposeSharedResource): Added.
        (WebKit::ShareableBitmap::leakSharedResource): Added.
        (WebKit::ShareableBitmap::createGraphicsContext): Update for new data types.
        (WebKit::ShareableBitmap::paint): Ditto.
        (WebKit::ShareableBitmap::createDirect2DSurface): Update for new data types.
        (WebKit::ShareableBitmap::createImage): Ditto.
        (WebKit::createSurfaceFromData): Deleted.
        (WebKit::ShareableBitmap::sync): Deleted.
        * UIProcess/BackingStore.cpp:
        * UIProcess/BackingStore.h:
        * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp:
        * UIProcess/WebPageProxy.cpp:
        * UIProcess/WebPageProxy.h:
        * UIProcess/win/BackingStoreDirect2D.cpp:
        (WebKit::BackingStore::createBackend):
        (WebKit::BackingStore::paint):
        (WebKit::BackingStore::incorporateUpdate):
        * UIProcess/win/PageClientImpl.cpp:
        * UIProcess/win/WebPageProxyWin.cpp:
        (WebKit::WebPageProxy::device const):
        (WebKit::WebPageProxy::setDevice):
        * UIProcess/win/WebView.cpp:
        (WebKit::WebView::WebView): Initialize DirectX stuff.
        (WebKit::WebView::paint): Use new DiretX drawing logic.
        (WebKit::WebView::onSizeEvent): Update SwapChain's buffer sizes when resizing.
        (WebKit::WebView::setupSwapChain): Added.
        (WebKit::WebView::configureBackingStore): Added.
        * UIProcess/win/WebView.h:
        (WebKit::WebView::d3dDevice):
        * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
        (WebKit::DrawingAreaCoordinatedGraphics::display):

2019-08-30  Chris Dumez  <cdumez@apple.com>

        [PSON] Bump the WebPage's identifier every time we process-swap
        https://bugs.webkit.org/show_bug.cgi?id=201225

        Reviewed by Alex Christensen.

        Every time we create a new WebPage object in a provisional process, we now assign it a new
        identifier, instead of using the identifier of the WebPage in the committed process. This
        will address issues with IPC when navigating back and forth between processes since we will
        no longer be confused as to which WebPage the IPC is coming from. Also, this will allow
        suspended WebPages to keep living in the process, even if we use the process for a new load
        (will be done in a follow-up patch) since we will no longer have an identifier conflict.

        * Scripts/webkit/messages.py:
        * Shared/API/APIPageHandle.cpp:
        (API::PageHandle::create):
        (API::PageHandle::createAutoconverting):
        (API::PageHandle::PageHandle):
        (API::PageHandle::encode const):
        (API::PageHandle::decode):
        * Shared/API/APIPageHandle.h:
        (API::PageHandle::pageProxyID const):
        (API::PageHandle::webPageID const):
        * Shared/API/Cocoa/WKBrowsingContextHandle.mm:
        (-[WKBrowsingContextHandle _initWithPageProxy:]):
        (-[WKBrowsingContextHandle _initWithPage:]):
        (-[WKBrowsingContextHandle _initWithPageProxyID:andWebPageID:]):
        (-[WKBrowsingContextHandle hash]):
        (-[WKBrowsingContextHandle isEqual:]):
        (-[WKBrowsingContextHandle encodeWithCoder:]):
        (-[WKBrowsingContextHandle initWithCoder:]):
        * Shared/API/Cocoa/WKBrowsingContextHandleInternal.h:
        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:
        * Shared/mac/ObjCObjectGraph.mm:
        (WebKit::ObjCObjectGraph::encode):
        (WebKit::ObjCObjectGraph::decode):
        * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
        (-[WKBrowsingContextController handle]):
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView dealloc]):
        (-[WKWebView _remoteObjectRegistry]):
        (-[WKWebView _handle]):
        * UIProcess/API/glib/WebKitURISchemeRequest.cpp:
        (webkitURISchemeRequestCreate):
        * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
        (WebKit::WebProcessProxy::transformHandlesToObjects):
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::~WebViewImpl):
        (WebKit::WebViewImpl::remoteObjectRegistry):
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
        (WebKit::NetworkProcessProxy::logDiagnosticMessage):
        (WebKit::NetworkProcessProxy::logDiagnosticMessageWithResult):
        (WebKit::NetworkProcessProxy::logDiagnosticMessageWithValue):
        (WebKit::NetworkProcessProxy::requestStorageAccessConfirm):
        (WebKit::NetworkProcessProxy::didCommitCrossSiteLoadWithDataTransferFromPrevalentResource):
        (WebKit::NetworkProcessProxy::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
        * UIProcess/ProvisionalPageProxy.cpp:
        (WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
        (WebKit::ProvisionalPageProxy::loadData):
        (WebKit::ProvisionalPageProxy::loadRequest):
        (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionAsync):
        (WebKit::ProvisionalPageProxy::decidePolicyForResponse):
        (WebKit::ProvisionalPageProxy::startURLSchemeTask):
        (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionSync):
        * UIProcess/ProvisionalPageProxy.h:
        (WebKit::ProvisionalPageProxy::webPageID const):
        * UIProcess/SuspendedPageProxy.h:
        * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
        (WebKit::WebUserContentControllerProxy::didPostMessage):
        * UIProcess/UserContent/WebUserContentControllerProxy.h:
        * UIProcess/UserContent/WebUserContentControllerProxy.messages.in:
        * UIProcess/VisitedLinkStore.cpp:
        (WebKit::VisitedLinkStore::addVisitedLinkHashFromPage):
        * UIProcess/VisitedLinkStore.h:
        * UIProcess/VisitedLinkStore.messages.in:
        * UIProcess/WebInspectorProxy.cpp:
        (WebKit::WebInspectorProxy::createFrontendPage):
        (WebKit::WebInspectorProxy::openLocalInspectorFrontend):
        (WebKit::WebInspectorProxy::closeFrontendPageAndWindow):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::swapToWebProcess):
        (WebKit::WebPageProxy::loadRequest):
        (WebKit::WebPageProxy::loadRequestWithNavigationShared):
        (WebKit::WebPageProxy::loadData):
        (WebKit::WebPageProxy::loadDataWithNavigationShared):
        (WebKit::WebPageProxy::commitProvisionalPage):
        (WebKit::WebPageProxy::continueNavigationInNewProcess):
        (WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
        (WebKit::WebPageProxy::decidePolicyForNavigationActionAsyncShared):
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
        (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
        (WebKit::WebPageProxy::decidePolicyForNavigationActionSyncShared):
        (WebKit::WebPageProxy::decidePolicyForResponse):
        (WebKit::WebPageProxy::decidePolicyForResponseShared):
        (WebKit::WebPageProxy::createNewPage):
        (WebKit::WebPageProxy::creationParameters):
        (WebKit::WebPageProxy::startURLSchemeTask):
        (WebKit::WebPageProxy::startURLSchemeTaskShared):
        (WebKit::WebPageProxy::loadSynchronousURLSchemeTask):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::webPageFromCorePageIdentifier):
        (WebKit::WebProcessProxy::didReceiveMessage):
        (WebKit::WebProcessProxy::transformHandlesToObjects):
        (WebKit::WebProcessProxy::transformObjectsToHandles):
        * UIProcess/WebProcessProxy.h:
        * UIProcess/WebURLSchemeHandler.cpp:
        (WebKit::WebURLSchemeHandler::startTask):
        (WebKit::WebURLSchemeHandler::taskCompleted):
        * UIProcess/WebURLSchemeHandler.h:
        * UIProcess/WebURLSchemeTask.cpp:
        (WebKit::WebURLSchemeTask::create):
        (WebKit::WebURLSchemeTask::WebURLSchemeTask):
        (WebKit::WebURLSchemeTask::didPerformRedirection):
        (WebKit::WebURLSchemeTask::didReceiveResponse):
        (WebKit::WebURLSchemeTask::didReceiveData):
        (WebKit::WebURLSchemeTask::didComplete):
        (WebKit::WebURLSchemeTask::pageDestroyed):
        * UIProcess/WebURLSchemeTask.h:
        (WebKit::WebURLSchemeTask::pageProxyID const):
        (WebKit::WebURLSchemeTask::webPageID const):
        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
        (-[WKWebProcessPlugInBrowserContextController handle]):
        (+[WKWebProcessPlugInBrowserContextController lookUpBrowsingContextFromHandle:]):
        * WebProcess/UserContent/WebUserContentController.cpp:
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::createWindow):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
        * WebProcess/WebPage/Cocoa/WebRemoteObjectRegistry.cpp:
        (WebKit::WebRemoteObjectRegistry::WebRemoteObjectRegistry):
        (WebKit::WebRemoteObjectRegistry::close):
        * WebProcess/WebPage/VisitedLinkTableController.cpp:
        (WebKit::VisitedLinkTableController::addVisitedLink):
        * WebProcess/WebPage/WebInspectorUI.cpp:
        (WebKit::WebInspectorUI::establishConnection):
        * WebProcess/WebPage/WebInspectorUI.h:
        * WebProcess/WebPage/WebInspectorUI.messages.in:
        * WebProcess/WebPage/WebPage.cpp:
        * WebProcess/WebPage/WebPage.h:
        (WebKit::WebPage::sessionStorageNamespaceIdentifier const):
        (WebKit::WebPage::webPageProxyIdentifier const):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::didReceiveMessage):
        (WebKit::WebProcess::transformHandlesToObjects):
        (WebKit::WebProcess::transformObjectsToHandles):
        * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
        (WebKit::StorageNamespaceImpl::createSessionStorageNamespace):
        (WebKit::StorageNamespaceImpl::createLocalStorageNamespace):
        (WebKit::StorageNamespaceImpl::createTransientLocalStorageNamespace):
        (WebKit::StorageNamespaceImpl::StorageNamespaceImpl):
        (WebKit::StorageNamespaceImpl::copy):
        (WebKit::StorageNamespaceImpl::sessionStoragePageID const):
        * WebProcess/WebStorage/StorageNamespaceImpl.h:
        * WebProcess/WebStorage/WebStorageNamespaceProvider.cpp:
        (WebKit::WebStorageNamespaceProvider::createSessionStorageNamespace):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::transformHandlesToObjects):

2019-08-30  Keith Rollin  <krollin@apple.com>

        Remove AppKitCompatibilityDeclarations.h
        https://bugs.webkit.org/show_bug.cgi?id=201283
        <rdar://problem/54822042>

        Reviewed by Alexey Proskuryakov.

        The two copies of these files -- on in WTF, one in MiniBrowser -- are
        empty and can be removed.

        * WebKit2Prefix.h:

2019-08-30  Adrian Perez de Castro  <aperez@igalia.com>

        [WPE][GTK] New API to remove a filter from an user content manager given its identifier
        https://bugs.webkit.org/show_bug.cgi?id=200479

        Reviewed by Carlos Garcia Campos.

        * UIProcess/API/glib/WebKitUserContentManager.cpp:
        (webkit_user_content_manager_remove_filter_by_id): Add new public API function.
        * UIProcess/API/gtk/WebKitUserContentManager.h: Add declaration for
        webkit_user_content_manager_remove_filter_by_id().
        * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: List new function.
        * UIProcess/API/wpe/WebKitUserContentManager.h: Add declaration for
        webkit_user_content_manager_remove_filter_by_id().
        * UIProcess/API/wpe/docs/wpe-1.0-sections.txt: List new function.

2019-08-30  Pablo Saavedra  <psaavedra@igalia.com>

        [GTK] Build failure in Debian Stable and Ubuntu LTS bots
        https://bugs.webkit.org/show_bug.cgi?id=201337

        Reviewed by Carlos Garcia Campos.

        * UIProcess/gtk/WaylandCompositor.cpp:
        (WebKit::WaylandCompositor::bindSurfaceToWebPage):

2019-08-30  Philippe Normand  <pnormand@igalia.com>

        [WPE][Qt] loadingChanged signal parameter is unusable
        https://bugs.webkit.org/show_bug.cgi?id=201301

        Reviewed by Carlos Garcia Campos.

        * UIProcess/API/wpe/qt/WPEQtView.h: Explicitely name signal
        parameter. It is a runtime requirement for QML.

2019-08-29  Keith Rollin  <krollin@apple.com>

        Remove HAVE_PASSKIT_GRANULAR_ERRORS conditional
        https://bugs.webkit.org/show_bug.cgi?id=201278
        <rdar://problem/54821052>

        Reviewed by Alex Christensen.

        HAVE_PASSKIT_GRANULAR_ERRORS is always True, so remove the conditional
        tests, keeping the True branches and removing the False branches.

        * Platform/cocoa/PaymentAuthorizationPresenter.mm:
        (WebKit::PaymentAuthorizationPresenter::completePaymentSession):
        (WebKit::PaymentAuthorizationPresenter::completeShippingContactSelection):
        * Platform/cocoa/PaymentAuthorizationViewController.mm:
        (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didAuthorizePayment:completion:]): Deleted.
        (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:completion:]): Deleted.
        (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:completion:]): Deleted.
        (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectPaymentMethod:completion:]): Deleted.
        * Platform/cocoa/WKPaymentAuthorizationDelegate.h:
        * Platform/cocoa/WKPaymentAuthorizationDelegate.mm:
        (-[WKPaymentAuthorizationDelegate completePaymentMethodSelection:]):
        (-[WKPaymentAuthorizationDelegate completePaymentSession:errors:didReachFinalState:]):
        (-[WKPaymentAuthorizationDelegate completeShippingContactSelection:summaryItems:shippingMethods:errors:]):
        (-[WKPaymentAuthorizationDelegate completeShippingMethodSelection:]):
        * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
        (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard):
        (WebKit::toPKContactFields):
        (WebKit::toNSSet):
        (WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest):
        (WebKit::toPKAddressField): Deleted.

2019-08-29  Chris Dumez  <cdumez@apple.com>

        Add "IsolatedCopy" in the name of String getters that call isolatedCopy() on the string
        https://bugs.webkit.org/show_bug.cgi?id=201318

        Reviewed by Alex Christensen.

        Add "IsolatedCopy" in the name of String getters that call isolatedCopy() on the string, for clarity.

        * NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.cpp:
        (WebKit::ResourceLoadStatisticsPersistentStorage::storageDirectoryPathIsolatedCopy const):
        (WebKit::ResourceLoadStatisticsPersistentStorage::resourceLogFilePath const):
        (WebKit::ResourceLoadStatisticsPersistentStorage::monitorDirectoryForNewStatistics):
        * NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.h:
        * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
        (WebKit::NetworkCache::BlobStorage::blobDirectoryPathIsolatedCopy const):
        (WebKit::NetworkCache::BlobStorage::synchronize):
        (WebKit::NetworkCache::BlobStorage::blobPathForHash const):
        * NetworkProcess/cache/NetworkCacheBlobStorage.h:
        * NetworkProcess/cache/NetworkCacheStorage.cpp:
        (WebKit::NetworkCache::Storage::basePathIsolatedCopy const):
        (WebKit::NetworkCache::Storage::versionPath const):
        (WebKit::NetworkCache::Storage::recordsPathIsolatedCopy const):
        (WebKit::NetworkCache::Storage::synchronize):
        (WebKit::NetworkCache::Storage::recordDirectoryPathForKey const):
        (WebKit::NetworkCache::Storage::traverse):
        (WebKit::NetworkCache::Storage::clear):
        (WebKit::NetworkCache::Storage::shrink):
        (WebKit::NetworkCache::Storage::deleteOldVersions):
        * NetworkProcess/cache/NetworkCacheStorage.h:

2019-08-29  Keith Rollin  <krollin@apple.com>

        Update .xcconfig symbols to reflect the current set of past and future product versions.
        https://bugs.webkit.org/show_bug.cgi?id=200720
        <rdar://problem/54305032>

        Reviewed by Alex Christensen.

        Remove version symbols related to old OS's we no longer support,
        ensure that version symbols are defined for OS's we do support.

        * Configurations/Base.xcconfig:
        * Configurations/DebugRelease.xcconfig:
        * Configurations/Version.xcconfig:

2019-08-29  Keith Rollin  <krollin@apple.com>

        Invalid XPCServices symlinks are being created
        https://bugs.webkit.org/show_bug.cgi?id=201320
        <rdar://problem/54719612>

        Reviewed by Dan Bernstein.

        When performing incremental builds, errant XPCServices symlinks can be
        created. For example, in the following, the second symlink is the
        correct one. The first symlink gets created when the build process
        tries to create the symlink and it already exists. When it already
        exists, the command to create the symlink actually follows the
        existing symlink and creates the (second) symlink at the location
        where the first symlink points.

            WebKit.framework/Versions/A/XPCServices/XPCServices@ -> Versions/Current/XPCServices
            WebKit.framework/XPCServices@ -> Versions/Current/XPCServices

        Address this by specifying -h to the `ln` command, which will cause it
        to not follow symlinks if they already exist at the target.

        Also, fix a benign issue where the Xcode build variable WRAPPER_NAME
        was being referenced in a context where it wasn't defined.

        * WebKit.xcodeproj/project.pbxproj:

2019-08-29  Alex Christensen  <achristensen@webkit.org>

        Speculative loads should use the NetworkSession owning their Cache
        https://bugs.webkit.org/show_bug.cgi?id=201314

        Reviewed by Chris Dumez.

        This provides a performance improvement when using non-default persistent WKWebsiteDataStores.

        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::NetworkSession):
        * NetworkProcess/cache/NetworkCache.cpp:
        (WebKit::NetworkCache::Cache::open):
        (WebKit::NetworkCache::Cache::Cache):
        * NetworkProcess/cache/NetworkCache.h:
        (WebKit::NetworkCache::Cache::sessionID const):
        * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
        (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):

2019-08-29  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS 13] Caret does not appear in text field if the body element is translated completely out of the viewport
        https://bugs.webkit.org/show_bug.cgi?id=201287
        <rdar://problem/54780864>

        Reviewed by Tim Horton.

        During EditorState computation, we use the hidden editable element heuristic to determine whether we should
        begin suppressing selection gestures and UI. Currently, we use the editable root of the selection range to
        determine where in the layer tree we should start our ascent, in search of a completely transparent or
        completely clipped container.

        However, in the case where the selection is inside a focused text field, this causes us to walk up the layer
        tree starting at the RenderLayer corresponding to the text field's inner contenteditable div, which is different
        than the text field's enclosing RenderLayer in the case where the containing block is transformed, such that no
        part of it is within the visible viewport. This scenario is exercised by the below test case, in which the caret
        after transforming the body horizontally by -100vw is hidden due to a false positive in the hidden editable area
        heuristic.

        Fix this by starting the layer tree ascent from the enclosing layer of the text form control if applicable,
        instead of the inner editable area under the shadow root of the form control.

        Test: editing/selection/ios/show-selection-in-transformed-container.html

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

2019-08-29  Youenn Fablet  <youenn@apple.com>

        Skip fetch event dispatching if no fetch event handler is added at script evaluation time
        https://bugs.webkit.org/show_bug.cgi?id=201174

        Reviewed by Chris Dumez.

        Store whether a fetch event handler is set at script evaluation time.
        If not, we skip the fetch event entirely so that the network load can start sooner.
        If fetch event is skipped, we trigger soft update, as defined in
        https://w3c.github.io/ServiceWorker/#handle-fetch step 16.

        * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
        (WebKit::WebSWServerConnection::startFetch):
        * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
        (WebKit::WebSWServerToContextConnection::softUpdate):
        * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
        * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        (WebKit::WebSWContextManagerConnection::serviceWorkerStarted):
        (WebKit::WebSWContextManagerConnection::serviceWorkerFailedToStart):
        (WebKit::WebSWContextManagerConnection::softUpdate):
        * WebProcess/Storage/WebSWContextManagerConnection.h:
        * WebProcess/Storage/WebSWContextManagerConnection.messages.in:

2019-08-29  Keith Rollin  <krollin@apple.com>

        Remove support for macOS < 10.13 (part 3)
        https://bugs.webkit.org/show_bug.cgi?id=201224
        <rdar://problem/54795934>

        Reviewed by Darin Adler.

        Remove symbols in WebKitTargetConditionals.xcconfig related to macOS
        10.13, including WK_MACOS_1013 and WK_MACOS_BEFORE_1013, and suffixes
        like _MACOS_SINCE_1013.

        * Configurations/WebKitTargetConditionals.xcconfig:

2019-08-29  Youenn Fablet  <youenn@apple.com>

        Use WebPageProxy callbacks in case of authentication challenge received from Service Worker
        https://bugs.webkit.org/show_bug.cgi?id=201177

        Reviewed by Alex Christensen.

        Send topOrigin for every possible load to NetworkProcess.
        Send topOrigin as part of authentication challenge to UIProcess.

        If there is no corresponding page for the pageID, try getting a page
        related to the service worker using the topOrigin and send the challenge to it.

        * NetworkProcess/NetworkCORSPreflightChecker.cpp:
        (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
        * NetworkProcess/NetworkCORSPreflightChecker.h:
        * NetworkProcess/NetworkLoad.cpp:
        (WebKit::NetworkLoad::didReceiveChallenge):
        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::NetworkLoadChecker):
        (WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
        * NetworkProcess/NetworkLoadChecker.h:
        * NetworkProcess/NetworkLoadParameters.h:
        * NetworkProcess/NetworkResourceLoadParameters.cpp:
        (WebKit::NetworkResourceLoadParameters::encode const):
        (WebKit::NetworkResourceLoadParameters::decode):
        * NetworkProcess/NetworkResourceLoadParameters.h:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::m_shouldCaptureExtraNetworkLoadMetrics):
        * NetworkProcess/PingLoad.cpp:
        (WebKit::PingLoad::PingLoad):
        (WebKit::PingLoad::didReceiveChallenge):
        * Shared/Authentication/AuthenticationManager.cpp:
        (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
        * Shared/Authentication/AuthenticationManager.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::processAuthenticationChallenge):
        (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/Network/NetworkProcessProxy.messages.in:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::didReceiveAuthenticationChallengeProxy):
        * UIProcess/WebPageProxy.h:
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
        (WebKit::WebLoaderStrategy::loadResourceSynchronously):
        (WebKit::WebLoaderStrategy::startPingLoad):

2019-08-29  Chris Dumez  <cdumez@apple.com>

        Dissociate the WebPageProxy's identifier from the WebPage's
        https://bugs.webkit.org/show_bug.cgi?id=201233

        Reviewed by Alex Christensen.

        Dissociate the WebPageProxy's identifier from the WebPage's. This will allow bumping the
        WebPage's identifier everytime we create a WebPage in a new process in case of process
        swap on navigation (Bug 201225).

        * Shared/WebBackForwardListItem.cpp:
        (WebKit::WebBackForwardListItem::create):
        (WebKit::WebBackForwardListItem::WebBackForwardListItem):
        * Shared/WebBackForwardListItem.h:
        (WebKit::WebBackForwardListItem::pageID const):
        * UIProcess/API/C/WKPage.cpp:
        (WKPageSetPageLoaderClient):
        * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
        (-[WKBrowsingContextController handle]):
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView dealloc]):
        (-[WKWebView _didCommitLayerTree:]):
        (-[WKWebView _dispatchSetViewLayoutSize:]):
        (-[WKWebView _cancelAnimatedResize]):
        (-[WKWebView _remoteObjectRegistry]):
        (-[WKWebView _handle]):
        (-[WKWebView _focusTextInputContext:completionHandler:]):
        (-[WKWebView _endAnimatedResize]):
        (-[WKWebView _resizeWhileHidingContentWithUpdates:]):
        (-[WKWebView _overrideLayoutParametersWithMinimumLayoutSize:maximumUnobscuredSizeOverride:]):
        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _getAllStorageAccessEntriesFor:completionHandler:]):
        * UIProcess/API/glib/WebKitWebContext.cpp:
        (webkitWebContextGetWebViewForPage):
        * UIProcess/API/glib/WebKitWebView.cpp:
        (webkit_web_view_get_page_id):
        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::handleForWebPageProxy):
        (WebKit::WebAutomationSession::switchToBrowsingContext):
        (WebKit::WebAutomationSession::waitForNavigationToCompleteOnPage):
        (WebKit::WebAutomationSession::respondToPendingPageNavigationCallbacksWithTimeout):
        (WebKit::WebAutomationSession::navigationOccurredForFrame):
        (WebKit::WebAutomationSession::documentLoadedForFrame):
        (WebKit::WebAutomationSession::inspectorFrontendLoaded):
        (WebKit::WebAutomationSession::mouseEventsFlushedForPage):
        (WebKit::WebAutomationSession::keyboardEventsFlushedForPage):
        (WebKit::WebAutomationSession::willClosePage):
        (WebKit::WebAutomationSession::evaluateJavaScriptFunction):
        (WebKit::WebAutomationSession::resolveChildFrameHandle):
        (WebKit::WebAutomationSession::resolveParentFrameHandle):
        (WebKit::WebAutomationSession::computeElementLayout):
        (WebKit::WebAutomationSession::selectOptionElement):
        (WebKit::WebAutomationSession::getAllCookies):
        (WebKit::WebAutomationSession::deleteSingleCookie):
        (WebKit::WebAutomationSession::inputDispatcherForPage):
        (WebKit::WebAutomationSession::viewportInViewCenterPointOfElement):
        (WebKit::WebAutomationSession::simulateMouseInteraction):
        (WebKit::WebAutomationSession::simulateKeyboardInteraction):
        (WebKit::WebAutomationSession::performMouseInteraction):
        (WebKit::WebAutomationSession::performKeyboardInteractions):
        (WebKit::WebAutomationSession::takeScreenshot):
        * UIProcess/Automation/WebAutomationSession.h:
        * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
        (WebKit::WebAutomationSession::inspectBrowsingContext):
        * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
        (WebKit::PlaybackSessionManagerProxy::PlaybackSessionManagerProxy):
        (WebKit::PlaybackSessionManagerProxy::invalidate):
        * UIProcess/Cocoa/TextCheckingController.mm:
        (WebKit::TextCheckingController::replaceRelativeToSelection):
        (WebKit::TextCheckingController::removeAnnotationRelativeToSelection):
        * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
        (WebKit::VideoFullscreenManagerProxy::VideoFullscreenManagerProxy):
        (WebKit::VideoFullscreenManagerProxy::invalidate):
        * UIProcess/Cocoa/WebPageProxyCocoa.mm:
        (WebKit::WebPageProxy::performDictionaryLookupAtLocation):
        (WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection):
        (WebKit::WebPageProxy::paymentCoordinatorAddMessageReceiver):
        (WebKit::WebPageProxy::paymentCoordinatorRemoveMessageReceiver):
        (WebKit::WebPageProxy::speakingErrorOccurred):
        (WebKit::WebPageProxy::boundaryEventOccurred):
        (WebKit::WebPageProxy::voicesDidChange):
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::~WebViewImpl):
        (WebKit::WebViewImpl::windowDidOrderOffScreen):
        (WebKit::WebViewImpl::windowDidOrderOnScreen):
        (WebKit::WebViewImpl::windowDidChangeOcclusionState):
        (WebKit::WebViewImpl::viewDidHide):
        (WebKit::WebViewImpl::viewDidUnhide):
        (WebKit::WebViewImpl::activeSpaceDidChange):
        (WebKit::WebViewImpl::remoteObjectRegistry):
        * UIProcess/GeolocationPermissionRequestManagerProxy.cpp:
        (WebKit::GeolocationPermissionRequestManagerProxy::didReceiveGeolocationPermissionDecision):
        * UIProcess/InspectorTargetProxy.cpp:
        (WebKit::InspectorTargetProxy::connect):
        (WebKit::InspectorTargetProxy::disconnect):
        (WebKit::InspectorTargetProxy::sendMessageToTargetBackend):
        * UIProcess/Notifications/NotificationPermissionRequestManagerProxy.cpp:
        (WebKit::NotificationPermissionRequestManagerProxy::createRequest):
        * UIProcess/Notifications/WebNotificationManagerProxy.cpp:
        (WebKit::WebNotificationManagerProxy::show):
        (WebKit::WebNotificationManagerProxy::cancel):
        (WebKit::WebNotificationManagerProxy::didDestroyNotification):
        (WebKit::pageIDsMatch):
        (WebKit::pageAndNotificationIDsMatch):
        (WebKit::WebNotificationManagerProxy::clearNotifications):
        (WebKit::WebNotificationManagerProxy::providerDidShowNotification):
        (WebKit::WebNotificationManagerProxy::providerDidClickNotification):
        * UIProcess/Notifications/WebNotificationManagerProxy.h:
        * UIProcess/ProvisionalPageProxy.cpp:
        (WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
        (WebKit::ProvisionalPageProxy::~ProvisionalPageProxy):
        (WebKit::ProvisionalPageProxy::processDidTerminate):
        (WebKit::ProvisionalPageProxy::cancel):
        (WebKit::ProvisionalPageProxy::initializeWebPage):
        (WebKit::ProvisionalPageProxy::loadData):
        (WebKit::ProvisionalPageProxy::loadRequest):
        (WebKit::ProvisionalPageProxy::goToBackForwardItem):
        (WebKit::ProvisionalPageProxy::didCreateMainFrame):
        (WebKit::ProvisionalPageProxy::didStartProvisionalLoadForFrame):
        (WebKit::ProvisionalPageProxy::didFailProvisionalLoadForFrame):
        (WebKit::ProvisionalPageProxy::didCommitLoadForFrame):
        * UIProcess/ProvisionalPageProxy.h:
        * UIProcess/RemoteWebInspectorProxy.cpp:
        (WebKit::RemoteWebInspectorProxy::load):
        (WebKit::RemoteWebInspectorProxy::sendMessageToFrontend):
        (WebKit::RemoteWebInspectorProxy::createFrontendPageAndWindow):
        (WebKit::RemoteWebInspectorProxy::closeFrontendPageAndWindow):
        * UIProcess/SuspendedPageProxy.cpp:
        (WebKit::SuspendedPageProxy::SuspendedPageProxy):
        (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
        (WebKit::SuspendedPageProxy::unsuspend):
        (WebKit::SuspendedPageProxy::close):
        (WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
        (WebKit::SuspendedPageProxy::loggingString const):
        * UIProcess/SuspendedPageProxy.h:
        * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
        (WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged):
        (WebKit::UserMediaPermissionRequestManagerProxy::denyRequest):
        (WebKit::UserMediaPermissionRequestManagerProxy::finishGrantingRequest):
        * UIProcess/ViewGestureController.cpp:
        (WebKit::ViewGestureController::ViewGestureController):
        (WebKit::ViewGestureController::~ViewGestureController):
        (WebKit::ViewGestureController::disconnectFromProcess):
        (WebKit::ViewGestureController::connectToProcess):
        (WebKit::ViewGestureController::controllerForGesture):
        (WebKit::ViewGestureController::forceRepaintIfNeeded):
        (WebKit::ViewGestureController::requestRenderTreeSizeNotificationIfNeeded):
        * UIProcess/ViewGestureController.h:
        * UIProcess/VisitedLinkStore.cpp:
        (WebKit::VisitedLinkStore::addVisitedLinkHashFromPage):
        * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp:
        (WebKit::WebAuthenticatorCoordinatorProxy::WebAuthenticatorCoordinatorProxy):
        (WebKit::WebAuthenticatorCoordinatorProxy::~WebAuthenticatorCoordinatorProxy):
        * UIProcess/WebBackForwardList.cpp:
        (WebKit::WebBackForwardList::itemForID):
        (WebKit::WebBackForwardList::restoreFromState):
        * UIProcess/WebEditCommandProxy.cpp:
        (WebKit::WebEditCommandProxy::unapply):
        (WebKit::WebEditCommandProxy::reapply):
        * UIProcess/WebFrameProxy.cpp:
        (WebKit::WebFrameProxy::loadURL):
        (WebKit::WebFrameProxy::loadData):
        (WebKit::WebFrameProxy::stopLoading const):
        (WebKit::WebFrameProxy::collapseSelection):
        * UIProcess/WebFullScreenManagerProxy.cpp:
        (WebKit::WebFullScreenManagerProxy::WebFullScreenManagerProxy):
        (WebKit::WebFullScreenManagerProxy::~WebFullScreenManagerProxy):
        (WebKit::WebFullScreenManagerProxy::willEnterFullScreen):
        (WebKit::WebFullScreenManagerProxy::didEnterFullScreen):
        (WebKit::WebFullScreenManagerProxy::willExitFullScreen):
        (WebKit::WebFullScreenManagerProxy::didExitFullScreen):
        (WebKit::WebFullScreenManagerProxy::setAnimatingFullScreen):
        (WebKit::WebFullScreenManagerProxy::requestExitFullScreen):
        (WebKit::WebFullScreenManagerProxy::saveScrollPosition):
        (WebKit::WebFullScreenManagerProxy::restoreScrollPosition):
        (WebKit::WebFullScreenManagerProxy::setFullscreenInsets):
        (WebKit::WebFullScreenManagerProxy::setFullscreenAutoHideDuration):
        (WebKit::WebFullScreenManagerProxy::setFullscreenControlsHidden):
        * UIProcess/WebInspectorProxy.cpp:
        (WebKit::WebInspectorProxy::WebInspectorProxy):
        (WebKit::WebInspectorProxy::invalidate):
        (WebKit::WebInspectorProxy::sendMessageToFrontend):
        (WebKit::WebInspectorProxy::connect):
        (WebKit::WebInspectorProxy::close):
        (WebKit::WebInspectorProxy::reset):
        (WebKit::WebInspectorProxy::updateForNewPageProcess):
        (WebKit::WebInspectorProxy::setFrontendConnection):
        (WebKit::WebInspectorProxy::showConsole):
        (WebKit::WebInspectorProxy::showResources):
        (WebKit::WebInspectorProxy::showMainResourceForFrame):
        (WebKit::WebInspectorProxy::attach):
        (WebKit::WebInspectorProxy::detach):
        (WebKit::WebInspectorProxy::togglePageProfiling):
        (WebKit::WebInspectorProxy::toggleElementSelection):
        (WebKit::WebInspectorProxy::createFrontendPage):
        (WebKit::WebInspectorProxy::openLocalInspectorFrontend):
        (WebKit::WebInspectorProxy::open):
        (WebKit::WebInspectorProxy::closeFrontendPageAndWindow):
        (WebKit::WebInspectorProxy::attachAvailabilityChanged):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::WebPageProxy):
        (WebKit::m_resetRecentCrashCountTimer):
        (WebKit::WebPageProxy::~WebPageProxy):
        (WebKit::WebPageProxy::setUIClient):
        (WebKit::WebPageProxy::setIconLoadingClient):
        (WebKit::WebPageProxy::launchProcess):
        (WebKit::WebPageProxy::suspendCurrentPageIfPossible):
        (WebKit::WebPageProxy::swapToWebProcess):
        (WebKit::WebPageProxy::launchProcessForReload):
        (WebKit::WebPageProxy::launchProcessWithItem):
        (WebKit::WebPageProxy::initializeWebPage):
        (WebKit::WebPageProxy::close):
        (WebKit::WebPageProxy::tryClose):
        (WebKit::WebPageProxy::loadRequest):
        (WebKit::WebPageProxy::loadRequestWithNavigationShared):
        (WebKit::WebPageProxy::loadFile):
        (WebKit::WebPageProxy::loadData):
        (WebKit::WebPageProxy::loadDataWithNavigationShared):
        (WebKit::WebPageProxy::loadAlternateHTML):
        (WebKit::WebPageProxy::loadWebArchiveData):
        (WebKit::WebPageProxy::navigateToPDFLinkWithSimulatedClick):
        (WebKit::WebPageProxy::stopLoading):
        (WebKit::WebPageProxy::reload):
        (WebKit::WebPageProxy::goToBackForwardItem):
        (WebKit::WebPageProxy::tryRestoreScrollPosition):
        (WebKit::WebPageProxy::setControlledByAutomation):
        (WebKit::WebPageProxy::setIndicating):
        (WebKit::WebPageProxy::createInspectorTargets):
        (WebKit::WebPageProxy::setBackgroundColor):
        (WebKit::WebPageProxy::setTopContentInset):
        (WebKit::WebPageProxy::setUnderlayColor):
        (WebKit::WebPageProxy::viewWillStartLiveResize):
        (WebKit::WebPageProxy::viewWillEndLiveResize):
        (WebKit::WebPageProxy::activityStateDidChange):
        (WebKit::WebPageProxy::viewDidEnterWindow):
        (WebKit::WebPageProxy::dispatchActivityStateChange):
        (WebKit::WebPageProxy::layerHostingModeDidChange):
        (WebKit::WebPageProxy::setInitialFocus):
        (WebKit::WebPageProxy::clearSelection):
        (WebKit::WebPageProxy::restoreSelectionInFocusedEditableElement):
        (WebKit::WebPageProxy::validateCommand):
        (WebKit::WebPageProxy::increaseListLevel):
        (WebKit::WebPageProxy::decreaseListLevel):
        (WebKit::WebPageProxy::changeListType):
        (WebKit::WebPageProxy::setBaseWritingDirection):
        (WebKit::WebPageProxy::setNeedsFontAttributes):
        (WebKit::WebPageProxy::scheduleFullEditorStateUpdate):
        (WebKit::WebPageProxy::selectAll):
        (WebKit::WebPageProxy::executeEditCommand):
        (WebKit::WebPageProxy::requestFontAttributesAtSelectionStart):
        (WebKit::WebPageProxy::setEditable):
        (WebKit::WebPageProxy::performDragControllerAction):
        (WebKit::WebPageProxy::dragEnded):
        (WebKit::WebPageProxy::didStartDrag):
        (WebKit::WebPageProxy::dragCancelled):
        (WebKit::WebPageProxy::processNextQueuedMouseEvent):
        (WebKit::WebPageProxy::sendWheelEvent):
        (WebKit::WebPageProxy::handleKeyboardEvent):
        (WebKit::WebPageProxy::handleGestureEvent):
        (WebKit::WebPageProxy::handleTouchEventSynchronously):
        (WebKit::WebPageProxy::resetPotentialTapSecurityOrigin):
        (WebKit::WebPageProxy::handleTouchEventAsynchronously):
        (WebKit::WebPageProxy::handleTouchEvent):
        (WebKit::WebPageProxy::cancelPointer):
        (WebKit::WebPageProxy::touchWithIdentifierWasRemoved):
        (WebKit::WebPageProxy::scrollBy):
        (WebKit::WebPageProxy::centerSelectionInVisibleArea):
        (WebKit::WebPageProxy::commitProvisionalPage):
        (WebKit::WebPageProxy::continueNavigationInNewProcess):
        (WebKit::WebPageProxy::setUserAgent):
        (WebKit::WebPageProxy::resumeActiveDOMObjectsAndAnimations):
        (WebKit::WebPageProxy::suspendActiveDOMObjectsAndAnimations):
        (WebKit::WebPageProxy::setCustomTextEncodingName):
        (WebKit::WebPageProxy::restoreFromSessionState):
        (WebKit::WebPageProxy::setTextZoomFactor):
        (WebKit::WebPageProxy::setPageZoomFactor):
        (WebKit::WebPageProxy::setPageAndTextZoomFactors):
        (WebKit::WebPageProxy::scalePage):
        (WebKit::WebPageProxy::scalePageInViewCoordinates):
        (WebKit::WebPageProxy::scaleView):
        (WebKit::WebPageProxy::windowScreenDidChange):
        (WebKit::WebPageProxy::accessibilitySettingsDidChange):
        (WebKit::WebPageProxy::setUseFixedLayout):
        (WebKit::WebPageProxy::setFixedLayoutSize):
        (WebKit::WebPageProxy::setAlwaysShowsHorizontalScroller):
        (WebKit::WebPageProxy::setAlwaysShowsVerticalScroller):
        (WebKit::WebPageProxy::listenForLayoutMilestones):
        (WebKit::WebPageProxy::setSuppressScrollbarAnimations):
        (WebKit::WebPageProxy::setEnableVerticalRubberBanding):
        (WebKit::WebPageProxy::setEnableHorizontalRubberBanding):
        (WebKit::WebPageProxy::setBackgroundExtendsBeyondPage):
        (WebKit::WebPageProxy::setPaginationMode):
        (WebKit::WebPageProxy::setPaginationBehavesLikeColumns):
        (WebKit::WebPageProxy::setPageLength):
        (WebKit::WebPageProxy::setGapBetweenPages):
        (WebKit::WebPageProxy::setPaginationLineGridEnabled):
        (WebKit::WebPageProxy::findStringMatches):
        (WebKit::WebPageProxy::findString):
        (WebKit::WebPageProxy::getImageForFindMatch):
        (WebKit::WebPageProxy::selectFindMatch):
        (WebKit::WebPageProxy::indicateFindMatch):
        (WebKit::WebPageProxy::hideFindUI):
        (WebKit::WebPageProxy::countStringMatches):
        (WebKit::WebPageProxy::replaceMatches):
        (WebKit::WebPageProxy::runJavaScriptInMainFrameScriptWorld):
        (WebKit::WebPageProxy::runJavaScriptInFrame):
        (WebKit::WebPageProxy::getRenderTreeExternalRepresentation):
        (WebKit::WebPageProxy::getSourceForFrame):
        (WebKit::WebPageProxy::getContentsAsString):
        (WebKit::WebPageProxy::getContentsAsAttributedString):
        (WebKit::WebPageProxy::getBytecodeProfile):
        (WebKit::WebPageProxy::getSamplingProfilerOutput):
        (WebKit::WebPageProxy::getContentsAsMHTMLData):
        (WebKit::WebPageProxy::getSelectionOrContentsAsString):
        (WebKit::WebPageProxy::getSelectionAsWebArchiveData):
        (WebKit::WebPageProxy::getMainResourceDataOfFrame):
        (WebKit::WebPageProxy::getResourceDataFromFrame):
        (WebKit::WebPageProxy::getWebArchiveOfFrame):
        (WebKit::WebPageProxy::forceRepaint):
        (WebKit::WebPageProxy::preferencesDidChange):
        (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
        (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrameShared):
        (WebKit::WebPageProxy::willPerformClientRedirectForFrame):
        (WebKit::WebPageProxy::didCancelClientRedirectForFrame):
        (WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared):
        (WebKit::WebPageProxy::didCommitLoadForFrame):
        (WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
        (WebKit::WebPageProxy::didFinishLoadForFrame):
        (WebKit::WebPageProxy::didFailLoadForFrame):
        (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
        (WebKit::WebPageProxy::decidePolicyForNavigationActionAsyncShared):
        (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
        (WebKit::WebPageProxy::decidePolicyForResponseShared):
        (WebKit::WebPageProxy::willSubmitForm):
        (WebKit::WebPageProxy::didNavigateWithNavigationDataShared):
        (WebKit::WebPageProxy::didPerformClientRedirectShared):
        (WebKit::WebPageProxy::didPerformServerRedirectShared):
        (WebKit::trySOAuthorization):
        (WebKit::WebPageProxy::createNewPage):
        (WebKit::WebPageProxy::showShareSheet):
        (WebKit::WebPageProxy::setMediaVolume):
        (WebKit::WebPageProxy::setMuted):
        (WebKit::WebPageProxy::stopMediaCapture):
        (WebKit::WebPageProxy::stopAllMediaPlayback):
        (WebKit::WebPageProxy::suspendAllMediaPlayback):
        (WebKit::WebPageProxy::resumeAllMediaPlayback):
        (WebKit::WebPageProxy::handleMediaEvent):
        (WebKit::WebPageProxy::setVolumeOfMediaElement):
        (WebKit::WebPageProxy::setMayStartMediaWhenInWindow):
        (WebKit::WebPageProxy::didChooseColor):
        (WebKit::WebPageProxy::didEndColorPicker):
        (WebKit::WebPageProxy::didCloseSuggestions):
        (WebKit::WebPageProxy::didSelectOption):
        (WebKit::WebPageProxy::setAllowsMediaDocumentInlinePlayback):
        (WebKit::WebPageProxy::backForwardAddItem):
        (WebKit::WebPageProxy::messageSenderDestinationID const):
        (WebKit::WebPageProxy::valueChangedForPopupMenu):
        (WebKit::WebPageProxy::setTextFromItemForPopupMenu):
        (WebKit::WebPageProxy::postMessageToInjectedBundle):
        (WebKit::WebPageProxy::failedToShowPopupMenu):
        (WebKit::WebPageProxy::showContextMenu):
        (WebKit::WebPageProxy::contextMenuItemSelected):
        (WebKit::WebPageProxy::handleContextMenuKeyEvent):
        (WebKit::WebPageProxy::didChooseFilesForOpenPanelWithDisplayStringAndIcon):
        (WebKit::WebPageProxy::didChooseFilesForOpenPanel):
        (WebKit::WebPageProxy::didCancelForOpenPanel):
        (WebKit::WebPageProxy::advanceToNextMisspelling):
        (WebKit::WebPageProxy::changeSpellingToWord):
        (WebKit::WebPageProxy::removeEditCommand):
        (WebKit::WebPageProxy::didFinishCheckingText):
        (WebKit::WebPageProxy::didCancelCheckingText):
        (WebKit::WebPageProxy::didReceiveEvent):
        (WebKit::WebPageProxy::processDidBecomeUnresponsive):
        (WebKit::WebPageProxy::processDidBecomeResponsive):
        (WebKit::WebPageProxy::dispatchProcessDidTerminate):
        (WebKit::WebPageProxy::gamepadActivity):
        (WebKit::WebPageProxy::updateWebsitePolicies):
        (WebKit::WebPageProxy::backForwardRemovedItem):
        (WebKit::WebPageProxy::setCanRunModal):
        (WebKit::WebPageProxy::beginPrinting):
        (WebKit::WebPageProxy::endPrinting):
        (WebKit::WebPageProxy::computePagesForPrinting):
        (WebKit::WebPageProxy::drawRectToImage):
        (WebKit::WebPageProxy::drawPagesToPDF):
        (WebKit::WebPageProxy::drawPagesForPrinting):
        (WebKit::WebPageProxy::setMinimumSizeForAutoLayout):
        (WebKit::WebPageProxy::setAutoSizingShouldExpandToViewHeight):
        (WebKit::WebPageProxy::setViewportSizeForCSSViewportUnits):
        (WebKit::WebPageProxy::handleAlternativeTextUIResult):
        (WebKit::WebPageProxy::setComposition):
        (WebKit::WebPageProxy::confirmComposition):
        (WebKit::WebPageProxy::cancelComposition):
        (WebKit::WebPageProxy::setScrollPinningBehavior):
        (WebKit::WebPageProxy::setOverlayScrollbarStyle):
        (WebKit::WebPageProxy::addMIMETypeWithCustomContentProvider):
        (WebKit::WebPageProxy::changeFontAttributes):
        (WebKit::WebPageProxy::changeFont):
        (WebKit::WebPageProxy::setTextAsync):
        (WebKit::WebPageProxy::insertTextAsync):
        (WebKit::WebPageProxy::hasMarkedText):
        (WebKit::WebPageProxy::getMarkedRangeAsync):
        (WebKit::WebPageProxy::getSelectedRangeAsync):
        (WebKit::WebPageProxy::characterIndexForPointAsync):
        (WebKit::WebPageProxy::firstRectForCharacterRangeAsync):
        (WebKit::WebPageProxy::setCompositionAsync):
        (WebKit::WebPageProxy::confirmCompositionAsync):
        (WebKit::WebPageProxy::takeSnapshot):
        (WebKit::WebPageProxy::requestActiveNowPlayingSessionInfo):
        (WebKit::WebPageProxy::performImmediateActionHitTestAtLocation):
        (WebKit::WebPageProxy::immediateActionDidUpdate):
        (WebKit::WebPageProxy::immediateActionDidCancel):
        (WebKit::WebPageProxy::immediateActionDidComplete):
        (WebKit::WebPageProxy::handleAcceptedCandidate):
        (WebKit::WebPageProxy::setUseSystemAppearance):
        (WebKit::WebPageProxy::setHeaderBannerHeightForTesting):
        (WebKit::WebPageProxy::setFooterBannerHeightForTesting):
        (WebKit::WebPageProxy::setShouldDispatchFakeMouseMoveEvents):
        (WebKit::WebPageProxy::setPlaybackTarget):
        (WebKit::WebPageProxy::externalOutputDeviceAvailableDidChange):
        (WebKit::WebPageProxy::setShouldPlayToPlaybackTarget):
        (WebKit::WebPageProxy::clearWheelEventTestTrigger):
        (WebKit::WebPageProxy::setShouldScaleViewToFitDocument):
        (WebKit::WebPageProxy::getLoadDecisionForIcon):
        (WebKit::WebPageProxy::setResourceCachingDisabled):
        (WebKit::WebPageProxy::setUserInterfaceLayoutDirection):
        (WebKit::WebPageProxy::didAllowPointerLock):
        (WebKit::WebPageProxy::didDenyPointerLock):
        (WebKit::WebPageProxy::requestPointerUnlock):
        (WebKit::WebPageProxy::setURLSchemeHandlerForScheme):
        (WebKit::WebPageProxy::didCommitCrossSiteLoadWithDataTransferFromPrevalentResource):
        (WebKit::WebPageProxy::effectiveAppearanceDidChange):
        (WebKit::WebPageProxy::insertAttachment):
        (WebKit::WebPageProxy::updateAttachmentAttributes):
        (WebKit::WebPageProxy::getApplicationManifest):
        (WebKit::WebPageProxy::setDefersLoadingForTesting):
        (WebKit::WebPageProxy::updateCurrentModifierState):
        (WebKit::WebPageProxy::simulateDeviceOrientationChange):
        (WebKit::WebPageProxy::detectDataInAllFrames):
        (WebKit::WebPageProxy::removeDataDetectedLinks):
        (WebKit::WebPageProxy::textInputContextsInRect):
        (WebKit::WebPageProxy::focusTextInputContext):
        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::identifier const):
        (WebKit::WebPageProxy::webPageID const):
        * UIProcess/WebPageProxyIdentifier.h: Added.
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
        (WebKit::WebProcessPool::pageEndUsingWebsiteDataStore):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::webPage):
        (WebKit::WebProcessProxy::addExistingWebPage):
        (WebKit::WebProcessProxy::removeWebPage):
        (WebKit::WebProcessProxy::addVisitedLinkStoreUser):
        (WebKit::WebProcessProxy::removeVisitedLinkStoreUser):
        (WebKit::WebProcessProxy::hasProvisionalPageWithID const):
        (WebKit::WebProcessProxy::isAllowedToUpdateBackForwardItem const):
        (WebKit::WebProcessProxy::transformObjectsToHandles):
        * UIProcess/WebProcessProxy.h:
        * UIProcess/WebURLSchemeHandler.cpp:
        (WebKit::WebURLSchemeHandler::startTask):
        (WebKit::WebURLSchemeHandler::stopAllTasksForPage):
        (WebKit::WebURLSchemeHandler::stopTask):
        (WebKit::WebURLSchemeHandler::removeTaskFromPageMap):
        * UIProcess/WebURLSchemeHandler.h:
        * UIProcess/WebURLSchemeTask.cpp:
        (WebKit::WebURLSchemeTask::WebURLSchemeTask):
        (WebKit::WebURLSchemeTask::didPerformRedirection):
        (WebKit::WebURLSchemeTask::didReceiveResponse):
        (WebKit::WebURLSchemeTask::didReceiveData):
        (WebKit::WebURLSchemeTask::didComplete):
        * UIProcess/WebURLSchemeTask.h:
        (WebKit::WebURLSchemeTask::pageID const):
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::getAllStorageAccessEntries):
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        * UIProcess/gtk/WebPageProxyGtk.cpp:
        (WebKit::WebPageProxy::getCenterForZoomGesture):
        * UIProcess/ios/EditableImageController.mm:
        (WebKit::EditableImageController::EditableImageController):
        (WebKit::EditableImageController::~EditableImageController):
        * UIProcess/ios/SmartMagnificationController.mm:
        (WebKit::SmartMagnificationController::SmartMagnificationController):
        (WebKit::SmartMagnificationController::~SmartMagnificationController):
        (WebKit::SmartMagnificationController::handleSmartMagnificationGesture):
        * UIProcess/ios/ViewGestureControllerIOS.mm:
        (WebKit::ViewGestureController::beginSwipeGesture):
        (WebKit::ViewGestureController::endSwipeGesture):
        * UIProcess/ios/WKContentView.mm:
        (-[WKContentView _wk_printedDocument]):
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView ensurePositionInformationIsUpToDate:]):
        (-[WKContentView requestAutocorrectionContextWithCompletionHandler:]):
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::requestFocusedElementInformation):
        (WebKit::WebPageProxy::updateVisibleContentRects):
        (WebKit::WebPageProxy::resendLastVisibleContentRects):
        (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
        (WebKit::WebPageProxy::setViewportConfigurationViewLayoutSize):
        (WebKit::WebPageProxy::setForceAlwaysUserScalable):
        (WebKit::WebPageProxy::setMaximumUnobscuredSize):
        (WebKit::WebPageProxy::setDeviceOrientation):
        (WebKit::WebPageProxy::setOverrideViewportArguments):
        (WebKit::WebPageProxy::selectWithGesture):
        (WebKit::WebPageProxy::updateSelectionWithTouches):
        (WebKit::WebPageProxy::replaceDictatedText):
        (WebKit::WebPageProxy::replaceSelectedText):
        (WebKit::WebPageProxy::requestAutocorrectionData):
        (WebKit::WebPageProxy::applyAutocorrection):
        (WebKit::WebPageProxy::selectTextWithGranularityAtPoint):
        (WebKit::WebPageProxy::selectPositionAtBoundaryWithDirection):
        (WebKit::WebPageProxy::moveSelectionAtBoundaryWithDirection):
        (WebKit::WebPageProxy::selectPositionAtPoint):
        (WebKit::WebPageProxy::beginSelectionInDirection):
        (WebKit::WebPageProxy::updateSelectionWithExtentPoint):
        (WebKit::WebPageProxy::updateSelectionWithExtentPointAndBoundary):
        (WebKit::WebPageProxy::requestDictationContext):
        (WebKit::WebPageProxy::requestAutocorrectionContext):
        (WebKit::WebPageProxy::getSelectionContext):
        (WebKit::WebPageProxy::handleTwoFingerTapAtPoint):
        (WebKit::WebPageProxy::handleStylusSingleTapAtPoint):
        (WebKit::WebPageProxy::selectWithTwoTouches):
        (WebKit::WebPageProxy::requestPositionInformation):
        (WebKit::WebPageProxy::startInteractionWithElementAtPosition):
        (WebKit::WebPageProxy::stopInteraction):
        (WebKit::WebPageProxy::performActionOnElement):
        (WebKit::WebPageProxy::applicationDidEnterBackground):
        (WebKit::WebPageProxy::applicationDidFinishSnapshottingAfterEnteringBackground):
        (WebKit::WebPageProxy::applicationWillEnterForeground):
        (WebKit::WebPageProxy::applicationWillResignActive):
        (WebKit::WebPageProxy::applicationDidBecomeActive):
        (WebKit::WebPageProxy::extendSelection):
        (WebKit::WebPageProxy::selectWordBackward):
        (WebKit::WebPageProxy::requestRectsForGranularityWithSelectionOffset):
        (WebKit::WebPageProxy::requestRectsAtSelectionOffsetWithText):
        (WebKit::WebPageProxy::storeSelectionForAccessibility):
        (WebKit::WebPageProxy::startAutoscrollAtPosition):
        (WebKit::WebPageProxy::cancelAutoscroll):
        (WebKit::WebPageProxy::moveSelectionByOffset):
        (WebKit::WebPageProxy::registerUIProcessAccessibilityTokens):
        (WebKit::WebPageProxy::willStartUserTriggeredZooming):
        (WebKit::WebPageProxy::potentialTapAtPosition):
        (WebKit::WebPageProxy::commitPotentialTap):
        (WebKit::WebPageProxy::cancelPotentialTap):
        (WebKit::WebPageProxy::tapHighlightAtPosition):
        (WebKit::WebPageProxy::handleTap):
        (WebKit::WebPageProxy::didRecognizeLongPress):
        (WebKit::WebPageProxy::handleDoubleTapForDoubleClickAtPoint):
        (WebKit::WebPageProxy::inspectorNodeSearchMovedToPosition):
        (WebKit::WebPageProxy::inspectorNodeSearchEndedAtPosition):
        (WebKit::WebPageProxy::blurFocusedElement):
        (WebKit::WebPageProxy::setIsShowingInputViewForFocusedElement):
        (WebKit::WebPageProxy::autofillLoginCredentials):
        (WebKit::WebPageProxy::focusNextFocusedElement):
        (WebKit::WebPageProxy::setFocusedElementValue):
        (WebKit::WebPageProxy::setFocusedElementValueAsNumber):
        (WebKit::WebPageProxy::setFocusedElementSelectedIndex):
        (WebKit::WebPageProxy::computePagesForPrintingAndDrawToPDF):
        (WebKit::WebPageProxy::contentSizeCategoryDidChange):
        (WebKit::WebPageProxy::generateSyntheticEditingCommand):
        (WebKit::WebPageProxy::hardwareKeyboardAvailabilityChanged):
        (WebKit::WebPageProxy::requestEvasionRectsAboveSelection):
        (WebKit::WebPageProxy::updateSelectionWithDelta):
        (WebKit::WebPageProxy::requestDocumentEditingContext):
        (WebKit::WebPageProxy::requestDragStart):
        (WebKit::WebPageProxy::requestAdditionalItemsForDragSession):
        (WebKit::WebPageProxy::didConcludeDrop):
        (WebKit::WebPageProxy::didRequestPasswordForQuickLookDocumentInMainFrameShared):
        * UIProcess/mac/RemoteWebInspectorProxyMac.mm:
        (WebKit::RemoteWebInspectorProxy::platformSave):
        (WebKit::RemoteWebInspectorProxy::platformAppend):
        * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
        (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateActivityState):
        * UIProcess/mac/ViewGestureControllerMac.mm:
        (WebKit::ViewGestureController::handleMagnificationGestureEvent):
        (WebKit::ViewGestureController::handleSmartMagnificationGesture):
        * UIProcess/mac/WKImmediateActionController.mm:
        (-[WKImmediateActionController immediateActionRecognizerWillBeginAnimation:]):
        * UIProcess/mac/WebInspectorProxyMac.mm:
        (WebKit::WebInspectorProxy::platformSave):
        (WebKit::WebInspectorProxy::platformAppend):
        * UIProcess/mac/WebPageProxyMac.mm:
        (WebKit::WebPageProxy::windowAndViewFramesChanged):
        (WebKit::WebPageProxy::setMainFrameIsScrollable):
        (WebKit::WebPageProxy::insertDictatedTextAsync):
        (WebKit::WebPageProxy::attributedSubstringForCharacterRangeAsync):
        (WebKit::WebPageProxy::fontAtSelection):
        (WebKit::WebPageProxy::stringSelectionForPasteboard):
        (WebKit::WebPageProxy::dataSelectionForPasteboard):
        (WebKit::WebPageProxy::readSelectionFromPasteboard):
        (WebKit::WebPageProxy::replaceSelectionWithPasteboardData):
        (WebKit::WebPageProxy::sendComplexTextInputToPlugin):
        (WebKit::WebPageProxy::uppercaseWord):
        (WebKit::WebPageProxy::lowercaseWord):
        (WebKit::WebPageProxy::capitalizeWord):
        (WebKit::WebPageProxy::setSmartInsertDeleteEnabled):
        (WebKit::WebPageProxy::registerUIProcessAccessibilityTokens):
        (WebKit::WebPageProxy::shouldDelayWindowOrderingForEvent):
        (WebKit::WebPageProxy::acceptsFirstMouse):
        * WebKit.xcodeproj/project.pbxproj:

2019-08-29  Chris Dumez  <cdumez@apple.com>

        Use inline data member initialization in ProcessLauncher
        https://bugs.webkit.org/show_bug.cgi?id=201247

        Reviewed by Ryosuke Niwa.

        * UIProcess/Launcher/ProcessLauncher.cpp:
        (WebKit::ProcessLauncher::ProcessLauncher):
        * UIProcess/Launcher/ProcessLauncher.h:

2019-08-28  Tim Horton  <timothy_horton@apple.com>

        Reloading a web view with a fixed-width viewport and variable content width restores the previous page scale, shouldn't
        https://bugs.webkit.org/show_bug.cgi?id=201256
        <rdar://problem/54809509>

        Reviewed by Simon Fraser.

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::restorePageState):
        When restoring page state from a history item, if the saved scale was equal to the
        initial scale at the time it was saved, ignore the saved scale and use the current
        initial scale instead.

        Normally this doesn't matter because a given page's initial scale doesn't usually change
        between loads, but it totally can! See the test for one example of a way an API client
        might cause this; you could also imagine something similar happening if the actual
        page content changed.

2019-08-28  Megan Gardner  <megan_gardner@apple.com>

        Null check webFrame when creating a print preview to prevent a crash.
        https://bugs.webkit.org/show_bug.cgi?id=201237
        <rdar://problem/51618863>

        Reviewed by Tim Horton.

        Move and expend a null check to keep from crashing when making a print preview.

        * UIProcess/mac/WKPrintingView.mm:
        (-[WKPrintingView _drawPreview:]):
        (-[WKPrintingView drawRect:]):

2019-08-28  Said Abou-Hallawa  <sabouhallawa@apple.com>

        All image drawing functions should take an argument of type ImagePaintingOptions
        https://bugs.webkit.org/show_bug.cgi?id=201059

        Reviewed by Simon Fraser.

        GraphicsContext::drawImage() now takes an ImagePaintingOptions.

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

2019-08-28  Keith Rollin  <krollin@apple.com>

        Remove support for macOS < 10.13 (part 2)
        https://bugs.webkit.org/show_bug.cgi?id=201197
        <rdar://problem/54759985>

        Reviewed by Darin Adler.

        Update conditionals that reference WK_MACOS_1013 and suffixes like
        _MACOS_SINCE_1013, assuming that we're always building on 10.13 or
        later and that these conditionals are always True or False.

        See Bug 200694 for earlier changes in this area.

        * Configurations/FeatureDefines.xcconfig:
        * Configurations/WebKit.xcconfig:

2019-08-28  Chris Dumez  <cdumez@apple.com>

        Have WebPageProxy generate the page identifier by itself
        https://bugs.webkit.org/show_bug.cgi?id=201223

        Reviewed by Ryosuke Niwa.

        Have WebPageProxy generate the page identifier by itself instead of
        having the WebProcessProxy do it.

        * UIProcess/ServiceWorkerProcessProxy.cpp:
        (WebKit::m_serviceWorkerPageID):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::create):
        (WebKit::WebPageProxy::WebPageProxy):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::createWebPage):
        (WebKit::WebProcessProxy::generatePageID): Deleted.
        * UIProcess/WebProcessProxy.h:

2019-08-28  Carlos Garcia Campos  <cgarcia@igalia.com>

        REGRESSION(r243434): Wrong URL passed to WebKitWebView::load-failed when cancelling previous load
        https://bugs.webkit.org/show_bug.cgi?id=201176

        Reviewed by Žan Doberšek.

        Use the current provisional/committed url when faking an error event, instead of the current active URI that can
        be the pending api request of a new load.

        * UIProcess/API/glib/WebKitWebView.cpp:
        (webkitWebViewWillStartLoad):

2019-08-28  Claudio Saavedra  <csaavedra@igalia.com>

        [GTK][WPE] Implement HSTS for the soup network backend
        https://bugs.webkit.org/show_bug.cgi?id=192074

        Reviewed by Carlos Garcia Campos.

        libsoup 2.67.1 introduced HSTS support via a SoupSessionFeature.
        Add support to the soup network backend by adding the feature to
        SoupNetworkSession and handling HSTS protocol upgrades, by
        propagating the scheme change further to clients. This patch adds
        the HSTS feature unconditionally, but it still possible to add
        a boolean property to the web context class if desired.

        Additionally, add API to the WebKitWebsiteDataManager to specify
        the directory where the HSTS database is saved. If the directory
        is not set or if the data manager is ephemeral, use a
        non-persistent, memory only HSTS enforcer.

        Implement as well the methods needed to clean-up and delete HSTS
        policies from the storage and expose the feature in GTK+
        MiniBrowser's about:data.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::fetchWebsiteData):
        (WebKit::NetworkProcess::deleteWebsiteData):
        (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
        (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
        (WebKit::NetworkProcess::registrableDomainsWithWebsiteData):
        * NetworkProcess/NetworkProcess.h:
        (WebKit::NetworkProcess::suppressesConnectionTerminationOnSystemChange const):
        * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
        (WebKit::NetworkDataTaskSoup::createRequest):
        (WebKit::NetworkDataTaskSoup::clearRequest):
        (WebKit::NetworkDataTaskSoup::shouldAllowHSTSPolicySetting const):
        (WebKit::NetworkDataTaskSoup::shouldAllowHSTSProtocolUpgrade const):
        (WebKit::NetworkDataTaskSoup::protocolUpgradedViaHSTS):
        (WebKit::NetworkDataTaskSoup::hstsEnforced):
        * NetworkProcess/soup/NetworkDataTaskSoup.h:
        * NetworkProcess/soup/NetworkProcessSoup.cpp:
        (WebKit::NetworkProcess::getHostNamesWithHSTSCache):
        (WebKit::NetworkProcess::deleteHSTSCacheForHostNames):
        (WebKit::NetworkProcess::clearHSTSCache):
        (WebKit::NetworkProcess::platformInitializeNetworkProcess):
        * UIProcess/API/APIWebsiteDataStore.h:
        * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
        (API::WebsiteDataStore::defaultHSTSDirectory):
        * UIProcess/API/glib/WebKitWebContext.cpp:
        (webkitWebContextConstructed):
        * UIProcess/API/glib/WebKitWebsiteData.cpp:
        (recordContainsSupportedDataTypes):
        (toWebKitWebsiteDataTypes):
        * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
        (webkitWebsiteDataManagerGetProperty):
        (webkitWebsiteDataManagerSetProperty):
        (webkitWebsiteDataManagerConstructed):
        (webkit_website_data_manager_class_init):
        (webkitWebsiteDataManagerGetDataStore):
        (webkit_website_data_manager_get_hsts_cache_directory):
        (toWebsiteDataTypes):
        * UIProcess/API/gtk/WebKitWebsiteData.h:
        * UIProcess/API/gtk/WebKitWebsiteDataManager.h:
        * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
        * UIProcess/API/wpe/WebKitWebsiteData.h:
        * UIProcess/API/wpe/WebKitWebsiteDataManager.h:
        * UIProcess/API/wpe/docs/wpe-1.0-sections.txt:
        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
        (WebKit::WebsiteDataStoreConfiguration::copy):
        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
        (WebKit::WebsiteDataStoreConfiguration::hstsStorageDirectory const):
        (WebKit::WebsiteDataStoreConfiguration::setHSTSStorageDirectory):

2019-08-27  Mark Lam  <mark.lam@apple.com>

        Refactor to use VM& instead of VM* at as many places as possible.
        https://bugs.webkit.org/show_bug.cgi?id=201172

        Reviewed by Yusuke Suzuki.

        * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMNode.cpp:
        (webkit_dom_node_for_js_value):
        * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
        (WebKit::InjectedBundleNodeHandle::getOrCreate):
        * WebProcess/Plugins/Netscape/JSNPObject.cpp:
        (WebKit::JSNPObject::getOwnPropertyNames):
        * WebProcess/Plugins/Netscape/NPJSObject.cpp:
        (WebKit::identifierFromIdentifierRep):
        (WebKit::NPJSObject::enumerate):
        * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
        (WebKit::NPRuntimeObjectMap::convertNPVariantToJSValue):
        (WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant):
        * WebProcess/WebPage/WebFrame.cpp:
        (WebKit::WebFrame::counterValue):

2019-08-27  James Savage  <james.savage@apple.com>

        Populate alternate URL for _WKActivatedElementInfo in UIContextMenu SPI.
        https://bugs.webkit.org/show_bug.cgi?id=201165.
        rdar://problem/54729648.

        Reviewed by Dean Jackson.

        * UIProcess/API/APIContextMenuElementInfo.h:
        * UIProcess/API/APIContextMenuElementInfo.cpp:
        (API::ContextMenuElementInfo::ContextMenuElementInfo): Initialize new memeber.

        * UIProcess/API/Cocoa/WKContextMenuElementInfo.mm:
        (-[WKContextMenuElementInfo _activatedElementInfo]): Use new initializer.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _requestActivatedElementAtPosition:completionBlock:]): Ditto.

        * UIProcess/API/Cocoa/_WKActivatedElementInfoInternal.h:
        * UIProcess/API/Cocoa/_WKActivatedElementInfo.mm:
        (+[_WKActivatedElementInfo activatedElementInfoWithInteractionInformationAtPosition:userInfo:]):
            Ditto.
        (-[_WKActivatedElementInfo _initWithInteractionInformationAtPosition:userInfo:]): Set new ivar.
        (+[_WKActivatedElementInfo activatedElementInfoWithInteractionInformationAtPosition:]): Deleted.
        (-[_WKActivatedElementInfo _initWithInteractionInformationAtPosition:]): Deleted.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView assignLegacyDataForContextMenuInteraction]): Use new initializer.
        (-[WKContentView continueContextMenuInteraction:]): If the context menu is being generated for
            an image, and we do not have a URL associated with the position information, try to
            generate one using existing SPI. This change also passes through the userInfo via a new
            property on _WKActivatedElementInfo. We only do this for the SPI version of this delegate
            method, because the API is not called for image previews.
        (-[WKContentView _contextMenuInteraction:overrideSuggestedActionsForConfiguration:]): Use new
            initializer.

2019-08-27  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [RemoteInspector][Socket] Restructuring the components of Socket implementation
        https://bugs.webkit.org/show_bug.cgi?id=201079

        Reviewed by Ross Kirsling.

        RemoteInspectorClient is now free from creation of SocketEndpoint. All communication
        to SocketEndpoint id now the duty of super class.

        * UIProcess/socket/RemoteInspectorClient.cpp:
        (WebKit::RemoteInspectorClient::RemoteInspectorClient): Remove direct communication to Socket Endpoint.
        (WebKit::RemoteInspectorClient::sendWebInspectorEvent): Ditto.
        * UIProcess/socket/RemoteInspectorClient.h:

2019-08-27  Chris Dumez  <cdumez@apple.com>

        Introduce subclasses to RemoteObjectRegistry for the UIProcess and the WebProcess
        https://bugs.webkit.org/show_bug.cgi?id=201153

        Reviewed by Alex Christensen.

        This better factoring improves code clarity.

        * PlatformMac.cmake:
        * Shared/API/Cocoa/RemoteObjectRegistry.h:
        (WebKit::RemoteObjectRegistry::~RemoteObjectRegistry):
        (WebKit::RemoteObjectRegistry::takeBackgroundActivityToken):
        * Shared/API/Cocoa/RemoteObjectRegistry.mm:
        (WebKit::RemoteObjectRegistry::RemoteObjectRegistry):
        (WebKit::RemoteObjectRegistry::sendInvocation):
        (WebKit::RemoteObjectRegistry::sendReplyBlock):
        (WebKit::RemoteObjectRegistry::sendUnusedReply):
        * Shared/API/Cocoa/_WKRemoteObjectRegistry.mm:
        (-[_WKRemoteObjectRegistry _initWithWebPage:]):
        (-[_WKRemoteObjectRegistry _initWithWebPageProxy:]):
        * SourcesCocoa.txt:
        * UIProcess/Cocoa/UIRemoteObjectRegistry.cpp: Added.
        (WebKit::UIRemoteObjectRegistry::takeBackgroundActivityToken):
        (WebKit::UIRemoteObjectRegistry::UIRemoteObjectRegistry):
        (WebKit::UIRemoteObjectRegistry::sendInvocation):
        (WebKit::UIRemoteObjectRegistry::messageSender):
        * UIProcess/Cocoa/UIRemoteObjectRegistry.h: Added.
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
        (WebKit::WebPage::setRemoteObjectRegistry):
        (WebKit::WebPage::remoteObjectRegistry):
        * WebProcess/WebPage/Cocoa/WebRemoteObjectRegistry.cpp: Added.
        (WebKit::WebRemoteObjectRegistry::WebRemoteObjectRegistry):
        (WebKit::WebRemoteObjectRegistry::~WebRemoteObjectRegistry):
        (WebKit::WebRemoteObjectRegistry::close):
        (WebKit::WebRemoteObjectRegistry::messageSender):
        * WebProcess/WebPage/Cocoa/WebRemoteObjectRegistry.h: Added.
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::close):
        * WebProcess/WebPage/WebPage.h:

2019-08-26  Jer Noble  <jer.noble@apple.com>

        Removing fullscreen element in rAF() callback after requestFullscreen() can leave fullscreen in inconsistent state.
        https://bugs.webkit.org/show_bug.cgi?id=201101
        <rdar://problem/54164587>

        Reviewed by Eric Carlson.

        Add more state to track in which direction the animation is flowing to allow in-process
        animations to be cancelled more gracefully.

        * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
        (-[WKFullScreenWindowController enterFullScreen]):
        (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
        (-[WKFullScreenWindowController requestExitFullScreen]):
        (-[WKFullScreenWindowController exitFullScreen]):
        * WebProcess/cocoa/VideoFullscreenManager.h:
        (WebKit::VideoFullscreenInterfaceContext::animationState const):
        (WebKit::VideoFullscreenInterfaceContext::setAnimationState):
        (WebKit::VideoFullscreenInterfaceContext::isAnimating const): Deleted.
        (WebKit::VideoFullscreenInterfaceContext::setIsAnimating): Deleted.
        * WebProcess/cocoa/VideoFullscreenManager.mm:
        (WebKit::VideoFullscreenManager::enterVideoFullscreenForVideoElement):
        (WebKit::VideoFullscreenManager::exitVideoFullscreenForVideoElement):
        (WebKit::VideoFullscreenManager::didEnterFullscreen):
        (WebKit::VideoFullscreenManager::didCleanupFullscreen):

2019-08-27  Carlos Garcia Campos  <cgarcia@igalia.com>

        Do not clear the pending api request when there's no navigation ID
        https://bugs.webkit.org/show_bug.cgi?id=201175

        Reviewed by Chris Dumez.

        After r247851, the pending API request URL is cleared for subresources in some cases.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):

2019-08-27  Zan Dobersek  <zdobersek@igalia.com>

        [CoordGraphics] Delay LayerTreeHost creation in always-on AC until DrawingArea painting is enabled
        https://bugs.webkit.org/show_bug.cgi?id=201178

        Reviewed by Carlos Garcia Campos.

        When in always-on AC mode, the LayerTreeHost spawning should be delayed
        until the WebPage construction (which sets up the LayerTreeHost-owning
        DrawingArea implementation) is further done with initializing relevant
        state, and not immediately after the DrawingArea is done with preference
        updates.

        This is necessary in order to enable the LayerTreeHost instance to take
        into account additional WebPage-creation attributes like the correct
        device scale factor. Until now, when the LayerTreeHost was spawned in
        always-on AC mode, the device scale factor was not yet updated in the
        WebPage construction to the appropriate value, leaving the LayerTreeHost
        with the default 1.0 value instead of the intended one.

        DrawingArea::setPaintingEnabled() is repurposed into enablePainting()
        that is to be called once everything should be set for painting (i.e.
        when setPaintingEnabled(true) was being called until now). Inside the
        DrawingAreaProxyCoordinatedGraphics class (only one to provide an
        implementation for this method), the LayerTreeHost is now spawned if
        in always-on AC mode. At this point, all relevant state coming from
        the owning WebPage object should be readily available for the host
        to correctly set up initial graphics scene.

        * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
        (WebKit::DrawingAreaCoordinatedGraphics::updatePreferences):
        (WebKit::DrawingAreaCoordinatedGraphics::enablePainting):
        * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h:
        * WebProcess/WebPage/DrawingArea.h:
        (WebKit::DrawingArea::enablePainting):
        (WebKit::DrawingArea::setPaintingEnabled): Deleted.
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_textAutoSizingAdjustmentTimer):
        (WebKit::WebPage::reinitializeWebPage):

2019-08-26  Devin Rousso  <drousso@apple.com>

        Web Inspector: use more C++ keywords for defining agents
        https://bugs.webkit.org/show_bug.cgi?id=200959

        Reviewed by Joseph Pecoraro.

         - make constructors `protected` when the agent isn't meant to be constructed directly
         - add `virtual` destructors that are defined in the *.cpp so forward-declarations work
         - use `final` wherever possible
         - add comments to indicate where any virtual functions come from

        * UIProcess/WebPageInspectorTargetAgent.h:
        * UIProcess/WebPageInspectorTargetAgent.cpp:

2019-08-26  Chris Dumez  <cdumez@apple.com>

        Regression: ITP started doing a lot more IPC after its logic was moved to the network process
        https://bugs.webkit.org/show_bug.cgi?id=201155

        Reviewed by John Wilander.

        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::initializeWebProcess):

2019-08-26  Wenson Hsieh  <wenson_hsieh@apple.com>

        REGRESSION (iOS 13): Tests that simulate multiple back-to-back single taps fail or time out
        https://bugs.webkit.org/show_bug.cgi?id=201129
        <rdar://problem/51857277>

        Reviewed by Tim Horton.

        Adds a new SPI hook in WebKit to let clients know when a synthetic tap gesture that has ended has been reset.
        See Tools/ChangeLog and LayoutTests/ChangeLog for more details.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _doAfterResettingSingleTapGesture:]):
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _singleTapDidReset:]):
        (-[WKContentView _doAfterResettingSingleTapGesture:]):

2019-08-26  Brent Fulgham  <bfulgham@apple.com>

        [FTW] Go back to ID2D1Bitmap as our NativeImage type
        https://bugs.webkit.org/show_bug.cgi?id=201122

        Reviewed by Alex Christensen.

        In Bug 200093 I switched the OS type of NativeImagePtr from ID2D1Bitmap to IWICBitmap.
        However, this was an ill-advised approach, because it dramatically harmed performance due
        to the heavy use of software rendering.

        I originally made this change because I thought this was the only way to get to the backing
        bits of the bitmaps, but it turns out that a more recent Direct2D data type (ID2D1Bitmap1)
        has the ability to map its memory to CPU-accessible memory, allowing software filter effects.

        This patch switches back to the ID2D1Bitap data type, and hooks up the ID2D1Bitmap1 data type
        to access the underlying memory of the bitmaps when software filter effects are used.

        Reviewed by Alex Christensen.

        * Shared/ShareableBitmap.h:
        * Shared/win/ShareableBitmapDirect2D.cpp:
        * UIProcess/win/BackingStoreDirect2D.cpp:
        * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:

2019-08-26  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthn] Support HID authenticators on iOS
        https://bugs.webkit.org/show_bug.cgi?id=201084
        <rdar://problem/51908390>

        Reviewed by Youenn Fablet.

        This patch makes the macOS HID implementation available in iOS as well.
        Mostly, it removes the PLATFORM(MAC) compile time flag.

        * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
        (WebKit::AuthenticatorManagerInternal::collectTransports):
        * UIProcess/WebAuthentication/AuthenticatorTransportService.cpp:
        (WebKit::AuthenticatorTransportService::create):
        (WebKit::AuthenticatorTransportService::createMock):
        * UIProcess/WebAuthentication/Cocoa/HidConnection.h:
        * UIProcess/WebAuthentication/Cocoa/HidConnection.mm:
        * UIProcess/WebAuthentication/Cocoa/HidService.h:
        * UIProcess/WebAuthentication/Cocoa/HidService.mm:
        * UIProcess/WebAuthentication/Cocoa/NfcConnection.mm:
        (WebKit::NfcConnection::NfcConnection):
        A tentative solution before there is an official UI.
        * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
        * UIProcess/WebAuthentication/Mock/MockHidConnection.h:
        * UIProcess/WebAuthentication/Mock/MockHidService.cpp:
        * UIProcess/WebAuthentication/Mock/MockHidService.h:
        * UIProcess/WebAuthentication/fido/CtapHidDriver.cpp:
        * UIProcess/WebAuthentication/fido/CtapHidDriver.h:

2019-08-26  Russell Epstein  <repstein@apple.com>

        Unreviewed, rolling out r248961.

        Same patch was re-landed after being rolled out. Patch is
        causing Catalina/iOS 13 test failures. Rolling out.

        Reverted changeset:

        "Verify Prefetch and credential behavior"
        https://bugs.webkit.org/show_bug.cgi?id=200000
        https://trac.webkit.org/changeset/248961

2019-08-26  Youenn Fablet  <youenn@apple.com>

        Add a WebsiteDataStore delegate to handle AuthenticationChallenge that do not come from pages
        https://bugs.webkit.org/show_bug.cgi?id=196870

        Reviewed by Alex Christensen.

        Make NetworkProcess provide the session ID for any authentication challenge.
        In case there is no associated page for the authentication challenge or this is related to a service worker,
        ask the website data store to take a decision.
        Add website data store delegate to allow applications to make the decision.
        Restrict using the delegate to server trust evaluation only.

        Make ping loads reuse the same mechanism.

        Covered by service worker tests and updated beacon test.

        * NetworkProcess/NetworkCORSPreflightChecker.cpp:
        (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
        * NetworkProcess/NetworkDataTask.cpp:
        (WebKit::NetworkDataTask::sessionID const):
        * NetworkProcess/NetworkDataTask.h:
        * NetworkProcess/NetworkLoad.cpp:
        (WebKit::NetworkLoad::didReceiveChallenge):
        * NetworkProcess/NetworkLoadChecker.h:
        (WebKit::NetworkLoadChecker::networkProcess):
        * NetworkProcess/PingLoad.cpp:
        (WebKit::PingLoad::didReceiveChallenge):
        * Shared/Authentication/AuthenticationManager.cpp:
        (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
        * Shared/Authentication/AuthenticationManager.h:
        * Shared/Authentication/cocoa/AuthenticationChallengeDispositionCocoa.h: Copied from Tools/WebKitTestRunner/cocoa/TestWebsiteDataStoreDelegate.h.
        * Shared/Authentication/cocoa/AuthenticationChallengeDispositionCocoa.mm: Copied from Source/WebKit/Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.h.
        (WebKit::toAuthenticationChallengeDisposition):
        * SourcesCocoa.txt:
        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (WebsiteDataStoreClient::WebsiteDataStoreClient):
        * UIProcess/API/Cocoa/_WKWebsiteDataStoreDelegate.h:
        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::NavigationClient::didReceiveAuthenticationChallenge):
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/Network/NetworkProcessProxy.messages.in:
        * UIProcess/ServiceWorkerProcessProxy.cpp:
        * UIProcess/ServiceWorkerProcessProxy.h:
        * UIProcess/WebPageProxy.cpp:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::isServiceWorkerPageID const):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebsiteData/WebsiteDataStoreClient.h:
        (WebKit::WebsiteDataStoreClient::didReceiveAuthenticationChallenge):
        * WebKit.xcodeproj/project.pbxproj:

2019-08-25  Simon Fraser  <simon.fraser@apple.com>

        [iOS WK2] Make a strongly-typed TransactionID to replace uint64_t transactionIDs
        https://bugs.webkit.org/show_bug.cgi?id=199983

        Reviewed by Dean Jackson.
        
        Add TransactionID which is a MonotonicObjectIdentifier<TransactionIDType>. This is modeled
        after ObjectIdentifier<>, but we can't use that because it doesn't have a guarantee of
        values always increasing by 1 (all derived classes share the same value source). Also, we
        need a per-RemoteLayerTreeDrawingArea set of values, but a static seed would cause values to
        be incremented by all RemoteLayerTreeDrawingAreas in a WebProcess.

        Replace all the bare uint64_t with TransactionID, fixing message generation codegen.

        * Scripts/webkit/messages.py:
        * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
        (WebKit::RemoteLayerTreeTransaction::transactionID const):
        (WebKit::RemoteLayerTreeTransaction::setTransactionID):
        * Shared/TransactionID.h: Added.
        (WebKit::MonotonicObjectIdentifier::MonotonicObjectIdentifier):
        (WebKit::MonotonicObjectIdentifier::isHashTableDeletedValue const):
        (WebKit::MonotonicObjectIdentifier::encode const):
        (WebKit::MonotonicObjectIdentifier::decode):
        (WebKit::MonotonicObjectIdentifier::operator== const):
        (WebKit::MonotonicObjectIdentifier::operator> const):
        (WebKit::MonotonicObjectIdentifier::operator>= const):
        (WebKit::MonotonicObjectIdentifier::operator< const):
        (WebKit::MonotonicObjectIdentifier::operator<= const):
        (WebKit::MonotonicObjectIdentifier::operator!= const):
        (WebKit::MonotonicObjectIdentifier::increment):
        (WebKit::MonotonicObjectIdentifier::next const):
        (WebKit::MonotonicObjectIdentifier::toUInt64 const):
        (WebKit::MonotonicObjectIdentifier::operator bool const):
        (WebKit::MonotonicObjectIdentifier::loggingString const):
        (WebKit::MonotonicObjectIdentifier::hashTableDeletedValue):
        (WebKit::MonotonicObjectIdentifier::isValidIdentifier):
        (WebKit::operator<<):
        * Shared/VisibleContentRectUpdateInfo.h:
        (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
        (WebKit::VisibleContentRectUpdateInfo::lastLayerTreeTransactionID const):
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _processWillSwapOrDidExit]):
        * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h:
        * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.messages.in:
        * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
        (WebKit::RemoteLayerTreeDrawingAreaProxy::willCommitLayerTree):
        (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::resetState):
        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView cleanupInteraction]):
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::commitPotentialTap):
        (WebKit::WebPageProxy::handleTap):
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
        (WebKit::RemoteLayerTreeDrawingArea::nextTransactionID const):
        (WebKit::RemoteLayerTreeDrawingArea::lastCommittedTransactionID const):
        (WebKit::RemoteLayerTreeDrawingArea::takeNextTransactionID):
        * WebProcess/WebPage/WebFrame.h:
        (WebKit::WebFrame::firstLayerTreeTransactionIDAfterDidCommitLoad const):
        (WebKit::WebFrame::setFirstLayerTreeTransactionIDAfterDidCommitLoad):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::handleTap):
        (WebKit::WebPage::handlePotentialDoubleTapForDoubleClickAtPoint):
        (WebKit::WebPage::commitPotentialTap):

2019-08-24  Chris Dumez  <cdumez@apple.com>

        Make CacheStorageEngineCaches's decodeCachesNames() more robust against bad input data
        https://bugs.webkit.org/show_bug.cgi?id=201102

        Reviewed by Antti Koivisto.

        Use Vector::tryReserveCapacity() instead of Vector::reserveInitialCapacity() in CacheStorage::decodeCachesNames()
        since the size is read from disk and thus cannot be trusted. If the size is too large, reserveInitialCapacity()
        would end up crashing the network process. Now, we merely discard the data if tryReserveCapacity() fails because
        the size is too large.

        * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
        (WebKit::CacheStorage::decodeCachesNames):

2019-08-23  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] [WebKit2] Tapping on the “I’m” text suggestion after typing “i’” does nothing
        https://bugs.webkit.org/show_bug.cgi?id=201085
        <rdar://problem/53056118>

        Reviewed by Tim Horton.

        Currently, logic in applyAutocorrectionInternal only selects the range to autocorrect if the text of the range
        matches the string to replace (delivered to us from UIKit). In the case of changing "I’" to "I’m", the string to
        replace is "I'" (with a straight quote rather than an apostrophe), even though the DOM contains an apostrophe.

        This is because kbd believes that the document context contains straight quotes (rather than apostrophes). For
        native text views, this works out because UIKit uses relative UITextPositions to determine the replacement
        range rather than by checking against the contents of the document. However, WKWebView does not have the ability
        to synchronously compute and reason about arbitrary UITextPositions relative to the selection, so we instead
        search for the string near the current selection when applying autocorrections.

        Of course, this doesn't work in this scenario because the replacement string contains a straight quote, yet the
        text node contains an apostrophe, so we bail and don't end up replacing any text. To address this, we repurpose
        TextIterator helpers currently used to allow find-in-page to match straight quotes against apostrophes; instead
        of matching the replacement string exactly, we instead match the quote-folded versions of these strings when
        finding the range to replace.

        Test: fast/events/ios/autocorrect-with-apostrophe.html

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

2019-08-23  Jiewen Tan  <jiewen_tan@apple.com>

        Unreviewed, build fix after r249059

        * UIProcess/WebAuthentication/Cocoa/NfcConnection.mm:
        (WebKit::NfcConnection::NfcConnection):
        Remove the HAVE() macro.

2019-08-23  Chris Dumez  <cdumez@apple.com>

        [geolocation] Rename interfaces and remove [NoInterfaceObject]
        https://bugs.webkit.org/show_bug.cgi?id=200885

        Reviewed by Alex Christensen.

        * Shared/WebGeolocationPosition.cpp:
        (WebKit::WebGeolocationPosition::create):
        * Shared/WebGeolocationPosition.h:
        (WebKit::WebGeolocationPosition::corePosition const):
        (WebKit::WebGeolocationPosition::WebGeolocationPosition):
        * UIProcess/API/C/WKGeolocationPosition.cpp:
        (WKGeolocationPositionCreate_c):
        * UIProcess/WebGeolocationManagerProxy.h:
        (WebKit::WebGeolocationManagerProxy::lastPosition const):
        * UIProcess/ios/WKGeolocationProviderIOS.mm:
        (-[WKLegacyCoreLocationProvider positionChanged:]):
        * WebProcess/Geolocation/WebGeolocationManager.cpp:
        (WebKit::WebGeolocationManager::didChangePosition):
        * WebProcess/Geolocation/WebGeolocationManager.h:
        * WebProcess/Geolocation/WebGeolocationManager.messages.in:
        * WebProcess/WebCoreSupport/WebGeolocationClient.cpp:
        (WebKit::WebGeolocationClient::lastPosition):
        * WebProcess/WebCoreSupport/WebGeolocationClient.h:

2019-08-23  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r249001.

        Caused one layout test to fail on all configurations and
        another to time out on Catalina / iOS 13.

        Reverted changeset:

        "Add a WebsiteDataStore delegate to handle
        AuthenticationChallenge that do not come from pages"
        https://bugs.webkit.org/show_bug.cgi?id=196870
        https://trac.webkit.org/changeset/249001

2019-08-23  Brian Burg  <bburg@apple.com>

        REGRESSION(r248713): WebDriver commands which target the implicit main frame now hit an ASSERT
        https://bugs.webkit.org/show_bug.cgi?id=200793
        <rdar://problem/54516988>

        Reviewed by Chris Dumez.

        SimulatedInputDispatcher and its callers need to support Optional<FrameIdentifier>
        and WTF::nullopt as an encoding for the implicit main frame.

        * UIProcess/Automation/SimulatedInputDispatcher.h:
        * UIProcess/Automation/SimulatedInputDispatcher.cpp:
        (WebKit::SimulatedInputDispatcher::resolveLocation):
        (WebKit::SimulatedInputDispatcher::run):

        * UIProcess/Automation/WebAutomationSession.h:
        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::viewportInViewCenterPointOfElement):
        (WebKit::WebAutomationSession::performInteractionSequence):
        (WebKit::WebAutomationSession::cancelInteractionSequence):

2019-08-20  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthn] Support NFC authenticators for iOS
        https://bugs.webkit.org/show_bug.cgi?id=188624
        <rdar://problem/43354214>

        Reviewed by Chris Dumez.

        This patch implements support for NFC authenticators including both FIDO2 and U2F ones. It utilizes a private
        framework called NearField instead of CoreNFC to be able to supply a custom UI later if necessary.

        The patch follows almost the same flow as previous HID and Local authenticator support.
        1) Discovery is via NfcService which will invoke NFHardwareManager to start a generic NFC reader session.
        2) Once a reader session is established, a NfcConnection is created to start the polling and register the WKNFReaderSessionDelegate
        to wait for 'didDetectTags'.
        3) When tags are detected, NfcConnection will determine if it meets our requriements: { type, connectability, fido applet availability }.
        The first tag that meets all requirement will then be returned for WebAuthn operations.
        4) The first WebAuthn operation is to send authenticatorGetInfo command to determine the supported protocol, and then initialize corresponding
        authenticators. Noted, the sending/receiving of this command is now abstracted into FidoService which will be shared across HidService and NfcService.
        5) From then, the actual WebAuthn request, either makeCredential or getAssertion will be sent.

        For testing, this patch follows the same flow as well.
        1) MockNfcService overrides NfcService to mock the behavior of NFC Tags discovery.
        2) The same class also swizzles methods from NFReaderSession to mock tag connection and communication.

        * Platform/spi/Cocoa/NearFieldSPI.h: Added.
        * Sources.txt:
        * SourcesCocoa.txt:
        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreSetWebAuthenticationMockConfiguration):
        * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
        (WebKit::AuthenticatorManagerInternal::collectTransports):
        * UIProcess/WebAuthentication/AuthenticatorTransportService.cpp:
        (WebKit::AuthenticatorTransportService::create):
        (WebKit::AuthenticatorTransportService::createMock):
        * UIProcess/WebAuthentication/Cocoa/HidService.h:
        * UIProcess/WebAuthentication/Cocoa/HidService.mm:
        (WebKit::HidService::HidService):
        (WebKit::HidService::deviceAdded):
        (WebKit::HidService::continueAddDeviceAfterGetInfo): Deleted.
        * UIProcess/WebAuthentication/Cocoa/NearFieldSoftLink.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
        * UIProcess/WebAuthentication/Cocoa/NearFieldSoftLink.mm: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
        * UIProcess/WebAuthentication/Cocoa/NfcConnection.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
        * UIProcess/WebAuthentication/Cocoa/NfcConnection.mm: Added.
        (WebKit::fido::compareVersion):
        (WebKit::NfcConnection::NfcConnection):
        (WebKit::NfcConnection::~NfcConnection):
        (WebKit::NfcConnection::transact const):
        (WebKit::NfcConnection::didDetectTags const):
        * UIProcess/WebAuthentication/Cocoa/NfcService.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
        * UIProcess/WebAuthentication/Cocoa/NfcService.mm: Added.
        (WebKit::NfcService::NfcService):
        (WebKit::NfcService::~NfcService):
        (WebKit::NfcService::didConnectTag):
        (WebKit::NfcService::startDiscoveryInternal):
        (WebKit::NfcService::platformStartDiscovery):
        * UIProcess/WebAuthentication/Cocoa/WKNFReaderSessionDelegate.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
        * UIProcess/WebAuthentication/Cocoa/WKNFReaderSessionDelegate.mm: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
        (-[WKNFReaderSessionDelegate initWithConnection:]):
        (-[WKNFReaderSessionDelegate readerSession:didDetectTags:]):
        * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
        (WebKit::MockHidConnection::send):
        (WebKit::MockHidConnection::registerDataReceivedCallbackInternal):
        (WebKit::MockHidConnection::parseRequest):
        (WebKit::MockHidConnection::feedReports):
        (WebKit::MockHidConnection::shouldContinueFeedReports):
        * UIProcess/WebAuthentication/Mock/MockNfcService.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
        * UIProcess/WebAuthentication/Mock/MockNfcService.mm: Added.
        (-[WKMockNFTag type]):
        (-[WKMockNFTag initWithNFTag:]):
        (-[WKMockNFTag description]):
        (-[WKMockNFTag isEqualToNFTag:]):
        (-[WKMockNFTag initWithType:]):
        (WebKit::MockNfcService::MockNfcService):
        (WebKit::MockNfcService::transceive):
        (WebKit::MockNfcService::platformStartDiscovery):
        (WebKit::MockNfcService::detectTags const):
        * UIProcess/WebAuthentication/Mock/MockWebAuthenticationConfiguration.h:
        * UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp:
        * UIProcess/WebAuthentication/fido/CtapAuthenticator.h:
        * UIProcess/WebAuthentication/fido/CtapNfcDriver.cpp: Added.
        (WebKit::CtapNfcDriver::CtapNfcDriver):
        (WebKit::CtapNfcDriver::transact):
        (WebKit::CtapNfcDriver::respondAsync const):
        * UIProcess/WebAuthentication/fido/CtapNfcDriver.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
        * UIProcess/WebAuthentication/fido/FidoService.cpp: Added.
        (WebKit::FidoService::FidoService):
        (WebKit::FidoService::getInfo):
        (WebKit::FidoService::continueAfterGetInfo):
        * UIProcess/WebAuthentication/fido/FidoService.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
        * UIProcess/WebAuthentication/fido/U2fAuthenticator.cpp:
        * UIProcess/WebAuthentication/fido/U2fAuthenticator.h:
        * UIProcess/ios/WebPageProxyIOS.mm:
        * WebKit.xcodeproj/project.pbxproj:

2019-08-23  Kate Cheney  <katherine_cheney@apple.com>

        Support ITP on a per-session basis (198923)
        https://bugs.webkit.org/show_bug.cgi?id=198923

        Reviewed by Chris Dumez.

        The original implementation of resourceLoadStatisticsUpdated
        did not allow for ITP on a per session basis due to the sessionID
        not being passed to the resourceLoadStatisticsUpdated function.
        This patch allows access of the correct networkSession by passing
        all resourceLoadStatistics in a new data structure of key-value
        pairs, where the sessionID is the key.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::resourceLoadStatisticsUpdated):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * WebProcess/WebProcess.cpp:

2019-08-23  Russell Epstein  <repstein@apple.com>

        Unreviewed, rolling out r249031.

        Causes multiple test failures on iOS simulator

        Reverted changeset:

        "[iOS] Should show input view when became first responder if
        keyboard was showing when the view was resigned"
        https://bugs.webkit.org/show_bug.cgi?id=200902
        https://trac.webkit.org/changeset/249031

2019-08-22  Andy Estes  <aestes@apple.com>

        [watchOS] Disable Content Filtering in the simulator build
        https://bugs.webkit.org/show_bug.cgi?id=201047

        Reviewed by Tim Horton.

        * Configurations/FeatureDefines.xcconfig:

2019-08-22  Daniel Bates  <dabates@apple.com>

        [iOS] Should show input view when became first responder if keyboard was showing when the view was resigned
        https://bugs.webkit.org/show_bug.cgi?id=200902
        <rdar://problem/54231756>

        Reviewed by Wenson Hsieh.

        When resigning first responder save whether the peripheral host has an input view on screen,
        including the software keyboard, so that we show the input view(s) again when the WKWebView
        is made first responder. In Safari, this avoids the need for a person to explicitly focus an
        editable element again to bring up the keyboard when returning to a tab they were previously
        typing in. It also makes the behavior of switching tabs in Safari with a software keyboard
        match the behavior of doing the same thing when a hardware keyboard attached.

        * UIProcess/PageClient.h:
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/ios/PageClientImplIOS.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::focusedElementDidChangeInputMode):
        Pass a diff of the activity state from the web process to the UI process so that we can
        differentiate between an inputmode change as a result of page deactivation vs a change
        caused by some other means. We need to differentiate these cases because we want to
        ignore a page that sets inputmode "none" (i.e. a request to hide the keyboard) from inside
        a focus event handler if the handler was called as part of the process of page activation
        (i.e. switching to the tab). Google Docs is one example of a web site that sets inputmode
        to "none" as a result of the page activation process.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView cleanupInteraction]): Clear out state.
        (-[WKContentView resignFirstResponderForWebView]): Save whether the peripheral host is on screen
        into a local before ending the editing session. We then copy the local into the ivar if we
        actually will resign. This ordering is explicitly done because:
                1. Ending the editing session may dismiss the keyboard => we need to query the peripheral
                   host first.
                2. If the view is being resigned as a result of a keyboard dismissal (i.e. a person pressed
                   the hide keyboard button on iPad) then the user has indicated that they are finished
                   with the keyboard and we do not want to show the keyboard on page re-activation => we
                   do not want to copy the local to the ivar.
                3. If the view refuses to resign itself then it does not make sense to save the keyboard
                   state as responder status hasn't changed.
        (-[WKContentView shouldShowAutomaticKeyboardUI]): Ignore inputmode="none", if needed.
        (-[WKContentView _didCommitLoadForMainFrame]): Clear out state.
        (-[WKContentView isFirstResponderOrBecomingFirstResponder]): Added.
        (-[WKContentView shouldShowInputViewOnPageActivation:]): Added.
        (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:activityStateChanges:userObject:]):
        Update ivar if this element is being focused as a result of page activation.
        (-[WKContentView _didUpdateInputMode:activityStateChanges:]): Modified to take the activity state
        diff. If the input mode was changed as a result of page activation then we want to update our ivar
        so that when we call -reloadInputViews and UIKit calls us back in -shouldShowAutomaticKeyboardUI we
        will know to ignore inputmode set to "none" when determining whether to show the automatic keyboard UI.
        Note that we do not need to check/track whether an earlier -_elementDidFocus actually started an
        input session as part of updating the value of our ivar because if an input session was not started,
        say the embedding client disallowed it, then we would not have a focused element => we early return from
        this function. Also remove duplication and improve code readbility by making use of the convenience function
        hasFocusedElement() instead of duplicating what it does.
        (-[WKContentView _didUpdateInputMode:]): Deleted.
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::focusedElementDidChangeInputMode): Modified to take the activity state diff
        and pass it through.
        (WebKit::WebPageProxy::didReleaseAllTouchPoints): Pass the empty set for the activity state diff to
        keep our current behavior.
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::focusedElementDidChangeInputMode): Send the activity state diff to the UI process.
2019-08-22  Keith Rollin  <krollin@apple.com>

        Remove logging that contains a URL
        https://bugs.webkit.org/show_bug.cgi?id=201052
        <rdar://problem/54613204>

        Reviewed by Chris Dumez.

        checkURLReceivedFromWebProcess in WebProcessProxy.cpp contains an old
        logging line that logs a URL. We don't log URLs any more for privacy
        reasons, so remove this.

        A search for WTFLogAlways.*url turns up other matches, but those are
        either false positives or cases where the URLs are logged only on
        demand by the developer as part of debugging.
        checkURLReceivedFromWebProcess is the only place where a URL is logged
        as a matter of course.

        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::checkURLReceivedFromWebProcess):

2019-08-22  Adrian Perez de Castro  <aperez@igalia.com>

        [GTK][WPE] Fixes for non-unified builds after r248547
        https://bugs.webkit.org/show_bug.cgi?id=201044

        Reviewed by Philippe Normand.

        * NetworkProcess/WebStorage/LocalStorageDatabaseTracker.cpp: Add missing inclusion of
        the wtf/CrossThreadCopier.h header.
        * WebProcess/WebStorage/StorageNamespaceImpl.h: Add missing inclusion of the
        WebCore/PageIdentifier.h header.

2019-08-22  Alex Christensen  <achristensen@webkit.org>

        Disable legacy TLS versions and add a temporary default to re-enable it
        https://bugs.webkit.org/show_bug.cgi?id=200945

        Reviewed by Brady Eidson.

        * NetworkProcess/NetworkSessionCreationParameters.cpp:
        (WebKit::NetworkSessionCreationParameters::privateSessionParameters):
        (WebKit::NetworkSessionCreationParameters::encode const):
        (WebKit::NetworkSessionCreationParameters::decode):
        * NetworkProcess/NetworkSessionCreationParameters.h:
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeNetworkProcess):
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::parameters):

2019-08-17  Darin Adler  <darin@apple.com>

        Use makeString and multi-argument StringBuilder::append instead of less efficient multiple appends
        https://bugs.webkit.org/show_bug.cgi?id=200862

        Reviewed by Ryosuke Niwa.

        * Shared/mac/AuxiliaryProcessMac.mm:
        (WebKit::setAndSerializeSandboxParameters): Use one append instead of multiple.

2019-08-22  Wenson Hsieh  <wenson_hsieh@apple.com>

        Typing Korean in title field after typing in the body inserts extraneous characters on blog.naver.com
        https://bugs.webkit.org/show_bug.cgi?id=201023
        <rdar://problem/54294794>

        Reviewed by Ryosuke Niwa.

        After r242833, we began to avoid sending redundant ElementDidFocus updates in the case where a focused element
        was blurred and refocused within the same runloop. This was done to prevent the input view from flickering due
        to input view reloading, as well as scrolling to reveal the focused element, when tapping to change selection on
        Microsoft Word online.

        However, on blog.naver.com, these ElementDidFocus messages were necessary in order to ensure that the platform
        input context changes when moving between the title and body fields, or when tapping to change selection. This
        is because blog.naver.com uses a hidden contenteditable area under a subframe (see WebCore ChangeLog for more
        detail here). While text is never directly inserted into this hidden contenteditable, the events are observed
        and used to "play back" editing in the main visible content area.

        Thus, when moving between the title and body fields (or when changing selection within either), the only hint we
        get is that the hidden editable element is blurred and immediately refocused. Since we no longer send
        ElementDidFocus updates in this scenario, UIKeyboardImpl and kbd are not aware that the page has effectively
        changed input contexts.

        Combined with the fact that Korean IME on iOS may insert additional text given the document context (i.e. text
        that the input manager, kbd, thinks we've previously inserted), this means that when typing several characters
        into the body field on naver and then switching to edit the title, initial keystrokes may insert unexpected
        text in the title field.

        To fix this, we add some hooks to notify the UI process when an element that was blurred has been immediately
        refocused. Upon receiving this message, the UI process then tells UIKeyboardImpl to re-retrieve its input
        context, which calls into -requestAutocorrectionContextWithCompletionHandler: in WKContentView. While notorious
        for being synchronous IPC, this is mitigated by (1) being limiting to only instances where we have a hidden
        editable area, and (2) being limited by a batching mechanism in the web process, such that if the focused
        element is blurred, refocused, re-blurred, and refocused many times in the same runloop, we'll only send a
        single UpdateInputContextAfterBlurringAndRefocusingElement message (as opposed to the many ElementDidFocus
        messages we would've sent in previous releases).

        * Platform/spi/ios/UIKitSPI.h:
        * UIProcess/PageClient.h:
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:

        Add a new mechanism to update the platform input context (on iOS, UIKeyboardImpl's document state) when focus
        moves away from and immediately returns to a hidden editable element.

        * UIProcess/ios/PageClientImplIOS.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::updateInputContextAfterBlurringAndRefocusingElement):
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _updateInputContextAfterBlurringAndRefocusingElement]):

        Tell the active UIKeyboardImpl to refetch document state from the WKContentView. While this does result in a new
        autocorrection context request (which, unfortunately, triggers synchronous IPC to the web process), this request
        would've still happened anyways in the case where we would previously have sent an ElementDidFocus message.

        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::updateInputContextAfterBlurringAndRefocusingElement):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::elementDidFocus):

        In the case where we avoid sending a full ElementDidFocus message to the UI process due to refocusing the same
        element, we should still notify the UI process so that it can synchronize state between the application process
        and kbd. See above for more details.

        (WebKit::WebPage::elementDidBlur):
        (WebKit::WebPage::updateInputContextAfterBlurringAndRefocusingElementIfNeeded):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::updateInputContextAfterBlurringAndRefocusingElementIfNeeded):

2019-08-22  Youenn Fablet  <youenn@apple.com>

        Add a WebsiteDataStore delegate to handle AuthenticationChallenge that do not come from pages
        https://bugs.webkit.org/show_bug.cgi?id=196870

        Reviewed by Alex Christensen.

        Make NetworkProcess provide the session ID for any authentication challenge.
        In case there is no associated page for the authentication challenge or this is related to a service worker,
        ask the website data store to take a decision.
        Add website data store delegate to allow applications to make the decision.
        Restrict using the delegate to server trust evaluation only.

        Make ping loads reuse the same mechanism.

        Covered by service worker tests and updated beacon test.

        * NetworkProcess/NetworkCORSPreflightChecker.cpp:
        (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
        * NetworkProcess/NetworkDataTask.cpp:
        (WebKit::NetworkDataTask::sessionID const):
        * NetworkProcess/NetworkDataTask.h:
        * NetworkProcess/NetworkLoad.cpp:
        (WebKit::NetworkLoad::didReceiveChallenge):
        * NetworkProcess/NetworkLoadChecker.h:
        (WebKit::NetworkLoadChecker::networkProcess):
        * NetworkProcess/PingLoad.cpp:
        (WebKit::PingLoad::didReceiveChallenge):
        * Shared/Authentication/AuthenticationManager.cpp:
        (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
        * Shared/Authentication/AuthenticationManager.h:
        * Shared/Authentication/cocoa/AuthenticationChallengeDispositionCocoa.h: Copied from Tools/WebKitTestRunner/cocoa/TestWebsiteDataStoreDelegate.h.
        * Shared/Authentication/cocoa/AuthenticationChallengeDispositionCocoa.mm: Copied from Source/WebKit/Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.h.
        (WebKit::toAuthenticationChallengeDisposition):
        * SourcesCocoa.txt:
        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (WebsiteDataStoreClient::WebsiteDataStoreClient):
        * UIProcess/API/Cocoa/_WKWebsiteDataStoreDelegate.h:
        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::NavigationClient::didReceiveAuthenticationChallenge):
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/Network/NetworkProcessProxy.messages.in:
        * UIProcess/ServiceWorkerProcessProxy.cpp:
        * UIProcess/ServiceWorkerProcessProxy.h:
        * UIProcess/WebPageProxy.cpp:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::isServiceWorkerPageID const):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebsiteData/WebsiteDataStoreClient.h:
        (WebKit::WebsiteDataStoreClient::didReceiveAuthenticationChallenge):
        * WebKit.xcodeproj/project.pbxproj:

2019-08-22  Claudio Saavedra  <csaavedra@igalia.com>

        [SOUP] NetworkProcessSoup does not initialize CacheOptions correctly
        https://bugs.webkit.org/show_bug.cgi?id=200886

        Reviewed by Philippe Normand.

        r247567 wrongly initializes CacheOptions in a local variable that is never used
        instead of using NetworkProcess's member variable, that is later used by the
        NetworkSession to initialize the cache.

        * NetworkProcess/soup/NetworkProcessSoup.cpp:
        (WebKit::NetworkProcess::platformInitializeNetworkProcess):

2019-08-21  Tim Horton  <timothy_horton@apple.com>

        [Mail] Tapping top of message scrolls back to copied text instead of top of the message
        https://bugs.webkit.org/show_bug.cgi?id=200999
        <rdar://problem/54564878>

        Reviewed by Wenson Hsieh.

        In the case where you have a WebCore selection but are not first responder,
        when you tap the WKWebView to become first responder, EventHandler would
        bail from setting the selection, assuming UIKit was going to do it. This
        behavior was introduced in r233311.

        However, since we are not first responder, UIKit does not change the
        selection, since it considers the view to not be editable.

        Fix this by letting WebCore set the selection in this case, as it used to.

        * WebProcess/WebCoreSupport/WebEditorClient.h:
        * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
        (WebKit::WebEditorClient::shouldAllowSingleClickToChangeSelection const):
        * WebProcess/WebPage/WebPage.h:
        (WebKit::WebPage::isShowingInputViewForFocusedElement const):
        Copy the logic from EventHandler, with the added caveat (which fixes the
        aforementioned behavior) that we will allow EventHandler to change the
        selection if we don't have a focused node in the UIKit sense, because
        we know that the platform text interaction code will *not* change the
        selection if that is the case, so it's up to us.

2019-08-21  Chris Dumez  <cdumez@apple.com>

        Crash under NetworkCache::Data::mapToFile()
        https://bugs.webkit.org/show_bug.cgi?id=200996
        <rdar://problem/54570421>

        Reviewed by Geoffrey Garen.

        Make sure NetworkCache::Data::mapToFile() calls makeSafeToUseMemoryMapForPath() between
        creating the file and calling mmap().

        * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
        (WebKit::NetworkCache::BlobStorage::add):
        * NetworkProcess/cache/NetworkCacheData.cpp:
        (WebKit::NetworkCache::Data::mapToFile const):

2019-08-21  Chris Dumez  <cdumez@apple.com>

        Have NetworkCache::store() null check its completion handler before calling it
        https://bugs.webkit.org/show_bug.cgi?id=200994

        Reviewed by Geoffrey Garen.

        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::retrieveCacheEntry):
        Stop passing nullptr for the completion handler now that the parameter has a default value.
        Note that passing nullptr here was likely wrong since the NetworkCache::store() implementation
        did not null-check the completion handler before calling it.

        * NetworkProcess/cache/NetworkCache.cpp:
        (WebKit::NetworkCache::Cache::store):
        Have NetworkCache::store() null check its completion handler before calling it as calling
        a null WTF::Function crashes.

        * NetworkProcess/cache/NetworkCache.h:
        Use nullptr as default parameter value for the completion handler.

2019-08-21  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):

2019-08-21  Ryosuke Niwa  <rniwa@webkit.org>

        Put keygen element behind a runtime flag and disable it by default
        https://bugs.webkit.org/show_bug.cgi?id=200850

        Reviewed by Antti Koivisto.

        * Shared/WebPreferences.yaml:
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetKeygenElementEnabled):
        (WKPreferencesGetKeygenElementEnabled):
        * UIProcess/API/C/WKPreferencesRefPrivate.h:

2019-08-21  Chris Dumez  <cdumez@apple.com>

        Crash under StringImpl::~StringImpl() in NetworkProcess::deleteWebsiteDataForRegistrableDomains()
        https://bugs.webkit.org/show_bug.cgi?id=200986
        <rdar://problem/32850192>

        Reviewed by Brent Fulgham.

        Code was calling postStorageTask() with a lambda that captures Strings that are not isolated copied.
        The lambda would get executed on another thread so this is not safe. The CrossThreadTask constructor
        does not take care of this for you, despite its name (the createCrossThreadTask() function does though).

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::fetchWebsiteData):
        (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
        (WebKit::NetworkProcess::registrableDomainsWithWebsiteData):

2019-08-21  Chris Dumez  <cdumez@apple.com>

        Add internal setting to disable SecureContext checks
        https://bugs.webkit.org/show_bug.cgi?id=200980
        <rdar://problem/54438512>

        Reviewed by Alex Christensen.

        Add internal setting to disable SecureContext checks, in order to facilitate development
        for features like Service workers or device orientation / motion.

        * Shared/WebPreferences.yaml:
        * UIProcess/API/Cocoa/WKPreferences.mm:
        (-[WKPreferences _secureContextChecksEnabled]):
        (-[WKPreferences _setSecureContextChecksEnabled:]):
        * UIProcess/API/Cocoa/WKPreferencesPrivate.h:

2019-08-21  Chris Dumez  <cdumez@apple.com>

        registrableDomainsToRemoveWebsiteDataFor() does not need to return a HashMap
        https://bugs.webkit.org/show_bug.cgi?id=200985

        Reviewed by John Wilander.

        registrableDomainsToRemoveWebsiteDataFor() does not need to return a HashMap. It is more
        efficient to simply return a Vector since we never need to look up keys.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        (WebKit::ResourceLoadStatisticsDatabaseStore::registrableDomainsToRemoveWebsiteDataFor):
        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
        (WebKit::ResourceLoadStatisticsMemoryStore::registrableDomainsToRemoveWebsiteDataFor):
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
        (WebKit::domainsToString):
        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForRegistrableDomains):
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
        (WebKit::NetworkProcess::deleteCookiesForTesting):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::deleteWebsiteDataForRegistrableDomains):
        * NetworkProcess/NetworkSession.h:

2019-08-21  Russell Epstein  <repstein@apple.com>

        Unreviewed, rolling out r248942.

        Causes multiple layout test crashes on MacOS Bots

        Reverted changeset:

        "Verify Prefetch and credential behavior"
        https://bugs.webkit.org/show_bug.cgi?id=200000
        https://trac.webkit.org/changeset/248942

2019-08-21  Keith Rollin  <krollin@apple.com>

        Remove support for watchOS < 6.0
        https://bugs.webkit.org/show_bug.cgi?id=200937
        <rdar://problem/54524009>

        Reviewed by Darin Adler.

        Update conditionals that reference __WATCH_OS_VERSION_MIN_REQUIRED and
        __WATCH_OS_VERSION_MAX_ALLOWED, assuming that they both have values >=
        60000. This means that expressions like
        "__WATCH_OS_VERSION_MIN_REQUIRED < 60000" are always False and
        "__WATCH_OS_VERSION_MIN_REQUIRED >= 60000" are always True.

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):

2019-08-21  Adrian Perez de Castro  <aperez@igalia.com>

        [GTK] Build failure due to unwieldy definition of “None” from X11 headers
        https://bugs.webkit.org/show_bug.cgi?id=200984

        Reviewed by Carlos Alberto Lopez Perez.

        * SourcesGTK.txt: Mark AcceleratedBackingStore.cpp with @no-unify
        because it includes AcceleratedSurfaceX11.h when building with
        ENABLE_X11_TARGET=ON, which in turn will include the X11 headers.
        It is just lucky that most of the time the order of the generated
        #include statements in the unified sources has been masking this
        problem.

2019-08-21  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):

2019-08-21  Pablo Saavedra  <psaavedra@igalia.com>

        [WPE] Build failure after r248846 ([WTF] Add makeUnique<T>, which ensures T is fast-allocated, makeUnique / makeUniqueWithoutFastMallocCheck part)
        https://bugs.webkit.org/show_bug.cgi?id=200973

        WPE fails to build with `-DENABLE_WPE_QT_API=ON` after changes done by r248846 in:

          Source/WebKit/UIProcess/API/wpe/qt/WPEQtView.cpp
          Source/WebKit/UIProcess/API/wpe/qt/WPEQtViewBackend.cpp

        ; to forces FastMalloc use.

        Related to:

          https://bugs.webkit.org/show_bug.cgi?id=200611
          https://bugs.webkit.org/show_bug.cgi?id=200620

        This patch puts WPEQt... classes into FastMalloc in the same way it
        was done by many others in r248603.

        Reviewed by Philippe Normand.

        * UIProcess/API/wpe/qt/WPEQtView.cpp:
        (WPEQtView::runJavaScript):
        * UIProcess/API/wpe/qt/WPEQtViewBackend.h:
        * UIProcess/API/wpe/qt/WPEQtViewLoadRequest.h:

2019-08-20  Said Abou-Hallawa  <sabouhallawa@apple.com>

        [iOS] REGRESSION (248501): gmail.com images are still not shown on some versions of iPhone iOS13
        https://bugs.webkit.org/show_bug.cgi?id=200948

        Reviewed by Tim Horton.

        Apply the gmail.com quirk for all iPhone iOS versions till the gmail.com
        bug is fixed.

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

2019-08-20  Chris Dumez  <cdumez@apple.com>

        WebSQLiteDatabaseTracker does not ensure it is still alive after dispatching to the main thread
        https://bugs.webkit.org/show_bug.cgi?id=200925

        Reviewed by Geoffrey Garen.

        WebSQLiteDatabaseTracker does not ensure it is still alive after dispatching to the main thread,
        which is not safe. Use WeakPtr to address the issue.

        * Shared/WebSQLiteDatabaseTracker.cpp:
        (WebKit::WebSQLiteDatabaseTracker::WebSQLiteDatabaseTracker):
        (WebKit::WebSQLiteDatabaseTracker::willBeginFirstTransaction):
        (WebKit::WebSQLiteDatabaseTracker::didFinishLastTransaction):
        * Shared/WebSQLiteDatabaseTracker.h:

2019-08-20  Brent Fulgham  <bfulgham@apple.com>

        [FTW] Fix scrolling in modern WebKit views
        https://bugs.webkit.org/show_bug.cgi?id=200923

        Reviewed by Don Olmstead.

        The initial implementation of scrolling in Direct2D had errors that
        caused hilarious rendering glitches. This patch corrects the logic
        so that page scroll is correct.

        This patch also fixes a bug that would trigger when resizing windows.

        * Shared/win/ShareableBitmapDirect2D.cpp:
        (WebKit::ShareableBitmap::paint):
        * UIProcess/BackingStore.h:
        (WebKit::BackingStore::renderTarget): Deleted.
        * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp:
        (WebKit::DrawingAreaProxyCoordinatedGraphics::sizeDidChange):
        (WebKit::DrawingAreaProxyCoordinatedGraphics::deviceScaleFactorDidChange):
        * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h:
        * UIProcess/win/BackingStoreDirect2D.cpp:
        (WebKit::BackingStore::paint):
        (WebKit::BackingStore::incorporateUpdate):
        (WebKit::BackingStore::scroll):
        * UIProcess/win/WebView.cpp:
        (WebKit::WebView::paint):
        (WebKit::WebView::onSizeEvent):

2019-08-20  Chris Dumez  <cdumez@apple.com>

        Unsafe usage of CookieStorageObserver from a background thread
        https://bugs.webkit.org/show_bug.cgi?id=200920

        Reviewed by Alex Christensen.

        * UIProcess/API/APIHTTPCookieStore.h:
        * UIProcess/API/Cocoa/APIHTTPCookieStoreCocoa.mm:
        (API::HTTPCookieStore::startObservingChangesToDefaultUIProcessCookieStore):

2019-08-20  Chris Dumez  <cdumez@apple.com>

        Use a strongly typed identifier for StorageNamespace's identifier
        https://bugs.webkit.org/show_bug.cgi?id=200895

        Reviewed by Alex Christensen and Youenn Fablet.

        Use a strongly typed identifier for StorageNamespace's identifier instead of uint64_t, to
        avoid type confusion.

        * NetworkProcess/WebStorage/LocalStorageNamespace.cpp:
        (WebKit::LocalStorageNamespace::LocalStorageNamespace):
        * NetworkProcess/WebStorage/LocalStorageNamespace.h:
        * NetworkProcess/WebStorage/StorageManager.cpp:
        (WebKit::StorageManager::createSessionStorageNamespace):
        (WebKit::StorageManager::destroySessionStorageNamespace):
        (WebKit::StorageManager::cloneSessionStorageNamespace):
        (WebKit::StorageManager::createLocalStorageArea):
        (WebKit::StorageManager::createTransientLocalStorageArea):
        (WebKit::StorageManager::createSessionStorageArea):
        (WebKit::StorageManager::getOrCreateLocalStorageNamespace):
        (WebKit::StorageManager::getOrCreateTransientLocalStorageNamespace):
        (WebKit::StorageManager::getOrCreateSessionStorageNamespace):
        * NetworkProcess/WebStorage/StorageManager.h:
        * NetworkProcess/WebStorage/StorageManagerSet.cpp:
        (WebKit::StorageManagerSet::connectToLocalStorageArea):
        (WebKit::StorageManagerSet::connectToTransientLocalStorageArea):
        (WebKit::StorageManagerSet::connectToSessionStorageArea):
        (WebKit::StorageManagerSet::cloneSessionStorageNamespace):
        * NetworkProcess/WebStorage/StorageManagerSet.h:
        * NetworkProcess/WebStorage/StorageManagerSet.messages.in:
        * Scripts/webkit/messages.py:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/InjectedBundle/InjectedBundle.cpp:
        (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_textAutoSizingAdjustmentTimer):
        * WebProcess/WebPage/WebPage.h:
        (WebKit::WebPage::sessionStorageNamespaceIdentifier const):
        * WebProcess/WebPage/WebPageGroupProxy.h:
        (WebKit::WebPageGroupProxy::localStorageNamespaceIdentifier const):
        * WebProcess/WebStorage/StorageAreaMap.cpp:
        (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
        (WebKit::StorageAreaMap::dispatchLocalStorageEvent):
        * WebProcess/WebStorage/StorageNamespaceIdentifier.h: Copied from Source/WebKit/WebProcess/WebStorage/WebStorageNamespaceProvider.h.
        * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
        (WebKit::StorageNamespaceImpl::createSessionStorageNamespace):
        (WebKit::StorageNamespaceImpl::createLocalStorageNamespace):
        (WebKit::StorageNamespaceImpl::createTransientLocalStorageNamespace):
        (WebKit::StorageNamespaceImpl::StorageNamespaceImpl):
        (WebKit::StorageNamespaceImpl::copy):
        (WebKit::StorageNamespaceImpl::sessionStoragePageID const):
        (WebKit::StorageNamespaceImpl::pageGroupID const):
        * WebProcess/WebStorage/StorageNamespaceImpl.h:
        (WebKit::StorageNamespaceImpl::storageNamespaceID const):
        * WebProcess/WebStorage/WebStorageNamespaceProvider.cpp:
        (WebKit::WebStorageNamespaceProvider::getOrCreate):
        (WebKit::WebStorageNamespaceProvider::WebStorageNamespaceProvider):
        (WebKit::WebStorageNamespaceProvider::~WebStorageNamespaceProvider):
        (WebKit::WebStorageNamespaceProvider::createSessionStorageNamespace):
        (WebKit::WebStorageNamespaceProvider::createLocalStorageNamespace):
        (WebKit::WebStorageNamespaceProvider::createTransientLocalStorageNamespace):
        * WebProcess/WebStorage/WebStorageNamespaceProvider.h:

2019-08-20  Dean Jackson  <dino@apple.com>

        REGRESSION: Open in New Tab is missing from context menu
        https://bugs.webkit.org/show_bug.cgi?id=200909
        <rdar://problem/54476169>

        Reviewed by Simon Fraser.

        Don't assume the new API if webView:contextMenuWillPresentForElement:
        is implemented.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (needsDeprecatedPreviewAPI):

2019-08-20  Joseph Pecoraro  <pecoraro@apple.com>

        Web Inspector: Support for JavaScript BigInt
        https://bugs.webkit.org/show_bug.cgi?id=180731
        <rdar://problem/36298748>

        Reviewed by Devin Rousso.

        * WebProcess/WebPage/WebInspectorUI.cpp:
        (WebKit::WebInspectorUI::WebInspectorUI):
        Enable BigInt in the Web Inspector process. It only makes use of
        `globalThis.BigInt(...)` to hold the value.

2019-08-19  Fujii Hironori  <Hironori.Fujii@sony.com>

        [CMake] WebKit2.dll can't link because of missing PAL's import symbols for WinCairo port
        https://bugs.webkit.org/show_bug.cgi?id=200910

        Unreviewed build fix for Windows port.

        * CMakeLists.txt: Added -DSTATICALLY_LINKED_WITH_PAL=1 if PAL_LIBRARY_TYPE is STATIC.

2019-08-19  Fujii Hironori  <Hironori.Fujii@sony.com>

        Unreviewed build fix for WinCairo port.

        The base class of NetworkDataTask has been changed in r248874.

        * NetworkProcess/curl/NetworkDataTaskCurl.h:
        (ref):
        (deref):
        Call 'ref' and 'deref' of NetworkDataTask instead of RefCounted<NetworkDataTask>.

2019-08-19  Keith Rollin  <krollin@apple.com>

        Unreviewed build fix for security entitlements.

        Bug 200242 (r248164) changed the way that entitlements were generated
        and applied during the build. In that refactoring, the codesign
        parameter "-o library" was dropped. This change adds it back.

        * Configurations/BaseXPCService.xcconfig:

2019-08-19  Chris Dumez  <cdumez@apple.com>

        NetworkDataTask is being ref'd / deref'd from several threads and is not ThreadSafeRefCounted
        https://bugs.webkit.org/show_bug.cgi?id=200897

        Reviewed by Geoffrey Garen.

        NetworkDataTask subclasses RefCounted and is ref'd / deref'd on the main thread. However, there
        is code in NetworkDataTaskCocoa::resume() that was ref'ing / deref'ing it on a background thread,
        which is unsafe. To address the issue, Have NetworkDataTask subclass ThreadSafeRefCounted, and
        make sure it always gets destroyed on the main thread.

        * NetworkProcess/NetworkDataTask.h:

        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        (WebKit::NetworkDataTaskCocoa::resume):
        Avoid some unnecessary refcounting churn.

2019-08-19  Alex Christensen  <achristensen@webkit.org>

        Move call to initializeMainThread introduced in r248549 to after WebKit.framework has been loaded
        https://bugs.webkit.org/show_bug.cgi?id=200896
        <rdar://problem/54479065>

        Reviewed by Chris Dumez.

        In XPCServiceMain we haven't been told which WebKit.framework to load yet, so when using staged frameworks it
        causes problems if we call a function from a WebKit framework.  We need to wait until after initializerFunctionPtr is called.

        * NetworkProcess/EntryPoint/Cocoa/XPCService/NetworkServiceEntryPoint.mm:
        (NetworkServiceInitializer):
        * PluginProcess/EntryPoint/Cocoa/XPCService/PluginServiceEntryPoint.mm:
        (PluginServiceInitializer):
        * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
        (WebKit::XPCServiceMain):
        * WebProcess/EntryPoint/Cocoa/XPCService/WebContentServiceEntryPoint.mm:
        (WebContentServiceInitializer):

2019-08-19  Yusuke Suzuki  <ysuzuki@apple.com>

        Unreviewed, build fix for PLATFORM_DRIVEN_TEXT_CHECKING
        https://bugs.webkit.org/show_bug.cgi?id=200620

        It is enabled if PLATFORM(MACCATALYST) is true.

        * UIProcess/Cocoa/TextCheckingController.h:

2019-08-19  Sihui Liu  <sihui_liu@apple.com>

        Remove IDB-specific quota
        https://bugs.webkit.org/show_bug.cgi?id=196545
        <rdar://problem/54201783>

        Reviewed by Youenn Fablet.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::createIDBServer):
        (WebKit::NetworkProcess::addIndexedDatabaseSession):
        (WebKit::NetworkProcess::setIDBPerOriginQuota): Deleted.
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * UIProcess/API/C/WKContext.cpp:
        (WKContextSetIDBPerOriginQuota): Deleted.
        * UIProcess/API/C/WKContextPrivate.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::setIDBPerOriginQuota): Deleted.
        * UIProcess/WebProcessPool.h:

2019-08-19  Youenn Fablet  <youenn@apple.com>

        Remove SessionID::emptySessionID()
        https://bugs.webkit.org/show_bug.cgi?id=200811

        Reviewed by Alex Christensen.

        Update SessionID call sites to use toUInt64.
        Remove debug asserts to isValid since construction of invalid session IDs can only happen in very specific cases
        typically for HashMaps.

        * NetworkProcess/Downloads/DownloadManager.h:
        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::storageSession):
        (WebKit::NetworkConnectionToWebProcess::logUserInteraction):
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::networkSession const):
        (WebKit::NetworkProcess::networkSessionByConnection const):
        (WebKit::NetworkProcess::setSession):
        (WebKit::NetworkProcess::destroySession):
        (WebKit::NetworkProcess::fetchWebsiteData):
        (WebKit::NetworkProcess::deleteWebsiteData):
        (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
        (WebKit::NetworkProcess::registrableDomainsWithWebsiteData):
        (WebKit::NetworkProcess::existingSWOriginStoreForSession const):
        (WebKit::NetworkProcess::webProcessWasDisconnected):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::startNetworkLoad):
        * NetworkProcess/mac/RemoteNetworkingContext.mm:
        (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::retrieveCacheStorageParameters):
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::~WebsiteDataStore):
        (WebKit::WebsiteDataStore::maybeRegisterWithSessionIDMap):
        (WebKit::WebsiteDataStore::existingNonDefaultDataStoreForSessionID):
        * WebProcess/Cache/WebCacheStorageProvider.cpp:
        (WebKit::WebCacheStorageProvider::createCacheStorageConnection):
        * WebProcess/Cache/WebCacheStorageProvider.h:
        * WebProcess/Storage/WebSWClientConnection.cpp:
        (WebKit::WebSWClientConnection::WebSWClientConnection):
        (WebKit::WebSWClientConnection::initializeConnectionIfNeeded):
        * WebProcess/Storage/WebServiceWorkerProvider.cpp:
        (WebKit::WebServiceWorkerProvider::existingServiceWorkerConnectionForSession):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_textAutoSizingAdjustmentTimer):

2019-08-19  Yusuke Suzuki  <ysuzuki@apple.com>

        Unreviewed, speculative build fix for GTK and WinCairo
        https://bugs.webkit.org/show_bug.cgi?id=200620

        * UIProcess/socket/RemoteInspectorProtocolHandler.cpp:

2019-08-19  Yusuke Suzuki  <ysuzuki@apple.com>

        Unreviewed, build fix in WinCairo and GTK ports
        https://bugs.webkit.org/show_bug.cgi?id=200767

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

2019-08-19  Youenn Fablet  <youenn@apple.com>

        enumerateDevices should return the same JS objects if called twice
        https://bugs.webkit.org/show_bug.cgi?id=200767

        Reviewed by Eric Carlson.

        Update code as enumerate device request is now gone.
        Make use of async IPC to simplify code since we are now passing a completion handler directly.

        * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
        (WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged):
        (WebKit::UserMediaPermissionRequestManagerProxy::finishGrantingRequest):
        (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
        * UIProcess/UserMediaPermissionRequestManagerProxy.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
        (WebKit::UserMediaPermissionRequestManager::enumerateMediaDevices):
        * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
        * WebProcess/WebCoreSupport/WebUserMediaClient.cpp:
        (WebKit::WebUserMediaClient::enumerateMediaDevices):
        * WebProcess/WebCoreSupport/WebUserMediaClient.h:
        * WebProcess/WebPage/WebPage.cpp:
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2019-08-18  Yusuke Suzuki  <ysuzuki@apple.com>

        [WTF] Add makeUnique<T>, which ensures T is fast-allocated, makeUnique / makeUniqueWithoutFastMallocCheck part
        https://bugs.webkit.org/show_bug.cgi?id=200620

        Reviewed by Geoffrey Garen.

        * NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.cpp:
        (WebKit::ResourceLoadStatisticsPersistentStorage::startMonitoringDisk):
        (WebKit::ResourceLoadStatisticsPersistentStorage::monitorDirectoryForNewStatistics):
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
        * NetworkProcess/CustomProtocols/soup/LegacyCustomProtocolManagerSoup.cpp:
        * NetworkProcess/Downloads/DownloadManager.cpp:
        (WebKit::DownloadManager::startDownload):
        (WebKit::DownloadManager::convertNetworkLoadToDownload):
        (WebKit::DownloadManager::resumeDownload):
        * NetworkProcess/Downloads/DownloadMap.cpp:
        (WebKit::DownloadMap::add):
        * NetworkProcess/Downloads/PendingDownload.cpp:
        (WebKit::PendingDownload::PendingDownload):
        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::establishSWServerConnection):
        * NetworkProcess/NetworkContentRuleListManager.cpp:
        (WebKit::NetworkContentRuleListManager::addContentRuleLists):
        * NetworkProcess/NetworkDataTaskBlob.cpp:
        (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
        (WebKit::NetworkDataTaskBlob::download):
        * NetworkProcess/NetworkHTTPSUpgradeChecker.cpp:
        (WebKit::NetworkHTTPSUpgradeChecker::NetworkHTTPSUpgradeChecker):
        * NetworkProcess/NetworkLoad.cpp:
        (WebKit::NetworkLoad::didReceiveResponse):
        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
        (WebKit::NetworkLoadChecker::contentSecurityPolicy):
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::switchToNewTestingSession):
        (WebKit::NetworkProcess::ensureSession):
        (WebKit::NetworkProcess::swServerForSession):
        (WebKit::NetworkProcess::initializeQuotaUsers):
        (WebKit::NetworkProcess::storageQuotaManager):
        * NetworkProcess/NetworkProcess.h:
        (WebKit::NetworkProcess::addSupplement):
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::m_shouldCaptureExtraNetworkLoadMetrics):
        (WebKit::NetworkResourceLoader::startNetworkLoad):
        * NetworkProcess/NetworkSocketChannel.cpp:
        (WebKit::NetworkSocketChannel::create):
        * NetworkProcess/PreconnectTask.cpp:
        * NetworkProcess/WebStorage/LocalStorageDatabase.cpp:
        (WebKit::LocalStorageDatabase::scheduleDatabaseUpdate):
        * NetworkProcess/WebStorage/LocalStorageNamespace.cpp:
        (WebKit::LocalStorageNamespace::getOrCreateStorageArea):
        * NetworkProcess/WebStorage/SessionStorageNamespace.cpp:
        (WebKit::SessionStorageNamespace::getOrCreateStorageArea):
        * NetworkProcess/WebStorage/StorageArea.cpp:
        (WebKit::StorageArea::clone const):
        * NetworkProcess/WebStorage/StorageManager.cpp:
        (WebKit::StorageManager::createSessionStorageNamespace):
        (WebKit::StorageManager::getOrCreateLocalStorageNamespace):
        (WebKit::StorageManager::getOrCreateTransientLocalStorageNamespace):
        (WebKit::StorageManager::getOrCreateSessionStorageNamespace):
        * NetworkProcess/WebStorage/StorageManagerSet.cpp:
        (WebKit::StorageManagerSet::add):
        * NetworkProcess/WebStorage/TransientLocalStorageNamespace.cpp:
        (WebKit::TransientLocalStorageNamespace::getOrCreateStorageArea):
        * NetworkProcess/cache/NetworkCache.cpp:
        (WebKit::NetworkCache::Cache::Cache):
        (WebKit::NetworkCache::Cache::makeEntry):
        (WebKit::NetworkCache::Cache::makeRedirectEntry):
        (WebKit::NetworkCache::Cache::update):
        * NetworkProcess/cache/NetworkCacheEntry.cpp:
        (WebKit::NetworkCache::Entry::decodeStorageRecord):
        * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
        (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
        * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
        (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::registerSubresourceLoad):
        (WebKit::NetworkCache::SpeculativeLoadManager::retrieve):
        (WebKit::NetworkCache::SpeculativeLoadManager::addPreloadedEntry):
        (WebKit::NetworkCache::SpeculativeLoadManager::satisfyPendingRequests):
        (WebKit::NetworkCache::SpeculativeLoadManager::revalidateSubresource):
        (WebKit::NetworkCache::SpeculativeLoadManager::startSpeculativeRevalidation):
        * NetworkProcess/cache/NetworkCacheStorage.cpp:
        (WebKit::NetworkCache::Storage::synchronize):
        (WebKit::NetworkCache::Storage::readRecord):
        (WebKit::NetworkCache::retrieveFromMemory):
        (WebKit::NetworkCache::Storage::retrieve):
        (WebKit::NetworkCache::Storage::store):
        (WebKit::NetworkCache::Storage::traverse):
        * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
        (WebKit::NetworkCache::SubresourcesEntry::decodeStorageRecord):
        * NetworkProcess/cache/PrefetchCache.cpp:
        (WebKit::PrefetchCache::store):
        (WebKit::PrefetchCache::storeRedirect):
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
        (WebKit::NetworkProcess::networkHTTPSUpgradeChecker):
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]):
        (WebKit::NetworkSessionCocoa::create):
        (WebKit::NetworkSessionCocoa::createWebSocketTask):
        * NetworkProcess/curl/NetworkProcessCurl.cpp:
        (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
        * NetworkProcess/curl/NetworkSessionCurl.h:
        * NetworkProcess/ios/NetworkConnectionToWebProcessIOS.mm:
        (WebKit::NetworkConnectionToWebProcess::paymentCoordinator):
        (WebKit::NetworkConnectionToWebProcess::paymentCoordinatorAuthorizationPresenter):
        * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
        (WebKit::NetworkDataTaskSoup::download):
        * NetworkProcess/soup/NetworkProcessSoup.cpp:
        (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
        * NetworkProcess/soup/NetworkSessionSoup.cpp:
        (WebKit::NetworkSessionSoup::NetworkSessionSoup):
        (WebKit::NetworkSessionSoup::createWebSocketTask):
        * NetworkProcess/soup/NetworkSessionSoup.h:
        * NetworkProcess/soup/WebKitSoupRequestInputStream.cpp:
        (webkitSoupRequestInputStreamReadAsync):
        * NetworkProcess/webrtc/NetworkMDNSRegister.cpp:
        (WebKit::NetworkMDNSRegister::registerMDNSName):
        * NetworkProcess/webrtc/NetworkRTCMonitor.cpp:
        (WebKit::NetworkRTCMonitor::startUpdating):
        * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
        (WebKit::NetworkRTCProvider::NetworkRTCProvider):
        (WebKit::NetworkRTCProvider::createSocket):
        (WebKit::NetworkRTCProvider::wrapNewTCPConnection):
        * Platform/IPC/Connection.cpp:
        (IPC::Connection::dispatchWorkQueueMessageReceiverMessage):
        (IPC::Connection::createSyncMessageEncoder):
        (IPC::Connection::enableIncomingMessagesThrottling):
        (IPC::Connection::dispatchSyncMessage):
        * Platform/IPC/Connection.h:
        (IPC::Connection::send):
        (IPC::Connection::sendWithAsyncReply):
        * Platform/IPC/Decoder.cpp:
        (IPC::Decoder::unwrapForTesting):
        * Platform/IPC/HandleMessage.h:
        (IPC::handleMessageAsync):
        * Platform/IPC/MessageSender.h:
        * Platform/IPC/cocoa/ConnectionCocoa.mm:
        (IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog):
        (IPC::Connection::open):
        (IPC::createMessageDecoder):
        (IPC::Connection::receiveSourceEventHandler):
        * Platform/IPC/unix/ConnectionUnix.cpp:
        (IPC::Connection::processMessage):
        (IPC::Connection::sendOutputMessage):
        * Platform/IPC/win/ConnectionWin.cpp:
        (IPC::Connection::readEventHandler):
        * Platform/mac/LayerHostingContext.mm:
        (WebKit::LayerHostingContext::createForPort):
        (WebKit::LayerHostingContext::createForExternalHostingProcess):
        (WebKit::LayerHostingContext::createForExternalPluginHostingProcess):
        * PluginProcess/WebProcessConnection.cpp:
        (WebKit::WebProcessConnection::createPluginInternal):
        * Shared/API/APIURL.h:
        (API::URL::create):
        (API::URL::parseURLIfNecessary const):
        * Shared/API/Cocoa/RemoteObjectInvocation.mm:
        (WebKit::RemoteObjectInvocation::decode):
        * Shared/API/Cocoa/_WKRemoteObjectRegistry.mm:
        (-[_WKRemoteObjectRegistry _initWithWebPage:]):
        (-[_WKRemoteObjectRegistry _initWithWebPageProxy:]):
        (-[_WKRemoteObjectRegistry _sendInvocation:interface:]):
        * Shared/API/glib/WebKitContextMenuItem.cpp:
        (webkitContextMenuItemCreate):
        (webkit_context_menu_item_new):
        (webkit_context_menu_item_new_from_gaction):
        (webkit_context_menu_item_new_from_stock_action):
        (webkit_context_menu_item_new_from_stock_action_with_label):
        (webkit_context_menu_item_new_with_submenu):
        (webkit_context_menu_item_new_separator):
        * Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
        (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
        * Shared/Cocoa/SandboxExtensionCocoa.mm:
        (WebKit::SandboxExtension::Handle::decode):
        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
        (WebKit::texmapLayer):
        (WebKit::CoordinatedGraphicsScene::ensureRootLayer):
        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
        (WebKit::ThreadedCompositor::ThreadedCompositor):
        * Shared/Plugins/NPRemoteObjectMap.cpp:
        (WebKit::NPRemoteObjectMap::registerNPObject):
        * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
        (WebKit::NetscapePluginModule::tryLoad):
        * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
        (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
        (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
        (WebKit::RemoteLayerTreeTransaction::decode):
        * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
        (WebKit::RemoteScrollingCoordinatorTransaction::decode):
        * Shared/cairo/ShareableBitmapCairo.cpp:
        (WebKit::ShareableBitmap::createGraphicsContext):
        * Shared/cg/ShareableBitmapCG.cpp:
        (WebKit::ShareableBitmap::createGraphicsContext):
        * Shared/win/ShareableBitmapDirect2D.cpp:
        (WebKit::ShareableBitmap::createGraphicsContext):
        * UIProcess/API/APIHTTPCookieStore.cpp:
        (API::HTTPCookieStore::registerObserver):
        * UIProcess/API/C/WKContext.cpp:
        (WKContextSetInjectedBundleClient):
        (WKContextSetHistoryClient):
        (WKContextSetDownloadClient):
        * UIProcess/API/C/WKGeolocationManager.cpp:
        (WKGeolocationManagerSetProvider):
        * UIProcess/API/C/WKNotificationManager.cpp:
        (WKNotificationManagerSetProvider):
        * UIProcess/API/C/WKPage.cpp:
        (WKPageSetPageContextMenuClient):
        (WKPageSetPageDiagnosticLoggingClient):
        (WKPageSetPageFindClient):
        (WKPageSetPageFindMatchesClient):
        (WKPageSetPageFormClient):
        (WKPageSetPageLoaderClient):
        (WKPageSetPagePolicyClient):
        (WKPageSetPageUIClient):
        (WKPageSetPageStateClient):
        * UIProcess/API/C/mac/WKPagePrivateMac.mm:
        (-[WKObservablePageState initWithPage:]):
        * UIProcess/API/C/wpe/WKView.cpp:
        (WKViewSetViewClient):
        * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
        (-[WKBrowsingContextController _initWithPageRef:]):
        * UIProcess/API/Cocoa/WKHTTPCookieStore.mm:
        (-[WKHTTPCookieStore addObserver:]):
        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _setDownloadDelegate:]):
        (-[WKProcessPool _setAutomationDelegate:]):
        * UIProcess/API/Cocoa/WKUserContentController.mm:
        (-[WKUserContentController addScriptMessageHandler:name:]):
        (-[WKUserContentController _addScriptMessageHandler:name:userContentWorld:]):
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]):
        (-[WKWebView setAllowsBackForwardNavigationGestures:]):
        (-[WKWebView _setInputDelegate:]):
        * UIProcess/API/Cocoa/_WKAutomationSession.mm:
        (-[_WKAutomationSession setDelegate:]):
        * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm:
        (-[_WKRemoteWebInspectorViewController init]):
        * UIProcess/API/glib/IconDatabase.cpp:
        (WebKit::readySQLiteStatement):
        * UIProcess/API/glib/WebKitAutomationSession.cpp:
        (webkitAutomationSessionConstructed):
        * UIProcess/API/glib/WebKitContextMenuClient.cpp:
        (attachContextMenuClientToView):
        * UIProcess/API/glib/WebKitCustomProtocolManagerClient.cpp:
        (attachCustomProtocolManagerClientToContext):
        * UIProcess/API/glib/WebKitDownloadClient.cpp:
        (attachDownloadClientToContext):
        * UIProcess/API/glib/WebKitFaviconDatabase.cpp:
        (webkitFaviconDatabaseOpen):
        * UIProcess/API/glib/WebKitFindController.cpp:
        (webkitFindControllerConstructed):
        * UIProcess/API/glib/WebKitFormClient.cpp:
        (attachFormClientToView):
        * UIProcess/API/glib/WebKitGeolocationManager.cpp:
        (webkitGeolocationManagerCreate):
        * UIProcess/API/glib/WebKitIconLoadingClient.cpp:
        (attachIconLoadingClientToView):
        * UIProcess/API/glib/WebKitInjectedBundleClient.cpp:
        (attachInjectedBundleClientToContext):
        * UIProcess/API/glib/WebKitNotificationProvider.cpp:
        (WebKitNotificationProvider::WebKitNotificationProvider):
        * UIProcess/API/glib/WebKitUIClient.cpp:
        (attachUIClientToView):
        * UIProcess/API/glib/WebKitUserContentManager.cpp:
        (webkit_user_content_manager_register_script_message_handler):
        (webkit_user_content_manager_register_script_message_handler_in_world):
        * UIProcess/API/glib/WebKitWebContext.cpp:
        (webkitWebContextConstructed):
        (webkit_web_context_set_automation_allowed):
        * UIProcess/API/glib/WebKitWebView.cpp:
        (webkitWebViewConstructed):
        * UIProcess/API/gtk/PageClientImpl.cpp:
        (WebKit::PageClientImpl::createDrawingAreaProxy):
        * UIProcess/API/gtk/WebKitEmojiChooser.cpp:
        (webkitEmojiChooserSetupEmojiSections):
        * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
        (WebKit::RemoteInspectorProtocolHandler::handleRequest):
        * UIProcess/API/gtk/WebKitWebInspector.cpp:
        (webkitWebInspectorCreate):
        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (webkitWebViewBaseConstructed):
        (webkitWebViewBaseGestureController):
        (webkitWebViewBaseDragAndDropHandler):
        (webkitWebViewBaseDidRelaunchWebProcess):
        * UIProcess/API/mac/WKView.mm:
        (-[WKView maybeInstallIconLoadingClient]):
        (-[WKView initWithFrame:processPool:configuration:]):
        * UIProcess/API/wpe/PageClientImpl.cpp:
        (WebKit::PageClientImpl::PageClientImpl):
        (WebKit::PageClientImpl::createDrawingAreaProxy):
        * UIProcess/API/wpe/WPEView.cpp:
        (WKWPE::View::View):
        (WKWPE::View::setClient):
        * UIProcess/API/wpe/qt/WPEQtView.cpp:
        (WPEQtView::notifyLoadChangedCallback):
        (WPEQtView::notifyLoadFailedCallback):
        (WPEQtView::runJavaScript):
        * UIProcess/API/wpe/qt/WPEQtViewBackend.cpp:
        (WPEQtViewBackend::create):
        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::WebAutomationSession):
        * UIProcess/AuxiliaryProcessProxy.h:
        (WebKit::AuxiliaryProcessProxy::send):
        * UIProcess/Cocoa/IconLoadingDelegate.mm:
        (WebKit::IconLoadingDelegate::createIconLoadingClient):
        * UIProcess/Cocoa/UIDelegate.mm:
        (WebKit::UIDelegate::createContextMenuClient):
        (WebKit::UIDelegate::createUIClient):
        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
        (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitialize):
        (WebKit::WebProcessPool::startDisplayLink):
        * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
        (WebKit::WebProcessProxy::processWasUnexpectedlyUnsuspended):
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::WebViewImpl):
        (WebKit::WebViewImpl::createDrawingAreaProxy):
        (WebKit::WebViewImpl::setTextIndicator):
        (WebKit::WebViewImpl::ensureGestureController):
        * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp:
        (WebKit::DrawingAreaProxyCoordinatedGraphics::incorporateUpdate):
        (WebKit::DrawingAreaProxyCoordinatedGraphics::dispatchAfterEnsuringDrawing):
        * UIProcess/DeviceIdHashSaltStorage.cpp:
        (WebKit::DeviceIdHashSaltStorage::getDataFromDecoder const):
        (WebKit::DeviceIdHashSaltStorage::completeDeviceIdHashSaltForOriginCall):
        * UIProcess/Downloads/DownloadProxyMap.cpp:
        (WebKit::DownloadProxyMap::createDownloadProxy):
        * UIProcess/Gamepad/UIGamepadProvider.cpp:
        (WebKit::UIGamepadProvider::setInitialConnectedGamepads):
        (WebKit::UIGamepadProvider::platformGamepadConnected):
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::createDownloadProxy):
        (WebKit::NetworkProcessProxy::takeUploadAssertion):
        * UIProcess/Notifications/WebNotificationManagerProxy.cpp:
        (WebKit::WebNotificationManagerProxy::WebNotificationManagerProxy):
        (WebKit::WebNotificationManagerProxy::setProvider):
        * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
        (WebKit::pluginRequiresGtk2):
        * UIProcess/ProcessThrottler.cpp:
        (WebKit::ProcessThrottler::didConnectToProcess):
        * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
        (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
        (WebKit::RemoteLayerTreeDrawingAreaProxy::initializeDebugIndicator):
        * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
        (WebKit::RemoteLayerTreeHost::makeNode):
        * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm:
        (WebKit::RemoteLayerTreeNode::createWithPlainLayer):
        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
        (WebKit::RemoteLayerTreeHost::makeNode):
        * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
        (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateBeforeChildren):
        * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
        (WebKit::ScrollingTreeOverflowScrollingNodeIOS::ScrollingTreeOverflowScrollingNodeIOS):
        * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp:
        (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::ScrollingTreeFrameScrollingNodeRemoteMac):
        * UIProcess/RemoteLayerTree/mac/ScrollingTreeOverflowScrollingNodeRemoteMac.cpp:
        (WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::ScrollingTreeOverflowScrollingNodeRemoteMac):
        * UIProcess/WebAuthentication/Cocoa/HidService.mm:
        (WebKit::HidService::deviceAdded):
        * UIProcess/WebGeolocationManagerProxy.cpp:
        (WebKit::WebGeolocationManagerProxy::WebGeolocationManagerProxy):
        (WebKit::WebGeolocationManagerProxy::setProvider):
        * UIProcess/WebMediaSessionFocusManager.cpp:
        (WebKit::WebMediaSessionFocusManager::setFocusedMediaElement):
        * UIProcess/WebPageInspectorController.cpp:
        (WebKit::WebPageInspectorController::WebPageInspectorController):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::WebPageProxy):
        (WebKit::m_resetRecentCrashCountTimer):
        (WebKit::WebPageProxy::setFormClient):
        (WebKit::WebPageProxy::setUIClient):
        (WebKit::WebPageProxy::setIconLoadingClient):
        (WebKit::WebPageProxy::setFindClient):
        (WebKit::WebPageProxy::setFindMatchesClient):
        (WebKit::WebPageProxy::setContextMenuClient):
        (WebKit::WebPageProxy::setInjectedBundleClient):
        (WebKit::WebPageProxy::suspendCurrentPageIfPossible):
        (WebKit::WebPageProxy::didAttachToRunningProcess):
        (WebKit::WebPageProxy::setDrawingArea):
        (WebKit::WebPageProxy::close):
        (WebKit::WebPageProxy::loadData):
        (WebKit::WebPageProxy::handleWheelEvent):
        (WebKit::WebPageProxy::processNextQueuedWheelEvent):
        (WebKit::WebPageProxy::continueNavigationInNewProcess):
        (WebKit::WebPageProxy::setFullscreenClient):
        (WebKit::WebPageProxy::userMediaPermissionRequestManager):
        (WebKit::WebPageProxy::setScrollPerformanceDataCollectionEnabled):
        (WebKit::WebPageProxy::speechSynthesisData):
        * UIProcess/WebProcessCache.cpp:
        (WebKit::WebProcessCache::addProcessIfPossible):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::WebProcessPool):
        (WebKit::WebProcessPool::setInjectedBundleClient):
        (WebKit::WebProcessPool::setHistoryClient):
        (WebKit::WebProcessPool::setDownloadClient):
        (WebKit::WebProcessPool::setAutomationClient):
        (WebKit::WebProcessPool::setLegacyCustomProtocolManagerClient):
        (WebKit::WebProcessPool::ensureNetworkProcess):
        (WebKit::WebProcessPool::didCollectPrewarmInformation):
        (WebKit::WebProcessPool::setWebProcessHasUploads):
        (WebKit::WebProcessPool::setWebProcessIsPlayingAudibleMedia):
        * UIProcess/WebProcessProxy.cpp:
        * UIProcess/cairo/BackingStoreCairo.cpp:
        (WebKit::BackingStore::createBackend):
        * UIProcess/glib/RemoteInspectorClient.cpp:
        (WebKit::RemoteInspectorClient::inspect):
        * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
        (WebKit::AcceleratedBackingStoreWayland::checkRequirements):
        * UIProcess/gtk/DragAndDropHandler.cpp:
        (WebKit::DragAndDropHandler::dragDataSelection):
        * UIProcess/gtk/WaylandCompositor.cpp:
        (WebKit::WaylandCompositor::initializeEGL):
        * UIProcess/ios/EditableImageController.mm:
        (WebKit::EditableImageController::ensureEditableImage):
        * UIProcess/ios/WKApplicationStateTrackingView.mm:
        (-[WKApplicationStateTrackingView didMoveToWindow]):
        * UIProcess/ios/WKContentView.mm:
        (-[WKContentView _commonInitializationWithProcessPool:configuration:]):
        (-[WKContentView initWithFrame:processPool:configuration:webView:]):
        (-[WKContentView _createDrawingAreaProxy:]):
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView setupInteraction]):
        (-[WKContentView becomeFirstResponderForWebView]):
        (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:activityStateChanges:userObject:]):
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::elementDidFocus):
        (WebKit::WebPageProxy::paymentCoordinatorAuthorizationPresenter):
        * UIProcess/mac/PageClientImplMac.mm:
        (WebKit::PageClientImpl::PageClientImpl):
        * UIProcess/mac/WKFullScreenWindowController.mm:
        (-[WKFullScreenWindowController initWithWindow:webView:page:]):
        * UIProcess/mac/WKTextFinderClient.mm:
        (-[WKTextFinderClient initWithPage:view:usePlatformFindUI:]):
        * UIProcess/socket/RemoteInspectorClient.cpp:
        (WebKit::RemoteInspectorClient::inspect):
        * UIProcess/socket/RemoteInspectorProtocolHandler.cpp:
        (WebKit::RemoteInspectorProtocolHandler::platformStartTask):
        * UIProcess/win/BackingStoreDirect2D.cpp:
        (WebKit::BackingStore::createBackend):
        * UIProcess/win/PageClientImpl.cpp:
        (WebKit::PageClientImpl::createDrawingAreaProxy):
        * UIProcess/win/WebView.cpp:
        (WebKit::WebView::WebView):
        * WebProcess/Gamepad/WebGamepadProvider.cpp:
        (WebKit::WebGamepadProvider::setInitialGamepads):
        (WebKit::WebGamepadProvider::gamepadConnected):
        * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
        (WKBundleSetClient):
        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
        (WKBundlePageSetContextMenuClient):
        (WKBundlePageSetEditorClient):
        (WKBundlePageSetFormClient):
        (WKBundlePageSetPageLoaderClient):
        (WKBundlePageSetResourceLoadClient):
        (WKBundlePageSetUIClient):
        * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
        (WKBundlePageOverlayCreate):
        * WebProcess/InjectedBundle/API/c/mac/WKBundlePageBannerMac.mm:
        (WKBundlePageBannerCreateBannerWithCALayer):
        * WebProcess/InjectedBundle/API/glib/DOM/DOMObjectCache.cpp:
        (WebKit::getOrCreateDOMObjectCacheFrameObserver):
        (WebKit::DOMObjectCache::put):
        * WebProcess/InjectedBundle/API/glib/WebKitExtensionManager.cpp:
        (WebKit::WebKitExtensionManager::initialize):
        * WebProcess/InjectedBundle/API/glib/WebKitWebEditor.cpp:
        (webkitWebEditorCreate):
        * WebProcess/InjectedBundle/API/glib/WebKitWebExtension.cpp:
        (webkitWebExtensionCreate):
        * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
        (webkitFrameGetOrCreate):
        (webkitWebPageCreate):
        * WebProcess/InjectedBundle/API/mac/WKDOMTextIterator.mm:
        (-[WKDOMTextIterator initWithRange:]):
        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
        (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]):
        (-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]):
        * WebProcess/InjectedBundle/InjectedBundle.cpp:
        (WebKit::InjectedBundle::InjectedBundle):
        (WebKit::InjectedBundle::setClient):
        * WebProcess/Network/WebSocketChannel.cpp:
        (WebKit::PendingMessage::PendingMessage):
        (WebKit::WebSocketChannel::send):
        * WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
        (WebKit::LibWebRTCProvider::createPeerConnection):
        (WebKit::LibWebRTCProvider::createSocketFactory):
        * WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp:
        (WebKit::LibWebRTCSocketFactory::createServerTcpSocket):
        (WebKit::LibWebRTCSocketFactory::createUdpSocket):
        (WebKit::LibWebRTCSocketFactory::createClientTcpSocket):
        (WebKit::LibWebRTCSocketFactory::createNewConnectionSocket):
        (WebKit::LibWebRTCSocketFactory::createAsyncResolver):
        * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
        (WebKit::PluginDestructionProtector::PluginDestructionProtector):
        * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
        (WebKit::NetscapePlugin::scheduleTimer):
        * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
        (WebKit::NetscapePluginStream::deliverData):
        * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
        (WebKit::NetscapePluginX11::create):
        * WebProcess/Plugins/PluginProxy.cpp:
        (WebKit::PluginProxy::initialize):
        * WebProcess/Plugins/PluginView.cpp:
        (WebKit::PluginView::createWebEvent const):
        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        (WebKit::WebSWContextManagerConnection::installServiceWorker):
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::createColorChooser):
        (WebKit::WebChromeClient::createDataListSuggestionPicker):
        * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
        (WebKit::WebInspectorClient::showPaintRect):
        * WebProcess/WebCoreSupport/WebPasteboardOverrides.cpp:
        (WebKit::WebPasteboardOverrides::addOverride):
        * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
        (WebKit::DrawingAreaCoordinatedGraphics::enterAcceleratedCompositingMode):
        * WebProcess/WebPage/DrawingArea.cpp:
        (WebKit::DrawingArea::create):
        * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
        (WebKit::PlatformCALayerRemote::ensureBackingStore):
        (WebKit::PlatformCALayerRemote::setTransform):
        (WebKit::PlatformCALayerRemote::setSublayerTransform):
        (WebKit::PlatformCALayerRemote::setFilters):
        (WebKit::PlatformCALayerRemote::setShapeRoundedRect):
        * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteTiledBacking.cpp:
        (WebKit::PlatformCALayerRemoteTiledBacking::PlatformCALayerRemoteTiledBacking):
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
        (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
        (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
        * WebProcess/WebPage/WebFrame.cpp:
        (WebKit::WebFrame::createSubframe):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_textAutoSizingAdjustmentTimer):
        (WebKit::WebPage::setInjectedBundleContextMenuClient):
        (WebKit::WebPage::setInjectedBundleEditorClient):
        (WebKit::WebPage::setInjectedBundleFormClient):
        (WebKit::WebPage::setInjectedBundlePageLoaderClient):
        (WebKit::WebPage::setInjectedBundleResourceLoadClient):
        (WebKit::WebPage::setInjectedBundleUIClient):
        (WebKit::WebPage::close):
        (WebKit::WebPage::beginPrinting):
        * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
        (WebKit::WebPrintOperationGtk::print):
        * WebProcess/WebPage/ios/FindControllerIOS.mm:
        (WebKit::FindController::updateFindIndicator):
        * WebProcess/WebPage/mac/DrawingAreaMac.cpp:
        (WebKit::DisplayRefreshMonitorMac::requestRefreshCallback):
        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
        (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::markAllLayersVolatile):
        (WebKit::WebProcess::ensureAutomationSessionProxy):
        (WebKit::WebProcess::libWebRTCNetwork):
        (WebKit::WebProcess::establishWorkerContextConnectionToNetworkProcess):
        * WebProcess/WebProcess.h:
        (WebKit::WebProcess::addSupplement):
        * WebProcess/cocoa/UserMediaCaptureManager.cpp:
        (WebKit::UserMediaCaptureManager::Source::Source):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::processTaskStateDidChange):
        (WebKit::WebProcess::updateCPUMonitorState):

2019-08-18  Per Arne Vollan  <pvollan@apple.com>

        [Mac] Use the PID of the WebContent process when issuing local file read sandbox extensions
        https://bugs.webkit.org/show_bug.cgi?id=200543
        <rdar://problem/49394015>
        
        Reviewed by Brent Fulgham.

        Adopt SPI to issue a process-specific sandbox extension for local file read, passing it the process
        identifier of the WebContent process.
        
        * Shared/Cocoa/SandboxExtensionCocoa.mm:
        (WebKit::SandboxExtensionImpl::sandboxExtensionForType):
        (WebKit::SandboxExtension::createHandleForReadByPid):
        * Shared/SandboxExtension.h:
        * UIProcess/Cocoa/WebPageProxyCocoa.mm:
        (WebKit::WebPageProxy::createSandboxExtensionsIfNeeded):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
        (WebKit::WebPageProxy::loadFile):

2019-08-17  Tim Horton  <timothy_horton@apple.com>

        Layout tests that call resizeTo() crash when run on iOS with IOSurface support enabled
        https://bugs.webkit.org/show_bug.cgi?id=200866
        <rdar://problem/50254021>

        Reviewed by Simon Fraser.

        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::convertToDeviceSpace):
        (WebKit::PageClientImpl::convertToUserSpace):
        Implement convertTo{Device,User}Space in PageClientImplIOS.
        We don't actually do any conversion. For our purposes, the window is
        "device" space, and we never allow iOS WebKit clients to resize the window...
        except for in tests! So just pass the rects straight through, instead of
        returning an empty rect.

2019-08-17  Eric Liang  <ericliang@apple.com>

        Use bundlePath SPI in AccessibilitySupport for WebProcessLoader
        https://bugs.webkit.org/show_bug.cgi?id=200367

        Reviewed by Darin Adler.

        * Platform/spi/ios/AccessibilitySupportSPI.h:
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::accessibilityWebProcessLoaderBundlePath):
        (WebKit::registerWithAccessibility):

2019-08-17  Sam Weinig  <weinig@apple.com>

        Rename StringBuilder::flexibleAppend(...) to StringBuilder::append(...)
        https://bugs.webkit.org/show_bug.cgi?id=200756

        Reviewed by Darin Adler.

        Update call sites for rename from StringBuilder::flexibleAppend(...) to 
        StringBuilder::append(...).

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::dumpHistoryItem):
        We have to explicitly access the underlying String of the URL rather than
        relying on the implicit conversion since it is now ambiguous which append(...)
        overload should be used.

2019-08-17  Devin Rousso  <drousso@apple.com>

        Web Inspector: make the initial height bigger when attached
        https://bugs.webkit.org/show_bug.cgi?id=200855

        Reviewed by Joseph Pecoraro.

        * Shared/WebPreferences.yaml:
        Increase the default attached height from `300px` to `500px`, which is close to the same
        amount of area given a 15" MacBook Pro's aspect ratio (default attached width is `750px`).

2019-08-17  Simon Fraser  <simon.fraser@apple.com>

        [iOS WK2] Scroll indicators disappear sometimes
        https://bugs.webkit.org/show_bug.cgi?id=200791

        Reviewed by Tim Horton.
        
        _web_setSubviews: replaces all of the views subviews with the supplied array, but this blows
        away views not managed by WebKit, including UIScrollViews scroll indicators. Fix by having
        WebKit-managed views implement the WKWebKitControlled protocol, and only removing views
        implementing that protocol.

        * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
        (-[UIView _web_setSubviews:]):
        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h:

2019-08-17  Antti Koivisto  <antti@apple.com>

        Content in <iframe> should override "touch-action" set in embedding document
        https://bugs.webkit.org/show_bug.cgi?id=200204
        <rdar://problem/54355249>

        Reviewed by Antoine Quint.

        Subframes where content doesn't use any touch-action properties won't generate event region for their main layer.
        As a result the touch-action property gets computed in UI process to the parent frames touch-action (instead of 'auto').

        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
        (WebKit::touchActionsForPoint):

        If the topmost layer hit is a WKChildScrollView we know its content layer didn't have an event region.
        This means we should return the default value 'auto'.

2019-08-16  Chris Dumez  <cdumez@apple.com>

        Use strongly typed identifiers for StorageArea / StorageAreaImpl
        https://bugs.webkit.org/show_bug.cgi?id=200835

        Reviewed by Alex Christensen.

        Use strongly typed identifiers for StorageArea / StorageAreaImpl. They currently both use uint64_t
        and are used in the same code, it is therefore very easy to confused the 2 types of identifiers.

        * NetworkProcess/WebStorage/StorageArea.cpp:
        (WebKit::StorageArea::StorageArea):
        (WebKit::StorageArea::setItem):
        (WebKit::StorageArea::removeItem):
        (WebKit::StorageArea::clear):
        (WebKit::StorageArea::dispatchEvents const):
        * NetworkProcess/WebStorage/StorageArea.h:
        (WebKit::StorageArea::identifier):
        * NetworkProcess/WebStorage/StorageAreaIdentifier.h: Copied from Source/WebKit/WebProcess/WebStorage/StorageAreaImpl.h.
        * NetworkProcess/WebStorage/StorageManagerSet.cpp:
        (WebKit::StorageManagerSet::connectToLocalStorageArea):
        (WebKit::StorageManagerSet::connectToTransientLocalStorageArea):
        (WebKit::StorageManagerSet::connectToSessionStorageArea):
        (WebKit::StorageManagerSet::disconnectFromStorageArea):
        (WebKit::StorageManagerSet::getValues):
        (WebKit::StorageManagerSet::setItem):
        (WebKit::StorageManagerSet::removeItem):
        (WebKit::StorageManagerSet::clear):
        * NetworkProcess/WebStorage/StorageManagerSet.h:
        * NetworkProcess/WebStorage/StorageManagerSet.messages.in:
        * Scripts/webkit/messages.py:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/Network/NetworkProcessConnection.cpp:
        (WebKit::NetworkProcessConnection::didReceiveMessage):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::registerStorageAreaMap):
        (WebKit::WebProcess::unregisterStorageAreaMap):
        (WebKit::WebProcess::storageAreaMap const):
        * WebProcess/WebProcess.h:
        * WebProcess/WebStorage/StorageAreaImpl.cpp:
        (WebKit::StorageAreaImpl::StorageAreaImpl):
        * WebProcess/WebStorage/StorageAreaImpl.h:
        * WebProcess/WebStorage/StorageAreaImplIdentifier.h: Copied from Source/WebKit/WebProcess/WebStorage/StorageAreaImpl.h.
        * WebProcess/WebStorage/StorageAreaMap.cpp:
        (WebKit::StorageAreaMap::StorageAreaMap):
        (WebKit::StorageAreaMap::setItem):
        (WebKit::StorageAreaMap::removeItem):
        (WebKit::StorageAreaMap::clear):
        (WebKit::StorageAreaMap::loadValuesIfNeeded):
        (WebKit::StorageAreaMap::dispatchStorageEvent):
        (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
        (WebKit::StorageAreaMap::dispatchLocalStorageEvent):
        (WebKit::StorageAreaMap::disconnect):
        * WebProcess/WebStorage/StorageAreaMap.h:
        (WebKit::StorageAreaMap::identifier const):
        * WebProcess/WebStorage/StorageAreaMap.messages.in:

2019-08-16  Chris Dumez  <cdumez@apple.com>

        Drop StorageArea::setWorkQueue() member function
        https://bugs.webkit.org/show_bug.cgi?id=200832

        Reviewed by Alex Christensen.

        Drop StorageArea::setWorkQueue() member function and pass the WorkQueue to the StorageArea constructor instead.
        The WorkQueue can never get updated so an explicit setter is not necessary. It also makes it clearer that the
        m_queue data member can never be null.

        * NetworkProcess/WebStorage/LocalStorageNamespace.cpp:
        (WebKit::LocalStorageNamespace::getOrCreateStorageArea):
        * NetworkProcess/WebStorage/LocalStorageNamespace.h:
        * NetworkProcess/WebStorage/SessionStorageNamespace.cpp:
        (WebKit::SessionStorageNamespace::getOrCreateStorageArea):
        * NetworkProcess/WebStorage/SessionStorageNamespace.h:
        * NetworkProcess/WebStorage/StorageArea.cpp:
        (WebKit::StorageArea::StorageArea):
        (WebKit::StorageArea::clone const):
        (WebKit::StorageArea::openDatabaseAndImportItemsIfNeeded const):
        * NetworkProcess/WebStorage/StorageArea.h:
        (WebKit::StorageArea::setWorkQueue): Deleted.
        * NetworkProcess/WebStorage/StorageManager.cpp:
        (WebKit::StorageManager::createLocalStorageArea):
        (WebKit::StorageManager::createTransientLocalStorageArea):
        (WebKit::StorageManager::createSessionStorageArea):
        * NetworkProcess/WebStorage/StorageManager.h:
        * NetworkProcess/WebStorage/StorageManagerSet.cpp:
        (WebKit::StorageManagerSet::connectToLocalStorageArea):
        (WebKit::StorageManagerSet::connectToTransientLocalStorageArea):
        (WebKit::StorageManagerSet::connectToSessionStorageArea):
        * NetworkProcess/WebStorage/TransientLocalStorageNamespace.cpp:
        (WebKit::TransientLocalStorageNamespace::getOrCreateStorageArea):
        * NetworkProcess/WebStorage/TransientLocalStorageNamespace.h:

2019-08-16  Chris Dumez  <cdumez@apple.com>

        LocalStorageDatabaseTracker does not need to subclass ThreadSafeRefCounted
        https://bugs.webkit.org/show_bug.cgi?id=200825

        Reviewed by Alex Christensen.

        LocalStorageDatabaseTracker does not need to subclass ThreadSafeRefCounted. It is currently always
        ref'd / deref'd from the com.apple.WebKit.WebStorage serial WorkQueue, save from inside
        LocalStorageDatabaseTracker::platformMaybeExcludeFromBackup() on iOS. However, it is probably
        not a good idea to set FileSystem metadata from the main thread in platformMaybeExcludeFromBackup()
        anyway.

        Note that I had to get rid of an old linked-on-after check since those are currently only safe
        to do on the main thread. I cleared this with Brady. It has been a while since we've shipped this
        behavior now and apps have had a chance to update.

        * NetworkProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
        (WebKit::LocalStorageDatabaseTracker::databasePath const):
        * NetworkProcess/WebStorage/LocalStorageDatabaseTracker.h:
        * NetworkProcess/WebStorage/ios/LocalStorageDatabaseTrackerIOS.mm:
        (WebKit::LocalStorageDatabaseTracker::platformMaybeExcludeFromBackup const):
        * UIProcess/Cocoa/VersionChecks.h:

2019-08-16  Chris Dumez  <cdumez@apple.com>

        LocalStorageDatabase should use inline initialization for its data members
        https://bugs.webkit.org/show_bug.cgi?id=200828

        Reviewed by John Wilander.

        * NetworkProcess/WebStorage/LocalStorageDatabase.cpp:
        (WebKit::LocalStorageDatabase::LocalStorageDatabase):
        * NetworkProcess/WebStorage/LocalStorageDatabase.h:

2019-08-16  Kate Cheney  <katherine_cheney@apple.com>

        Functions with no parameters in WebKit/Shared/API/c and WebKit/UIProcess/API/C are
        missing a "void" specifier in their argument list
        https://bugs.webkit.org/show_bug.cgi?id=200826

        Reviewed by Chris Dumez.

        Added void to indicate functions with no arguments to satisfy compiler errors.
        This error came to light when fixing another patch.

        * Shared/API/c/WKArray.h:
        * Shared/API/c/WKConnectionRef.h:
        * Shared/API/c/WKContextMenuItem.h:
        * Shared/API/c/WKData.h:
        * Shared/API/c/WKDictionary.h:
        * Shared/API/c/WKErrorRef.h:
        * Shared/API/c/WKMutableArray.h:
        * Shared/API/c/WKMutableDictionary.h:
        * Shared/API/c/WKNumber.h:
        * Shared/API/c/WKPluginInformation.h:
        * Shared/API/c/WKRenderLayer.h:
        * Shared/API/c/WKRenderObject.h:
        * Shared/API/c/WKSecurityOriginRef.h:
        * Shared/API/c/WKSerializedScriptValue.h:
        * Shared/API/c/WKString.h:
        * Shared/API/c/WKURL.h:
        * Shared/API/c/WKURLRequest.h:
        * Shared/API/c/WKURLResponse.h:
        * Shared/API/c/WKUserContentURLPattern.h:
        * UIProcess/API/C/WKBackForwardListItemRef.h:
        * UIProcess/API/C/WKBackForwardListRef.h:
        * UIProcess/API/C/WKContext.h:
        * UIProcess/API/C/WKFormSubmissionListener.h:
        * UIProcess/API/C/WKFrame.h:
        * UIProcess/API/C/WKFramePolicyListener.h:
        * UIProcess/API/C/WKGeolocationManager.h:
        * UIProcess/API/C/WKGeolocationPermissionRequest.h:
        * UIProcess/API/C/WKGeolocationPosition.h:
        * UIProcess/API/C/WKHitTestResult.h:
        * UIProcess/API/C/WKNavigationDataRef.h:
        * UIProcess/API/C/WKOpenPanelParametersRef.h:
        * UIProcess/API/C/WKOpenPanelResultListener.h:
        * UIProcess/API/C/WKPage.h:
        * UIProcess/API/C/WKPageConfigurationRef.h:
        * UIProcess/API/C/WKPageGroup.h:
        * UIProcess/API/C/WKPageUIClient.h:
        * UIProcess/API/C/WKPreferencesRef.h:
        * UIProcess/API/C/WKUserContentControllerRef.h:
        * UIProcess/API/C/WKUserMediaPermissionRequest.h:
        * UIProcess/API/C/WKUserScriptRef.h:

2019-08-16  Chris Dumez  <cdumez@apple.com>

        LocalStorageDatabase does not need to subclass ThreadSafeRefCounted
        https://bugs.webkit.org/show_bug.cgi?id=200822

        Reviewed by Geoff Garen.

        LocalStorageDatabase does not need to subclass ThreadSafeRefCounted, it is only ref'd / deref'd by the StorageArea
        on the com.apple.WebKit.WebStorage serial WorkQueue, and in LocalStorageDatabase::scheduleDatabaseUpdate() on the
        same WorkQueue.

        * NetworkProcess/WebStorage/LocalStorageDatabase.cpp:
        (WebKit::LocalStorageDatabase::LocalStorageDatabase):
        (WebKit::LocalStorageDatabase::~LocalStorageDatabase):
        * NetworkProcess/WebStorage/LocalStorageDatabase.h:

2019-08-16  Chris Dumez  <cdumez@apple.com>

        Many WebStorage classes do not need to subclass ThreadSafeRefCounted
        https://bugs.webkit.org/show_bug.cgi?id=200821

        Reviewed by Geoffrey Garen.

        Many WebStorage classes do not need to subclass ThreadSafeRefCounted. They never get ref'd or deref'd.

        * NetworkProcess/WebStorage/LocalStorageNamespace.cpp:
        (WebKit::LocalStorageNamespace::getOrCreateStorageArea):
        (WebKit::LocalStorageNamespace::clearAllStorageAreas):
        * NetworkProcess/WebStorage/LocalStorageNamespace.h:
        * NetworkProcess/WebStorage/SessionStorageNamespace.cpp:
        (WebKit::SessionStorageNamespace::getOrCreateStorageArea):
        * NetworkProcess/WebStorage/SessionStorageNamespace.h:
        * NetworkProcess/WebStorage/StorageArea.cpp:
        (WebKit::StorageArea::clone const):
        * NetworkProcess/WebStorage/StorageArea.h:
        * NetworkProcess/WebStorage/StorageManager.cpp:
        (WebKit::StorageManager::createSessionStorageNamespace):
        (WebKit::StorageManager::createLocalStorageArea):
        (WebKit::StorageManager::createTransientLocalStorageArea):
        (WebKit::StorageManager::createSessionStorageArea):
        (WebKit::StorageManager::getOrCreateLocalStorageNamespace):
        (WebKit::StorageManager::getOrCreateTransientLocalStorageNamespace):
        (WebKit::StorageManager::getOrCreateSessionStorageNamespace):
        * NetworkProcess/WebStorage/StorageManager.h:
        * NetworkProcess/WebStorage/TransientLocalStorageNamespace.cpp:
        (WebKit::TransientLocalStorageNamespace::getOrCreateStorageArea):
        * NetworkProcess/WebStorage/TransientLocalStorageNamespace.h:

2019-08-16  Dean Jackson  <dino@apple.com>

        Long pressing images with transparent backgrounds in dark mode causes a black background to appear around the image content
        https://bugs.webkit.org/show_bug.cgi?id=200827
        <rdar://53933379>

        Reviewed by Tim Horton.

        Set a clear color when there is no provided background.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (createTargetedPreview):

2019-08-16  Ryosuke Niwa  <rniwa@webkit.org>

        Split tabIndex computation for DOM and the rest of WebCore
        https://bugs.webkit.org/show_bug.cgi?id=200806

        Reviewed by Chris Dumez.

        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.cpp:
        (webkit_dom_html_element_get_tab_index):
        (webkit_dom_html_element_set_tab_index):

2019-08-16  Ross Kirsling  <ross.kirsling@sony.com>

        Unreviewed restabilization of non-unified build.

        * NetworkProcess/NetworkCORSPreflightChecker.h:
        * NetworkProcess/WebStorage/StorageManagerSet.cpp:
        (WebKit::StorageManagerSet::StorageManagerSet):
        * Shared/FrameInfoData.cpp:
        (WebKit::FrameInfoData::decode):
        * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
        * WebProcess/WebStorage/StorageNamespaceImpl.h:

2019-08-16  Chris Dumez  <cdumez@apple.com>

        StorageManager does not need to subclass RefCounted
        https://bugs.webkit.org/show_bug.cgi?id=200818

        Reviewed by Geoffrey Garen.

        StorageManager does not need to subclass RefCounted. It is owned by the StorageManagerSet
        and is never ref'd / deref'd.

        * NetworkProcess/WebStorage/StorageManager.h:
        (WebKit::StorageManager::create): Deleted.
        * NetworkProcess/WebStorage/StorageManagerSet.cpp:
        (WebKit::StorageManagerSet::add):
        * NetworkProcess/WebStorage/StorageManagerSet.h:

2019-08-16  Chris Dumez  <cdumez@apple.com>

        Clarify StorageManagerSet / StorageManager threading model after r248734
        https://bugs.webkit.org/show_bug.cgi?id=200817

        Reviewed by Geoffrey Garen.

        Clarify StorageManagerSet / StorageManager threading model after r248734. StorageManager is now
        a background thread object but it still calls its completion handlers on the main thread, which
        is very error prone. The pattern in WebKit for thread safety is that methods should always call
        their completion handler of the thread / queue they were called on themselves. Doing differently
        has caused so many thread-safety bugs in the past.

        * NetworkProcess/WebStorage/StorageManager.cpp:
        (WebKit::StorageManager::getSessionStorageOrigins const):
        (WebKit::StorageManager::deleteSessionStorageOrigins):
        (WebKit::StorageManager::deleteSessionStorageEntriesForOrigins):
        (WebKit::StorageManager::getLocalStorageOrigins const):
        (WebKit::StorageManager::getLocalStorageOriginDetails const):
        (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
        (WebKit::StorageManager::deleteLocalStorageEntriesForOrigins):
        (WebKit::StorageManager::getSessionStorageOrigins): Deleted.
        (WebKit::StorageManager::getLocalStorageOrigins): Deleted.
        (WebKit::StorageManager::getLocalStorageOriginDetails): Deleted.
        * NetworkProcess/WebStorage/StorageManager.h:
        * NetworkProcess/WebStorage/StorageManagerSet.cpp:
        (WebKit::StorageManagerSet::getSessionStorageOrigins):
        (WebKit::StorageManagerSet::deleteSessionStorage):
        (WebKit::StorageManagerSet::deleteSessionStorageForOrigins):
        (WebKit::StorageManagerSet::getLocalStorageOrigins):
        (WebKit::StorageManagerSet::deleteLocalStorageModifiedSince):
        (WebKit::StorageManagerSet::deleteLocalStorageForOrigins):
        (WebKit::StorageManagerSet::getLocalStorageOriginDetails):

2019-08-16  Chris Dumez  <cdumez@apple.com>

        StorageManagerSet constructor should not be public
        https://bugs.webkit.org/show_bug.cgi?id=200816

        Reviewed by Geoffrey Garen.

        StorageManagerSet constructor should not be public since it subclasses ThreadSafeRefCounted and
        has a factory method.

        * NetworkProcess/WebStorage/StorageManagerSet.h:

2019-08-16  Timothy Hatcher  <timothy@apple.com>

        REGRESSION (r248436): WKWebView doesn’t respect isOpaque setting in NIB.
        https://bugs.webkit.org/show_bug.cgi?id=200802
        rdar://problem/54357818

        Reviewed by Tim Horton.

        Tests: WKWebView.IsOpaqueDefault, WKWebView.SetOpaqueYes, WKWebView.SetOpaqueNo, WKWebView.IsOpaqueYesSubclassOverridden,
        WKWebView.IsOpaqueNoSubclassOverridden, WKWebView.IsOpaqueYesDecodedFromArchive, WKWebView.IsOpaqueNoDecodedFromArchive,
        WKWebView.IsOpaqueDrawsBackgroundYesConfiguration, WKWebView.IsOpaqueDrawsBackgroundNoConfiguration.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]): Call _setOpaqueInternal:NO instead of self.opaque = NO.
        (-[WKWebView _setOpaqueInternal:]): Added. Moved code from setOpaque:.
        (-[WKWebView setOpaque:]): Call _setOpaqueInternal:.

2019-08-15  Yusuke Suzuki  <ysuzuki@apple.com>

        [WTF] Add makeUnique<T>, which ensures T is fast-allocated, WTF_MAKE_FAST_ALLOCATED annotation part
        https://bugs.webkit.org/show_bug.cgi?id=200620

        Reviewed by Geoffrey Garen.

        * NetworkProcess/AdClickAttributionManager.h:
        * NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.h:
        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
        * NetworkProcess/Cookies/WebCookieManager.h:
        * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.h:
        * NetworkProcess/NetworkHTTPSUpgradeChecker.h:
        * NetworkProcess/NetworkProcess.cpp:
        * NetworkProcess/NetworkSession.h:
        * NetworkProcess/NetworkSocketChannel.h:
        * NetworkProcess/WebSocketTask.h:
        * NetworkProcess/cache/PrefetchCache.h:
        * NetworkProcess/cocoa/WebSocketTaskCocoa.h:
        * NetworkProcess/soup/WebKitSoupRequestInputStream.cpp:
        * NetworkProcess/soup/WebSocketTaskSoup.h:
        * NetworkProcess/webrtc/LibWebRTCSocketClient.h:
        * NetworkProcess/webrtc/NetworkMDNSRegister.cpp:
        * Platform/Module.h:
        * PluginProcess/PluginControllerProxy.h:
        * Shared/ApplePay/WebPaymentCoordinatorProxy.h:
        * Shared/Authentication/AuthenticationManager.h:
        * Shared/Cocoa/SandboxExtensionCocoa.mm:
        * Shared/Plugins/NPObjectMessageReceiver.h:
        * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
        * UIProcess/API/APIAutomationClient.h:
        * UIProcess/API/APIAutomationSessionClient.h:
        * UIProcess/API/APIContextMenuClient.h:
        * UIProcess/API/APICustomProtocolManagerClient.h:
        * UIProcess/API/APIDiagnosticLoggingClient.h:
        * UIProcess/API/APIDownloadClient.h:
        * UIProcess/API/APIFindClient.h:
        * UIProcess/API/APIFindMatchesClient.h:
        * UIProcess/API/APIFormClient.h:
        * UIProcess/API/APIFullscreenClient.h:
        * UIProcess/API/APIGeolocationProvider.h:
        * UIProcess/API/APIHistoryClient.h:
        * UIProcess/API/APIIconDatabaseClient.h:
        * UIProcess/API/APIIconLoadingClient.h:
        * UIProcess/API/APIInjectedBundleClient.h:
        * UIProcess/API/APILegacyContextHistoryClient.h:
        * UIProcess/API/APILoaderClient.h:
        * UIProcess/API/APINavigationClient.h:
        * UIProcess/API/APIPolicyClient.h:
        * UIProcess/API/APIUIClient.h:
        * UIProcess/API/C/WKPage.cpp:
        (WKPageSetPageStateClient):
        * UIProcess/API/Cocoa/WKUserContentController.mm:
        * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm:
        * UIProcess/API/glib/IconDatabase.h:
        * UIProcess/API/glib/WebKitAutomationSession.cpp:
        * UIProcess/API/glib/WebKitIconLoadingClient.cpp:
        * UIProcess/API/glib/WebKitNotificationProvider.h:
        * UIProcess/API/glib/WebKitUserContentManager.cpp:
        * UIProcess/API/glib/WebKitWebContext.cpp:
        * UIProcess/API/glib/WebKitWebView.cpp:
        * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
        * UIProcess/API/gtk/WebKitWebInspector.cpp:
        * UIProcess/API/mac/WKView.mm:
        (-[WKView maybeInstallIconLoadingClient]):
        * UIProcess/API/wpe/APIViewClient.h:
        * UIProcess/API/wpe/ScrollGestureController.h:
        * UIProcess/ApplicationStateTracker.h:
        * UIProcess/Cocoa/AutomationSessionClient.h:
        * UIProcess/Cocoa/IconLoadingDelegate.h:
        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
        * UIProcess/DrawingAreaProxy.h:
        * UIProcess/HighPerformanceGraphicsUsageSampler.h:
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/PageClient.h:
        * UIProcess/PerActivityStateCPUUsageSampler.h:
        * UIProcess/RemoteLayerTree/RemoteLayerTreeScrollingPerformanceData.h:
        * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
        * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
        * UIProcess/SystemPreviewController.h:
        * UIProcess/UserMediaPermissionRequestManagerProxy.h:
        * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.h:
        * UIProcess/WebNavigationState.h:
        * UIProcess/WebPageInjectedBundleClient.h:
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebsiteData/WebsiteDataStoreClient.h:
        * UIProcess/gtk/DragAndDropHandler.h:
        * UIProcess/ios/EditableImageController.h:
        * UIProcess/ios/InputViewUpdateDeferrer.h:
        * UIProcess/ios/SmartMagnificationController.h:
        * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
        * UIProcess/mac/WKFullScreenWindowController.mm:
        * UIProcess/mac/WKTextFinderClient.mm:
        * WebProcess/ApplePay/WebPaymentCoordinator.h:
        * WebProcess/Geolocation/GeolocationPermissionRequestManager.h:
        * WebProcess/Geolocation/WebGeolocationManager.h:
        * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
        * WebProcess/InjectedBundle/API/c/mac/WKBundlePageBannerMac.mm:
        * WebProcess/InjectedBundle/API/glib/DOM/DOMObjectCache.cpp:
        * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
        * WebProcess/MediaCache/WebMediaKeyStorageManager.h:
        * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
        * WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
        * WebProcess/Network/webrtc/LibWebRTCResolver.h:
        * WebProcess/Notifications/WebNotificationManager.h:
        * WebProcess/Plugins/Netscape/NetscapePlugin.h:
        * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.h:
        * WebProcess/Plugins/PluginController.h:
        * WebProcess/Storage/WebSWOriginTable.h:
        * WebProcess/WebCoreSupport/WebAlternativeTextClient.h:
        * WebProcess/WebCoreSupport/WebChromeClient.h:
        * WebProcess/WebCoreSupport/WebContextMenuClient.h:
        * WebProcess/WebCoreSupport/WebDragClient.h:
        * WebProcess/WebCoreSupport/WebEditorClient.h:
        * WebProcess/WebCoreSupport/WebGeolocationClient.h:
        * WebProcess/WebCoreSupport/WebInspectorClient.h:
        * WebProcess/WebCoreSupport/WebMessagePortChannelProvider.h:
        * WebProcess/WebCoreSupport/WebNotificationClient.h:
        * WebProcess/WebCoreSupport/WebPlugInClient.h:
        * WebProcess/WebCoreSupport/WebProgressTrackerClient.h:
        * WebProcess/WebCoreSupport/WebSpeechSynthesisClient.h:
        * WebProcess/WebCoreSupport/WebUserMediaClient.h:
        * WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.h:
        * WebProcess/WebPage/FindController.h:
        * WebProcess/WebPage/ViewGestureGeometryCollector.h:
        * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
        * WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h:
        * WebProcess/WebProcess.h:
        * WebProcess/cocoa/UserMediaCaptureManager.h:

2019-08-15  Brent Fulgham  <bfulgham@apple.com>

        [FTW] Enable CoreFoundation use if building for Apple target
        https://bugs.webkit.org/show_bug.cgi?id=200799

        Reviewed by Alex Christensen.

        Fix the build and remove an unused method.

        * PlatformFTW.cmake:
        * Shared/ShareableBitmap.h:
        * Shared/win/ShareableBitmapDirect2D.cpp:
        (WebKit::ShareableBitmap::createDirect2DSurface):
        (WebKit::ShareableBitmap::releaseSurfaceData): Deleted.

2019-08-15  Sihui Liu  <sihui_liu@apple.com>

        Some improvements on web storage
        https://bugs.webkit.org/show_bug.cgi?id=200373

        Reviewed by Geoffrey Garen.

        Fix some issues in web storage architecture. For example, sessionStorageNameSpace for web page is prepared and 
        destroyed in the network process when the page comes and goes, even though the page may not use sessionStorage 
        at all. The messages about page state sent from web process to network process can be waste.

        Here are some general ideas of this patch:
        1. Network process owns the web storage, and web process keeps a small local copy (based on session and 
        origins that are visited). There is a virtual connection from the local copy in the web process to the original
        copy in the network process. The connection is created by web process when some page asks for web storage.
        2. If connection is lost because network process is gone, storage in memory will be lost. The local copy in web
        processs will be discarded.
        3. (SessionID, StorageNamespaceID, SecurityOrigin) is used to identify a storage area. If session is changed in
        web process (like enabling private browsing in layout test now), a re-connection with different sessionID would 
        suffice to load another copy of storage.
        4. localStorage in ephemeral session has the same behavior as localStorage instead of sessionStorage, which
        means different pages in the same ephemeral session share the same localStorage.

        Also, this patch introduces StorageManagerSet to network process. It handles web storage stuff, including
        receiving storage messages from web process, on one background thread. Previously each session has its own
        StorageManager and each StorageManager has its own WorkQueue.

        * CMakeLists.txt:
        * DerivedSources-input.xcfilelist:
        * DerivedSources-output.xcfilelist:
        * DerivedSources.make:

        * NetworkProcess/NetworkConnectionToWebProcess.cpp: remove message handlers that are no longer needed. Network
        process no longer needs to know page states from web process.
        (WebKit::NetworkConnectionToWebProcess::didClose):
        (WebKit::NetworkConnectionToWebProcess::webPageWasAdded): Deleted.
        (WebKit::NetworkConnectionToWebProcess::webPageWasRemoved): Deleted.
        (WebKit::NetworkConnectionToWebProcess::webProcessSessionChanged): Deleted.
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:

        * NetworkProcess/NetworkProcess.cpp: NetworkProcess uses StorageManagerSet instead of StorageManager from 
        different sessions to deal with web storage.
        (WebKit::NetworkProcess::NetworkProcess):
        (WebKit::NetworkProcess::initializeNetworkProcess):
        (WebKit::NetworkProcess::createNetworkConnectionToWebProcess): StorageManagerSet starts handling 
        StorageManagerSet messages from the new connection.
        (WebKit::NetworkProcess::addWebsiteDataStore):
        (WebKit::NetworkProcess::destroySession):
        (WebKit::NetworkProcess::hasLocalStorage):
        (WebKit::NetworkProcess::fetchWebsiteData):
        (WebKit::NetworkProcess::deleteWebsiteData):
        (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
        (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
        (WebKit::NetworkProcess::actualPrepareToSuspend):
        (WebKit::NetworkProcess::resume):
        (WebKit::NetworkProcess::syncLocalStorage):
        (WebKit::NetworkProcess::clearLegacyPrivateBrowsingLocalStorage): added for clearing in-memory ephemeral
        localStorage.
        (WebKit::NetworkProcess::getLocalStorageOriginDetails):
        (WebKit::NetworkProcess::connectionToWebProcessClosed):
        (WebKit::NetworkProcess::webPageWasAdded): Deleted.
        (WebKit::NetworkProcess::webPageWasRemoved): Deleted.
        (WebKit::NetworkProcess::webProcessWasDisconnected): Deleted.
        (WebKit::NetworkProcess::webProcessSessionChanged): Deleted.
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:

        * NetworkProcess/NetworkSession.cpp: StorageManager is moved out of NetworkSession. It is now managed by 
        StorageManagerSet.
        (WebKit::NetworkSession::NetworkSession):
        (WebKit::NetworkSession::~NetworkSession):
        * NetworkProcess/NetworkSession.h:
        (WebKit::NetworkSession::storageManager): Deleted.

        * NetworkProcess/NetworkSessionCreationParameters.cpp: creation parameters of StorageManager is moved out of
        NetworkSessionCreationParameters.
        (WebKit::NetworkSessionCreationParameters::privateSessionParameters):
        (WebKit::NetworkSessionCreationParameters::encode const):
        (WebKit::NetworkSessionCreationParameters::decode):
        * NetworkProcess/NetworkSessionCreationParameters.h:

        * NetworkProcess/WebStorage/LocalStorageDatabase.cpp:
        (WebKit::LocalStorageDatabase::updateDatabase): remove an assertion that is no longer true as we can force an
        update with syncLocalStorage now.
        * NetworkProcess/WebStorage/LocalStorageDatabase.h: make updateDatabase public for syncLocalStorage.

        * NetworkProcess/WebStorage/LocalStorageDatabaseTracker.cpp: LocalStorageDatabaseTracker is created on the
        background thread now, so it does not hold WorkQueue to do the file operation.
        (WebKit::LocalStorageDatabaseTracker::create):
        (WebKit::LocalStorageDatabaseTracker::LocalStorageDatabaseTracker):
        (WebKit::LocalStorageDatabaseTracker::~LocalStorageDatabaseTracker):
        * NetworkProcess/WebStorage/LocalStorageDatabaseTracker.h:
        * NetworkProcess/WebStorage/LocalStorageNamespace.cpp:
        (WebKit::LocalStorageNamespace::getOrCreateStorageArea):
        (WebKit::LocalStorageNamespace::cloneTo): Deleted.
        * NetworkProcess/WebStorage/LocalStorageNamespace.h:
        * NetworkProcess/WebStorage/SessionStorageNamespace.cpp:
        (WebKit::SessionStorageNamespace::getOrCreateStorageArea):
        (WebKit::SessionStorageNamespace::addAllowedConnection): Deleted.
        (WebKit::SessionStorageNamespace::removeAllowedConnection): Deleted.
        * NetworkProcess/WebStorage/SessionStorageNamespace.h:
        (WebKit::SessionStorageNamespace::allowedConnections const): Deleted.

        * NetworkProcess/WebStorage/StorageArea.cpp:
        (WebKit::generateStorageAreaIdentifier): each StorageArea has an identifier. StorageAreaMap in web process uses
        this identifier to indicate which StorageArea it is connecting to.
        (WebKit::StorageArea::StorageArea):
        (WebKit::StorageArea::~StorageArea): StorageArea may still have listeners because StorageArea should be 
        destroyed by requests from UI process, and listeners are connections to web processses.
        (WebKit::StorageArea::addListener): load localStorageDatabase in advance if there is some connection to this 
        LocalStorage area.
        (WebKit::StorageArea::removeListener):
        (WebKit::StorageArea::hasListener const):
        (WebKit::StorageArea::clear):
        (WebKit::StorageArea::openDatabaseAndImportItemsIfNeeded const):
        (WebKit::StorageArea::dispatchEvents const):
        (WebKit::StorageArea::syncToDatabase):
        (WebKit::StorageArea::setItems): Deleted. Stop syncing from web process to network process after network process
        is relaunched.
        * NetworkProcess/WebStorage/StorageArea.h:
        (WebKit::StorageArea::identifier):
        (WebKit::StorageArea::setWorkQueue):

        * NetworkProcess/WebStorage/StorageManager.cpp: StorageManager should be accessed by only background thread now.
        (WebKit::StorageManager::StorageManager):
        (WebKit::StorageManager::~StorageManager):
        (WebKit::StorageManager::createSessionStorageNamespace):
        (WebKit::StorageManager::destroySessionStorageNamespace): this is not used now but keep it for future 
        improvement to remove in-memory sessionStorage in network process if we know some web page is gone forever.
        (WebKit::StorageManager::cloneSessionStorageNamespace): previously each page had its own ephemeral 
        localStorageNamespace and now all pages in the same session share one localStorage, so we don't need to clone
        localStorageNamespace.
        (WebKit::StorageManager::getSessionStorageOrigins):
        (WebKit::StorageManager::deleteSessionStorageOrigins):
        (WebKit::StorageManager::deleteSessionStorageEntriesForOrigins):
        (WebKit::StorageManager::getLocalStorageOrigins):
        (WebKit::StorageManager::getLocalStorageOriginDetails):
        (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
        (WebKit::StorageManager::deleteLocalStorageEntriesForOrigins):
        (WebKit::StorageManager::createLocalStorageArea):
        (WebKit::StorageManager::createTransientLocalStorageArea):
        (WebKit::StorageManager::createSessionStorageArea):
        (WebKit::StorageManager::getOrCreateLocalStorageNamespace):
        (WebKit::StorageManager::getOrCreateTransientLocalStorageNamespace):
        (WebKit::StorageManager::getOrCreateSessionStorageNamespace):
        (WebKit::StorageManager::clearStorageNamespaces):
        (WebKit::StorageManager::addAllowedSessionStorageNamespaceConnection): Deleted.
        (WebKit::StorageManager::removeAllowedSessionStorageNamespaceConnection): Deleted.
        (WebKit::StorageManager::processDidCloseConnection): Deleted.
        (WebKit::StorageManager::deleteLocalStorageEntriesForOrigin): Deleted.
        (WebKit::StorageManager::createLocalStorageMap): Deleted.
        (WebKit::StorageManager::createTransientLocalStorageMap): Deleted.
        (WebKit::StorageManager::createSessionStorageMap): Deleted.
        (WebKit::StorageManager::destroyStorageMap): Deleted.
        (WebKit::StorageManager::prewarm): Deleted.
        (WebKit::StorageManager::getValues): Deleted.
        (WebKit::StorageManager::setItem): Deleted.
        (WebKit::StorageManager::setItems): Deleted.
        (WebKit::StorageManager::removeItem): Deleted.
        (WebKit::StorageManager::clear): Deleted.
        (WebKit::StorageManager::waitUntilTasksFinished): Deleted.
        (WebKit::StorageManager::suspend): Deleted.
        (WebKit::StorageManager::resume): Deleted.
        (WebKit::StorageManager::findStorageArea const): Deleted.
        * NetworkProcess/WebStorage/StorageManager.h:
        (WebKit::StorageManager::workQueue const): Deleted.
        (): Deleted.

        * NetworkProcess/WebStorage/StorageManager.messages.in: Removed. Moved to StorageManagerSet.messages.in.

        * NetworkProcess/WebStorage/StorageManagerSet.cpp: Added.
        (WebKit::StorageManagerSet::create):
        (WebKit::StorageManagerSet::StorageManagerSet):
        (WebKit::StorageManagerSet::~StorageManagerSet):
        (WebKit::StorageManagerSet::add):
        (WebKit::StorageManagerSet::remove):
        (WebKit::StorageManagerSet::contains):
        (WebKit::StorageManagerSet::addConnection):
        (WebKit::StorageManagerSet::removeConnection):
        (WebKit::StorageManagerSet::waitUntilTasksFinished):
        (WebKit::StorageManagerSet::waitUntilSyncingLocalStorageFinished):
        (WebKit::StorageManagerSet::suspend):
        (WebKit::StorageManagerSet::resume):
        (WebKit::StorageManagerSet::getSessionStorageOrigins):
        (WebKit::StorageManagerSet::deleteSessionStorage):
        (WebKit::StorageManagerSet::deleteSessionStorageForOrigins):
        (WebKit::StorageManagerSet::getLocalStorageOrigins):
        (WebKit::StorageManagerSet::deleteLocalStorageModifiedSince):
        (WebKit::StorageManagerSet::deleteLocalStorageForOrigins):
        (WebKit::StorageManagerSet::getLocalStorageOriginDetails):
        (WebKit::StorageManagerSet::connectToLocalStorageArea):
        (WebKit::StorageManagerSet::connectToTransientLocalStorageArea):
        (WebKit::StorageManagerSet::connectToSessionStorageArea):
        (WebKit::StorageManagerSet::disconnectFromStorageArea):
        (WebKit::StorageManagerSet::getValues):
        (WebKit::StorageManagerSet::setItem):
        (WebKit::StorageManagerSet::removeItem):
        (WebKit::StorageManagerSet::clear):
        (WebKit::StorageManagerSet::cloneSessionStorageNamespace):
        * NetworkProcess/WebStorage/StorageManagerSet.h: Added.
        * NetworkProcess/WebStorage/StorageManagerSet.messages.in: Added.

        * Shared/WebsiteDataStoreParameters.cpp: creation parameters of StorageManager are moved to 
        WebsiteDataStoreParameters.
        (WebKit::WebsiteDataStoreParameters::encode const):
        (WebKit::WebsiteDataStoreParameters::decode):
        (WebKit::WebsiteDataStoreParameters::privateSessionParameters):
        * Shared/WebsiteDataStoreParameters.h:
        * Sources.txt:

        * UIProcess/API/C/WKContext.cpp: add SPI for tests.
        (WKContextSyncLocalStorage):
        (WKContextClearLegacyPrivateBrowsingLocalStorage):
        * UIProcess/API/C/WKContextPrivate.h:
        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreRemoveLocalStorage):
        * UIProcess/API/C/WKWebsiteDataStoreRef.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):
        (WebKit::WebProcessPool::syncLocalStorage):
        (WebKit::WebProcessPool::clearLegacyPrivateBrowsingLocalStorage):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::parameters):
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::parameters):
        * WebKit.xcodeproj/project.pbxproj:

        * WebProcess/InjectedBundle/InjectedBundle.cpp: session change of web storage is done via 
        WebStorageNamespaceProvider instead of WebProcess now.
        (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
        * WebProcess/WebProcess.cpp: web process no longer sends messsages about page state to network process.
        (WebKit::WebProcess::createWebPage):
        (WebKit::WebProcess::removeWebPage):
        (WebKit::WebProcess::ensureNetworkProcessConnection):
        (WebKit::WebProcess::networkProcessConnectionClosed):
        (WebKit::WebProcess::storageAreaMap const):
        (WebKit::WebProcess::enablePrivateBrowsingForTesting): Deleted. This was used for changing session via 
        WebProcess.
        * WebProcess/WebProcess.h:
        * WebProcess/WebStorage/StorageAreaImpl.cpp:
        (WebKit::StorageAreaImpl::StorageAreaImpl):
        (WebKit::StorageAreaImpl::length):
        (WebKit::StorageAreaImpl::key):
        (WebKit::StorageAreaImpl::item):
        (WebKit::StorageAreaImpl::setItem):
        (WebKit::StorageAreaImpl::removeItem):
        (WebKit::StorageAreaImpl::clear):
        (WebKit::StorageAreaImpl::contains):
        (WebKit::StorageAreaImpl::storageType const):
        (WebKit::StorageAreaImpl::incrementAccessCount):
        (WebKit::StorageAreaImpl::decrementAccessCount):
        (WebKit::StorageAreaImpl::prewarm): Deleted.
        (WebKit::StorageAreaImpl::securityOrigin const): Deleted.

        * WebProcess/WebStorage/StorageAreaImpl.h: make StorageAreaImpl hold a weak reference to StorageAreaMap and 
        StorageNamespaceImpl hold a strong reference. In this way lifeime of localStorage StorageAreraMap stays align 
        with StorageNameSpaceProvider and Page.

        * WebProcess/WebStorage/StorageAreaMap.cpp: identifier of StorageAreaMap is the same as identifier of 
        StorageArea it connects to. If the identifier is 0, it means the StorageAreaMap is disconnected.
        (WebKit::StorageAreaMap::StorageAreaMap):
        (WebKit::StorageAreaMap::~StorageAreaMap):
        (WebKit::StorageAreaMap::setItem):
        (WebKit::StorageAreaMap::removeItem):
        (WebKit::StorageAreaMap::clear):
        (WebKit::StorageAreaMap::resetValues):
        (WebKit::StorageAreaMap::loadValuesIfNeeded):
        (WebKit::StorageAreaMap::applyChange):
        (WebKit::StorageAreaMap::dispatchStorageEvent):
        (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
        (WebKit::StorageAreaMap::dispatchLocalStorageEvent):
        (WebKit::StorageAreaMap::connect):
        (WebKit::StorageAreaMap::disconnect):
        (WebKit::generateStorageMapID): Deleted.
        (WebKit::StorageAreaMap::prewarm): Deleted.
        (WebKit::StorageAreaMap::didGetValues): Deleted. This is useless as GetValues is a synchronous operation.
        * WebProcess/WebStorage/StorageAreaMap.h:
        (): Deleted.

        * WebProcess/WebStorage/StorageAreaMap.messages.in: there are two synchronous messages, one for connection and 
        one for getting values. We may merge them into one in future improvement.
        * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
        (WebKit::StorageNamespaceImpl::createSessionStorageNamespace):
        (WebKit::StorageNamespaceImpl::createLocalStorageNamespace):
        (WebKit::StorageNamespaceImpl::createTransientLocalStorageNamespace):
        (WebKit::StorageNamespaceImpl::StorageNamespaceImpl):
        (WebKit::StorageNamespaceImpl::storageArea):
        (WebKit::StorageNamespaceImpl::copy):
        (WebKit::StorageNamespaceImpl::setSessionIDForTesting):
        (WebKit::StorageNamespaceImpl::createEphemeralLocalStorageNamespace): Deleted.
        * WebProcess/WebStorage/StorageNamespaceImpl.h:
        * WebProcess/WebStorage/WebStorageNamespaceProvider.cpp:
        (WebKit::WebStorageNamespaceProvider::createSessionStorageNamespace):
        (WebKit::WebStorageNamespaceProvider::createLocalStorageNamespace):
        (WebKit::WebStorageNamespaceProvider::createTransientLocalStorageNamespace):
        (WebKit::WebStorageNamespaceProvider::createEphemeralLocalStorageNamespace): Deleted.
        * WebProcess/WebStorage/WebStorageNamespaceProvider.h:

2019-08-15  Wenson Hsieh  <wenson_hsieh@apple.com>

        Occasional hang under -[UIKeyboardTaskQueue lockWhenReadyForMainThread] when long-pressing non-editable text
        https://bugs.webkit.org/show_bug.cgi?id=200731
        <rdar://problem/54315371>

        Reviewed by Tim Horton.

        When handling a single tap in non-editable content, keyboards logic in UIKit may attempt to wait for all
        pending tasks in UIKeyboardTaskQueue to finish executing (e.g. by calling -waitUntilAllTasksAreFinished]). If
        the task queue has a pending task at this moment - for example, a text selection update that is waiting for a
        response from the web process - this will result in a permanent deadlock, since the main thread will be blocked,
        and therefore cannot receive any IPC communication from the web process.

        One way to trigger this is to activate both the loupe gesture and non-editable text tap gesture simultaneously,
        by tapping in a non-editable part of the web page, while an ongoing loupe gesture is driving selection updates
        (see the layout test for more details).

        To avoid getting into this scenario, prevent the text tap gesture recognizer from firing in a few edge cases
        that could lead to hangs under keyboard code in UIKit. See comments below.

        Test: editing/selection/ios/tap-during-loupe-gesture.html

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):

        Don't allow the text tap gesture recognizer to fire if the user is actively modifying the text selection using
        the loupe gesture, or if there's other pending selection change updates that are pending responses from the web
        content process.

        (-[WKContentView selectTextWithGranularity:atPoint:completionHandler:]):
        (-[WKContentView updateSelectionWithExtentPoint:withBoundary:completionHandler:]):

        Increment and decrement _suppressNonEditableSingleTapTextInteractionCount while handling these selection
        updates.

2019-08-15  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r248440.
        https://bugs.webkit.org/show_bug.cgi?id=200772

        Introduced regressions related to loading of local files.
        (Requested by perarne on #webkit).

        Reverted changeset:

        "[Mac] Use the PID of the WebContent process when issuing
        local file read sandbox extensions"
        https://bugs.webkit.org/show_bug.cgi?id=200543
        https://trac.webkit.org/changeset/248440

2019-08-15  Alex Christensen  <achristensen@webkit.org>

        WKUIDelegate's webView:contextMenuDidEndForElement: should be called when context menus end
        https://bugs.webkit.org/show_bug.cgi?id=200750
        <rdar://problem/54232261> and <rdar://problem/52355829>

        Reviewed by Tim Horton.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView contextMenuInteraction:willEndForConfiguration:animator:]):

2019-08-14  Brian Burg  <bburg@apple.com>

        Web Automation: mouse buttons are not correctly printed in SimulatedInputDispatcher log spew
        https://bugs.webkit.org/show_bug.cgi?id=200729

        Reviewed by Devin Rousso.

        This was printing out gibberish because it was trying to decode a WebMouseEvent button
        as an Automation protocol button. The logging was less useful because of it.

        To fix this, push usage of Automation protocol-based MouseButton type alias all the way
        to the platform-specific methods. The mouse buttons are the same for WebMouseEvent::Button
        and the Automation protocol type, except the automation type has an auto-generated toString.

        * UIProcess/Automation/SimulatedInputDispatcher.h:
        * UIProcess/Automation/SimulatedInputDispatcher.cpp:
        (WebKit::SimulatedInputDispatcher::transitionInputSourceToState):
        (WebKit::SimulatedInputDispatcher::run):
        Fix types.

        * UIProcess/Automation/WebAutomationSession.h:
        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::simulateMouseInteraction):
        (WebKit::WebAutomationSession::performMouseInteraction):
        (WebKit::WebAutomationSession::performInteractionSequence):
        (WebKit::protocolMouseButtonToWebMouseEventButton): Deleted.
        Fix types.

        * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
        (WebKit::automationMouseButtonToPlatformMouseButton):
        (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
        * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
        (WebKit::mouseButtonToGdkButton):
        (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
        * UIProcess/Automation/wpe/WebAutomationSessionWPE.cpp:
        (WebKit::mouseButtonToWPEButton):
        (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
        Move translation between MouseButton and native button values to platform methods.

2019-08-15  Simon Fraser  <simon.fraser@apple.com>

        Use ObjectIdentifier<FrameIdentifierType> for frameIDs
        https://bugs.webkit.org/show_bug.cgi?id=199986

        Reviewed by Ryosuke Niwa.

        Use the strongly-typed FrameIdentifier instead of uint64_t as frame identifiers everywhere.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        (WebKit::ResourceLoadStatisticsDatabaseStore::hasStorageAccess):
        (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccess):
        (WebKit::ResourceLoadStatisticsDatabaseStore::grantStorageAccess):
        (WebKit::ResourceLoadStatisticsDatabaseStore::grantStorageAccessInternal):
        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
        (WebKit::ResourceLoadStatisticsMemoryStore::hasStorageAccess):
        (WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccess):
        (WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccess):
        (WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccessInternal):
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
        (WebKit::WebResourceLoadStatisticsStore::hasStorageAccessForFrame):
        (WebKit::WebResourceLoadStatisticsStore::callHasStorageAccessForFrameHandler):
        (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
        (WebKit::WebResourceLoadStatisticsStore::grantStorageAccess):
        (WebKit::WebResourceLoadStatisticsStore::callGrantStorageAccessHandler):
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
        * NetworkProcess/NetworkCORSPreflightChecker.h:
        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
        (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
        (WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue):
        (WebKit::NetworkConnectionToWebProcess::getRawCookies):
        (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForFrame):
        (WebKit::NetworkConnectionToWebProcess::hasStorageAccess):
        (WebKit::NetworkConnectionToWebProcess::requestStorageAccess):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::NetworkLoadChecker):
        * NetworkProcess/NetworkLoadChecker.h:
        * NetworkProcess/NetworkLoadParameters.h:
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::start):
        (WebKit::NetworkResourceLoader::retrieveCacheEntry):
        (WebKit::NetworkResourceLoader::startNetworkLoad):
        (WebKit::NetworkResourceLoader::convertToDownload):
        (WebKit::NetworkResourceLoader::abort):
        (WebKit::NetworkResourceLoader::didReceiveResponse):
        (WebKit::NetworkResourceLoader::didReceiveBuffer):
        (WebKit::NetworkResourceLoader::didFinishLoading):
        (WebKit::NetworkResourceLoader::didFailLoading):
        (WebKit::NetworkResourceLoader::continueWillSendRequest):
        (WebKit::escapeIDForJSON):
        (WebKit::logBlockedCookieInformation):
        (WebKit::logCookieInformationInternal):
        (WebKit::NetworkResourceLoader::logCookieInformation):
        * NetworkProcess/NetworkResourceLoader.h:
        * NetworkProcess/cache/NetworkCache.h:
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
        (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
        * Scripts/webkit/messages.py:
        * Shared/API/APIFrameHandle.cpp:
        (API::FrameHandle::create):
        (API::FrameHandle::createAutoconverting):
        (API::FrameHandle::FrameHandle):
        (API::FrameHandle::decode):
        * Shared/API/APIFrameHandle.h:
        (API::FrameHandle::frameID const):
        * Shared/API/Cocoa/_WKFrameHandle.mm:
        (-[_WKFrameHandle hash]):
        (-[_WKFrameHandle _frameID]):
        (-[_WKFrameHandle initWithCoder:]):
        (-[_WKFrameHandle encodeWithCoder:]):
        * Shared/Authentication/AuthenticationManager.cpp:
        (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
        * Shared/Authentication/AuthenticationManager.h:
        * Shared/FrameInfoData.h:
        * UIProcess/API/C/WKFrameHandleRef.cpp:
        (WKFrameHandleGetFrameID):
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _printOperationWithPrintInfo:forFrame:]):
        (-[WKWebView _canChangeFrameLayout:]):
        * UIProcess/API/Cocoa/_WKInspector.mm:
        (-[_WKInspector showMainResourceForFrame:]):
        * UIProcess/Automation/SimulatedInputDispatcher.cpp:
        (WebKit::SimulatedInputDispatcher::run):
        * UIProcess/Automation/SimulatedInputDispatcher.h:
        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::webFrameIDForHandle):
        (WebKit::WebAutomationSession::handleForWebFrameID):
        (WebKit::WebAutomationSession::switchToBrowsingContext):
        (WebKit::WebAutomationSession::waitForNavigationToComplete):
        (WebKit::findPageForFrameID):
        (WebKit::WebAutomationSession::respondToPendingFrameNavigationCallbacksWithTimeout):
        (WebKit::WebAutomationSession::evaluateJavaScriptFunction):
        (WebKit::WebAutomationSession::resolveChildFrameHandle):
        (WebKit::WebAutomationSession::resolveParentFrameHandle):
        (WebKit::WebAutomationSession::computeElementLayout):
        (WebKit::WebAutomationSession::selectOptionElement):
        (WebKit::WebAutomationSession::getAllCookies):
        (WebKit::WebAutomationSession::deleteSingleCookie):
        (WebKit::WebAutomationSession::viewportInViewCenterPointOfElement):
        (WebKit::WebAutomationSession::takeScreenshot):
        * UIProcess/Automation/WebAutomationSession.h:
        * UIProcess/Cocoa/UIDelegate.mm:
        (WebKit::UIDelegate::UIClient::checkUserMediaPermissionForOrigin):
        * UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.mm:
        (-[WKReloadFrameErrorRecoveryAttempter attemptRecovery]):
        * UIProcess/Cocoa/WebPageProxyCocoa.mm:
        (WebKit::WebPageProxy::contentFilterDidBlockLoadForFrame):
        (WebKit::WebPageProxy::contentFilterDidBlockLoadForFrameShared):
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
        (WebKit::NetworkProcessProxy::requestStorageAccessConfirm):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/Network/NetworkProcessProxy.messages.in:
        * UIProcess/ProvisionalPageProxy.cpp:
        (WebKit::ProvisionalPageProxy::validateInput):
        (WebKit::ProvisionalPageProxy::didCreateMainFrame):
        (WebKit::ProvisionalPageProxy::didPerformClientRedirect):
        (WebKit::ProvisionalPageProxy::didStartProvisionalLoadForFrame):
        (WebKit::ProvisionalPageProxy::didFailProvisionalLoadForFrame):
        (WebKit::ProvisionalPageProxy::didCommitLoadForFrame):
        (WebKit::ProvisionalPageProxy::didNavigateWithNavigationData):
        (WebKit::ProvisionalPageProxy::didChangeProvisionalURLForFrame):
        (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionAsync):
        (WebKit::ProvisionalPageProxy::decidePolicyForResponse):
        (WebKit::ProvisionalPageProxy::didPerformServerRedirect):
        (WebKit::ProvisionalPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
        (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionSync):
        (WebKit::ProvisionalPageProxy::contentFilterDidBlockLoadForFrame):
        * UIProcess/ProvisionalPageProxy.h:
        * UIProcess/ServiceWorkerProcessProxy.cpp:
        (WebKit::ServiceWorkerProcessProxy::didReceiveAuthenticationChallenge):
        * UIProcess/ServiceWorkerProcessProxy.h:
        * UIProcess/SuspendedPageProxy.cpp:
        (WebKit::SuspendedPageProxy::SuspendedPageProxy):
        * UIProcess/SuspendedPageProxy.h:
        * UIProcess/UserMediaPermissionCheckProxy.cpp:
        (WebKit::UserMediaPermissionCheckProxy::UserMediaPermissionCheckProxy):
        * UIProcess/UserMediaPermissionCheckProxy.h:
        (WebKit::UserMediaPermissionCheckProxy::create):
        (WebKit::UserMediaPermissionCheckProxy::frameID const):
        * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
        (WebKit::UserMediaPermissionRequestManagerProxy::resetAccess):
        (WebKit::UserMediaPermissionRequestManagerProxy::searchForGrantedRequest const):
        (WebKit::UserMediaPermissionRequestManagerProxy::wasRequestDenied):
        (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
        (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo):
        (WebKit::UserMediaPermissionRequestManagerProxy::wasGrantedVideoOrAudioAccess):
        (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
        * UIProcess/UserMediaPermissionRequestManagerProxy.h:
        * UIProcess/UserMediaPermissionRequestProxy.cpp:
        (WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy):
        * UIProcess/UserMediaPermissionRequestProxy.h:
        (WebKit::UserMediaPermissionRequestProxy::create):
        (WebKit::UserMediaPermissionRequestProxy::mainFrameID const):
        (WebKit::UserMediaPermissionRequestProxy::frameID const):
        * UIProcess/WebFrameProxy.cpp:
        (WebKit::WebFrameProxy::WebFrameProxy):
        * UIProcess/WebFrameProxy.h:
        (WebKit::WebFrameProxy::create):
        (WebKit::WebFrameProxy::frameID const):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::suspendCurrentPageIfPossible):
        (WebKit::WebPageProxy::commitProvisionalPage):
        (WebKit::WebPageProxy::runJavaScriptInFrame):
        (WebKit::WebPageProxy::didCreateMainFrame):
        (WebKit::WebPageProxy::didCreateSubframe):
        (WebKit::WebPageProxy::didCreateWindow):
        (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
        (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
        (WebKit::WebPageProxy::didExplicitOpenForFrame):
        (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
        (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrameShared):
        (WebKit::WebPageProxy::willPerformClientRedirectForFrame):
        (WebKit::WebPageProxy::didCancelClientRedirectForFrame):
        (WebKit::WebPageProxy::didChangeProvisionalURLForFrame):
        (WebKit::WebPageProxy::didChangeProvisionalURLForFrameShared):
        (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
        (WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared):
        (WebKit::WebPageProxy::didCommitLoadForFrame):
        (WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
        (WebKit::WebPageProxy::didFinishLoadForFrame):
        (WebKit::WebPageProxy::didFailLoadForFrame):
        (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
        (WebKit::WebPageProxy::didChangeMainDocument):
        (WebKit::WebPageProxy::didReceiveTitleForFrame):
        (WebKit::WebPageProxy::didFirstLayoutForFrame):
        (WebKit::WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame):
        (WebKit::WebPageProxy::didDisplayInsecureContentForFrame):
        (WebKit::WebPageProxy::didRunInsecureContentForFrame):
        (WebKit::WebPageProxy::didDetectXSSForFrame):
        (WebKit::WebPageProxy::frameDidBecomeFrameSet):
        (WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
        (WebKit::WebPageProxy::decidePolicyForNavigationActionAsyncShared):
        (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
        (WebKit::WebPageProxy::decidePolicyForNavigationActionSyncShared):
        (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
        (WebKit::WebPageProxy::decidePolicyForResponse):
        (WebKit::WebPageProxy::decidePolicyForResponseShared):
        (WebKit::WebPageProxy::unableToImplementPolicy):
        (WebKit::WebPageProxy::willSubmitForm):
        (WebKit::WebPageProxy::didNavigateWithNavigationData):
        (WebKit::WebPageProxy::didNavigateWithNavigationDataShared):
        (WebKit::WebPageProxy::didPerformClientRedirect):
        (WebKit::WebPageProxy::didPerformClientRedirectShared):
        (WebKit::WebPageProxy::didPerformServerRedirect):
        (WebKit::WebPageProxy::didPerformServerRedirectShared):
        (WebKit::WebPageProxy::didUpdateHistoryTitle):
        (WebKit::WebPageProxy::runJavaScriptAlert):
        (WebKit::WebPageProxy::runJavaScriptConfirm):
        (WebKit::WebPageProxy::runJavaScriptPrompt):
        (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel):
        (WebKit::WebPageProxy::runOpenPanel):
        (WebKit::WebPageProxy::printFrame):
        (WebKit::WebPageProxy::focusedFrameChanged):
        (WebKit::WebPageProxy::frameSetLargestFrameChanged):
        (WebKit::WebPageProxy::didReceiveAuthenticationChallengeProxy):
        (WebKit::WebPageProxy::exceededDatabaseQuota):
        (WebKit::WebPageProxy::requestStorageSpace):
        (WebKit::WebPageProxy::makeStorageSpaceRequest):
        (WebKit::WebPageProxy::requestGeolocationPermissionForFrame):
        (WebKit::WebPageProxy::requestUserMediaPermissionForFrame):
        (WebKit::WebPageProxy::enumerateMediaDevicesForFrame):
        (WebKit::WebPageProxy::shouldAllowDeviceOrientationAndMotionAccess):
        (WebKit::WebPageProxy::requestStorageAccessConfirm):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::webFrame const):
        (WebKit::WebProcessProxy::canCreateFrame const):
        (WebKit::WebProcessProxy::frameCreated):
        (WebKit::WebProcessProxy::didDestroyFrame):
        * UIProcess/WebProcessProxy.h:
        * UIProcess/WebProcessProxy.messages.in:
        * UIProcess/ios/WKContentView.mm:
        (-[WKContentView _wk_pageCountForPrintFormatter:]):
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::computePagesForPrintingAndDrawToPDF):
        * WebProcess/Automation/WebAutomationSessionProxy.cpp:
        (WebKit::evaluateJavaScriptCallback):
        (WebKit::WebAutomationSessionProxy::didClearWindowObjectForFrame):
        (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction):
        (WebKit::WebAutomationSessionProxy::didEvaluateJavaScriptFunction):
        (WebKit::WebAutomationSessionProxy::resolveChildFrameWithOrdinal):
        (WebKit::WebAutomationSessionProxy::resolveChildFrameWithNodeHandle):
        (WebKit::WebAutomationSessionProxy::resolveChildFrameWithName):
        (WebKit::WebAutomationSessionProxy::resolveParentFrame):
        (WebKit::WebAutomationSessionProxy::focusFrame):
        (WebKit::WebAutomationSessionProxy::computeElementLayout):
        (WebKit::WebAutomationSessionProxy::selectOptionElement):
        (WebKit::WebAutomationSessionProxy::takeScreenshot):
        (WebKit::WebAutomationSessionProxy::getCookiesForFrame):
        (WebKit::WebAutomationSessionProxy::deleteCookie):
        * WebProcess/Automation/WebAutomationSessionProxy.h:
        * WebProcess/Automation/WebAutomationSessionProxy.messages.in:
        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
        (+[WKWebProcessPlugInFrame lookUpFrameFromHandle:]):
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::scheduleLoad):
        (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
        (WebKit::WebLoaderStrategy::loadResourceSynchronously):
        * WebProcess/Network/WebResourceLoader.cpp:
        (WebKit::WebResourceLoader::willSendRequest):
        (WebKit::WebResourceLoader::didReceiveResponse):
        (WebKit::WebResourceLoader::didReceiveData):
        (WebKit::WebResourceLoader::didFinishResourceLoad):
        (WebKit::WebResourceLoader::didFailResourceLoad):
        (WebKit::WebResourceLoader::didBlockAuthenticationChallenge):
        (WebKit::WebResourceLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied):
        (WebKit::WebResourceLoader::didReceiveResource):
        * WebProcess/Network/WebResourceLoader.h:
        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        (WebKit::WebSWContextManagerConnection::installServiceWorker):
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::focusedFrameChanged):
        (WebKit::WebChromeClient::contentsSizeChanged const):
        (WebKit::WebChromeClient::hasStorageAccess):
        (WebKit::WebChromeClient::requestStorageAccess):
        * WebProcess/WebCoreSupport/WebChromeClient.h:
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::frameID const):
        (WebKit::WebFrameLoaderClient::dispatchDidFailProvisionalLoad):
        (WebKit::WebFrameLoaderClient::dispatchDidFailLoad):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
        * WebProcess/WebPage/WebCookieJar.cpp:
        (WebKit::WebCookieJar::cookies const):
        (WebKit::WebCookieJar::setCookies):
        (WebKit::WebCookieJar::cookieRequestHeaderFieldValue const):
        (WebKit::WebCookieJar::getRawCookies const):
        * WebProcess/WebPage/WebCookieJar.h:
        * WebProcess/WebPage/WebFrame.cpp:
        (WebKit::WebFrame::WebFrame):
        (WebKit::generateFrameID): Deleted.
        * WebProcess/WebPage/WebFrame.h:
        (WebKit::WebFrame::frameID const):
        * WebProcess/WebPage/WebInspector.cpp:
        (WebKit::WebInspector::showMainResourceForFrame):
        * WebProcess/WebPage/WebInspector.h:
        * WebProcess/WebPage/WebInspector.messages.in:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::loadURLInFrame):
        (WebKit::WebPage::loadDataInFrame):
        (WebKit::WebPage::stopLoadingFrame):
        (WebKit::WebPage::didReceivePolicyDecision):
        (WebKit::WebPage::continueWillSubmitForm):
        (WebKit::WebPage::runJavaScriptInFrame):
        (WebKit::WebPage::getSourceForFrame):
        (WebKit::WebPage::getMainResourceDataOfFrame):
        (WebKit::WebPage::getResourceDataFromFrame):
        (WebKit::WebPage::getWebArchiveOfFrame):
        (WebKit::WebPage::addConsoleMessage):
        (WebKit::WebPage::sendCSPViolationReport):
        (WebKit::WebPage::enqueueSecurityPolicyViolationEvent):
        (WebKit::WebPage::beginPrinting):
        (WebKit::WebPage::computePagesForPrinting):
        (WebKit::WebPage::computePagesForPrintingImpl):
        (WebKit::WebPage::drawRectToImage):
        (WebKit::WebPage::drawPagesToPDF):
        (WebKit::WebPage::drawPagesToPDFImpl):
        (WebKit::WebPage::drawPagesForPrinting):
        (WebKit::WebPage::frameBecameRemote):
        (WebKit::WebPage::hasStorageAccess):
        (WebKit::WebPage::requestStorageAccess):
        (WebKit::WebPage::shouldAllowDeviceOrientationAndMotionAccess):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::computePagesForPrintingPDFDocument):
        (WebKit::WebPage::computePagesForPrintingAndDrawToPDF):
        * WebProcess/WebPage/mac/WebPageMac.mm:
        (WebKit::WebPage::computePagesForPrintingPDFDocument):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::webFrame const):
        (WebKit::WebProcess::addWebFrame):
        (WebKit::WebProcess::removeWebFrame):
        * WebProcess/WebProcess.h:

2019-08-14  Wenson Hsieh  <wenson_hsieh@apple.com>

        Remove m_blockRectForTextSelection (along with related code)
        https://bugs.webkit.org/show_bug.cgi?id=200695

        Reviewed by Megan Gardner.

        This member variable was consulted by block selection codepaths which no longer exist.
        No change in behavior.

        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::selectTextWithGranularityAtPoint):
        (WebKit::selectionBoxForRange): Deleted.

2019-08-14  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r248526.

        Caused two IndexedDB perf tests to fail

        Reverted changeset:

        "Remove IDB-specific quota"
        https://bugs.webkit.org/show_bug.cgi?id=196545
        https://trac.webkit.org/changeset/248526

2019-08-14  Andy Estes  <aestes@apple.com>

        Fix the build when ENABLE(APPLE_PAY) is false.

        * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:

2019-08-14  Keith Rollin  <krollin@apple.com>

        Remove support for macOS < 10.13
        https://bugs.webkit.org/show_bug.cgi?id=200694
        <rdar://problem/54278851>

        Reviewed by Youenn Fablet.

        Update conditionals that reference __MAC_OS_X_VERSION_MIN_REQUIRED and
        __MAC_OS_X_VERSION_MAX_ALLOWED, assuming that they both have values >=
        101300. This means that expressions like
        "__MAC_OS_X_VERSION_MIN_REQUIRED < 101300" are always False and
        "__MAC_OS_X_VERSION_MIN_REQUIRED >= 101300" are always True.

        * NetworkProcess/Downloads/cocoa/WKDownloadProgress.mm:
        (-[WKDownloadProgress initWithDownloadTask:download:URL:sandboxExtension:]):
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
        * Shared/WebPreferencesDefaultValues.cpp:
        (WebKit::defaultCustomPasteboardDataEnabled):
        * Shared/WebPreferencesDefaultValues.h:
        * Shared/mac/AuxiliaryProcessMac.mm:
        * UIProcess/Cocoa/WebViewImpl.h:
        * UIProcess/Cocoa/WebViewImpl.mm:
        (-[WKTextTouchBarItemController itemForIdentifier:]):
        (WebKit::WebViewImpl::mediaPlaybackControlsView const):
        (WebKit::WebViewImpl::updateMediaTouchBar):
        * UIProcess/mac/WebColorPickerMac.mm:
        * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h:
        * WebProcess/Plugins/PDF/PDFPlugin.h:
        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (-[WKPDFPluginAccessibilityObject setPdfLayerController:]):
        (-[WKPDFPluginAccessibilityObject accessibilityAttributeValue:]):
        (-[WKPDFPluginAccessibilityObject ALLOW_DEPRECATED_IMPLEMENTATIONS_END]):
        (-[WKPDFPluginAccessibilityObject accessibilityFocusedUIElement]):
        (-[WKPDFPluginAccessibilityObject accessibilityAssociatedControlForAnnotation:]):
        (-[WKPDFPluginAccessibilityObject accessibilityHitTest:]):
        (WebKit::PDFPlugin::pdfDocumentDidLoad):
        (WebKit::PDFPlugin::handleMouseEvent):
        (WebKit::PDFPlugin::handleMouseEnterEvent):
        (WebKit::PDFPlugin::handleContextMenuEvent):
        (WebKit::PDFPlugin::pluginHandlesContentOffsetForAccessibilityHitTest const):
        (WebKit::PDFPlugin::accessibilityAssociatedPluginParentForElement const):
        (WebKit::PDFPlugin::updateCursor): Deleted.
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::initializeWebProcess):

2019-08-14  Brian Burg  <bburg@apple.com>

        REGRESSION(r245320): Web Automation: Perform Actions hangs when pointerdown happens near top of page
        https://bugs.webkit.org/show_bug.cgi?id=200728
        <rdar://problem/54260518>

        Reviewed by Devin Rousso.

        In the last major refactoring for this code, it seems that the argument to
        platformSimulateMouseInteraction was not unified to use viewport coordinates
        in all code paths. This patch fixes both callers to *not* add in topContentInset,
        and instead this is added back in when doing platform-specific event simulation.

        This has no effect on iOS since it's guarded by ENABLE(WEBDRIVER_MOUSE_INTERACTIONS),
        which is only built on macOS.

        * UIProcess/Automation/WebAutomationSession.h:
        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::performMouseInteraction):
        * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
        (WebKit::WebAutomationSession::platformSimulateMouseInteraction):

2019-08-14  Andy Estes  <aestes@apple.com>

        [Cocoa] Add some WKA extension points
        https://bugs.webkit.org/show_bug.cgi?id=200506
        <rdar://problem/51682474>

        Reviewed by Tim Horton.

        * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
        (WebKit::finishCreating):
        (WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest):
        * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
        (IPC::finishDecoding):
        (IPC::finishEncoding):
        (IPC::ArgumentCoder<ApplePaySessionPaymentRequest>::encode):
        (IPC::ArgumentCoder<ApplePaySessionPaymentRequest>::decode):
        * Shared/WebCoreArgumentCoders.h:

2019-08-14  Luming Yin  <luming_yin@apple.com>

        v3: CrashTracer: Regression : MobileSafari at UIKitCore: -[UITargetedPreview initWithView:parameters:]
        https://bugs.webkit.org/show_bug.cgi?id=200634

        Reviewed by Simon Fraser.

        Under rare race conditions, the WKContentView may no longer have an associated window. However, 
        UIContextMenuInteraction may still attempt initialize a UITargetedPreview with the orphaned 
        WKContentView. Speculative fix for crashes under such scenarios, so that we can continue without 
        a context menu configuration to prevent the UIKit exception.

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

2019-08-14  Zalan Bujtas  <zalan@apple.com>

        [ContentChangeObserver] Stop content change observation explicitly.
        https://bugs.webkit.org/show_bug.cgi?id=200689
        <rdar://problem/54274887>

        Reviewed by Simon Fraser.

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

2019-08-14  Youenn Fablet  <youenn@apple.com>

        Remove use of emptySessionID from NetworkLoadParameters
        https://bugs.webkit.org/show_bug.cgi?id=200712

        Reviewed by Alex Christensen.

        Make NetworkLoadParameters constructor take a session ID.
        Update call sites accordingly.

        * NetworkProcess/AdClickAttributionManager.cpp:
        (WebKit::AdClickAttributionManager::fireConversionRequest):
        * NetworkProcess/Downloads/DownloadManager.cpp:
        (WebKit::DownloadManager::startDownload):
        * NetworkProcess/NetworkCORSPreflightChecker.cpp:
        (WebKit::NetworkCORSPreflightChecker::startPreflight):
        * NetworkProcess/NetworkLoadParameters.h:
        (WebKit::NetworkLoadParameters::NetworkLoadParameters):
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::preconnectTo):
        * NetworkProcess/NetworkResourceLoadParameters.cpp:
        (WebKit::NetworkResourceLoadParameters::encode const):
        (WebKit::NetworkResourceLoadParameters::decode):
        * NetworkProcess/NetworkResourceLoadParameters.h:
        (WebKit::NetworkResourceLoadParameters::NetworkResourceLoadParameters):
        * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
        (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
        (WebKit::WebLoaderStrategy::loadResourceSynchronously):
        (WebKit::WebLoaderStrategy::startPingLoad):
        (WebKit::WebLoaderStrategy::preconnectTo):

2019-08-14  Youenn Fablet  <youenn@apple.com>

        Remove use of emptySessionID from WebPageCreationParameters
        https://bugs.webkit.org/show_bug.cgi?id=200708

        Reviewed by Alex Christensen.

        Make WebPageCreationParameters constructor take a SessionID.
        Update constructor call sites.

        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:
        (WebKit::WebPageCreationParameters::WebPageCreationParameters):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):

2019-08-14  Youenn Fablet  <youenn@apple.com>

        Remove API::PageConfiguration::m_sessionID
        https://bugs.webkit.org/show_bug.cgi?id=200670

        Reviewed by Alex Christensen.

        We can remove this member since it is only accessed for a debug assertion that can be removed without any harm.

        * UIProcess/API/APIPageConfiguration.cpp:
        (API::PageConfiguration::PageConfiguration):
        (API::PageConfiguration::copy const):
        (API::PageConfiguration::setWebsiteDataStore):
        * UIProcess/API/APIPageConfiguration.h:
        * UIProcess/API/glib/WebKitWebContext.cpp:
        (webkitWebContextCreatePageForWebView):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::createWebPage):

2019-08-14  Youenn Fablet  <youenn@apple.com>

        ThreadableBlobRegistry::blobSize should take a SessionID as parameter
        https://bugs.webkit.org/show_bug.cgi?id=200671

        Reviewed by Alex Christensen.

        Update WebCacheStorageConnection to implement sessionID getter.
        Update NetworkConnectionToWebProcess to get a sessionID as parameter to blobSize computation.

        * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
        (WebKit::NetworkDataTaskCurl::createCurlRequest):
        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::blobSize):
        (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * NetworkProcess/NetworkProcessPlatformStrategies.cpp:
        (WebKit::NetworkProcessPlatformStrategies::createBlobRegistry):
        * WebProcess/Cache/WebCacheStorageConnection.h:
        * WebProcess/FileAPI/BlobRegistryProxy.cpp:
        (WebKit::BlobRegistryProxy::blobSize):
        * WebProcess/FileAPI/BlobRegistryProxy.h:

2019-08-14  Youenn Fablet  <youenn@apple.com>

        Remove SessionID default constructor
        https://bugs.webkit.org/show_bug.cgi?id=200669

        Reviewed by Alex Christensen.

        Update IPC decoder to use an Optional<SessionID>.
        Update PageConfiguration to use emptySessionID instead of default constructor.

        * NetworkProcess/NetworkSessionCreationParameters.cpp:
        (WebKit::NetworkSessionCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:
        * UIProcess/API/APIPageConfiguration.cpp:
        (API::PageConfiguration::PageConfiguration):
        (API::PageConfiguration::sessionID): Deleted.
        (API::PageConfiguration::setSessionID): Deleted.

2019-08-14  Youenn Fablet  <youenn@apple.com>

        Make WebSWOriginStore::m_webSWServerConnections a WeakHashSet
        https://bugs.webkit.org/show_bug.cgi?id=200661

        Reviewed by Alex Christensen.

        * NetworkProcess/ServiceWorker/WebSWOriginStore.cpp:
        (WebKit::WebSWOriginStore::importComplete):
        (WebKit::WebSWOriginStore::registerSWServerConnection):
        (WebKit::WebSWOriginStore::unregisterSWServerConnection):
        (WebKit::WebSWOriginStore::didInvalidateSharedMemory):
        * NetworkProcess/ServiceWorker/WebSWOriginStore.h:

2019-08-14  Youenn Fablet  <youenn@apple.com>

        NetworkProcess::m_swServerConnections should use WeakPtr
        https://bugs.webkit.org/show_bug.cgi?id=200660

        Reviewed by Geoffrey Garen.

        Use WeakPtr for SWServer connections as an extra safety measure.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::postMessageToServiceWorkerClient):
        (WebKit::NetworkProcess::postMessageToServiceWorker):
        (WebKit::NetworkProcess::registerSWServerConnection):
        (WebKit::NetworkProcess::unregisterSWServerConnection):
        * NetworkProcess/NetworkProcess.h:

2019-08-14  Youenn Fablet  <youenn@apple.com>

        Move some WebRTC runtime flags from experimental to internal
        https://bugs.webkit.org/show_bug.cgi?id=200672

        Reviewed by Eric Carlson.

        * Shared/WebPreferences.yaml:

2019-08-13  Said Abou-Hallawa  <sabouhallawa@apple.com>

        shouldRespectImageOrientation should be a value in ImageOrientation
        https://bugs.webkit.org/show_bug.cgi?id=200553

        Reviewed by Simon Fraser.

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

2019-08-13  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Switch NSURLSession on top navigation to prevalent resource with user interaction
        https://bugs.webkit.org/show_bug.cgi?id=200642
        <rdar://problem/53962073>

        Reviewed by Alex Christensen.

        Since prevalent resources with user interaction get to keep their cookies and website
        data, we should use a different NSURLSessions for when they are first-party websites
        and have access to that data. This patch achieves that.

        The WebKit::NetworkDataTaskCocoa constructor now checks with the network storage session
        if the first party for this load should be isolated. The category for which this is true
        is checked in the new function
        WebCore:NetworkStorageSession::shouldBlockThirdPartyCookiesButKeepFirstPartyCookiesFor()
        which in turn is backed by a new split of m_registrableDomainsToBlockCookieFor into:
        - m_registrableDomainsToBlockAndDeleteCookiesFor
        - m_registrableDomainsToBlockButKeepCookiesFor
        ... in WebCore:NetworkStorageSession.

        Non-isolated sessions are now picked up through the convenience function
        WebKit::NetworkSessionCocoa::session() whereas isolated sessions are created lazily and
        picked up through WebKit::NetworkSessionCocoa::isolatedSession().

        The number of isolated NSURLSessions in memory is capped to 10. When the cap is hit,
        the session that's been unused the longest is aged out.

        The C API changes are test infrastructure.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        (WebKit::ResourceLoadStatisticsDatabaseStore::clear):
        (WebKit::ResourceLoadStatisticsDatabaseStore::domainsToBlockAndDeleteCookiesFor const):
        (WebKit::ResourceLoadStatisticsDatabaseStore::domainsToBlockButKeepCookiesFor const):
        (WebKit::ResourceLoadStatisticsDatabaseStore::updateCookieBlocking):
        (WebKit::ResourceLoadStatisticsDatabaseStore::domainsToBlock const): Deleted.
        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
        (WebKit::ResourceLoadStatisticsMemoryStore::clear):
        (WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlocking):
        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
        (WebKit::ResourceLoadStatisticsStore::updateCookieBlockingForDomains):
        (WebKit::ResourceLoadStatisticsStore::debugLogDomainsInBatches):
        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::callUpdatePrevalentDomainsToBlockCookiesForHandler):
        (WebKit::WebResourceLoadStatisticsStore::scheduleCookieBlockingUpdateForDomains): Deleted.
        (WebKit::WebResourceLoadStatisticsStore::scheduleClearBlockingStateForDomains): Deleted.
            Dead code.
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
        (WebKit::RegistrableDomainsToBlockCookiesFor::isolatedCopy const):
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::updatePrevalentDomainsToBlockCookiesFor):
        (WebKit::NetworkProcess::scheduleClearInMemoryAndPersistent):
        (WebKit::NetworkProcess::hasIsolatedSession const):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * NetworkProcess/NetworkSession.h:
        (WebKit::NetworkSession::shouldIsolateSessionsForPrevalentTopFrames const):
        (WebKit::NetworkSession::hasIsolatedSession const):
        (WebKit::NetworkSession::clearIsolatedSessions):
        * NetworkProcess/NetworkSessionCreationParameters.cpp:
        (WebKit::NetworkSessionCreationParameters::encode const):
        (WebKit::NetworkSessionCreationParameters::decode):
        * NetworkProcess/NetworkSessionCreationParameters.h:
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
        * NetworkProcess/cocoa/NetworkSessionCocoa.h:
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
        (WebKit::NetworkSessionCocoa::session):
        (WebKit::NetworkSessionCocoa::isolatedSession):
        (WebKit::NetworkSessionCocoa::hasIsolatedSession const):
        (WebKit::NetworkSessionCocoa::clearIsolatedSessions):
        (WebKit::NetworkSessionCocoa::invalidateAndCancel):
        (WebKit::NetworkSessionCocoa::clearCredentials):
        * Shared/WebPreferences.yaml:
        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreStatisticsHasIsolatedSession):
        * UIProcess/API/C/WKWebsiteDataStoreRef.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::hasIsolatedSession):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::parameters):
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::hasLocalStorageForTesting const):
        (WebKit::WebsiteDataStore::hasIsolatedSessionForTesting const):
        * UIProcess/WebsiteData/WebsiteDataStore.h:

2019-08-13  Chris Dumez  <cdumez@apple.com>

        Fix potential thread safety issue under WebResourceLoadStatisticsStore::hasHadUserInteraction()
        https://bugs.webkit.org/show_bug.cgi?id=200688

        Reviewed by Alex Christensen.

        Fix potential thread safety issue under WebResourceLoadStatisticsStore::hasHadUserInteraction().
        It passes a RegistrableDomain to another thread without isolated copying it.

        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):

2019-08-13  Chris Dumez  <cdumez@apple.com>

        Fix potential thread safety issue under StorageManager::getSessionStorageOrigins()
        https://bugs.webkit.org/show_bug.cgi?id=200684

        Reviewed by Geoffrey Garen.

        Fix potential thread safety issue under StorageManager::getSessionStorageOrigins(). The origins are being
        passed from the background queue to the main thread without isolated copy.

        * NetworkProcess/WebStorage/StorageManager.cpp:
        (WebKit::StorageManager::getSessionStorageOrigins):

2019-08-12  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthn] Make CtapHidAuthenticator/U2fHidAuthenticator to CtapAuthenticator/U2fAuthenticator
        https://bugs.webkit.org/show_bug.cgi?id=191527
        <rdar://problem/54237146>

        Reviewed by Chris Dumez.

        This patch makes an ABC CtapDriver, which services as an abstract interface for CtapAuthenticator/U2fAuthenticator to talk to
        the actual object that implement the specific CTAP protocol that mananges communications over different transports, for example,
        CtapHidDriver, such that CtapAuthenticator/U2fAuthenticator can be shared across different transports.

        This patch also renames CtapHidAuthenticator/U2fHidAuthenticator to CtapAuthenticator/U2fAuthenticator correspondingly.

        * Sources.txt:
        * UIProcess/WebAuthentication/Cocoa/HidService.mm:
        (WebKit::HidService::continueAddDeviceAfterGetInfo):
        * UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp: Renamed from Source/WebKit/UIProcess/WebAuthentication/fido/CtapHidAuthenticator.cpp.
        (WebKit::CtapAuthenticator::CtapAuthenticator):
        (WebKit::CtapAuthenticator::makeCredential):
        (WebKit::CtapAuthenticator::continueMakeCredentialAfterResponseReceived const):
        (WebKit::CtapAuthenticator::getAssertion):
        (WebKit::CtapAuthenticator::continueGetAssertionAfterResponseReceived):
        (WebKit::CtapAuthenticator::tryDowngrade):
        * UIProcess/WebAuthentication/fido/CtapAuthenticator.h: Copied from Source/WebKit/UIProcess/WebAuthentication/fido/CtapHidAuthenticator.h.
        * UIProcess/WebAuthentication/fido/CtapDriver.h: Renamed from Source/WebKit/UIProcess/WebAuthentication/fido/CtapHidAuthenticator.h.
        * UIProcess/WebAuthentication/fido/CtapHidDriver.h:
        (WebKit::CtapHidDriver::setProtocol):
        * UIProcess/WebAuthentication/fido/U2fAuthenticator.cpp: Renamed from Source/WebKit/UIProcess/WebAuthentication/fido/U2fHidAuthenticator.cpp.
        (WebKit::U2fAuthenticator::U2fAuthenticator):
        (WebKit::U2fAuthenticator::makeCredential):
        (WebKit::U2fAuthenticator::checkExcludeList):
        (WebKit::U2fAuthenticator::issueRegisterCommand):
        (WebKit::U2fAuthenticator::getAssertion):
        (WebKit::U2fAuthenticator::issueSignCommand):
        (WebKit::U2fAuthenticator::issueNewCommand):
        (WebKit::U2fAuthenticator::issueCommand):
        (WebKit::U2fAuthenticator::responseReceived):
        (WebKit::U2fAuthenticator::continueRegisterCommandAfterResponseReceived):
        (WebKit::U2fAuthenticator::continueCheckOnlyCommandAfterResponseReceived):
        (WebKit::U2fAuthenticator::continueBogusCommandAfterResponseReceived):
        (WebKit::U2fAuthenticator::continueSignCommandAfterResponseReceived):
        * UIProcess/WebAuthentication/fido/U2fAuthenticator.h: Renamed from Source/WebKit/UIProcess/WebAuthentication/fido/U2fHidAuthenticator.h.
        * WebKit.xcodeproj/project.pbxproj:

2019-08-13  Chris Dumez  <cdumez@apple.com>

        Crash under IPC::Connection::markCurrentlyDispatchedMessageAsInvalid()
        https://bugs.webkit.org/show_bug.cgi?id=200674
        <rdar://problem/50692748>

        Reviewed by Geoff Garen.

        When the client terminates a provisional process (e.g. via the [WKWebView _killWebContentProcessAndResetState]
        SPI), the WebProcessProxy would notify its associated WebPageProxy objects that it had terminated but would fail
        to notify its associated ProvisionalPageProxy objects. As a result, those objects would not get destroyed and
        would still think that they were in the middle of a provisional load the next time a load started. This inconsistent
        state would lead to crashes such as the one in the radar.

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

2019-08-13  Youenn Fablet  <youenn@apple.com>

        Blob registries should be keyed by session IDs
        https://bugs.webkit.org/show_bug.cgi?id=200567
        <rdar://problem/54120212>

        Reviewed by Alex Christensen.

        Move blob registry to NetworkSession so that it is partitioned by session ID.
        In case session ID is not given through IPC, use the connection as key to get the network session.
        This is used for blobSize.

        * NetworkProcess/Downloads/DownloadManager.cpp:
        (WebKit::DownloadManager::startDownload):
        * NetworkProcess/Downloads/DownloadManager.h:
        * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
        * NetworkProcess/FileAPI/NetworkBlobRegistry.h: Removed.
        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::didClose):
        (WebKit::NetworkConnectionToWebProcess::resolveBlobReferences):
        (WebKit::NetworkConnectionToWebProcess::registerFileBlobURL):
        (WebKit::NetworkConnectionToWebProcess::registerBlobURL):
        (WebKit::NetworkConnectionToWebProcess::registerBlobURLFromURL):
        (WebKit::NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked):
        (WebKit::NetworkConnectionToWebProcess::registerBlobURLForSlice):
        (WebKit::NetworkConnectionToWebProcess::unregisterBlobURL):
        (WebKit::NetworkConnectionToWebProcess::blobSize):
        (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
        (WebKit::NetworkConnectionToWebProcess::filesInBlob):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::blobRegistry):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcessPlatformStrategies.cpp:
        (WebKit::NetworkProcessPlatformStrategies::createBlobRegistry):
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::startNetworkLoad):
        * NetworkProcess/NetworkSession.h:
        (WebKit::NetworkSession::blobRegistry):
        * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
        (WebKit::NetworkDataTaskSoup::createRequest):
        * NetworkProcess/soup/NetworkSessionSoup.cpp:
        (WebKit::NetworkSessionSoup::createWebSocketTask):
        * Sources.txt:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/FileAPI/BlobRegistryProxy.cpp:
        (WebKit::BlobRegistryProxy::registerFileBlobURL):
        (WebKit::BlobRegistryProxy::registerBlobURL):
        (WebKit::BlobRegistryProxy::registerBlobURLOptionallyFileBacked):
        (WebKit::BlobRegistryProxy::unregisterBlobURL):
        (WebKit::BlobRegistryProxy::registerBlobURLForSlice):
        (WebKit::BlobRegistryProxy::writeBlobsToTemporaryFiles):
        * WebProcess/FileAPI/BlobRegistryProxy.h:
        * WebProcess/Network/NetworkProcessConnection.cpp:
        (WebKit::NetworkProcessConnection::writeBlobsToTemporaryFiles):
        * WebProcess/Network/NetworkProcessConnection.h:

2019-08-13  Youenn Fablet  <youenn@apple.com>

        User Agent and SessionID should be given to NetworkRTCProvider to set up the correct proxy information
        https://bugs.webkit.org/show_bug.cgi?id=200583

        Reviewed by Eric Carlson.

        Pass session id and user agent whenever creating a TCP client socket.
        Use this information to get the proxy information from NetworkSession and pass it to libwebrtc socket creation.

        * NetworkProcess/cocoa/NetworkSessionCocoa.h:
        * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
        (WebKit::NetworkRTCProvider::proxyInfoFromSession):
        (WebKit::NetworkRTCProvider::createClientTCPSocket):
        * NetworkProcess/webrtc/NetworkRTCProvider.h:
        * NetworkProcess/webrtc/NetworkRTCProvider.messages.in:
        * WebKit.xcodeproj/project.pbxproj:
        * NetworkProcess/webrtc/NetworkRTCProvider.mm: Added.
        (WebKit::NetworkRTCProvider::proxyInfoFromSession):
        * WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
        (WebKit::LibWebRTCProvider::createPeerConnection):
        (WebKit::LibWebRTCProvider::createSocketFactory):
        * WebProcess/Network/webrtc/LibWebRTCProvider.h:
        * WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp:
        (WebKit::LibWebRTCSocketFactory::createServerTcpSocket):
        (WebKit::LibWebRTCSocketFactory::createUdpSocket):
        (WebKit::LibWebRTCSocketFactory::createClientTcpSocket):
        (WebKit::LibWebRTCSocketFactory::createAsyncResolver):
        * WebProcess/Network/webrtc/LibWebRTCSocketFactory.h:

2019-08-12  Chris Dumez  <cdumez@apple.com>

        Fix bad RELEASE_LOG_ERROR under ProvisionalPageProxy::ProvisionalPageProxy()
        https://bugs.webkit.org/show_bug.cgi?id=200646

        Reviewed by Alex Christensen.

        Fix bad RELEASE_LOG_ERROR under ProvisionalPageProxy::ProvisionalPageProxy(). Should be a
        simple RELEASE_LOG() as this is not an error.

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

2019-08-12  Sam Weinig  <weinig@apple.com>

        Replace multiparameter overloads of append() in StringBuilder as a first step toward standardizinging on the flexibleAppend() implementation
        https://bugs.webkit.org/show_bug.cgi?id=200614

        Reviewed by Darin Adler.

        Renames StringBuilder::append(const LChar*, unsigned), StringBuilder::append(const UChar*, unsigned) and 
        StringBuilder::append(const char*, unsigned) to StringBuilder::appendCharacters(...).
        
        Renames StringBuilder::append(const String& string, unsigned offset, unsigned length) to 
        StringBuilder::appendSubstring(...).

        * Shared/mac/AuxiliaryProcessMac.mm:
        (WebKit::setAndSerializeSandboxParameters):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::didReceiveInvalidMessage):
        Update for renames.

2019-08-12  Dean Jackson  <dino@apple.com>

        Contextual menu Hide and Show Link Previews should not have a symbol
        https://bugs.webkit.org/show_bug.cgi?id=200645
        <rdar://problem/54129647>

        Reviewed by Wenson Hsieh.

        Don't use an image on the UIMenuItem.

        * UIProcess/API/Cocoa/_WKElementAction.mm:
        (+[_WKElementAction imageForElementActionType:]): Return nil for Show/Hide Link Previews.

2019-08-12  Chris Dumez  <cdumez@apple.com>

        Unreviewed, add missing WTF::initializeMainThread() call to fix some crashes on the bots after r248533.

        * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
        (WebKit::XPCServiceMain):

2019-08-12  Megan Gardner  <megan_gardner@apple.com>

        Fix Crash in Mail Search
        https://bugs.webkit.org/show_bug.cgi?id=200589
        <rdar://problem/53666720>

        Reviewed by Tim Horton.

        If we search in Mail backwards first, for AppKit reasons 
        we get a -1 for the index of the found item.
        Do not try and insert data in this case.

        * UIProcess/mac/WKTextFinderClient.mm:

2019-08-12  Adrian Perez de Castro  <aperez@igalia.com>

        [WPE][GTK] Fix building without unified sources
        https://bugs.webkit.org/show_bug.cgi?id=200641

        Reviewed by Žan Doberšek.

        * UIProcess/gtk/WebDataListSuggestionsDropdownGtk.cpp: Add missing inclusions for headers
        WebCore/GtkUtilities.h (for convertWidgetPointToScreenPoint), WebCore/IntPoint.h, and
        WebPageProxy.h (the two latter to avoid usage of undefined types).
        (WebKit::WebDataListSuggestionsDropdownGtk::show): Add namespace prefix to use
        WebCore::IntPoint.

2019-08-12  Sihui Liu  <sihui_liu@apple.com>

        Clear m_sessionStorageNamespaces on the background thread
        https://bugs.webkit.org/show_bug.cgi?id=200631
        <rdar://problem/54149638>

        Reviewed by Chris Dumez.

        Network process receives messages about web page state from web process and destroys sessionStorageNamespace if 
        needed. It also receives messages about session state from UI process and destroys StorageManager, which owns 
        SessionStorageNamespaces, if needed. Because of the race in receiving the messages from different processes, 
        network process may decide to destroy StorageManager before destroying all SessionStorageNamespaces, and 
        SessionStorageNamespaces are destroyed with StorageManager on the main thread.

        * NetworkProcess/WebStorage/StorageManager.cpp:
        (WebKit::StorageManager::waitUntilTasksFinished):

2019-08-12  Sihui Liu  <sihui_liu@apple.com>

        Remove an assertion in ~StorageArea()
        https://bugs.webkit.org/show_bug.cgi?id=200630
        <rdar://problem/54097722>

        Reviewed by Chris Dumez.

        In r247370, we clear the LocalStorageNamespace before the destructor of LocalStorageNamespace is invoked, to 
        make sure StorageArea gets destroyed on the background thread. 
        StorageArea can get destroyed before LocalStorageNamespace, so the assertion in ~StorageArea() is not true any 
        more.

        * NetworkProcess/WebStorage/StorageArea.cpp:
        (WebKit::StorageArea::~StorageArea):

2019-08-12  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iPadOS] Web pages sometimes load at half width in Safari
        https://bugs.webkit.org/show_bug.cgi?id=200624
        <rdar://problem/52694257>

        Reviewed by Simon Fraser.

        Whenever WKWebView's size changes, it normally notifies the web content process by calling into WebPageProxy::
        setViewportConfigurationViewLayoutSize, which remembers this view layout size using a member variable,
        m_viewportConfigurationViewLayoutSize. Later, m_viewportConfigurationViewLayoutSize is consulted as a part of
        constructing the creation parameters used to set up a new page.

        However, during animated resize, WKWebView avoids these calls to setViewportConfigurationViewLayoutSize via the
        dynamic viewport update mode check in -[WKWebView _frameOrBoundsChanged]. Instead, the new view layout size is
        pushed to the web process by calling WebPageProxy::dynamicViewportSizeUpdate.

        Since dynamicViewportSizeUpdate doesn't update m_viewportConfigurationViewLayoutSize, the next
        WebPageCreationParameters that are created with this WebPageProxy (e.g. after a process swap, or after
        reloading, if the process was terminated) will use the size of the WKWebView prior to the most recent animated
        resize.

        To fix the bug, we simply make sure that m_viewportConfigurationViewLayoutSize is updated in the dynamic
        viewport size update (i.e. animated resize) case as well.

        Test: WebKit.CreateWebPageAfterAnimatedResize

        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::dynamicViewportSizeUpdate):

2019-08-12  Chris Dumez  <cdumez@apple.com>

        Crash under NetworkResourceLoader::start()
        https://bugs.webkit.org/show_bug.cgi?id=200628

        Reviewed by Youenn Fablet.

        Make sure the NetworkResourceLoader is still alive when the lambda passed to NetworkLoadChecker::check()
        gets executed.

        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::start):
        (WebKit::NetworkResourceLoader::retrieveCacheEntry):
        * NetworkProcess/NetworkResourceLoader.h:

2019-08-12  Jonathan Bedard  <jbedard@apple.com>

        Tapping buttons in Data Detectors lookup previews doesn't work (Follow-up fix)
        https://bugs.webkit.org/show_bug.cgi?id=200579
        <rdar://problem/54056519>

        Reviewed by Megan Gardner.

        * Platform/spi/ios/UIKitSPI.h: Add _UIContextMenuStyle SPI.

2019-08-12  Chris Dumez  <cdumez@apple.com>

        Add threading assertions to RefCounted
        https://bugs.webkit.org/show_bug.cgi?id=200507

        Reviewed by Ryosuke Niwa.

        Enable new RefCounted threading assertions for WebKit2
        (UIProcess + auxiliary processes).

        * Shared/AuxiliaryProcess.cpp:
        (WebKit::AuxiliaryProcess::initialize):
        * Shared/Cocoa/WebKit2InitializeCocoa.mm:
        (WebKit::runInitializationCode):
        * Shared/WebKit2Initialize.cpp:
        (WebKit::InitializeWebKit2):

2019-08-12  Chris Dumez  <cdumez@apple.com>

        Unreviewed, rolling out r248525.

        Revert new threading assertions while I work on fixing the
        issues they exposed

        Reverted changeset:

        "Add threading assertions to RefCounted"
        https://bugs.webkit.org/show_bug.cgi?id=200507
        https://trac.webkit.org/changeset/248525

2019-08-12  Youenn Fablet  <youenn@apple.com>

        Remove IDB-specific quota
        https://bugs.webkit.org/show_bug.cgi?id=196545

        Reviewed by Alex Christensen.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::createIDBServer):
        (WebKit::NetworkProcess::addIndexedDatabaseSession):
        (WebKit::NetworkProcess::setIDBPerOriginQuota): Deleted.
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * UIProcess/API/C/WKContext.cpp:
        (WKContextSetIDBPerOriginQuota): Deleted.
        * UIProcess/API/C/WKContextPrivate.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::setIDBPerOriginQuota): Deleted.
        * UIProcess/WebProcessPool.h:

2019-08-11  Chris Dumez  <cdumez@apple.com>

        Add threading assertions to RefCounted
        https://bugs.webkit.org/show_bug.cgi?id=200507

        Reviewed by Ryosuke Niwa.

        Enable new RefCounted threading assertions for WebKit2
        (UIProcess + auxiliary processes).

        * Shared/AuxiliaryProcess.cpp:
        (WebKit::AuxiliaryProcess::initialize):
        * Shared/Cocoa/WebKit2InitializeCocoa.mm:
        (WebKit::runInitializationCode):
        * Shared/WebKit2Initialize.cpp:
        (WebKit::InitializeWebKit2):

2019-08-11  Wenson Hsieh  <wenson_hsieh@apple.com>

        WebPage and ViewportConfiguration have differing notions of viewLayoutSize
        https://bugs.webkit.org/show_bug.cgi?id=200619

        Reviewed by Tim Horton.

        The notion of a "view layout size" exists on WebPage and WebPageProxy for the purpose of specifying an intrinsic
        content size for the entire web view on macOS. However, it also exists in ViewportConfiguration (as
        viewLayoutSize) and WebPageProxy (under the name m_viewportConfigurationViewLayoutSize) for the purposes of
        specifying the minimum layout size of the page's viewport.

        This is especially confusing in WebPageProxy, which has both m_viewportConfigurationViewLayoutSize and
        m_viewLayoutSize. To remedy this, rename "*viewLayoutSize" for the purposes of specifying an intrinsic web view
        size to "*minimumSizeForAutoLayout" instead, which is consistent with the corresponding SPI property name on
        WKView.

        No change in behavior.

        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _minimumLayoutWidth]):
        (-[WKWebView _setMinimumLayoutWidth:]):
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::setMinimumSizeForAutoLayout):
        (WebKit::WebViewImpl::minimumSizeForAutoLayout const):
        (WebKit::WebViewImpl::setIntrinsicContentSize):
        * UIProcess/DrawingAreaProxy.h:
        (WebKit::DrawingAreaProxy::minimumSizeForAutoLayoutDidChange):
        (WebKit::DrawingAreaProxy::viewLayoutSizeDidChange): Deleted.
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::minimumSizeForAutoLayout const):
        (WebKit::WebPageProxy::viewLayoutSize const): Deleted.
        * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
        * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
        (WebKit::TiledCoreAnimationDrawingAreaProxy::minimumSizeForAutoLayoutDidChange):
        (WebKit::TiledCoreAnimationDrawingAreaProxy::didUpdateGeometry):
        (WebKit::TiledCoreAnimationDrawingAreaProxy::willSendUpdateGeometry):
        (WebKit::TiledCoreAnimationDrawingAreaProxy::viewLayoutSizeDidChange): Deleted.
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_textAutoSizingAdjustmentTimer):
        (WebKit::WebPage::reinitializeWebPage):
        (WebKit::WebPage::setMinimumSizeForAutoLayout):
        (WebKit::WebPage::updateIntrinsicContentSizeIfNeeded):
        (WebKit::WebPage::setViewLayoutSize): Deleted.
        * WebProcess/WebPage/WebPage.h:
        (WebKit::WebPage::minimumSizeForAutoLayout const):
        (WebKit::WebPage::viewLayoutSize const): Deleted.
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
        (WebKit::TiledCoreAnimationDrawingArea::updateGeometry):

2019-08-10  Alex Christensen  <achristensen@webkit.org>

        Disable ContentChangeObserver TouchEvent adjustment on youtube.com on iOS in mobile browsing mode
        https://bugs.webkit.org/show_bug.cgi?id=200609
        <rdar://problem/54015403>

        Reviewed by Maciej Stachowiak.

        * Shared/WebsitePoliciesData.cpp:
        (WebKit::WebsitePoliciesData::encode const):
        (WebKit::WebsitePoliciesData::decode):
        (WebKit::WebsitePoliciesData::applyToDocumentLoader):
        * Shared/WebsitePoliciesData.h:
        * UIProcess/API/APIWebsitePolicies.cpp:
        (API::WebsitePolicies::copy const):
        (API::WebsitePolicies::data):
        * UIProcess/API/APIWebsitePolicies.h:
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::effectiveContentModeAfterAdjustingPolicies):

2019-08-10  Said Abou-Hallawa  <sabouhallawa@apple.com>

        [iOS] Add a quirk for gmail.com messages on iPhone iOS13
        https://bugs.webkit.org/show_bug.cgi?id=200605

        Reviewed by Maciej Stachowiak.

        Use WebPage::platformUserAgent() to add the gmail.com quirk.

        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::effectiveContentModeAfterAdjustingPolicies):
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::platformUserAgent const):

2019-08-10  Tim Horton  <timothy_horton@apple.com>

        Remove some more unused 32-bit code
        https://bugs.webkit.org/show_bug.cgi?id=200607

        Reviewed by Alexey Proskuryakov.

        * Modules/OSX.modulemap:

2019-08-09  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS 13] Google Docs/Slides/Sheets: paste often doesn't work and sometimes produces an error
        https://bugs.webkit.org/show_bug.cgi?id=200591
        <rdar://problem/54102238>

        Reviewed by Ryosuke Niwa and Tim Horton.

        Adopts UIKit SPI to avoid incrementing the general pasteboard's change count whenever an editable element is
        focused. This is due to how, in iOS 13, UIKit temporarily writes an image to the pasteboard when showing the
        keyboard, to determine whether or not to show the Memojis in the input view.

        This causes UIPasteboard's changeCount to increment twice due to adding and then removing the image, which means
        that the changeCount sanity checks in the web process will race against the pasteboard gaining and then losing
        this temporary image.

        Instead, the new -supportsImagePaste SPI may be used to short-circuit this step, and avoid updating the
        changeCount when UIKeyboardImpl's delegate changes.

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

2019-08-09  Alex Christensen  <achristensen@webkit.org>

        Remove unused Connection::sendWithReply
        https://bugs.webkit.org/show_bug.cgi?id=200590

        Reviewed by Chris Dumez.

        This was attempted in r245151, but rolled out in r245164 because my SecItemShim code didn't work well on non-main threads.
        Chris found a better solution for SecItemShim in r248014, making this unused code.  Let's remove it.

        * Platform/IPC/Connection.cpp:
        (IPC::Connection::invalidate):
        (IPC::Connection::processIncomingSyncReply):
        (IPC::Connection::connectionDidClose):
        (IPC::Connection::sendMessageWithReply): Deleted.
        * Platform/IPC/Connection.h:
        (IPC::Connection::send):
        (IPC::Connection::sendWithReply): Deleted.

2019-08-09  Simon Fraser  <simon.fraser@apple.com>

        [iOS WK2] Remove context menu hints on navigation
        https://bugs.webkit.org/show_bug.cgi?id=200588
        rdar://problem/54061796

        Reviewed by Tim Horton.

        Make sure the context menu hint doesn't linger across navigations by hosting it in its
        own container view (shared with drag previews), and hiding that view on navigation (unparenting
        may have bad consequences). We remove the view when the animation ends.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _didCommitLoadForMainFrame]):
        (-[WKContentView containerViewForTargetedPreviews]):
        (-[WKContentView _hideContextMenu]):
        (-[WKContentView contextMenuInteraction:willEndForConfiguration:animator:]):

2019-08-09  Alex Christensen  <achristensen@webkit.org>

        Disable CSSOM View Scrolling API for IMDb iOS app
        https://bugs.webkit.org/show_bug.cgi?id=200586
        <rdar://problem/53645833>

        Reviewed by Simon Fraser.

        Change the CSSOMViewScrollingAPIEnabled default value to be off for the IMDb app's WKWebViews.
        I manually verified this is effective in those WKWebViews but no other WKWebViews and that it fixes the radar.

        * Shared/WebPreferences.yaml:
        * Shared/WebPreferencesDefaultValues.cpp:
        (WebKit::defaultCSSOMViewScrollingAPIEnabled):
        * Shared/WebPreferencesDefaultValues.h:

2019-08-09  Tim Horton  <timothy_horton@apple.com>

        Tapping buttons in Data Detectors lookup previews doesn't work
        https://bugs.webkit.org/show_bug.cgi?id=200579
        <rdar://problem/54056519>

        Reviewed by Megan Gardner.

        * Platform/spi/ios/UIKitSPI.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _contextMenuInteraction:styleForMenuWithConfiguration:]):
        If a Data Detectors context menu wants the action menu style, provide it.

        (-[WKContentView contextMenuInteraction:willPerformPreviewActionForMenuWithConfiguration:animator:]):
        If a Data Detectors context menu provides a view controller to present
        on context menu commit, present it. We present on top of the same view
        controller that is currently presenting the context menu, but modally
        instead of inside the context menu.

        If a Data Detectors context menu instead provides a URL to launch on
        context menu commit, call openURL.

        In both cases, change the commit style to pop, since we're committing
        instead of dismissing.

2019-08-08  Dean Jackson  <dino@apple.com>

        REGRESSION (52279987): Most of the WKUIDelegate contextMenu delegate methods are not being called
        https://bugs.webkit.org/show_bug.cgi?id=200557
        <rdar://problem/53717962>

        Reviewed by Wenson Hsieh.

        UIKit changed the name of delegates recently. We ignored the warning because
        it was still calling the old methods. However, it will only do so for applications
        authored by Apple, breaking 3rd parties.

        The change here is just adopting the new methods in place of the old ones.
        It does not change the API that WebKit vends (they still use the older names).

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView contextMenuInteraction:willDisplayMenuForConfiguration:animator:]):
        (-[WKContentView contextMenuInteraction:willPerformPreviewActionForMenuWithConfiguration:animator:]):
        (-[WKContentView contextMenuInteraction:willEndForConfiguration:animator:]):
        (-[WKContentView contextMenuInteractionWillPresent:]): Deleted.
        (-[WKContentView contextMenuInteraction:willCommitWithAnimator:]): Deleted.
        (-[WKContentView contextMenuInteractionDidEnd:]): Deleted.

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

        [iOS WK2] Hide previews when an inner overflow or frame scrollview scrolls
        https://bugs.webkit.org/show_bug.cgi?id=200552
        rdar://problem/54086338

        Reviewed by Wenson Hsieh.

        Give UITargetedPreview the UIScrollView that the target element is inside of,
        so it can clean up if the user starts to scroll that view.

        * Platform/spi/ios/UIKitSPI.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _createTargetedPreviewIfPossible]):

2019-08-08  Chris Dumez  <cdumez@apple.com>

        Add threading assertions to WebStorage code
        https://bugs.webkit.org/show_bug.cgi?id=200550

        Reviewed by Geoffrey Garen.

        Add threading assertions to WebStorage code for extra safety.

        * NetworkProcess/WebStorage/LocalStorageNamespace.cpp:
        (WebKit::LocalStorageNamespace::LocalStorageNamespace):
        (WebKit::LocalStorageNamespace::~LocalStorageNamespace):
        (WebKit::LocalStorageNamespace::getOrCreateStorageArea):
        (WebKit::LocalStorageNamespace::clearStorageAreasMatchingOrigin):
        (WebKit::LocalStorageNamespace::clearAllStorageAreas):
        (WebKit::LocalStorageNamespace::ephemeralOrigins const):
        (WebKit::LocalStorageNamespace::cloneTo):
        * NetworkProcess/WebStorage/SessionStorageNamespace.cpp:
        (WebKit::SessionStorageNamespace::SessionStorageNamespace):
        (WebKit::SessionStorageNamespace::~SessionStorageNamespace):
        (WebKit::SessionStorageNamespace::addAllowedConnection):
        (WebKit::SessionStorageNamespace::removeAllowedConnection):
        (WebKit::SessionStorageNamespace::getOrCreateStorageArea):
        (WebKit::SessionStorageNamespace::cloneTo):
        (WebKit::SessionStorageNamespace::origins const):
        (WebKit::SessionStorageNamespace::clearStorageAreasMatchingOrigin):
        (WebKit::SessionStorageNamespace::clearAllStorageAreas):
        * NetworkProcess/WebStorage/StorageArea.cpp:
        (WebKit::StorageArea::StorageArea):
        (WebKit::StorageArea::~StorageArea):
        (WebKit::StorageArea::addListener):
        (WebKit::StorageArea::removeListener):
        (WebKit::StorageArea::hasListener const):
        (WebKit::StorageArea::clone const):
        (WebKit::StorageArea::setItem):
        (WebKit::StorageArea::setItems):
        (WebKit::StorageArea::removeItem):
        (WebKit::StorageArea::clear):
        (WebKit::StorageArea::items const):
        (WebKit::StorageArea::openDatabaseAndImportItemsIfNeeded const):
        (WebKit::StorageArea::dispatchEvents const):
        * NetworkProcess/WebStorage/StorageManager.cpp:
        (WebKit::StorageManager::createSessionStorageNamespace):
        (WebKit::StorageManager::destroySessionStorageNamespace):
        (WebKit::StorageManager::addAllowedSessionStorageNamespaceConnection):
        (WebKit::StorageManager::removeAllowedSessionStorageNamespaceConnection):
        (WebKit::StorageManager::cloneSessionStorageNamespace):
        (WebKit::StorageManager::processDidCloseConnection):
        (WebKit::StorageManager::getSessionStorageOrigins):
        (WebKit::StorageManager::deleteSessionStorageOrigins):
        (WebKit::StorageManager::deleteSessionStorageEntriesForOrigins):
        (WebKit::StorageManager::getLocalStorageOrigins):
        (WebKit::StorageManager::getLocalStorageOriginDetails):
        (WebKit::StorageManager::deleteLocalStorageEntriesForOrigin):
        (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
        (WebKit::StorageManager::deleteLocalStorageEntriesForOrigins):
        (WebKit::StorageManager::waitUntilTasksFinished):
        (WebKit::StorageManager::suspend):
        (WebKit::StorageManager::resume):
        (WebKit::StorageManager::findStorageArea const):
        (WebKit::StorageManager::getOrCreateLocalStorageNamespace):
        (WebKit::StorageManager::getOrCreateTransientLocalStorageNamespace):
        * NetworkProcess/WebStorage/TransientLocalStorageNamespace.cpp:
        (WebKit::TransientLocalStorageNamespace::TransientLocalStorageNamespace):
        (WebKit::TransientLocalStorageNamespace::~TransientLocalStorageNamespace):
        (WebKit::TransientLocalStorageNamespace::getOrCreateStorageArea):
        (WebKit::TransientLocalStorageNamespace::origins const):
        (WebKit::TransientLocalStorageNamespace::clearStorageAreasMatchingOrigin):
        (WebKit::TransientLocalStorageNamespace::clearAllStorageAreas):

2019-08-08  Brent Fulgham  <bfulgham@apple.com>

        [FTW] Get WebKit, WebKit2, and MiniBrowser building and executing
        https://bugs.webkit.org/show_bug.cgi?id=200539
        <rdar://problem/54082550>

        Reviewed by Dean Jackson.

        * PlatformFTW.cmake: Added.
        * Shared/ShareableBitmap.h:
        * Shared/win/ShareableBitmapDirect2D.cpp: Added.
        * UIProcess/BackingStore.cpp:
        * UIProcess/BackingStore.h:
        (WebKit::BackingStore::renderTarget):
        * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp:
        * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h:
        * UIProcess/win/BackingStoreDirect2D.cpp: Added.
        * UIProcess/win/WebInspectorProxyWin.cpp:
        (WebKit::WebInspectorProxy::inspectorPageURL):
        (WebKit::WebInspectorProxy::inspectorTestPageURL):
        (WebKit::WebInspectorProxy::inspectorBaseURL):
        * UIProcess/win/WebView.cpp:
        (WebKit::WebView::paint):
        * UIProcess/win/WebView.h:
        * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
        (WebKit::DrawingAreaCoordinatedGraphics::display):
        * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h:
        * WebProcess/WebPage/win/WebInspectorUIWin.cpp:
        (WebKit::WebInspectorUI::localizedStringsURL):
        (WebKit::RemoteWebInspectorUI::localizedStringsURL):
        * WebProcess/win/WebProcessMainWin.cpp:
        (WebKit::WebProcessMainWin):

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

        [Mac] Use the PID of the WebContent process when issuing local file read sandbox extensions
        https://bugs.webkit.org/show_bug.cgi?id=200543

        Reviewed by Brent Fulgham.

        Adopt SPI to issue a process-specific sandbox extension for local file read, passing it the process
        identifier of the WebContent process.

        * Shared/Cocoa/SandboxExtensionCocoa.mm:
        (WebKit::SandboxExtensionImpl::sandboxExtensionForType):
        (WebKit::SandboxExtension::createHandleForReadByPid):
        * Shared/SandboxExtension.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):

2019-08-08  Said Abou-Hallawa  <sabouhallawa@apple.com>

        [iOS] Position image information should respect the image orientation
        https://bugs.webkit.org/show_bug.cgi?id=200487

        Reviewed by Simon Fraser.

        imagePositionInformation() should respect the image orientation when
        drawing an Image to a ShareableBitmap context.

        boundsPositionInformation() already takes care of the image orientation
        because it gets RenderImage::enclosingBoundingBox().

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

2019-08-08  Timothy Hatcher  <timothy@apple.com>

        Set WKWebView opaque based on drawsBackground in PageConfiguration.
        https://bugs.webkit.org/show_bug.cgi?id=200528

        Reviewed by Tim Horton.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]): Set self.opaque = NO when !self.opaque || !pageConfiguration->drawsBackground().
        It is almost impossible to have !self.opaque be NO at this point, since we are still inside initWithFrame:. A subclass could
        override opaque and return NO, but checking pageConfiguration's drawsBackground is a good alternative.
        * WebProcess/WebPage/WebPage.h: Remove unused m_drawsBackground member.

2019-08-08  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS 13] Taps that interrupt momentum scrolling are recognized as clicks
        https://bugs.webkit.org/show_bug.cgi?id=200516
        <rdar://problem/53889373>

        Reviewed by Tim Horton.

        After <https://trac.webkit.org/r247656>, the -tracksImmediatelyWhileDecelerating property of WKScrollView and
        WKChildScrollView is set to NO. This means that if a user interacts with the page while the scroll view is
        decelerating (e.g. after momentum scrolling), the pan gesture recognizer will not be immediately recognized.
        This gives other gesture recognizers, such as the synthetic click (single tap) gesture a chance to instead
        recognize first. In this particular bug, this causes taps on the web view that are intended to only stop
        momentum scrolling to instead activate clickable elements beneath the touch, such as links and buttons.

        To mitigate this, we add some logic to prevent the click gesture recognizer from firing in the case where the
        tap also causes the scroll view to decelerate. This heuristic is similar to the one introduced in r219310, which
        has the same purpose of hiding gestures that stop momentum scrolling from the page, and also consults
        -[UIScrollView _isInterruptingDeceleration].

        Tests:  fast/scrolling/ios/click-events-during-momentum-scroll-in-main-frame.html
                fast/scrolling/ios/click-events-during-momentum-scroll-in-overflow-after-tap-on-body.html
                fast/scrolling/ios/click-events-during-momentum-scroll-in-overflow.html

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

        Return NO in the case of the single tap gesture if the UIScrollView most recently touched by the single tap
        gesture (or one of its enclosing scroll views, up to the main WKScrollView) is being interrupted while
        decelerating.

        * UIProcess/ios/WKSyntheticTapGestureRecognizer.h:
        * UIProcess/ios/WKSyntheticTapGestureRecognizer.mm:
        (-[WKSyntheticTapGestureRecognizer reset]):
        (-[WKSyntheticTapGestureRecognizer touchesBegan:withEvent:]):

        Teach WKSyntheticTapGestureRecognizer to keep track of the last WKScrollView that was touched, for later use in
        -gestureRecognizerShouldBegin:. To do this, we keep a weak reference to the first UIScrollView we find in the
        set of touches.

        (-[WKSyntheticTapGestureRecognizer lastTouchedScrollView]):

2019-08-08  Dean Jackson  <dino@apple.com>

        Use "safari" glyph for "Show Link Previews" contextual menu
        https://bugs.webkit.org/show_bug.cgi?id=200544
        <rdar://problem/54087842>

        Reviewed by Tim Horton.

        Use the system image for the compass.

        * UIProcess/API/Cocoa/_WKElementAction.mm:
        (+[_WKElementAction imageForElementActionType:]):

2019-08-08  Chris Dumez  <cdumez@apple.com>

        Move classes declared inside StorageManager.cpp into their own headers
        https://bugs.webkit.org/show_bug.cgi?id=200527

        Reviewed by Alex Christensen.

        Move classes declared inside StorageManager.cpp into their own headers
        for clarity. StorageManager.cpp was getting really big.

        * NetworkProcess/WebStorage/LocalStorageNamespace.cpp: Added.
        (WebKit::LocalStorageNamespace::LocalStorageNamespace):
        (WebKit::LocalStorageNamespace::~LocalStorageNamespace):
        (WebKit::LocalStorageNamespace::getOrCreateStorageArea):
        (WebKit::LocalStorageNamespace::clearStorageAreasMatchingOrigin):
        (WebKit::LocalStorageNamespace::clearAllStorageAreas):
        (WebKit::LocalStorageNamespace::ephemeralOrigins const):
        (WebKit::LocalStorageNamespace::cloneTo):
        * NetworkProcess/WebStorage/LocalStorageNamespace.h: Added.
        (WebKit::LocalStorageNamespace::create):
        (WebKit::LocalStorageNamespace::storageManager const):
        * NetworkProcess/WebStorage/SessionStorageNamespace.cpp: Added.
        (WebKit::SessionStorageNamespace::SessionStorageNamespace):
        (WebKit::SessionStorageNamespace::~SessionStorageNamespace):
        (WebKit::SessionStorageNamespace::addAllowedConnection):
        (WebKit::SessionStorageNamespace::removeAllowedConnection):
        (WebKit::SessionStorageNamespace::getOrCreateStorageArea):
        (WebKit::SessionStorageNamespace::cloneTo):
        (WebKit::SessionStorageNamespace::origins const):
        (WebKit::SessionStorageNamespace::clearStorageAreasMatchingOrigin):
        (WebKit::SessionStorageNamespace::clearAllStorageAreas):
        * NetworkProcess/WebStorage/SessionStorageNamespace.h: Added.
        (WebKit::SessionStorageNamespace::create):
        (WebKit::SessionStorageNamespace::isEmpty const):
        (WebKit::SessionStorageNamespace::allowedConnections const):
        * NetworkProcess/WebStorage/StorageArea.cpp: Added.
        (WebKit::StorageArea::StorageArea):
        (WebKit::StorageArea::~StorageArea):
        (WebKit::StorageArea::addListener):
        (WebKit::StorageArea::removeListener):
        (WebKit::StorageArea::hasListener const):
        (WebKit::StorageArea::clone const):
        (WebKit::StorageArea::setItem):
        (WebKit::StorageArea::setItems):
        (WebKit::StorageArea::removeItem):
        (WebKit::StorageArea::clear):
        (WebKit::StorageArea::items const):
        (WebKit::StorageArea::openDatabaseAndImportItemsIfNeeded const):
        (WebKit::StorageArea::dispatchEvents const):
        * NetworkProcess/WebStorage/StorageArea.h: Added.
        (WebKit::StorageArea::create):
        (WebKit::StorageArea::securityOrigin const):
        (WebKit::StorageArea::isEphemeral const):
        * NetworkProcess/WebStorage/StorageManager.cpp:
        (WebKit::StorageManager::createLocalStorageMap):
        (WebKit::StorageManager::findStorageArea const):
        (WebKit::StorageManager::getOrCreateLocalStorageNamespace):
        (WebKit::StorageManager::getOrCreateTransientLocalStorageNamespace):
        * NetworkProcess/WebStorage/StorageManager.h:
        (WebKit::StorageManager::create):
        (WebKit::StorageManager::localStorageDatabaseTracker const):
        (WebKit::StorageManager::workQueue const):
        * NetworkProcess/WebStorage/TransientLocalStorageNamespace.cpp: Added.
        (WebKit::TransientLocalStorageNamespace::TransientLocalStorageNamespace):
        (WebKit::TransientLocalStorageNamespace::~TransientLocalStorageNamespace):
        (WebKit::TransientLocalStorageNamespace::getOrCreateStorageArea):
        (WebKit::TransientLocalStorageNamespace::origins const):
        (WebKit::TransientLocalStorageNamespace::clearStorageAreasMatchingOrigin):
        (WebKit::TransientLocalStorageNamespace::clearAllStorageAreas):
        * NetworkProcess/WebStorage/TransientLocalStorageNamespace.h: Added.
        (WebKit::TransientLocalStorageNamespace::create):
        * NetworkProcess/cache/NetworkCache.cpp:
        (WebKit::NetworkCache::canRequestUseSpeculativeRevalidation):
        * Sources.txt:
        * WebKit.xcodeproj/project.pbxproj:

2019-08-08  Rob Buis  <rbuis@igalia.com>

        Add runtime flag for lazy image loading
        https://bugs.webkit.org/show_bug.cgi?id=199794

        Reviewed by Darin Adler.

        Add LazyImageLoading preference.

        * Shared/WebPreferences.yaml:
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetLazyImageLoadingEnabled):
        (WKPreferencesGetLazyImageLoadingEnabled):
        * UIProcess/API/C/WKPreferencesRefPrivate.h:

2019-08-07  Chris Dumez  <cdumez@apple.com>

        Turn some ITP threading ASSERTs into RELEASE_ASSERTs
        https://bugs.webkit.org/show_bug.cgi?id=200521

        Reviewed by Ryosuke Niwa.

        Turn some ITP threading ASSERTs into RELEASE_ASSERTs to help catch more bugs.

        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
        (WebKit::ResourceLoadStatisticsMemoryStore::ResourceLoadStatisticsMemoryStore):
        (WebKit::ResourceLoadStatisticsMemoryStore::isEmpty const):
        * NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.cpp:
        (WebKit::ResourceLoadStatisticsPersistentStorage::ResourceLoadStatisticsPersistentStorage):
        (WebKit::ResourceLoadStatisticsPersistentStorage::~ResourceLoadStatisticsPersistentStorage):
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
        (WebKit::WebResourceLoadStatisticsStore::~WebResourceLoadStatisticsStore):
        (WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):

2019-08-07  Kate Cheney  <katherine_cheney@apple.com>

        Adopt non-deprecated CGColorSpace API
        https://bugs.webkit.org/show_bug.cgi?id=184358

        Reviewed by Darin Adler.

        * Shared/mac/ColorSpaceData.mm:
        (WebKit::ColorSpaceData::decode):

        We changed the deprecated CGColorSpaceCreateWithICCProfile function to 
        CGColorSpaceCreateWithICCData. 

2019-08-07  Alex Christensen  <achristensen@webkit.org>

        Remove speculative workaround for upload crash
        https://bugs.webkit.org/show_bug.cgi?id=200514

        Reviewed by Geoffrey Garen.

        This workaround didn't help anyways, and the crash has been resolved.  Let's clean up.

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (-[WKNetworkSessionDelegate URLSession:task:needNewBodyStream:]):

2019-08-07  Chris Dumez  <cdumez@apple.com>

        Regression(r247784) ResourceLoadStatisticsMemoryStore / ResourceLoadStatisticsPersistentStorage may get destroyed on the wrong thread
        https://bugs.webkit.org/show_bug.cgi?id=200517

        Reviewed by Geoffrey Garen.

        The issue is that WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore() is null checking
        m_persistentStorage and m_statisticsStore on the main thread, even though those members are initialized
        and destroyed on the background thread. As a result, if flushAndDestroyPersistentStore() is called *before*
        the background task to initialize those members has had a chance to run, then we'd return early without
        destroying those members. Later on, the background task would then initialize those data members and we
        would then destroy them on the main thread when the WebResourceLoadStatisticsStore is destroyed on the
        main thread.

        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):

2019-08-06  Dean Jackson  <dino@apple.com>

        Context menu on a universal link produces a blank preview
        https://bugs.webkit.org/show_bug.cgi?id=200485
        <rdar://problem/53699620>

        Reviewed by Tim Horton.

        If the context menu is activated on an iTunesStore URL, pass it
        on to DataDetectors, who should know how to handle it.

        Two drive-by fixes:
        - make it clear that early returns do not produce a value. Instead call the
          completion handler first, then return.
        - The new API DataDetectors case doesn't need to worry about hiding link previews
          as DataDetectors itself will handle that.

        * UIProcess/ios/WKContentViewInteraction.mm: If the URL is an iTunesStoreURL
        (as defined by CoreServices), let DataDetectors handle it.
        (-[WKContentView assignLegacyDataForContextMenuInteraction]):
        (-[WKContentView continueContextMenuInteraction:]):
        (-[WKContentView continueContextMenuInteractionWithDataDetectors:]): New method to
        use DataDetectors if possible.

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

        Add to InteractionInformationAtPosition information about whether the element is in a subscrollable region
        https://bugs.webkit.org/show_bug.cgi?id=200374
        rdar://problem/54095519

        Reviewed by Tim Horton.
        
        Add InteractionInformationAtPosition.containerScrollingNodeID and initialize it in elementPositionInformation()
        by asking the scrolling coordinator.
        
        Also add a way to get from a ScrollingNodeID to a UIScrollView to RemoteScrollingCoordinatorProxy,
        which gets the scrolling node and asks the delegate for the UIView.

        * Shared/ios/InteractionInformationAtPosition.h:
        * Shared/ios/InteractionInformationAtPosition.mm:
        (WebKit::InteractionInformationAtPosition::encode const):
        (WebKit::InteractionInformationAtPosition::decode):
        * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
        * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
        (WebKit::RemoteScrollingCoordinatorProxy::scrollViewForScrollingNodeID const):
        * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
        * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
        (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollView const):
        * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::elementPositionInformation):

2019-08-07  Priyanka Agarwal  <pagarwal999@apple.com>

        Allow clients to toggle a text input field between being viewable and having characters hidden while maintaining 
        a yellow auto-filled appearance
        https://bugs.webkit.org/show_bug.cgi?id=200037
        rdar://problem/51900961

        Reviewed by Daniel Bates.

        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h:
        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
        (-[WKWebProcessPlugInNodeHandle HTMLInputElementIsAutoFilledAndViewable]):
        Accessor function for boolean which represents if the input element is autofilled and viewable.

        (-[WKWebProcessPlugInNodeHandle setHTMLInputElementIsAutoFilledAndViewable:]):
        Setter function for boolean which represents if the input element is autofilled and viewable.

        * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
        (WKBundleNodeHandleSetHTMLInputElementAutoFilledAndViewable):
        Accessor function for boolean which represents if the input element is autofilled and viewable.

       * WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h:
        Creating function declaration for boolean setter.

        * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
        Accessor function for boolean which represents if the input element is autofilled and viewable.

        (WebKit::InjectedBundleNodeHandle::isHTMLInputElementAutoFilledAndViewable const):
        Setter function for boolean which represents if the input element is autofilled and viewable.

        (WebKit::InjectedBundleNodeHandle::setHTMLInputElementAutoFilledAndViewable):
        Setter function for boolean which represents if the input element is autofilled and viewable.

        * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
        Adding setter and getter functions for the boolean which represents if the input element is autofilled
        and viewable.

2019-08-07  Chris Dumez  <cdumez@apple.com>

        Add more threading assertions to ITP code
        https://bugs.webkit.org/show_bug.cgi?id=200505

        Reviewed by Brent Fulgham.

        Add more threading assertions to ITP code to help catch bugs and protect against future bad usage.

        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
        (WebKit::ResourceLoadStatisticsMemoryStore::isEmpty const):
        (WebKit::ResourceLoadStatisticsMemoryStore::setPersistentStorage):
        (WebKit::ResourceLoadStatisticsMemoryStore::incrementRecordsDeletedCountForDomains):
        (WebKit::ResourceLoadStatisticsMemoryStore::classifyPrevalentResources):
        (WebKit::ResourceLoadStatisticsMemoryStore::syncStorageIfNeeded):
        (WebKit::ResourceLoadStatisticsMemoryStore::syncStorageImmediately):
        (WebKit::ResourceLoadStatisticsMemoryStore::grandfatherDataForDomains):
        (WebKit::ResourceLoadStatisticsMemoryStore::ensurePrevalentResourcesForDebugMode):
        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
        (WebKit::ResourceLoadStatisticsStore::statisticsEpirationTime const):
        (WebKit::ResourceLoadStatisticsStore::mergeOperatingDates):
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::hasStorageAccessForFrame):
        (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
        (WebKit::WebResourceLoadStatisticsStore::grantStorageAccess):
        (WebKit::WebResourceLoadStatisticsStore::applicationWillTerminate):
        (WebKit::WebResourceLoadStatisticsStore::logFrameNavigation):
        (WebKit::WebResourceLoadStatisticsStore::logWebSocketLoading):
        (WebKit::WebResourceLoadStatisticsStore::logSubresourceLoading):
        (WebKit::WebResourceLoadStatisticsStore::logSubresourceRedirect):
        (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
        (WebKit::WebResourceLoadStatisticsStore::removePrevalentDomains):
        (WebKit::WebResourceLoadStatisticsStore::networkSession):
        (WebKit::WebResourceLoadStatisticsStore::invalidateAndCancel):
        (WebKit::WebResourceLoadStatisticsStore::sendDiagnosticMessageWithValue const):
        (WebKit::WebResourceLoadStatisticsStore::notifyPageStatisticsTelemetryFinished const):

2019-08-07  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r248330.

        Breaks internal builds.

        Reverted changeset:

        "Context menu on a universal link produces a blank preview"
        https://bugs.webkit.org/show_bug.cgi?id=200485
        https://trac.webkit.org/changeset/248330

2019-08-06  Ryosuke Niwa  <rniwa@webkit.org>

        [iPadOS] slides.google.com: tapping near cursor in a slide title focuses the speaker notes
        https://bugs.webkit.org/show_bug.cgi?id=200216

        Reviewed by Wenson Hsieh.

        The bug was caused by a race condition between Google slides removing inputmode="none" from the hidden
        content editable and updating the focused region upon receiving a pointerup event, which happens after
        the Google slides had already updated its page layout & coordinates based on new visual viewport with
        the software keyboard's boudning rect taken into account.

        Delay bringing up the software keyboard for a inputmode change until all touches are released.

        In the future, we could consider also delaying the software keyboard to be brought in general until
        touchend / pointerup events are dispatched but this is rather risky since that could affact random
        other websites while Google suites is the only major site to make use of inputmode="none".

        This patch also reverts r243044, which was added for Google slides, since it's no longer needed and
        interferes with this patch by adding another way to bring up the software keyboard.

        Note: Adjusting touchend / pointerup coordinates while the keyboard is being brought up doesn't work
        because the page had already updated the layout by then based on new visual viewport size.

        Test: fast/forms/ios/inputmode-change-update-keyboard-after-pointerup.html

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::handleTouchEventSynchronously): Call didReleaseAllTouchPoints when all
        touches are released.
        (WebKit::WebPageProxy::handleTouchEventAsynchronously): Ditto.
        (WebKit::WebPageProxy::handleTouchEvent): Ditto.
        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::didReleaseAllTouchPoints): Added for non-iOS platforms.
        (WebKit::WebPageProxy::m_pendingInputModeChange): Added. Used when inputmode is changed while
        there is an on-going touch interaction.
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::elementDidFocus): Clear m_pendingInputModeChange when a new element is focused.
        (WebKit::WebPageProxy::elementDidBlur): Ditto for bluring.
        (WebKit::WebPageProxy::focusedElementDidChangeInputMode): Don't bring up the software keyboard now if
        there are on-going touches by exiting early after setting m_pendingInputModeChange.
        (WebKit::WebPageProxy::didReleaseAllTouchPoints): Bring up the software keyboard if inputmode
        had changed from "none" to something else.
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::dispatchTouchEvent): Removed the code added by r243044.

2019-08-06  Fujii Hironori  <Hironori.Fujii@sony.com>

        ASSERTION FAILED: m_observers.isEmpty() if WKPageSetPageStateClient is used
        https://bugs.webkit.org/show_bug.cgi?id=200465

        Reviewed by Alex Christensen.

        PageLoadState::Observer should be removed before destructing
        WebPageProxy.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::~WebPageProxy): Call
        setPageLoadStateObserver with nullptr to remove
        PageLoadState::Observer.

2019-08-06  Chris Dumez  <cdumez@apple.com>

        Add release assertions to help catch a bug in our WebProcessCache implementation
        https://bugs.webkit.org/show_bug.cgi?id=200483

        Reviewed by Geoffrey Garen.

        Add release assertions to help catch a bug in our WebProcessCache implementation. We
        have evidence (rdar://problem/53962494) that we have processes with a page which
        starts a provisional load while the process is in the WebProcessCache. This should
        not be possible.

        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::setIsInProcessCache):
        (WebKit::WebProcessProxy::addExistingWebPage):

2019-08-06  Dean Jackson  <dino@apple.com>

        Context menu on a universal link produces a blank preview
        https://bugs.webkit.org/show_bug.cgi?id=200485
        <rdar://problem/53699620>

        Reviewed by Dean Jackson.

        If the context menu is activated on an iTunesStore URL, pass it
        on to DataDetectors, who should know how to handle it.

        Two drive-by fixes:
        - make it clear that early returns do not produce a value. Instead call the
          completion handler first, then return.
        - The new API DataDetectors case doesn't need to worry about hiding link previews
          as DataDetectors itself will handle that.

        * UIProcess/ios/WKContentViewInteraction.mm: If the URL is an iTunesStoreURL
        (as defined by CoreServices), let DataDetectors handle it.
        (-[WKContentView assignLegacyDataForContextMenuInteraction]):
        (-[WKContentView continueContextMenuInteraction:]):
        (-[WKContentView continueContextMenuInteractionWithDataDetectors:]): New method to
        use DataDetectors if possible.

2019-08-06  Chris Dumez  <cdumez@apple.com>

        Avoid unnecessary ResourceRequest copy under NetworkResourceLoader::isCrossOriginPrefetch()
        https://bugs.webkit.org/show_bug.cgi?id=200478

        Reviewed by Youenn Fablet.

        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::isCrossOriginPrefetch const):

2019-08-06  Jiewen Tan  <jiewen_tan@apple.com>

        Unreviewed, a build fix after r248319

        Use HAVE(DATA_PROTECTION_KEYCHAIN) instead of HAVE_DATA_PROTECTION_KEYCHAIN.

        * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
        (WebKit::LocalAuthenticator::makeCredential):
        (WebKit::LocalAuthenticator::continueMakeCredentialAfterUserConsented):
        (WebKit::LocalAuthenticator::continueMakeCredentialAfterAttested):
        (WebKit::LocalAuthenticator::getAssertion):
        (WebKit::LocalAuthenticator::continueGetAssertionAfterUserConsented):

2019-08-06  Jiewen Tan  <jiewen_tan@apple.com>

        Unreviewed, a build fix after r248308

        Use kSecUseDataProtectionKeychain for iOS 13 and macOS Catalina or newer.

        * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
        (WebKit::LocalAuthenticator::makeCredential):
        (WebKit::LocalAuthenticator::continueMakeCredentialAfterUserConsented):
        (WebKit::LocalAuthenticator::continueMakeCredentialAfterAttested):
        (WebKit::LocalAuthenticator::getAssertion):
        (WebKit::LocalAuthenticator::continueGetAssertionAfterUserConsented):

2019-08-06  Chris Dumez  <cdumez@apple.com>

        Unreviewed, fix internal iOS build after r248308.

        * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
        (WebKit::LocalAuthenticator::makeCredential):

2019-08-06  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthN] Enable LocalAuthenticator for macOS
        https://bugs.webkit.org/show_bug.cgi?id=182772
        <rdar://problem/43347920>

        Reviewed by Brent Fulgham.

        This patch enables LocalAuthenticator for macOS. The majority
        of this patch is to tweak macOS keychain to use the modern one.

        * Configurations/WebKit.xcconfig:
        * Platform/spi/Cocoa/DeviceIdentitySPI.h:
        * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
        (WebKit::LocalAuthenticatorInternal::toVector):
        (WebKit::LocalAuthenticator::makeCredential):
        (WebKit::LocalAuthenticator::continueMakeCredentialAfterUserConsented):
        (WebKit::LocalAuthenticator::continueMakeCredentialAfterAttested):
        (WebKit::LocalAuthenticator::getAssertion):
        (WebKit::LocalAuthenticator::continueGetAssertionAfterUserConsented):
        * UIProcess/WebAuthentication/Cocoa/LocalConnection.mm:
        (WebKit::LocalConnection::getUserConsent const):
        (WebKit::LocalConnection::getAttestation const):
        * UIProcess/WebAuthentication/Cocoa/LocalService.mm:
        (WebKit::LocalService::isAvailable):
        * UIProcess/WebAuthentication/Mock/MockLocalConnection.mm:
        (WebKit::MockLocalConnection::getAttestation const):
        * config.h:

2019-08-06  Jer Noble  <jer.noble@apple.com>

        Add test for behavior introduced in r248174
        https://bugs.webkit.org/show_bug.cgi?id=200446

        Reviewed by Eric Carlson.

        Add a new helper struct, FullscreenTouchSecheuristicParameters, and static getter,
        iosParameters(), to allow the settings used by WKFullScreenViewController to be tested
        in TestWebKitAPI. Make both of the Secheuristic classes privately exported as well.

        * UIProcess/ios/fullscreen/FullscreenTouchSecheuristic.cpp:
        (WebKit::FullscreenTouchSecheuristic::scoreOfNextTouch):
        (WebKit::FullscreenTouchSecheuristic::reset):
        (WebKit::FullscreenTouchSecheuristic::distanceScore):
        (WebKit::FullscreenTouchSecheuristic::attenuationFactor):
        * UIProcess/ios/fullscreen/FullscreenTouchSecheuristic.h:
        (WebKit::FullscreenTouchSecheuristic::setParameters):
        (WebKit::FullscreenTouchSecheuristic::requiredScore const):
        (WebKit::FullscreenTouchSecheuristic::setRampUpSpeed):
        (WebKit::FullscreenTouchSecheuristic::setRampDownSpeed):
        (WebKit::FullscreenTouchSecheuristic::setXWeight):
        (WebKit::FullscreenTouchSecheuristic::setYWeight):
        (WebKit::FullscreenTouchSecheuristic::setGamma):
        (WebKit::FullscreenTouchSecheuristic::setGammaCutoff):
        * UIProcess/ios/fullscreen/FullscreenTouchSecheuristicParameters.cpp: Copied from Source/WebKit/UIProcess/ios/fullscreen/FullscreenTouchSecheuristic.h.
        (WebKit::FullscreenTouchSecheuristicParameters::iosParameters):
        * UIProcess/ios/fullscreen/FullscreenTouchSecheuristicParameters.h: Copied from Source/WebKit/UIProcess/ios/fullscreen/FullscreenTouchSecheuristic.h.
        * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
        (-[WKFullScreenViewController initWithWebView:]):
        (-[WKFullScreenViewController _touchDetected:]):
        * WebKit.xcodeproj/project.pbxproj:

2019-08-06  Claudio Saavedra  <csaavedra@igalia.com>

        [GLIB] Fix documentation typo

        Unreviewed.

        * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:

2019-08-05  Fujii Hironori  <Hironori.Fujii@sony.com>

        [Win][MiniBrowser][WK2] Unhandled key events should be bubbled up to the parent window
        https://bugs.webkit.org/show_bug.cgi?id=200464

        Reviewed by Ross Kirsling.

        * UIProcess/API/C/WKNativeEvent.h: Define WKNativeEventPtr for WIN32.

2019-08-05  Youenn Fablet  <youenn@apple.com>

        Support RTCRtpSender.dtmf
        https://bugs.webkit.org/show_bug.cgi?id=200431

        Reviewed by Eric Carlson.

        * Shared/WebPreferences.yaml:

2019-08-05  Simon Fraser  <simon.fraser@apple.com>

        iOS 13: Overflow:hidden on body prevents PDF scroll
        https://bugs.webkit.org/show_bug.cgi?id=200435
        rdar://problem/53942888

        Reviewed by Tim Horton.

        When we navigate from an overflow:hidden HTML page to a custom view (like PDF), we need
        to make sure that the scroll view is scrollable.

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

2019-08-05  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Re-introduce latch mode for subresource cookie blocking
        https://bugs.webkit.org/show_bug.cgi?id=200395
        <rdar://problem/53869611>

        Reviewed by Darin Adler.

        Back when we had a relaxation of cookie blocking 24 hours after first-party user
        interaction, we made sure cookie blocking could be turned on and off in subresource
        redirect chains. The 24 hour window is now long gone. This patch simplifies the
        cookie blocking so that once a subresource request is denied cookies, any
        subsequent redirect of that request will also be denied cookies, regardless of the
        classification status of the domains involved. I call it latch mode.

        * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        (WebKit::NetworkDataTaskCocoa::blockCookies):
        (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
        (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
        (WebKit::NetworkDataTaskCocoa::applyCookieBlockingPolicy): Deleted.

2019-08-05  Youenn Fablet  <youenn@apple.com>

        Disable speculative loading if cache is not to be used for the load
        https://bugs.webkit.org/show_bug.cgi?id=199644

        Reviewed by Alex Christensen.

        When the page is reloaded, loads are instructed to not use the cache.
        It is therefore unneeded to do speculative revalidation.
        Allow speculative revalidation if the cache policy is either the default HTTP policy or
        if policy is to refresh all cache data.
        Covered by added test.

        * NetworkProcess/cache/NetworkCache.cpp:
        (WebKit::NetworkCache::cachePolicyValidForSpeculativeRevalidation):
        (WebKit::NetworkCache::canRequestUseSpeculativeRevalidation):

2019-08-04  Konstantin Tokarev  <annulen@yandex.ru>

        Remove unused lambda capture in MemoryPressureMonitor
        https://bugs.webkit.org/show_bug.cgi?id=200420

        Reviewed by Darin Adler.

        * UIProcess/linux/MemoryPressureMonitor.cpp:
        (WebKit::MemoryPressureMonitor::start):

2019-08-03  Konstantin Tokarev  <annulen@yandex.ru>

        Fix compilation with disabled WebGL
        https://bugs.webkit.org/show_bug.cgi?id=200421

        Reviewed by Wenson Hsieh.

        After r247452 webGLStateTracker is guarded with #if ENABLE(WEBGL)

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

2019-08-02  Keith Rollin  <krollin@apple.com>

        Consistently use Obj-C boolean literals
        https://bugs.webkit.org/show_bug.cgi?id=200405
        <rdar://problem/53880043>

        Reviewed by Simon Fraser, Joseph Pecoraro.

        There are places where we use equivalent but different expressions for
        Obj-C boolean objects. For example, we use both [NSNumber
        numberWithBool:YES] and @YES. There are places where both are used in
        the same function, such as -[WebPreferences initialize]. The boolean
        literal is in greater use and is more succinct, so standardize on
        that. Also, change @(YES/NO) to @YES/NO.

        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        (WebKit::NetworkDataTaskCocoa::applySniffingPoliciesAndBindRequestToInferfaceIfNeeded):
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
        * UIProcess/WebAuthentication/Cocoa/LocalConnection.mm:
        (WebKit::LocalConnection::getAttestation const):

2019-08-02  Sihui Liu  <sihui_liu@apple.com>

        API tests using permanent credentials should clear credentials left by previous tests
        https://bugs.webkit.org/show_bug.cgi?id=199729

        Reviewed by Alex Christensen.

        Permanent password credentials currently are shared across processes, so we don't need to clear them from 
        network process.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::clearPermanentCredentialsForProtectionSpace): Deleted.
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _clearPermanentCredentialsForProtectionSpace:]):
        (-[WKProcessPool _clearPermanentCredentialsForProtectionSpace:completionHandler:]): Deleted.
        * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::clearPermanentCredentialsForProtectionSpace):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::clearPermanentCredentialsForProtectionSpace): Deleted.
        * UIProcess/WebProcessPool.h:

2019-08-02  Devin Rousso  <drousso@apple.com>

        Web Inspector: Timelines: Develop > Start Timeline Recording doesn't work when focused on a detached inspector window
        https://bugs.webkit.org/show_bug.cgi?id=200125
        <rdar://problem/53543008>

        Reviewed by Brian Burg.

        Always show the Timelines tab in Web Inspector whenever timeline recording starts/stops.
        Notify the UIProcess whenever the timeline recording state changes.

        * WebProcess/WebPage/WebInspector.messages.in:
        * WebProcess/WebPage/WebInspector.h:
        * WebProcess/WebPage/WebInspector.cpp:
        (WebKit::WebInspector::startPageProfiling):
        (WebKit::WebInspector::stopPageProfiling):
        (WebKit::WebInspector::timelineRecordingChanged): Added.
        (WebKit::WebInspector::showTimelines): Deleted.

        * WebProcess/WebPage/WebInspectorUI.messages.in:
        * WebProcess/WebPage/WebInspectorUI.h:
        * WebProcess/WebPage/WebInspectorUI.cpp:
        (WebKit::WebInspectorUI::showTimelines): Deleted.

        * WebProcess/WebCoreSupport/WebInspectorClient.h:
        * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
        (WebKit::WebInspectorClient::timelineRecordingChanged): Added.

        * UIProcess/WebInspectorProxy.messages.in:
        * UIProcess/WebInspectorProxy.h:
        * UIProcess/WebInspectorProxy.cpp:
        (WebKit::WebInspectorProxy::togglePageProfiling):
        (WebKit::WebInspectorProxy::timelineRecordingChanged): Added.
        (WebKit::WebInspectorProxy::showTimelines): Deleted.

        * UIProcess/API/C/WKInspector.cpp:
        (WKInspectorTogglePageProfiling):

        * UIProcess/API/Cocoa/_WKInspector.h:
        * UIProcess/API/Cocoa/_WKInspector.mm:
        (-[_WKInspector showTimelines]): Deleted.

        * WebProcess/InjectedBundle/API/c/WKBundleInspector.cpp:
        (WKBundleInspectorSetPageProfilingEnabled):

2019-08-02  Jer Noble  <jer.noble@apple.com>

        [iPadOS] slides.google.com: Full Screen API warning is presented when swiping through slides
        https://bugs.webkit.org/show_bug.cgi?id=200313
        <rdar://problem/53777001>

        Reviewed by Eric Carlson.

        Only run the secheuristic scoring during UIGestureRecognizerStateEnded, rather than both
        UIGestureRecognizerStateEnded and UIGestureRecognizerStateBegan. The goal of the heuristic is
        to detect fake on-screen keyboards by detecting gestures that look like "typing". Using only
        UIGestureRecognizerStateEnded still allows us to do this (as typing will usually have identical
        geometries for both Ended and Began) without generating false-positives during swipe gestures.

        * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
        (-[WKFullScreenViewController _touchDetected:]):

2019-08-02  Wenson Hsieh  <wenson_hsieh@apple.com>

        [macOS 10.15] Image dragged from Safari does not appear in Notes
        https://bugs.webkit.org/show_bug.cgi?id=188490
        <rdar://problem/39462717>

        Reviewed by Andy Estes.

        Removes some logic that clears out the cached promised drag image in the UI process when WebKit is asked to
        provide TIFF image data. This prevents the drop destination from asking for promised image data, if anything
        else (e.g. the system) also asks the web view to provide the same data. Additionally, this logic didn't
        previously guarantee that the promised image would be cleared anyways, since it is dependent on the drop target
        actually requesting the promised image in order to perform the cleanup.

        In lieu of clearing the promised drag image when it's requested, we instead clear it out upon mainframe
        navigation, in PageClientImpl::didCommitLoadForMainFrame.

        Test: DragAndDropTests.MultiplePromisedImageDataRequests

        * UIProcess/Cocoa/WebViewImpl.h:
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::clearPromisedDragImage):
        (WebKit::WebViewImpl::pasteboardChangedOwner):
        (WebKit::WebViewImpl::provideDataForPasteboard):

        Fix the bug by not immediately clearing out the promised drag image.

        * UIProcess/mac/PageClientImplMac.mm:
        (WebKit::PageClientImpl::didCommitLoadForMainFrame):

2019-08-02  Keith Rollin  <krollin@apple.com>

        macCatalyst build fails the first attempt, requires a second build
        https://bugs.webkit.org/show_bug.cgi?id=200242
        <rdar://problem/53678481>

        macCatalyst builds fail the first time with an error like:

            Code Signing Error: The file
            "/Users/tim_cook/Build/Debug-maccatalyst/DerivedSources/WebKit2/WebContent-macCatalyst-no-sandbox.entitlements"
            could not be opened. Verify the value of the
            CODE_SIGN_ENTITLEMENTS build setting for target "WebContent" is
            correct and that the file exists on disk.

        This problem is caused by the file referenced by
        CODE_SIGN_ENTITLEMENTS changing during the build process. For
        macCatalyst builds, we start with the iOS entitlements files and then
        tweak them for macCatalyst. When this occurs during a clean build,
        Xcode sees the entitlements file being generated and complains about
        it. Restarting the build does so with the file already existing, and
        so Xcode does not complain about it.

        The approach of generating or tweaking entitlement files may have
        worked in the past, but the fact is that Xcode doesn't support it.

        We had a similar problem with macOS builds. The entitlements files
        used to be generated on the fly with scripts like
        WebKit/Scripts/process-network-sandbox-entitlements.sh. That process
        was reworked to avoid the issue with Xcode not allowing the files to
        be generated (see r241135). In short:

        o The various process-*-entitlements.sh scripts were consolidated into
          a single process-entitlements file
        o CODE_SIGN_ENTITLEMENTS, which contains the name of the entitlements
          file to use, was de-initialized so that Xcode would not try to
          access our generated entitlements file
        o CODE_SIGN_INJECT_BASE_ENTITLEMENTS (which injects some base
          entitlements) was set to NO. If it were left set to YES, Xcode would
          create its own entitlements file and use it as if it were specified
          in CODE_SIGN_ENTITLEMENTS
        o WK_LIBRARY_VALIDATION_CODE_SIGN_FLAGS was updated with an
          "--entitlements <generated_file>" option.
          WK_LIBRARY_VALIDATION_CODE_SIGN_FLAGS was then used to initialize
          OTHER_CODE_SIGN_FLAGS. By specifying the entitlements file this way,
          we avoid Xcode complaining about it.

        This approach works well for macOS, and so we now also use it to
        address the issue with macCatalyst. While we're at it, convert the
        rest of the platforms to use the same approach and also generate their
        entitlements from the process-entitlements script.

        The new process was validated by performing a build with the old
        process and the new process, and then comparing the entitlements of
        the resulting XPC services to make sure they were the same. Builds
        were performed for all platforms, and for Engineering and Production
        builds.

        Reviewed by Brent Fulgham.

        * Configurations/BaseXPCService.xcconfig:
        * Configurations/Network-iOS.entitlements: Removed.
        * Configurations/Network-macCatalyst.entitlements: Removed.
        * Configurations/NetworkService.xcconfig:
        * Configurations/PluginService.64.xcconfig:
        * Configurations/PluginService.entitlements: Removed.
        * Configurations/WebContent-iOS.entitlements: Removed.
        * Configurations/WebContent-macCatalyst.entitlements: Removed.
        * Configurations/WebContentService.Development.xcconfig:
        * Configurations/WebContentService.xcconfig:
        * Scripts/copy-webcontent-resources-to-private-headers.sh:
        * Scripts/process-entitlements.sh:
        * WebKit.xcodeproj/project.pbxproj:

2019-08-02  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Update OptionsGTK.cmake and NEWS for 2.25.4 release

        * gtk/NEWS: Add release notes for 2.25.4.

2019-08-02  Carlos Garcia Campos  <cgarcia@igalia.com>

        [SOUP] WebSockets: use SOUP_WEBSOCKET_CLOSE_NO_STATUS when closing with no status
        https://bugs.webkit.org/show_bug.cgi?id=200338

        Reviewed by Alex Christensen.

        * NetworkProcess/soup/WebSocketTaskSoup.cpp:
        (WebKit::WebSocketTask::close):

2019-08-01  Alex Christensen  <achristensen@webkit.org>

        Do not send NetworkProcessProxy::LogTestingEvent message if we are not testing
        https://bugs.webkit.org/show_bug.cgi?id=200360

        Reviewed by Tim Horton.

        Sending this message causes instantiation of the default WebsiteDataStore in the UIProcess,
        which causes more memory to be used than is needed if we are browsing without the default WebsiteDataStore.

        Covered by an API test.

        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::logTestingEvent):
        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::NetworkSession):
        * NetworkProcess/NetworkSession.h:
        (WebKit::NetworkSession::enableResourceLoadStatisticsLogTestingEvent const):
        * NetworkProcess/NetworkSessionCreationParameters.cpp:
        (WebKit::NetworkSessionCreationParameters::encode const):
        (WebKit::NetworkSessionCreationParameters::decode):
        * NetworkProcess/NetworkSessionCreationParameters.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::parameters):
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        (WebKit::WebsiteDataStore::hasStatisticsTestingCallback const):

2019-08-01  Alex Christensen  <achristensen@webkit.org>

        Move FormData zip file generation to NetworkProcess and enable it for all WebKit clients for uploading directories
        https://bugs.webkit.org/show_bug.cgi?id=200102
        <rdar://problem/53275114>

        Reviewed by Darin Adler.

        * NetworkProcess/NetworkResourceLoadParameters.cpp:
        (WebKit::NetworkResourceLoadParameters::encode const):
        * Platform/IPC/FormDataReference.h:
        (IPC::FormDataReference::encode const):
        * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
        * WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h:
        (API::InjectedBundle::PageUIClient::shouldGenerateFileForUpload): Deleted.
        (API::InjectedBundle::PageUIClient::generateFileForUpload): Deleted.
        * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
        (WebKit::InjectedBundlePageUIClient::shouldGenerateFileForUpload): Deleted.
        (WebKit::InjectedBundlePageUIClient::generateFileForUpload): Deleted.
        * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::shouldReplaceWithGeneratedFileForUpload): Deleted.
        (WebKit::WebChromeClient::generateReplacementFile): Deleted.
        * WebProcess/WebCoreSupport/WebChromeClient.h:
        * WebProcess/com.apple.WebProcess.sb.in:

2019-08-01  Tim Horton  <timothy_horton@apple.com>

        REGRESSION: HSBC Personal Banking download/print dialog is usually positioned off screen on iPad
        https://bugs.webkit.org/show_bug.cgi?id=200356
        <rdar://problem/51885199>

        Reviewed by Beth Dakin.

        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::desktopClassBrowsingRecommendedForRequest):
        Add HSBC domains to the list of sites that recommend mobile mode by default.

2019-08-01  Chris Dumez  <cdumez@apple.com>

        Crash under WebProcessProxy::didBecomeUnresponsive()
        https://bugs.webkit.org/show_bug.cgi?id=200346
        <rdar://problem/53795984>

        Reviewed by Geoffrey Garen.

        Make sure the BackgroundProcessResponsivenessTimer / ResponsivenessTimer ref their client
        while they call mayBecomeUnresponsive() / willChangeIsResponsive() / didChangeIsResponsive()
        / didBecomeUnresponsive() on their client, in case calling one of these ends up destroying
        the client.

        * UIProcess/BackgroundProcessResponsivenessTimer.cpp:
        (WebKit::BackgroundProcessResponsivenessTimer::setResponsive):
        * UIProcess/ResponsivenessTimer.cpp:
        (WebKit::ResponsivenessTimer::timerFired):
        * UIProcess/ResponsivenessTimer.h:
        * UIProcess/WebProcessProxy.h:

2019-08-01  Youenn Fablet  <youenn@apple.com>

        UserMediaPermissionRequestManagerProxy should not use audio+video denied requests to deny audio-only or video-only requests
        https://bugs.webkit.org/show_bug.cgi?id=200317

        Reviewed by Eric Carlson.

        Only match audio+video denied requests with new audio+video requests.
        That will ensure that audio can still be captured if user denied access to the camera through preferences
        and website started with a getUserMedia({audio: true, video: true}) call.
        Covered by added API test.

        * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
        (WebKit::UserMediaPermissionRequestManagerProxy::wasRequestDenied):

2019-08-01  Carlos Garcia Campos  <cgarcia@igalia.com>

        [SOUP] WebSockets: add support for extensions when using web sockets libsoup API
        https://bugs.webkit.org/show_bug.cgi?id=199943

        Reviewed by Alex Christensen.

        * NetworkProcess/NetworkSocketChannel.cpp:
        (WebKit::NetworkSocketChannel::didConnect): Add extensions parameter and pass it to the IPC message.
        * NetworkProcess/NetworkSocketChannel.h:
        * NetworkProcess/cocoa/WebSocketTaskCocoa.mm:
        (WebKit::WebSocketTask::didConnect): Pass empty extensions string.
        * NetworkProcess/soup/WebSocketTaskSoup.cpp:
        (WebKit::WebSocketTask::acceptedExtensions const): Build the accepted extensions string.
        (WebKit::WebSocketTask::didConnect): Pass accepted extensions to NetworkSocketChannel::didConnect().
        * NetworkProcess/soup/WebSocketTaskSoup.h:
        * WebProcess/Network/WebSocketChannel.cpp:
        (WebKit::WebSocketChannel::extensions): Return the extensions string received from the network process.
        (WebKit::WebSocketChannel::didConnect): Save the extensions string.
        * WebProcess/Network/WebSocketChannel.h:
        * WebProcess/Network/WebSocketChannel.messages.in:

2019-08-01  Carlos Garcia Campos  <cgarcia@igalia.com>

        [SOUP] Switch to use libsoup WebSockets API
        https://bugs.webkit.org/show_bug.cgi?id=200162

        Reviewed by Michael Catanzaro.

        Remove temporary method added for old WebSockets implementation.

        * NetworkProcess/NetworkStorageSessionProvider.h:

2019-07-31  Dean Jackson  <dino@apple.com>

        WKImagePreviewViewController not being autoreleased
        https://bugs.webkit.org/show_bug.cgi?id=200325
        <rdar://problem/53788214>

        Reviewed by Wenson Hsieh.

        Wenson noticed I wasn't autoreleasing the WKImagePreviewViewController.

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

2019-07-31  Chris Dumez  <cdumez@apple.com>

        REGRESSION (r247486?): Flaky API Test TestWebKitAPI.WKWebView.LocalStorageProcessSuspends
        https://bugs.webkit.org/show_bug.cgi?id=200086
        <rdar://problem/53501721>

        Reviewed by Alex Christensen.

        The test would first send a ProcessWillSuspendImminently IPC to the NetworkProcess and then
        run JS in the WebContent process, which would in turn send IPC to the NetworkProcess. The
        test was flaky because it expected the network process to receive the IPC from the UIProcess
        *before* the one from the WebContent process. However, there is no guarantee about ordering
        from IPC messages coming from different connections.

        To address the flakiness, this patch introduces a new ProcessWillSuspendImminentlyForTesting
        synchronous IPC and uses this instead. As a result, it is now guaranteed that the network
        process processes this IPC *before* receiving any IPC from the WebContent process that is
        the result of IPC from the UIProcess.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::processWillSuspendImminentlyForTestingSync):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _sendNetworkProcessWillSuspendImminently]):
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::sendProcessWillSuspendImminentlyForTesting):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::sendNetworkProcessWillSuspendImminentlyForTesting):
        (WebKit::WebProcessPool::sendNetworkProcessWillSuspendImminently): Deleted.
        * UIProcess/WebProcessPool.h:

2019-07-31  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS 13] Safari crashes when closing a tab with a focused element if the unified field has focus
        https://bugs.webkit.org/show_bug.cgi?id=200291
        <rdar://problem/53717946>

        Reviewed by Megan Gardner.

        Makes -requestAutocorrectionContextWithCompletionHandler: robust in the case where the web page has been closed,
        and there is no Connection object to use when waiting for a sync IPC response.

        Test: AutocorrectionTests.RequestAutocorrectionContextAfterClosingPage

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

2019-07-31  Chris Fleizach  <cfleizach@apple.com>

        AX: com.apple.WebKit.WebContent at com.apple.WebKit: -[WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]
        https://bugs.webkit.org/show_bug.cgi?id=200277
        <rdar://problem/49475009>

        Reviewed by Per Arne Vollan.

        Verify Page is available before calling into it.

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

2019-07-31  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Datalist element support for TextFieldInputType
        https://bugs.webkit.org/show_bug.cgi?id=98934

        Reviewed by Michael Catanzaro.

        Add a WebDataListSuggestionsDropdown implementation for the GTK port using a popup window with a tree view list.

        * Sources.txt:
        * SourcesGTK.txt:
        * UIProcess/API/gtk/PageClientImpl.cpp:
        (WebKit::PageClientImpl::createDataListSuggestionsDropdown):
        * UIProcess/API/gtk/PageClientImpl.h:
        * UIProcess/gtk/WebDataListSuggestionsDropdownGtk.cpp: Added.
        (WebKit::firstTimeItemSelectedCallback):
        (WebKit::WebDataListSuggestionsDropdownGtk::WebDataListSuggestionsDropdownGtk):
        (WebKit::WebDataListSuggestionsDropdownGtk::~WebDataListSuggestionsDropdownGtk):
        (WebKit::WebDataListSuggestionsDropdownGtk::treeViewRowActivatedCallback):
        (WebKit::WebDataListSuggestionsDropdownGtk::didSelectOption):
        (WebKit::WebDataListSuggestionsDropdownGtk::show):
        (WebKit::WebDataListSuggestionsDropdownGtk::handleKeydownWithIdentifier):
        (WebKit::WebDataListSuggestionsDropdownGtk::close):
        * UIProcess/gtk/WebDataListSuggestionsDropdownGtk.h: Copied from Tools/WebKitTestRunner/gtk/UIScriptControllerGtk.h.

2019-07-31  Tim Horton  <timothy_horton@apple.com>

        Remove WebKit2 Makefile guards for pre-Snow Leopard macOS
        https://bugs.webkit.org/show_bug.cgi?id=200294

        Reviewed by Dan Bernstein.

        * Makefile:
        It seems ... unlikely ... that anyone is trying to build
        trunk WebKit for Leopard or prior.

2019-07-30  Fujii Hironori  <Hironori.Fujii@sony.com>

        [WebKit] Add PageLoadState::Observer C API
        https://bugs.webkit.org/show_bug.cgi?id=199848

        Reviewed by Alex Christensen.

        There is no WebKit C API to get the timing of title changed since
        WKPageLoaderClientV0::didReceiveTitleForFrame has been removed in
        r235398. Cocoa and glib WebKit API exist.

        * PlatformWin.cmake:
        * UIProcess/API/C/WKPage.cpp:
        (WKPageSetPageStateClient):
        * UIProcess/API/C/WKPage.h: Added WKPageSetPageStateClient.
        * UIProcess/API/C/WKPageStateClient.h: Added.
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::setPageLoadStateObserver):
        * UIProcess/WebPageProxy.h:
        * WebKit.xcodeproj/project.pbxproj:

2019-07-30  Chris Dumez  <cdumez@apple.com>

        Fix non-thread safe use of WeakPtr under sendSecItemRequest()
        https://bugs.webkit.org/show_bug.cgi?id=200249

        Reviewed by Alex Christensen.

        The function was calling globalNetworkProcess() from a background thread. This is not safe because
        globalNetworkProcess() deferences a WeakPtr<NetworkProcess> internally and the NetworkProcess object
        gets destroyed on the main thread.

        * Shared/mac/SecItemShim.cpp:
        (WebKit::sendSecItemRequest):

2019-07-24  Carlos Garcia Campos  <cgarcia@igalia.com>

        [SOUP] Move SoupNetworkSession ownership from NetworkStorageSession to NetworkSession
        https://bugs.webkit.org/show_bug.cgi?id=200076

        Reviewed by Michael Catanzaro.

        NetworkStorageSession should only own the cookie jar, since it's the only thing it handles from the session.

        * NetworkProcess/Cookies/soup/WebCookieManagerSoup.cpp:
        (WebKit::WebCookieManager::setCookiePersistentStorage): Use the network session instead of the storage session
        to set the peristent cookie storage.
        * NetworkProcess/CustomProtocols/soup/LegacyCustomProtocolManagerSoup.cpp:
        (WebKit::LegacyCustomProtocolManager::registerScheme): Iterate network sessions instead of storage sessions to
        access the SoupNetworkSession.
        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::resourceLoadStatisticsUpdated): Use
        NetworkProcess::forEachNetworkSession() to iterate network sessions.
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::lowMemoryHandler): Ditto.
        (WebKit::NetworkProcess::forEachNetworkSession): Added to iterate network sessions intead of exposing the map
        that is always used to iterate the sessions.
        (WebKit::NetworkProcess::switchToNewTestingSession): Use the new NetworkStorageSession constructor API.
        (WebKit::NetworkProcess::ensureSession): Ditto.
        (WebKit::NetworkProcess::destroySession): Allow to destroy the default session for soup based ports. This is
        only called right before process exit to ensure we don't leak network resources like the cookies database.
        (WebKit::NetworkProcess::setResourceLoadStatisticsEnabled): Use NetworkProcess::forEachNetworkSession() to
        iterate network sessions.
        (WebKit::NetworkProcess::fetchWebsiteData): Ditto.
        (WebKit::NetworkProcess::deleteWebsiteDataForOrigins): Ditto.
        (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains): Ditto.
        (WebKit::NetworkProcess::registrableDomainsWithWebsiteData): Ditto.
        (WebKit::NetworkProcess::setCacheModel): Ditto.
        (WebKit::NetworkProcess::actualPrepareToSuspend): Ditto.
        (WebKit::NetworkProcess::resume): Ditto.
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkStorageSessionProvider.h:
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::clearDiskCache): Ditto.
        * NetworkProcess/ios/NetworkProcessIOS.mm:
        (WebKit::NetworkProcess::clearCacheForAllOrigins): Ditto.
        * NetworkProcess/soup/NetworkProcessMainSoup.cpp: Destroy the default session before process exists.
        * NetworkProcess/soup/NetworkProcessSoup.cpp:
        (WebKit::NetworkProcess::userPreferredLanguagesChanged): Iterate network sessions instead of storage sessions to
        access the SoupNetworkSession.
        (WebKit::NetworkProcess::platformCreateDefaultStorageSession const): Use the new NetworkStorageSession constructor API.
        (WebKit::NetworkProcess::clearDiskCache): Use NetworkProcess::forEachNetworkSession() to iterate network sessions.
        (WebKit::NetworkProcess::setNetworkProxySettings): Iterate network sessions instead of storage sessions to
        access the SoupNetworkSession.
        * NetworkProcess/soup/NetworkSessionSoup.cpp:
        (WebKit::NetworkSessionSoup::NetworkSessionSoup): Create the SoupNetworkSession and setup cookies.
        (WebKit::NetworkSessionSoup::soupSession const): Return the SoupSession of SoupNetworkSession.
        (WebKit::NetworkSessionSoup::setCookiePersistentStorage): Setup a new cookie jar.
        * NetworkProcess/soup/NetworkSessionSoup.h:

2019-07-30  Truitt Savell  <tsavell@apple.com>

        Unreviewed, rolling out r247932.

        Broke 8 API tests across all platforms.

        Reverted changeset:

        "Fix non-thread safe use of WeakPtr under
        sendSecItemRequest()"
        https://bugs.webkit.org/show_bug.cgi?id=200249
        https://trac.webkit.org/changeset/247932

2019-07-29  Wenson Hsieh  <wenson_hsieh@apple.com>

        YouTube search field shows RTL text outside its border on iPadOS
        https://bugs.webkit.org/show_bug.cgi?id=200253
        <rdar://problem/53680603>

        Reviewed by Beth Dakin.

        Limits code added in r238939 to respect the current keyboard's writing mode to only editable web views. This
        behavior was only intended for Mail, and isn't generally compatible with web content.

        While the call to -setInitialDirection is correctly gated on an web view editability check, it appears that
        other changes in iOS 13 now cause -setBaseWritingDirection:forRange: to be invoked directly from keyboards code.
        This means that -setBaseWritingDirection:forRange: should additionally be guarded with the same check.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView setBaseWritingDirection:forRange:]):

2019-07-29  Sihui Liu  <sihui_liu@apple.com>

        Try fixing crash at com.apple.WebKit.Networking: NetworkProcess::setSharedHTTPCookieStorage
        https://bugs.webkit.org/show_bug.cgi?id=200189
        <rdar://problem/41325767>

        Reviewed by Chris Dumez.

        The crash indicates that sharedCookieStorage is accessed before being set in network process. 
        sharedCookieStorage is set during the processing of InitializeNetworkProcess message, and access to 
        sharedCookieStorage is supposed to happen after that. Therefore, it is likely some message is received and 
        handled before InitializeNetworkProcess. 
 
        One possible explanation is WebKit APIs get called on different threads. Because of the race in checking and 
        setting m_networkProcess, some message is sent between network process gets launched (m_networkProcess is set) 
        and InitializeNetworkProcess message is sent. To mitigate this issue, we make sure m_networkProcess is set only
        in the main runloop and only after InitializeNetworkProcess is sent. 

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

2019-07-29  Chris Dumez  <cdumez@apple.com>

        Fix non-thread safe use of WeakPtr under sendSecItemRequest()
        https://bugs.webkit.org/show_bug.cgi?id=200249

        Reviewed by Alex Christensen.

        The function was calling globalNetworkProcess() from a background thread. This is not safe because
        globalNetworkProcess() deferences a WeakPtr<NetworkProcess> internally and the NetworkProcess object
        gets destroyed on the main thread.

        * Shared/mac/SecItemShim.cpp:
        (WebKit::sendSecItemRequest):

2019-07-29  Zalan Bujtas  <zalan@apple.com>

        [ContentChangeObserver] didFinishContentChangeObserving should include the type of content change.
        https://bugs.webkit.org/show_bug.cgi?id=200247
        <rdar://problem/53681149>

        Reviewed by Simon Fraser.

        * WebProcess/WebCoreSupport/WebChromeClient.h:
        * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
        (WebKit::WebChromeClient::didFinishContentChangeObserving):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::didFinishContentChangeObserving):

2019-07-29  Youenn Fablet  <youenn@apple.com>

        REGRESSION: WebSockets no longer work in Service Workers
        https://bugs.webkit.org/show_bug.cgi?id=199906
        <rdar://problem/53516732>

        Reviewed by Geoffrey Garen.

        Use WebSocketProvider so that network calls are done in the network process.

        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        (WebKit::WebSWContextManagerConnection::installServiceWorker):

2019-07-29  Zalan Bujtas  <zalan@apple.com>

        [ContentChangeObserver] ChromeClient::observedContentChange() name is misleading
        https://bugs.webkit.org/show_bug.cgi?id=200238
        <rdar://problem/53677038>

        Reviewed by Simon Fraser.

        * WebProcess/WebCoreSupport/WebChromeClient.h:
        * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
        (WebKit::WebChromeClient::didFinishContentChangeObserving):
        (WebKit::WebChromeClient::observedContentChange): Deleted.
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::didFinishContentChangeObserving):
        (WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver): Deleted.

2019-07-26  Ryosuke Niwa  <rniwa@webkit.org>

        ShareableBitmap::createGraphicsContext() should return nullptr when CGBitmapContextCreateWithData returns nil
        https://bugs.webkit.org/show_bug.cgi?id=200185

        Reviewed by Simon Fraser.

        We should not be creating GraphicsContext with nil CGContextRef in ShareableBitmap::createGraphicsContext()
        as such a GraphicsContext is only used for specific purposes.

        This patch adds an early return to ShareableBitmap::createGraphicsContext() when CGBitmapContextCreateWithData
        returns nil CGContextRef.

        * PluginProcess/PluginControllerProxy.cpp:
        (WebKit::PluginControllerProxy::paint):
        * Shared/API/c/cg/WKImageCG.cpp:
        (WKImageCreateFromCGImage):
        * Shared/ContextMenuContextData.cpp:
        (WebKit::ContextMenuContextData::ContextMenuContextData):
        * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
        (WebKit::RemoteLayerBackingStore::display):
        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::encodeImage):
        * Shared/cg/ShareableBitmapCG.cpp:
        (WebKit::ShareableBitmap::createGraphicsContext):
        (WebKit::ShareableBitmap::makeCGImageCopy):
        * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
        (WebKit::imageForRect):
        * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
        (WebKit::InjectedBundleRangeHandle::renderedImage):
        * WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp:
        (WebKit::InjectedBundleHitTestResult::image const):
        * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
        (WebKit::NetscapePlugin::snapshot):
        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit::PDFPlugin::snapshot):
        * WebProcess/Plugins/PluginProxy.cpp:
        (WebKit::PluginProxy::paint):
        (WebKit::PluginProxy::update):
        * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
        (WebKit::convertCGImageToBitmap):
        * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
        (WebKit::DrawingAreaCoordinatedGraphics::display):
        * WebProcess/WebPage/WebFrame.cpp:
        (WebKit::WebFrame::createSelectionSnapshot const):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::snapshotAtSize):
        (WebKit::WebPage::snapshotNode):
        (WebKit::WebPage::drawRectToImage):

2019-07-29  Dean Jackson  <dino@apple.com>

        Contextual menu does not present when holding an embedded photo but works with link and attachments
        https://bugs.webkit.org/show_bug.cgi?id=200239
        <rdar://problem/53318733>

        Reviewed by Tim Horton.

        If the user long-pressed on an image, and the client implemented the new API but did
        not provide a configuration, we were not falling back to the default behaviour of
        giving a menu allowing the user to copy/share/save the image.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView continueContextMenuInteraction:]): If we get through the delegates,
        and the element is an image, return the default configuration.

2019-07-29  Chris Dumez  <cdumez@apple.com>

        Remove unnecessary null check under WebResourceLoadStatisticsStore::hasStorageAccess()
        https://bugs.webkit.org/show_bug.cgi?id=200229

        Reviewed by Alex Christensen.

        Remove unnecessary null check under WebResourceLoadStatisticsStore::hasStorageAccess().
        There is already a null check with an early return a few lines above.

        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):

2019-07-29  Wenson Hsieh  <wenson_hsieh@apple.com>

        UI process occasionally hangs in -[UIKeyboardTaskQueue lockWhenReadyForMainThread]
        https://bugs.webkit.org/show_bug.cgi?id=200215
        <rdar://problem/52976965>

        Reviewed by Tim Horton.

        To implement autocorrection on iOS, UIKit sometimes needs to request contextual information from WebKit. This is
        handled as a sync IPC message in WebKit, since UIKit would otherwise proceed to block the main thread after
        sending the request, preventing WebKit from handling any IPC responses in the UI process (potentially resulting
        in deadlock if any other sync IPC messages were to arrive in the UI process during this time).

        The synchronous nature of this autocorrection request means that if any sync IPC message were to be
        simultaneously dispatched in the opposite direction (i.e. web to UI process), we need to immediately handle the
        incoming sync message in the UI process (otherwise, we'd end up deadlocking for 1 second until the
        autocorrection context request hits a 1-second IPC timeout).

        One such synchronous message from the web process to the UI process is WebPageProxy::CreateNewPage, triggered as
        a result of synchronously opening a new window. Due to Safari changes in iOS 13 (<rdar://problem/51755088>),
        this message now calls into code which then causes UIKit to call *back into* -[WKContentView
        requestAutocorrectionContextWithCompletionHandler:] for the newly opened web view, under the scope of the call
        to -requestAutocorrectionContextWithCompletionHandler: in the original web view.

        This caused a crash, which was tracked in <rdar://problem/52590170>. There was an attempt to fix this in r247345
        by invoking the existing handler well before storing the new one; while this avoided the crash, it didn't solve
        the root problem, which was that keyboard task queues would get into a bad state after this scenario; this would
        manifest in a UI process hang under -[UIKeyboardTaskQueue lockWhenReadyForMainThread] during the next user
        gesture, which is tracked by this bug (<rdar://problem/52976965>).

        As it turns out, the keyboard task queue gets into a bad state because it is architected in such a way that
        tasks added to the queue under the scope of parent task must be finished executing before their parents;
        otherwise, the call to -[UIKeyboardTaskExecutionContext returnExecutionToParentWithInfo:] never happens when
        handling the child task. This has the effect of causing the keyboard task queue to end up with a
        UIKeyboardTaskExecutionContext that can never return execution to its parent context, such that if the task
        queue is then told to wait until any future task is finished executing, it will hang forever, waiting for these
        stuck tasks to finish executing (which never happens, because they're all waiting to return execution to their
        parents which are already done executing!)

        To fix this hang and avoid ever getting into this bad state, we need to invoke the autocorrection request
        handlers in this order:

        (1) Receive outer autocorrection context request.
        (2) Receive inner autocorrection context request.
        (3) Invoke inner autocorrection context request completion handler.
        (4) Invoke outer autocorrection context request completion handler.

        ...instead of swapping (3) and (4), like we do currently.

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

        Remove the hack added in r247345 to try and avoid reentrant autocorrection context requests; we don't need this
        anymore, since we should now be able to handle these reentrant requests in the way UIKit expects.

        (-[WKContentView requestAutocorrectionContextWithCompletionHandler:]):

        Add an early return in the case where the request is synchronous and there's already a pending autocorrection
        context to ensure that the completion handler for the nested request is invoked before the outer request is
        finished.

2019-07-29  Simon Fraser  <simon.fraser@apple.com>

        Can't scroll on yummly.co.uk recipe (scale(0) div covers the content and hit-tests)
        https://bugs.webkit.org/show_bug.cgi?id=200263
        rdar://problem/53679408

        Reviewed by Antti Koivisto.

        The content on this page had a scale(0) div overlaying an overflow:scroll element,
        and our UI-side hit-testing code would find this scale(0) element, because apparently
        -[UIView convertPoint:fromView:] will happily work with non-invertible matrices, and 
        -[UIView pointInside:withEvent:] just compares the point with the view bounds.

        Since the view frame takes the transform into account, we can look for an empty frame
        to detect these non-invertible transforms.

        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
        (WebKit::collectDescendantViewsAtPoint):

2019-07-29  Youenn Fablet  <youenn@apple.com>

        NetworkProcess clear and fetch of cache entries might move the callback aggregator more than once
        https://bugs.webkit.org/show_bug.cgi?id=200228

        Reviewed by Alex Christensen.

        copyRef the callback aggregator instead of moving it.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::fetchWebsiteData):
        (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):

2019-07-29  Chris Dumez  <cdumez@apple.com>

        Possible use-after-move under NetworkConnectionToWebProcess::resourceLoadStatisticsUpdated()
        https://bugs.webkit.org/show_bug.cgi?id=200225

        Reviewed by Brent Fulgham.

        The code was WTFMove()-ing the method parameter inside of a loop, which means that it could
        move it several times. Instead of copying the parameters, I opted into sending the statistics
        only to the network session that matches this WebProcess connection.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::resourceLoadStatisticsUpdated):

2019-07-27  Chris Dumez  <cdumez@apple.com>

        Allow more syscalls in the WebContent process' sandbox profile
        https://bugs.webkit.org/show_bug.cgi?id=200182
        <rdar://problem/53594973>

        Reviewed by Geoffrey Garen.

        I reviewed all crash traces attached to the radar and found the following
        syscalls that we not yet allowed by the WebContent process's sandbox
        profile.

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

2019-07-26  Jiewen Tan  <jiewen_tan@apple.com>

        NavigationSOAuthorizationSession should check the active URL of the responding page after waking up from waiting
        https://bugs.webkit.org/show_bug.cgi?id=200150
        <rdar://problem/53280170>

        Reviewed by Brent Fulgham.

        NavigationSOAuthorizationSession should check the active URL of the responding page after waking up from waiting
        as the page might have already changed the location.

        * UIProcess/Cocoa/SOAuthorization/NavigationSOAuthorizationSession.h:
        * UIProcess/Cocoa/SOAuthorization/NavigationSOAuthorizationSession.mm:
        (WebKit::NavigationSOAuthorizationSession::shouldStartInternal):
        (WebKit::NavigationSOAuthorizationSession::webViewDidMoveToWindow):
        (WebKit::NavigationSOAuthorizationSession::pageActiveURLDidChangeDuringWaiting const):
        * UIProcess/Cocoa/SOAuthorization/SubFrameSOAuthorizationSession.mm:
        (WebKit::SubFrameSOAuthorizationSession::abortInternal):

2019-07-26  Chris Dumez  <cdumez@apple.com>

        Crashes under XPCServiceMain() / mach_msg_trap() due to sandboxing
        https://bugs.webkit.org/show_bug.cgi?id=200173
        <rdar://problem/53594973>

        Reviewed by Per Arne Vollan.

        Allow a few more syscalls as they appear to be needed by mach_msg_trap().

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

2019-07-26  Daniel Bates  <dabates@apple.com>

        [iOS] REGRESSION: Keyboard dismisses and reappears when typing 2FA pin on appleid.apple.com
        https://bugs.webkit.org/show_bug.cgi?id=200171
        <rdar://problem/50245251>

        Reviewed by Wenson Hsieh.

        Take out an InputViewUpdateDeferrer token (if we don't already have one) to temporarily defer
        tearing down the input view (keyboard) before bluring the previously focused element as part
        of switching between focused elements. This avoid a noticeable flash caused by UIKit animating
        out and animating in the keyboard should the newly focused element require the keyboard. We
        only take out the InputViewUpdateDeferrer until we fall off the end of _elementDidFocus: (or
        bail early). Once we fall of the end UIKit will update input view UI.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:activityStateChanges:userObject:]):

2019-07-26  Chris Dumez  <cdumez@apple.com>

        Avoid WebContent process SIGKILL when using kevent()
        https://bugs.webkit.org/show_bug.cgi?id=200170
        <rdar://problem/51559921>

        Reviewed by Per Arne Vollan.

        Avoid WebContent process SIGKILL when using kevent() by updated its sandboxing profile.

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

2019-07-26  Chris Dumez  <cdumez@apple.com>

        [iOS] WebPage::TouchEventSync() & WebPage::GetPositionInformation() sync IPC causes UIProcess hangs
        https://bugs.webkit.org/show_bug.cgi?id=200138
        <rdar://problem/52698157>

        Reviewed by Geoffrey Garen.

        Revert most of r247822 and use an alternative approach to address hangs. In this patch, the proposal
        is to add a SendSyncOption::ForceDispatchWhenDestinationIsWaitingForUnboundedSyncReply flag on the
        WebPage::TouchEventSync() & WebPage::GetPositionInformation() sendSync() calls in the UIProcess.
        Those will cause this IPCs to get dispatched right away in the WebContent process, even if the
        WebContent process is itself currently stuck on unbounded (i.e. potentially slow) synchronous IPC
        (JS alerts / prompts & sync XHR). Because re-entering WebCore on sync IPC is generally unsafe, this
        patch also updates the WebPage::getPositionInformation() & WebPage::touchEventSync() to return early
        (i.e. cancelled) if they get called while the WebContent process is stuck on a slow sendSync.

        This approach should address the UIProcess hangs caused by the WebPage::TouchEventSync() and
        WebPage::GetPositionInformation() sync IPC messages when the WebContent process is busy on a slow XHR
        or a JS prompt / alert. It should be safe because we do not re-enter WebCore. The only drawback is that
        those IPCs will be cancelled (early return with default value) when the WebContent process is busy.
        However, I am being told that this is likely acceptable in practice.        

        * Platform/IPC/Connection.cpp:
        (IPC::Connection::SyncMessageState::processIncomingMessage):
        (IPC::Connection::sendMessage):
        (IPC::Connection::sendSyncMessage):
        (IPC::Connection::dispatchMessage):
        * Platform/IPC/Connection.h:
        (IPC::UnboundedSynchronousIPCScope::UnboundedSynchronousIPCScope):
        (IPC::UnboundedSynchronousIPCScope::~UnboundedSynchronousIPCScope):
        (IPC::UnboundedSynchronousIPCScope::hasOngoingUnboundedSyncIPC):
        * Platform/IPC/Decoder.cpp:
        (IPC::Decoder::shouldDispatchMessageWhenWaitingForSyncReply const):
        * Platform/IPC/Decoder.h:
        * Platform/IPC/Encoder.cpp:
        (IPC::Encoder::shouldDispatchMessageWhenWaitingForSyncReply const):
        (IPC::Encoder::setShouldDispatchMessageWhenWaitingForSyncReply):
        (IPC::Encoder::wrapForTesting):
        * Platform/IPC/Encoder.h:
        * Platform/IPC/MessageFlags.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::handleTouchEventSynchronously):
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView ensurePositionInformationIsUpToDate:]):
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::loadResourceSynchronously):
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
        (WebKit::WebChromeClient::runJavaScriptAlert):
        (WebKit::WebChromeClient::runJavaScriptConfirm):
        (WebKit::WebChromeClient::runJavaScriptPrompt):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::layerVolatilityTimerFired):
        (WebKit::WebPage::markLayersVolatile):
        (WebKit::WebPage::cancelMarkLayersVolatile):
        (WebKit::WebPage::touchEventSync):
        (WebKit::WebPage::didCompletePageTransition):
        (WebKit::WebPage::updatePreferences):
        (WebKit::WebPage::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
        * WebProcess/WebPage/WebPage.h:
        (WebKit::WebPage::sendSyncWithDelayedReply):
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::getPositionInformation):

2019-07-26  Zalan Bujtas  <zalan@apple.com>

        Unable to tap/double tap to open files/folders in Google Drive in Safari
        https://bugs.webkit.org/show_bug.cgi?id=200096
        <rdar://problem/52748552>

        Reviewed by Wenson Hsieh.

        This patch reverts to the original double-tap-for-double-click implementation (see r244775 and r246347 for more information).

        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:
        * UIProcess/PageClient.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::creationParameters):
        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/PageClientImplIOS.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::doubleTapForDoubleClickDelay): Deleted.
        (WebKit::PageClientImpl::doubleTapForDoubleClickRadius): Deleted.
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView setupInteraction]):
        (-[WKContentView cleanupInteraction]):
        (-[WKContentView _removeDefaultGestureRecognizers]):
        (-[WKContentView _addDefaultGestureRecognizers]):
        (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]): Do not recognize the single and double gestures the same time.
        (-[WKContentView gestureRecognizerShouldBegin:]):
        (-[WKContentView _doubleTapRecognizedForDoubleClick:]):
        (-[WKContentView _didStartProvisionalLoadForMainFrame]):
        (-[WKContentView _ensureNonBlockingDoubleTapGestureRecognizer]): Deleted.
        (-[WKContentView _doubleTapForDoubleClickDelay]): Deleted.
        (-[WKContentView _doubleTapForDoubleClickRadius]): Deleted.
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::handleDoubleTapForDoubleClickAtPoint):
        * WebProcess/WebPage/WebPage.cpp:
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::handleDoubleTapForDoubleClickAtPoint):
        (WebKit::WebPage::commitPotentialTap):
        (WebKit::WebPage::handlePotentialDoubleTapForDoubleClickAtPoint): Deleted.

2019-07-26  Eric Liang  <ericliang@apple.com>

        AX: web process should load correct bundle path for MACCATALYST
        https://bugs.webkit.org/show_bug.cgi?id=200122

        Reviewed by Brent Fulgham.

        Added the path to accessibility bundle for Mac Catalyst.
        Added sandbox profile to read accessibility settings.

        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::registerWithAccessibility):
        * WebProcess/com.apple.WebProcess.sb.in:

2019-07-26  Alexander Mikhaylenko  <exalm7659@gmail.com>

        REGRESSION(r246496): [GTK] Tapping the web view scrolls up a bit
        https://bugs.webkit.org/show_bug.cgi?id=200084

        Reviewed by Carlos Garcia Campos.

        gdk_event_get_scroll_direction() returns false, but also sets direction to GDK_SCROLL_UP if
        the direction was GDK_SCROLL_SMOOTH. Relying on zero deltas in this case is not correct, because
        they can also be zero with GDK_SCROLL_SMOOTH. In this case, set the direction manually to avoid
        that.

        See https://gitlab.gnome.org/GNOME/gtk/issues/2048

        * Shared/gtk/WebEventFactory.cpp:
        (WebKit::WebEventFactory::createWebWheelEvent):

2019-07-26  Loïc Yhuel  <loic.yhuel@softathome.com>

        [WPE] Support disk cache dumping like GTK
        https://bugs.webkit.org/show_bug.cgi?id=200157

        Reviewed by Carlos Garcia Campos.

        Creating or touching "dump" would create the dump.json.

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

2019-07-26  Rob Buis  <rbuis@igalia.com>

        Make storing cross-origin top-level prefetches in HTTP cache optional
        https://bugs.webkit.org/show_bug.cgi?id=199499

        Reviewed by Youenn Fablet.

        Currently when we navigate we check if there is a cross-origin top-level
        prefetch we can use for the navigation. The current solution uses the
        HTTP cache as a way to store the prefetch and to immediately use it for
        the navigation load. However this solution fails in case the prefetch is
        not cacheable.

        Instead of this, simulate a HTTP Cache entry to process the load and
        afterwards try to store the navigation load into the HTTP cache, where
        normal store decisions will be applied.

        Test: http/wpt/prefetch/link-prefetch-skip-disk-cache.html

        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::retrieveCacheEntry):
        (WebKit::NetworkResourceLoader::retrieveCacheEntryInternal):
        * NetworkProcess/NetworkResourceLoader.h:

2019-07-25  Zan Dobersek  <zdobersek@igalia.com>

        Unreviewed build fix in NetworkDataTaskSoup.

        * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
        (WebKit::NetworkDataTaskSoup::authenticateCallback):
        Fix incorrect use of the dereferencing operator introduced in r247831.

2019-07-25  Jiewen Tan  <jiewen_tan@apple.com>

        Unreviewed, build fix after r247851

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
        Reverts an unnecessary change.

2019-07-25  Fujii Hironori  <fujii.hironori@gmail.com>

        [GTK] Indistinguishable overloaded callback function inspectorViewDestroyed if RemoteWebInspectorProxyGtk.cpp and WebInspectorProxyGtk.cpp are in a unified build bundle
        https://bugs.webkit.org/show_bug.cgi?id=200123

        Reviewed by Carlos Garcia Campos.

        * UIProcess/gtk/RemoteWebInspectorProxyGtk.cpp:
        (WebKit::remoteInspectorViewDestroyed): Added.
        (WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow):
        (WebKit::inspectorViewDestroyed): Deleted.
        Renamed inspectorViewDestroyed to remoteInspectorViewDestroyed.

2019-07-25  Jiewen Tan  <jiewen_tan@apple.com>

        WebPageProxy::receivedPolicyDecision should check navigation ID before clear pendingAPIRequest
        https://bugs.webkit.org/show_bug.cgi?id=200108
        <rdar://problem/53521238>

        Reviewed by Chris Dumez.

        Assuming there are two loads happening one after another. There is an issue when clients save
        the first decisionHandler and then call WKNavigationActionPolicyCancel for it right after the
        second decisionHandler received, -[WKWebView URL] could return a null string even though it is
        loading the second one.

        To solve that, this patch pairs a navigationID with the pendingAPIRequestURL such that
        WebPageProxy::receivedPolicyDecision could clear the pendingAPIRequestURL only if
        the passed navigation ID matches the current one.

        * UIProcess/PageLoadState.cpp:
        (WebKit::PageLoadState::reset):
        (WebKit::PageLoadState::activeURL):
        (WebKit::PageLoadState::estimatedProgress):
        (WebKit::PageLoadState::pendingAPIRequestURL const):
        (WebKit::PageLoadState::pendingAPIRequest const):
        (WebKit::PageLoadState::setPendingAPIRequest):
        (WebKit::PageLoadState::clearPendingAPIRequest):
        (WebKit::PageLoadState::isLoading):
        (WebKit::PageLoadState::setPendingAPIRequestURL): Deleted.
        (WebKit::PageLoadState::clearPendingAPIRequestURL): Deleted.
        * UIProcess/PageLoadState.h:
        (WebKit::PageLoadState::setPendingAPIRequest):
        (WebKit::PageLoadState::setPendingAPIRequestURL): Deleted.
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::launchProcessForReload):
        (WebKit::WebPageProxy::loadRequestWithNavigationShared):
        (WebKit::WebPageProxy::loadFile):
        (WebKit::WebPageProxy::loadDataWithNavigationShared):
        (WebKit::WebPageProxy::loadAlternateHTML):
        (WebKit::WebPageProxy::loadWebArchiveData):
        (WebKit::WebPageProxy::reload):
        (WebKit::WebPageProxy::goToBackForwardItem):
        (WebKit::WebPageProxy::receivedPolicyDecision):
        (WebKit::WebPageProxy::continueNavigationInNewProcess):
        (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
        (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):

2019-07-25  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r247806.
        https://bugs.webkit.org/show_bug.cgi?id=200141

        It is regressing PLT (Requested by youenn on #webkit).

        Reverted changeset:

        "Disable speculative loading if cache is not to be used for
        the load"
        https://bugs.webkit.org/show_bug.cgi?id=199644
        https://trac.webkit.org/changeset/247806

2019-07-25  Dean Jackson  <dino@apple.com>

        WebKit/UIProcess/ios/WKContentViewInteraction.mm: error: implementing deprecated method contextMenuInteractionWillPresent
        https://bugs.webkit.org/show_bug.cgi?id=200136
        <rdar://problem/53547698>

        Reviewed by Wenson Hsieh.

        Ignore deprecation warnings for these UIContextMenuInteraction delegates.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView contextMenuInteractionWillPresent:]):
        (-[WKContentView contextMenuInteraction:willCommitWithAnimator:]):
        (-[WKContentView contextMenuInteractionDidEnd:]):

2019-07-25  Dean Jackson  <dino@apple.com>

        Add helper for ignoring deprecated implementation warnings
        https://bugs.webkit.org/show_bug.cgi?id=200135

        Reviewed by Wenson Hsieh.

        Add ALLOW_DEPRECATED_IMPLEMENTATIONS_BEGIN/END macro which
        is IGNORE_WARNINGS_BEGIN("deprecated-implementations")

        * UIProcess/API/Cocoa/LegacyBundleForClass.mm:
        * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
        (IGNORE_WARNINGS_BEGIN): Deleted.
        * UIProcess/API/Cocoa/WKBrowsingContextGroup.mm:
        (IGNORE_WARNINGS_BEGIN): Deleted.
        * UIProcess/API/Cocoa/WKConnection.mm:
        (IGNORE_WARNINGS_BEGIN): Deleted.
        * UIProcess/API/Cocoa/WKPreviewElementInfo.mm:
        * UIProcess/API/Cocoa/WKProcessGroup.mm:
        (IGNORE_WARNINGS_BEGIN): Deleted.
        * UIProcess/API/Cocoa/WKTypeRefWrapper.mm:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView ALLOW_DEPRECATED_IMPLEMENTATIONS_END]):
        (-[WKWebView draggedImage:endedAt:operation:]):
        (-[WKWebView accessibilityAttributeValue:]):
        (-[WKWebView accessibilityAttributeValue:forParameter:]):
        (-[WKWebView namesOfPromisedFilesDroppedAtDestination:]):
        (-[WKWebView IGNORE_WARNINGS_END]): Deleted.
        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
        (-[WKWebViewConfiguration ALLOW_DEPRECATED_IMPLEMENTATIONS_END]):
        (-[WKWebViewConfiguration _setWebsiteDataStore:]):
        (-[WKWebViewConfiguration IGNORE_WARNINGS_END]): Deleted.
        * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
        * UIProcess/API/mac/WKView.mm:
        (-[WKView ALLOW_DEPRECATED_IMPLEMENTATIONS_END]):
        (-[WKView draggedImage:endedAt:operation:]):
        (-[WKView accessibilityAttributeValue:]):
        (-[WKView accessibilityAttributeValue:forParameter:]):
        (-[WKView namesOfPromisedFilesDroppedAtDestination:]):
        (-[WKView IGNORE_WARNINGS_END]): Deleted.
        * UIProcess/WKImagePreviewViewController.mm:
        (-[WKImagePreviewViewController ALLOW_DEPRECATED_IMPLEMENTATIONS_END]):
        (-[WKImagePreviewViewController IGNORE_WARNINGS_END]): Deleted.
        * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
        (-[WKAirPlayRoutePicker popoverControllerDidDismissPopover:]):
        * UIProcess/ios/forms/WKFileUploadPanel.mm:
        (-[WKFileUploadPanel popoverControllerDidDismissPopover:]):
        * UIProcess/ios/forms/WKFormPopover.mm:
        (-[WKRotatingPopover popoverControllerDidDismissPopover:]):
        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (-[WKPDFPluginAccessibilityObject ALLOW_DEPRECATED_IMPLEMENTATIONS_END]):
        (-[WKPDFPluginAccessibilityObject accessibilityAttributeValue:]):
        (-[WKPDFPluginAccessibilityObject accessibilityAttributeValue:forParameter:]):
        (-[WKPDFPluginAccessibilityObject accessibilityPerformAction:]):
        (-[WKPDFPluginAccessibilityObject accessibilityIsAttributeSettable:]):
        (-[WKPDFPluginAccessibilityObject accessibilitySetValue:forAttribute:]):
        (-[WKPDFPluginAccessibilityObject IGNORE_WARNINGS_END]): Deleted.
        * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
        (-[WKAccessibilityWebPageObject ALLOW_DEPRECATED_IMPLEMENTATIONS_END]):
        (-[WKAccessibilityWebPageObject accessibilityIsAttributeSettable:]):
        (-[WKAccessibilityWebPageObject accessibilitySetValue:forAttribute:]):
        (-[WKAccessibilityWebPageObject accessibilityAttributeValue:]):
        (-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
        (-[WKAccessibilityWebPageObject IGNORE_WARNINGS_END]): Deleted.

2019-07-25  Youenn Fablet  <youenn@apple.com>

        Make NetworkSession no longer RefCounted
        https://bugs.webkit.org/show_bug.cgi?id=200020

        This allows to have a simpler memory management model where
        NetworkSession cannot live once removed from the network process session map.
        This requires some additional null checks, especially in NetworkDataTask.

        Reviewed by Carlos Garcia Campos.

        * NetworkProcess/curl/NetworkSessionCurl.h:
        * NetworkProcess/soup/NetworkSessionSoup.h:
        * NetworkProcess/NetworkDataTask.cpp:
        (WebKit::NetworkDataTask::NetworkDataTask):
        * NetworkProcess/NetworkDataTask.h:
        * NetworkProcess/NetworkDataTaskBlob.cpp:
        (WebKit::NetworkDataTaskBlob::~NetworkDataTaskBlob):
        (WebKit::NetworkDataTaskBlob::download):
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::lowMemoryHandler):
        (WebKit::NetworkProcess::setSession):
        (WebKit::NetworkProcess::destroySession):
        (WebKit::NetworkProcess::setResourceLoadStatisticsEnabled):
        (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
        * NetworkProcess/NetworkProcess.h:
        (WebKit::NetworkProcess::networkSessions):
        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::create):
        * NetworkProcess/NetworkSession.h:
        * NetworkProcess/NetworkSocketChannel.cpp:
        (WebKit::NetworkSocketChannel::NetworkSocketChannel):
        (WebKit::NetworkSocketChannel::~NetworkSocketChannel):
        * NetworkProcess/NetworkSocketChannel.h:
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        (WebKit::NetworkDataTaskCocoa::applySniffingPoliciesAndBindRequestToInferfaceIfNeeded):
        (WebKit::computeIsAlwaysOnLoggingAllowed):
        (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
        (WebKit::NetworkDataTaskCocoa::~NetworkDataTaskCocoa):
        (WebKit::NetworkDataTaskCocoa::resume):
        (WebKit::NetworkDataTaskCocoa::isAlwaysOnLoggingAllowed const):
        * NetworkProcess/cocoa/NetworkSessionCocoa.h:
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (-[WKNetworkSessionDelegate initWithNetworkSession:withCredentials:]):
        (WebKit::NetworkSessionCocoa::create):
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
        * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
        (WebKit::NetworkDataTaskSoup::createRequest):
        (WebKit::NetworkDataTaskSoup::clearRequest):
        (WebKit::NetworkDataTaskSoup::cancel):
        (WebKit::NetworkDataTaskSoup::authenticateCallback):
        (WebKit::NetworkDataTaskSoup::authenticate):
        (WebKit::NetworkDataTaskSoup::continueAuthenticate):

2019-07-25  Chris Dumez  <cdumez@apple.com>

        Avoid some unnecessary HashMap copies
        https://bugs.webkit.org/show_bug.cgi?id=200129

        Reviewed by Youenn Fablet.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::didClose):
        * UIProcess/AuxiliaryProcessProxy.cpp:
        (WebKit::AuxiliaryProcessProxy::connect):
        * UIProcess/Launcher/ProcessLauncher.cpp:
        (WebKit::ProcessLauncher::ProcessLauncher):
        * UIProcess/Launcher/ProcessLauncher.h:
        (WebKit::ProcessLauncher::create):
        * WebProcess/Plugins/WebPluginInfoProvider.cpp:
        (WebKit::WebPluginInfoProvider::setPluginLoadClientPolicy):

2019-07-25  Truitt Savell  <tsavell@apple.com>

        Unreviewed, rolling out r247821.

        Caused two crashing Layout Tests

        Reverted changeset:

        "Make storing cross-origin top-level prefetches in HTTP cache
        optional"
        https://bugs.webkit.org/show_bug.cgi?id=199499
        https://trac.webkit.org/changeset/247821

2019-07-25  Michael Catanzaro  <mcatanzaro@igalia.com>

        Unreviewed, fix -Wredundant-move warning spam after r247672
        https://bugs.webkit.org/show_bug.cgi?id=199967
        <rdar://problem/53351435>

        * Platform/IPC/ArgumentCoders.cpp:
        (IPC::decodeStringText):
        * Platform/IPC/ArgumentCoders.h:

2019-07-25  Chris Dumez  <cdumez@apple.com>

        Avoid UI Process hangs when the WebContent process is showing JS prompts / alerts
        https://bugs.webkit.org/show_bug.cgi?id=200107
        <rdar://problem/53034592>

        Reviewed by Geoffrey Garen.

        * Platform/IPC/Connection.cpp:
        (IPC::Connection::SyncMessageState::incrementProcessIncomingSyncMessagesWhenWaitingForSyncReplyCount):
        (IPC::Connection::SyncMessageState::decrementProcessIncomingSyncMessagesWhenWaitingForSyncReplyCount):
        (IPC::Connection::SyncMessageState::processIncomingMessage):
        (IPC::Connection::sendSyncMessage):
        * Platform/IPC/Connection.h:
        Add support for new SendSyncOption::ProcessIncomingSyncMessagesWhenWaitingForSyncReply flag
        to allow processing incoming sync messages while sending a particular sync IPC. This is the
        default behavior in all processes except in the WebContent process, where we try to avoid
        re-entering to prevent bugs. This flag allows the WebContent process to change its default
        behavior for some specific IPCs, where we know it is safe to re-enter and where it benefits
        performance to re-renter.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::didReceiveSyncMessage):
        (WebKit::NetworkProcessProxy::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/Network/NetworkProcessProxy.messages.in:
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
        * WebProcess/WebCoreSupport/WebChromeClient.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
        * WebProcess/WebPage/WebPage.h:
        (WebKit::WebPage::sendSyncWithDelayedReply):
        * WebProcess/WebPage/WebPage.messages.in:
        SendSyncOption::ProcessIncomingSyncMessagesWhenWaitingForSyncReply
        Add testing infrastructure for SendSyncOption::ProcessIncomingSyncMessagesWhenWaitingForSyncReply
        flag.

        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::runJavaScriptAlert):
        (WebKit::WebChromeClient::runJavaScriptConfirm):
        (WebKit::WebChromeClient::runJavaScriptPrompt):
        Use new SendSyncOption::ProcessIncomingSyncMessagesWhenWaitingForSyncReply flag when sending
        the synchronous IPC for JS alerts / prompt / confirm. This allows the WebProcess to process
        incoming synchronous IPC for other processes (in particular the UIProcess) while it is blocked
        on those synchronous IPCs. It is safe to re-enter the WebContent process on these sync IPCs
        since they are triggered by JS and we return to JS right after. This should avoid UIProcess
        hangs when the UIProcess is sending a sync IPC to the WebContent process, which is itself
        stuck on the sync IPC to show a JS alert.

2019-07-25  Rob Buis  <rbuis@igalia.com>

        Make storing cross-origin top-level prefetches in HTTP cache optional
        https://bugs.webkit.org/show_bug.cgi?id=199499

        Reviewed by Youenn Fablet.

        Currently when we navigate we check if there is a cross-origin top-level
        prefetch we can use for the navigation. The current solution uses the
        HTTP cache as a way to store the prefetch and to immediately use it for
        the navigation load. However this solution fails in case the prefetch is
        not cacheable.

        Instead of this, simulate a HTTP Cache entry to process the load and
        afterwards try to store the navigation load into the HTTP cache, where
        normal store decisions will be applied.

        Test: http/wpt/prefetch/link-prefetch-skip-disk-cache.html

        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::retrieveCacheEntry):
        (WebKit::NetworkResourceLoader::retrieveCacheEntryInternal):
        * NetworkProcess/NetworkResourceLoader.h:

2019-07-25  Truitt Savell  <tsavell@apple.com>

        Unreviewed, rolling out r247817.

        Broke 14 http/tests/paymentrequest/ tests. on iOS

        Reverted changeset:

        "Unable to tap/double tap to open files/folders in Google
        Drive in Safari"
        https://bugs.webkit.org/show_bug.cgi?id=200096
        https://trac.webkit.org/changeset/247817

2019-07-24  Zalan Bujtas  <zalan@apple.com>

        Unable to tap/double tap to open files/folders in Google Drive in Safari
        https://bugs.webkit.org/show_bug.cgi?id=200096
        <rdar://problem/52748552>

        Reviewed by Wenson Hsieh.

        This patch reverts to the original double-tap-for-double-click implementation (see r244775 and r246347 for more information).

        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:
        * UIProcess/PageClient.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::creationParameters):
        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/PageClientImplIOS.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::doubleTapForDoubleClickDelay): Deleted.
        (WebKit::PageClientImpl::doubleTapForDoubleClickRadius): Deleted.
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView setupInteraction]):
        (-[WKContentView cleanupInteraction]):
        (-[WKContentView _removeDefaultGestureRecognizers]):
        (-[WKContentView _addDefaultGestureRecognizers]):
        (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]): Do not recognize the single and double gestures the same time.
        (-[WKContentView gestureRecognizerShouldBegin:]):
        (-[WKContentView _doubleTapRecognizedForDoubleClick:]):
        (-[WKContentView _didStartProvisionalLoadForMainFrame]):
        (-[WKContentView _ensureNonBlockingDoubleTapGestureRecognizer]): Deleted.
        (-[WKContentView _doubleTapForDoubleClickDelay]): Deleted.
        (-[WKContentView _doubleTapForDoubleClickRadius]): Deleted.
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::handleDoubleTapForDoubleClickAtPoint):
        * WebProcess/WebPage/WebPage.cpp:
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::handleDoubleTapForDoubleClickAtPoint):
        (WebKit::WebPage::commitPotentialTap):
        (WebKit::WebPage::handlePotentialDoubleTapForDoubleClickAtPoint): Deleted.

2019-07-24  Yusuke Suzuki  <ysuzuki@apple.com>

        [bmalloc] Add IsoHeap test to ensure that IsoHeap pages are not allocating too large VA
        https://bugs.webkit.org/show_bug.cgi?id=200103

        Reviewed by Mark Lam.

        Move MachVMSPI.h from PAL to WTF.

        * Platform/cocoa/SharedMemoryCocoa.cpp:

2019-07-24  Youenn Fablet  <youenn@apple.com>

        Disable speculative loading if cache is not to be used for the load
        https://bugs.webkit.org/show_bug.cgi?id=199644

        Reviewed by Alex Christensen.

        When the page is reloaded, loads are instructed to not use the cache.
        It is therefore unneeded to do speculative revalidation.
        Allow speculative revalidation if the cache policy is either the default HTTP policy or
        if policy is to refresh all cache data.
        Covered by added test.

        * NetworkProcess/cache/NetworkCache.cpp:
        (WebKit::NetworkCache::cachePolicyValidForSpeculativeRevalidation):
        (WebKit::NetworkCache::canRequestUseSpeculativeRevalidation):

2019-07-24  Priyanka Agarwal  <pagarwal999@apple.com>

        Allow Clients to Add Fields to the AutoFillContext Dictionary
        https://bugs.webkit.org/show_bug.cgi?id=199326
        rdar://problem/42816957

        Reviewed by Wenson Hsieh.

        * UIProcess/API/Cocoa/_WKInputDelegate.h:
        Added function declaration for function which returns additional dictionary for autofillcontext

        * UIProcess/ios/WKContentViewInteraction.h:
        Created dictionary for additional autofillcontext

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:activityStateChanges:userObject:]):
        Populating additional dictionary for autofillcontext

        (-[WKContentView _autofillContext]):
        Adding new dictionary to the returned autofillcontext

2019-07-24  Chris Dumez  <cdumez@apple.com>

        Regression(r247400): Unable to log into AIB Mobile Banking App
        https://bugs.webkit.org/show_bug.cgi?id=200094
        <rdar://problem/52519818>

        Reviewed by Brent Fulgham.

        In r247400, a change was made to only set the 'app has universal sandbox access' flag
        only when issueing the sandbox extension for / actually succeeded (it usually fails
        in practice). Previously, AIB Mobile Banking app was relying on this behavior to
        trigger a load for file:///login which is outside their container. However, now that
        the 'app has universal sandbox access' flag is no longer set, it trips our security
        checks and the load gets ignored.

        To address the issue, apply only the 'app has universal sandbox access' flag fix with
        a linked-on-after check.

        * UIProcess/Cocoa/VersionChecks.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):

2019-07-24  Tim Horton  <timothy_horton@apple.com>

        Module-enabled users of WKWebProcessPlugInFrame.h fail to build; duplicate declaration
        https://bugs.webkit.org/show_bug.cgi?id=200095
        <rdar://problem/53512407>

        Reviewed by Wenson Hsieh.

        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h:
        Import <JavaScriptCore/JavaScriptCore.h> (the module header) instead of
        <JavaScriptCore/JSContext.h> directly, otherwise we can end up getting
        JSContext.h included twice, to the compiler's chagrin.

2019-07-24  Brady Eidson  <beidson@apple.com>

        Crash in WebContent process with custom schemes.
        <rdar://problem/52968793> and https://bugs.webkit.org/show_bug.cgi?id=200062

        Reviewed by Andy Estes.

        Almost everywhere in WebURLSchemeTaskProxy where we call processNextPendingTask() we first protect the task with a ref.
        But not in didReceiveData.
        So lets do that.

        * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp:
        (WebKit::WebURLSchemeTaskProxy::didReceiveData): Protect this.

2019-07-24  Alex Christensen  <achristensen@webkit.org>

        Null check CompletionHandler in WebPreviewLoaderClient::didReceivePassword
        https://bugs.webkit.org/show_bug.cgi?id=200080
        <rdar://problem/37275772>

        Reviewed by Chris Dumez.

        * WebProcess/WebCoreSupport/ios/WebPreviewLoaderClient.cpp:
        (WebKit::WebPreviewLoaderClient::didReceivePassword):

2019-07-24  Chris Dumez  <cdumez@apple.com>

        Crash under WebKit:WTF::Detail::CallableWrapper<WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlocking(WTF::CompletionHandler<void ()>&&)::$_32::operator()()::'lambda'(), void>::call
        https://bugs.webkit.org/show_bug.cgi?id=200071
        <rdar://problem/53335583>

        Reviewed by Brent Fulgham and Youenn Fablet.

        The WebResourceLoadStatisticsStore is a main thread object. In its destructor, it was dispatching
        to the background queue to destroy the m_statisticsStore / m_persistentStorage data members, which
        live on the background queue. It would then synchronously wait for the background queue to finish
        destroying them. The idea was to guarantee that the ResourceLoadStatisticsMemoryStore and the
        ResourceLoadStatisticsPersistentStorage would never outlive the WebResourceLoadStatisticsStore,
        given that they keep a raw pointer back to the WebResourceLoadStatisticsStore (via m_store data
        member).

        The issue is that *while* the WebResourceLoadStatisticsStore destructor is running on the main
        thread, the background queue may be running code in ResourceLoadStatisticsMemoryStore or
        ResourceLoadStatisticsPersistentStorage which refs the WebResourceLoadStatisticsStore, even
        though its ref count has already reached 0. It is actually a common pattern in
        ResourceLoadStatisticsMemoryStore to call RunLoop::main().dispatch() and ref their m_store in
        the lambda, so that they can interact with the WebResourceLoadStatisticsStore.

        To address the issue, we now destroy m_statisticsStore / m_persistentStorage *before* the
        WebResourceLoadStatisticsStore destructor runs. The NetworkSession destructor now calls
        WebResourceLoadStatisticsStore::didDestroyNetworkSession() which takes care of destroying
        m_statisticsStore / m_persistentStorage on the background queue, synchronously. The
        WebResourceLoadStatisticsStore destructor will only run later, once all remaining references
        to it are gone.

        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::~WebResourceLoadStatisticsStore):
        (WebKit::WebResourceLoadStatisticsStore::didDestroyNetworkSession):
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::~NetworkSession):

2019-07-24  Youenn Fablet  <youenn@apple.com>

        SYS___pthread_markcancel is sometimes used by libwebrtc
        https://bugs.webkit.org/show_bug.cgi?id=200087
        <rdar://problem/53408606>

        Reviewed by Brent Fulgham.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
        Whitelist this unix-call within WebProcess as libwebrtc uses it.

2019-07-24  Zalan Bujtas  <zalan@apple.com>

        ASSERTION FAILED: settings().textAutosizingEnabled() && settings().textAutosizingUsesIdempotentMode() in WebCore::Page::recomputeTextAutoSizingInAllFrames()
        https://bugs.webkit.org/show_bug.cgi?id=200079
        <rdar://problem/53474325>

        Reviewed by Wenson Hsieh.

        Do not reset idempotent values when the text autosizing is off.

        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetTextAutosizingUsesIdempotentMode):
        (WKPreferencesGetTextAutosizingUsesIdempotentMode):
        * UIProcess/API/C/WKPreferencesRef.h:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::resetIdempotentTextAutosizingIfNeeded):

2019-07-24  Chris Dumez  <cdumez@apple.com>

        Unreviewed, rolling out r247766.

        Caused an API test failure

        Reverted changeset:

        "Crash under
        WebKit:WTF::Detail::CallableWrapper<WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlocking(WTF::CompletionHandler<void
        ()>&&)::$_32::operator()()::'lambda'(), void>::call"
        https://bugs.webkit.org/show_bug.cgi?id=200071
        https://trac.webkit.org/changeset/247766

2019-07-23  Chris Dumez  <cdumez@apple.com>

        Crash under WebKit:WTF::Detail::CallableWrapper<WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlocking(WTF::CompletionHandler<void ()>&&)::$_32::operator()()::'lambda'(), void>::call
        https://bugs.webkit.org/show_bug.cgi?id=200071
        <rdar://problem/53335583>

        Reviewed by Brent Fulgham and Youenn Fablet.

        The WebResourceLoadStatisticsStore is a main thread object. In its destructor, it was dispatching
        to the background queue to destroy the m_statisticsStore / m_persistentStorage data members, which
        live on the background queue. It would then synchronously wait for the background queue to finish
        destroying them. The idea was to guarantee that the ResourceLoadStatisticsMemoryStore and the
        ResourceLoadStatisticsPersistentStorage would never outlive the WebResourceLoadStatisticsStore,
        given that they keep a raw pointer back to the WebResourceLoadStatisticsStore (via m_store data
        member).

        The issue is that *while* the WebResourceLoadStatisticsStore destructor is running on the main
        thread, the background queue may be running code in ResourceLoadStatisticsMemoryStore or
        ResourceLoadStatisticsPersistentStorage which refs the WebResourceLoadStatisticsStore, even
        though its ref count has already reached 0. It is actually a common pattern in
        ResourceLoadStatisticsMemoryStore to call RunLoop::main().dispatch() and ref their m_store in
        the lambda, so that they can interact with the WebResourceLoadStatisticsStore.

        To address the issue, we now destroy m_statisticsStore / m_persistentStorage *before* the
        WebResourceLoadStatisticsStore destructor runs. The NetworkSession destructor now calls
        WebResourceLoadStatisticsStore::didDestroyNetworkSession() which takes care of destroying
        m_statisticsStore / m_persistentStorage on the background queue, synchronously. The
        WebResourceLoadStatisticsStore destructor will only run later, once all remaining references
        to it are gone.

        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::~WebResourceLoadStatisticsStore):
        (WebKit::WebResourceLoadStatisticsStore::didDestroyNetworkSession):
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::~NetworkSession):

2019-07-23  Alex Christensen  <achristensen@webkit.org>

        Move javaScriptConfigurationDirectory SPI from _WKProcessPoolConfiguration to WKProcessPoolPrivate to make it runtime switchable
        https://bugs.webkit.org/show_bug.cgi?id=200045

        Reviewed by Mark Lam.

        This allows me to maintain the status quo in Safari.

        * UIProcess/API/APIProcessPoolConfiguration.cpp:
        (API::ProcessPoolConfiguration::copy):
        * UIProcess/API/APIProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _javaScriptConfigurationDirectory]):
        (-[WKProcessPool _setJavaScriptConfigurationDirectory:]):
        * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
        (-[_WKProcessPoolConfiguration javaScriptConfigurationDirectory]): Deleted.
        (-[_WKProcessPoolConfiguration setJavaScriptConfigurationDirectory:]): Deleted.
        * UIProcess/WebProcessPool.cpp:
        (WebKit::legacyWebsiteDataStoreConfiguration):
        (WebKit::WebProcessPool::sendWebProcessDataStoreParameters):
        * UIProcess/WebProcessPool.h:

2019-07-23  Russell Epstein  <repstein@apple.com>

        Unreviewed, rolling out r247745.

        This broke API test
        TestWebKitAPI.WKProcessPool.JavaScriptConfiguration as
        indicated by EWS

        Reverted changeset:

        "Move javaScriptConfigurationDirectory SPI from
        _WKProcessPoolConfiguration to WKProcessPoolPrivate to make it
        runtime switchable"
        https://bugs.webkit.org/show_bug.cgi?id=200045
        https://trac.webkit.org/changeset/247745

2019-07-23  Chris Fleizach  <cfleizach@apple.com>

        AX: CrashTracer: com.apple.WebKit.WebContent at WebKit: WebKit::WebSpeechSynthesisClient::speak
        https://bugs.webkit.org/show_bug.cgi?id=199988

        Reviewed by Per Arne Vollan.

        Improvements to WebSpeechSynthesis to avoid crashing and improve correctness.
        - Reset and cancel speech jobs on page close or reload (otherwise the synthesizer keeps talking after your page is gone)
        - Have a separate speech finish callback mechanism, use the start speaking callback when the synthesizer tells us.
        - Move an assert on utterance state to only apply when we use the in process synthesizer.

        * UIProcess/Cocoa/WebPageProxyCocoa.mm:
        (WebKit::WebPageProxy::didStartSpeaking):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::reload):
        (WebKit::WebPageProxy::resetState):
        (WebKit::WebPageProxy::resetSpeechSynthesizer):
        (WebKit::WebPageProxy::speechSynthesisSetFinishedCallback):
        (WebKit::WebPageProxy::speechSynthesisSpeak):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * WebProcess/WebCoreSupport/WebSpeechSynthesisClient.cpp:
        (WebKit::WebSpeechSynthesisClient::speak):

2019-07-23  Chris Dumez  <cdumez@apple.com>

        Get rid of unnecessary callback aggregators in WebResourceLoadStatisticsStore
        https://bugs.webkit.org/show_bug.cgi?id=200042

        Reviewed by Brent Fulgham.

        Only 1 asynchronous function is called so there is nothing to "aggregate".

        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::scheduleCookieBlockingUpdate):
        (WebKit::WebResourceLoadStatisticsStore::scheduleCookieBlockingUpdateForDomains):
        (WebKit::WebResourceLoadStatisticsStore::scheduleClearBlockingStateForDomains):

2019-07-23  Zalan Bujtas  <zalan@apple.com>

        [iOS] Tapping the search field on a search results page on zillow.com shows and immediately dismisses the keyboard
        https://bugs.webkit.org/show_bug.cgi?id=200044
        <rdar://problem/53103732>

        Reviewed by Wenson Hsieh.

        * Shared/FocusedElementInformation.cpp:
        (WebKit::FocusedElementInformation::encode const):
        (WebKit::FocusedElementInformation::decode):
        * Shared/FocusedElementInformation.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _elementDidBlur]):
        (-[WKContentView _shouldAvoidScrollingWhenFocusedContentIsVisible]):
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::getFocusedElementInformation):

2019-07-23  Alex Christensen  <achristensen@webkit.org>

        Move javaScriptConfigurationDirectory SPI from _WKProcessPoolConfiguration to WKProcessPoolPrivate to make it runtime switchable
        https://bugs.webkit.org/show_bug.cgi?id=200045

        Reviewed by Mark Lam.

        This allows me to maintain the status quo in Safari.

        * UIProcess/API/APIProcessPoolConfiguration.cpp:
        (API::ProcessPoolConfiguration::copy):
        * UIProcess/API/APIProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _javaScriptConfigurationDirectory]):
        (-[WKProcessPool _setJavaScriptConfigurationDirectory:]):
        * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
        (-[_WKProcessPoolConfiguration javaScriptConfigurationDirectory]): Deleted.
        (-[_WKProcessPoolConfiguration setJavaScriptConfigurationDirectory:]): Deleted.
        * UIProcess/WebProcessPool.cpp:
        (WebKit::legacyWebsiteDataStoreConfiguration):
        (WebKit::WebProcessPool::sendWebProcessDataStoreParameters):
        * UIProcess/WebProcessPool.h:

2019-07-24  Simon Fraser  <simon.fraser@apple.com>

        [iOS WK2] A top fixed bar can flicker when scrolling with the keyboard up
        https://bugs.webkit.org/show_bug.cgi?id=200105
        rdar://problem/52871975

        Reviewed by Wenson Hsieh.

        ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition() computes a visual viewport
        from the current scroll position and scrollableAreaSize(). This doesn't know anything about
        the impact of keyboards on the visual viewport, so it computes a too-large visual viewport
        when the keyboard is up, triggering incorrect manipulations of the layout viewport. This
        leads to the top bar flashing to position 0 when it should be hidden off the top.

        Fix by feeding into the scrolling tree the height of the visual viewport which takes
        FrameView::visualViewportOverrideRect() into account. This is stored on ScrollingStateFrameScrollingNode/
        ScrollingTreeFrameScrollingNode.

        * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
        (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
        (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):

2019-07-23  Alex Christensen  <achristensen@webkit.org>

        Add SPI for setting media cache and key location on _WKWebsiteDataStoreConfiguration
        https://bugs.webkit.org/show_bug.cgi?id=199972

        Reviewed by Jer Noble.

        This is a step towards removing WebsiteDataStore::legacyDefaultDataStoreConfiguration
        I added a unit test for the media cache location,
        but the media key location can't reasonably be unit tested in an open source project.

        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _initWithConfiguration:]):
        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
        (-[_WKWebsiteDataStoreConfiguration mediaCacheDirectory]):
        (-[_WKWebsiteDataStoreConfiguration setMediaCacheDirectory:]):
        (-[_WKWebsiteDataStoreConfiguration mediaKeysStorageDirectory]):
        (-[_WKWebsiteDataStoreConfiguration setMediaKeysStorageDirectory:]):

2019-07-23  Wenson Hsieh  <wenson_hsieh@apple.com>

        [macOS 10.15] Web process crashes when attempting to show the font panel via Font > Show Fonts
        https://bugs.webkit.org/show_bug.cgi?id=200021
        <rdar://problem/53301325>

        Reviewed by Ryosuke Niwa.

        Always return false from canShowFontPanel in WebKit2.

        * WebProcess/WebCoreSupport/WebEditorClient.h:

2019-07-23  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Update OptionsGTK.cmake and NEWS for 2.25.3 release

        * gtk/NEWS: Add release notes for 2.25.3.

2019-07-23  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Emoji chooser is misplaced after scrolling
        https://bugs.webkit.org/show_bug.cgi?id=199996

        Reviewed by Michael Catanzaro.

        Convert caret rectangle coordinates to root view.

        * WebProcess/WebPage/gtk/WebPageGtk.cpp:
        (WebKit::WebPage::showEmojiPicker):

2019-07-22  Ross Kirsling  <ross.kirsling@sony.com>

        Unreviewed non-unified build fix.

        * NetworkProcess/NetworkCORSPreflightChecker.h:
        * NetworkProcess/NetworkLoadChecker.h:
        * UIProcess/API/C/WKContext.cpp:
        * UIProcess/API/C/WKPageConfigurationRef.cpp:
        * UIProcess/Downloads/DownloadProxy.cpp:
        * UIProcess/WebPageInjectedBundleClient.cpp:
        * UIProcess/WebPreferences.cpp:
        * WebProcess/Network/WebSocketChannel.cpp:
        (WebKit::PendingMessage::PendingMessage):

2019-07-22  Megan Gardner  <megan_gardner@apple.com>

        Remove Staging for scrolling bug
        https://bugs.webkit.org/show_bug.cgi?id=199894

        Reviewed by Wenson Hsieh.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKUIWKTextInteractionAssistant scrollSelectionToVisible]): Deleted.

2019-07-22  Brent Fulgham  <bfulgham@apple.com>

        Correct web audio-related crash in seed reports
        https://bugs.webkit.org/show_bug.cgi?id=200009
        <rdar://problem/51565203>

        Reviewed by Per Arne Vollan.

        Revise the iOS sandbox to allow the WebContent process to communicate with
        the 'com.apple.coremedia.audioprocessingtap.xpc' service, which is needed by
        some types of WebAudio.

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

2019-07-22  Dean Jackson  <dino@apple.com>

        WebKit SPI fix for [ClickyOrb] Audio continues playing after dismissing a video preview in Safari
        https://bugs.webkit.org/show_bug.cgi?id=200011
        <rdar://problem/53409457>

        Reviewed by Tim Horton.

        Don't check for the SPI @selector(_webView:contextMenuDidEndForElement:)
        on the WKUIDelegate so that clients that got caught implementing the
        SPI before moving to the real API can still clean-up state. In other words,
        don't force a client that only implements that method to move completely
        to the new API.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (needsDeprecatedPreviewAPI):

2019-07-22  Jer Noble  <jer.noble@apple.com>

        REGRESSION(rUnknown): YouTube playback pauses when switching to a new tab
        https://bugs.webkit.org/show_bug.cgi?id=199971
        <rdar://problem/51951218>

        Reviewed by Alex Christensen.

        When we get a message notifying us that the view has been removed from the window, we unconditionally
        ask the fullscreen manager to exit fullscreen, which has the side effect (on iOS) of pausing the video
        unconditionally. Only ask the fullscreen manager to exit fullscreen if there is actually a video in
        fullscreen mode.

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

2019-07-22  Youenn Fablet  <youenn@apple.com>

        Make sure to unref captured lambda variables given to _strictTrustEvaluate in the main thread
        https://bugs.webkit.org/show_bug.cgi?id=199948

        Reviewed by Alex Christensen.

        Use a weak pointer instead of a Ref for the NetworkSession.
        Add a null check in processServerTrustEvaluation for extra safety if we decide to remove the data task NetworkSession ref.
        Make sure to move the NetworkDataTask ref in the completion handler so that the unrefing is done in the main thread.

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (processServerTrustEvaluation):
        (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):

2019-07-22  Alex Christensen  <achristensen@webkit.org>

        Don't always look for a JSC configuration file after r247685
        https://bugs.webkit.org/show_bug.cgi?id=199917

        * UIProcess/API/APIProcessPoolConfiguration.cpp:
        (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
        (API::ProcessPoolConfiguration::ProcessPoolConfiguration):
        ProcessPoolConfiguration's javaScriptConfigurationDirectory wasn't used before r247685,
        which made it always look for a file with 'JavaScriptCoreDebug' in its name.  I had assumed
        m_javaScriptConfigurationDirectory would default to a null string, but it was defaulting to
        defaultJavaScriptConfigurationDirectory.  Make it a null string instead.

2019-07-22  Simon Fraser  <simon.fraser@apple.com>

        Make some constructors explicit
        https://bugs.webkit.org/show_bug.cgi?id=199981

        Reviewed by Daniel Bates.

        Make explicit public constructors of objects that take POD or String& arguments,
        to reduce the changes of the compiler doing implicit conversions.

        * Platform/Module.h:
        * WebProcess/WebPage/WebInspector.cpp:
        (WebKit::WebInspector::openInNewTab):

2019-07-22  Daniel Bates  <dabates@apple.com>

        [iOS] REGRESSION (r241734): Autocorrection highlight should hide when field becomes defocused
        https://bugs.webkit.org/show_bug.cgi?id=199807
        <rdar://problem/52760259>

        Fix a bad merge of r247653. svn-apply was way too forgiving. The original patch touched
        the non-existent function, -_didCommitLoadForMainFrame in WKContentViewInteraction.mm. Because
        that didn't exist, svn-apply patched up -clearSelection.

        * UIProcess/ios/WKContentView.h:
        * UIProcess/ios/WKContentView.mm:
        (-[WKContentView _didCommitLoadForMainFrame]): Deleted; moved to WKContentViewInteraction.mm
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView clearSelection]): Remove code that should be in -_didCommitLoadForMainFrame.
        (-[WKContentView _didCommitLoadForMainFrame]): Moved from WKContentView.mm

2019-07-22  Alex Christensen  <achristensen@webkit.org>

        Add SPI to _WKWebsiteDataStoreConfiguration for configuring application cache storage location
        https://bugs.webkit.org/show_bug.cgi?id=199954

        Reviewed by Geoff Garen.

        This is a step towards removing WebsiteDataStore::legacyDefaultDataStoreConfiguration
        Covered by a new API test.

        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _initWithConfiguration:]):
        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
        (-[_WKWebsiteDataStoreConfiguration applicationCacheDirectory]):
        (-[_WKWebsiteDataStoreConfiguration setApplicationCacheDirectory:]):
        (-[_WKWebsiteDataStoreConfiguration applicationCacheFlatFileSubdirectoryName]):
        (-[_WKWebsiteDataStoreConfiguration setApplicationCacheFlatFileSubdirectoryName:]):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::sendWebProcessDataStoreParameters):
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        (WebKit::WebsiteDataStore::applicationCacheFlatFileSubdirectoryName const):

2019-07-22  Alex Christensen  <achristensen@webkit.org>

        Add SPI _WKProcessPoolConfiguration.javaScriptConfigurationDirectory
        https://bugs.webkit.org/show_bug.cgi?id=199917

        Reviewed by Sam Weinig.

        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
        (-[_WKProcessPoolConfiguration javaScriptConfigurationDirectory]):
        (-[_WKProcessPoolConfiguration setJavaScriptConfigurationDirectory:]):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::sendWebProcessDataStoreParameters):

2019-07-22  Carlos Garcia Campos  <cgarcia@igalia.com>

        [SOUP] WebSockets: use new api to send text messages
        https://bugs.webkit.org/show_bug.cgi?id=199936

        Reviewed by Michael Catanzaro.

        New API allows to include null character in text messages.

        * NetworkProcess/soup/WebSocketTaskSoup.cpp:
        (WebKit::WebSocketTask::didReceiveMessageCallback): Pass data size to String::fromUTF8().
        (WebKit::WebSocketTask::sendString): Use soup_websocket_connection_send_message() instead of
        soup_websocket_connection_send_text() when available. Also use
        StrictConversionReplacingUnpairedSurrogatesWithFFFD options when converting to UTF-8.

2019-07-21  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] [WebKit2] Add limited support for -isPosition:atBoundary:inDirection: in WKContentView
        https://bugs.webkit.org/show_bug.cgi?id=199993
        <rdar://problem/49523528>

        Reviewed by Beth Dakin.

        Add support for -isPosition:atBoundary:inDirection:, only in the cases where the given position is the start or
        and position and the given granularity is UITextGranularityParagraph.

        Test: EditorStateTests.ParagraphBoundary

        * Shared/EditorState.cpp:
        (WebKit::EditorState::PostLayoutData::encode const):
        (WebKit::EditorState::PostLayoutData::decode):
        * Shared/EditorState.h:

        Add a couple of bits to indicate whether the selection start or end positions are at paragraph boundaries.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView isPosition:atBoundary:inDirection:]):

        Implement this to return selectionStartIsAtParagraphBoundary or selectionEndIsAtParagraphBoundary.

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

2019-07-20  Chris Dumez  <cdumez@apple.com>

        Speed up HashTable decoding by reserving capacity and avoiding rehashing
        https://bugs.webkit.org/show_bug.cgi?id=199982

        Reviewed by Saam Barati.

        Use HashMap::reserveInitialCapacity() in the HashMap IPC decoder for
        performance. I measured a ~35% improvement when decoding a very large
        HashMap of Strings (~160k entries) in the context of the
        StorageManager::GetValues IPC.

        * Platform/IPC/ArgumentCoders.h:
        * Shared/API/c/WKDictionary.cpp:
        (WKDictionaryCreate):

2019-07-20  Chris Dumez  <cdumez@apple.com>

        Micro-optimize HashMap & String IPC decoding
        https://bugs.webkit.org/show_bug.cgi?id=199967

        Reviewed by Geoffrey Garen.

        The legacy HashMap decoder (returning a boolean) was failing to WTFMove()
        the key & value when calling HashMap::add(). The modern decoder (returning
        an Optional) was properly using WTFMove(). Rewrite the legacy HashMap decoder
        to call the modern one to reduce code duplication and to get this optimization.

        Also, encode HashMap::size() as a uint32_t instead of a uint64_t since
        HashMap::size() returns an 'unsigned int' type. Finally, update the modern
        decoder to WTFMove(hashMap) when returning. Because the function returns an
        Optional<HashMap> and not a HashMap, I do not believe we get return value
        optimization (RVO).

        Do similar changes to String IPC coders.

        * Platform/IPC/ArgumentCoders.cpp:
        (IPC::decodeStringText):
        (IPC::ArgumentCoder<String>::decode):
        * Platform/IPC/ArgumentCoders.h:

2019-07-20  Alexander Mikhaylenko  <exalm7659@gmail.com>

        REGRESSION(r246033/r246496): [GTK] Kinetic scrolling doesn't work
        https://bugs.webkit.org/show_bug.cgi?id=199322

        Reviewed by Michael Catanzaro.

        Check ENABLE(KINETIC_SCROLLING) instead of ENABLE(ASYNC_SCROLLING) when setting wheel event phase and momentum phase.

        * Shared/WebEventConversion.cpp:
        (WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent):

2019-07-20  Zalan Bujtas  <zalan@apple.com>

        [Text autosizing] Do not nuke the style on dynamicViewportSizeUpdate
        https://bugs.webkit.org/show_bug.cgi?id=199718
        <rdar://problem/53344961>

        Reviewed by Simon Fraser.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_textAutoSizingAdjustmentTimer):
        (WebKit::WebPage::close):
        (WebKit::WebPage::didCommitLoad):
        (WebKit::WebPage::textAutoSizingAdjustmentTimerFired):
        (WebKit::m_shrinkToFitContentTimer): Deleted.
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::dynamicViewportSizeUpdate):
        (WebKit::WebPage::resetIdempotentTextAutosizingIfNeeded):
        (WebKit::WebPage::resetTextAutosizing):
        (WebKit::WebPage::viewportConfigurationChanged):

2019-07-19  Youenn Fablet  <youenn@apple.com>

        Remote WebInspector should enable mock capture devices in UIProcess if doing it in WebProcess
        https://bugs.webkit.org/show_bug.cgi?id=199924
        <rdar://problem/50552067>

        Reviewed by Devin Rousso.

        Add IPC plumbery to pass inspector override value for mock capture devices.
        Add an override in UserMediaPermissionRequestManagerProxy so that the value stays in sync with web inspector.
        The override will be removed when web inspector goes away.

        * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
        (WebKit::UserMediaPermissionRequestManagerProxy::syncWithWebCorePrefs const):
        * UIProcess/UserMediaPermissionRequestManagerProxy.h:
        (WebKit::UserMediaPermissionRequestManagerProxy::setMockCaptureDevicesEnabledOverride):
        * UIProcess/WebInspectorProxy.cpp:
        (WebKit::WebInspectorProxy::setMockCaptureDevicesEnabled):
        * UIProcess/WebInspectorProxy.h:
        * UIProcess/WebInspectorProxy.messages.in:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::setMockCaptureDevicesEnabledOverride):
        * UIProcess/WebPageProxy.h:
        * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
        (WebKit::WebInspectorClient::setMockCaptureDevicesEnabled):
        * WebProcess/WebCoreSupport/WebInspectorClient.h:
        * WebProcess/WebPage/WebInspector.cpp:
        (WebKit::WebInspector::setMockCaptureDevicesEnabled):
        * WebProcess/WebPage/WebInspector.h:

2019-07-19  Tim Horton  <timothy_horton@apple.com>

        Web Content process gets stuck suspended after navigating away from a system preview
        https://bugs.webkit.org/show_bug.cgi?id=199965
        <rdar://problem/53109004>

        Reviewed by Dean Jackson.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _isBackground]):
        * UIProcess/ios/WKSystemPreviewView.h:
        * UIProcess/ios/WKSystemPreviewView.mm:
        (-[WKSystemPreviewView web_initWithFrame:webView:mimeType:]):
        (-[WKSystemPreviewView web_isBackground]):
        Apply the fix from r193481 to WKSystemPreviewView as well, having it
        become a WKApplicationStateTrackingView and plumbing that through
        to our is-background machinery.

        We really, really should instead have WKWebView itself be the application
        state tracking view, but that is a bigger change (and has some implications
        for full-screen video and whatnot).

2019-07-19  Dean Jackson  <dino@apple.com>

        Provide correct names for UIContextMenuInteraction API replacements
        https://bugs.webkit.org/show_bug.cgi?id=199966

        Reviewed by Tim Horton.

        We had some old incorrect names for replacements to SPI. While
        here, I reordered and expanded the documentation for the new API.

        * UIProcess/API/Cocoa/WKUIDelegate.h:
        * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:

2019-07-19  Daniel Bates  <dabates@apple.com>

        [iOS] REGRESSION (r241734): Autocorrection highlight should hide when field becomes defocused
        https://bugs.webkit.org/show_bug.cgi?id=199807
        <rdar://problem/52760259>

        Reviewed by Wenson Hsieh.

        Sometimes the correction highlight may not hide when defocusing an editable field.
        This occurs only when a person pressed a key in a non-editable element beforehand.
        We need to reset some state to force a re-computation of whether a keyboard is still
        needed whenever an element is defocused (blurred in web paralance).

        Following r241734 both editable and non-editable key events are handled using the same
        code path. This is accomplished by having WKContentView's -_requiresKeyboardWhenFirstResponder
        return YES to tell UIKit it needs a keyboard even when there is no editable element focused.
        As a result UIKit retains all the keyboard state, including keeping the correction highlight
        visible. Prior to r241734 WKContentView's -_requiresKeyboardWhenFirstResponder would not return
        YES when a non-editable element was focused and hence UIKit would tear down the keyboard
        and its state, including the correction highlight. In r245154, we made keyboard instantiate
        for a focused non-editable element lazy as a performance optimization. Although r245154
        kept the r241734 behavior (just made it lazy) it re-wrote the code in such a way that we
        can utilize it as a hook to fix this bug. In particular, we now clear the bit about a
        seen keydown in a non-editable element whenever we are defocusing an editable element
        before we reload the input views, as part of hiding the keyboard. On the reload, UIKit
        will call -_requiresKeyboardWhenFirstResponder, WebKit will respond with NO now that
        a non-editable element is focused and hence UIKit will do what it did pre r241734: tear
        down the keyboard.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _didCommitLoadForMainFrame]): Clear the bit about a seen keydown here
        so that we don't keep the keyboard around on a new page commit. This includes the case
        when the same page is reloaded. There is not much advantage to keeping the keyboard
        around across reloads and not doing so will reduce our memory footprint. 
        (-[WKContentView _elementDidBlur]): Clear the same bit as well when defocusing an
        editable element. This will cause UIKit to tear down the keyboard on reload removing
        the correction highlight.

2019-07-19  Dean Jackson  <dino@apple.com>

        Add a menu item to toggle between showing and hiding link previews
        https://bugs.webkit.org/show_bug.cgi?id=199940
        <rdar://problem/53032288>

        Reviewed by Beth Dakin.

        Add a new _WKElementAction that toggles the display of link previews
        in context menus, and add it to the default set of actions we provide
        for links.

        When a UIAction is created from this new _WKElementAction type,
        it can be identified by WKElementActionTypeToggleShowLinkPreviewsIdentifier.
        This allows us to check a UIMenu provided by a delegate to make sure
        that they have provided the toggle menu item. If they haven't, we add it
        back.

        The preference for showing links is moved from kCFPreferencesAnyApplication
        to standard user defaults, so that it can be set no matter what the
        hosting application is.

        * UIProcess/API/Cocoa/_WKElementAction.h: New action type.
        * UIProcess/API/Cocoa/_WKElementAction.mm: 
        (+[_WKElementAction _elementActionWithType:customTitle:assistant:]):
        (+[_WKElementAction imageForElementActionType:]): Use eye.fill for now.
        I'll need to check with HI to see if there is a more appropriate glyph.
        (elementActionTypeToUIActionIdentifier):
        (uiActionIdentifierToElementActionType):

        * UIProcess/ios/WKActionSheetAssistant.mm: Add the toggle action to
        the default set.
        (-[WKActionSheetAssistant defaultActionsForLinkSheet:]):

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _registerPreview]): No need to listen for CFPreferences
        notifications any more.
        (-[WKContentView _unregisterPreview]):
        (menuWithShowLinkPreviewAction): New method that adds the UIAction
        for toggling previews to a UIMenu if necessary.
        (-[WKContentView assignLegacyDataForContextMenuInteraction]):
        (-[WKContentView _contextMenuInteraction:configurationForMenuAtLocation:completion:]):
        (-[WKContentView _showLinkPreviewsPreferenceChanged:]): Deleted.
        (titleForMenu): Deleted. URL text previews will be provided separately.

2019-07-19  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] Entering 2FA code on idmsa.apple.com causes unexpected scrolling
        https://bugs.webkit.org/show_bug.cgi?id=199949
        <rdar://problem/49944428>

        Reviewed by Tim Horton and Megan Gardner.

        Since at least iOS 11, -[UIScrollView _adjustForAutomaticKeyboardInfo:animated:lastAdjustment:] adjusts the
        scroll view's content offset to account for updated keyboard bottom insets. In WebKit, we call this method
        whenever keyboard geometry changes (based on system notifications, such as UIKeyboardWillHideNotification).

        When switching between focused form fields, we hide the keyboard for the previous focused element prior to
        showing the keyboard for the newly focused element. This means that we will actually dismiss the keyboard in the
        process of changing the focused element, which posts keyboard geometry notifications, which causes us to scroll
        WKScrollView.

        On iOS 12, this would be immediately followed by re-presenting the keyboard for the new focused element, which
        causes us to adjust the scroll view back to its original position right away; this means that the scrolling that
        happens as a result of adjusting for the keyboard insets after dismissal doesn't result in any visible change.

        However, on iOS 13, after r239441 and r244546, we now defer scrolling and zooming to reveal the focused element
        until later; this means the scrolling that happens as a result of initially dismissing the keyboard now causes a
        consistent jump in the scroll view's scroll position (whereas on iOS 12, this only happens rarely, and the jump
        is also less noticeable).

        To mitigate this, we detect the case where we're moving focus from one element to another; if we're about to
        show a keyboard for the newly focused element, then we should avoid scrolling as a result of the impending
        "keyboard will hide" notification.

        Test: fast/forms/ios/no-scrolling-when-moving-focus-between-adjacent-fields.html

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _keyboardChangedWithInfo:adjustScrollView:]):
        (-[WKWebView _keyboardWillHide:]):
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (shouldShowKeyboardForElement):

        Add a helper to determine whether we're focusing an element which presents a "keyboard" (i.e. a UIKit input
        view, as opposed to modal select pickers, modal date pickers, or fields with inputmode="none", for which we
        don't show an input view).

        (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:activityStateChanges:userObject:]):
        (-[WKContentView shouldIgnoreKeyboardWillHideNotification]):

2019-07-18  Alex Christensen  <achristensen@webkit.org>

        Fix warning when importing WebKit in Swift
        https://bugs.webkit.org/show_bug.cgi?id=199914
        <rdar://problem/52854930>

        Reviewed by Wenson Hsieh.

        * UIProcess/API/Cocoa/NSAttributedString.h:
        Declare NSAttributedString and update a swift name.
        This fix was proposed by Argyrios Kyrtzidis.

2019-07-18  Alex Christensen  <achristensen@webkit.org>

        Add and test _WKWebsiteDataStoreConfiguration.deviceIdHashSaltsStorageDirectory SPI
        https://bugs.webkit.org/show_bug.cgi?id=199923

        Reviewed by Youenn Fablet.

        This is a step towards us getting rid of WebsiteDataStore::legacyDefaultDataStoreConfiguration

        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _initWithConfiguration:]):
        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
        (-[_WKWebsiteDataStoreConfiguration deviceIdHashSaltsStorageDirectory]):
        (-[_WKWebsiteDataStoreConfiguration setDeviceIdHashSaltsStorageDirectory:]):

2019-07-18  Alex Christensen  <achristensen@webkit.org>

        Move NetworkCache ownership from NetworkProcess to NetworkSession
        https://bugs.webkit.org/show_bug.cgi?id=199817

        Reviewed by Geoff Garen.

        I also added SPI to set the path of the NetworkCache with an API test.
        If this new SPI is not used, it falls back to getting the cache location from the NetworkProcess to maintain compatibility.
        We still get options, cache size, and cache model from the NetworkProcess.  Those should be migrated with new SPI later.
        Clearing the cache and other operations now iterate the NetworkSessions instead of assuming there is only one cache.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::fetchWebsiteData):
        (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
        (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
        (WebKit::NetworkProcess::registrableDomainsWithWebsiteData):
        (WebKit::NetworkProcess::setCacheModel):
        * NetworkProcess/NetworkProcess.h:
        (WebKit::NetworkProcess::diskCacheDirectory const):
        (WebKit::NetworkProcess::cacheOptions const):
        (WebKit::NetworkProcess::cache): Deleted.
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::m_shouldCaptureExtraNetworkLoadMetrics):
        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::NetworkSession):
        * NetworkProcess/NetworkSession.h:
        (WebKit::NetworkSession::cache):
        * NetworkProcess/NetworkSessionCreationParameters.cpp:
        (WebKit::NetworkSessionCreationParameters::encode const):
        (WebKit::NetworkSessionCreationParameters::decode):
        * NetworkProcess/NetworkSessionCreationParameters.h:
        * NetworkProcess/cache/NetworkCache.cpp:
        (WebKit::NetworkCache::Cache::open):
        (WebKit::NetworkCache::Cache::Cache):
        * NetworkProcess/cache/NetworkCache.h:
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
        (WebKit::NetworkProcess::clearDiskCache):
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
        * NetworkProcess/curl/NetworkSessionCurl.cpp:
        (WebKit::NetworkSessionCurl::NetworkSessionCurl):
        * NetworkProcess/soup/NetworkSessionSoup.cpp:
        (WebKit::NetworkSessionSoup::NetworkSessionSoup):
        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _initWithConfiguration:]):
        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
        (-[_WKWebsiteDataStoreConfiguration networkCacheDirectory]):
        (-[_WKWebsiteDataStoreConfiguration setNetworkCacheDirectory:]):
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::parameters):
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        (WebKit::WebsiteDataStore::resolvedNetworkCacheDirectory const):

2019-07-18  Chris Dumez  <cdumez@apple.com>

        Regression(r247486) Multiple Layout Tests in http/tests/cache/* are crashing on iOS Debug WK2
        https://bugs.webkit.org/show_bug.cgi?id=199892
        <rdar://problem/53230217>

        Reviewed by Geoffrey Garen.

        The StorageManager was unregistering itself as a WorkQueueMessageReceiver on a given IPC
        connection too early. As a result, we would sometimes receive a 'StorageManager:DestroyStorageMap'
        IPC in NetworkConnectionToWebProcess::didReceiveMessage() with nobody to process it, which would
        trigger an assertion. To address the issue, we stop unregistering the StorageManager as a
        WorkQueueMessageReceiver inside removeAllowedSessionStorageNamespaceConnection(). Instead, we
        let the logic inside processDidCloseConnection() take care of it once the connection closes.

        * NetworkProcess/WebStorage/StorageManager.cpp:
        (WebKit::StorageManager::removeAllowedSessionStorageNamespaceConnection):
        (WebKit::StorageManager::processDidCloseConnection):
        * NetworkProcess/WebStorage/StorageManager.h:

2019-07-18  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Crash in webkitWebViewBaseRenderHostFileDescriptor
        https://bugs.webkit.org/show_bug.cgi?id=199402

        Reviewed by Michael Catanzaro.

        There are two problems here:

         - We need to ensure that the checks we do in HardwareAccelerationManager to disable AC mode are the same
           as the ones done in AcceleratedBackingStore create() methods. This is not the case for WPE renderer.
         - Some of the places where accelerateBackingStore is used, can be called even if AC mode is disabled, so we
           need to null-check there before using the backing store.

        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (webkitWebViewBaseDraw): Add an assert to ensure accelerateBackingStore is not nullptr here.
        (webkitWebViewBaseEnterAcceleratedCompositingMode): Ditto.
        (webkitWebViewBaseUpdateAcceleratedCompositingMode): Ditto.
        (webkitWebViewBaseExitAcceleratedCompositingMode): Ditto.
        (webkitWebViewBaseMakeGLContextCurrent): Ditto.
        (webkitWebViewBaseDidRelaunchWebProcess): Null-check accelerateBackingStore before using it.
        (webkitWebViewBasePageClosed): Ditto.
        (webkitWebViewBaseRenderHostFileDescriptor): Ditto.
        * UIProcess/gtk/AcceleratedBackingStore.cpp:
        (WebKit::AcceleratedBackingStore::checkRequirements): Call AcceleratedBackingStoreWayland::checkRequirements()
        or AcceleratedBackingStoreX11::checkRequirements() depending on the current display.
        (WebKit::AcceleratedBackingStore::create): Return early if AC mode is disabled in HardwareAccelerationManager.
        * UIProcess/gtk/AcceleratedBackingStore.h:
        * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
        (WebKit::AcceleratedBackingStoreWayland::checkRequirements): Check requirements for hardware acceleration in Wayland.
        (WebKit::AcceleratedBackingStoreWayland::create): Assert that requirements are present.
        * UIProcess/gtk/AcceleratedBackingStoreWayland.h:
        * UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
        (WebKit::AcceleratedBackingStoreX11::checkRequirements): Check requirements for hardware acceleration in X11.
        (WebKit::AcceleratedBackingStoreX11::create): Assert that requirements are present.
        * UIProcess/gtk/AcceleratedBackingStoreX11.h:
        * UIProcess/gtk/HardwareAccelerationManager.cpp:
        (WebKit::HardwareAccelerationManager::HardwareAccelerationManager): Use
        AcceleratedBackingStore::checkRequirements() to decide whether to disable AC mode.

2019-07-17  Megan Gardner  <megan_gardner@apple.com>

        Early Out of positionInfomation check if possible
        https://bugs.webkit.org/show_bug.cgi?id=199885
        <rdar://problem/53229413>

        This is an early-out check that happens after most of the work is done.
        Move it to happen before we make all these calls, if in the end, we will not use the information.

        Reviewed by Tim Horton.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):

2019-07-17  Chris Dumez  <cdumez@apple.com>

        Unreviewed, add debug logging to help diagnose flaky crashes on the bots.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):

2019-07-17  Tim Horton  <timothy_horton@apple.com>

        [macCatalyst] Unable to interact with YouTube video while it's playing
        https://bugs.webkit.org/show_bug.cgi?id=199893
        <rdar://problem/51871151>

        Reviewed by Simon Fraser.

        * Platform/spi/ios/UIKitSPI.h:
        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
        (-[WKRemoteView initWithFrame:contextID:]):
        (-[WKUIRemoteView initWithFrame:pid:contextID:]):
        Disable remote context hit-testing for WKUIRemoteView just like we
        already do for WKRemoteView.

2019-07-17  Chris Dumez  <cdumez@apple.com>

        Prewarm local storage in the NetworkProcess to reduce WebContent process hangs
        https://bugs.webkit.org/show_bug.cgi?id=199879
        <rdar://problem/53217757>

        Reviewed by Ryosuke Niwa.

        * NetworkProcess/WebStorage/StorageManager.cpp:
        (WebKit::StorageManager::prewarm):
        (WebKit::StorageManager::getValues):
        * NetworkProcess/WebStorage/StorageManager.h:
        * NetworkProcess/WebStorage/StorageManager.messages.in:
        * WebProcess/WebStorage/StorageAreaImpl.cpp:
        (WebKit::StorageAreaImpl::prewarm):
        * WebProcess/WebStorage/StorageAreaImpl.h:
        * WebProcess/WebStorage/StorageAreaMap.cpp:
        (WebKit::StorageAreaMap::loadValuesIfNeeded):
        (WebKit::StorageAreaMap::prewarm):
        * WebProcess/WebStorage/StorageAreaMap.h:

2019-07-19  Simon Fraser  <simon.fraser@apple.com>

        [iOS WK2] Allow scrolling interaction on frames and oveflow scroll even when the main frame is rubber-banding
        https://bugs.webkit.org/show_bug.cgi?id=199963
        rdar://problem/52897797

        Reviewed by Tim Horton.

        Adopt UIKit SPI to allow for scrolling of inner UIScrollViews when the outer one is still rubber-banding.

        * Platform/spi/ios/UIKitSPI.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]):
        * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
        (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren):

2019-07-17  Megan Gardner  <megan_gardner@apple.com>

        Set WordIsNearTap flag, was not being set at all before
        https://bugs.webkit.org/show_bug.cgi?id=199880

        Reviewed by Wenson Hsieh.

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

2019-07-17  Jiewen Tan  <jiewen_tan@apple.com>

        Provide a NSURL cateogry to tell AppSSO Kerberos URLs
        https://bugs.webkit.org/show_bug.cgi?id=199887
        <rdar://problem/52323161>

        Reviewed by Brent Fulgham.

        * UIProcess/Cocoa/SOAuthorization/SOAuthorizationNSURLExtras.h:
        * UIProcess/Cocoa/SOAuthorization/SOAuthorizationNSURLExtras.mm:
        (+[NSURL _web_willPerformSOKerberosAuthorizationWithURL:]):

2019-07-17  Antoine Quint  <graouts@apple.com>

        Disable Pointer Events prior to watchOS 6
        https://bugs.webkit.org/show_bug.cgi?id=199890
        <rdar://problem/53206113>

        Reviewed by Dean Jackson.

        * Configurations/FeatureDefines.xcconfig:

2019-07-17  Daniel Bates  <dabates@apple.com>

        Typing into a cell in a Google Sheet lags behind by one character
        https://bugs.webkit.org/show_bug.cgi?id=199587
        <rdar://problem/51616845>

        Reviewed by Brent Fulgham.

        Remove all timers from the holding tank on text insertion or deletion (represented as an
        editing command). Timers that were in the holding tank never stopped ticking and will now
        be able to execute their action.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::executeEditingCommand):
        (WebKit::WebPage::insertTextAsync):
        (WebKit::WebPage::setCompositionAsync):
        (WebKit::WebPage::confirmCompositionAsync):
        Call platformWillPerformEditingCommand().

        * WebProcess/WebPage/WebPage.h:
        (WebKit::WebPage::platformWillPerformEditingCommand): Added.
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::platformWillPerformEditingCommand): Remove all the timers from the holding
        tank if we have a holding tank.

2019-07-17  Darin Adler  <darin@apple.com>

        No need for isURLAllowed function in Frame
        https://bugs.webkit.org/show_bug.cgi?id=120266

        Reviewed by Alex Christensen.

        * WebProcess/Automation/WebAutomationSessionProxy.cpp:
        (WebKit::WebAutomationSessionProxy::resolveChildFrameWithNodeHandle):
        Use is<HTMLFrameElementBase> instead of isFrameElementBase.

2019-07-17  Alex Christensen  <achristensen@webkit.org>

        Add a runtime-disabled dialog element skeleton
        https://bugs.webkit.org/show_bug.cgi?id=199839

        Reviewed by Ryosuke Niwa.

        * Shared/WebPreferences.yaml:
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetDialogElementEnabled):
        (WKPreferencesGetDialogElementEnabled):
        * UIProcess/API/C/WKPreferencesRefPrivate.h:
        Add SPI to enable the dialog element for tests.

2019-07-17  Ryosuke Niwa  <rniwa@webkit.org>

        [iOS] Option + Up or Down Arrow key doesn’t move cursor past paragraph boundaries in WebKit2
        https://bugs.webkit.org/show_bug.cgi?id=199851

        Reviewed by Wenson Hsieh.

        The bug was caused by the difference in the way AppKit and UIKit responds to Option + Up / Down.

        On macOS, AppKit sends moveForward before sending moveToStartOfParagraph and moveBackward
        before sending moveToEndOfParagraph. As a result, when Option + Down is pressed when we are at
        the end of a line, we would first move to the beginning of the next line (i.e. after the line break)
        before moving or extending selection with the paragraph boundary granurality.

        On iOS, UIKit only calls _moveToStartOfParagraph without moving forward by a character. As a result,
        moving forward by the paragraph boundary granurality immediately stops when we're starting at the
        end of a line when Option + Down is pressed. Option + Up case is similar.

        Fix the bug on iOS by emulating what happens on macOS. Namely, move the selection forward or backward
        by the character granurality before moving by the paragraph boundary granurality.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _moveToStartOfParagraph:withHistory:]):
        (-[WKContentView _moveToEndOfParagraph:withHistory:]):

2019-07-17  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Fix GTK and WPE debug build after r247508

        * UIProcess/API/glib/WebKitWebResource.cpp:
        (webkitWebResourceCreate): Remove invalid assert.

2019-07-17  Carlos Garcia Campos  <cgarcia@igalia.com>

        [WPE][GTK] UI process crash due to NULL dereference in webkitWebViewResourceLoadStarted()
        https://bugs.webkit.org/show_bug.cgi?id=199621

        Reviewed by Michael Catanzaro.

        Null-check frame received in injected bundle message to ensure the frame hasn't been destroyed.

        * UIProcess/API/glib/WebKitInjectedBundleClient.cpp:
        * UIProcess/API/glib/WebKitWebResource.cpp:
        (webkitWebResourceCreate): Receive a reference to the frame instead of a pointer.
        * UIProcess/API/glib/WebKitWebResourcePrivate.h:
        * UIProcess/API/glib/WebKitWebView.cpp:
        (webkitWebViewResourceLoadStarted): Ditto.
        * UIProcess/API/glib/WebKitWebViewPrivate.h:

2019-07-17  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] Do not assert when receiving invalid data in injected bundle messages
        https://bugs.webkit.org/show_bug.cgi?id=199830

        Reviewed by Michael Catanzaro.

        Just silently ignore them to avoid UI process crashes.

        * UIProcess/API/glib/WebKitInjectedBundleClient.cpp:

2019-07-17  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] No web view updates after swapping web process if AC mode is forced
        https://bugs.webkit.org/show_bug.cgi?id=199826

        Reviewed by Michael Catanzaro.

        This is because when AC mode is forced the provisional page creates a drawing area that is always in AC
        mode. When swapping processes, the current drawing area is destroyed (which exists AC mode) and the provisional
        one is set. From that point the web process is in AC mode but the UI process isn't. We need to update the
        compositing mode when swapping processes.

        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (webkitWebViewBaseDidExitWebProcess):
        * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h:

2019-07-16  Antoine Quint  <graouts@apple.com>

        REGRESSION: fast/events/watchos/double-tap-to-zoom* tests crashing in com.apple.WebKit: -[WKContentView(WKInteraction) _singleTapDidReset:]
        https://bugs.webkit.org/show_bug.cgi?id=199840
        <rdar://problem/52856531>

        Reviewed by Wenson Hsieh.

        We need to ensure the NSNumber used for -[WKSyntheticTapGestureRecognizer lastActiveTouchIdentifier] is retained. This innocent change required
        the use of RetainPtr<>, which required the move to an Objective-C++ file, which lead to a change in the order files are unified, which lead to
        build errors, which leads to a much bigger patch than just the source change necessary to fix the crash.

        * SourcesCocoa.txt:
        * UIProcess/ios/WKSyntheticTapGestureRecognizer.mm: Renamed from Source/WebKit/UIProcess/ios/WKSyntheticTapGestureRecognizer.m.
        * UIProcess/ios/forms/WKFormPeripheralBase.h:
        * UIProcess/ios/forms/WKFormPeripheralBase.mm:
        * WebKit.xcodeproj/project.pbxproj:

2019-07-16  Brent Fulgham  <bfulgham@apple.com>

        Update WebContent Process sandbox based on user seed data
        https://bugs.webkit.org/show_bug.cgi?id=199799
        <rdar://problem/52903477>

        Reviewed by Alexey Proskuryakov.

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

2019-07-16  Andy Estes  <aestes@apple.com>

        [macCatalyst] Do not include WebKitLegacy.h in WebKit.h
        https://bugs.webkit.org/show_bug.cgi?id=199833
        <rdar://problem/53036744>

        Reviewed by Tim Horton.

        * Shared/API/Cocoa/WebKit.h:

2019-07-16  Frederic Wang  <fwang@igalia.com>

        Fix build warning because of missing super_class initializer
        https://bugs.webkit.org/show_bug.cgi?id=199825

        Reviewed by Jonathan Bedard.

        * UIProcess/ios/WKContentView.mm:
        (keyCommandsPlaceholderHackForEvernote):

2019-07-16  Tim Horton  <timothy_horton@apple.com>

        NSTextFinder holes don't scroll with the page
        https://bugs.webkit.org/show_bug.cgi?id=199815
        <rdar://problem/52280514>

        Reviewed by Simon Fraser.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _usePlatformFindUI]):
        (-[WKWebView _setUsePlatformFindUI:]):
        (-[WKWebView _ensureTextFinderClient]):
        Add a bit so that clients can choose whether they want our find UI,
        which respects scrolling, or the system find UI, which works when
        doing multi-document searches. Right now you can't have both.

        (-[WKWebView scrollFindMatchToVisible:]):
        Implement and plumb scrollFindMatchToVisible.

        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::indicateFindMatch):
        * UIProcess/WebPageProxy.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::indicateFindMatch):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        Plumb indicateFindMatch to FindController.

        * UIProcess/mac/WKTextFinderClient.h:
        * UIProcess/mac/WKTextFinderClient.mm:
        (-[WKTextFinderClient initWithPage:view:usePlatformFindUI:]):
        Store whether or not we are using the platform find UI.

        (-[WKTextFinderClient findMatchesForString:relativeToMatch:findOptions:maxResults:resultCollector:]):
        If using WebKit find UI, turn on our UI in the options passed to findString[Matches].

        (-[WKTextFinderClient scrollFindMatchToVisible:]):
        If using WebKit find UI, when the platform tells us to reveal a find match, indicate it.

        (-[WKTextFinderClient didFindStringMatchesWithRects:didWrapAround:]):
        If using WebKit find UI, lie to the platform and return no rects so that it doesn't paint a yellow rectangle.

        (-[WKTextFinderClient getImageForMatchResult:completionHandler:]):
        If using WebKit find UI, lie to the platform and return no image so that it doesn't paint a yellow rectangle.

        (-[WKTextFinderClient initWithPage:view:]): Deleted.

        * WebProcess/WebPage/FindController.cpp:
        (WebKit::FindController::updateFindUIAfterPageScroll):
        Make it possible to use our find UI with 'findStringMatches'; since the platform
        find infrastrucutre depends on knowing about all matches up front, we need
        to use 'findStringMatches' instead of 'findString', but we had never combined
        that with our UI. Don't throw away the other matches when we indicate one, and
        don't send DidFindString in the case we are coming from 'findStringMatches'.
        This all needs a bit of cleanup in the future.

        (WebKit::FindController::findString):
        Tell updateFindUIAfterPageScroll that we are 'findString' so that it uses its normal behavior.

        (WebKit::FindController::findStringMatches):
        Tell updateFindUIAfterPageScroll that we are 'findStringMatches' so that it uses the adjusted behavior.

        (WebKit::FindController::indicateFindMatch):
        Add 'indicateFindMatch', which both selects the match and moves the indicator there.

        * WebProcess/WebPage/FindController.h:

2019-07-16  Chris Dumez  <cdumez@apple.com>

        Speed up StorageManager::getValues()
        https://bugs.webkit.org/show_bug.cgi?id=199812

        Reviewed by Alex Christensen.

        Made the following performance improvements:
        - Made StorageManager a WorkQueueMessageReceiver again (like it was before it
          got moved from the UIProcess to the Network process). This avoids a lot of
          thread hopping (IPC thread -> Main thread -> StorageManagerThread -> Main Thread)
          and a lot of isolatedCopying of the strings.
        - Move values around when possible to avoid copying.
        - Add fast path to StorageMap::importItems() for when the StorageMap is
          empty when importing (15ms -> 2.5ms).

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
        (WebKit::NetworkConnectionToWebProcess::didReceiveSyncMessage):
        * NetworkProcess/WebStorage/LocalStorageDatabase.cpp:
        (WebKit::LocalStorageDatabase::importItems):
        * NetworkProcess/WebStorage/StorageManager.cpp:
        (WebKit::StorageManager::addAllowedSessionStorageNamespaceConnection):
        (WebKit::StorageManager::removeAllowedSessionStorageNamespaceConnection):
        (WebKit::StorageManager::processDidCloseConnection):
        (WebKit::StorageManager::createLocalStorageMap):
        (WebKit::StorageManager::createTransientLocalStorageMap):
        (WebKit::StorageManager::createSessionStorageMap):
        (WebKit::StorageManager::destroyStorageMap):
        (WebKit::StorageManager::getValues):
        (WebKit::StorageManager::setItem):
        (WebKit::StorageManager::setItems):
        (WebKit::StorageManager::removeItem):
        (WebKit::StorageManager::clear):
        * NetworkProcess/WebStorage/StorageManager.h:

        * Platform/IPC/Connection.cpp:
        (IPC::Connection::addWorkQueueMessageReceiver):
        (IPC::Connection::removeWorkQueueMessageReceiver):
        (IPC::Connection::processIncomingMessage):
        (IPC::Connection::dispatchMessage):
        (IPC::Connection::dispatchMessageToWorkQueueReceiver):
        * Platform/IPC/Connection.h:
        * WebProcess/WebStorage/StorageAreaMap.cpp:
        (WebKit::StorageAreaMap::loadValuesIfNeeded):
        Messages to WorkQueueMessageReceivers are normally dispatched from the IPC WorkQueue. However, there is a race if
        a client (here StorageManager) adds itself as a WorkQueueMessageReceiver as a result of receiving an IPC message
        on the main thread (here NetworkConnectionToWebProcess::WebPageWasAdded).
        The message might have already been dispatched from the IPC WorkQueue to the main thread by the time the
        client registers itself as a WorkQueueMessageReceiver. To address this, we check again for messages receivers
        once the message arrives on the main thread.

2019-07-16  Zalan Bujtas  <zalan@apple.com>

        [ContentChangeObserver] Cancel ongoing content observation when tap is failed/cancelled
        https://bugs.webkit.org/show_bug.cgi?id=199828
        <rdar://problem/53152696>

        Reviewed by Wenson Hsieh.

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::commitPotentialTapFailed):
        (WebKit::WebPage::cancelPotentialTap):

2019-07-15  Alex Christensen  <achristensen@webkit.org>

        Remove redundant WebsiteDataStoreConfiguration member
        https://bugs.webkit.org/show_bug.cgi?id=199820

        Reviewed by Geoffrey Garen.

        m_webStorageDirectory was only used for _WKWebsiteDataStoreConfiguration._webStorageDirectory's backing,
        which was copied over to m_localStorageDirectory of a new object in WKWebsiteDataStore's _initWithConfiguration.
        This is a baby step towards cleaning up this mess with no behavior change.  I see no reason to rename the SPI.

        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
        (-[_WKWebsiteDataStoreConfiguration _webStorageDirectory]):
        (-[_WKWebsiteDataStoreConfiguration _setWebStorageDirectory:]):
        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
        (WebKit::WebsiteDataStoreConfiguration::copy):
        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
        (WebKit::WebsiteDataStoreConfiguration::webStorageDirectory const): Deleted.
        (WebKit::WebsiteDataStoreConfiguration::setWebStorageDirectory): Deleted.

2019-07-15  Fujii Hironori  <Hironori.Fujii@sony.com>

        Make WKURLSchemeTask thread safe
        https://bugs.webkit.org/show_bug.cgi?id=199764

        Unreviewed build fix for WinCairo port.

        Source\WebKit\UIProcess\socket\RemoteInspectorProtocolHandler.cpp(82): error C2039: 'request': is not a member of 'WebKit::WebURLSchemeTask'

        * UIProcess/WebURLSchemeTask.h:
        (WebKit::WebURLSchemeTask::request const): Restored WebURLSchemeTask::request with a threading assertion.

2019-07-15  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r247444.

        Caused two scrolling tests to fail on iOS Simulator

        Reverted changeset:

        "Typing into a cell in a Google Sheet lags behind by one
        character"
        https://bugs.webkit.org/show_bug.cgi?id=199587
        https://trac.webkit.org/changeset/247444

2019-07-15  Zalan Bujtas  <zalan@apple.com>

        outlook.live.com has odd viewport with edge gap
        https://bugs.webkit.org/show_bug.cgi?id=199822
        <rdar://problem/53029072>

        Reviewed by Wenson Hsieh.

        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::setViewportConfigurationViewLayoutSize):
        (WebKit::WebPage::dynamicViewportSizeUpdate):
        (WebKit::WebPage::resetViewportDefaultConfiguration):
        (WebKit::WebPage::immediatelyShrinkToFitContent):
        (WebKit::WebPage::viewLayoutSizeAdjustedForQuirks): Deleted.

2019-07-11  Myles C. Maxfield  <mmaxfield@apple.com>

        New York font erroneously gets synthetic bold
        https://bugs.webkit.org/show_bug.cgi?id=199653
        <rdar://problem/51692592>

        Reviewed by Simon Fraser.

        Add the SPI to enable the new fonts.

        * Shared/WebPreferences.yaml:
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetShouldAllowDesignSystemUIFonts):
        (WKPreferencesGetShouldAllowDesignSystemUIFonts):
        * UIProcess/API/C/WKPreferencesRefPrivate.h:
        * UIProcess/API/Cocoa/WKPreferences.mm:
        (-[WKPreferences _shouldAllowDesignSystemUIFonts]):
        (-[WKPreferences _setShouldAllowDesignSystemUIFonts:]):
        * UIProcess/API/Cocoa/WKPreferencesPrivate.h:

2019-07-15  Brady Eidson  <beidson@apple.com>

        Make WKURLSchemeTask thread safe.
        <rdar://problem/50471863> and https://bugs.webkit.org/show_bug.cgi?id=199764

        Reviewed by Alex Christensen.

        Punt most of the WKURLSchemeTask operations back to the main thread.
        Make accessing the NSURLRequest be thread safe with lock protection.

        * UIProcess/API/Cocoa/WKURLSchemeTask.mm:
        (getExceptionTypeFromMainRunLoop):
        (-[WKURLSchemeTaskImpl dealloc]):
        (-[WKURLSchemeTaskImpl request]):
        (-[WKURLSchemeTaskImpl _requestOnlyIfCached]):
        (-[WKURLSchemeTaskImpl didReceiveResponse:]):
        (-[WKURLSchemeTaskImpl didReceiveData:]):
        (-[WKURLSchemeTaskImpl didFinish]):
        (-[WKURLSchemeTaskImpl didFailWithError:]):
        (-[WKURLSchemeTaskImpl _didPerformRedirection:newRequest:]):

        * UIProcess/WebURLSchemeTask.cpp:
        (WebKit::WebURLSchemeTask::WebURLSchemeTask):
        (WebKit::WebURLSchemeTask::~WebURLSchemeTask):
        (WebKit::WebURLSchemeTask::didPerformRedirection):
        (WebKit::WebURLSchemeTask::didReceiveResponse):
        (WebKit::WebURLSchemeTask::didReceiveData):
        (WebKit::WebURLSchemeTask::didComplete):
        (WebKit::WebURLSchemeTask::pageDestroyed):
        (WebKit::WebURLSchemeTask::stop):
        (WebKit::WebURLSchemeTask::nsRequest const):

        * UIProcess/WebURLSchemeTask.h:
        (WebKit::WebURLSchemeTask::identifier const):
        (WebKit::WebURLSchemeTask::pageID const):
        (WebKit::WebURLSchemeTask::process):
        (WebKit::WebURLSchemeTask::process const): Deleted.
        (WebKit::WebURLSchemeTask::request const): Deleted.

2019-07-15  Wenson Hsieh  <wenson_hsieh@apple.com>

        Followup to r247439
        https://bugs.webkit.org/show_bug.cgi?id=199788
        <rdar://problem/52142570>

        Reviewed by Tim Horton.

        As it turns out, sending modern async completion-handler based IPC messages while processing incoming sync
        messages results in a debug assertion. Instead of migrating FontAtSelection to the new async IPC mechanism,
        restore the older CallbackID-based async IPC.

        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/mac/WebPageProxyMac.mm:
        (WebKit::WebPageProxy::fontAtSelection):
        (WebKit::WebPageProxy::fontAtSelectionCallback):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/mac/WebPageMac.mm:
        (WebKit::WebPage::fontAtSelection):

2019-07-15  Dean Jackson  <dino@apple.com>

        [WebGL] Remove software rendering and simplify context creation on macOS
        https://bugs.webkit.org/show_bug.cgi?id=199789

        Reviewed by Sam Weinig.

        Remove force software WebGL setting.

        * Shared/WebPreferences.yaml:
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetForceSoftwareWebGLRendering): Deleted.
        (WKPreferencesGetForceSoftwareWebGLRendering): Deleted.
        * UIProcess/API/C/WKPreferencesRefPrivate.h:

2019-07-15  Daniel Bates  <dabates@apple.com>

        Typing into a cell in a Google Sheet lags behind by one character
        https://bugs.webkit.org/show_bug.cgi?id=199587
        <rdar://problem/51616845>

        Reviewed by Brent Fulgham.

        Remove all timers from the holding tank on text insertion or deletion (represented as an
        editing command). Timers that were in the holding tank never stopped ticking and will now
        be able to execute their action.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::executeEditingCommand):
        (WebKit::WebPage::insertTextAsync):
        (WebKit::WebPage::setCompositionAsync):
        (WebKit::WebPage::confirmCompositionAsync):
        Call platformWillPerformEditingCommand().

        * WebProcess/WebPage/WebPage.h:
        (WebKit::WebPage::platformWillPerformEditingCommand): Added.
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::platformWillPerformEditingCommand): Remove all the timers from the holding
        tank if we have a holding tank.

2019-07-15  Wenson Hsieh  <wenson_hsieh@apple.com>

        [macOS 10.15] Cannot unbold selected text when the system font is used
        https://bugs.webkit.org/show_bug.cgi?id=199788
        <rdar://problem/52142570>

        Reviewed by Tim Horton.

        In macOS 10.15, +[NSFont fontWithName:size:] no longer recognizes system fonts (of name
        ".SFNS-*") and returns nil instead. However, our existing implementation of
        WebPageProxy::fontAtSelection works by grabbing the font name in the web process, and
        sending it over to the UI process, where it is mapped to an NSFont. As a result, this always
        results in a nil font in macOS 10.15, which causes us to never update NSFontManager's
        selected font. In turn, this means that once selected text is bolded, it can't be unbolded
        via NSFontManager, since NSFontManager thinks that the text is still not bold.

        To fix this, we simply encode and send a platform FontInfo instead of sending the font name.
        This allows the UI process to reconstruct NSFonts from font attribute dictionaries instead,
        and update the font manager.

        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::updateFontManagerIfNeeded):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/mac/WebPageProxyMac.mm:
        (WebKit::WebPageProxy::fontAtSelection):

        Refactor this to send a FontInfo (containing a font attribute dictionary) instead of a font
        name.

        (WebKit::WebPageProxy::fontAtSelectionCallback): Deleted.
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

        Change FontAtSelection to use sendWithAsyncReply instead of sending a callback ID. This also
        allows us to remove FontAtSelectionCallback.

        * WebProcess/WebPage/mac/WebPageMac.mm:
        (WebKit::WebPage::fontAtSelection):

2019-07-15  Jiewen Tan  <jiewen_tan@apple.com>

        [iOS] SOAuthorizationSession should tell AppSSO whether the UIClient is capable of showing the extension UI
        https://bugs.webkit.org/show_bug.cgi?id=199790
        <rdar://problem/52790112>

        Reviewed by Brent Fulgham.

        On iOS, WebKit relies on a SPI -[WKUIDelegatePrivate _presentingViewControllerForWebView:] to present the
        extension UI. However, third party clients often don't implement this SPI. Therefore, WebKit will not be
        able to present the extension UI for them.

        To be able to show the extension UI for third party WebKit clients, WebKit should unset SOAuthorization.enableEmbeddedAuthorizationViewController
        whenever clients don't implement the above SPI such that AppSSO could show the UI in their UI process.

        * UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm:
        (WebKit::SOAuthorizationSession::start):

2019-07-15  Wenson Hsieh  <wenson_hsieh@apple.com>

        REGRESSION: Chase app crashes immediately after authentication
        https://bugs.webkit.org/show_bug.cgi?id=199798
        <rdar://problem/53106179>

        Reviewed by Alex Christensen.

        After r247411, we sometimes try to consult `_page` from WKWebView, before WKWebView's `_page` has been set. This
        happens under a check for -[WKWebView _isEditable], from within -[WKContentView setupInteraction], which happens
        if the host app is not linked on the iOS 12 SDK or earlier. To mitigate this, simply add a null check in
        -_isEditable.

        There's currently no great way to test this, since we don't have a mechanism for simulating linked-on checks.

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

2019-07-13  Andres Gonzalez  <andresg_22@apple.com>

        Add accessibility support to WKDataListSuggestionsView.
        https://bugs.webkit.org/show_bug.cgi?id=199772
        <rdar://problem/47095851>

        Reviewed by Chris Fleizach.

        Added accessibility announcement notifications to show, dismiss and selection change for the datalist suggestions view.
        * UIProcess/mac/WebDataListSuggestionsDropdownMac.mm:
        (-[WKDataListSuggestionsView notifyAccessibilityClients:]):
        (-[WKDataListSuggestionsView moveSelectionByDirection:]):
        (-[WKDataListSuggestionsView invalidate]):
        (-[WKDataListSuggestionsView showSuggestionsDropdown:]):

2019-07-13  Zalan Bujtas  <zalan@apple.com>

        Cannot bring up custom media controls at all on v.youku.com
        https://bugs.webkit.org/show_bug.cgi?id=199699
        <rdar://problem/51835327>

        Reviewed by Simon Fraser.

        * 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):
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::handleStylusSingleTapAtPoint):
        (WebKit::textInteractionPositionInformation):
        * WebProcess/WebPage/mac/WebPageMac.mm:
        (WebKit::WebPage::shouldDelayWindowOrderingEvent):
        (WebKit::WebPage::acceptsFirstMouse):
        (WebKit::WebPage::performImmediateActionHitTestAtLocation):

2019-07-12  Andy Estes  <aestes@apple.com>

        [Cocoa] -loadFileURL:allowingReadAccessToURL: should fully resolve file URLs
        https://bugs.webkit.org/show_bug.cgi?id=199768
        <rdar://problem/52002206>

        Reviewed by Geoffrey Garen.

        -loadFileURL:allowingReadAccessToURL: used -_web_originalDataAsWTFString from WKNSURLExtras
        to convert the file and read access NSURLs to strings, which under the hood calls
        CFURLGetBytes(). CFURLGetBytes() gets the URL's string without considering the base URL, so
        if the client creates a URL like this:

            NSURL *url = [NSURL fileURLWithPath:@"tmpfile.txt" relativeToURL:[NSURL fileURLWithPath:@"/tmp"]]

        ... then -_web_originalDataAsWTFString will merely return the string "tmpfile.txt". When
        that is later converted back to a URL in WebPageProxy::loadFile(), we lose track of the base
        component and refuse to load something that no longer looks like a file: URL.

        Fixed this by fully resolving the URLs passed to -loadFileURL:allowingReadAccessToURL: when
        converting to strings by using -[NSURL absoluteString] instead of -_web_originalDataAsWTFString.

        * Shared/Cocoa/WKNSURLExtras.mm:
        (-[NSURL _web_originalDataAsWTFString]):
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView loadFileURL:allowingReadAccessToURL:]):

2019-07-12  Megan Gardner  <megan_gardner@apple.com>

        Turn off two finger gestures for editable non-scaled content
        https://bugs.webkit.org/show_bug.cgi?id=199739
        <rdar://problem/52107190>

        Reviewed by Tim Horton.

        This gesture is blocking a selection gesture. Turn it off as it is not
        even being used in editable content.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView setupInteraction]):
        (-[WKContentView _didChangeWebViewEditability]):

2019-07-12  Jiewen Tan  <jiewen_tan@apple.com>

        SOAuthorizationSession::presentViewController should check WebPageProxy::isClosed()
        https://bugs.webkit.org/show_bug.cgi?id=199755
        <rdar://problem/52323585>

        Reviewed by Chris Dumez.

        WebPageProxy::pageClient() is not guaranteed to be non null all the time. Therefore, we should check
        WebPageProxy::isClosed() before using it.

        * UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm:
        (WebKit::SOAuthorizationSession::presentViewController):

2019-07-12  Chris Dumez  <cdumez@apple.com>

        Regression(macOS Catalina): Cannot quick look html documents in Mail
        https://bugs.webkit.org/show_bug.cgi?id=199754
        <rdar://problem/51304961>

        Reviewed by Geoff Garen.

        If the client asks us to load a file URL but does not provide a resource path, WebKit
        would fallback to issuing a sandbox extension for /. This no longer works on mac OS
        Catalina and it would thus fail to load the file.

        To address the issue, if the attempt to create a sandbox extension for / fails, we now
        fall back to issuing one for the file's baseURL (path of containing folder).

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

2019-07-12  Michael Catanzaro  <mcatanzaro@igalia.com>

        WebBackForwardListItem::setPageState should receive pageState by rvalue reference
        https://bugs.webkit.org/show_bug.cgi?id=199535

        Reviewed by Alex Christensen

        Coverity is complaining here about copying PageState by value in the parameter list. It's
        sort of a false positive, in that the PageState really does need to be copied here, so this
        is the best we can do. But pass by value and then WTFMove() is a pretty strange way to write
        it. Passing by rvalue reference would be better. This makes the copy more clear.

        * Shared/WebBackForwardListItem.h:
        (WebKit::WebBackForwardListItem::setPageState):
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::updateBackForwardItem):

2019-07-12  Youenn Fablet  <youenn@apple.com>

        Add release logging for quota checks
        https://bugs.webkit.org/show_bug.cgi?id=199697

        Reviewed by Alex Christensen.

        Log requests made to the page and the result from the application.

        * Platform/Logging.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::requestStorageSpace):

2019-07-12  Youenn Fablet  <youenn@apple.com>

        Remove unneeded variable in LocalStorageNamespace::getOrCreateStorageArea
        https://bugs.webkit.org/show_bug.cgi?id=199477

        Reviewed by Alex Christensen.

        * NetworkProcess/WebStorage/StorageManager.cpp:
        (WebKit::StorageManager::LocalStorageNamespace::getOrCreateStorageArea):

2019-07-12  Pawel Stanek  <p.stanek@metrological.com>

        Connection::waitForSyncReply() uses wall time clock for timeout
        https://bugs.webkit.org/show_bug.cgi?id=198712
        Due to a nature of the system time (it might not be set, jump, be off
        by a lot) it is better to use monotonically increasing time which is
        exactly what's used in a similar place i.e. Connection::waitForMessage()
        
        Reviewed by Alex Christensen.

        * Platform/IPC/Connection.cpp:
        (IPC::Connection::waitForSyncReply):

2019-07-12  Timothy Hatcher  <timothy@apple.com>

        Drop DarkModeCSSEnabled as an experimental feature and always enable it.
        https://bugs.webkit.org/show_bug.cgi?id=199725
        rdar://problem/52970972

        Reviewed by Megan Gardner.

        * Shared/WebPreferences.yaml: Removed DarkModeCSSEnabled.

2019-07-11  Myles C. Maxfield  <mmaxfield@apple.com>

        New York font erroneously gets synthetic bold
        https://bugs.webkit.org/show_bug.cgi?id=199653
        <rdar://problem/51692592>

        Reviewed by Simon Fraser.

        Add the SPI to enable the new fonts.

        * Shared/WebPreferences.yaml:
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetShouldAllowDesignSystemUIFonts):
        (WKPreferencesGetShouldAllowDesignSystemUIFonts):
        * UIProcess/API/C/WKPreferencesRefPrivate.h:
        * UIProcess/API/Cocoa/WKPreferences.mm:
        (-[WKPreferences _shouldAllowDesignSystemUIFonts]):
        (-[WKPreferences _setShouldAllowDesignSystemUIFonts:]):
        * UIProcess/API/Cocoa/WKPreferencesPrivate.h:

2019-07-11  Chris Dumez  <cdumez@apple.com>

        ASSERTION FAILED: RunLoop::isMain() under IPC::Connection::sendWithAsyncReply()
        https://bugs.webkit.org/show_bug.cgi?id=199734
        <rdar://problem/52977439>

        Reviewed by Geoffrey Garen.

        It appears WKProcessTaskStateObserverDelegate's taskStateDidChange handler can get called
        on a background thread so we need to make sure we go back to the main thread before we
        go into WebKit and do IPC.

        * Shared/Cocoa/ProcessTaskStateObserver.mm:
        (-[WKProcessTaskStateObserverDelegate process:taskStateDidChange:]):

2019-07-11  Sihui Liu  <sihui_liu@apple.com>

        StorageArea should not be destructed on the main thread
        https://bugs.webkit.org/show_bug.cgi?id=199713
        <rdar://problem/52911900>

        Reviewed by Alex Christensen.

        After r246079, LocalStorageNameSpace could be destructed on the main thread and it may hold the last reference 
        to StorageArea. Then we saw the crashes that StorageArea was wrongly destructed on the main thread.

        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::~NetworkSession):
        * NetworkProcess/WebStorage/StorageManager.cpp:
        (WebKit::StorageManager::waitUntilTasksFinished):
        (WebKit::StorageManager::waitUntilWritesFinished): Deleted.
        * NetworkProcess/WebStorage/StorageManager.h:

2019-07-11  Tim Horton  <timothy_horton@apple.com>

        Null deref of Range under WebPage::startAutoscrollAtPosition
        https://bugs.webkit.org/show_bug.cgi?id=199724
        <rdar://problem/41127089>

        Reviewed by Dean Jackson.

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::startAutoscrollAtPosition):
        Refactor this function to be early-return-y, and add one more
        early return if the Range is null.

2019-07-11  Pablo Saavedra  <psaavedra@igalia.com>

        [WPE][GTK] Build failure with ENABLE_ACCESSIBILITY=OFF
        https://bugs.webkit.org/show_bug.cgi?id=199625

        Added ENABLE(ACCESSIBILITY) and replaced HAVE(ACCESSIBILITY)
        with ENABLE(ACCESSIBILITY) in the code.

        Additionally, the TestRunner code generator now honors the
        Conditional IDL format.

        Reviewed by Konstantin Tokarev.

        * UIProcess/API/glib/WebKitWebViewAccessible.cpp:
        * UIProcess/API/glib/WebKitWebViewAccessible.h:
        * UIProcess/API/wpe/PageClientImpl.cpp:
        * UIProcess/API/wpe/PageClientImpl.h:
        * UIProcess/API/wpe/WPEView.cpp:
        (WKWPE::m_backend):
        (WKWPE::View::~View):
        * UIProcess/API/wpe/WPEView.h:
        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
        (WKAccessibilityRootObject):
        (WKAccessibilityFocusedObject):
        (WKAccessibilityEnableEnhancedAccessibility):
        (WKAccessibilityEnhancedAccessibilityEnabled):
        * WebProcess/WebPage/WebPage.cpp:
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/atk/WebKitWebPageAccessibilityObject.cpp:
        * WebProcess/WebPage/atk/WebKitWebPageAccessibilityObject.h:
        * WebProcess/WebPage/gtk/WebPageGtk.cpp:
        (WebKit::WebPage::platformInitialize):
        * WebProcess/WebPage/wpe/WebPageWPE.cpp:
        (WebKit::WebPage::platformInitialize):
        * WebProcess/wpe/WebProcessMainWPE.cpp:

2019-07-11  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r247314.
        https://bugs.webkit.org/show_bug.cgi?id=199721

        Caused performance regression. (Requested by deanj on
        #webkit).

        Reverted changeset:

        "Disable speculative loading if cache is not to be used for
        the load"
        https://bugs.webkit.org/show_bug.cgi?id=199644
        https://trac.webkit.org/changeset/247314

2019-07-11  Dean Jackson  <dino@apple.com>

        CrashTracer: Regression : MobileSafari at UIKit: -[CALayerAccessibility__UIKit__QuartzCore setBounds:]
        https://bugs.webkit.org/show_bug.cgi?id=199720
        <rdar://problem/51470469>

        Reviewed by Tim Horton.

        Speculative fix after confirming that this crash can occur when
        a zero width/height view is used for a UITargetedPreview. We
        already guarded against this in the default flow, but not in
        the fallback path where we take a view snapshot.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (createFallbackTargetedPreview): Return early if rectangles are empty.

2019-07-11  Alex Christensen  <achristensen@webkit.org>

        Use mobile UA on jsfiddle.net
        https://bugs.webkit.org/show_bug.cgi?id=199687
        <rdar://problem/50839844>

        Reviewed by Maciej Stachowiak.

        Text selection does not work on iPads using desktop UA.
        This isn't the best solution, but it's certainly *a* solution.

        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::desktopClassBrowsingRecommendedForRequest):

2019-07-11  Simon Fraser  <simon.fraser@apple.com>

        [iOS WK2] Can't place caret or select in content that overflows a contenteditable element
        https://bugs.webkit.org/show_bug.cgi?id=199741
        rdar://problem/50545233

        Reviewed by Wenson Hsieh.

        Various code paths for editing used renderer->absoluteBoundingBoxRect(), which is the border
        box of the element (or a set of line boxes for inline elements) converted to absolute
        coordinates. This excludes overflow content, but contenteditable needs to be able to
        place the caret in overflow content, and allow selection rects to be in the overflow area
        (if the element has visible overflow).

        Try to clean this up by adding some static helpers on WebPage for accessing the relevant
        rects, and use them in code call from visiblePositionInFocusedNodeForPoint(), and
        code that is input to selectionClipRect.

        This changes selectionClipRect to use the padding box (excluding borders), which is a progression.

        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::platformEditorState const):
        (WebKit::elementBoundsInFrame):
        (WebKit::constrainPoint):
        (WebKit::WebPage::rootViewBoundsForElement):
        (WebKit::WebPage::absoluteInteractionBoundsForElement):
        (WebKit::WebPage::rootViewInteractionBoundsForElement):
        (WebKit::WebPage::dispatchSyntheticMouseEventsForSelectionGesture):
        (WebKit::WebPage::getFocusedElementInformation):
        (WebKit::innerFrameQuad): Deleted.
        (WebKit::elementRectInRootViewCoordinates): Deleted.

2019-07-11  Jonathan Bedard  <jbedard@apple.com>

        [iOS 13] Enable WebKit build
        https://bugs.webkit.org/show_bug.cgi?id=199481
        <rdar://problem/52619048>

        Reviewed by Tim Horton.

        * Platform/spi/ios/UIKitSPI.h: Add UITextEffectsWindow.sharedTextEffectsWindowForWindowScene SPI.
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView showGlobalMenuControllerInRect:]): setTargetRect, setMenuVisible marked depreciated in iOS 13.
        (-[WKContentView hideGlobalMenuController]): Ditto.

2019-07-11  Wenson Hsieh  <wenson_hsieh@apple.com>

        MobileSafari may crash under -[UIKeyboardTaskExecutionContext transferExecutionToMainThreadWithTask:]
        https://bugs.webkit.org/show_bug.cgi?id=199701
        <rdar://problem/52590170>

        Reviewed by Tim Horton.

        Mitigates a crash wherein we end up calling the completion handler of
        -requestAutocorrectionContextWithCompletionHandler: within a nested call
        to -requestAutocorrectionContextWithCompletionHandler:. In this particular
        case, a sync `window.open` from the web process to the UI process happens
        while the UI process is already handling a sync autocorrection context
        request. This causes the UI process to try and immediately dispatch the
        incoming sync message to avoid deadlock. However, Safari's logic to create
        and set up a new web view when opening a new window makes the new view the
        first responder, which then prompts UIKit logic to request an autocorrection
        context for the new web view.

        To avoid the issue for now, simply use -resignFirstResponder as a cue to invoke
        pending autocorrection context handlers in the original web view before UIKit
        tries to request autocorrection context in the newly created view.

        I attempted to write a test for this, but realized that we only end up hitting
        the debug assertion pointed out in <https://webkit.org/b/199680>; we should be
        able to write a test for this in the future, if we teach Connection to handle
        multiple outgoing sync messages.

        For the time being, I've attached a manual test case to the bug.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView resignFirstResponderForWebView]):
        (-[WKContentView _cancelPendingAutocorrectionContextHandler]):

        Add a new helper to signify that a pending autocorrection context handler should be cancelled (invoked
        immediately with empty data). Use this in a few places where we currently explicitly pass
        -[WKAutocorrectionContext emptyAutocorrectionContext].

        (-[WKContentView requestAutocorrectionContextWithCompletionHandler:]):

2019-07-10  Simon Fraser  <simon.fraser@apple.com>

        [iOS WK2] With modal overlay and body overflow:hidden, can't access all the content
        https://bugs.webkit.org/show_bug.cgi?id=199693
        rdar://problem/51930364

        Reviewed by Tim Horton.

        A page with overflow:hidden on the root needs to be scrollable if:
        * it's zoomed
        * the visual viewport is smaller than the layout viewport (including visible keyboard)
        * scrolling is required to hide MobileSafari's squishy bars

        This patch does the last two, plumbing a "visual viewport is smaller than layout viewport"
        bit up from WebCore via the scrolling tree (that way, when it changes we automatically trigger
        a commit), and checking for squished bars in WKWebView.

        * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
        (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
        (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _didCommitLayerTree:]):
        (-[WKWebView _overrideLayoutParametersWithMinimumLayoutSize:maximumUnobscuredSizeOverride:]):
        * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
        (WebKit::RemoteScrollingCoordinatorProxy::hasScrollableMainFrame const):
        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::maximumUnobscuredSize const):
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::dynamicViewportSizeUpdate):
        (WebKit::WebPage::updateVisibleContentRects):

2019-07-10  Tim Horton  <timothy_horton@apple.com>

        Long pressing on attachments will crash the WebContent process
        https://bugs.webkit.org/show_bug.cgi?id=199696
        <rdar://problem/52920241>

        Reviewed by Dean Jackson.

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::linkIndicatorPositionInformation):
        (WebKit::elementPositionInformation):
        (WebKit::selectionPositionInformation):
        (WebKit::WebPage::positionInformation):
        Instead of one-off creating a node snapshot for <attachment>, just
        use TextIndicator. This way, we get an estimated background color,
        paint at the right resolution, etc.

        Also, hitNode was often null where we were previously calling
        shareableBitmapSnapshotForNode, because it depends on the element
        having click event handlers. selectionPositionInformation() re-hit-tests
        more permissively to find the <attachment>, so moving this code
        inside that function ensures that we don't try to snapshot a null node.

2019-07-10  Dean Jackson  <dino@apple.com>

        Safari’s context menu actions are missing options
        https://bugs.webkit.org/show_bug.cgi?id=199694
        <rdar://problem/52726822>

        Reviewed by Tim Horton.

        One of the most embarrassing errors I've ever made. I was returning
        early when something existed, instead of when it didn't exist.
        (*cough* tests *cough*)

        * UIProcess/ios/WKContentViewInteraction.mm:

2019-07-10  Jon Lee  <jonlee@apple.com>

        Opt trello.com to mobile UA
        https://bugs.webkit.org/show_bug.cgi?id=199686
        rdar://problem/51708119

        Reviewed by Wenson Hsieh.

        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::desktopClassBrowsingRecommendedForRequest): Currently the desktop version
        of the site prevents users from tapping cards to edit them. Opt trello into the mobile
        UA for now.

2019-07-10  Daniel Bates  <dabates@apple.com>

        [iOS] Selection handles "Lollipops" can become gray and stay gray
        https://bugs.webkit.org/show_bug.cgi?id=198852
        <rdar://problem/51736130>

        Reviewed by Wenson Hsieh.

        Tell the text interaction assistant to update the selection UI when the tint color changes.
        We do this by way of deactivating and activating selection.

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

2019-07-10  Dean Jackson  <dino@apple.com>

        Share or Copy image from context menu does not share the correct data
        https://bugs.webkit.org/show_bug.cgi?id=199681
        <rdar://problem/50538771>

        Reviewed by Tim Horton.

        The UIContextMenuInteraction calls didEndInteraction before executing the
        actions of a selected menu item. This means we were assuming the interaction
        had finished before performing the action triggered in the interaction, ending
        up in the state where we had forgotten which element we were working with.

        Rather than ask for UIKit to change, I'm just starting the interaction again
        as the action is run. Thankfully we already had the location of the interaction.
        There is a small risk that the page has changed in the meantime, but I'm not
        sure what to do about that.

        While here, I moved a method only used by us into _WKElementActionInternal,
        and changed the location stored by _WKActivatedElementInfo from a CGPoint
        to an WebCore::IntPoint (since it doesn't escape WebKit).

        * UIProcess/API/Cocoa/_WKActivatedElementInfo.mm: Use a WebCore::IntPoint rather than a CGPoint.
        (-[_WKActivatedElementInfo _initWithType:URL:imageURL:location:title:ID:rect:image:]):
        (-[_WKActivatedElementInfo _initWithType:URL:imageURL:location:title:ID:rect:image:userInfo:]):
        (-[_WKActivatedElementInfo _interactionLocation]):
        * UIProcess/API/Cocoa/_WKActivatedElementInfoInternal.h:

        * UIProcess/API/Cocoa/_WKElementAction.h: Move uiActionForElementInfo to Internal.
        * UIProcess/API/Cocoa/_WKElementActionInternal.h:

        * UIProcess/API/Cocoa/_WKElementAction.mm: When executing the handlers, restart the interaction
        using the location in _WKActivatedElementInfo.
        (+[_WKElementAction _elementActionWithType:customTitle:assistant:]):

        * UIProcess/ios/WKContentViewInteraction.mm: Explicitly start and stop interactions at
        the appropriate points in the UIContextMenu flow. This isn't really needed since we're
        doing it in the handlers, but it will be correct if the UIKit delegate order changes.
        (-[WKContentView continueContextMenuInteraction:]):
        (-[WKContentView contextMenuInteractionDidEnd:]):

2019-07-10  Chris Dumez  <cdumez@apple.com>

        Crash under IPC::Connection::waitForMessage()
        https://bugs.webkit.org/show_bug.cgi?id=199680
        <rdar://problem/52500561>

        Reviewed by Tim Horton.

        IPC::Connection::waitForMessage() is crashing due to a null defererence of
        m_waitingForMessage. Since m_waitingForMessage is only ever set to null in
        waitForMessage(), this seems to imply we've re-entered waitForMessage().
        This is in theory possible since the loop inside waitForMessage() calls
        SyncMessageState::singleton().dispatchMessages() on every iteration to
        process incoming synchronous IPC messages. In theory, one of these sync
        IPC messages could run code which ends up calling waitForAndDispatchImmediately()
        (and thus waitForMessage()).

        We had a debug assertion to try and catch re-entrancy with a comment stating
        "We don't support having multiple clients waiting for messages." but we
        would not see those in release and we would crash with a null dereference
        instead.

        To address the crashes in release, return early in case of re-entrancy
        (we would still hit an assertion in debug).

        * Platform/IPC/Connection.cpp:
        (IPC::Connection::Connection):
        (IPC::Connection::waitForMessage):
        * Platform/IPC/Connection.h:

2019-07-10  Tim Horton  <timothy_horton@apple.com>

        Context menus are not presented for WKWebViews that don't have UIDelegates
        https://bugs.webkit.org/show_bug.cgi?id=199678

        Reviewed by Dean Jackson.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView continueContextMenuInteraction:]):
        Remove this unnecessary early-return if we don't have a UIDelegate.
        We have a default behavior that we totally want to happen.
        Also, rename completion() to continueWithContextMenuConfiguration()
        to reduce confusion between completion() and completionBlock() in
        this method.

2019-07-10  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r247223.
        https://bugs.webkit.org/show_bug.cgi?id=199679

        Caused perf regression. (Requested by deanj on #webkit).

        Reverted changeset:

        "[iPadOS] Viewport pops while loading sohu.com, xinhuanet.com,
        and various other websites"
        https://bugs.webkit.org/show_bug.cgi?id=199575
        https://trac.webkit.org/changeset/247223

2019-07-10  Youenn Fablet  <youenn@apple.com>

        Disable speculative loading if cache is not to be used for the load
        https://bugs.webkit.org/show_bug.cgi?id=199644

        Reviewed by Chris Dumez.

        When the page is reloaded, loads are instructed to not use the cache.
        It is therefore unneeded to do speculative revalidation.
        Allow speculative revalidation if the cache policy is either the default HTTP policy or
        if policy is to refresh all cache data.
        Covered by added test.

        * NetworkProcess/cache/NetworkCache.cpp:
        (WebKit::NetworkCache::cachePolicyValidForSpeculativeRevalidation):
        (WebKit::NetworkCache::canRequestUseSpeculativeRevalidation):

2019-07-10  Alex Christensen  <achristensen@webkit.org>

        Fix build after Foundation changes UIEdgeInsets definition
        https://bugs.webkit.org/show_bug.cgi?id=199660
        <rdar://problem/52390453>

        Reviewed by Tim Horton.

        * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
        * UIProcess/Cocoa/WKWebViewContentProvider.h:

2019-07-10  Antti Koivisto  <antti@apple.com>

        Remove TouchActionData
        https://bugs.webkit.org/show_bug.cgi?id=199668

        Reviewed by Simon Fraser.

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

2019-07-09  Michael Catanzaro  <mcatanzaro@igalia.com>

        [WPE][GTK] GUniqueOutPtr::release should return a raw pointer
        https://bugs.webkit.org/show_bug.cgi?id=199579

        Reviewed by Carlos Garcia Campos.

        * NetworkProcess/glib/WebKitCachedResolver.cpp:
        (webkitCachedResolverLookupByNameAsync):
        (webkitCachedResolverLookupByNameWithFlagsAsync):
        * UIProcess/API/glib/WebKitFaviconDatabase.cpp:
        (processPendingIconsForPageURL):
        (webkit_favicon_database_get_favicon):
        * UIProcess/API/glib/WebKitUserContentFilterStore.cpp:
        (webkit_user_content_filter_store_save_from_file):

2019-07-09  Tim Horton  <timothy_horton@apple.com>

        Fixed elements appear in the middle of full page screenshots taken when scrolled
        https://bugs.webkit.org/show_bug.cgi?id=199649
        <rdar://problem/52476226>

        Reviewed by Simon Fraser.

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::computePagesForPrintingAndDrawToPDF):
        Temporarily expand the layout viewport to the size of the snapshotting page,
        so that fixed elements sit against the bounds of the page instead of
        wherever you're currently scrolled to.

2019-07-09  Simon Fraser  <simon.fraser@apple.com>

        [iOS WK2] Use Optional<> for two data members of WKWebView
        https://bugs.webkit.org/show_bug.cgi?id=199637

        Reviewed by Tim Horton.

        Use Optional<CGSize> to replace _overridesViewLayoutSize/_viewLayoutSizeOverride
        and _overridesMaximumUnobscuredSize/_maximumUnobscuredSizeOverride.

        No behavior change.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView activeViewLayoutSize:]):
        (-[WKWebView _frameOrBoundsChanged]):
        (activeMaximumUnobscuredSize):
        (-[WKWebView _minimumLayoutSizeOverride]):
        (-[WKWebView _setViewLayoutSizeOverride:]):
        (-[WKWebView _maximumUnobscuredSizeOverride]):
        (-[WKWebView _setMaximumUnobscuredSizeOverride:]):
        (-[WKWebView _beginAnimatedResizeWithUpdates:]):
        (-[WKWebView _clearOverrideLayoutParameters]):

2019-07-09  Chris Dumez  <cdumez@apple.com>

        Fix integer type encoding / decoding in WKRemoteObjectCoder
        https://bugs.webkit.org/show_bug.cgi?id=199643
        <rdar://problem/52732342>

        Reviewed by Anders Carlsson.

        As per [1], q / Q match to long long / unsigned long long, not long / unsigned long.

        [1] https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Articles/ocrtTypeEncodings.html#//apple_ref/doc/uid/TP40008048-CH100

        * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
        (encodeInvocationArguments):
        (decodeInvocationArguments):

2019-07-09  Chris Dumez  <cdumez@apple.com>

        Cleanup uses of NetworkProcess::m_sessionByConnection
        https://bugs.webkit.org/show_bug.cgi?id=199586

        Reviewed by Alex Christensen.

        Avoid double HashMap lookups and call add() instead of ensure() when appropriate.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::networkSessionByConnection const):
        (WebKit::NetworkProcess::webPageWasAdded):
        (WebKit::NetworkProcess::webProcessWasDisconnected):

2019-07-09  Saagar Jha  <saagarjha@apple.com>

        WKObject's minimum object alignment needs to be larger
        https://bugs.webkit.org/show_bug.cgi?id=199523

        Reviewed by Alex Christensen.

        WKObject's wrapped objects are currently constructed at addresses aligned to 8-byte boundaries, but some
        classes have more stringent requirements. By querying std::aligned_storage for the alignment of an object
        larger than anything we can construct, we should be able to satisfy alignment for any of WebKit's types.

        * Shared/Cocoa/APIObject.mm: Use std::aligned_storage in conjunction with alignof to determine
        minimumObjectAlignment, instead of hardcoding 8.

2019-07-09  Megan Gardner  <megan_gardner@apple.com>

        Don't strip out spaces for personalized Autocorrections
        https://bugs.webkit.org/show_bug.cgi?id=199476
        <rdar://problem/50782015>

        Reviewed by Dean Jackson.

        When inserting 'autocorrections' that are really predictive
        text suggestions based on personal data, we would remove the space
        before the suggestion, resulting in incorrect input.
        To fix, do not remove a space when the autocorrected text and the text it is 
        replacing do not have any length.

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

2019-07-09  Truitt Savell  <tsavell@apple.com>

        Unreviewed, rolling out r247230.

        Caused storage/domstorage/localstorage/private-browsing-
        affects-storage.html to crash with an assertion.

        Reverted changeset:

        "Cleanup uses of NetworkProcess::m_sessionByConnection"
        https://bugs.webkit.org/show_bug.cgi?id=199586
        https://trac.webkit.org/changeset/247230

2019-07-09  Youenn Fablet  <youenn@apple.com>

        XHR CORS requests logged twice in the server
        https://bugs.webkit.org/show_bug.cgi?id=199492
        <rdar://problem/52757558>

        Reviewed by Chris Dumez.

        Disable speculative loading for XHR and fetch.
        These speculative requests might have specific headers that are no longer relevant
        when reloading the page. This might then confuse servers.

        * NetworkProcess/cache/NetworkCache.cpp:
        (WebKit::NetworkCache::makeStoreDecision):
        (WebKit::NetworkCache::canRequestUseSpeculativeRevalidation):
        (WebKit::NetworkCache::Cache::retrieve):

2019-07-09  Chris Dumez  <cdumez@apple.com>

        Fix validation of method signature in decodeInvocation()
        https://bugs.webkit.org/show_bug.cgi?id=199629
        <rdar://problem/52731659>

        Reviewed by Dan Bernstein.

        The decoder was mistakenly assigning remoteMethodSignature to localMethodSignature
        before comparing remoteMethodSignature and localMethodSignature, thus making the
        check useless.

        * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
        (decodeInvocation):

2019-07-09  Youenn Fablet  <youenn@apple.com>

        Revert conditional WebPageProxy check to grant universal file read sandbox upon correct sandbox creation
        https://bugs.webkit.org/show_bug.cgi?id=199622
        <rdar://problem/52357508>

        Reviewed by Alex Christensen.

        On iOS, the sandbox extension to '/' will usually fail, thus the universal file read sandbox is not granted.
        This makes WebPageProxy cancel some file:// loads to the application own container.
        As a short term fix, go back to previous behavior.
        Covered by testing broken app identified in rdar://problem/52357508.

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

2019-07-09  Sihui Liu  <sihui_liu@apple.com>

        Only allow fetching and removing session credentials from WebsiteDataStore
        https://bugs.webkit.org/show_bug.cgi?id=199385
        <rdar://problem/52622080>

        Reviewed by Alex Christensen.

        Stop sending an extra message to network process for fetching or removing persistent credentials.

        Also introduce a new SPI for clearing persistent credentials created in test.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::clearPermanentCredentialsForProtectionSpace):
        (WebKit::NetworkProcess::fetchWebsiteData):
        (WebKit::NetworkProcess::deleteWebsiteData):
        (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
        (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
        (WebKit::NetworkProcess::originsWithPersistentCredentials): Deleted.
        (WebKit::NetworkProcess::removeCredentialsWithOrigins): Deleted.
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::originsWithPersistentCredentials): Deleted.
        (WebKit::NetworkProcess::removeCredentialsWithOrigins): Deleted.
        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _clearPermanentCredentialsForProtectionSpace:completionHandler:]):
        * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::clearPermanentCredentialsForProtectionSpace):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::fetchDataAndApply):
        (WebKit::computeWebProcessAccessTypeForDataRemoval):
        (WebKit::WebsiteDataStore::removeData):

2019-07-09  Antoine Quint  <graouts@apple.com>

        [Pointer Events] Scroll indicators should not show for scrollable content with touch-action: none
        https://bugs.webkit.org/show_bug.cgi?id=199618

        Reviewed by Simon Fraser.

        Even though we correctly didn't scroll when "touch-action: none" was specified on an element, we would only apply
        scrolling constraints after the panning gesture was recognized and the backing UIScrollView would show its scroll
        indicators. While this is correct when only "pan-x" or "pan-y" is specified, we should not show the scroll indicators
        at all for "touch-action: none" since no scrolling should happen.

        To do this, we add a new method to the WKTouchActionGestureRecognizerDelegate protocol to indicate whether a given
        gesture recognizer may pan content in the WKWebView. If the gesture recognizer is the top-level scroll view or one
        created within the page to back "overflow: scroll" content or an iframe, we correctly make that gesture recognizer
        fail to recognize if neither "pan-x" nor "pan-y" is specified for this touch identifier.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView gestureRecognizerMayPanWebView:]):
        * UIProcess/ios/WKTouchActionGestureRecognizer.h:
        * UIProcess/ios/WKTouchActionGestureRecognizer.mm:
        (-[WKTouchActionGestureRecognizer canPreventGestureRecognizer:]):

2019-07-09  Chris Dumez  <cdumez@apple.com>

        Validate reply block signature in [WKRemoteObjectRegistry _invokeMethod]
        https://bugs.webkit.org/show_bug.cgi?id=199584
        <rdar://problem/46268249>

        Reviewed by Geoffrey Garen.

        Validate reply block signature in [WKRemoteObjectRegistry _invokeMethod] for robustness.

        * Shared/API/Cocoa/_WKRemoteObjectRegistry.mm:
        (validateReplyBlockSignature):
        (-[_WKRemoteObjectRegistry _invokeMethod:]):

2019-07-09  Alex Christensen  <achristensen@webkit.org>

        UserData::decode should return false when decoding an unrecognized type
        https://bugs.webkit.org/show_bug.cgi?id=199598
        <rdar://52735138>

        Reviewed by Ryosuke Niwa.

        * Shared/UserData.cpp:
        (WebKit::UserData::decode):

2019-07-08  Chris Dumez  <cdumez@apple.com>

        Speculative fix for crashes under LocalStorageDatabaseTracker::databasePath()
        https://bugs.webkit.org/show_bug.cgi?id=199599
        <rdar://problem/31169686>

        Reviewed by Ryosuke Niwa.

        Speculative fix for crashes under LocalStorageDatabaseTracker::databasePath():
        - Add new localStorageDirectory() getter to LocalStorageDatabaseTracker which
          calls isolatedCopy() on m_localStorageDirectory before returning it.
          Use it everywhere instead of m_localStorageDirectory since it is not safe
          to use the same String from various threads like it was done.
        - Move localStorageDirectory when constructing the LocalStorageDatabaseTracker
          instead of copying it.
        - Make sure that LocalStorageDatabaseTracker and StorageManager are both
          constructed and destroyed on the main thread.

        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::NetworkSession):
        * NetworkProcess/NetworkSession.h:
        * NetworkProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
        (WebKit::LocalStorageDatabaseTracker::create):
        (WebKit::LocalStorageDatabaseTracker::LocalStorageDatabaseTracker):
        (WebKit::LocalStorageDatabaseTracker::localStorageDirectory const):
        (WebKit::LocalStorageDatabaseTracker::~LocalStorageDatabaseTracker):
        (WebKit::LocalStorageDatabaseTracker::deleteAllDatabases):
        (WebKit::LocalStorageDatabaseTracker::origins const):
        (WebKit::LocalStorageDatabaseTracker::databasePath const):
        * NetworkProcess/WebStorage/LocalStorageDatabaseTracker.h:
        * NetworkProcess/WebStorage/StorageManager.cpp:
        (WebKit::StorageManager::create):
        (WebKit::StorageManager::StorageManager):
        (WebKit::StorageManager::~StorageManager):
        * NetworkProcess/WebStorage/StorageManager.h:
        * NetworkProcess/WebStorage/ios/LocalStorageDatabaseTrackerIOS.mm:
        (WebKit::LocalStorageDatabaseTracker::platformMaybeExcludeFromBackup const):
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
        * NetworkProcess/curl/NetworkSessionCurl.cpp:
        (WebKit::NetworkSessionCurl::NetworkSessionCurl):
        * NetworkProcess/soup/NetworkSessionSoup.cpp:
        (WebKit::NetworkSessionSoup::NetworkSessionSoup):

2019-07-08  Chris Dumez  <cdumez@apple.com>

        Use WeakHashSet for WebUserContentControllerProxy::m_processes
        https://bugs.webkit.org/show_bug.cgi?id=199591
        <rdar://problem/52798721>

        Reviewed by Youenn Fablet.

        Use WeakHashSet for WebUserContentControllerProxy::m_processses for safety. In theory, a WebProcessProxy could
        stay in the map if we failed to call WebProcessProxy::shutDown() before destroying it.

        * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
        (WebKit::WebUserContentControllerProxy::~WebUserContentControllerProxy):
        (WebKit::WebUserContentControllerProxy::addProcess):
        (WebKit::WebUserContentControllerProxy::removeProcess):
        (WebKit::WebUserContentControllerProxy::addUserContentWorldUse):
        (WebKit::WebUserContentControllerProxy::removeUserContentWorldUses):
        (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::addContentRuleList):
        (WebKit::WebUserContentControllerProxy::removeContentRuleList):
        (WebKit::WebUserContentControllerProxy::removeAllContentRuleLists):
        * UIProcess/UserContent/WebUserContentControllerProxy.h:
        (WebKit::WebUserContentControllerProxy::addNetworkProcess):
        (WebKit::WebUserContentControllerProxy::removeNetworkProcess):

2019-07-08  Daniel Bates  <dabates@apple.com>

        [iOS] Support select all in non-editable element
        https://bugs.webkit.org/show_bug.cgi?id=199257
        <rdar://problem/52553667>

        Reviewed by Wenson Hsieh.

        Unless we are populating the callout bar always advertise that WebKit can perform Select All
        when building with USE(UIKIT_KEYBOARD_ADDITIONS). This way you can press Command + A to select
        all text even in a non-editable element just like you can on Mac.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView canPerformActionForWebView:withSender:]):

2019-07-08  Chris Dumez  <cdumez@apple.com>

        Cleanup uses of NetworkProcess::m_sessionByConnection
        https://bugs.webkit.org/show_bug.cgi?id=199586

        Reviewed by Alex Christensen.

        Avoid double HashMap lookups and call add() instead of ensure() when appropriate.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::networkSessionByConnection const):
        (WebKit::NetworkProcess::webPageWasAdded):
        (WebKit::NetworkProcess::webProcessWasDisconnected):

2019-07-08  Tim Horton  <timothy_horton@apple.com>

        WKWebView fails to render when another view uses CoreImage filters
        https://bugs.webkit.org/show_bug.cgi?id=199488
        <rdar://problem/52695825>

        Reviewed by Dean Jackson.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::layerHostingModeDidChange):
        Update m_layerHostingMode when it changes, even if we can't message
        the Web Content process. This ensures that the next time we launch
        a Web Content process, WebPageCreationParameters will have the correct
        layer hosting mode, and is the usual pattern for such things.

2019-07-08  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iPadOS] Viewport pops while loading sohu.com, xinhuanet.com, and various other websites
        https://bugs.webkit.org/show_bug.cgi?id=199575
        <rdar://problem/51842220>

        Reviewed by Simon Fraser.

        Currently, the shrink-to-fit-content heuristic added to scale desktop sites fit within the viewport on iPadOS
        only runs during two intervals: after document load, and after page load. On very script-heavy websites, this
        may cause a visible jump, as rendering may commence well before the document is finished parsing.

        To mitigate this, we move the first opportunity for the shrink-to-fit heuristic from after document, to right
        after the page transition has completed (before we unfreeze the layer tree).

        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDidFinishDocumentLoad):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::didCompletePageTransition):
        (WebKit::WebPage::didFinishDocumentLoad): Deleted.

        Remove this didFinishDocumentLoad hook, which was only used to schedule the shrink-to-fit timer.

        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::immediatelyShrinkToFitContent):

        m_mainFrame might be null after page transition completes, so we need to ensure immediatelyShrinkToFitContent is
        robust in this scenario.

2019-07-08  Chris Dumez  <cdumez@apple.com>

        Add threading assertion to WTF::CompletionHandler
        https://bugs.webkit.org/show_bug.cgi?id=199516

        Reviewed by Alex Christensen.

        Update some MessagePort-related code to use WTF::Function instead of WTF::CompletionHandler
        since the callback is always called on the main thread, even when it was created on a
        worker thread. Ideally, this code would be refactored so that the callback gets called on
        the worker thread directly.

        * UIProcess/UIMessagePortChannelProvider.cpp:
        (WebKit::UIMessagePortChannelProvider::checkRemotePortForActivity):
        * UIProcess/UIMessagePortChannelProvider.h:
        * WebProcess/WebCoreSupport/WebMessagePortChannelProvider.cpp:
        (WebKit::WebMessagePortChannelProvider::checkRemotePortForActivity):
        * WebProcess/WebCoreSupport/WebMessagePortChannelProvider.h:

2019-07-08  Antoine Quint  <graouts@apple.com>

        [Pointer Events] "touch-action: none" does not prevent double-tap-to-zoom
        https://bugs.webkit.org/show_bug.cgi?id=199571
        <rdar://problem/51715002>

        Reviewed by Wenson Hsieh.

        We add a new WKTouchActionGestureRecognizerDelegate method to check whether a gesture recognizer may lead to
        zooming the page as a result of double-tapping, which can be caused by two different gesture recognizers
        managed by WKContentViewInteraction. If that delegate method returns true and we have "touch-action: none"
        set for this touch, we cause those gesture recognizers to fail and prevent double-tap-to-zoom behavior.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView gestureRecognizerMayDoubleTapToZoomWebView:]):
        * UIProcess/ios/WKTouchActionGestureRecognizer.h:
        * UIProcess/ios/WKTouchActionGestureRecognizer.mm:
        (-[WKTouchActionGestureRecognizer canPreventGestureRecognizer:]):

2019-07-08  Per Arne Vollan  <pvollan@apple.com>

        [iOS] WebContent processes should not globally allow mach lookup to the AX server.
        https://bugs.webkit.org/show_bug.cgi?id=199386
        <rdar://problem/52487468>

        Reviewed by Chris Fleizach.

        Instead, a mach extension for this service should be issued to the WebContent process. This has already been implemented.

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

2019-07-08  Claudio Saavedra  <csaavedra@igalia.com>

        REGRESSION(r246671): [WPE][GTK] Crash in NetworkProcess since the DNS cache landed
        https://bugs.webkit.org/show_bug.cgi?id=199572

        Reviewed by Michael Catanzaro.

        The GError coming from the wrapped resolver shouldn't be freed,
        but passed onto the caller.

        * NetworkProcess/glib/WebKitCachedResolver.cpp:
        (webkitCachedResolverLookupByNameAsync):
        (webkitCachedResolverLookupByNameWithFlagsAsync):

2019-07-07  Antoine Quint  <graouts@apple.com>

        [Pointer Events] touch-action should affect the behavior of pinch-to-zoom to show tabs in Safari
        https://bugs.webkit.org/show_bug.cgi?id=199560
        <rdar://problem/52742265>

        Reviewed by Dean Jackson.

        There are other UIPinchGestureRecognizer objects that may lead to pinch-to-zoom behavior, for instance pinching
        out to show open tabs in Safari on iOS. We add a new WKUIDelegatePrivate method that will allow Safari to indicate
        that a UIPinchGestureRecognizer considered for prevention would lead to pinch-to-zoom behavior.

        * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView gestureRecognizerMayPinchToZoomWebView:]):

2019-07-08  Antoine Quint  <graouts@apple.com>

        [Pointer Events] Enable only on the most recent version of the supported iOS family
        https://bugs.webkit.org/show_bug.cgi?id=199562
        <rdar://problem/52766511>

        Reviewed by Dean Jackson.

        * Configurations/FeatureDefines.xcconfig:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView cancelPointersForGestureRecognizer:]):
        (-[WKContentView activeTouchIdentifierForGestureRecognizer:]):
        (-[WKContentView touchActionActiveTouches]):
        * UIProcess/ios/WKSyntheticTapGestureRecognizer.m:
        (-[WKSyntheticTapGestureRecognizer touchesEnded:withEvent:]):
        * UIProcess/ios/WKTouchActionGestureRecognizer.h:
        * UIProcess/ios/WKTouchActionGestureRecognizer.mm:
        (-[WKTouchActionGestureRecognizer canPreventGestureRecognizer:]):

2019-07-08  Michael Catanzaro  <mcatanzaro@igalia.com>

        [GTK] ViewGestureController constructor leaves m_direction uninitialized
        https://bugs.webkit.org/show_bug.cgi?id=199532

        Reviewed by Carlos Garcia Campos.

        This is harmless because it should never be read until after it's initialized, but still not
        robust. Fix it by assuming Back as the default value until the first swipe begins.

        * UIProcess/ViewGestureController.h:

2019-07-07  Zalan Bujtas  <zalan@apple.com>

        [ContentChangeObserver] Difficult to control videos on iqiyi.com as the actions are mouse hover
        https://bugs.webkit.org/show_bug.cgi?id=199542
        <rdar://problem/51886813>

        Reviewed by Simon Fraser.

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

2019-07-06  Antoine Quint  <graouts@apple.com>

        [Pointer Events] Use a gesture recognizer to prevent pinch-to-zoom behavior
        https://bugs.webkit.org/show_bug.cgi?id=199543

        Reviewed by Dean Jackson.

        We used to set the "enabled" property on the main UIScrollView's UIPinchGestureRecognizer to disable pinch-to-zoom
        behavior based on the "touch-action" CSS property. This was sub-optimal since this gesture recognizer can be publicly
        accessible by third-party developers, but also because it set state instead of a run-time solution.

        We now introduce a new WKTouchActionGestureRecognizer dedicated to preventing clearly identified gesture recognizers
        from being recognized to disable some built-in behavior. As a new touch starts, we record the computed touch-action
        property for the given touch identifier on the WKTouchActionGestureRecognizer, then WKTouchActionGestureRecognizer
        determines, by implementing -[canPreventGestureRecognizer:], whether the possibly-prevented gesture recognizer
        is known to lead to a pinch-to-zoom behavior and whether it contains a touch that should prevent it.

        To support the WKTouchActionGestureRecognizer, WKContentViewInteraction implements the new WKTouchActionGestureRecognizerDelegate
        protocol to indicate whether the possibly-prevented gesture recognizer is the main UIScrollView's UIPinchGestureRecognizer.

        No new test since this changes the implementation of existing behavior.

        * SourcesCocoa.txt:
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView setupInteraction]):
        (-[WKContentView cleanupInteraction]):
        (-[WKContentView _removeDefaultGestureRecognizers]):
        (-[WKContentView _addDefaultGestureRecognizers]):
        (-[WKContentView _handleTouchActionsForTouchEvent:]):
        (-[WKContentView gestureRecognizerMayPinchToZoomWebView:]):
        (-[WKContentView touchActionActiveTouches]):
        * UIProcess/ios/WKTouchActionGestureRecognizer.h: Added.
        * UIProcess/ios/WKTouchActionGestureRecognizer.mm: Added.
        (-[WKTouchActionGestureRecognizer initWithTouchActionDelegate:]):
        (-[WKTouchActionGestureRecognizer setTouchActions:forTouchIdentifier:]):
        (-[WKTouchActionGestureRecognizer clearTouchActionsForTouchIdentifier:]):
        (-[WKTouchActionGestureRecognizer touchesBegan:withEvent:]):
        (-[WKTouchActionGestureRecognizer touchesMoved:withEvent:]):
        (-[WKTouchActionGestureRecognizer touchesEnded:withEvent:]):
        (-[WKTouchActionGestureRecognizer touchesCancelled:withEvent:]):
        (-[WKTouchActionGestureRecognizer _updateState]):
        (-[WKTouchActionGestureRecognizer canBePreventedByGestureRecognizer:]):
        (-[WKTouchActionGestureRecognizer canPreventGestureRecognizer:]):
        * WebKit.xcodeproj/project.pbxproj:

2019-07-06  Chris Fleizach  <cfleizach@apple.com>

        AX: CrashTracer: com.apple.WebKit.WebContent at WebKit: WebKit::WebSpeechSynthesisClient::speak
        https://bugs.webkit.org/show_bug.cgi?id=199435

        Reviewed by Ryosuke Niwa.

        Ensure we don't access null observers in speech callbacks.

        * WebProcess/WebCoreSupport/WebSpeechSynthesisClient.cpp:
        (WebKit::WebSpeechSynthesisClient::voiceList):
        (WebKit::WebSpeechSynthesisClient::speak):
        (WebKit::WebSpeechSynthesisClient::pause):
        (WebKit::WebSpeechSynthesisClient::resume):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::speakingErrorOccurred):
        (WebKit::WebPage::boundaryEventOccurred):
        (WebKit::WebPage::voicesDidChange):

2019-07-05  Chris Dumez  <cdumez@apple.com>

        Fix thread safety bug in WebResourceLoadStatisticsTelemetry::calculateAndSubmit()
        https://bugs.webkit.org/show_bug.cgi?id=199536

        Reviewed by Youenn Fablet.

        The resourceLoadStatisticsStore is an object that is created / used / destroyed on the background
        queue. It is therefore not safe to create a WeakPtr for it and use that WeakPtr on the main thread.

        * NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.cpp:
        (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit):

2019-07-05  Michael Catanzaro  <mcatanzaro@igalia.com>

        Unreviewed, fix -Wswitch warning

        We don't support HTTPCookieAcceptPolicy::ExclusivelyFromMainDocumentDomain.

        Fun fact, soup's OnlyFromMainDocumentDomain functions the same as Apple's
        ExclusivelyFromMainDocumentDomain. These should be renamed....

        * NetworkProcess/Cookies/soup/WebCookieManagerSoup.cpp:
        (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):

2019-07-05  Dean Jackson  <dino@apple.com>

        [iOS] Context Menu - Add to Reading List does nothing
        https://bugs.webkit.org/show_bug.cgi?id=199504
        <rdar://problem/52554137>

        Reviewed by Anders Carlsson.

        We were holding weak references to the _WKElementAction in
        the handler provided to UIAction. By the time the handler was
        called, the object had been deallocated.

        * UIProcess/API/Cocoa/_WKElementAction.mm:
        (-[_WKElementAction uiActionForElementInfo:]): Use strong references in handler.

2019-07-05  Ryosuke Niwa  <rniwa@webkit.org>

        [iOS] Crash in WebKit::WebPage::positionInformation via Range::startPosition
        https://bugs.webkit.org/show_bug.cgi?id=199503

        Reviewed by Wenson Hsieh.

        The crash was caused because focusedElementPositionInformation asssumes Editor::compositionRange is not null
        whenever Editor::hasComposition returns true, which is not necessary the case when Editor::m_compositionNode
        contains no text (data is of length 0).

        Fixed the crash by adding an early return for when Editor::compositionRange returns nullptr.

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

2019-07-05  Zalan Bujtas  <zalan@apple.com>

        [ContentChangeObserver] REGRESSION (r247015): facebook photo/video upload button is unresponsive to user interaction.
        https://bugs.webkit.org/show_bug.cgi?id=199502
        <rdar://problem/52547473>

        Reviewed by Simon Fraser.

        Apparently it's a common practice to put transparent elements over visible click targets (button like divs) and use the invisible
        elements to catch the user input (e.g. Facebook's Photo/Video button).
        This patch modifies the original "do not trigger click on invisible targets" heuristic to a more restrictive "do not trigger
        click if the click target was previously hidden and became visible through touch start".
        If this still breaks some use cases, we could turn it into YouTube quirk.       

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

2019-07-05  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r247123.

        Caused TestWebKitAPI.Challenge.BasicProposedCredential to
        fail.

        Reverted changeset:

        "Only allow fetching and removing session credentials from
        WebsiteDataStore"
        https://bugs.webkit.org/show_bug.cgi?id=199385
        https://trac.webkit.org/changeset/247123

2019-07-05  Wenson Hsieh  <wenson_hsieh@apple.com>

        Click events on outer page are not being dispatched correctly after touch-zooming within an iframe
        https://bugs.webkit.org/show_bug.cgi?id=185001
        <rdar://problem/40569615>

        Reviewed by Simon Fraser.

        Mitigations introduced in r227759 prevent a touch inside a document of origin A to result in a click event being
        dispatched on an element inside a document of origin B. It accomplishes this by keeping track of the security
        origin of the last touch via m_potentialTapSecurityOrigin on WebPage. However, there exists a corner case in
        which m_potentialTapSecurityOrigin, set after touching a document in a subframe, may persist even after the user
        has finished interacting, causing taps in subsequent documents to not result in synthetic click events due to
        mismatched potential tap origins.

        This may happen if the first user gesture happens inside an element in a subframe with touch event handlers, but
        no click event handler (and the touch is additionally not over some clickable element). In this case,
        m_potentialTapNode is set to null in WebPage::potentialTapAtPosition, and when we consult it in
        WebPage::commitPotentialTap, we just end up calling commitPotentialTapFailed(); and return early. This means
        that m_potentialTapNode, m_potentialTapLocation, and (importantly) m_potentialTapSecurityOrigin are not reset.
        This causes subsequent taps in the top-level document to never dispatch click events, if the security origin
        does not match with that of the subframe.

        To fix this, we add a new async IPC message from the UI process to the web process to ensure that our current
        security origin is reset before attempting to handle a tap.

        Test: http/tests/events/touch/ios/click-after-handling-touch-in-cross-origin-frame.https.html

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

        Reset any stale potential tap security origin if needed.

        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _webTouchEventsRecognized:]):

        Send the new IPC message when starting a touch.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::resetPotentialTapSecurityOrigin):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2019-07-05  Wenson Hsieh  <wenson_hsieh@apple.com>

        Touching media controls sometimes shows software keyboard
        https://bugs.webkit.org/show_bug.cgi?id=199490
        <rdar://problem/52076270>

        Reviewed by Eric Carlson.

        In r243044, we added a compatibility hack for Google Slides (and other G-suite properties) to allow the on-
        screen keyboard to show up after a prevented touch event in the case where an element was already focused, even
        if the touch event handler doesn't explicitly refocus the element. However, this means that if a regular text
        field (or other form control) has been programmatically focused, then interacting with any other element that
        prevents default on touchstart will cause us to show the keyboard for that focused element.

        To mitigate this, only fall down this refocusing codepath in the case where the focused element is a hidden
        editable element (in the style of many Google productivity web apps). For non-hidden editable elements that are
        already focused, this refocusing logic is not necessary, since the user should be able to interact with the
        control to show the keyboard anyways; for hidden editable areas, this compatibility hack is actually needed,
        since there is typically no other way for a user to focus these elements and show an on-screen keyboard.

        Tests:  fast/events/touch/ios/show-keyboard-after-preventing-touchstart.html
                fast/events/touch/ios/do-not-show-keyboard-after-preventing-touchstart.html

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::dispatchTouchEvent):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::isTransparentOrFullyClipped const):

        Renamed from enclosingLayerIsTransparentOrFullyClipped, and pulled out into a private helper method.

        (WebKit::WebPage::platformEditorState const):
        (WebKit::WebPage::requestEvasionRectsAboveSelection):
        (WebKit::WebPage::getFocusedElementInformation):
        (WebKit::enclosingLayerIsTransparentOrFullyClipped): Deleted.

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

        Simplify logic that handles registering WebProcessProxy objects with their WebsiteDataStore
        https://bugs.webkit.org/show_bug.cgi?id=199412
        <rdar://problem/51899751>

        Reviewed by Ryosuke Niwa.

        Simplify logic that handles registering WebProcessProxy objects with their WebsiteDataStore to make
        it more maintainable and less error-prone (avoid bugs like <rdar://problem/51899751>).

        The following changes were made:
        1. The WebProcess now registers / unregisters itself directly with its WebsiteDataStore when needed,
           instead of having the WebPageProxy/ProvisionalPageProxy be in charge of calling the right
           WebProcessLifetimeTracker / WebProcessLifetimeObserver abstractions.
        2. The WebProcessLifetimeTracker / WebProcessLifetimeObserver abstractions were dropped. The
           WebsiteDataStore was the only observer.
        3. The WebProcessProxy is now registered with its WebsiteDataStore as soon as it has a page (provisional
           or not) instead of waiting until the process has finished launching. This simplifies the logic a
           lot and waiting until the process has launched is not needed by the WebsiteDataStore.
           

        * Sources.txt:
        * UIProcess/ProvisionalPageProxy.cpp:
        (WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
        (WebKit::ProvisionalPageProxy::~ProvisionalPageProxy):
        * UIProcess/ProvisionalPageProxy.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::m_resetRecentCrashCountTimer):
        (WebKit::WebPageProxy::finishAttachingToWebProcess):
        (WebKit::WebPageProxy::close):
        (WebKit::WebPageProxy::processDidTerminate):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebProcessCache.cpp:
        (WebKit::WebProcessCache::CachedProcess::CachedProcess):
        * UIProcess/WebProcessLifetimeObserver.cpp: Removed.
        * UIProcess/WebProcessLifetimeObserver.h: Removed.
        * UIProcess/WebProcessLifetimeTracker.cpp: Removed.
        * UIProcess/WebProcessLifetimeTracker.h: Removed.
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::setWebsiteDataStore):
        (WebKit::WebProcessProxy::updateRegistrationWithDataStore):
        (WebKit::WebProcessProxy::addProvisionalPageProxy):
        (WebKit::WebProcessProxy::removeProvisionalPageProxy):
        (WebKit::WebProcessProxy::connectionWillOpen):
        (WebKit::WebProcessProxy::processWillShutDown):
        (WebKit::WebProcessProxy::addExistingWebPage):
        (WebKit::WebProcessProxy::removeWebPage):
        * UIProcess/WebProcessProxy.h:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::registerProcess):
        (WebKit::WebsiteDataStore::unregisterProcess):

        (WebKit::WebsiteDataStore::processPoolForCookieStorageOperations):
        Drop change that was added in r246097 to work around the fact that WebProcessProxy objects
        were only registering themselves with their data store after their process had finished
        launching.

        (WebKit::WebsiteDataStore::fetchDataAndApply):
        (WebKit::WebsiteDataStore::removeData):
        (WebKit::WebsiteDataStore::processPools const):
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        (WebKit::WebsiteDataStore::processes const):
        * WebKit.xcodeproj/project.pbxproj:

2019-07-04  Zalan Bujtas  <zalan@apple.com>

        [ContentChangeObserver] Limit mouseOut dispatching after synthetic click to YouTube.com
        https://bugs.webkit.org/show_bug.cgi?id=199497
        <rdar://problem/52361019>

        Reviewed by Wenson Hsieh.

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

2019-07-03  Ryosuke Niwa  <rniwa@webkit.org>

        Crash in WebDragClient::startDrag because GraphicsContext is nullptr
        https://bugs.webkit.org/show_bug.cgi?id=199491

        Reviewed by Wenson Hsieh.

        Added a nullptr check.

        Unfortunately no new tests since we don't have a reproducible test case.

        * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
        (WebKit::convertImageToBitmap):

2019-07-03  Tim Horton  <timothy_horton@apple.com>

        Data Detectors are not working for context menus in clients that use the legacy preview API
        https://bugs.webkit.org/show_bug.cgi?id=199486
        <rdar://problem/52117322>

        Reviewed by Dean Jackson.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView assignLegacyDataForContextMenuInteraction]):
        The Data Detectors code in the legacy preview path is guarded by a
        #define that did not survive upstreaming. Remove it.

2019-07-03  Chris Dumez  <cdumez@apple.com>

        StorageManager::suspend() sometimes fails to call its completion handler
        https://bugs.webkit.org/show_bug.cgi?id=199482

        Reviewed by Youenn Fablet.

        Make sure the completion handler gets called in the early return cases.

        * NetworkProcess/WebStorage/StorageManager.cpp:
        (WebKit::StorageManager::suspend):

2019-07-03  Youenn Fablet  <youenn@apple.com>

        Make CacheStorage::Engine directory listing operations in a background thread
        https://bugs.webkit.org/show_bug.cgi?id=199470

        Reviewed by Chris Dumez.

        Use the io work queue to get the list of directories.
        Then go back to main thread and trigger clear/fetch operation as currently done.

        * NetworkProcess/cache/CacheStorageEngine.cpp:
        (WebKit::CacheStorage::ReadOriginsTaskCounter::create):
        (WebKit::CacheStorage::ReadOriginsTaskCounter::ReadOriginsTaskCounter):
        (WebKit::CacheStorage::Engine::getDirectories):
        (WebKit::CacheStorage::Engine::fetchEntries):
        (WebKit::CacheStorage::Engine::fetchDirectoryEntries):
        (WebKit::CacheStorage::Engine::clearCachesForOriginFromDisk):
        (WebKit::CacheStorage::Engine::clearCachesForOriginFromDirectories):
        * NetworkProcess/cache/CacheStorageEngine.h:

2019-07-03  Sihui Liu  <sihui_liu@apple.com>

        Only allow fetching and removing session credentials from WebsiteDataStore
        https://bugs.webkit.org/show_bug.cgi?id=199385

        Reviewed by Alex Christensen.

        Stop sending an extra message to network process for fetching or removing persistent credentials.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::fetchWebsiteData):
        (WebKit::NetworkProcess::deleteWebsiteData):
        (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
        (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
        (WebKit::NetworkProcess::originsWithPersistentCredentials): Deleted.
        (WebKit::NetworkProcess::removeCredentialsWithOrigins): Deleted.
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::originsWithPersistentCredentials): Deleted.
        (WebKit::NetworkProcess::removeCredentialsWithOrigins): Deleted.
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::fetchDataAndApply):
        (WebKit::computeWebProcessAccessTypeForDataRemoval):
        (WebKit::WebsiteDataStore::removeData):

2019-07-03  Tim Horton  <timothy_horton@apple.com>

        UI process exception when dragging an <attachment> with no content type
        https://bugs.webkit.org/show_bug.cgi?id=199480
        <rdar://problem/44351353>

        Reviewed by Wenson Hsieh.

        * UIProcess/API/Cocoa/APIAttachmentCocoa.mm:
        (API::Attachment::mimeType const):
        (API::Attachment::utiType const):
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::startDrag):
        Make null or empty contentType fail the drag, instead of crashing.

2019-07-03  Chris Dumez  <cdumez@apple.com>

        Clarify threading model for WebResourceLoadStatisticsStore::dumpResourceLoadStatistics()
        https://bugs.webkit.org/show_bug.cgi?id=199468

        Reviewed by Youenn Fablet.

        Our convention is that the WebResourceLoadStatisticsStore is always created, used and
        destroyed on the main thread, while the ResourceLoadStatisticsStore is always created,
        used and destroyed on the background queue.

        r245517 broke this convention by introducing a tryDumpResourceLoadStatistics() method
        to WebResourceLoadStatisticsStore which gets called on the background queue. This patch
        fixes this since this has been a huge source of thread-safety bugs in the past.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        (WebKit::ResourceLoadStatisticsDatabaseStore::dumpResourceLoadStatistics):
        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
        (WebKit::ResourceLoadStatisticsMemoryStore::dumpResourceLoadStatistics):
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
        (WebKit::ResourceLoadStatisticsStore::removeDataRecords):
        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
        (WebKit::ResourceLoadStatisticsStore::dataRecordsBeingRemoved const):
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::dumpResourceLoadStatistics):
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:

2019-07-03  Jonathan Bedard  <jbedard@apple.com>

        [Catalina] Enable WebKit build
        https://bugs.webkit.org/show_bug.cgi?id=199209

        Reviewed by Darin Adler.

        * UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.h: AppSSO is SPI.
        * WebKit2Prefix.h: SecTask.h declares SecTaskGetCodeSignStatus(...) unavailable
        on Mac, exclude this header.

2019-07-03  Daniel Bates  <dabates@apple.com>

        REGRESSION (r246817): fast/events/ios/key-events-comprehensive/key-events-{control, control-shift}.html are failing
        https://bugs.webkit.org/show_bug.cgi?id=199465
        <rdar://problem/52613496>

        Reviewed by Wenson Hsieh.

        Don't advertise that WebKit can perform cursor movements when there isn't some kind of selection.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView canPerformAction:withSender:]):

2019-07-03  Chris Dumez  <cdumez@apple.com>

        Fix a couple of thread safety issues in ResourceLoadStatisticsStore
        https://bugs.webkit.org/show_bug.cgi?id=199463

        Reviewed by Alex Christensen.

        The ResourceLoadStatisticsStore object is constructed / used / destroyed on a background queue.
        It is therefore not safe to use a WeakPtr to the ResourceLoadStatisticsStore on the main thread.

        The safe pattern is to have the ResourceLoadStatisticsStore capture a Ref<> of its m_store before
        dispatching to the main thread and use this store on the main thread instead of weakThis->m_store.
        ResourceLoadStatisticsStore's m_store is constructed / used / destroyed on the main thread.

        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
        (WebKit::ResourceLoadStatisticsStore::removeDataRecords):
        (WebKit::ResourceLoadStatisticsStore::processStatisticsAndDataRecords):

2019-07-03  Youenn Fablet  <youenn@apple.com>

        Isolate CacheStorage::Engine path when hopping to a background thread
        https://bugs.webkit.org/show_bug.cgi?id=199461

        Reviewed by Chris Dumez.

        * NetworkProcess/cache/CacheStorageEngine.cpp:
        (WebKit::CacheStorage::Engine::initialize):

2019-07-03  Jer Noble  <jer.noble@apple.com>

        Unreviewed, rolling out r246053.

        This changeset caused media playback to break when the hosting app was backgrounded.

        * UIProcess/ApplicationStateTracker.mm:
        * UIProcess/ios/ProcessAssertionIOS.mm:
        (-[WKProcessAssertionBackgroundTaskManager init]):
        (-[WKProcessAssertionBackgroundTaskManager _scheduleReleaseTask]):
        (-[WKProcessAssertionBackgroundTaskManager _cancelPendingReleaseTask]):
        (-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]):
        (-[WKProcessAssertionBackgroundTaskManager _releaseBackgroundTask]):

2019-07-03  Alex Christensen  <achristensen@webkit.org>

        Use smarter pointers in WKDownloadProgress
        https://bugs.webkit.org/show_bug.cgi?id=199456
        <rdar://problem/51392926>

        Reviewed by Chris Dumez.

        There's still a problem related to our use of raw pointers.  Let's just not use raw pointers.

        * NetworkProcess/Downloads/Download.h:
        * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
        (WebKit::Download::publishProgress):
        * NetworkProcess/Downloads/cocoa/WKDownloadProgress.h:
        * NetworkProcess/Downloads/cocoa/WKDownloadProgress.mm:
        (-[WKDownloadProgress performCancel]):
        (-[WKDownloadProgress initWithDownloadTask:download:URL:sandboxExtension:]):
        (-[WKDownloadProgress progressCancelled]): Deleted.

2019-07-03  Sam Weinig  <weinig@apple.com>

        Adopt simple structured bindings in more places
        https://bugs.webkit.org/show_bug.cgi?id=199247

        Reviewed by Alex Christensen.

        Replaces simple uses of std::tie() with structured bindings. Does not touch
        uses of std::tie() that are not initial declarations, use std::ignore or in
        case where the binding is captured by a lambda, as structured bindings don't
        work for those cases yet.

        * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
        (WebKit::NetworkCache::printSpeculativeLoadingDiagnosticMessageCounts):
        * NetworkProcess/cache/PrefetchCache.cpp:
        (WebKit::PrefetchCache::clearExpiredEntries):
        * Platform/IPC/MessageReceiverMap.cpp:
        (IPC::MessageReceiverMap::removeMessageReceiver):
        * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
        (WebKit::PlaybackSessionManagerProxy::invalidate):
        * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
        (WebKit::VideoFullscreenManagerProxy::invalidate):
        (WebKit::VideoFullscreenManagerProxy::requestHideAndExitFullscreen):
        (WebKit::VideoFullscreenManagerProxy::hasMode const):
        (WebKit::VideoFullscreenManagerProxy::mayAutomaticallyShowVideoPictureInPicture const):
        (WebKit::VideoFullscreenManagerProxy::isPlayingVideoInEnhancedFullscreen const):
        (WebKit::VideoFullscreenManagerProxy::applicationDidBecomeActive):
        (WebKit::VideoFullscreenManagerProxy::setupFullscreenWithID):
        (WebKit::VideoFullscreenManagerProxy::didCleanupFullscreen):
        * UIProcess/ios/SmartMagnificationController.mm:
        (WebKit::SmartMagnificationController::zoomFactorForTargetRect):
        (WebKit::SmartMagnificationController::didCollectGeometryForSmartMagnificationGesture):
        (WebKit::SmartMagnificationController::magnify):
        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit:: const):
        * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
        (WebKit::WebPage::performDictionaryLookupAtLocation):
        (WebKit::WebPage::performDictionaryLookupForSelection):
        * WebProcess/cocoa/PlaybackSessionManager.mm:
        (WebKit::PlaybackSessionManager::~PlaybackSessionManager):
        (WebKit::PlaybackSessionManager::removeContext):
        * WebProcess/cocoa/VideoFullscreenManager.mm:
        (WebKit::VideoFullscreenManager::~VideoFullscreenManager):
        (WebKit::VideoFullscreenManager::removeContext):
        (WebKit::VideoFullscreenManager::enterVideoFullscreenForVideoElement):
        (WebKit::VideoFullscreenManager::requestVideoContentLayer):
        (WebKit::VideoFullscreenManager::didSetupFullscreen):
        (WebKit::VideoFullscreenManager::willExitFullscreen):
        (WebKit::VideoFullscreenManager::didEnterFullscreen):
        (WebKit::VideoFullscreenManager::didCleanupFullscreen):
        (WebKit::VideoFullscreenManager::setVideoLayerFrameFenced):

2019-07-03  Zalan Bujtas  <zalan@apple.com>

        [ContentChangeObserver] REGRESSION (r244356): Drop down menus collapse without user input - Ebay.com
        https://bugs.webkit.org/show_bug.cgi?id=199457
        <rdar://problem/52386563>

        Reviewed by Simon Fraser.

        There's a fixed, 32ms window for observing content changes after the tap is committed. r244356 introduced the fast-click behavior on form elements by omitting this fixed window and
        dispatch the synthetic click on the target node.
        This patch preserves the fast-click behavior, but now we stay at hover if the mouseMove event triggers a synchronous actionable visiblity change (as opposed to always proceed with click).

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

2019-07-03  Patrick Griffis  <pgriffis@igalia.com>

        [GTK][WPE] Remove Flatpak sandbox
        https://bugs.webkit.org/show_bug.cgi?id=199416

        Reviewed by Michael Catanzaro.

        The flatpak-spawn based sandbox was only a proof of concept and
        lacks flexibility for our needs so we ended up using it with very
        permissive permissions and it still imposed limitations that our main
        bubblewrap sandbox didn't have.

        So in order to get as many applications using the sandbox as possible we
        will just remove this for now and focus on bubblewrap. At some point
        it may be possible to improve flatpak-spawn to fit our needs.

        * SourcesGTK.txt:
        * SourcesWPE.txt:
        * UIProcess/Launcher/glib/FlatpakLauncher.cpp: Removed.
        * UIProcess/Launcher/glib/FlatpakLauncher.h: Removed.
        * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
        (WebKit::ProcessLauncher::launchProcess):

2019-07-03  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r246616.

        Caused http/tests/inspector/network/har/har-page.html to fail
        on Catalina.

        Reverted changeset:

        "Web Inspector: Network: replace CFNetwork SPI with new API
        where able"
        https://bugs.webkit.org/show_bug.cgi?id=198762
        https://trac.webkit.org/changeset/246616

2019-07-03  Chris Dumez  <cdumez@apple.com>

        Crash under WTF::RefCounted<WebKit::TaskCounter>::deref()
        https://bugs.webkit.org/show_bug.cgi?id=199453
        <rdar://problem/51991477>

        Reviewed by Youenn Fablet.

        The crash was caused by StorageManager::suspend() getting called on the main thread but calling
        its completion handler on a background queue. The completion handler was capturing a TaskCounter
        object which is RefCounted (not ThreadSafeRefCounted).

        Address the issue by making sure StorageManager::suspend() calls its completion handler on the
        main thread. Also get rid of TaskCounter and use a WTF::CallbackAggregator instead.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::actualPrepareToSuspend):
        (WebKit::TaskCounter::TaskCounter): Deleted.
        (WebKit::TaskCounter::~TaskCounter): Deleted.
        * NetworkProcess/WebStorage/StorageManager.cpp:
        (WebKit::StorageManager::suspend):

2019-07-03  Youenn Fablet  <youenn@apple.com>

        Make sure to cross-thread copy in StorageManager when hopping back to the main thread
        https://bugs.webkit.org/show_bug.cgi?id=199423

        Reviewed by Chris Dumez.

        Make sure to isolate copy some strings that may not be isolated in case of ephemeral sessions.
        Small refactoring to use crossThreadCopy instead of doing vector copy ourselves.

        * NetworkProcess/WebStorage/LocalStorageDatabaseTracker.h:
        (WebKit::LocalStorageDatabaseTracker::OriginDetails::isolatedCopy const):
        * NetworkProcess/WebStorage/StorageManager.cpp:
        (WebKit::StorageManager::deleteSessionStorageEntriesForOrigins):
        (WebKit::StorageManager::getLocalStorageOrigins):
        (WebKit::StorageManager::getLocalStorageOriginDetails):
        (WebKit::StorageManager::deleteLocalStorageEntriesForOrigins):

2019-07-02  Joonghun Park  <jh718.park@samsung.com>

        Unreviewed. Fix build break introduced in r247058.

        * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:

2019-07-02  Youenn Fablet  <youenn@apple.com>

        StorageManager does not need to be a WorkQueueMessageReceiver anymore
        https://bugs.webkit.org/show_bug.cgi?id=199421

        Reviewed by Chris Dumez.

        * NetworkProcess/WebStorage/StorageManager.h:

2019-07-02  Chris Dumez  <cdumez@apple.com>

        ThreadSafeRefCounted<DestructionThread::Main> is not safe to use in the UIProcess
        https://bugs.webkit.org/show_bug.cgi?id=199420
        <rdar://problem/52289717>

        Reviewed by Ryosuke Niwa.

        Update IPC::Connection and DeviceIdHashSaltStorage to use DestructionThread::MainRunLoop
        instead of DestructionThread::Main, since both classes are used in the UIProcess.

        Using DestructionThread::Main is not safe in the UIProcess because its implementation relies
        on isMainThread() / callOnMainThread(). Those get confused about which thread is the main
        thread when an application uses both WK1 and WK2.

        * Platform/IPC/Connection.h:
        * UIProcess/DeviceIdHashSaltStorage.h:

2019-07-02  Patrick Griffis  <pgriffis@igalia.com>

        [GTK][WPE] Explicitly blacklist problematic directories for sandbox
        https://bugs.webkit.org/show_bug.cgi?id=199367

        Reviewed by Michael Catanzaro.

        There are some directories that simply do not make sense to bind into the sandbox
        and will only cause issues such as `/proc` so lets just block them.

        * UIProcess/API/glib/WebKitWebContext.cpp:
        (path_is_not_blacklisted):
        (webkit_web_context_add_path_to_sandbox):

2019-07-02  Tim Horton  <timothy_horton@apple.com>

        REGRESSION (r243240): Unable to swipe back in Safari
        https://bugs.webkit.org/show_bug.cgi?id=199394
        <rdar://problem/51137447>

        Reviewed by Wenson Hsieh.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _processDidExit]):
        r243240 started nilling out the ViewGestureController, but we don't actually
        expect that; the only time WKWebView's ViewGestureController goes away
        is if the client turns off the gestures... and so nothing ever puts it back.
        Instead, just always disconnect, don't nil it out.

2019-07-02  Chris Dumez  <cdumez@apple.com>

        Protect NetworkProcess::m_networkSessions against corruption
        https://bugs.webkit.org/show_bug.cgi?id=199418
        <rdar://problem/50614019>

        Reviewed by Youenn Fablet.

        I believe the most likely reason for the crash at <rdar://problem/50614019> is that NetworkProcess::m_networkSessions
        is getting corrupted and is returning us a bad pointer.

        To harden our code, I added debug assertions to make sure that this HashMap is only used on the main thread and
        to make sure that the sessionID used as key is always valid. I have also added if checks to avoid crashing in
        release whenever possible.

        Note that we came to a similar conclusion for NetworkProcess::m_swServers when investigating rdar://problem/51859081,
        so the two radars are potentially related. Both HashMaps are owned by the NetworkProcess and use a SessionID
        as key.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
        (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
        (WebKit::NetworkConnectionToWebProcess::logUserInteraction):
        (WebKit::NetworkConnectionToWebProcess::logWebSocketLoading):
        (WebKit::NetworkConnectionToWebProcess::logSubresourceLoading):
        (WebKit::NetworkConnectionToWebProcess::logSubresourceRedirect):
        (WebKit::NetworkConnectionToWebProcess::hasStorageAccess):
        (WebKit::NetworkConnectionToWebProcess::requestStorageAccess):
        (WebKit::NetworkConnectionToWebProcess::requestStorageAccessUnderOpener):
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::networkSession const):
        (WebKit::NetworkProcess::setSession):
        (WebKit::NetworkProcess::destroySession):
        (WebKit::NetworkProcess::addKeptAliveLoad):
        (WebKit::NetworkProcess::removeKeptAliveLoad):
        (WebKit::NetworkProcess::webProcessWasDisconnected):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::retrieveCacheEntry):
        (WebKit::NetworkResourceLoader::didFinishWithRedirectResponse):
        (WebKit::NetworkResourceLoader::tryStoreAsCacheEntry):
        (WebKit::NetworkResourceLoader::shouldLogCookieInformation):
        * NetworkProcess/ios/NetworkConnectionToWebProcessIOS.mm:
        (WebKit::NetworkConnectionToWebProcess::paymentCoordinatorBoundInterfaceIdentifier):
        (WebKit::NetworkConnectionToWebProcess::paymentCoordinatorCTDataConnectionServiceType):
        (WebKit::NetworkConnectionToWebProcess::paymentCoordinatorSourceApplicationBundleIdentifier):
        (WebKit::NetworkConnectionToWebProcess::paymentCoordinatorSourceApplicationSecondaryIdentifier):

2019-07-02  Chris Dumez  <cdumez@apple.com>

        VisitedLinkStore does not need to subclass WebProcessLifetimeObserver
        https://bugs.webkit.org/show_bug.cgi?id=199407

        Reviewed by Sam Weinig.

        VisitedLinkStore does not need to subclass WebProcessLifetimeObserver, it overrides
        only 2 of WebProcessLifetimeObserver's functions and the implementation of those
        overrides is empty. It also does not use WebProcessLifetimeObserver::processes()
        since the VisitedLinkStore maintains its own list of processes.

        * UIProcess/API/mac/WKView.mm:
        * UIProcess/Automation/WebAutomationSession.cpp:
        * UIProcess/VisitedLinkStore.cpp:
        * UIProcess/VisitedLinkStore.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::m_resetRecentCrashCountTimer):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:

2019-07-02  Chris Dumez  <cdumez@apple.com>

        Null dereference under StorageManager::destroySessionStorageNamespace()
        https://bugs.webkit.org/show_bug.cgi?id=199388
        <rdar://problem/52030641>

        Reviewed by Youenn Fablet.

        * NetworkProcess/WebStorage/StorageManager.cpp:
        (WebKit::StorageManager::createSessionStorageNamespace):
        Call HashMap::ensure() instead of contains() + set() to avoid double hash lookup.

        (WebKit::StorageManager::destroySessionStorageNamespace):
        Add null check to address top crasher, similarly to what was done in r246552.
        I am keeping the debug assertion since this is not supposed to happen.

2019-07-02  Daniel Bates  <dabates@apple.com>

        [iOS] Cannot tab cycle through credit card fields on antonsvpatisserie.com checkout page
        https://bugs.webkit.org/show_bug.cgi?id=196053
        <rdar://problem/49093034>

        Reviewed by Wenson Hsieh.

        Allow iframes to be keyboard focusable when pressing the Tab key on the keyboard. This
        also allow the that the focus controller to search their content document for other
        editable elements. This makes iOS match the behavior on Mac.

        Although iframes can be focused by pressing the Tab key we maintain the current UI
        restriction on iOS of not allowing iframes themselves to be focusable via the next and
        previous accessory bar buttons. We do this because it's unclear what value supporting
        such focusing brings, but it's clear that doing so makes tab cycling more confusing
        since the default focus appearance for an iframe is indistinguishable from its non-
        focused appearance.

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::isAssistableElement): Do not consider an iframe as assistable.

2019-07-02  Alexander Mikhaylenko  <exalm7659@gmail.com>

        [GTK] Support cancelling touchscreen back/forward gesture
        https://bugs.webkit.org/show_bug.cgi?id=199401

        Reviewed by Michael Catanzaro.

        It should be possible to cancel the gesture when performing it on
        touchscreen, for example, by moving pen too far from the screen.
        Handle this case properly.

        Only DragGesture in GestureController needs to handle this,
        SwipeGesture simply won't emit the relevant event in this case.

        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        * UIProcess/ViewGestureController.h:
        * UIProcess/gtk/GestureController.cpp:
        (WebKit::GestureController::DragGesture::cancelDrag):
        (WebKit::GestureController::DragGesture::cancel):
        (WebKit::GestureController::DragGesture::DragGesture):
        * UIProcess/gtk/GestureController.h:
        * UIProcess/gtk/ViewGestureControllerGtk.cpp:
        (WebKit::ViewGestureController::platformTeardown):
        (WebKit::ViewGestureController::cancelSwipe):

2019-07-02  Devin Rousso  <drousso@apple.com>

        Web Inspector: Debug: "Reset Web Inspector" should also clear the saved window size and attachment side
        https://bugs.webkit.org/show_bug.cgi?id=198956

        Reviewed by Matt Baker.

        * UIProcess/WebPreferences.h:
        * UIProcess/WebPreferences.cpp:
        (WebKit::WebPreferences::deleteKey): Added.
        * UIProcess/gtk/WebPreferencesGtk.cpp:
        (WebKit::WebPreferences::platformDeleteKey): Added.
        * UIProcess/mac/WebPreferencesMac.mm:
        (WebKit::WebPreferences::platformDeleteKey): Added.
        * UIProcess/wpe/WebPreferencesWPE.cpp:
        (WebKit::WebPreferences::platformDeleteKey): Added.
        * UIProcess/win/WebPreferencesWin.cpp:
        (WebKit::WebPreferences::platformDeleteKey): Added.
        * Shared/WebPreferencesStore.h:
        * Shared/WebPreferencesStore.cpp:
        (WebKit::WebPreferencesStore::deleteKey): Added.

        * UIProcess/WebInspectorProxy.messages.in:
        * UIProcess/WebInspectorProxy.h:
        * UIProcess/WebInspectorProxy.cpp:
        (WebKit::WebInspectorProxy::resetWindowState): Added.
        (WebKit::WebInspectorProxy::platformResetWindowState): Added.
        * UIProcess/gtk/WebInspectorProxyGtk.cpp:
        (WebKit::WebInspectorProxy::platformResetWindowState): Added.
        * UIProcess/mac/WebInspectorProxyMac.mm:
        (WebKit::WebInspectorProxy::platformResetWindowState): Added.
        * UIProcess/wpe/WebInspectorProxyWPE.cpp:
        (WebKit::WebInspectorProxy::platformResetWindowState): Added.
        * UIProcess/win/WebInspectorProxyWin.cpp:
        (WebKit::WebInspectorProxy::platformResetWindowState): Added.
        * WebProcess/WebPage/WebInspectorUI.h:
        * WebProcess/WebPage/WebInspectorUI.cpp:
        (WebKit::WebInspectorUI::resetWindowState): Added.

        * UIProcess/RemoteWebInspectorProxy.messages.in:
        * UIProcess/RemoteWebInspectorProxy.h:
        * UIProcess/RemoteWebInspectorProxy.cpp:
        (WebKit::RemoteWebInspectorProxy::resetWindowState): Added.
        (WebKit::RemoteWebInspectorProxy::platformResetWindowState): Added.
        * UIProcess/gtk/RemoteWebInspectorProxyGtk.cpp:
        (WebKit::RemoteWebInspectorProxy::platformResetWindowState): Added.
        * UIProcess/mac/RemoteWebInspectorProxyMac.mm:
        (WebKit::RemoteWebInspectorProxy::platformResetWindowState): Added.
        * UIProcess/win/RemoteWebInspectorProxyWin.cpp:
        (WebKit::RemoteWebInspectorProxy::platformResetWindowState): Added.
        * WebProcess/WebPage/RemoteWebInspectorUI.h:
        * WebProcess/WebPage/RemoteWebInspectorUI.cpp:
        (WebKit::RemoteWebInspectorUI::resetWindowState): Added.

2019-07-01  Chris Dumez  <cdumez@apple.com>

        Remove virtual functions on WebProcessLifetimeObserver that are unused after r245540
        https://bugs.webkit.org/show_bug.cgi?id=199383

        Reviewed by Alex Christensen.

        * UIProcess/WebProcessLifetimeObserver.h:
        (WebKit::WebProcessLifetimeObserver::webProcessDidCloseConnection):
        * UIProcess/WebProcessLifetimeTracker.cpp:
        (WebKit::WebProcessLifetimeTracker::addObserver):
        (WebKit::WebProcessLifetimeTracker::pageWasInvalidated):

2019-07-01  Chris Dumez  <cdumez@apple.com>

        StorageManager::SessionStorageNamespace::allowedConnections() should not copy the HashSet
        https://bugs.webkit.org/show_bug.cgi?id=199379

        Reviewed by Alex Christensen.

        This was pretty inefficient.

        * NetworkProcess/WebStorage/StorageManager.cpp:
        (WebKit::StorageManager::SessionStorageNamespace::allowedConnections const):

2019-07-01  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] REGRESSION (r246757): Unable to select non-editable text in subframes
        https://bugs.webkit.org/show_bug.cgi?id=199366
        <rdar://problem/52460509>

        Reviewed by Tim Horton.

        r246757 removed logic in selectionPositionInformation responsible for setting the focused frame when handling a
        position information request. As the FIXME formerly in InteractionInformationRequest.h alluded to, text
        selection gestures on iOS were dependent on this behavior when selecting text in subframes, since text selection
        helpers in WebPageIOS.mm assume that the focused frame already contains the selection being set.

        Rather than calling setFocusedFrame when requesting position information, we can fix this by making
        WebPage::selectWithGesture and WebPage::selectTextWithGranularityAtPoint both set the focused frame if needed
        before extending or moving text selections.

        Covered by layout tests that began to fail after r246757:
        - editing/selection/ios/selection-handles-in-iframe.html
        - editing/selection/ios/selection-handle-clamping-in-iframe.html

        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::selectWithGesture):

        Only call the new helper method, setFocusedFrameBeforeSelectingTextAtLocation, at the start of the gesture.

        (WebKit::WebPage::setFocusedFrameBeforeSelectingTextAtLocation):
        (WebKit::WebPage::selectTextWithGranularityAtPoint):

2019-07-01  Alex Christensen  <achristensen@webkit.org>

        Add new decidePolicyForNavigationAction SPI with preferences and userInfo
        https://bugs.webkit.org/show_bug.cgi?id=199371
        <rdar://problem/52352905>

        Reviewed by Tim Horton.

        Also deprecate some older SPI so we may someday clean up this mess.

        * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
        * UIProcess/Cocoa/NavigationState.h:
        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::setNavigationDelegate):
        (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
        (WebKit::NavigationState::NavigationClient::shouldBypassContentModeSafeguards const):

2019-07-01  Alex Christensen  <achristensen@webkit.org>

        Deprecate but still call _webView:showCustomSheetForElement: after transition to UIContextMenuInteraction
        https://bugs.webkit.org/show_bug.cgi?id=199296
        <rdar://problem/51041960>

        Reviewed by Darin Adler.

        * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _showAttachmentSheet]):
        (-[WKContentView actionSheetAssistant:showCustomSheetForElement:]):
        (-[WKContentView continueContextMenuInteraction:]):

2019-07-01  Alex Christensen  <achristensen@webkit.org>

        Add main thread assertions in sendWithAsyncReply code
        https://bugs.webkit.org/show_bug.cgi?id=199324

        Reviewed by Sam Weinig.

        sendWithAsyncReply can only be used on the main thread because
        the CompletionHandler will be called on the main thread, and if it's
        called from a background thread, then HashMap corruption will likely happen.
        Add assertions to alert developers that they should only call sendWithAsyncReply
        from the main thread.

        This is responding to good feedback from r237294

        * Platform/IPC/Connection.cpp:
        (IPC::asyncReplyHandlerMap):
        (IPC::nextAsyncReplyHandlerID):
        (IPC::addAsyncReplyHandler):
        (IPC::clearAsyncReplyHandlers):
        (IPC::CompletionHandler<void):

2019-07-01  Eric Carlson  <eric.carlson@apple.com>

        [iOS] Exiting from fullscreen scrolls to top of page
        https://bugs.webkit.org/show_bug.cgi?id=199338
        <rdar://problem/51273017>

        Reviewed by Jer Noble.

        * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
        (-[WKFullScreenWindowController _completedExitFullScreen]): Restore scroll position.
        Hide window after restoring scroll position.
        (-[WKFullScreenWindowController _exitFullscreenImmediately]): Drive-by fix: remove code
        already also done in _completedExitFullScreen.

2019-07-01  Zalan Bujtas  <zalan@apple.com>

        Tapping on the bottom part of youtube video behaves as if controls were visible
        https://bugs.webkit.org/show_bug.cgi?id=199349
        <rdar://problem/51955744>

        Reviewed by Simon Fraser.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::handleTouchEvent):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::handleSyntheticClick):
        (WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
        (WebKit::WebPage::completeSyntheticClick):
        (WebKit::WebPage::potentialTapAtPosition):

2019-07-01  Wenson Hsieh  <wenson_hsieh@apple.com>

        iOS: REGRESSION(async scroll): Caret doesn't scroll when scrolling textarea
        https://bugs.webkit.org/show_bug.cgi?id=198217
        <rdar://problem/51097296>

        Reviewed by Simon Fraser.

        In iOS 12, when scrolling a text selection in an fast-scrolling container, editor state updates are scheduled
        under AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll after the end of the scrolling gesture,
        when the scrolling layer action is ScrollingLayerPositionAction::Set. This is no longer the case in iOS 13,
        because we now bail in ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling after scroll deceleration
        finishes since the scroll position didn't end up changing. Additionally, we no longer use
        ScrollingLayerPositionAction::Set in the case where scrolling finished decelerating, since
        ScrollingTreeScrollingNodeDelegateIOS::scrollViewDidScroll no longer uses to value of inUserInteraction to
        determine whether to Set or Sync scrolling layer positions.

        To restore iOS 12 behavior, ensure that we send a scrolling tree update using ScrollingLayerPositionAction::Set
        after scrolling ends.

        * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
        (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollViewDidScroll):

2019-07-01  Per Arne Vollan  <pvollan@apple.com>

        Perform less work when a pre-warmed WebProcess is suspended or resumed.
        https://bugs.webkit.org/show_bug.cgi?id=199195

        Reviewed by Darin Adler.

        Return early from WebProcess::actualPrepareToSuspend and WebProcess::processDidResume
        if this is a pre-warmed process. This is a confirmed improvement in page load time.

        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::actualPrepareToSuspend):
        (WebKit::WebProcess::cancelPrepareToSuspend):
        (WebKit::WebProcess::processDidResume):

2019-07-01  Carlos Garcia Campos  <cgarcia@igalia.com>

        WebSockets: add support for sending blob messages when using web sockets platform APIs
        https://bugs.webkit.org/show_bug.cgi?id=199189

        Reviewed by Youenn Fablet.

        Add helper private class BlobLoader that uses FileReaderLoader to load the blobs. Since blob loads are
        asynchronous, the messages are queued using another helper internal class PendingMessage.

        * WebProcess/Network/WebSocketChannel.cpp:
        (WebKit::WebSocketChannel::increaseBufferedAmount): Increase the buffered amount checking we don't overlofw.
        (WebKit::WebSocketChannel::decreaseBufferedAmount): Decrease the buffered amount.
        (WebKit::WebSocketChannel::sendMessage): Helper class to send message to the network process and decrease the
        buffered amount when done.
        (WebKit::WebSocketChannel::send): Queue the message in pending queue if there are pending messages in the queue
        for text and binary messages. For blobs, always queue the message unless it's an empty blob that we can handle
        as empty binary data directly.
        (WebKit::PendingMessage::PendingMessage): Helper class to queue message requests.
        (WebKit::PendingMessage::type const): Type of message: Text, Binary, Blob.
        (WebKit::PendingMessage::textMessage const): The text message.
        (WebKit::PendingMessage::binaryData const): The binary data.
        (WebKit::PendingMessage::blobLoader const): The blob loader.
        (WebKit::WebSocketChannel::fail): Notify the client about the error to ensure onclose is emitted.
        (WebKit::WebSocketChannel::disconnect): Clear the pending messages queue.
        * WebProcess/Network/WebSocketChannel.h:

2019-07-01  Miguel Gomez  <magomez@igalia.com>

        [WPE][GTK] Content disappearing when using CSS transforms
        https://bugs.webkit.org/show_bug.cgi?id=181757

        Reviewed by Žan Doberšek.

        Set the appropriate AnimatedBackingStoreClient to the TextureMapperLayers when required.

        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
        (WebKit::CoordinatedGraphicsScene::updateSceneState):

2019-06-30  Antti Koivisto  <antti@apple.com>

        Use separate variables for moving and stationary scrolling relationships in RemoteLayerTreeNode
        https://bugs.webkit.org/show_bug.cgi?id=199348

        Reviewed by Darin Adler.

        A layer can have only one acting scroll parent. Not using a vector for that case makes the code clearer.

        * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h:
        (WebKit::RemoteLayerTreeNode::actingScrollContainerID const):
        (WebKit::RemoteLayerTreeNode::stationaryScrollContainerIDs const):

        Separate fields for the acting container and stationary containers.

        (WebKit::RemoteLayerTreeNode::setActingScrollContainerID):
        (WebKit::RemoteLayerTreeNode::setStationaryScrollContainerIDs):
        (WebKit::RemoteLayerTreeNode::relatedScrollContainerIDs const): Deleted.
        (WebKit::RemoteLayerTreeNode::relatedScrollContainerPositioningBehavior const): Deleted.
        * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm:
        (WebKit::RemoteLayerTreeNode::setRelatedScrollContainerBehaviorAndIDs): Deleted.
        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
        (WebKit::isScrolledBy):
        (WebKit::findActingScrollParent):
        * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
        (WebKit::RemoteScrollingCoordinatorProxy::establishLayerTreeScrollingRelations):

2019-06-30  Fujii Hironori  <Hironori.Fujii@sony.com>

        [Win] Multiline mode of tooltip control does word-wrapping very slowly
        https://bugs.webkit.org/show_bug.cgi?id=198989

        Reviewed by Ross Kirsling.

        * UIProcess/win/WebView.cpp:
        (WebKit::truncatedString): Added.
        (WebKit::WebView::setToolTip): Use truncatedString.

2019-06-30  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        Pass WebProcess information to platformInitializeWebProcess().
        https://bugs.webkit.org/show_bug.cgi?id=199345

        Reviewed by Darin Adler.

        Add const reference to WebProcessProxy for first argument of
        WebProcessPool::platformInitializeWebProcess().

        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::initializeNewWebProcess):
        * UIProcess/WebProcessPool.h:
        * UIProcess/glib/WebProcessPoolGLib.cpp:
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        * UIProcess/win/WebProcessPoolWin.cpp:
        (WebKit::WebProcessPool::platformInitializeWebProcess):

2019-06-28  Brent Fulgham  <bfulgham@apple.com>

        Revise WebContent sandbox based on seed feedback
        https://bugs.webkit.org/show_bug.cgi?id=199339
        <rdar://problem/49609201>

        Reviewed by Alexey Proskuryakov.

        Unblock syscall needed by CoreText.

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

2019-06-28  Tim Horton  <timothy_horton@apple.com>

        iOS WebKit2 find-in-page indicator doesn't move with 'overflow: scroll'
        https://bugs.webkit.org/show_bug.cgi?id=175032
        <rdar://problem/29346482>

        Reviewed by Wenson Hsieh.

        * WebProcess/WebPage/FindController.cpp:
        (WebKit::FindController::drawRect):
        (WebKit::FindController::didScrollAffectingFindIndicatorPosition):
        Adopt the macOS code that notices that the find highlight doesn't match
        its original position, but instead of hiding the highlight like we do on macOS,
        update it. We do this asynchronously to avoid mutating the layer tree
        in the middle of painting, which is not /truly/ unsafe, but definitely
        non-ideal and causes fun flashes.

        * WebProcess/WebPage/FindController.h:
        * WebProcess/WebPage/ios/FindControllerIOS.mm:
        (WebKit::FindController::updateFindIndicator):
        Store m_findIndicatorRect when updating the indicator, just like we do on macOS.

2019-06-28  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed build fix attempt after r246928.

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

2019-06-28  Youenn Fablet  <youenn@apple.com>

        Protect NetworkProcess::m_swServers from bad session IDs
        https://bugs.webkit.org/show_bug.cgi?id=199298
        <rdar://problem/51859081>

        Reviewed by Chris Dumez.

        Protect NetworkProcess from receiving bad session IDs in service worker code path by checking for session ID validity whenever interacting with the map.
        One of the check is done in WebProcess in which case, if the session ID is bad, the SW connection to NetworkProcess will not be made.
        For bad session IDs, this will in that case trigger timing out of service worker operations.

        For get/clear data, exit early in case of bad session ID.

        Made some refactoring to remove swOriginStoreForSession method.
        In the one call site where it is used, the store should already be created so we reuse existingSWOriginStoreForSession.

        Added a bunch of additional ASSERTs.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::destroySession):
        (WebKit::NetworkProcess::fetchWebsiteData):
        (WebKit::NetworkProcess::deleteWebsiteData):
        (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
        (WebKit::NetworkProcess::registrableDomainsWithWebsiteData):
        (WebKit::NetworkProcess::actualPrepareToSuspend):
        (WebKit::NetworkProcess::swServerForSession):
        (WebKit::NetworkProcess::existingSWOriginStoreForSession const):
        (WebKit::NetworkProcess::registerSWServerConnection):
        * NetworkProcess/NetworkProcess.h:
        * WebProcess/Network/NetworkProcessConnection.cpp:
        (WebKit::NetworkProcessConnection::initializeSWClientConnection):
        * WebProcess/Storage/WebSWClientConnection.cpp:
        (WebKit::WebSWClientConnection::WebSWClientConnection):
        (WebKit::WebSWClientConnection::initializeConnectionIfNeeded):
        (WebKit::WebSWClientConnection::ensureConnectionAndSend):

2019-06-28  Timothy Hatcher  <timothy@apple.com>

        Rename effectiveAppearanceIsInactive and useInactiveAppearance to better match UIUserInterfaceLevel.
        https://bugs.webkit.org/show_bug.cgi?id=199336
        rdar://problem/52348938

        Reviewed by Tim Horton.

        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _effectiveUserInterfaceLevelIsElevated]):
        (-[WKWebView _effectiveAppearanceIsInactive]): Deleted.
        * UIProcess/API/Cocoa/WKWebViewInternal.h:
        * UIProcess/Cocoa/WebViewImpl.h:
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::effectiveUserInterfaceLevelIsElevated):
        (WebKit::WebViewImpl::effectiveAppearanceIsInactive): Deleted.
        * UIProcess/PageClient.h:
        (WebKit::PageClient::effectiveUserInterfaceLevelIsElevated const):
        (WebKit::PageClient::effectiveAppearanceIsInactive const): Deleted.
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::creationParameters):
        (WebKit::WebPageProxy::useElevatedUserInterfaceLevel const):
        (WebKit::WebPageProxy::effectiveAppearanceDidChange):
        (WebKit::WebPageProxy::useInactiveAppearance const): Deleted.
        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/PageClientImplIOS.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::effectiveUserInterfaceLevelIsElevated const):
        (WebKit::PageClientImpl::effectiveAppearanceIsInactive const): Deleted.
        * UIProcess/mac/PageClientImplMac.h:
        * UIProcess/mac/PageClientImplMac.mm:
        (WebKit::PageClientImpl::effectiveUserInterfaceLevelIsElevated const):
        (WebKit::PageClientImpl::effectiveAppearanceIsInactive const): Deleted.
        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
        (WKBundlePageSetUseDarkAppearance):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_shrinkToFitContentTimer):
        (WebKit::WebPage::effectiveAppearanceDidChange):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2019-06-28  Jer Noble  <jer.noble@apple.com>

        Unreviewed maccatalyst build fix; add ENABLE(FULLSCREEN) checks around calls to fullScreenManager().

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

2019-06-28  Tim Horton  <timothy_horton@apple.com>

        macCatalyst: Selected range sometimes wrong after autocorrection
        https://bugs.webkit.org/show_bug.cgi?id=199299
        <rdar://problem/49717224>

        Reviewed by Wenson Hsieh.

        * UIProcess/Cocoa/TextCheckingController.h:
        * UIProcess/Cocoa/TextCheckingController.mm:
        (WebKit::TextCheckingController::replaceRelativeToSelection):
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView replaceSelectionOffset:length:withAnnotatedString:relativeReplacementRange:]):
        Plumb the whole relative replacement range through to the Web Content process.

        * WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.h:
        * WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.messages.in:
        * WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.mm:
        (WebKit::TextCheckingControllerProxy::replaceRelativeToSelection):
        Only replace the text of the substring that changed (the replacement range),
        and fix up the selection offset math (it was really just wrong before).

2019-06-28  Wenson Hsieh  <wenson_hsieh@apple.com>

        Need a way for SPI clients to know when to avoid resizing to accommodate for the input view bounds
        https://bugs.webkit.org/show_bug.cgi?id=199331
        <rdar://problem/52116170>

        Reviewed by Tim Horton.

        Expose new SPI, such that clients may check whether to avoid resizing the web view when changing input view
        bounds. In particular, resizing the web view in this case causes toolbar menus in Microsoft Word online to
        dismiss immediately after opening them, due to resize events fired as a result of the input view dismissing.

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

        Add a new flag to FocusedElementInformation to indicate whether we should avoid resizing the web view when an
        input view is presented.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _shouldAvoidResizingWhenInputViewBoundsChange]):
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _elementDidBlur]):

        Reset the value of the flag.

        (-[WKContentView _shouldAvoidResizingWhenInputViewBoundsChange]):
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::getFocusedElementInformation):

2019-06-28  Jer Noble  <jer.noble@apple.com>

        Add new -[WKWebView _closeAllMediaPresentations] SPI
        https://bugs.webkit.org/show_bug.cgi?id=199294
        <rdar://problem/51965958>

        Reviewed by Alex Christensen.

        Add a new SPI that will close all out-of-window media presentations, including
        picture-in-picture, video fullscreen, and element fullscreen.

        Drive-by fixes:

        + -[WKApplicationStateTrackingView didMoveToWindow] incorrectly assumes that a WKWebView will
          never be moved frome one window to another, and asserts.

        + -[WKFullScreenWindowController close] doesn't fire the correct 'webkitfullscreenchange' event
          when called in the middle of animating into fullscreen.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _closeAllMediaPresentations]):
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
        * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
        (WebKit::VideoFullscreenManagerProxy::forEachSession):
        * UIProcess/ios/WKApplicationStateTrackingView.mm:
        (-[WKApplicationStateTrackingView didMoveToWindow]):
        * UIProcess/mac/WKFullScreenWindowController.h:
        * UIProcess/mac/WKFullScreenWindowController.mm:
        (-[WKFullScreenWindowController exitFullScreenImmediately]):
        (-[WKFullScreenWindowController close]):

2019-06-28  Antti Koivisto  <antti@apple.com>

        [iOS Scrolling] Propagate scrolls to non-nested UIScrollViews
        https://bugs.webkit.org/show_bug.cgi?id=199222

        Reviewed by Simon Fraser.

        We may generate scrolling hierarchies where the scrolling ancestor of a layer is not
        an ancestor in the layer tree. We  handle this in most situations but there is still
        a problem where a scroller fails to propage scroll to the ancestor when it reaches
        the edge.

        This patch hooks up a new SPI that allows us to tell UIKit about non-ancestor scrolling
        relations and solve this problem.

        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h:
        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
        (WebKit::findActingScrollParent):
        * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
        * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
        (-[WKScrollingNodeScrollViewDelegate _actingParentScrollViewForScrollView:]):

        Hook into UIKit SPI.

        (WebKit::ScrollingTreeScrollingNodeDelegateIOS::findActingScrollParent):

2019-06-28  Konstantin Tokarev  <annulen@yandex.ru>

        Remove traces of ENABLE_ICONDATABASE remaining after its removal in 219733
        https://bugs.webkit.org/show_bug.cgi?id=199317

        Reviewed by Michael Catanzaro.

        While IconDatabase and all code using it was removed,
        ENABLE_ICONDATABASE still exists as build option and C++ macro.

        * Configurations/FeatureDefines.xcconfig:
        * PlatformGTK.cmake: Remove reference to unused urlIcon.png file.

2019-06-28  Wenson Hsieh  <wenson_hsieh@apple.com>

        -[WKContentView _selectionClipRects] returns a bogus value in -reloadInputViews when focusing an element
        https://bugs.webkit.org/show_bug.cgi?id=199310
        <rdar://problem/52292137>

        Reviewed by Megan Gardner.

        When reloading input views under -_elementDidFocus:, -_selectionClipRect returns the value of the previously
        focused element; this is because _selectionClipRect depends on EditorState's post layout data, which is only
        guaranteed to arrive during the next remote layer tree commit after the element is focused.

        However, some clients need to inspect this value under the call to -reloadInputViews when an element is focused;
        to make this work, simply check whether we are currently waiting for post-layout EditorState data to arrive
        following element focus; if so, return the FocusedElementInformation's elementRect, which represents the initial
        state of the focused element. Otherwise, use the EditorState's post layout data, which is guaranteed to be more
        up-to-date than the FocusedElementInformation's element rect.

        Test: KeyboardInputTests.SelectionClipRectsWhenPresentingInputView

        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::waitingForPostLayoutEditorStateUpdateAfterFocusingElement const):
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _selectionClipRect]):

2019-06-28  Carlos Garcia Campos  <cgarcia@igalia.com>

        [SOUP] WebSockets: runtime critical warning when closing the connection in some cases
        https://bugs.webkit.org/show_bug.cgi?id=199265

        Reviewed by Michael Catanzaro.

        Ensure the connection is still open before calling soup_websocket_connection_close().

        * NetworkProcess/soup/WebSocketTaskSoup.cpp:
        (WebKit::WebSocketTask::close):

2019-06-27  Zan Dobersek  <zdobersek@igalia.com>

        Unreviewed WPE build fix.

        * SourcesWPE.txt: Add WebSocketTaskSoup.cpp to the build.

2019-06-27  Dean Jackson  <dino@apple.com>

        Provide overrides for UIKit's suggested actions in UIContextMenuInteraction
        https://bugs.webkit.org/show_bug.cgi?id=199301
        <rdar://problem/52297380>

        Reviewed by Tim Horton.

        We were previously wrapping the actionMenuProvider with our own block
        in order to ensure the correct suggestedActions were passed to the provider.
        UIKit added API for us to override the actions separately.

        Unfortunately we can't quite yet get rid of our access into the
        UIContextMenuConfiguration, because we still need to override the preview
        handler in the case where the user does not want link previews.

        * Platform/spi/ios/UIKitSPI.h:
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView continueContextMenuInteraction:]):
        (-[WKContentView _contextMenuInteraction:overrideSuggestedActionsForConfiguration:]):
        Implement the new delegate SPI to provide our own actions.

2019-06-27  Daniel Bates  <dabates@apple.com>

        [iOS] Select all with existing range selection replaces range instead of selecting all text
        https://bugs.webkit.org/show_bug.cgi?id=197950
        <rdar://problem/50245131>

        Reviewed by Wenson Hsieh.

        Following <rdar://problem/47333786>, UIKit now asks WebKit whether it can handle Command + A as
        "select all" instead of just demanding that we handle it. So, WebKit needs to be able to correctly
        tell UIKit in advance whether it can handle it. Currenlty WebKit tells UIKit it cannot handle a
        "select all" whenever there is an existing range selection. So, UIKit does not tell WebKit to
        perform the "select all". Moreover, since UIKit has no other means to handle this key command
        itself it tells WebKit the key command was not handled. So, WebKit tells the keyboard to insert
        the "a". Instead, WebKit should tell UIKit it can handle a "select all" even when this is an
        existing range selection. However we need to keep the current logic just for when UIKit is
        asking us with respect to populating the callout menu to not regress platform behavior.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView canPerformActionForWebView:withSender:]): Do what we do now if we are called
        when populating the callout menu and action is Select All. Otherwise, return YES for the Select All
        action if we have a non-empty selection.

2019-06-27  Andy Estes  <aestes@apple.com>

        [iOS] Stop using cached UITargetedPreviews from previous interactions when starting a new context menu interaction
        https://bugs.webkit.org/show_bug.cgi?id=199285
        <rdar://problem/52074916>

        Reviewed by Tim Horton.

        WKContentView was caching the UITargetedPreview created in
        -contextMenuInteraction:previewForHighlightingMenuWithConfiguration: for later reuse by
        -contextMenuInteraction:previewForDismissingMenuWithConfiguration:. The cached value was
        then cleared in -contextMenuInteractionDidEnd:.

        This was wrong, because -contextMenuInteractionDidEnd: can be called before
        -contextMenuInteraction:previewForDismissingMenuWithConfiguration:, so we would clear the
        cache then create and cache a new UITargetedPreview during dismissal. Then when a new
        context menu interaction started, we'd reuse the targeted preview created for the previous
        dismissal (which has the wrong geometry).

        Stop assuming an ordering between
        -contextMenuInteraction:previewForDismissingMenuWithConfiguration: and
        -contextMenuInteractionDidEnd:. Instead, always create and cache a new UITargetedPreview in
        -contextMenuInteraction:previewForHighlightingMenuWithConfiguration:, then reuse it and
        clear the cache in -contextMenuInteraction:previewForDismissingMenuWithConfiguration:.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _createTargetedPreviewIfPossible]):
        (-[WKContentView contextMenuInteraction:previewForDismissingMenuWithConfiguration:]):
        (-[WKContentView contextMenuInteractionDidEnd:]):

2019-06-27  Sihui Liu  <sihui_liu@apple.com>

        Regression(r246526): StorageManager thread hangs
        https://bugs.webkit.org/show_bug.cgi?id=199278
        <rdar://problem/52202948>

        Reviewed by Geoffrey Garen.

        r246526 adds a lock m_localStorageNamespacesMutex to protect m_localStorageNamespaces, because 
        m_localStorageNamespaces is destroyed at main thread while accesses to m_localStorageNamespaces happen in the 
        background thread.
        After r246526, getOrCreateLocalStorageNamespace acquires lock m_localStorageNamespacesMutex when 
        m_localStorageNamespacesMutex is already acquired in cloneSessionStorageNamespace, so the StorageManager thread
        hangs.
        To solve this issue, we can remove the lock in getOrCreateLocalStorageNamespace, or we can remove the 
        m_localStorageNamespacesMutex. waitUntilWritesFinished() before ~StorageManager() already guarantees nothing 
        will be running in the background thread, so it is unlikely we the access to m_localStorageNamespaces in the 
        background thread would collide with the destruction of m_localStorageNamespaces. Also, we don't need 
        didDestroyStorageArea as LocalStorageNamespace can hold the last reference of StorageArea after r245881.

        * NetworkProcess/WebStorage/StorageManager.cpp:
        (WebKit::StorageManager::StorageArea::StorageArea):
        (WebKit::StorageManager::StorageArea::~StorageArea):
        (WebKit::StorageManager::LocalStorageNamespace::LocalStorageNamespace):
        (WebKit::StorageManager::cloneSessionStorageNamespace):
        (WebKit::StorageManager::getLocalStorageOrigins):
        (WebKit::StorageManager::deleteLocalStorageEntriesForOrigin):
        (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
        (WebKit::StorageManager::deleteLocalStorageEntriesForOrigins):
        (WebKit::StorageManager::getOrCreateLocalStorageNamespace):
        (WebKit::StorageManager::LocalStorageNamespace::didDestroyStorageArea): Deleted.
        * NetworkProcess/WebStorage/StorageManager.h:

2019-06-27  Carlos Garcia Campos  <cgarcia@igalia.com>

        WebSockets: avoid data copies when queuing tasks in WebSocketChannel
        https://bugs.webkit.org/show_bug.cgi?id=199262

        Reviewed by Alex Christensen.

        For IPC message handler arguments we can receive rvalue references instead of const references.

        * WebProcess/Network/WebSocketChannel.cpp:
        (WebKit::WebSocketChannel::didConnect):
        (WebKit::WebSocketChannel::didReceiveText):
        (WebKit::WebSocketChannel::didReceiveBinaryData):
        (WebKit::WebSocketChannel::didClose):
        (WebKit::WebSocketChannel::didReceiveMessageError):
        * WebProcess/Network/WebSocketChannel.h:

2019-06-27  Youenn Fablet  <youenn@apple.com>

        Fix build after revision 246877
        https://bugs.webkit.org/show_bug.cgi?id=199276

        Unreviewed.

        Pass protocol parameter to NetworkSocketChannel.

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (-[WKNetworkSessionDelegate URLSession:webSocketTask:didOpenWithProtocol:]):
        * NetworkProcess/cocoa/WebSocketTaskCocoa.h:
        * NetworkProcess/cocoa/WebSocketTaskCocoa.mm:
        (WebKit::WebSocketTask::didConnect):

2019-06-27  Beth Dakin  <bdakin@apple.com>

        Upstream use of MACCATALYST
        https://bugs.webkit.org/show_bug.cgi?id=199245
        rdar://problem/51687723

        Reviewed by Tim Horton.

        * Configurations/Base.xcconfig:
        * Configurations/FeatureDefines.xcconfig:
        * Configurations/Network-iOSMac.entitlements: Removed.
        * Configurations/Network-macCatalyst.entitlements: Copied from Source/WebKit/Configurations/Network-iOSMac.entitlements.
        * Configurations/NetworkService.xcconfig:
        * Configurations/SDKVariant.xcconfig:
        * Configurations/WebContent-iOSMac.entitlements: Removed.
        * Configurations/WebContent-macCatalyst.entitlements: Copied from Source/WebKit/Configurations/WebContent-iOSMac.entitlements.
        * Configurations/WebContentService.xcconfig:
        * Configurations/WebKit.xcconfig:
        * NetworkProcess/ios/NetworkProcessIOS.mm:
        * NetworkProcess/mac/NetworkProcessMac.mm:
        (WebKit::NetworkProcess::initializeProcess):
        (WebKit::NetworkProcess::initializeProcessName):
        * Platform/mac/LayerHostingContext.mm:
        (WebKit::LayerHostingContext::createForExternalHostingProcess):
        * Platform/spi/ios/ManagedConfigurationSPI.h:
        * Platform/spi/ios/UIKitSPI.h:
        * Shared/WebPreferencesDefaultValues.cpp:
        (WebKit::defaultCustomPasteboardDataEnabled):
        * Shared/ios/AuxiliaryProcessIOS.mm:
        (WebKit::AuxiliaryProcess::initializeSandbox):
        * Shared/ios/InteractionInformationAtPosition.h:
        * Shared/ios/InteractionInformationAtPosition.mm:
        (WebKit::InteractionInformationAtPosition::encode const):
        (WebKit::InteractionInformationAtPosition::decode):
        * Shared/mac/AuxiliaryProcessMac.mm:
        (WebKit::enableSandboxStyleFileQuarantine):
        * Shared/mac/CodeSigning.mm:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _webViewPrintFormatter]):
        * UIProcess/API/Cocoa/WKWebViewInternal.h:
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
        (WebKit::RemoteLayerTreeHost::updateLayerTree):
        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
        (-[WKRemoteView initWithFrame:contextID:]):
        * UIProcess/_WKWebViewPrintFormatter.mm:
        * UIProcess/_WKWebViewPrintFormatterInternal.h:
        * UIProcess/ios/WKActionSheetAssistant.mm:
        (-[WKActionSheetAssistant _elementActionForDDAction:]):
        * UIProcess/ios/WKContentView.mm:
        (-[WKContentView _commonInitializationWithProcessPool:configuration:]):
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView setupInteraction]):
        (-[WKContentView cleanupInteraction]):
        (-[WKContentView _removeDefaultGestureRecognizers]):
        (-[WKContentView _addDefaultGestureRecognizers]):
        (-[WKContentView _showTapHighlight]):
        (-[WKContentView gestureRecognizer:canBePreventedByGestureRecognizer:]):
        (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
        (-[WKContentView canPerformActionForWebView:withSender:]):
        (-[WKContentView _defineForWebView:]):
        (-[WKContentView setSelectedTextRange:]):
        (-[WKContentView closestPositionToPoint:]):
        (-[WKContentView _showShareSheet:inRect:completionHandler:]):
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::desktopClassBrowsingSupported):
        (WebKit::desktopClassBrowsingRecommended):
        * UIProcess/ios/forms/WKFileUploadPanel.mm:
        (-[WKFileUploadPanel _showDocumentPickerMenu]):
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.mm:
        * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
        (WebKit::WebPage::dictionaryPopupInfoForRange):
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::platformEditorState const):
        (WebKit::WebPage::selectWithGesture):
        (WebKit::selectionPositionInformation):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::initializeSandbox):
        * WebProcess/com.apple.WebProcess.sb.in:

2019-06-27  Saam Barati  <sbarati@apple.com>

        Make WEBGPU enabled only on Mojave and later.

        Rubber-stamped by Myles C. Maxfield.

        * Configurations/FeatureDefines.xcconfig:

2019-06-27  Adrian Perez de Castro  <aperez@igalia.com>

        [GTK][WPE] Fix build non-unified builds after r246856
        https://bugs.webkit.org/show_bug.cgi?id=199263

        Reviewed by Michael Catanzaro.

        * UIProcess/API/C/WKMessageListener.cpp: Added missing inclusion of WKAPICast.h and usage of WebKit namespace.

2019-06-27  Carlos Garcia Campos  <cgarcia@igalia.com>

        [SOUP] WebSockets: handle TLS certificate and errors
        https://bugs.webkit.org/show_bug.cgi?id=199223

        Reviewed by Michael Catanzaro.

        Connect to accept-certificate signal on the WebSocket message connection to decide what to do in case of TLS errors.

        * NetworkProcess/soup/NetworkSessionSoup.cpp:
        (WebKit::webSocketAcceptCertificateCallback):
        (WebKit::webSocketMessageNetworkEventCallback):
        (WebKit::NetworkSessionSoup::createWebSocketTask):

2019-06-27  Carlos Garcia Campos  <cgarcia@igalia.com>

        [SOUP] Use libsoup WebSockets API
        https://bugs.webkit.org/show_bug.cgi?id=199151

        Reviewed by Michael Catanzaro.

        Use the new WebSockets code path that depends on platform specific WebSockets implementation using the libsoup
        API. This is an initial implementation manually tested using the layout tests, which most of them fail due to
        missing console messages, missing features in the new code path or differences in the platform
        implementation. It will be disabled by default until it's feature complete compared to the internal WebKit
        implementation.

        * NetworkProcess/NetworkSocketChannel.cpp:
        (WebKit::NetworkSocketChannel::NetworkSocketChannel): Null check m_socket before using it, because
        createWebSocketTask() can return nullptr;
        (WebKit::NetworkSocketChannel::didConnect): Receive the protocol accepted by the server.
        (WebKit::NetworkSocketChannel::didReceiveMessageError): Something failed in the server side.
        * NetworkProcess/NetworkSocketChannel.h:
        * NetworkProcess/WebSocketTask.h:
        * NetworkProcess/soup/NetworkSessionSoup.cpp:
        (WebKit::NetworkSessionSoup::createWebSocketTask): Create a WebSocketTask.
        * NetworkProcess/soup/NetworkSessionSoup.h:
        * NetworkProcess/soup/WebSocketTaskSoup.cpp: Added.
        (WebKit::WebSocketTask::WebSocketTask):
        (WebKit::WebSocketTask::~WebSocketTask):
        (WebKit::WebSocketTask::didConnect):
        (WebKit::WebSocketTask::didReceiveMessageCallback):
        (WebKit::WebSocketTask::didReceiveErrorCallback):
        (WebKit::WebSocketTask::didFail):
        (WebKit::WebSocketTask::didCloseCallback):
        (WebKit::WebSocketTask::didClose):
        (WebKit::WebSocketTask::sendString):
        (WebKit::WebSocketTask::sendData):
        (WebKit::WebSocketTask::close):
        (WebKit::WebSocketTask::cancel):
        (WebKit::WebSocketTask::resume):
        * NetworkProcess/soup/WebSocketTaskSoup.h: Copied from Source/WebKit/NetworkProcess/WebSocketTask.h.
        * SourcesGTK.txt:
        * WebProcess/Network/WebSocketChannel.cpp:
        (WebKit::WebSocketChannel::subprotocol): Return the protocol accepted by the server.
        (WebKit::WebSocketChannel::didConnect): Set the protocol accepted by the server.
        (WebKit::WebSocketChannel::didReceiveMessageError): It's now an IPC message handler and receives the reason as parameter.
        (WebKit::WebSocketChannel::networkProcessCrashed): Pass empty reason.
        * WebProcess/Network/WebSocketChannel.h:
        * WebProcess/Network/WebSocketChannel.messages.in:

2019-06-21  Konstantin Tokarev  <annulen@yandex.ru>

        [cmake] Switch to built-in handling of C++ standard instead of hardcoding -std=c++17
        https://bugs.webkit.org/show_bug.cgi?id=199108

        Reviewed by Don Olmstead.

        Rationale:

        1. It provides an abstraction over exact flags of particular compilers -
           we just specify required version of C++ standard
        2. External libraries (like Qt used in WPEQt) may require particular C++
           standard or even particular C++ features to be availabe (e.g. Qt
           requires INTERFACE_COMPILE_FEATURES cxx_decltype, which causes cmake
           to add -std=gnu++11 unless proper CXX_STANDARD is defined)

        * PlatformWPE.cmake: Use project-level default for CXX_STANDARD
        property.

2019-06-26  Jiewen Tan  <jiewen_tan@apple.com>

        SubFrameSOAuthorizationSession should preserve the referrer header when fall back to web path
        https://bugs.webkit.org/show_bug.cgi?id=199232
        <rdar://problem/51718328>

        Reviewed by Youenn Fablet.

        The fall back to web path mechanism in SubFrameSOAuthorizationSession doesn't actually resume
        the previous navigation. Instead it starts a new one. The current implementation doesn't carry
        any information from the previous navigation. It is problematic when it comes to http referrer
        as the server might use that to determine what kind of responses to send back. Therefore, we
        add that information now.

        To accomplish the above, the patch teaches WebFrameProxy::loadURL to carry referrer information
        when it is available. Then SubFrameSOAuthorizationSession can reuses the referrer from the
        original request.

        * UIProcess/Cocoa/SOAuthorization/SubFrameSOAuthorizationSession.mm:
        (WebKit::SubFrameSOAuthorizationSession::fallBackToWebPathInternal):
        * UIProcess/WebFrameProxy.cpp:
        (WebKit::WebFrameProxy::loadURL):
        * UIProcess/WebFrameProxy.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::loadURLInFrame):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2019-06-26  Fujii Hironori  <Hironori.Fujii@sony.com>

        testRunner.setAlwaysAcceptCookies should wait for cookie accept policy to be set
        https://bugs.webkit.org/show_bug.cgi?id=199230
        <rdar://problem/52217933>

        Unreviewed build fix for WinCairo WK2 since r246856.

        * PlatformWin.cmake: Added WKMessageListener.h to WebKit_PUBLIC_FRAMEWORK_HEADERS.

2019-06-26  Dean Jackson  <dino@apple.com>

        Add type to UIImage symbol mapping for _WKElementAction
        https://bugs.webkit.org/show_bug.cgi?id=199255

        Reviewed by Sam Weinig.

        Moving some code in from WebKitAdditions now
        that the API is public.

        * UIProcess/API/Cocoa/_WKElementAction.mm:
        (+[_WKElementAction imageForElementActionType:]):
        (elementActionTypeToUIActionIdentifier):
        (uiActionIdentifierToElementActionType):

2019-06-26  Dean Jackson  <dino@apple.com>

        Expose UIAction identifiers for _WKElementActions
        https://bugs.webkit.org/show_bug.cgi?id=199246
        <rdar://problem/52218950>

        Reviewed by Tim Horton.

        In order for clients to create a contextual menu, they are given
        a set of suggested UIActions, created from _WKElementActions.
        By associating identifiers (strings) with the UIActions, clients
        can inspect the suggestions and make a decision on whether or
        not to include them in the final menu.

        * UIProcess/API/Cocoa/_WKElementAction.h: Typedef UIActionIdentifier,
        add a method to create a UIAction from an _WKElementAction, and a
        helper to map between identifiers and types.

        * UIProcess/API/Cocoa/_WKElementAction.mm:
        (elementActionTypeToUIActionIdentifier): Helper to convert between the two types.
        (uiActionIdentifierToElementActionType): The inverse of above.
        (+[_WKElementAction elementActionTypeForUIActionIdentifier:]): A client given
        a UIAction object can use this helper method to see what _WKElementActionType it
        corresponds to.
        (-[_WKElementAction uiActionForElementInfo:]): Used by WKContentViewInteraction to
        create a UIAction from this _WKElementAction.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (uiActionForLegacyPreviewAction): Renamed to make it clear this is a legacy approach.
        (menuFromLegacyPreviewOrDefaultActions): Split these functions to separate the legacy
        and non-legacy approach.
        (-[WKContentView assignLegacyDataForContextMenuInteraction]):
        (-[WKContentView continueContextMenuInteraction:]):
        (uiActionForPreviewAction): Deleted.
        (menuFromPreviewOrDefaults): Deleted.

2019-06-26  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iPadOS] Fix another crash in -[UIPreviewTarget initWithContainer:center:transform:] when generating a fallback targeted preview
        https://bugs.webkit.org/show_bug.cgi?id=199243
        <rdar://problem/51554509>

        Reviewed by Tim Horton.

        Additionally make createFallbackTargetedPreview robust in the case where the content view is unparented, and
        rename _ensureTargetedPreview to _createTargetedPreviewIfPossible, to reflect the fact that it may now return
        nil.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (createTargetedPreview):
        (createFallbackTargetedPreview):
        (-[WKContentView _createTargetedPreviewIfPossible]):
        (-[WKContentView contextMenuInteraction:previewForHighlightingMenuWithConfiguration:]):
        (-[WKContentView contextMenuInteraction:previewForDismissingMenuWithConfiguration:]):
        (-[WKContentView _ensureTargetedPreview]): Deleted.

2019-06-26  Alex Christensen  <achristensen@webkit.org>

        testRunner.setAlwaysAcceptCookies should wait for cookie accept policy to be set
        https://bugs.webkit.org/show_bug.cgi?id=199230
        <rdar://51757107>

        Reviewed by Andy Estes.

        This patch adds an optional callback to WKCookieManagerSetHTTPCookieAcceptPolicy which is luckily only used for testing.
        It also adds listener-based asynchronous versions of didReceiveSynchronousMessageFromInjectedBundle.
        WebKitTestRunner uses these new abilities to wait for the cookie accept policy to be set in the network process while the web process is hung.
        This removes the race condition that was causing some flakiness in tests that use testRunner.setAlwaysAcceptCookies

        * Shared/API/APIObject.h:
        * Shared/API/c/WKBase.h:
        * Sources.txt:
        * UIProcess/API/APIInjectedBundleClient.h:
        (API::InjectedBundleClient::didReceiveSynchronousMessageFromInjectedBundle):
        * UIProcess/API/APIMessageListener.h: Copied from Source/WebKit/UIProcess/API/APIInjectedBundleClient.h.
        (API::MessageListener::create):
        (API::MessageListener::sendReply):
        (API::MessageListener::MessageListener):
        * UIProcess/API/C/WKAPICast.h:
        * UIProcess/API/C/WKContextInjectedBundleClient.h:
        * UIProcess/API/C/WKCookieManager.cpp:
        (WKCookieManagerSetHTTPCookieAcceptPolicy):
        * UIProcess/API/C/WKCookieManager.h:
        * UIProcess/API/C/WKMessageListener.cpp: Copied from Source/WebKit/UIProcess/API/APIInjectedBundleClient.h.
        (WKMessageListenerGetTypeID):
        (WKMessageListenerSendReply):
        * UIProcess/API/C/WKMessageListener.h: Copied from Source/WebKit/UIProcess/API/APIInjectedBundleClient.h.
        * UIProcess/API/C/WKPageInjectedBundleClient.h:
        * UIProcess/WebContextInjectedBundleClient.cpp:
        (WebKit::WebContextInjectedBundleClient::didReceiveSynchronousMessageFromInjectedBundle):
        * UIProcess/WebContextInjectedBundleClient.h:
        * UIProcess/WebPageInjectedBundleClient.cpp:
        (WebKit::WebPageInjectedBundleClient::didReceiveSynchronousMessageFromInjectedBundle):
        * UIProcess/WebPageInjectedBundleClient.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::handleSynchronousMessage):
        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::injectedBundleClient): Deleted.
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::handleSynchronousMessage):
        * WebKit.xcodeproj/project.pbxproj:

2019-06-26  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iPadOS] eddm.usps.com scrolls horizontally due to explicit width set in viewport meta tag
        https://bugs.webkit.org/show_bug.cgi?id=199219
        <rdar://problem/50425765>

        Reviewed by Tim Horton.

        Currently, the heuristic to determine whether the page should be shrunk to fit the content width after loading
        works by checking whether the page's content is wider than the layout width we've provided for the page.
        However, in the case where an explicit width larger than the true view width is specified by the page's meta
        viewport, we'll end up believing that the page's content is not wider than the layout width, which is dictated
        by the fixed meta viewport width. Instead, we can shrink the page down in this scenario by comparing the content
        width against the scaled size of the view when computing the amount of horizontal overflow.

        Test: fast/viewport/ios/shrink-to-fit-content-large-constant-width.html

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

2019-06-26  Zalan Bujtas  <zalan@apple.com>

        [ContentChangeObserver] Dispatch synthetic mouse event asynchronously in completePendingSyntheticClickForContentChangeObserver
        https://bugs.webkit.org/show_bug.cgi?id=199220
        <rdar://problem/51787961>

        Reviewed by Simon Fraser.

        WebPage::completePendingSyntheticClickForContentChangeObserver should not dispatch mouse events synchronously.
        Mouse events, through style updates could destroy the element that initiated this change.
        WebPage::handleSyntheticClick() already implements this pattern.

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

2019-06-25  Jiewen Tan  <jiewen_tan@apple.com>

        Implement a new SPI to inform clients about AppSSO
        https://bugs.webkit.org/show_bug.cgi?id=199085
        <rdar://problem/50028246>

        Reviewed by Geoffrey Garen.

        This patch implements a new SPI to inform clients about incoming AppSSO interceptions during
        navigations. Therefore, clients can make an informed decision about whether this is the right
        moment to do the interception as interceptions often show native UI. Also, the SPI is designed
        to pass along a human readable name for the extension such that clients can do whatever they
        want to inform users about what's going on.

        Here is the new SPI:
        - (void)_webView:(WKWebView *)webView decidePolicyForSOAuthorizationLoadWithCurrentPolicy:(_WKSOAuthorizationLoadPolicy)policy forExtension:(NSString *)extension completionHandler:(void (^)(_WKSOAuthorizationLoadPolicy policy))completionHandler;

        * UIProcess/API/APINavigationClient.h:
        (API::NavigationClient::decidePolicyForSOAuthorizationLoad):
        * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
        * UIProcess/Cocoa/NavigationState.h:
        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::setNavigationDelegate):
        (WebKit::soAuthorizationLoadPolicy):
        (WebKit::wkSOAuthorizationLoadPolicy):
        (WebKit::NavigationState::NavigationClient::decidePolicyForSOAuthorizationLoad):
        * UIProcess/Cocoa/SOAuthorization/SOAuthorizationLoadPolicy.h: Added.
        * UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm:
        (WebKit::SOAuthorizationSession::start):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::decidePolicyForSOAuthorizationLoad):
        * UIProcess/WebPageProxy.h:
        * WebKit.xcodeproj/project.pbxproj:

2019-06-25  Simon Fraser  <simon.fraser@apple.com>

        [iOS WK2 Debug] scrollingcoordinator/scrolling-tree/scroller-with-negative-z-child.html asserts
        https://bugs.webkit.org/show_bug.cgi?id=199218

        Reviewed by Zalan Bujtas.

        Followup to r246766; don't assert in the UI process if a ScrollingTreeOverflowScrollProxyNode
        doesn't have a related overflow node; this is currently expected behavior with negative z-order
        children of a scroller.

        * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
        (WebKit::RemoteScrollingCoordinatorProxy::establishLayerTreeScrollingRelations):

2019-06-25  Daniel Bates  <dabates@apple.com>

        Non-editable text selections should be modifiable with hardware keyboard
        https://bugs.webkit.org/show_bug.cgi?id=199204
        <rdar://problem/51651496>

        Reviewed by Wenson Hsieh.

        UIKit changes are need for this to work, including <rdar://problem/48322899>.
        Note that without these changes, -canPerformAction is never called for _move*
        selectors.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView canPerformAction:withSender:]):

2019-06-25  Daniel Bates  <dabates@apple.com>

        [iOS] Should not process key events in non-editable elements using IME
        https://bugs.webkit.org/show_bug.cgi?id=199122
        <rdar://problem/52006654>

        Reviewed by Brent Fulgham.

        Use the non-Input Method code path (the one we use for US keyboard input) for all key events
        targeting a non-editable element. Such key events will never require Input Method support
        (i.e. show candidate suggestions). Moreover, this behavior matches the behavior on Mac.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView handleKeyWebEvent:withCompletionHandler:]):

2019-06-25  Alex Christensen  <achristensen@webkit.org>

        Make HTTPCookieAcceptPolicy an enum class
        https://bugs.webkit.org/show_bug.cgi?id=199081

        Reviewed by Michael Catanzaro.

        Doing so reveals some interesting bugs in the C API that are also fixed:
        WKPreferencesGetIncrementalRenderingSuppressionTimeout was using its toAPI function to convert a double to a double because HTTPCookieAcceptPolicy used to be an unsigned integer.
        toAPI(WebCore::MouseButton) was also using the toAPI(HTTPCookieAcceptPolicy) because HTTPCookieAcceptPolicy used to be an unsigned integer.
        Yikes!  Type safety is our friend.

        * NetworkProcess/Cookies/WebCookieManager.messages.in:
        * NetworkProcess/Cookies/mac/WebCookieManagerMac.mm:
        (WebKit::toCFHTTPCookieStorageAcceptPolicy):
        (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
        (WebKit::WebCookieManager::platformGetHTTPCookieAcceptPolicy):
        * Shared/API/c/WKSharedAPICast.h:
        (WebKit::toAPI):
        * Shared/HTTPCookieAcceptPolicy.h:
        (): Deleted.
        * UIProcess/API/C/WKAPICast.h:
        (WebKit::toHTTPCookieAcceptPolicy):
        (WebKit::toAPI):
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesGetIncrementalRenderingSuppressionTimeout):
        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (toHTTPCookieAcceptPolicy):
        * UIProcess/WebCookieManagerProxy.cpp:
        (WebKit::WebCookieManagerProxy::didGetHTTPCookieAcceptPolicy):
        * UIProcess/WebCookieManagerProxy.h:
        * UIProcess/WebCookieManagerProxy.messages.in:

2019-06-25  Tim Horton  <timothy_horton@apple.com>

        Wrong title for Data Detectors tap action menu
        https://bugs.webkit.org/show_bug.cgi?id=199198
        <rdar://problem/51957842>

        Reviewed by Wenson Hsieh.

        * UIProcess/ios/WKActionSheetAssistant.mm:
        (-[WKActionSheetAssistant showDataDetectorsSheet]):
        Always pass the results array through to DataDetectors; they need it
        to figure out the title too!

2019-06-25  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] Occasional crash under -[UIPreviewTarget initWithContainer:center:transform:] when generating a drag preview
        https://bugs.webkit.org/show_bug.cgi?id=199192
        <rdar://problem/51554509>

        Reviewed by Tim Horton.

        Tweak our preview generation code (for both the context menu and dragging) to be robust in the case where the
        content view's unscaled view is nil; this may happen in the case after the web content process is terminated
        and -cleanupInteraction is called, but before -setupInteraction is subsequently called.

        Additionally, make our logic for creating targeted previews robust in the case where the view is removed from
        the view hierarchy right before the platform asks for a targeted preview.

        Test:   DragAndDropTests.WebProcessTerminationDuringDrag
                DragAndDropTests.WebViewRemovedFromViewHierarchyDuringDrag

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView containerViewForTargetedPreviews]):
        (-[WKContentView _deliverDelayedDropPreviewIfPossible:]):
        (-[WKContentView dragInteraction:previewForLiftingItem:session:]):
        (-[WKContentView _ensureTargetedPreview]):

2019-06-25  Youenn Fablet  <youenn@apple.com>

        Close sockets with too high file descriptor
        https://bugs.webkit.org/show_bug.cgi?id=199116

        Reviewed by Eric Carlson.

        Log the case of failing to open a socket.

        * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
        (WebKit::NetworkRTCProvider::createSocket):

2019-06-25  Tim Horton  <timothy_horton@apple.com>

        When Caps Lock is enabled on the Smart Keyboard, can't scroll with space or arrow keys
        https://bugs.webkit.org/show_bug.cgi?id=199187
        <rdar://problem/51521709>

        Reviewed by Anders Carlsson.

        * UIProcess/ios/WKKeyboardScrollingAnimator.mm:
        (-[WKKeyboardScrollingAnimator keyboardScrollForEvent:]):
        When deciding whether a key event should start a scroll, ignore all
        modifiers other than the ones we actually care about (including Caps Lock).

2019-06-25  Michael Catanzaro  <mcatanzaro@igalia.com>

        Fully rename WebKitGTK+ -> WebKitGTK everywhere
        https://bugs.webkit.org/show_bug.cgi?id=199159

        Reviewed by Carlos Garcia Campos.

        * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:

2019-06-24  Brady Eidson  <beidson@apple.com>

        Null deref in WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad.
        <rdar://problem/51535942> and https://bugs.webkit.org/show_bug.cgi?id=199123

        Reviewed by Andy Estes.

        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad): Properly detect this null DocumentLoader
          and try to learn more about the state of things.

2019-06-24  Chris Dumez  <cdumez@apple.com>

        Pages using Google's anti-flicker optimization may take ~5 seconds to do initial paint
        https://bugs.webkit.org/show_bug.cgi?id=199173
        <rdar://problem/45968770>

        Reviewed by Geoffrey Garen.

        Add experimental feature for the quirk.

        * Shared/WebPreferences.yaml:

2019-06-24  John Wilander  <wilander@apple.com>

        Remove IsITPFirstPartyWebsiteDataRemovalEnabled as runtime check
        https://bugs.webkit.org/show_bug.cgi?id=199164
        <rdar://problem/52061147>

        Reviewed by Brent Fulgham.

        We've had this toggle as a safety thing since mid-March. No need for it any longer.

        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
        (WebKit::ResourceLoadStatisticsMemoryStore::shouldRemoveAllButCookiesFor const):
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::initializeNetworkProcess):
        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
        (WebKit::NetworkProcessCreationParameters::decode):
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * Shared/WebPreferences.yaml:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeNetworkProcess):

2019-06-24  Daniel Bates  <dabates@apple.com>

        m_focusedElement != &element in WebPage::elementDidBlur() sometimes
        https://bugs.webkit.org/show_bug.cgi?id=198928
        <rdar://problem/51814327>

        Reviewed by Brent Fulgham.

        This can happen when the focused editable element is inside a nested frame and a person
        taps outside that frame. For reasons that seem lost to time, WebKit2 on iOS would mutate
        the focused frame whenever computing selection positioning information (say, for a tap).
        This "quirk" was added in r163476, but that code has go through multiple iterations and
        is no longer comparable to the current code. Yet, the original mutation of the focused
        frame remained. As a result the UI process and Web process go out of sync with respect
        to what each thinks is the focused element and this visually manifest itself in at least
        two ways:

            1. A non-sensical DOM focus event would be dispatched at the frame tapped, but
            we would keep the focused element focused.

            2. Because we would keep the focused element focused in (1), even though its frame
            is not focused, the keyboard would be active (software keyboard on screen or candidate bar
            on screen if a hardware keyboard is attached), but appear unresponsive: any keys pressed
            would not cause text to be typed into the editable field.

        Because of (1) it was possible for m_focusedElement != &element in WebPage::elementDidBlur().
        When this happens the UI process would never receive an ElementDidBlur message and hence would
        not clear out the focused element state and hide the keyboard.

        We neither do this frame focus mutation in Legacy WebKit on iOS nor Mac. Let's remove this quirk.
        If it turns out that it causes a compatibility issue then we will be in a better position to
        understand its purpose and consider bringing this quirk back, if needed.

        * Shared/ios/InteractionInformationRequest.cpp:
        (WebKit::InteractionInformationRequest::encode const):
        (WebKit::InteractionInformationRequest::decode):
        (WebKit::InteractionInformationRequest::isValidForRequest):
        (WebKit::InteractionInformationRequest::isApproximatelyValidForRequest):
        * Shared/ios/InteractionInformationRequest.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _requestActivatedElementAtPosition:completionBlock:]):
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _webTouchEventsRecognized:]):
        Remove the readOnly field.

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::selectionPositionInformation): Remove code to mutate the focused frame.

2019-06-24  Per Arne Vollan  <pvollan@apple.com>

        [Cocoa] Avoid creating a PlatformMediaSessionManager when the WebProcess is suspended or resumed
        https://bugs.webkit.org/show_bug.cgi?id=199160

        Reviewed by Brent Fulgham.

        When the WebProcess suspends or resumes, the PlatformMediaSessionManager is notified about this.
        Avoid creating a new PlatformMediaSessionManager if it does not already exist.

        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::actualPrepareToSuspend):
        (WebKit::WebProcess::cancelPrepareToSuspend):
        (WebKit::WebProcess::processDidResume):

2019-06-24  Adrian Perez de Castro  <aperez@igalia.com>

        [WPE][GTK] Fixes for compilation with unified builds disabled
        https://bugs.webkit.org/show_bug.cgi?id=199155

        Reviewed by Michael Catanzaro.

        * NetworkProcess/glib/DNSCache.cpp: Add missing inclusion of wtf/glib/RunLoopSourcePriority.h
        * NetworkProcess/glib/DNSCache.h: Add missing forward declaration for GInetAddress

2019-06-24  Alexander Mikhaylenko  <exalm7659@gmail.com>

        [GTK] Navigation gesture should use dark fallback bg color on dark themes
        https://bugs.webkit.org/show_bug.cgi?id=199104

        Reviewed by Michael Catanzaro.

        Use theme_base_color instead of white background for swipe gesture fallback if no snapshot is found and
        the page did not specify a color. This allows it to use dark colors for dark themes. If the color was
        not found, still fall back to white.

        * UIProcess/gtk/ViewGestureControllerGtk.cpp:
        (WebKit::ViewGestureController::beginSwipeGesture):

2019-06-23  Dan Bernstein  <mitz@apple.com>

        Platform font class gets needlessly initialized in the Networking process
        https://bugs.webkit.org/show_bug.cgi?id=199140

        Reviewed by Tim Horton.

        * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: Revert a change that was made in
          r246702, which is not needed anymore.
        * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: Ditto.

        * Shared/Cocoa/ArgumentCodersCocoa.mm:
        (IPC::platformColorClass): Added getter that uses NSClassFromString, thereby avoiding
          initializing the class.
        (IPC::platformFontClass): Ditto.
        (IPC::typeFromObject): Changed to use the above getters instead of +class.

2019-06-23  Simon Fraser  <simon.fraser@apple.com>

        [Async overflow scroll] Clipped composited layers inside overflow scroll jitter and get incorrectly clipped
        https://bugs.webkit.org/show_bug.cgi?id=199133
        rdar://problem/43614439

        Reviewed by Antti Koivisto.
        
        LayoutConstraints -> AbsolutePositionConstraints rename.

        * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
        (ArgumentCoder<ScrollingStatePositionedNode>::decode):
        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<AbsolutePositionConstraints>::encode):
        (IPC::ArgumentCoder<AbsolutePositionConstraints>::decode):
        (IPC::ArgumentCoder<LayoutConstraints>::encode): Deleted.
        (IPC::ArgumentCoder<LayoutConstraints>::decode): Deleted.
        * Shared/WebCoreArgumentCoders.h:
        * Shared/WebRenderLayer.cpp:
        (WebKit::WebRenderLayer::WebRenderLayer):
        * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
        (WebKit::RemoteScrollingCoordinatorProxy::establishLayerTreeScrollingRelations): ScrollingTreeOverflowScrollProxyNode
        have overflow scroll relations now too.

2019-06-23  Simon Fraser  <simon.fraser@apple.com>

        Add OverflowScrollProxyNodes to the scrolling tree
        https://bugs.webkit.org/show_bug.cgi?id=199132

        Reviewed by Antti Koivisto.

        Add ScrollingStateOverflowScrollProxyNode and ScrollingTreeOverflowScrollProxyNode. These
        nodes represent clip and scroll position for an overflow:scroll in the containing block chain,
        but not the paint ancestor chain of a layer. They will be used to correctly manipulate clip
        rects for composited layers in non-stacking-context scrollers, and in a future patch will
        replace the functionality of "Moves" positioned nodes.

        An OverflowScrollProxyNode has the ScrollingNodeID of the scrolling node that it relates to,
        and we use the existing "related overflow nodes" to create the back references in the scrolling tree.

        These nodes are not instantiated yet; a future patch will hook them up.

        * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
        (ArgumentCoder<ScrollingStateOverflowScrollProxyNode>::encode):
        (ArgumentCoder<ScrollingStateOverflowScrollProxyNode>::decode):
        (WebKit::encodeNodeAndDescendants):
        (WebKit::RemoteScrollingCoordinatorTransaction::decode):
        (WebKit::dump):
        * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
        (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
        * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
        (WebKit::RemoteScrollingTree::createScrollingTreeNode):
        * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
        (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
        * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
        (WebKit::ScrollingTreeScrollingNodeDelegateIOS::repositionScrollingLayers):

2019-06-21  Jiewen Tan  <jiewen_tan@apple.com>

        Unreviewed, a build fix after r246701

        * Shared/LoadParameters.h:
        Add a default value for shouldOpenExternalURLsPolicy.

2019-06-21  Brent Fulgham  <bfulgham@apple.com>

        Adjust sandboxes based on seed feedback
        https://bugs.webkit.org/show_bug.cgi?id=199119
        <rdar://problem/50164879>

        Reviewed by Geoffrey Garen.

        Update our sandboxes to address test failures and bugs encountered during initial iOS 13 and
        macOS Catalina testing.

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

2019-06-21  Jiewen Tan  <jiewen_tan@apple.com>

        WebPageProxy::loadData should accept ShouldOpenExternalURLsPolicy
        https://bugs.webkit.org/show_bug.cgi?id=199114
        <rdar://problem/51671674>

        Reviewed by Youenn Fablet.

        This patch teaches WebPageProxy::loadData to accept ShouldOpenExternalURLsPolicy policy,
        and then utilize it in RedirectSOAuthorizationSession. Therefore, the response loaded after
        successful interceptions will be able to propagate the same policy from the last navigation
        as it were continuous loading.

        Besides the above, this patch also fixes some minor issues.

        * Shared/LoadParameters.h:
        * UIProcess/Cocoa/SOAuthorization/NavigationSOAuthorizationSession.mm:
        (WebKit::NavigationSOAuthorizationSession::shouldStartInternal):
        (WebKit::NavigationSOAuthorizationSession::webViewDidMoveToWindow):
        * UIProcess/Cocoa/SOAuthorization/PopUpSOAuthorizationSession.h:
        * UIProcess/Cocoa/SOAuthorization/PopUpSOAuthorizationSession.mm:
        (WebKit::PopUpSOAuthorizationSession::completeInternal):
        * UIProcess/Cocoa/SOAuthorization/RedirectSOAuthorizationSession.h:
        * UIProcess/Cocoa/SOAuthorization/RedirectSOAuthorizationSession.mm:
        (WebKit::shouldOpenExternalURLsPolicy):
        (WebKit::RedirectSOAuthorizationSession::completeInternal):
        * UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.h:
        * UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm:
        (WebKit::SOAuthorizationSession::complete):
        * UIProcess/Cocoa/SOAuthorization/SubFrameSOAuthorizationSession.h:
        * UIProcess/Cocoa/SOAuthorization/SubFrameSOAuthorizationSession.mm:
        (WebKit::SubFrameSOAuthorizationSession::fallBackToWebPathInternal):
        (WebKit::SubFrameSOAuthorizationSession::completeInternal):
        (WebKit::SubFrameSOAuthorizationSession::loadDataToFrame):
        (WebKit::SubFrameSOAuthorizationSession::postDidCancelMessageToParent):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::loadRequestWithNavigationShared):
        (WebKit::WebPageProxy::loadFile):
        (WebKit::WebPageProxy::loadData):
        (WebKit::WebPageProxy::loadDataWithNavigationShared):
        * UIProcess/WebPageProxy.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::loadDataImpl):
        (WebKit::WebPage::loadData):
        * WebProcess/WebPage/WebPage.h:

2019-06-21  Tim Horton  <timothy_horton@apple.com>

        WebKit context menu highlights include extra padding
        https://bugs.webkit.org/show_bug.cgi?id=199080
        <rdar://problem/51140126>

        Reviewed by Dean Jackson.

        * Shared/ios/InteractionInformationRequest.cpp:
        (WebKit::InteractionInformationRequest::encode const):
        (WebKit::InteractionInformationRequest::decode):
        (WebKit::InteractionInformationRequest::isValidForRequest):
        (WebKit::InteractionInformationRequest::isApproximatelyValidForRequest):
        * Shared/ios/InteractionInformationRequest.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView gestureRecognizerShouldBegin:]):
        (-[WKContentView positionInformationForActionSheetAssistant:]):
        (-[WKContentView updatePositionInformationForActionSheetAssistant:]):
        (-[WKContentView _contextMenuInteraction:configurationForMenuAtLocation:completion:]):
        (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::linkIndicatorPositionInformation):
        Disable the margin going forward, but leave it if we're using the legacy
        API, because there is no way to add margin at the platform level with
        the legacy API.

        In the future we should always have no margin in our indicator, and just
        apply it in whatever consumes the indicator, so that there is no
        disagreement between clients about the size of the margin.

2019-06-21  Youenn Fablet  <youenn@apple.com>

        WebPageProxy should use the right path for sandbox extension
        https://bugs.webkit.org/show_bug.cgi?id=198902
        <rdar://problem/50772810>

        Reviewed by Geoffrey Garen.

        Store the sandbox path, if any, in UIProcess for each page in its PageLoadState.
        This allows proper sandbox handling for reload after crash and process swap cases.
        Store the sandbox path, if any, in the b/w list so that the sandbox path can be properly computed
        during b/f navigation works.

        Add SPI for test purposes to check what is the current sandbox path.

        * Shared/WebBackForwardListItem.h:
        (WebKit::WebBackForwardListItem::resourceDirectoryURL const):
        (WebKit::WebBackForwardListItem::setResourceDirectoryURL):
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _resourceDirectoryURL]):
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/PageLoadState.cpp:
        (WebKit::PageLoadState::resourceDirectoryURL const):
        (WebKit::PageLoadState::setPendingAPIRequestURL):
        * UIProcess/PageLoadState.h:
        (WebKit::PageLoadState::setPendingAPIRequestURL):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
        (WebKit::WebPageProxy::loadRequestWithNavigationShared):
        (WebKit::WebPageProxy::loadFile):
        (WebKit::WebPageProxy::reload):
        (WebKit::WebPageProxy::backForwardAddItem):
        (WebKit::WebPageProxy::backForwardGoToItemShared):
        (WebKit::WebPageProxy::currentResourceDirectoryURL const):
        * UIProcess/WebPageProxy.h:

2019-06-21  Antoine Quint  <graouts@apple.com>

        [iOS] Compatibility mouse events aren't prevented by calling preventDefault() on pointerdown
        https://bugs.webkit.org/show_bug.cgi?id=198124
        <rdar://problem/50410863>

        Reviewed by Dean Jackson.

        Ensure we wait until completion of a tap before removing the pointer ID and the preventDefault() state along with it.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _singleTapDidReset:]):
        (-[WKContentView _commitPotentialTapFailed]):
        (-[WKContentView _didCompleteSyntheticClick]):
        (-[WKContentView _singleTapRecognized:]):

2019-06-21  Keith Rollin  <krollin@apple.com>

        Address reference to UIColor.groupTableViewBackgroundColor in WKPasswordView.mm
        https://bugs.webkit.org/show_bug.cgi?id=199111
        <rdar://problem/51992107>

        Reviewed by Timothy Hatcher.

        WKPasswordView.mm is used on iOS-family devices. However, it doesn't
        build on tvOS or watchOS when "treat deprecation warnings as errors"
        is enabled. This build failure is due to a reference to
        UIColor.groupTableViewBackgroundColor in a branch of non-dark-mode
        code. Address this by surrounding the reference with
        ALLOW_DEPRECATED_DECLARATIONS_* macros.

        Attempting to address the build failure by unconditionally enabling
        the dark-mode code works for tvOS, but fails for watchOS due to lack
        of dark-mode support on that platform.

        * UIProcess/ios/WKPasswordView.mm:
        (-[WKPasswordView showInScrollView:]):

2019-06-21  Michael Catanzaro  <mcatanzaro@igalia.com>

        [WPE][GTK] Bump minimum versions of GLib, GTK, libsoup, ATK, GStreamer, and Cairo
        https://bugs.webkit.org/show_bug.cgi?id=199094

        Reviewed by Carlos Garcia Campos.

        * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
        (WebKit::NetworkDataTaskSoup::createRequest):
        (WebKit::NetworkDataTaskSoup::writeDownloadCallback):
        (WebKit::NetworkDataTaskSoup::writeDownload):
        (WebKit::NetworkDataTaskSoup::startingCallback):
        (WebKit::NetworkDataTaskSoup::requestStartedCallback): Deleted.
        * Shared/gtk/WebEventFactory.cpp:
        (WebKit::buttonForEvent):
        (WebKit::WebEventFactory::createWebMouseEvent):
        (WebKit::WebEventFactory::createWebWheelEvent):
        (WebKit::WebEventFactory::createWebKeyboardEvent):
        (WebKit::WebEventFactory::createWebTouchEvent):
        * UIProcess/API/gtk/PageClientImpl.cpp:
        (WebKit::PageClientImpl::doneWithTouchEvent):
        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (ClickCounter::currentClickCountForGdkButtonEvent):
        (webkitWebViewBaseRealize):
        (webkitWebViewBaseHandleMouseEvent):
        (webkitWebViewBaseGetTouchPointsForEvent):
        (webkitWebViewBaseTouchEvent):
        (webkitWebViewBaseGestureController):
        (webkitWebViewBaseEvent):
        (deviceScaleFactorChanged):
        (webkitWebViewBaseCreateWebPage):
        (webkitWebViewBaseTakeViewSnapshot):
        * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
        * UIProcess/API/gtk/WebKitWebViewDialog.cpp:
        (webkitWebViewDialogDraw):
        (webkitWebViewDialogConstructed):
        (webkit_web_view_dialog_class_init):
        * UIProcess/API/gtk/WebKitWebViewGtk.cpp:
        (fileChooserDialogResponseCallback):
        (webkitWebViewRunFileChooser):
        * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
        (WebKit::doMouseEvent):
        (WebKit::doMotionEvent):
        (WebKit::doKeyStrokeEvent):
        * UIProcess/WebPageProxy.h:
        * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
        (WebKit::AcceleratedBackingStoreWayland::~AcceleratedBackingStoreWayland):
        (WebKit::AcceleratedBackingStoreWayland::tryEnsureGLContext):
        (WebKit::AcceleratedBackingStoreWayland::makeContextCurrent):
        (WebKit::AcceleratedBackingStoreWayland::paint):
        * UIProcess/gtk/AcceleratedBackingStoreWayland.h:
        * UIProcess/gtk/DragAndDropHandler.cpp:
        (WebKit::DragAndDropHandler::startDrag):
        (WebKit::DragAndDropHandler::fillDragData):
        (WebKit::DragAndDropHandler::finishDrag):
        * UIProcess/gtk/DragAndDropHandler.h:
        * UIProcess/gtk/GestureController.cpp:
        (WebKit::GestureController::handleEvent):
        * UIProcess/gtk/GestureController.h:
        * UIProcess/gtk/InputMethodFilter.cpp:
        (WebKit::InputMethodFilter::filterKeyEvent):
        (WebKit::InputMethodFilter::logHandleKeyboardEventForTesting):
        (WebKit::InputMethodFilter::logHandleKeyboardEventWithCompositionResultsForTesting):
        * UIProcess/gtk/ViewGestureControllerGtk.cpp:
        (WebKit::isEventStop):
        (WebKit::createScrollEvent):
        * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
        (WebKit::WebContextMenuProxyGtk::append):
        (WebKit::WebContextMenuProxyGtk::WebContextMenuProxyGtk):
        (WebKit::WebContextMenuProxyGtk::~WebContextMenuProxyGtk):
        * UIProcess/gtk/WebKitInspectorWindow.cpp:
        (webkit_inspector_window_init):
        (webkitInspectorWindowSetSubtitle):
        * UIProcess/gtk/WebPageProxyGtk.cpp:
        (WebKit::WebPageProxy::getCenterForZoomGesture):
        * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
        (WebKit::WebPopupMenuProxyGtk::showPopupMenu):
        (WebKit::WebPopupMenuProxyGtk::hidePopupMenu):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/gtk/WebPageGtk.cpp:
        (WebKit::WebPage::getCenterForZoomGesture):

2019-06-20  Patrick Griffis  <pgriffis@igalia.com> and Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] Implement a basic DNS cache
        https://bugs.webkit.org/show_bug.cgi?id=196094

        Reviewed by Michael Catanzaro.

        This adds a simple cache to all DNS operations in the network process.

        * NetworkProcess/glib/DNSCache.cpp: Added.
        (WebKit::DNSCache::DNSCache):
        (WebKit::DNSCache::mapForType):
        (WebKit::DNSCache::lookup):
        (WebKit::DNSCache::update):
        (WebKit::DNSCache::removeExpiredResponsesInMap):
        (WebKit::DNSCache::pruneResponsesInMap):
        (WebKit::DNSCache::removeExpiredResponsesFired):
        (WebKit::DNSCache::clear):
        * NetworkProcess/glib/DNSCache.h: Added.
        * NetworkProcess/glib/WebKitCachedResolver.cpp: Added.
        (addressListVectorToGList):
        (addressListGListToVector):
        (webkitCachedResolverLookupByName):
        (webkitCachedResolverLookupByNameAsync):
        (webkitCachedResolverLookupByNameFinish):
        (dnsCacheType):
        (webkitCachedResolverLookupByNameWithFlags):
        (webkitCachedResolverLookupByNameWithFlagsAsync):
        (webkitCachedResolverLookupByNameWithFlagsFinish):
        (webkitCachedResolverLookupByAddress):
        (webkitCachedResolverLookupByAddressAsync):
        (webkitCachedResolverLookupByAddressFinish):
        (webkitCachedResolverLookupRecords):
        (webkitCachedResolverLookupRecordsAsync):
        (webkitCachedResolverLookupRecordsFinish):
        (webkitCachedResolverReload):
        (webkit_cached_resolver_class_init):
        (webkitCachedResolverNew):
        * NetworkProcess/glib/WebKitCachedResolver.h: Added.
        * NetworkProcess/soup/NetworkProcessSoup.cpp:
        (WebKit::NetworkProcess::platformInitializeNetworkProcess):
        * PlatformGTK.cmake:
        * PlatformWPE.cmake:
        * SourcesGTK.txt:
        * SourcesWPE.txt:

2019-06-20  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Stop pretending WebCore::Widget can have a platform widget
        https://bugs.webkit.org/show_bug.cgi?id=199066

        Reviewed by Michael Catanzaro.

        Rename PlatformWidget as PlatformViewWidget to avoid conflict with PlatformWidget defined in WebCore.

        * UIProcess/WebPageProxy.h:
        * UIProcess/win/WebPageProxyWin.cpp:
        (WebKit::WebPageProxy::viewWidget):

2019-06-20  Megan Gardner  <megan_gardner@apple.com>

        Remove change that was causing hangs
        https://bugs.webkit.org/show_bug.cgi?id=199055
        <rdar://problem/51820516>

        Reviewed by Darin Adler.

        This fix can sometimes cause deadlocks in the UIProcess.
        We have a different fix that will go into UIKit <rdar://problem/51927701>.

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

2019-06-20  Daniel Bates  <dabates@apple.com>

        [iOS] Evernote crashes when creating a note
        https://bugs.webkit.org/show_bug.cgi?id=199083
        <rdar://problem/51759247>

        Reviewed by Brent Fulgham.

        Add a hack just for Evernote linked before iOS 13 that dynamically adds a placeholder -[WKContentView keyCommands]
        method (it just calls super). Evernote swizzles the IPI -[WKContentView keyCommands], but this
        method may not always be present in the WebKit binary following r240514. So, Evernote may end
        up swizzling -[UIResponder keyCommands], but their implementation doesn't account for this
        scenario and they end up crashing because they call an unrecognized selector.

        * UIProcess/Cocoa/VersionChecks.h: Add version check.
        * UIProcess/ios/WKContentView.mm:
        (keyCommandsPlaceholderHackForEvernote): Added.
        (-[WKContentView _commonInitializationWithProcessPool:configuration:]): Install the hack.

2019-06-20  Brady Eidson  <beidson@apple.com>

        WebURLSchemeHandlerProxy::loadSynchronously crash with sync request.
        <rdar://problem/51862206> and https://bugs.webkit.org/show_bug.cgi?id=199063

        Reviewed by Geoffrey Garen.

        Don't use a DataReference for the sync reply type.

        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/WebURLSchemeHandler.h:

        * UIProcess/WebURLSchemeTask.cpp:
        (WebKit::WebURLSchemeTask::didComplete):
        * UIProcess/WebURLSchemeTask.h:

        * WebProcess/WebPage/WebURLSchemeHandlerProxy.cpp:
        (WebKit::WebURLSchemeHandlerProxy::loadSynchronously):

2019-06-20  Alex Christensen  <achristensen@webkit.org>

        Add unit test for UIContextMenuConfiguration API
        https://bugs.webkit.org/show_bug.cgi?id=199043

        Reviewed by Wenson Hsieh.

        * UIProcess/API/APIPageConfiguration.cpp:
        (API::PageConfiguration::copy const):
        * UIProcess/API/APIPageConfiguration.h:
        (API::PageConfiguration::clickInteractionDriverForTesting const):
        (API::PageConfiguration::setClickInteractionDriverForTesting):
        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
        (-[WKWebViewConfiguration _setClickInteractionDriverForTesting:]):
        (-[WKWebViewConfiguration _clickInteractionDriverForTesting]):
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _registerPreview]):

2019-06-20  Alexander Mikhaylenko  <exalm7659@gmail.com>

        [GTK] Enable navigation swipe layout tests
        https://bugs.webkit.org/show_bug.cgi?id=198995

        Reviewed by Michael Catanzaro.

        Implement API for enabling and controlling swipes from WebKitTestRunner.

        Implement beginSimulatedSwipeInDirectionForTesting() and completeSimulatedSwipeInDirectionForTesting()
        in ViewGestureController for controlling the test swipes. Add functions in WebKitWebViewBase for calling
        them.

        Simulate the gesture by generating two scroll events: one to begin the gesture and one to complete it.

        Since there's no reliable way to set source device type of the generated events to touchpad, don't check
        source device type for simulated swipes.

        * UIProcess/API/C/gtk/WKView.cpp:
        (WKViewSetEnableBackForwardNavigationGesture): Added.
        (WKViewBeginBackSwipeForTesting): Added.
        (WKViewCompleteBackSwipeForTesting): Added.
        * UIProcess/API/C/gtk/WKViewPrivate.h:
        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (webkitWebViewBaseBeginBackSwipeForTesting): Added.
        (webkitWebViewBaseCompleteBackSwipeForTesting): Added.
        * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
        * UIProcess/ViewGestureController.h:
        * UIProcess/gtk/ViewGestureControllerGtk.cpp:
        (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanInfluenceSwipe):
        Skip source device type check for simulated swipes. Also, remove an incorrect FIXME.
        (WebKit::createScrollEvent): Added.
        (WebKit::ViewGestureController::beginSimulatedSwipeInDirectionForTesting): Implemented.
        (WebKit::ViewGestureController::completeSimulatedSwipeInDirectionForTesting): Implemented.

2019-06-20  Charlie Turner  <cturner@igalia.com>

        [GTK] Make startup pause available in DEVELOPER_MODE rather than DEBUG.
        https://bugs.webkit.org/show_bug.cgi?id=199069

        Reviewed by Michael Catanzaro.

        * WebProcess/gtk/WebProcessMainGtk.cpp: Allow developers to pause
        the web process in DEVELOPER_MODE rather than only DEBUG, matching
        the WPE behaviour and also the purpose of DEVELOPER_MODE.

2019-06-20  Alexander Mikhaylenko  <exalm7659@gmail.com>

        [GTK] The Previous/Next gesture should handle RTL
        https://bugs.webkit.org/show_bug.cgi?id=198707

        Reviewed by Michael Catanzaro.

        The gesture uses PageClientImpl::userInterfaceLayoutDirection() to determine the text
        direction. Implement that method, then adjust drawing so that the pages move from/to
        the left instead of right side for RTL locales.

        * UIProcess/API/gtk/PageClientImpl.cpp:
        (WebKit::): Implemented.
        * UIProcess/API/gtk/PageClientImpl.h:
        * UIProcess/gtk/ViewGestureControllerGtk.cpp:
        (WebKit::ViewGestureController::draw):

2019-06-20  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Remove support for GTK2 plugins
        https://bugs.webkit.org/show_bug.cgi?id=199065

        Reviewed by Sergio Villar Senin.

        * PlatformGTK.cmake:
        * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
        (WebKit::moduleMixesGtkSymbols):
        * Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp:
        (WebKit::NetscapePluginModule::getPluginInfo):
        * Shared/Plugins/PluginModuleInfo.h:
        * Shared/gtk/WebEventFactory.cpp:
        (WebKit::isGdkKeyCodeFromKeyPad):
        (WebKit::buttonForEvent):
        (WebKit::WebEventFactory::createWebMouseEvent):
        (WebKit::WebEventFactory::createWebWheelEvent):
        (WebKit::WebEventFactory::createWebKeyboardEvent):
        (WebKit::WebEventFactory::createWebTouchEvent):
        * SourcesGTK.txt:
        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
        (WebKit::ProcessLauncher::launchProcess):
        * UIProcess/Plugins/PluginProcessProxy.h:
        * UIProcess/Plugins/gtk/PluginInfoCache.cpp:
        (WebKit::PluginInfoCache::getPluginInfo):
        (WebKit::PluginInfoCache::updatePluginInfo):
        * UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
        (WebKit::PluginInfoStore::getPluginInfo):
        * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
        (WebKit::PluginProcessProxy::platformGetLaunchOptionsWithAttributes):
        (WebKit::PluginProcessProxy::scanPlugin):
        * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:

2019-06-19  Dean Jackson  <dino@apple.com>

        No menu pop-up when long pressing on a link in Firefox app
        https://bugs.webkit.org/show_bug.cgi?id=199045
        <rdar://problem/51422407>

        Reviewed by Tim Horton.

        Add a version check for linking on-or-after iOS 13. When
        that isn't true, we don't use UIContextMenuInteraction
        and instead fall back on the legacy UIPreviewItem API.

        * UIProcess/Cocoa/VersionChecks.h: Add FirstThatHasUIContextMenuInteraction.
        * UIProcess/ios/WKContentViewInteraction.h: 
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _shouldUseContextMenus]): New method to decide if we should
        use context menus or preview items.
        (-[WKContentView setupInteraction]): Make the decision at runtime rather than
        compile time.
        (-[WKContentView _contentsOfUserInterfaceItem:]): Ditto.
        (-[WKContentView _registerPreview]): Ditto.
        (-[WKContentView _unregisterPreview]): Ditto.

2019-06-19  Andy Estes  <aestes@apple.com>

        [iOS] Fall back to taking a UIView snapshohot for UITargetedPreviews if InteractionInformationAtPosition does not have an image
        https://bugs.webkit.org/show_bug.cgi?id=199038
        <rdar://problem/50555810>

        Reviewed by Tim Horton.

        In -contextMenuInteraction:previewForHighlightingMenuWithConfiguration: and friend, we
        should always return a non-nil UITargetedPreview. When we do return nil, UIKit uses the web
        view itself as the snapshot view, creating an unsightly animation.

        For cases where we fail to create a UITargetedPreview from the information in
        InteractionInformationAtPosition, this patch falls back to creating a UITargetedPreview with
        a snapshot view obtained from
        -[UIView resizableSnapshotViewFromRect:afterScreenUpdates:withCapInsets:].

        Also renamed -targetedPreview to -_ensureTargetedPreview and cached the UITargetedPreview
        for reuse in -contextMenuInteraction:previewForDismissingMenuWithConfiguration:.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (createFallbackTargetedPreview):
        (-[WKContentView _ensureTargetedPreview]):
        (-[WKContentView contextMenuInteraction:previewForHighlightingMenuWithConfiguration:]):
        (-[WKContentView contextMenuInteraction:previewForDismissingMenuWithConfiguration:]):
        (-[WKContentView contextMenuInteractionDidEnd:]):
        (-[WKContentView _targetedPreview]): Renamed to _ensureTargetedPreview.

2019-06-19  Devin Rousso  <drousso@apple.com>

        Web Inspector: Network: replace CFNetwork SPI with new API where able
        https://bugs.webkit.org/show_bug.cgi?id=198762

        Reviewed by Timothy Hatcher.

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):

2019-06-19  Alex Christensen  <achristensen@webkit.org>

        DownloadMonitor::measuredThroughputRate should approach zero with no throughput
        https://bugs.webkit.org/show_bug.cgi?id=198981
        <rdar://problem/51456914>

        Reviewed by Geoffrey Garen.

        When the timer fires to approximate the download rate, add a new timestamp with 0 bytes received since the last time we received bytes.
        Then, if there's only one timestamp, assume the throughput rate is 0 instead of infinite.
        This will prevent false positives estimating large download rates based on old data when the throughput drops to 0.

        * NetworkProcess/Downloads/DownloadMonitor.cpp:
        (WebKit::DownloadMonitor::measuredThroughputRate const):
        (WebKit::DownloadMonitor::timerFired):

2019-06-19  Sihui Liu  <sihui_liu@apple.com>

        Remove unused originsWithCredentials from WebsiteData
        https://bugs.webkit.org/show_bug.cgi?id=199020

        Reviewed by Geoffrey Garen.

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

2019-06-19  Sihui Liu  <sihui_liu@apple.com>

        Crash at com.apple.WebKit: WebKit::WebsiteDataStore::processPools const
        https://bugs.webkit.org/show_bug.cgi?id=198935
        <rdar://problem/51549308>

        Reviewed by Geoffrey Garen.

        When WebProcessProxy is in WebProcessCache or is pre-warmed, it does not hold a strong reference of 
        WebProcessPool. In this case, we should not store the raw pointer of WebProcessPool and perform websiteDataStore
        operations with it.
        This patch should fix the crash at dereferencing null pointer of WebProcessPool in 
        WebsiteDataStore::processPools, but it is unclear why websiteDataStore comes to observe cached or prewarmed web 
        process that should not have web page. The release log may help us find the cause.

        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::processPoolIfExists const):
        * UIProcess/WebProcessProxy.h:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::processPools const):

2019-06-19  Alex Christensen  <achristensen@webkit.org>

        Add a unit test for client certificate authentication
        https://bugs.webkit.org/show_bug.cgi?id=197800

        Reviewed by Youenn Fablet.

        * Shared/cf/ArgumentCodersCF.cpp:
        Move SPI declarations to SecuritySPI.h.

2019-06-19  Alex Christensen  <achristensen@webkit.org>

        Update preview API deprecation message.
        https://bugs.webkit.org/show_bug.cgi?id=198974

        * UIProcess/API/Cocoa/WKUIDelegate.h:

2019-06-19  Adrian Perez de Castro  <aperez@igalia.com>

        [GTK] Fix compilation errors for the GTK2 plugin process
        https://bugs.webkit.org/show_bug.cgi?id=199000

        Reviewed by Michael Catanzaro.

        * Shared/gtk/WebEventFactory.cpp: Use the GdkEvent union fields
        when directly accessing event struct fields.
        (WebKit::buttonForEvent):
        (WebKit::WebEventFactory::createWebMouseEvent):
        (WebKit::WebEventFactory::createWebKeyboardEvent):

2019-06-19  Adrian Perez de Castro  <aperez@igalia.com>

        [WPE][GTK] Fix build with unified sources disabled
        https://bugs.webkit.org/show_bug.cgi?id=198752

        Reviewed by Michael Catanzaro.

        * NetworkProcess/NetworkHTTPSUpgradeChecker.cpp:
        (WebKit::NetworkHTTPSUpgradeChecker::NetworkHTTPSUpgradeChecker): Qualify SQLiteDatabase
        with its namespace.
        * UIProcess/WebFrameProxy.h: Replace forward declaration of WebPageProxy with inclusion
        of WebPageProxy.h to avoid build error due to usage of undefined class. Moved DataCallback
        definition from WebPageProxy.h to avoid code using the type before its declaration.
        * UIProcess/WebPageProxy.h: Remove definition of DataCallback.
        * UIProcess/wpe/WebInspectorProxyWPE.cpp: Add missing forward declaration of
        WebCore::FloatRect.
        (WebKit::WebInspectorProxy::platformSetSheetRect): Qualify FloatRect with its namespace.
        * WebProcess/Automation/WebAutomationSessionProxy.cpp: Qualify all occurrences of
        PageIdentifier with its namespace.
        (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::takeScreenshot):
        (WebKit::WebAutomationSessionProxy::getCookiesForFrame):
        (WebKit::WebAutomationSessionProxy::deleteCookie):
        * WebProcess/Cache/WebCacheStorageConnection.cpp: Ditto.
        (WebKit::WebCacheStorageConnection::open):
        (WebKit::WebCacheStorageConnection::remove):
        (WebKit::WebCacheStorageConnection::retrieveCaches):
        (WebKit::WebCacheStorageConnection::retrieveRecords):
        (WebKit::WebCacheStorageConnection::batchDeleteOperation):
        (WebKit::WebCacheStorageConnection::batchPutOperation):
        * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp: Add missing inclusion of WebPage.h
        * WebProcess/WebPage/gtk/WebPageGtk.cpp: Add missing inclusion of gtk/gtk.h
        * WebProcess/WebPage/wpe/WebPageWPE.cpp: Add missing inclusion of WebPageProxy.h

2019-06-19  Alexander Mikhaylenko  <exalm7659@gmail.com>

        [GTK] Page blinks after navigation swipe if it triggered PSON
        https://bugs.webkit.org/show_bug.cgi?id=198996

        Reviewed by Michael Catanzaro.

        Disconnect and then reconnect ViewGestureController during process swap
        instead of destroying and re-creating it.

        * UIProcess/API/gtk/PageClientImpl.cpp:
        (WebKit::PageClientImpl::PageClientImpl::processWillSwap): Added.
        (WebKit::PageClientImpl::PageClientImpl::processDidExit): Implemented.
        * UIProcess/API/gtk/PageClientImpl.h:
        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (webkitWebViewBaseWillSwapWebProcess): Added.
        Disconnect ViewGestureController if it exists.
        (webkitWebViewBaseDidExitWebProcess): Added.
        Destroy ViewGestureController.
        (webkitWebViewBaseDidRelaunchWebProcess):
        Reconnect the ViewGestureController if it exists.
        * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:

2019-06-19  Takashi Komori  <Takashi.Komori@sony.com>

        [Curl] CurlRequestScheduler doesn't terminate worker thread in a certain situation.
        https://bugs.webkit.org/show_bug.cgi?id=198993

        Cancel CurlRequest before invalidation to remove tasks from CurlRequestScheduler certainly in ~NetworkDataTaskCurl.

        Reviewed by Fujii Hironori.

        * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
        (WebKit::NetworkDataTaskCurl::~NetworkDataTaskCurl):

2019-06-19  Zan Dobersek  <zdobersek@igalia.com>

        [Nicosia] Invalidate SceneIntegration in LayerTreeHost::invalidate()
        https://bugs.webkit.org/show_bug.cgi?id=198992

        Reviewed by Carlos Garcia Campos.

        * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
        (WebKit::LayerTreeHost::invalidate): Invalidate the
        Nicosia::SceneIntegration object. This should properly disassociate
        the now-invalited LayerTreeHost (a SceneIntegration client) from the
        SceneIntegration object that can still be shared with platform layers
        originating from this LayerTreeHost.

2019-06-18  Dean Jackson  <dino@apple.com>

        UIContextMenuInteraction implementation for WKContentView
        https://bugs.webkit.org/show_bug.cgi?id=198986
        <rdar://problem/51875189>

        Reviewed by Andy Estes.

        Implement UIContextMenuInteraction and its delegate as a
        replacement for UIPreviewItemController in iOS 13.

        In order to preserve existing behaviour as much as possible,
        we check for the implementation of new WebKit API to configure
        the menu. If that is not present, we attempt to convert
        the results of the existing WebKit WKPreviewAction delegates
        into something that works with UIContextMenus.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView setupInteraction]):
        (-[WKContentView _contentsOfUserInterfaceItem:]):
        (-[WKContentView _registerPreview]):
        (-[WKContentView _unregisterPreview]):
        (-[WKContentView _showLinkPreviewsPreferenceChanged:]):
        (needsDeprecatedPreviewAPI):
        (uiActionForPreviewAction):
        (menuFromPreviewOrDefaults):
        (titleForMenu):
        (-[WKContentView assignLegacyDataForContextMenuInteraction]):
        (-[WKContentView contextMenuInteraction:configurationForMenuAtLocation:]):
        (-[WKContentView _contextMenuInteraction:configurationForMenuAtLocation:completion:]):
        (-[WKContentView continueContextMenuInteraction:]):
        (uiImageForImage):
        (createTargetedPreview):
        (-[WKContentView _targetedPreview]):
        (-[WKContentView contextMenuInteraction:previewForHighlightingMenuWithConfiguration:]):
        (-[WKContentView contextMenuInteractionWillPresent:]):
        (-[WKContentView contextMenuInteraction:previewForDismissingMenuWithConfiguration:]):
        (-[WKContentView contextMenuInteraction:willCommitWithAnimator:]):
        (-[WKContentView contextMenuInteractionDidEnd:]):
        (-[WKContentView shouldUsePreviewForLongPress]): Deleted.

2019-06-18  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r246575.

        Breaks internal builds.

        Reverted changeset:

        "Update WebKit API to separately retrieve actions and use
        context menus"
        https://bugs.webkit.org/show_bug.cgi?id=198974
        https://trac.webkit.org/changeset/246575

2019-06-18  Alex Christensen  <achristensen@webkit.org>

        Update WebKit API to separately retrieve actions and use context menus
        https://bugs.webkit.org/show_bug.cgi?id=198974
        <rdar://problem/50735687>

        Reviewed by Tim Horton.

        Update API and SPI, and add infrastructure for asynchronously requesting interaction information.

        * UIProcess/API/Cocoa/WKUIDelegate.h:
        * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:

2019-06-18  Daniel Bates  <dabates@apple.com>

        REGRESSION (r240757): Cannot dismiss the keyboard on http://apple.com/apple-tv-plus
        https://bugs.webkit.org/show_bug.cgi?id=198922
        <rdar://problem/50300056>

        Reviewed by Wenson Hsieh.

        Actually dismiss the keyboard as intended in r240757. Do not wait for the round-trip
        to the WebProcess to run through the -elementDidBlur steps in the UIProcess and hide
        the keyboard when a person explicitly dismisses the keyboard via the Done button (iPhone)
        or hide keyboard button (iPad).

        Note that r240757 revealed another bug in this code, <https://bugs.webkit.org/show_bug.cgi?id=198928>.
        I am unclear of the implications of that bug, but it is clear for this bug that it
        never makes sense to round-trip to the WebProcess when the keyboard is dismissed by
        a user gesture.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView endEditingAndUpdateFocusAppearanceWithReason:]): Invoke -_elementDidBlur
        to blur the element in the UIProcess and hide the keyboard.
        (-[WKContentView _elementDidBlur]): Prevent duplicate invocations of -didEndFormControlInteraction
        and setIsShowingInputViewForFocusedElement messages by only doing these actions when
        editablity changes. This covers the case where -_elementDidBlur may be invoked a second
        time (the reply in the round-trip). In that case we don't need to do these actions.

2019-06-18  Alex Christensen  <achristensen@webkit.org>

        NetworkSession::networkStorageSession can return null
        https://bugs.webkit.org/show_bug.cgi?id=198947
        <rdar://problem/51394449>

        Reviewed by Youenn Fablet.

        We are seeing evidence of crashes from the map owning NetworkSessions and the map owning NetworkStorageSessions becoming out of sync
        because NetworkSession is refcounted but NetworkStorageSession is not.  I started the complete fix in https://bugs.webkit.org/show_bug.cgi?id=194926
        but for now let's add less risky null checks to prevent fallout.

        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
        (WebKit::ResourceLoadStatisticsStore::updateClientSideCookiesAgeCap):
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::hasStorageAccessForFrame):
        (WebKit::WebResourceLoadStatisticsStore::callHasStorageAccessForFrameHandler):
        (WebKit::WebResourceLoadStatisticsStore::grantStorageAccess):
        (WebKit::WebResourceLoadStatisticsStore::removeAllStorageAccess):
        (WebKit::WebResourceLoadStatisticsStore::setCacheMaxAgeCap):
        (WebKit::WebResourceLoadStatisticsStore::callUpdatePrevalentDomainsToBlockCookiesForHandler):
        (WebKit::WebResourceLoadStatisticsStore::removePrevalentDomains):
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::initializeNetworkProcess):
        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::networkStorageSession const):
        * NetworkProcess/NetworkSession.h:
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        (WebKit::NetworkDataTaskCocoa::applyCookieBlockingPolicy):
        (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
        (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
        (WebKit::NetworkDataTaskCocoa::tryPasswordBasedAuthentication):

2019-06-18  Brady Eidson  <beidson@apple.com>

        Handle NSProgress calling our cancellation handler on background threads (and calling it more than once).
        <rdar://problem/51392926> and https://bugs.webkit.org/show_bug.cgi?id=198945

        Reviewed by Alex Christensen.

        If you have a download in progress and quickly tap the button to cancel it multiple times, then:
            - NSProgress calls our cancellation handler on a non-main thread, which we can't handle.
            - They do it more than once, which is also bad.
            - They might even do it multiple times concurrently (on different background dispatch queues)
        
        Let's work around these.

        * NetworkProcess/Downloads/Download.cpp:
        (WebKit::Download::cancel): Double check we're on the main thread, and handle being called twice.

        * NetworkProcess/Downloads/cocoa/WKDownloadProgress.mm:
        (-[WKDownloadProgress performCancel]): Actually cancel the WebKit::Download if we still have one.
        (-[WKDownloadProgress progressCancelled]): Called when NSProgress calls the cancellation handler, no matter
          which thread it does it on. By leveraging std::call_once we handle multiple calls as well as being called
          concurrently from different threads. call_once punts the *actual* cancel operation off to the main thread.
        (-[WKDownloadProgress initWithDownloadTask:download:URL:sandboxExtension:]): The cancellation handler is
          now simply calling 'progressCancelled' on self, assuming the weak pointer for self is still valid.

2019-06-18  Daniel Bates  <dabates@apple.com>

        [iOS] Pressing key while holding Command should not insert character
        https://bugs.webkit.org/show_bug.cgi?id=198925
        <rdar://problem/51778811>

        Reviewed by Brent Fulgham.

        Do not insert a character for an unhandled key command that has a Command modifier.
        For example, pressing Command + Shift + v, which is an unhandled key command (at the
        time of writing) should not insert v. This matches iOS and Mac platform conventions.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _interpretKeyEvent:isCharEvent:]):

2019-06-18  John Wilander  <wilander@apple.com>

        Change log channel name from ResourceLoadStatisticsDebug to ITPDebug and remove unnecessary #if !RELEASE_LOG_DISABLED
        https://bugs.webkit.org/show_bug.cgi?id=198970
        <rdar://problem/51855836>

        Reviewed by Brent Fulgham.

        * 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/Classifier/ResourceLoadStatisticsStore.cpp:
        (WebKit::domainsToString):
        (WebKit::ResourceLoadStatisticsStore::removeDataRecords):
        (WebKit::ResourceLoadStatisticsStore::setResourceLoadStatisticsDebugMode):
        (WebKit::ResourceLoadStatisticsStore::debugLogDomainsInBatches):
        * Platform/Logging.h:

2019-06-18  Youenn Fablet  <youenn@apple.com>

        StorageManager::removeAllowedSessionStorageNamespaceConnection should make sure its storageNamespaceID is valid
        https://bugs.webkit.org/show_bug.cgi?id=198966
        rdar://problem/51352080

        Reviewed by Alex Christensen.

        Make sure the namespace ID is a key of the map before using the value.
        The namespace ID is coming straight from IPC so should not be trusted.
        Also, namespace IDs are added/removed based on web pages being created/deleted.
        Namespace IDs are supposed to be scoped by session IDs.
        Using page IDs for namespace IDs works as long as the page does not change of session ID during its lifetime, which is not guaranteed.

        * NetworkProcess/WebStorage/StorageManager.cpp:
        (WebKit::StorageManager::removeAllowedSessionStorageNamespaceConnection):

2019-06-18  David Quesada  <david_quesada@apple.com>

        Network process crash in SandboxExtension::consume() via Download::publishProgress
        https://bugs.webkit.org/show_bug.cgi?id=198968
        rdar://problem/51732997

        Reviewed by Alex Christensen.

        Add an early return if the network process fails to resolve a sandbox extension handle for publishing
        progress on a download. Creating the NSProgress doesn't do much since the progress reporting service
        won't honor the attempt to publish progress on a URL the process does not have access to, and nothing
        else in the Network process makes any use of the progress.

        * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
        (WebKit::Download::publishProgress):

2019-06-18  Adrian Perez de Castro  <aperez@igalia.com>

        Unreviewed. Update OptionsWPE.cmake and NEWS for the 2.25.1 release

        * wpe/NEWS: Add release notes for 2.25.1

2019-06-18  Tim Horton  <timothy_horton@apple.com>

        Expose DataDetectors context generation on WKContentViewInteraction
        https://bugs.webkit.org/show_bug.cgi?id=198950
        <rdar://problem/51116021>

        Reviewed by Andy Estes.

        * UIProcess/ios/WKActionSheetAssistant.h:
        * UIProcess/ios/WKActionSheetAssistant.mm:
        (-[WKActionSheetAssistant currentPositionInformation]):
        (-[WKActionSheetAssistant showDataDetectorsSheet]):
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView dataDetectionContextForPositionInformation:]):
        (-[WKContentView dataDetectionContextForActionSheetAssistant:]):
        For use by other clients, add -dataDetectionContextForPositionInformation:
        and make -dataDetectionContextForActionSheetAssistant: use it.
        Also, pull the code to augment the context with surrounding text out of
        from WKActionSheetAssistant.

2019-06-18  Adrian Perez de Castro  <aperez@igalia.com>

        [WPE] Fix building the documentation

        Unreviewed.

        * UIProcess/API/wpe/docs/wpe-docs.sgml: Fix typo "2.62" -> "2.26"

2019-06-18  Truitt Savell  <tsavell@apple.com>

        Unreviewed, rolling out r246531.

        Broke internal builds.

        Reverted changeset:

        "Expose DataDetectors context generation on
        WKContentViewInteraction"
        https://bugs.webkit.org/show_bug.cgi?id=198950
        https://trac.webkit.org/changeset/246531

2019-06-18  Simon Fraser  <simon.fraser@apple.com>

        Convert macOS to scroll by changing layer boundsOrigin
        https://bugs.webkit.org/show_bug.cgi?id=198917

        Reviewed by Antti Koivisto.

        Remove unreached and confusing code.

        * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
        (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::repositionScrollingLayers):

2019-06-18  Dean Jackson  <dino@apple.com>

        Attachment elements are missing context menu previews
        https://bugs.webkit.org/show_bug.cgi?id=198946

        Reviewed by Tim Horton.

        When requesting position information on an <attachment> element,
        we were not providing a snapshot image.

        * WebProcess/WebPage/WebPage.h: New common method to take a snapshot.
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::shareableBitmapSnapshotForNode): New helper.
        (WebKit::WebPage::positionInformation): If the element is an attachment,
        then ask for a snapshot.

2019-06-17  Tim Horton  <timothy_horton@apple.com>

        Expose DataDetectors context generation on WKContentViewInteraction
        https://bugs.webkit.org/show_bug.cgi?id=198950
        <rdar://problem/51116021>

        Reviewed by Andy Estes.

        * UIProcess/ios/WKActionSheetAssistant.h:
        * UIProcess/ios/WKActionSheetAssistant.mm:
        (-[WKActionSheetAssistant currentPositionInformation]):
        (-[WKActionSheetAssistant showDataDetectorsSheet]):
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView dataDetectionContextForPositionInformation:]):
        (-[WKContentView dataDetectionContextForActionSheetAssistant:]):
        For use by other clients, add -dataDetectionContextForPositionInformation:
        and make -dataDetectionContextForActionSheetAssistant: use it.
        Also, pull the code to augment the context with surrounding text out of
        from WKActionSheetAssistant.

2019-06-17  Sihui Liu  <sihui_liu@apple.com>

        -[WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:] doesn't delete _WKWebsiteDataTypeCredentials
        https://bugs.webkit.org/show_bug.cgi?id=198854
        <rdar://problem/51386058>

        Reviewed by Geoffrey Garen.

        Clear persistent credentials in deleteWebsiteData of network process.

        Also, merge originsWithPersistentCredentials and removeCredentialsWithOrigins into fetchWebsiteData and
        deleteWebsiteData, and move credentials handling to WebCore.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::fetchWebsiteData):
        (WebKit::NetworkProcess::deleteWebsiteData):
        (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
        (WebKit::NetworkProcess::originsWithPersistentCredentials): Deleted.
        (WebKit::NetworkProcess::removeCredentialsWithOrigins): Deleted.
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::originsWithPersistentCredentials): Deleted.
        (WebKit::NetworkProcess::removeCredentialsWithOrigins): Deleted.
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::fetchDataAndApply):
        (WebKit::computeWebProcessAccessTypeForDataRemoval):
        (WebKit::WebsiteDataStore::removeData):

2019-06-17  Tim Horton  <timothy_horton@apple.com>

        Fix the build with case-sensitive includes
        <rdar://problem/51828273>

        * UIProcess/API/Cocoa/WKContentRuleListStore.mm:
        FileSystem, not Filesystem.

2019-06-17  Jiewen Tan  <jiewen_tan@apple.com>

        Unreviewed, build fix after r246514

        * UIProcess/Cocoa/SOAuthorization/SOAuthorizationNSURLExtras.h:
        * UIProcess/Cocoa/SOAuthorization/SOAuthorizationNSURLExtras.mm:
        (+[NSURL _web_canPerformAuthorizationWithURL:]):
        Expose the above method as a SPI for Safari.
        * WebKit.xcodeproj/project.pbxproj:

2019-06-17  Alex Christensen  <achristensen@webkit.org>

        Protect StorageManager::m_localStorageNamespaces with a Lock
        https://bugs.webkit.org/show_bug.cgi?id=198939
        <rdar://problem/51784225>

        Reviewed by Geoff Garen.

        StorageManager::LocalStorageNamespace::didDestroyStorageArea is called from StorageArea::~StorageArea which is called on the main thread.
        All other access of m_localStorageNamespaces is from the non-main thread.  Sometimes this causes hash table corruption, so wait for a mutex
        before accessing this member variable.

        * NetworkProcess/WebStorage/StorageManager.cpp:
        (WebKit::StorageManager::LocalStorageNamespace::didDestroyStorageArea):
        (WebKit::StorageManager::cloneSessionStorageNamespace):
        (WebKit::StorageManager::getLocalStorageOrigins):
        (WebKit::StorageManager::deleteLocalStorageEntriesForOrigin):
        (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
        (WebKit::StorageManager::deleteLocalStorageEntriesForOrigins):
        (WebKit::StorageManager::getOrCreateLocalStorageNamespace):
        * NetworkProcess/WebStorage/StorageManager.h:

2019-06-17  Alex Christensen  <achristensen@webkit.org>

        Add null check in WebFrameLoaderClient::assignIdentifierToInitialRequest
        https://bugs.webkit.org/show_bug.cgi?id=198926
        <rdar://problem/50079713>

        Reviewed by Brady Eidson.

        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::assignIdentifierToInitialRequest):
        WebKitLegacy's version already checks null for the corresponding call.

2019-06-17  Alex Christensen  <achristensen@webkit.org>

        Fix internal build after r246514
        https://bugs.webkit.org/show_bug.cgi?id=198874

        * UIProcess/API/APINavigationAction.h:
        A problematic reference to APINavigationActionAdditions.h was left.
        Its contents had been sprinkled into the correct places, though.

2019-06-17  Jiewen Tan  <jiewen_tan@apple.com>

        Move SOAuthorization from WebKitAdditions to WebKit
        https://bugs.webkit.org/show_bug.cgi?id=198874
        <rdar://problem/47573431>

        Reviewed by Brent Fulgham.

        This patch basically moves everything from existing WebKitAdditions to WebKit.
        It also replaces the LoadOptimizer nonsense with the actual SOAuthorization API.

        * Configurations/WebKit.xcconfig:
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
        * PluginProcess/mac/PluginProcessMac.mm:
        (WebKit::PluginProcess::platformInitializePluginProcess):
        * SourcesCocoa.txt:
        * UIProcess/API/APINavigationAction.h:
        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::trySOAuthorization):
        (WebKit::tryInterceptNavigation):
        (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
        (WebKit::tryOptimizingLoad): Deleted.
        * UIProcess/Cocoa/SOAuthorization/NavigationSOAuthorizationSession.h: Added.
        (WebKit::NavigationSOAuthorizationSession::callback):
        * UIProcess/Cocoa/SOAuthorization/NavigationSOAuthorizationSession.mm: Copied from Tools/TestWebKitAPI/Tests/WebKitCocoa/TestLoadOptimizer.mm.
        (WebKit::NavigationSOAuthorizationSession::NavigationSOAuthorizationSession):
        (WebKit::NavigationSOAuthorizationSession::~NavigationSOAuthorizationSession):
        (WebKit::NavigationSOAuthorizationSession::shouldStartInternal):
        (WebKit::NavigationSOAuthorizationSession::webViewDidMoveToWindow):
        * UIProcess/Cocoa/SOAuthorization/PopUpSOAuthorizationSession.h: Added.
        * UIProcess/Cocoa/SOAuthorization/PopUpSOAuthorizationSession.mm: Added.
        (-[WKSOSecretDelegate initWithSession:]):
        (-[WKSOSecretDelegate webViewDidClose:]):
        (-[WKSOSecretDelegate webView:decidePolicyForNavigationAction:decisionHandler:]):
        (-[WKSOSecretDelegate webView:didFinishNavigation:]):
        (WebKit::PopUpSOAuthorizationSession::PopUpSOAuthorizationSession):
        (WebKit::PopUpSOAuthorizationSession::~PopUpSOAuthorizationSession):
        (WebKit::PopUpSOAuthorizationSession::shouldStartInternal):
        (WebKit::PopUpSOAuthorizationSession::fallBackToWebPathInternal):
        (WebKit::PopUpSOAuthorizationSession::abortInternal):
        (WebKit::PopUpSOAuthorizationSession::completeInternal):
        (WebKit::PopUpSOAuthorizationSession::close):
        (WebKit::PopUpSOAuthorizationSession::initSecretWebView):
        * UIProcess/Cocoa/SOAuthorization/RedirectSOAuthorizationSession.h: Copied from Tools/TestWebKitAPI/Tests/WebKitCocoa/TestLoadOptimizer.mm.
        * UIProcess/Cocoa/SOAuthorization/RedirectSOAuthorizationSession.mm: Added.
        (WebKit::RedirectSOAuthorizationSession::RedirectSOAuthorizationSession):
        (WebKit::RedirectSOAuthorizationSession::fallBackToWebPathInternal):
        (WebKit::RedirectSOAuthorizationSession::abortInternal):
        (WebKit::RedirectSOAuthorizationSession::completeInternal):
        (WebKit::RedirectSOAuthorizationSession::beforeStart):
        * UIProcess/Cocoa/SOAuthorization/SOAuthorizationCoordinator.h: Copied from Tools/TestWebKitAPI/Tests/WebKitCocoa/TestLoadOptimizer.mm.
        * UIProcess/Cocoa/SOAuthorization/SOAuthorizationCoordinator.mm: Added.
        (WebKit::SOAuthorizationCoordinator::SOAuthorizationCoordinator):
        (WebKit::SOAuthorizationCoordinator::canAuthorize const):
        (WebKit::SOAuthorizationCoordinator::tryAuthorize):
        * UIProcess/Cocoa/SOAuthorization/SOAuthorizationNSURLExtras.h: Copied from Tools/TestWebKitAPI/Tests/WebKitCocoa/TestLoadOptimizer.mm.
        * UIProcess/Cocoa/SOAuthorization/SOAuthorizationNSURLExtras.mm: Copied from Tools/TestWebKitAPI/Tests/WebKitCocoa/TestLoadOptimizer.mm.
        (+[NSURL _web_canPerformAuthorizationWithURL:]):
        * UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.h: Added.
        (WebKit::SOAuthorizationSession::page const):
        (WebKit::SOAuthorizationSession::state const):
        (WebKit::SOAuthorizationSession::setState):
        (WebKit::SOAuthorizationSession::navigationAction):
        * UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm: Added.
        (WebKit::SOAuthorizationSession::SOAuthorizationSession):
        (WebKit::SOAuthorizationSession::~SOAuthorizationSession):
        (WebKit::SOAuthorizationSession::releaseNavigationAction):
        (WebKit::SOAuthorizationSession::becomeCompleted):
        (WebKit::SOAuthorizationSession::shouldStart):
        (WebKit::SOAuthorizationSession::start):
        (WebKit::SOAuthorizationSession::fallBackToWebPath):
        (WebKit::SOAuthorizationSession::abort):
        (WebKit::SOAuthorizationSession::complete):
        (WebKit::SOAuthorizationSession::presentViewController):
        (WebKit::SOAuthorizationSession::dismissViewController):
        * UIProcess/Cocoa/SOAuthorization/SubFrameSOAuthorizationSession.h: Copied from Tools/TestWebKitAPI/Tests/WebKitCocoa/TestLoadOptimizer.mm.
        * UIProcess/Cocoa/SOAuthorization/SubFrameSOAuthorizationSession.mm: Added.
        (WebKit::SubFrameSOAuthorizationSession::SubFrameSOAuthorizationSession):
        (WebKit::SubFrameSOAuthorizationSession::fallBackToWebPathInternal):
        (WebKit::SubFrameSOAuthorizationSession::abortInternal):
        (WebKit::SubFrameSOAuthorizationSession::completeInternal):
        (WebKit::SubFrameSOAuthorizationSession::beforeStart):
        (WebKit::SubFrameSOAuthorizationSession::loadDataToFrame):
        (WebKit::SubFrameSOAuthorizationSession::postDidCancelMessageToParent):
        * UIProcess/Cocoa/SOAuthorization/WKSOAuthorizationDelegate.h: Renamed from Tools/TestWebKitAPI/Tests/WebKitCocoa/TestLoadOptimizer.mm.
        * UIProcess/Cocoa/SOAuthorization/WKSOAuthorizationDelegate.mm: Added.
        (-[WKSOAuthorizationDelegate authorization:presentViewController:withCompletion:]):
        (-[WKSOAuthorizationDelegate authorizationDidNotHandle:]):
        (-[WKSOAuthorizationDelegate authorizationDidCancel:]):
        (-[WKSOAuthorizationDelegate authorizationDidComplete:]):
        (-[WKSOAuthorizationDelegate authorization:didCompleteWithHTTPAuthorizationHeaders:]):
        (-[WKSOAuthorizationDelegate authorization:didCompleteWithHTTPResponse:httpBody:]):
        (-[WKSOAuthorizationDelegate authorization:didCompleteWithError:]):
        (-[WKSOAuthorizationDelegate setSession:]):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
        (WebKit::trySOAuthorization):
        (WebKit::WebPageProxy::createNewPage):
        (WebKit::tryOptimizingLoad): Deleted.
        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::setShouldSuppressSOAuthorizationInAllNavigationPolicyDecision):
        (WebKit::WebPageProxy::setShouldSuppressSOAuthorizationInNextNavigationPolicyDecision):
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::WebsiteDataStore):
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        (WebKit::WebsiteDataStore::soAuthorizationCoordinator):
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeProcess):

2019-06-17  Tim Horton  <timothy_horton@apple.com>

        Fix the build.

        * UIProcess/Gamepad/ios/UIGamepadProviderIOS.mm:
        (WebKit::UIGamepadProvider::platformWebPageProxyForGamepadInput):
        * UIProcess/_WKTouchEventGenerator.mm:
        (-[_WKTouchEventGenerator _sendHIDEvent:]):
        (-[_WKTouchEventGenerator _sendMarkerHIDEventWithCompletionBlock:]):

2019-06-17  Dan Bernstein  <mitz@apple.com>

        REGRESSION (r242686): Paths in XPC services’ LC_DYLD_ENVIRONMENT are incorrect in built products directory
        https://bugs.webkit.org/show_bug.cgi?id=198904

        Reviewed by Alex Christensen.

        After r242686, in local builds, the XPC service executables run from their location at the
        top of the built products directory, rather than inside the framework.

        * Configurations/BaseXPCService.xcconfig: Updated the load commands that set
          DYLD_FRAMEWORK_PATH and DYLD_LIBRARY_PATH for the new location in the built products
          directory. Also removed WK_XPC_SERVICE_INSERT_LIBRARIES_DIR that had been unused.

        * WebKit.xcodeproj/project.pbxproj: Made the creation of symbolic links inside the
          framework’s XPCServices directory predicated on whether this is an install build, rather
          than on the build configuration, for consistency with the condition used in the .xcconfig.

2019-06-17  Brent Fulgham  <bfulgham@apple.com>

        Ensure ITP state is relayed to Network Process on restart
        https://bugs.webkit.org/show_bug.cgi?id=198797
        <rdar://problem/51646944>

        Reviewed by Youenn Fablet.

        Now that the ITP state is maintained in the Network Process, we have to make sure that we update
        that process with current ITP state if the Network Process crashes and is relaunched. This wasn't a
        problem in earlier releases because we tracked all ITP state in the UIProcess.

        This patch does the following:
        1. Add a new method to WKWebsiteDataStore to allow us to trigger statistics processing, which has the
           side effect of syncing ITP state persistently so that it will be available after bouncing the process.
        2. Adds a new test that sets a tracking domain, bounces the process, and confirms the state is still
           consistent.

        Tested by TestWebKitAPI.

        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
        (WebKit::ResourceLoadStatisticsStore::processStatisticsAndDataRecords):
        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _clearPrevalentDomain:completionHandler:]):
        (-[WKWebsiteDataStore _processStatisticsAndDataRecords:]):
        * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):
        (WebKit::WebProcessPool::setResourceLoadStatisticsEnabled):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):

2019-06-17  Ludovico de Nittis  <ludovico.denittis@collabora.com>

        [GTK] Stop accessing GdkEvent fields when possible
        https://bugs.webkit.org/show_bug.cgi?id=198829

        Reviewed by Michael Catanzaro.

        Direct access to GdkEvent structs is no longer possible in GTK 4.

        * Shared/gtk/WebEventFactory.cpp:
        (WebKit::buttonForEvent):
        (WebKit::WebEventFactory::createWebMouseEvent):
        (WebKit::WebEventFactory::createWebWheelEvent):
        (WebKit::WebEventFactory::createWebKeyboardEvent):
        (WebKit::WebEventFactory::createWebTouchEvent):
        * UIProcess/API/gtk/WebKitEmojiChooser.cpp:
        * UIProcess/API/gtk/WebKitScriptDialogImpl.cpp:
        (webkitScriptDialogImplKeyPressEvent):
        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (ClickCounter::currentClickCountForGdkButtonEvent):
        (webkitWebViewBaseKeyPressEvent):
        (webkitWebViewBaseHandleMouseEvent):
        (webkitWebViewBaseCrossingNotifyEvent):
        (webkitWebViewBaseGetTouchPointsForEvent):
        (webkitWebViewBaseTouchEvent):
        (webkitWebViewBaseEvent):
        * UIProcess/gtk/GestureController.cpp:
        (WebKit::GestureController::handleEvent):
        * UIProcess/gtk/InputMethodFilter.cpp:
        (WebKit::InputMethodFilter::filterKeyEvent):
        (WebKit::InputMethodFilter::logHandleKeyboardEventForTesting):
        (WebKit::InputMethodFilter::logHandleKeyboardEventWithCompositionResultsForTesting):
        * UIProcess/gtk/KeyBindingTranslator.cpp:
        (WebKit::KeyBindingTranslator::commandsForKeyEvent):
        * UIProcess/gtk/ViewGestureControllerGtk.cpp:
        (WebKit::isEventStop):
        (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanInfluenceSwipe):
        (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventGetScrollingDeltas):
        (WebKit::ViewGestureController::SwipeProgressTracker::handleEvent):
        * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
        (WebKit::WebPopupMenuProxyGtk::treeViewButtonReleaseEventCallback):
        (WebKit::WebPopupMenuProxyGtk::keyPressEventCallback):

2019-06-17  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Update OptionsGTK.cmake and NEWS for 2.25.2 release

        * gtk/NEWS: Add release notes for 2.25.2.

2019-06-17  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed, rolling out r246467.

        It broke scrolling with mouse wheel

        Reverted changeset:

        "[GTK] Stop accessing GdkEvent fields when possible"
        https://bugs.webkit.org/show_bug.cgi?id=198829
        https://trac.webkit.org/changeset/246467

2019-06-16  Darin Adler  <darin@apple.com>

        Rename AtomicString to AtomString
        https://bugs.webkit.org/show_bug.cgi?id=195276

        Reviewed by Michael Catanzaro.

        * many files: Let do-webcore-rename do the renaming.

2019-06-16  Simon Fraser  <simon.fraser@apple.com>

        Implement ScrollableArea::scrollOffset()
        https://bugs.webkit.org/show_bug.cgi?id=198895

        Reviewed by Antti Koivisto.

        * UIProcess/win/WebPopupMenuProxyWin.cpp:
        (WebKit::PopupMenuWin::scrollPosition const):
        (WebKit::WebPopupMenuProxyWin::onKeyDown): Just use m_scrollOffset.
        (WebKit::WebPopupMenuProxyWin::scrollSize const): Deleted.
        * UIProcess/win/WebPopupMenuProxyWin.h: Remove the one-axis scrollOffset()
        * WebProcess/Plugins/PDF/PDFPlugin.h:
        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit::PDFPlugin::scrollSize const): Deleted.
        (WebKit::PDFPlugin::scrollOffset const): Deleted.
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
        (WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):

2019-06-15  Youenn Fablet  <youenn@apple.com>

        WebProcessPool::clearWebProcessHasUploads cannot assume its given processIdentifier is valid
        https://bugs.webkit.org/show_bug.cgi?id=198865

        Unreviewed.

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::clearWebProcessHasUploads):
        Remove wrong debug assertion in case of WebProcessProxy destruction.

2019-06-15  Ludovico de Nittis  <ludovico.denittis@collabora.com>

        [GTK] Stop accessing GdkEvent fields when possible
        https://bugs.webkit.org/show_bug.cgi?id=198829

        Reviewed by Michael Catanzaro.

        Direct access to GdkEvent structs is no longer possible in GTK 4.

        * Shared/gtk/WebEventFactory.cpp:
        (WebKit::buttonForEvent):
        (WebKit::WebEventFactory::createWebMouseEvent):
        (WebKit::WebEventFactory::createWebWheelEvent):
        (WebKit::WebEventFactory::createWebKeyboardEvent):
        (WebKit::WebEventFactory::createWebTouchEvent):
        * UIProcess/API/gtk/WebKitEmojiChooser.cpp:
        * UIProcess/API/gtk/WebKitScriptDialogImpl.cpp:
        (webkitScriptDialogImplKeyPressEvent):
        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (ClickCounter::currentClickCountForGdkButtonEvent):
        (webkitWebViewBaseKeyPressEvent):
        (webkitWebViewBaseHandleMouseEvent):
        (webkitWebViewBaseCrossingNotifyEvent):
        (webkitWebViewBaseGetTouchPointsForEvent):
        (webkitWebViewBaseTouchEvent):
        (webkitWebViewBaseEvent):
        * UIProcess/gtk/GestureController.cpp:
        (WebKit::GestureController::handleEvent):
        * UIProcess/gtk/InputMethodFilter.cpp:
        (WebKit::InputMethodFilter::filterKeyEvent):
        (WebKit::InputMethodFilter::logHandleKeyboardEventForTesting):
        (WebKit::InputMethodFilter::logHandleKeyboardEventWithCompositionResultsForTesting):
        * UIProcess/gtk/KeyBindingTranslator.cpp:
        (WebKit::KeyBindingTranslator::commandsForKeyEvent):
        * UIProcess/gtk/ViewGestureControllerGtk.cpp:
        (WebKit::isEventStop):
        (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanInfluenceSwipe):
        (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventGetScrollingDeltas):
        (WebKit::ViewGestureController::SwipeProgressTracker::handleEvent):
        * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
        (WebKit::WebPopupMenuProxyGtk::treeViewButtonReleaseEventCallback):
        (WebKit::WebPopupMenuProxyGtk::keyPressEventCallback):

2019-06-15  Rob Buis  <rbuis@igalia.com>

        Store prefetch redirects in the prefetch cache
        https://bugs.webkit.org/show_bug.cgi?id=197371

        Reviewed by Youenn Fablet.

        Store prefetch redirects in the prefetch cache and use them when
        navigating.

        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::retrieveCacheEntry):
        (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
        (WebKit::NetworkResourceLoader::didFinishWithRedirectResponse):
        * NetworkProcess/NetworkResourceLoader.h:
        * NetworkProcess/cache/PrefetchCache.cpp:
        (WebKit::PrefetchCache::Entry::Entry):
        (WebKit::PrefetchCache::storeRedirect):
        * NetworkProcess/cache/PrefetchCache.h:

2019-06-14  Devin Rousso  <drousso@apple.com>

        waitForNavigationToComplete may be called before WebPageProxy knows it's loading
        https://bugs.webkit.org/show_bug.cgi?id=198741
        <rdar://problem/31164316>

        Reviewed by Joseph Pecoraro.

        There's a potential race in `WebAutomationSession::waitForNavigationToCompleteOnPage` when
        querying for the `WebPageProxy`'s loading state (via `PageLoadingState::isLoading`), in that
        a pending load may be committed _after_ the `WebAutomationSession` checks it's value. This
        makes the automation session think that it isn't loading, so it will continue running
        commands, which can lead to a JavaScript error ("Callback was not called before the unload
        event") as any injected scripts will be cleared by the impending navigation, leaving the
        script evaluation callbacks "dangling".

        Expose more information from `PageLoadState` about whether it thinks there _may_ be a
        navigation currently happening, which the `WebAutomationSession` can use to delay commands.

        In the best case, no navigations are "missed".

        In the worst case, the automation session will wait `pageLoadTimeout` before continuing.

        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::waitForNavigationToCompleteOnPage):

        * UIProcess/PageLoadState.h:
        * UIProcess/PageLoadState.cpp:
        (WebKit::PageLoadState::hasUncommittedLoad const): Added.

2019-06-14  Youenn Fablet  <youenn@apple.com>

        WebProcessPool::clearWebProcessHasUploads cannot assume its given processIdentifier is valid
        https://bugs.webkit.org/show_bug.cgi?id=198865
        <rdar://problem/51618878>

        Reviewed by Brady Eidson.

        NetworkProcess currently instructs UIProcess whether a given WebProcess is doing upload.
        There is no guarantee though that the WebProcessProxy is still there when the IPC is arriving at UIProcess.
        Instead, let WebProcess handles its upload state and notify WebProcessPool about its state.
        Make sure WebProcessProxy unregisters itself in case of crash.
        In case of NetworkProcess crash, WebProcesses will see all their uploads fail
        and will notify automatically UIProcess to update their state.

        Since the processID given to WebProcessPool is coming from IPC, we cannot not trust it.
        Add early return in case of not finding a WebProcessProxy for WebProcessPool clear/set methods.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * NetworkProcess/NetworkResourceLoadMap.cpp:
        (WebKit::NetworkResourceLoadMap::add):
        (WebKit::NetworkResourceLoadMap::take):
        * NetworkProcess/NetworkResourceLoadMap.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::setWebProcessHasUploads):
        (WebKit::WebProcessPool::clearWebProcessHasUploads):
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::~WebProcessProxy):
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
        (WebKit::WebLoaderStrategy::remove):
        (WebKit::WebLoaderStrategy::tryLoadingSynchronouslyUsingURLSchemeHandler):
        * WebProcess/Network/WebLoaderStrategy.h:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::ensureNetworkProcessConnection):

2019-06-14  Youenn Fablet  <youenn@apple.com>

        WebResourceLoadStatisticsStore should not use its network session if invalidated
        https://bugs.webkit.org/show_bug.cgi?id=198814

        Reviewed by Geoffrey Garen.

        Tell WebResourceLoadStatisticsStore that its network session is invalidated.
        WebResourceLoadStatisticsStore will then clear its reference to the network session.

        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
        (WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlocking):
        Added for test purposes to trigger further cookie processing.
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::invalidateAndCancel):
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::invalidateAndCancel):

2019-06-14  Joseph Pecoraro  <pecoraro@apple.com>

        [Cocoa] NSFileWrapper associated with _WKAttachment
        https://bugs.webkit.org/show_bug.cgi?id=198871
        <rdar://problem/51760625>

        Reviewed by Wenson Hsieh.

        * UIProcess/API/Cocoa/_WKAttachment.mm:
        (-[_WKAttachment dealloc]):
        Ensure we destruct the API::Object associated with this so RetainPtrs can release.

2019-06-14  Tim Horton  <timothy_horton@apple.com>

        WebKit's NSAttributedString.h is not included in the WebKit.h umbrella header
        https://bugs.webkit.org/show_bug.cgi?id=198869
        <rdar://problem/51754437>

        Reviewed by Timothy Hatcher.

        * Shared/API/Cocoa/WebKit.h:
        Make the new API available to modularized clients and folks who just import WebKit.h

2019-06-14  Jiewen Tan  <jiewen_tan@apple.com>

        Disable AppSSO for web processes and plugin processes
        https://bugs.webkit.org/show_bug.cgi?id=198843
        <rdar://problem/51642920>

        Reviewed by Sam Weinig.

        This patch moves the disabling of AppSSO from AuxiliaryProcess to PluginProcess
        and WebProcess such that NetworkingProcess will not be affected.

        * PluginProcess/mac/PluginProcessMac.mm:
        (WebKit::PluginProcess::platformInitializePluginProcess):
        * Shared/ios/AuxiliaryProcessIOS.mm:
        (WebKit::AuxiliaryProcess::platformInitialize):
        * Shared/mac/AuxiliaryProcessMac.mm:
        (WebKit::AuxiliaryProcess::platformInitialize):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeProcess):

2019-06-14  Megan Gardner  <megan_gardner@apple.com>

        Move Synthetic Editing Commands to behind an experimental feature flag
        https://bugs.webkit.org/show_bug.cgi?id=198842
        <rdar://problem/50594700>

        Reviewed by Simon Fraser.

        Add a feature flag to gate synthetic editing commands.

        * Shared/WebPreferences.yaml:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::getFocusedElementInformation):

2019-06-13  Megan Gardner  <megan_gardner@apple.com>

        Fix selection hang in Mail
        https://bugs.webkit.org/show_bug.cgi?id=198845
        <rdar://problem/51388180>

        Reviewed by Tim Horton.

        SelectionDidChange requires a selectionWillChange in order to keep things in line.

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

2019-06-13  Tim Horton  <timothy_horton@apple.com>

        No content shows up for WKWebView while locked even with _canShowWhileLocked is YES
        https://bugs.webkit.org/show_bug.cgi?id=198819
        <rdar://problem/51636240>

        Reviewed by Simon Fraser.

        * UIProcess/Cocoa/WebPageProxyCocoa.mm:
        (WebKit::WebPageProxy::didCreateContextForVisibilityPropagation):
        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::contextIDForVisibilityPropagation const):
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/WebProcessProxy.h:
        (WebKit::WebProcessProxy::contextIDForVisibilityPropagation): Deleted.
        * UIProcess/WebProcessProxy.messages.in:
        * UIProcess/ios/WKContentView.mm:
        (-[WKContentView _setupVisibilityPropagationView]):
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::didCreateContextForVisibilityPropagation): Deleted.
        * UIProcess/ios/WebProcessProxyIOS.mm:
        (WebKit::WebProcessProxy::didCreateContextForVisibilityPropagation): Deleted.
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_shrinkToFitContentTimer):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebProcess.h:
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):
        Move the creation of the visibility propagation context to WebPage instead of WebProcess,
        because canShowWhileLocked is per-page, not per-process.

        Also, pass canShowWhileLocked into the context creation function for the visibility
        propagation context, not just RemoteLayerTree contexts.

2019-06-13  Antoine Quint  <graouts@apple.com>

        "display: contents" Content click does not trigger
        https://bugs.webkit.org/show_bug.cgi?id=198559
        <rdar://problem/51488524>

        Reviewed by Antti Koivisto.

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

2019-06-13  Takashi Komori  <Takashi.Komori@sony.com>

        [curl] Remove member objects of CurlRequest not to share by different threads.
        https://bugs.webkit.org/show_bug.cgi?id=198747

        Reviewed by Fujii Hironori.

        * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
        (WebKit::NetworkDataTaskCurl::curlDidReceiveResponse):
        (WebKit::NetworkDataTaskCurl::curlDidComplete):
        (WebKit::NetworkDataTaskCurl::curlDidFailWithError):
        * NetworkProcess/curl/NetworkDataTaskCurl.h:

2019-06-13  Zan Dobersek  <zdobersek@igalia.com>

        [Nicosia] Add SceneIntegration
        https://bugs.webkit.org/show_bug.cgi?id=198791

        Reviewed by Carlos Garcia Campos.

        Have the LayerTreeHost own the SceneIntegration object that's to be
        associated with layers used inside the LayerTreeHost's scene. The
        class now also inherits the SceneIntegration::Client interface, with the
        requestUpdate() method scheduling a scene update in ThreadedCompositor.

        CompositingCoordinator now retrieves the SceneIntegration object from
        the LayerTreeHost instance and manages association to that object for
        layers under the coordinator's control.

        ThreadedCompositor class gets a new public updateScene() method that
        schedules an update, enabling the SceneIntegration class to invoke
        scene updates.

        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
        (WebKit::ThreadedCompositor::updateScene):
        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
        * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
        (WebKit::CompositingCoordinator::createGraphicsLayer):
        (WebKit::CompositingCoordinator::detachLayer):
        (WebKit::CompositingCoordinator::attachLayer):
        * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
        * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
        (WebKit::LayerTreeHost::LayerTreeHost):
        (WebKit::LayerTreeHost::sceneIntegration):
        (WebKit::LayerTreeHost::requestUpdate):
        * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h:

2019-06-13  Ludovico de Nittis  <ludovico.denittis@collabora.com>

        [GTK] gdk_display_get_device_manager and gdk_screen_get_width/height are deprecated
        https://bugs.webkit.org/show_bug.cgi?id=198822

        Reviewed by Carlos Garcia Campos.

        GdkSeat and GdkRectangle should be used, respectively.

        * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
        (WebKit::doMouseEvent):
        (WebKit::doMotionEvent):
        (WebKit::doKeyStrokeEvent):

2019-06-12  Antoine Quint  <graouts@apple.com>

        Show the web page URL when sharing an AR model
        https://bugs.webkit.org/show_bug.cgi?id=198812
        <rdar://problem/48689498>

        Reviewed by Dean Jackson.

        * UIProcess/Cocoa/DownloadClient.mm:
        (WebKit::DownloadClient::didStart):
        * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
        (-[_WKPreviewControllerDataSource initWithMIMEType:originatingPageURL:]):
        (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
        (WebKit::SystemPreviewController::start):
        (-[_WKPreviewControllerDataSource initWithMIMEType:]): Deleted.
        * UIProcess/SystemPreviewController.h:

2019-06-12  Antti Koivisto  <antti@apple.com>

        Try to fix iOS build.

        * NetworkProcess/Downloads/DownloadMap.cpp:

2019-06-12  Youenn Fablet  <youenn@apple.com>

        Use NSURLSession for WebSocket
        https://bugs.webkit.org/show_bug.cgi?id=198568

        Reviewed by Geoffrey Garen.

        Implement socket channel provider on WebProcess level by sending IPC to NetworkProcess.
        On NetworkProcess side, use NSURLSession API to implement the WebSocket functionality. 
        This is a partial implementation:
        - inspector integration is not working.
        - some error cases are not well handled or are not producing the same error messages.
        - some features are not implemented (extensions, subprotocols, handshake authentication challenge, cookie handling...).

        * CMakeLists.txt:
        * DerivedSources-input.xcfilelist:
        * DerivedSources-output.xcfilelist:
        * DerivedSources.make:
        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
        (WebKit::NetworkConnectionToWebProcess::createSocketChannel):
        (WebKit::NetworkConnectionToWebProcess::removeSocketChannel):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::createWebSocketTask):
        * NetworkProcess/NetworkSession.h:
        (WebKit::NetworkSession::removeWebSocketTask):
        (WebKit::NetworkSession::addWebSocketTask):
        * NetworkProcess/NetworkSocketChannel.cpp: Added.
        (WebKit::NetworkSocketChannel::create):
        (WebKit::NetworkSocketChannel::NetworkSocketChannel):
        (WebKit::NetworkSocketChannel::~NetworkSocketChannel):
        (WebKit::NetworkSocketChannel::sendString):
        (WebKit::NetworkSocketChannel::sendData):
        (WebKit::NetworkSocketChannel::finishClosingIfPossible):
        (WebKit::NetworkSocketChannel::close):
        (WebKit::NetworkSocketChannel::didConnect):
        (WebKit::NetworkSocketChannel::didReceiveText):
        (WebKit::NetworkSocketChannel::didReceiveBinaryData):
        (WebKit::NetworkSocketChannel::didClose):
        (WebKit::NetworkSocketChannel::messageSenderConnection const):
        * NetworkProcess/NetworkSocketChannel.h: Added.
        * NetworkProcess/NetworkSocketChannel.messages.in: Added.
        * NetworkProcess/NetworkSocketStream.messages.in:
        * NetworkProcess/WebSocketTask.h: Added.
        (WebKit::WebSocketTask::sendString):
        (WebKit::WebSocketTask::sendData):
        (WebKit::WebSocketTask::close):
        (WebKit::WebSocketTask::cancel):
        (WebKit::WebSocketTask::resume):
        * NetworkProcess/cocoa/NetworkSessionCocoa.h:
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (-[WKNetworkSessionDelegate existingWebSocketTask:]):
        (-[WKNetworkSessionDelegate URLSession:webSocketTask:didOpenWithProtocol:]):
        (-[WKNetworkSessionDelegate URLSession:webSocketTask:didCloseWithCode:reason:]):
        (WebKit::NetworkSessionCocoa::continueDidReceiveChallenge):
        (WebKit::NetworkSessionCocoa::createWebSocketTask):
        (WebKit::NetworkSessionCocoa::addWebSocketTask):
        (WebKit::NetworkSessionCocoa::removeWebSocketTask):
        (WebKit::NetworkSessionCocoa::webSocketDataTaskForIdentifier):
        * NetworkProcess/cocoa/WebSocketTaskCocoa.h: Added.
        * NetworkProcess/cocoa/WebSocketTaskCocoa.mm: Added.
        (WebKit::WebSocketTask::WebSocketTask):
        (WebKit::WebSocketTask::~WebSocketTask):
        (WebKit::WebSocketTask::readNextMessage):
        (WebKit::WebSocketTask::cancel):
        (WebKit::WebSocketTask::resume):
        (WebKit::WebSocketTask::didConnect):
        (WebKit::WebSocketTask::didClose):
        (WebKit::WebSocketTask::sendString):
        (WebKit::WebSocketTask::sendData):
        (WebKit::WebSocketTask::close):
        (WebKit::WebSocketTask::identifier const):
        * Shared/WebPreferences.yaml:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/Network/NetworkProcessConnection.cpp:
        (WebKit::NetworkProcessConnection::didReceiveMessage):
        * WebProcess/Network/WebSocketChannel.cpp: Added.
        (WebKit::WebSocketChannel::create):
        (WebKit::WebSocketChannel::WebSocketChannel):
        (WebKit::WebSocketChannel::~WebSocketChannel):
        (WebKit::WebSocketChannel::messageSenderConnection const):
        (WebKit::WebSocketChannel::messageSenderDestinationID const):
        (WebKit::WebSocketChannel::subprotocol):
        (WebKit::WebSocketChannel::extensions):
        (WebKit::WebSocketChannel::connect):
        (WebKit::WebSocketChannel::send):
        (WebKit::WebSocketChannel::bufferedAmount const):
        (WebKit::WebSocketChannel::close):
        (WebKit::WebSocketChannel::fail):
        (WebKit::WebSocketChannel::disconnect):
        (WebKit::WebSocketChannel::didConnect):
        (WebKit::WebSocketChannel::didReceiveText):
        (WebKit::WebSocketChannel::didReceiveBinaryData):
        (WebKit::WebSocketChannel::didClose):
        (WebKit::WebSocketChannel::didFail):
        (WebKit::WebSocketChannel::networkProcessCrashed):
        * WebProcess/Network/WebSocketChannel.h: Added.
        * WebProcess/Network/WebSocketChannel.messages.in: Added.
        * WebProcess/Network/WebSocketChannelManager.cpp: Added.
        (WebKit::WebSocketChannelManager::createWebSocketChannel):
        (WebKit::WebSocketChannelManager::networkProcessCrashed):
        (WebKit::WebSocketChannelManager::didReceiveMessage):
        * WebProcess/Network/WebSocketChannelManager.h: Added.
        * WebProcess/Network/WebSocketProvider.cpp:
        (WebKit::WebSocketProvider::createWebSocketChannel):
        * WebProcess/Network/WebSocketProvider.h:
        * WebProcess/Network/WebSocketStream.cpp:
        * WebProcess/Network/WebSocketStream.messages.in:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::networkProcessConnectionClosed):
        * WebProcess/WebProcess.h:
        (WebKit::WebProcess::webSocketChannelManager):

2019-06-12  Sihui Liu  <sihui_liu@apple.com>

        Add assertions to help debug crash at WebKit::HistoryEntryDataEncoder::operator<<
        https://bugs.webkit.org/show_bug.cgi?id=198766

        Reviewed by Geoffrey Garen.

        * Shared/SessionState.h:
        (WebKit::FrameState::~FrameState):
        * UIProcess/API/C/WKPage.cpp:
        (WKPageCopySessionState):
        * UIProcess/mac/LegacySessionStateCoding.cpp:
        (WebKit::HistoryEntryDataEncoder::encodeFixedLengthData):
        (WebKit::encodeFrameStateNode):

2019-06-12  Ludovico de Nittis  <ludovico.denittis@collabora.com>

        [GTK] GTK_STOCK_* types have been deprecated since GTK 3.10
        https://bugs.webkit.org/show_bug.cgi?id=198787

        Reviewed by Michael Catanzaro.

        We completely remove the gtkStockIDFromContextMenuAction function in order to get rid of the stock items.
        This function was used only in "createActionIfNeeded" where now we pass a nullptr as a stock_id variable.

        * Shared/glib/WebContextMenuItemGlib.cpp:
        (WebKit::gtkStockIDFromContextMenuAction):

2019-06-12  Brent Fulgham  <bfulgham@apple.com>

        Unreviewed fix after rr246360.

        The current code accidentally calls the completion handler twice.

        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _setPrevalentDomain:completionHandler:]):

2019-06-12  Jiewen Tan  <jiewen_tan@apple.com>

        REGRESSION (r245043) [Mac WK2 Debug] ASSERTION FAILED: m_services.isEmpty() && transports.size() <= maxTransportNumber seen with two http/wpt/webauthn/public-key-credential-* tests
        https://bugs.webkit.org/show_bug.cgi?id=197917
        <rdar://problem/51524958>

        Reviewed by Brent Fulgham.

        This is a race condition that when a new request comes in the middle between the previous one finishes and the clearStateAsync is queued in the main thread.
        Therefore, when the new request starts discovery, it will still see previous request's state.

        To fix this issue, clearState() will be called unconditionally for every request. And a guard is added to clearState() to prevent double clearance.

        * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
        (WebKit::AuthenticatorManager::makeCredential):
        (WebKit::AuthenticatorManager::getAssertion):
        (WebKit::AuthenticatorManager::clearState):

2019-06-12  Brent Fulgham  <bfulgham@apple.com>

        Add mechanism and test case to check if ITP is active
        https://bugs.webkit.org/show_bug.cgi?id=198694
        <rdar://problem/51557704>

        Reviewed by Youenn Fablet.

        Add a new private SPI call on the WebsiteDataStore object that allows test code
        to mark a domain as prevalent, and check the prevalance of a resource. This
        is then used to build a test to confirm ITP is active and working.

        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _setPrevalentDomain:completionHandler:]):
        (-[WKWebsiteDataStore _getIsPrevalentDomain:completionHandler:]):
        * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:

2019-06-12  Wenson Hsieh  <wenson_hsieh@apple.com>

        Many layout tests are failing on iPad simulator due to unexpected viewport dimensions
        https://bugs.webkit.org/show_bug.cgi?id=198789
        <rdar://problem/51595519>

        Reviewed by Simon Fraser.

        Prevent the shrink-to-fit-content timer from activating on layout tests that use the testing viewport
        configuration.

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

2019-06-12  Michael Catanzaro  <mcatanzaro@igalia.com>

        [WPE][GTK] Deprecate WebSQL APIs
        https://bugs.webkit.org/show_bug.cgi?id=195011

        Reviewed by Carlos Garcia Campos.

        * UIProcess/API/glib/WebKitSettings.cpp:
        (webkit_settings_class_init):
        * UIProcess/API/glib/WebKitWebContext.cpp:
        (webkitWebContextConstructed):
        * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
        (webkitWebsiteDataManagerGetProperty):
        (webkit_website_data_manager_class_init):
        * UIProcess/API/gtk/WebKitWebsiteData.h:
        * UIProcess/API/gtk/WebKitWebsiteDataManager.h:
        * UIProcess/API/wpe/WebKitWebsiteData.h:
        * UIProcess/API/wpe/WebKitWebsiteDataManager.h:

2019-06-12  Michael Catanzaro  <mcatanzaro@igalia.com>

        [WPE][GTK] Enable hyperlink auditing
        https://bugs.webkit.org/show_bug.cgi?id=197845

        Reviewed by Carlos Garcia Campos.

        * UIProcess/API/glib/WebKitSettings.cpp:
        (webkit_settings_class_init):

2019-06-12  Ludovico de Nittis  <ludovico.denittis@collabora.com>

        [GTK] gtk_misc_set_alignment is deprecated since GTK 3.14
        https://bugs.webkit.org/show_bug.cgi?id=198785

        Reviewed by Carlos Garcia Campos.

        Replace the deprecated gtk_misc_set_alignment with halign and valign.

        * UIProcess/API/gtk/WebKitAuthenticationDialog.cpp:
        (createLabelWithLineWrap):

2019-06-11  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] Idempotent text autosizing needs to react properly to viewport changes
        https://bugs.webkit.org/show_bug.cgi?id=198736
        <rdar://problem/50591911>

        Reviewed by Zalan Bujtas.

        If idempotent text autosizing is enabled, respond to viewport initial scale changes by forcing a style recalc,
        since the amount by which idempotent text autosizing boosts font sizes depends on the Page's initial scale.

        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::resetIdempotentTextAutosizingIfNeeded):
        (WebKit::WebPage::viewportConfigurationChanged):

2019-06-11  Zalan Bujtas  <zalan@apple.com>

        LayoutTests/fast/events/touch/ios/double-tap-for-double-click* test cases are failing
        https://bugs.webkit.org/show_bug.cgi?id=198764
        <rdar://problem/51035459>

        Reviewed by Wenson Hsieh.

        This patch replaces the existing, _doubleTapGestureRecognizerForDoubleClick based double click handling with a WebProcess based implementation using
        the potentialTapAtPosition/commitPotentialTap infrastructure.

        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:
        * UIProcess/PageClient.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::creationParameters):
        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/PageClientImplIOS.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::doubleTapForDoubleClickDelay):
        (WebKit::PageClientImpl::doubleTapForDoubleClickRadius):
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _ensureNonBlockingDoubleTapGestureRecognizer]):
        (-[WKContentView setupInteraction]):
        (-[WKContentView cleanupInteraction]):
        (-[WKContentView _removeDefaultGestureRecognizers]):
        (-[WKContentView _addDefaultGestureRecognizers]):
        (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
        (-[WKContentView gestureRecognizerShouldBegin:]):
        (-[WKContentView _didStartProvisionalLoadForMainFrame]):
        (-[WKContentView _doubleTapForDoubleClickDelay]):
        (-[WKContentView _doubleTapForDoubleClickRadius]):
        (-[WKContentView _doubleTapRecognizedForDoubleClick:]): Deleted.
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::handleDoubleTapForDoubleClickAtPoint): Deleted.
        * WebProcess/WebPage/WebPage.cpp:
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::handlePotentialDoubleTapForDoubleClickAtPoint):
        (WebKit::WebPage::commitPotentialTap):
        (WebKit::WebPage::handleDoubleTapForDoubleClickAtPoint): Deleted.

2019-06-11  Andy Estes  <aestes@apple.com>

        [Apple Pay] ASSERTION FAILED: m_state == State::Activating under WebPaymentCoordinatorProxy::showPaymentUI
        https://bugs.webkit.org/show_bug.cgi?id=198776
        <rdar://problem/49123795>

        Reviewed by Brian Weinstein.

        It's possible that an active session is aborted before the completion handler passed to
        platformShowPaymentUI() has executed. When that happens, m_state will be Idle even though we
        assert that it is Activating. Fix this by returning early in the platformShowPaymentUI()
        completion handler when m_state is Idle.

        It's not possible to write a layout test for this because MockPaymentCoordinator handles
        showing payment UI directly in the web process, so this code is not executed in layout
        tests. The assertion can be reproduced manually by loading
        https://w3c-test.org/payment-request/payment-is-showing.https.html and clicking the button.

        * Shared/ApplePay/WebPaymentCoordinatorProxy.cpp:
        (WebKit::WebPaymentCoordinatorProxy::showPaymentUI):

2019-06-11  Patrick Griffis  <pgriffis@igalia.com>

        [GTK] Fix a11y support in bubblewrap sandbox
        https://bugs.webkit.org/show_bug.cgi?id=198777

        Reviewed by Michael Catanzaro.

        * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
        (WebKit::bindA11y):

2019-06-11  Timothy Hatcher  <timothy@apple.com>

        Flash when tapping compose button after switching to/from dark mode without restarting Mail.
        https://bugs.webkit.org/show_bug.cgi?id=198769
        rdar://problem/51370037

        Reviewed by Tim Horton.

        Accessing a dynamic color outside a normal UIView choke point without setting
        UITraitCollection.currentTraitCollection first can cause undefined results.
        Use LocalCurrentTraitCollection inside scrollViewBackgroundColor when accessing
        the dynamic system UIColors. Also use systemBackgroundColor instead of white.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (scrollViewBackgroundColor):

2019-06-11  Megan Gardner  <megan_gardner@apple.com>

        Integrate scrollbar gestures for iOS
        https://bugs.webkit.org/show_bug.cgi?id=198767

        Reviewed by Tim Horton.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (_WKGestureRecognizerIsBuiltInScrollViewGestureRecognizer):
        (-[WKContentView gestureRecognizer:canPreventGestureRecognizer:]):

2019-06-11  Timothy Hatcher  <timothy@apple.com>

        Scrollbar can show as white on white in dark mode on iOS.
        https://bugs.webkit.org/show_bug.cgi?id=198772
        rdar://problem/51516743

        Reviewed by Tim Horton.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _updateScrollViewBackground]): Use UIScrollViewIndicatorStyleBlack instead
        of UIScrollViewIndicatorStyleDefault to prevent getting a white scrollbar in dark mode.

2019-06-11  Michael Catanzaro  <mcatanzaro@igalia.com>

        Unreviewed build warning fixes

        Silence -Wunused-variable warning

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

2019-06-11  Simon Fraser  <simon.fraser@apple.com>

        Fix non-internal builds after r246327.

        * Platform/spi/ios/UIKitSPI.h:

2019-06-10  Simon Fraser  <simon.fraser@apple.com>

        Add logging for UI-side compositing hit-testing
        https://bugs.webkit.org/show_bug.cgi?id=198739

        Reviewed by Antti Koivisto.

        Make it easier to debug UI-side compositing hit-testing issues with a UIHitTesting log
        channel, which logs information about the UIView hierarchy, which views are found by
        hit-testing, and what touch-actions apply.

        This log channel can be set by passing the argument '-WebKit2Logging "UIHitTesting"' when
        launching a debug iOS MobileSafari instance.

        * Platform/Logging.h:
        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
        (-[UIView _web_findDescendantViewAtPoint:withEvent:]):
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView hitTest:withEvent:]):
        (-[WKContentView _handleTouchActionsForTouchEvent:]):

2019-06-11  Antti Koivisto  <antti@apple.com>

        REGRESSION (iOS): Can't scroll litter-robot.com checkout form's dropdown menus
        https://bugs.webkit.org/show_bug.cgi?id=198753
        <rdar://problem/51355686>

        Reviewed by Simon Fraser.

        If an element with 'overflow:scroll' also had 'visibility:hidden' or 'pointer-events:none' it would
        capture touches and prevent scrolling of any overlapped scrollers.

        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
        (WebKit::collectDescendantViewsAtPoint):

        Filter out views with 'isUserInteractionEnabled == NO' (set for hidden and pointer-events:none layers).
        This prevents it being considered as the first view hit when determining scrolling relationships.

        (-[UIView _web_findDescendantViewAtPoint:withEvent:]):

        No need to skip here anymore.

2019-06-11  Wenson Hsieh  <wenson_hsieh@apple.com>

        Quotes are always inserted as smart quotes on stackblitz.com, causing compilation errors
        https://bugs.webkit.org/show_bug.cgi?id=198735
        <rdar://problem/51557159>

        Reviewed by Megan Gardner.

        Add a flag in FocusedElementInformation to indicate whether spellchecking is allowed in the focused element.
        If spellchecking is not allowed, then disable smart quotes and dashes, which matches behavior on macOS.

        * Shared/FocusedElementInformation.cpp:
        (WebKit::FocusedElementInformation::encode const):
        (WebKit::FocusedElementInformation::decode):
        * Shared/FocusedElementInformation.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView textInputTraits]):
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::getFocusedElementInformation):

2019-06-11  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Remove option REDIRECTED_XCOMPOSITE_WINDOW
        https://bugs.webkit.org/show_bug.cgi?id=198748

        Reviewed by Žan Doberšek.

        It's unused and untested, we kept that code path only because the redirected window caused performance issues in
        some drivers in embedded devices. Nowadays there are much better solutions for those cases like using WPE port
        or GTK port under wayland instead of X11.

        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
        (WebKit::ThreadedCompositor::create): Remove the ShouldDoFrameSync parameter since it always receives Yes.
        (WebKit::ThreadedCompositor::ThreadedCompositor): Ditto.
        (WebKit::ThreadedCompositor::createGLContext): Remove the code to handle the case of ShouldDoFrameSync being No,
        since it's always Yes.
        (WebKit::ThreadedCompositor::setNativeSurfaceHandleForCompositing): Deleted.
        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (webkitWebViewBaseRealize): Remove the code for !USE(REDIRECTED_XCOMPOSITE_WINDOW).
        (webkitWebViewBaseUnrealize): Ditto.
        (webkitWebViewBaseDraw): acceleratedBackingStore member can't be nullptr now.
        (webkitWebViewBaseEnterAcceleratedCompositingMode): Ditto.
        (webkitWebViewBaseUpdateAcceleratedCompositingMode): Ditto.
        (webkitWebViewBaseExitAcceleratedCompositingMode): Ditto.
        (webkitWebViewBaseMakeGLContextCurrent): Ditto.
        (webkitWebViewBaseDidRelaunchWebProcess): Remove the code for !USE(REDIRECTED_XCOMPOSITE_WINDOW).
        (webkitWebViewBasePageClosed): Ditto.
        (webkitWebViewBaseRenderHostFileDescriptor): acceleratedBackingStore member can't be nullptr now.
        * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp:
        (WebKit::DrawingAreaProxyCoordinatedGraphics::didUpdateBackingStoreState): Remove the code for !USE(REDIRECTED_XCOMPOSITE_WINDOW).
        (WebKit::DrawingAreaProxyCoordinatedGraphics::setNativeSurfaceHandleForCompositing): Deleted.
        (WebKit::DrawingAreaProxyCoordinatedGraphics::destroyNativeSurfaceHandleForCompositing): Deleted.
        * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h:
        * UIProcess/gtk/AcceleratedBackingStore.cpp:
        (WebKit::AcceleratedBackingStore::create): Add an assert to ensure we create an AcceleratedBackingStore.
        * UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
        * UIProcess/gtk/AcceleratedBackingStoreX11.h:
        * UIProcess/gtk/HardwareAccelerationManager.cpp:
        (WebKit::HardwareAccelerationManager::HardwareAccelerationManager): Remove the code for !USE(REDIRECTED_XCOMPOSITE_WINDOW).
        * WebProcess/WebPage/AcceleratedSurface.cpp:
        (WebKit::AcceleratedSurface::create): Add an assert to ensure we create an AcceleratedSurface.
        * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
        (WebKit::DrawingAreaCoordinatedGraphics::enterAcceleratedCompositingMode): Remove the code for !USE(REDIRECTED_XCOMPOSITE_WINDOW).
        (WebKit::DrawingAreaCoordinatedGraphics::setNativeSurfaceHandleForCompositing): Deleted.
        (WebKit::DrawingAreaCoordinatedGraphics::destroyNativeSurfaceHandleForCompositing): Deleted.
        * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h:
        * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
        (WebKit::LayerTreeHost::LayerTreeHost): m_surface can't be nullptr now.
        (WebKit::LayerTreeHost::sizeDidChange): Ditto.
        (WebKit::LayerTreeHost::deviceOrPageScaleFactorChanged): Ditto.
        (WebKit::LayerTreeHost::nativeSurfaceHandleForCompositing): Ditto.
        (WebKit::LayerTreeHost::didDestroyGLContext): Ditto.
        (WebKit::LayerTreeHost::willRenderFrame): Ditto.
        (WebKit::LayerTreeHost::didRenderFrame): Ditto.
        (WebKit::LayerTreeHost::setNativeSurfaceHandleForCompositing): Deleted.
        * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h:
        * WebProcess/WebPage/DrawingArea.h:
        * WebProcess/WebPage/DrawingArea.messages.in:
        * WebProcess/WebPage/WebPage.h:
        (WebKit::WebPage::nativeWindowHandle): Deleted.
        * WebProcess/WebPage/gtk/AcceleratedSurfaceX11.cpp:
        * WebProcess/WebPage/gtk/AcceleratedSurfaceX11.h:

2019-06-11  Michael Catanzaro  <mcatanzaro@igalia.com>

        [WPE][GTK] bubblewrap sandbox should grant access to web extensions directory
        https://bugs.webkit.org/show_bug.cgi?id=198734

        Reviewed by Carlos Garcia Campos.

        * UIProcess/API/glib/WebKitWebContext.cpp:
        (webkit_web_context_set_web_extensions_directory):

2019-06-10  Andy Estes  <aestes@apple.com>

        [iOS] Use PDFKit SPI for taking snapshots when the hosting app is not entitled for global capture
        https://bugs.webkit.org/show_bug.cgi?id=198731
        <rdar://problem/46215174>

        Reviewed by Tim Horton.

        PDFHostViewController renders PDF contents in a view service, and apps are unable to
        snapshot views rendered out-of-process without an entitlement.

        When an app is missing this entitlement and calls WKWebView's
        takeSnapshotWithConfiguration: API when a PDF is displayed, fall back to calling
        PDFHostViewController's snapshotting SPI.

        Testing is blocked by <https://webkit.org/b/175204>.

        * Platform/spi/ios/PDFKitSPI.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
        * UIProcess/Cocoa/WKWebViewContentProvider.h:
        * UIProcess/ios/WKPDFView.mm:
        (+[WKPDFView web_requiresCustomSnapshotting]):
        (-[WKPDFView web_snapshotRectInContentViewCoordinates:snapshotWidth:completionHandler:]):
        * UIProcess/ios/WKSystemPreviewView.mm:
        (+[WKSystemPreviewView web_requiresCustomSnapshotting]):

2019-06-10  Sam Weinig  <weinig@apple.com>

        Remove Dashboard support
        https://bugs.webkit.org/show_bug.cgi?id=198615

        Reviewed by Ryosuke Niwa.

        * Configurations/FeatureDefines.xcconfig:
        * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
        (WKBundleSetUseDashboardCompatibilityMode): Deleted.
        * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
        * WebProcess/InjectedBundle/InjectedBundle.cpp:
        (WebKit::InjectedBundle::setUseDashboardCompatibilityMode): Deleted.
        * WebProcess/InjectedBundle/InjectedBundle.h:
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::annotatedRegionsChanged): Deleted.
        * WebProcess/WebCoreSupport/WebChromeClient.h:

2019-06-10  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] fast/xsl tests are flaky when run after certain viewport shrink-to-fit tests
        https://bugs.webkit.org/show_bug.cgi?id=198699
        <rdar://problem/50501718>

        Reviewed by Simon Fraser.

        Lift logic that sets the "IsKnownToLayOutWiderThanViewport" flag out of resetViewportDefaultConfiguration, and
        into didCommitLoad instead (along with other logic for resetting viewport arguments). The previous method,
        resetViewportDefaultConfiguration, was being triggered very frequently undo didReceiveMobileDocType, causing the
        shrink-to-fit heuristic to sometimes take no effect. The original intention here was simply to reset the flag
        upon page load.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::didCommitLoad):
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::resetViewportDefaultConfiguration):

2019-06-10  Timothy Hatcher  <timothy@apple.com>

        Integrate dark mode support for iOS.
        https://bugs.webkit.org/show_bug.cgi?id=198687
        rdar://problem/51545643

        Reviewed by Tim Horton.

        * Configurations/FeatureDefines.xcconfig:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _effectiveAppearanceIsDark]):
        (-[WKWebView _effectiveAppearanceIsInactive]):
        (-[WKWebView _dynamicUserInterfaceTraitDidChange]):
        * UIProcess/API/Cocoa/WKWebViewInternal.h:
        * UIProcess/ios/PageClientImplIOS.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::effectiveAppearanceIsDark const):
        (WebKit::PageClientImpl::effectiveAppearanceIsInactive const):
        * UIProcess/ios/WKPasswordView.mm:
        (-[WKPasswordView showInScrollView:]):
        (configureScrollView): Deleted.

2019-06-10  Sihui Liu  <sihui_liu@apple.com>

        [WKHTTPCookieStore getAllCookies:] may return duplicate cookies
        https://bugs.webkit.org/show_bug.cgi?id=198635
        <rdar://problem/46010232>

        Reviewed by Ryosuke Niwa.

        When there is no process pool, we store cookies set in memory with HashSet m_pendingCookies of WebsiteDataStore.

        HashSet does not contain duplicate Cookies that are completely identical, but it may contain Cookies that have 
        all the other properties identical other than value. This is not correct because Cookies with same name, domain
        and path should be treated as the same cookie. When a cookie is set via API, we should either insert the 
        cookie into m_pendingCookies if the cookie does not exist, or update the cookie value if it already exists.

        Note that we still use HashSet with CookieHash for m_pendingCookies because in cookie deletion, we only delete 
        cookie when there is a complete match. If some cookie from m_pendingCookies has all other properties the same as
        the cookie specified in the deletion function, but the value is different, it will not be removed.

        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::addPendingCookie):

2019-06-10  Philippe Normand  <pnormand@igalia.com>

        [WPE][Qt] Port to new wpe_fdo_egl_exported_image API
        https://bugs.webkit.org/show_bug.cgi?id=198713

        Reviewed by Carlos Garcia Campos.

        * UIProcess/API/wpe/qt/WPEQtViewBackend.cpp:
        (WPEQtViewBackend::WPEQtViewBackend):
        (WPEQtViewBackend::texture):
        (WPEQtViewBackend::displayImage):
        * UIProcess/API/wpe/qt/WPEQtViewBackend.h:

2019-06-09  Brent Fulgham  <bfulgham@apple.com>

        [iOS] ResourceLoadStatistics state is not properly relayed to the NetworkProcess
        https://bugs.webkit.org/show_bug.cgi?id=198692
        <rdar://problem/51538088>

        Reviewed by Maciej Stachowiak.

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::setResourceLoadStatisticsEnabled): Message the NetworkProcess
        on state change.

2019-06-08  Dean Jackson  <dino@apple.com>

        Drag starting state can get stuck even though the drag has ended
        https://bugs.webkit.org/show_bug.cgi?id=198696
        <rdar://problem/51556045>

        Reviewed by Wenson Hsieh.

        In iOS 13, we're seeing cases of the DragSession not
        correctly ending, and thus leaving m_isStartingDrag in
        an incorrect state. Temporarily force this to be reset
        in ::dragEnded while investigating

        * UIProcess/ios/WKContentViewInteraction.mm: Add some more release logging
        while here.
        (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]):
        (-[WKContentView dragInteraction:item:willAnimateCancelWithAnimator:]):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::dragEnded):

2019-06-08  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] The default application name for user agent when requesting desktop content is still "Mobile/15E148"
        https://bugs.webkit.org/show_bug.cgi?id=198693
        <rdar://problem/51555371>

        Reviewed by Tim Horton.

        Fixes the bug by introducing an applicationNameForDesktopUserAgent member to WebPageProxy. This
        applicationNameForDesktopUserAgent is set alongside the regular applicationNameForUserAgent; however, in the
        case where it is being set via WKWebViewConfiguration, use WKWebViewConfiguration's
        _applicationNameForDesktopUserAgent instead. See below for more details.

        Tested by adding to the existing API test PreferredContentMode.ApplicationNameForDesktopUserAgent.

        * UIProcess/API/APIWebsitePolicies.cpp:
        (API::WebsitePolicies::copy const):
        * UIProcess/API/APIWebsitePolicies.h:

        Drive-by fix: rename applicationNameForUserAgentWithModernCompatibility to applicationNameForDesktopUserAgent in
        a few places.

        * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
        (-[WKBrowsingContextController setApplicationNameForUserAgent:]):
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]):
        (-[WKWebView _setApplicationNameForUserAgent:]):
        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:

        Change _applicationNameForUserAgent into an Optional<RetainPtr<NSString>>. A value of WTF::nullopt allows us to
        know that the default application name should be used (which is different when requesting desktop content).

        (-[WKWebViewConfiguration encodeWithCoder:]):
        (-[WKWebViewConfiguration initWithCoder:]):
        (-[WKWebViewConfiguration copyWithZone:]):
        (-[WKWebViewConfiguration _applicationNameForDesktopUserAgent]):

        Add _applicationNameForDesktopUserAgent to the web view configuration. This behaves like
        applicationNameForUserAgent, with one exception: in the case where the default applicationNameForUserAgent is
        used (i.e. the client has not specified any application name), default to `nil` as the application name for user
        agent, rather than "Mobile/15E148".

        (-[WKWebViewConfiguration applicationNameForUserAgent]):
        (-[WKWebViewConfiguration setApplicationNameForUserAgent:]):
        * UIProcess/API/Cocoa/WKWebViewConfigurationInternal.h:
        * UIProcess/API/Cocoa/WKWebpagePreferences.mm:
        (-[WKWebpagePreferences _applicationNameForUserAgentWithModernCompatibility]):
        (-[WKWebpagePreferences _setApplicationNameForUserAgentWithModernCompatibility:]):
        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::setApplicationNameForDesktopUserAgent):
        (WebKit::WebPageProxy::applicationNameForDesktopUserAgent const):
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::effectiveContentModeAfterAdjustingPolicies):

2019-06-08  Andy Estes  <aestes@apple.com>

        [Apple Pay] If we have a bound interface identifier, set it on new PKPaymentRequests
        https://bugs.webkit.org/show_bug.cgi?id=198690
        <rdar://problem/48041803>

        Reviewed by Tim Horton.

        * NetworkProcess/cocoa/NetworkSessionCocoa.h:
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::boundInterfaceIdentifier const): Implemented a public getter
        for m_boundInterfaceIdentifier.

        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/ios/NetworkConnectionToWebProcessIOS.mm:
        (WebKit::NetworkConnectionToWebProcess::paymentCoordinatorBoundInterfaceIdentifier):
        Implemented an override for paymentCoordinatorBoundInterfaceIdentifier.

        * Shared/ApplePay/WebPaymentCoordinatorProxy.h: Declared
        paymentCoordinatorBoundInterfaceIdentifier for clients to override.

        * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
        (WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest): If the client has a non-empty
        bound interface identifier, set it on the new PKPaymentRequest.

        * UIProcess/WebPageProxy.h:
        * UIProcess/Cocoa/WebPageProxyCocoa.mm:
        (WebKit::WebPageProxy::paymentCoordinatorBoundInterfaceIdentifier): Implemented an override
        for paymentCoordinatorBoundInterfaceIdentifier.

2019-06-07  Antti Koivisto  <antti@apple.com>

        REGRESSION (r245006): Setting scrollview.scrollEnabled clobbers any scrollEnabled set by a client
        https://bugs.webkit.org/show_bug.cgi?id=198656
        <rdar://problem/51494585>

        Reviewed by Tim Horton.

        Allow client to disable scrolling and zooming.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _didCommitLayerTree:]):
        * UIProcess/ios/WKScrollView.h:
        * UIProcess/ios/WKScrollView.mm:
        (-[WKScrollView initWithFrame:]):
        (-[WKScrollView setScrollEnabled:]):
        (-[WKScrollView _setScrollEnabledInternal:]):
        (-[WKScrollView _updateScrollability]):
        (-[WKScrollView setZoomEnabled:]):
        (-[WKScrollView _setZoomEnabledInternal:]):
        (-[WKScrollView _updateZoomability]):

2019-06-07  Wenson Hsieh  <wenson_hsieh@apple.com>

        Allow clients to vend custom -inputView and -inputAccessoryView by overriding WKWebView methods
        https://bugs.webkit.org/show_bug.cgi?id=198631
        <rdar://problem/51505431>

        Reviewed by Tim Horton.

        Allow WKWebView API clients to override WKContentView's default input view and/or input accessory view by
        subclassing WKWebView and implementing -inputView or -inputAccessoryView.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView inputAccessoryView]):
        (-[WKWebView inputView]):
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView inputView]):
        (-[WKContentView inputViewForWebView]):
        (-[WKContentView inputAccessoryView]):
        (-[WKContentView inputAccessoryViewForWebView]):

2019-06-07  Tim Horton  <timothy_horton@apple.com>

        Disable focus rings on WKContentView for PLATFORM(IOSMAC)
        https://bugs.webkit.org/show_bug.cgi?id=198685

        Reviewed by Simon Fraser.

        * Platform/spi/ios/UIKitSPI.h:
        * UIProcess/ios/WKContentView.mm:
        (-[WKContentView _commonInitializationWithProcessPool:configuration:]):

2019-06-07  Megan Gardner  <megan_gardner@apple.com>

        Extend quirks to emulate bold/italic/underline in hidden editable areas
        https://bugs.webkit.org/show_bug.cgi?id=198681

        Reviewed by Wenson Hsieh.

        * Shared/FocusedElementInformation.cpp:
        (WebKit::FocusedElementInformation::encode const):
        (WebKit::FocusedElementInformation::decode):
        * Shared/FocusedElementInformation.h:
        * Shared/SyntheticEditingCommandType.h:
        * UIProcess/ios/WKContentView.mm:
        (-[WKContentView undoManager]):
        * UIProcess/ios/WKContentViewInteraction.mm:
        (shouldSynthezieKeyEvents):
        (-[WKContentView toggleBoldfaceForWebView:]):
        (-[WKContentView toggleItalicsForWebView:]):
        (-[WKContentView toggleUnderlineForWebView:]):
        (-[WKContentView _elementDidBlur]):
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::generateSyntheticEditingCommand):
        (WebKit::WebPage::getFocusedElementInformation):

2019-06-05  Alex Christensen  <achristensen@webkit.org>

        Introduce new SPI for context menus on iOS
        https://bugs.webkit.org/show_bug.cgi?id=198590

        Reviewed by Tim Horton.

        Also introduce WKContextMenuElementInfo which is API.
        This is part of <rdar://problem/51003503>

        * Shared/API/APIObject.h:
        * Shared/API/Cocoa/WebKit.h:
        * Shared/Cocoa/APIObject.mm:
        (API::Object::newObject):
        * Sources.txt:
        * SourcesCocoa.txt:
        * UIProcess/API/APIContextMenuElementInfo.cpp: Added.
        (API::ContextMenuElementInfo::ContextMenuElementInfo):
        * UIProcess/API/APIContextMenuElementInfo.h: Added.
        * UIProcess/API/Cocoa/WKContextMenuElementInfo.h: Added.
        * UIProcess/API/Cocoa/WKContextMenuElementInfo.mm: Added.
        (-[WKContextMenuElementInfo linkURL]):
        (-[WKContextMenuElementInfo _apiObject]):
        (-[WKContextMenuElementInfo _activatedElementInfo]):
        * UIProcess/API/Cocoa/WKContextMenuElementInfoInternal.h: Added.
        * UIProcess/API/Cocoa/WKContextMenuElementInfoPrivate.h: Added.
        * UIProcess/API/Cocoa/WKPreviewElementInfo.h:
        * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
        * UIProcess/API/Cocoa/_WKActivatedElementInfo.h:
        * UIProcess/API/Cocoa/_WKActivatedElementInfo.mm:
        (-[_WKActivatedElementInfo _initWithInteractionInformationAtPosition:]):
        (-[_WKActivatedElementInfo isAnimatedImage]):
        * UIProcess/ios/WKActionSheetAssistant.h:
        * UIProcess/ios/WKActionSheetAssistant.mm:
        (-[WKActionSheetAssistant defaultActionsForLinkSheet:]):
        (-[WKActionSheetAssistant defaultActionsForImageSheet:]):
        * UIProcess/ios/WKContentView.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        * WebKit.xcodeproj/project.pbxproj:

2019-06-07  Antoine Quint  <graouts@apple.com>

        Restrict fast clicks everywhere to desktop content mode
        https://bugs.webkit.org/show_bug.cgi?id=198610
        <rdar://problem/50114230>

        Reviewed by Dean Jackson.

        We now set a new allowsFastClicksEverywhere property on the WebPageProxy when the content mode changes, set to true
        when we're in desktop browsing mode. We now check on this property to opt into the fast clicks everywhere behavior.

        This patch had been reverted once because it yielded some regressions in existing tests, notably under
        fast/events/touch/ios/content-observation. This updated patch addresses this by ensuring the gesture recognizers
        used for double-tap-to-zoom are disabled in -[WKContentViewInteraction _didStartProvisionalLoadForMainFrame]
        to ensure that two tests dispatching a tap at the same location don't yield the recognition of a double-tap
        rathern than the recognition of two single taps. 

        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::allowsFastClicksEverywhere const):
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _handleSmartMagnificationInformationForPotentialTap:renderRect:fitEntireRect:viewportMinimumScale:viewportMaximumScale:]):
        (_didStartProvisionalLoadForMainFrame):
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::effectiveContentModeAfterAdjustingPolicies):

2019-06-07  Brent Fulgham  <bfulgham@apple.com>

        [iOS] Update sandboxes to address iokit-get-property errors
        https://bugs.webkit.org/show_bug.cgi?id=198494
        <rdar://problem/51322072> and <rdar://problem/50602737>

        Reviewed by Per Arne Vollan.

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

2019-06-07  Andy Estes  <aestes@apple.com>

        process-swap-on-navigation error when loading blocked website on iOS 12.2 only.
        https://bugs.webkit.org/show_bug.cgi?id=196930
        <rdar://problem/47819301>

        Reviewed by Chris Dumez.

        The ContentFilterDidBlockLoadForFrame message needs to be handled by ProvisionalPageProxy in
        order to look up the blocked frame in the correct WebProcessProxy.

        * UIProcess/Cocoa/WebPageProxyCocoa.mm:
        (WebKit::WebPageProxy::contentFilterDidBlockLoadForFrame):
        (WebKit::WebPageProxy::contentFilterDidBlockLoadForFrameShared):
        * UIProcess/ProvisionalPageProxy.cpp:
        (WebKit::ProvisionalPageProxy::contentFilterDidBlockLoadForFrame):
        (WebKit::ProvisionalPageProxy::didReceiveMessage):
        * UIProcess/ProvisionalPageProxy.h:
        * UIProcess/WebPageProxy.h:

2019-06-07  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Fix api used to release wpe_fdo_egl_exported_image in GTK

        We are using the old deprecated API in AcceleratedBackingStoreWayland::displayBuffer().

        * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
        (WebKit::AcceleratedBackingStoreWayland::displayBuffer):

2019-06-06  Carlos Garcia Campos  <cgarcia@igalia.com>

        REGRESSION(r243094): [GTK][WPE] Stale content after restoring the web view session
        https://bugs.webkit.org/show_bug.cgi?id=198561

        Reviewed by Chris Dumez.

        This is another regression of delaying the web process launch until the first load. If the session is restored
        before anything has been loaded, which is the normal way, the RestoreSession message is just ignored and the
        state is sent to the WebPage on creation via creation parameters. The WebPage considers that restoring a session
        from creation parameters only happens when re-launching a process after a crash or in case of process swap. In
        those cases, the history item is not marked as restored from session. We need to ensure the session is restored
        in the web process from the IPC message handler, by launching the initial process before the session is
        restored.

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

2019-06-06  Youenn Fablet  <youenn@apple.com>

        Use an enumeration in UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo callback
        https://bugs.webkit.org/show_bug.cgi?id=198548

        Reviewed by Eric Carlson.

        Move from an Optional<bool> to an enum having three values to ease readability.

        * UIProcess/UserMediaPermissionCheckProxy.cpp:
        (WebKit::UserMediaPermissionCheckProxy::setUserMediaAccessInfo):
        (WebKit::UserMediaPermissionCheckProxy::complete):
        * UIProcess/UserMediaPermissionCheckProxy.h:
        (WebKit::UserMediaPermissionCheckProxy::invalidate):
        * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
        (WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged):
        (WebKit::UserMediaPermissionRequestManagerProxy::startProcessingUserMediaPermissionRequest):
        (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo):
        (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
        * UIProcess/UserMediaPermissionRequestManagerProxy.h:

2019-06-06  Youenn Fablet  <youenn@apple.com>

        Allow WebKitTestRunner to terminate network process after it finishes service worker file operations
        https://bugs.webkit.org/show_bug.cgi?id=198584

        Reviewed by Geoffrey Garen.

        Add IPC binding to new internal API.

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

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

        Unreviewed, rolling out r246165.
        https://bugs.webkit.org/show_bug.cgi?id=198636

        Causing test failures in 7 content-observation tests.
        (Requested by ShawnRoberts on #webkit).

        Reverted changeset:

        "Restrict fast clicks everywhere to desktop content mode"
        https://bugs.webkit.org/show_bug.cgi?id=198610
        https://trac.webkit.org/changeset/246165

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

        Unreviewed, rolling out r246123.
        https://bugs.webkit.org/show_bug.cgi?id=198634

        Causes test failures (Requested by ShawnRoberts on #webkit).

        Reverted changeset:

        "[iOS] Update sandboxes to address iokit-get-property errors"
        https://bugs.webkit.org/show_bug.cgi?id=198494
        https://trac.webkit.org/changeset/246123

2019-06-06  Geoffrey Garen  <ggaren@apple.com>

        Crash using WKHTTPCookieStore when you use WKWebView and UIWebView in the same app
        https://bugs.webkit.org/show_bug.cgi?id=198622

        Reviewed by Chris Dumez.

        Today in a WWDC lab, I saw some crash reports from an app that mixed
        WKWebView and UIWebView. The proximate cause of the crash is that
        WKHTTPCookieStore queues a callOnMainThread function, and then
        UIWebView dequeues it on the WebThread.

        No test because this crash depends on mixing WKWebView and UIWebView and
        getting (un)lucky on the timing.

        * UIProcess/API/APIHTTPCookieStore.cpp:
        (API::HTTPCookieStore::cookies):
        (API::HTTPCookieStore::setCookies):
        (API::HTTPCookieStore::deleteCookie): Avoid using callOnMainThread
        becuase it is prohibited in the UI process.

2019-06-06  Antoine Quint  <graouts@apple.com>

        Remove duplicated websiteDataStoreParameters code from WebsitePoliciesData::applyToDocumentLoader()
        https://bugs.webkit.org/show_bug.cgi?id=198608

        Reviewed by Wenson Hsieh.

        Due to a rebasing error, r244218 re-introduced code that was removed in r244197. This patch removes this code for good.

        * Shared/WebsitePoliciesData.cpp:
        (WebKit::WebsitePoliciesData::applyToDocumentLoader):

2019-06-06  Antoine Quint  <graouts@apple.com>

        Restrict fast clicks everywhere to desktop content mode
        https://bugs.webkit.org/show_bug.cgi?id=198610
        <rdar://problem/50114230>

        Reviewed by Dean Jackson.

        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::allowsFastClicksEverywhere const):
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _handleSmartMagnificationInformationForPotentialTap:renderRect:fitEntireRect:viewportMinimumScale:viewportMaximumScale:]):
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::effectiveContentModeAfterAdjustingPolicies):

2019-06-06  Sihui Liu  <sihui_liu@apple.com>

        NetworkHTTPSUpgradeChecker should construct and destruct database on the background thread
        https://bugs.webkit.org/show_bug.cgi?id=198496

        Reviewed by Chris Dumez.

        * NetworkProcess/NetworkHTTPSUpgradeChecker.cpp:
        (WebKit::NetworkHTTPSUpgradeChecker::NetworkHTTPSUpgradeChecker):
        (WebKit::NetworkHTTPSUpgradeChecker::~NetworkHTTPSUpgradeChecker):
        * NetworkProcess/NetworkHTTPSUpgradeChecker.h:

2019-06-06  Truitt Savell  <tsavell@apple.com>

        Unreviewed, rolling out r246137.

        Broke internal builds.

        Reverted changeset:

        "Introduce new SPI for context menus on iOS"
        https://bugs.webkit.org/show_bug.cgi?id=198590
        https://trac.webkit.org/changeset/246137

2019-06-06  Antti Koivisto  <antti@apple.com>

        Position fixed is buggy with overflow:auto scrolling inside iframes
        https://bugs.webkit.org/show_bug.cgi?id=154399
        <rdar://problem/24742251>

        Reviewed by Frederic Wang and Simon Fraser.

        * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
        (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):

        Remove viewportChangedViaDelegatedScrolling call as we were just relying on its side effect of (partially) applying
        the scrolling tree. Instead call the new applyScrollingTreeLayerPositionsAfterCommit() unconditionally.
        It only does work if there are local deltas to apply.

        Local deltas will potentially need to be applied in non-fixed cases too and it is hard to reason about the conditions.

        * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
        (WebKit::RemoteScrollingCoordinatorProxy::applyScrollingTreeLayerPositionsAfterCommit):
        (WebKit::RemoteScrollingCoordinatorProxy::applyScrollingTreeLayerPositions): Deleted.
        * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:

2019-06-06  Michael Catanzaro  <mcatanzaro@igalia.com>

        [WPE][GTK] Clean up use of initiatingPageID in implementation of webkit_uri_scheme_request_get_web_view()
        https://bugs.webkit.org/show_bug.cgi?id=198564

        Reviewed by Carlos Garcia Campos.

        Note that we have to use RefPtr rather than Ref here because the priv struct has to remain
        default-constructible.

        * UIProcess/API/glib/WebKitURISchemeRequest.cpp:
        (webkitURISchemeRequestCreate):
        (webkit_uri_scheme_request_get_web_view):

2019-06-06  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] Enable PSON
        https://bugs.webkit.org/show_bug.cgi?id=194979

        Reviewed by Žan Doberšek.

        * Shared/WebPreferencesDefaultValues.h:

2019-06-05  Said Abou-Hallawa  <sabouhallawa@apple.com>

        [Cocoa] REGRESSION(r244182): Inspector thinks CA commits can be nested
        https://bugs.webkit.org/show_bug.cgi?id=198497

        Reviewed by Simon Fraser.

        Call InspectorController::willComposite() from the CA preCommit handler
        similar to the call to InspectorController::didComposite() in the CA
        postCommit handler. Ensure these calls will be once for nested commits.

        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
        (WebKit::RemoteLayerTreeDrawingArea::addCommitHandlers):
        (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
        * WebProcess/WebPage/WebPage.h:
        (WebKit::WebPage::firstFlushAfterCommit const):
        (WebKit::WebPage::setFirstFlushAfterCommit):
        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
        (WebKit::TiledCoreAnimationDrawingArea::addCommitHandlers):
        (WebKit::TiledCoreAnimationDrawingArea::flushLayers):

2019-06-05  Alex Christensen  <achristensen@webkit.org>

        Introduce new SPI for context menus on iOS
        https://bugs.webkit.org/show_bug.cgi?id=198590

        Reviewed by Tim Horton.

        Also introduce WKContextMenuElementInfo which is API.
        This is part of <rdar://problem/51003503>

        * Shared/API/APIObject.h:
        * Shared/API/Cocoa/WebKit.h:
        * Shared/Cocoa/APIObject.mm:
        (API::Object::newObject):
        * Sources.txt:
        * SourcesCocoa.txt:
        * UIProcess/API/APIContextMenuElementInfo.cpp: Added.
        (API::ContextMenuElementInfo::ContextMenuElementInfo):
        * UIProcess/API/APIContextMenuElementInfo.h: Added.
        * UIProcess/API/Cocoa/WKContextMenuElementInfo.h: Added.
        * UIProcess/API/Cocoa/WKContextMenuElementInfo.mm: Added.
        (-[WKContextMenuElementInfo linkURL]):
        (-[WKContextMenuElementInfo _apiObject]):
        (-[WKContextMenuElementInfo _activatedElementInfo]):
        * UIProcess/API/Cocoa/WKContextMenuElementInfoInternal.h: Added.
        * UIProcess/API/Cocoa/WKContextMenuElementInfoPrivate.h: Added.
        * UIProcess/API/Cocoa/WKPreviewElementInfo.h:
        * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
        * UIProcess/API/Cocoa/_WKActivatedElementInfo.h:
        * UIProcess/API/Cocoa/_WKActivatedElementInfo.mm:
        (-[_WKActivatedElementInfo _initWithInteractionInformationAtPosition:]):
        (-[_WKActivatedElementInfo isAnimatedImage]):
        * UIProcess/ios/WKActionSheetAssistant.h:
        * UIProcess/ios/WKActionSheetAssistant.mm:
        (-[WKActionSheetAssistant defaultActionsForLinkSheet:]):
        (-[WKActionSheetAssistant defaultActionsForImageSheet:]):
        * UIProcess/ios/WKContentView.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        * WebKit.xcodeproj/project.pbxproj:

2019-06-05  Jer Noble  <jer.noble@apple.com>

        -[WKWebView _suspendAllMediaPlayback] does not persist across navigation.
        https://bugs.webkit.org/show_bug.cgi?id=198585

        Reviewed by Chris Dumez.

        Add a new WebPageCreationParameters entry for mediaPlaybackIsSuspended, and pass
        that value across during WebPage creation.

        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::suspendAllMediaPlayback):
        (WebKit::WebPageProxy::resumeAllMediaPlayback):
        (WebKit::WebPageProxy::creationParameters):
        * UIProcess/WebPageProxy.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage):

2019-06-05  Sihui Liu  <sihui_liu@apple.com>

        TestWebKitAPI.WKWebView.LocalStorageProcessSuspends is flaky on release builds
        https://bugs.webkit.org/show_bug.cgi?id=198582

        Reviewed by Youenn Fablet.

        Initialize the state of StorageManager.

        * NetworkProcess/WebStorage/StorageManager.h:

2019-06-05  Alex Christensen  <achristensen@webkit.org>

        Re-enable safe browsing in WKWebView
        https://bugs.webkit.org/show_bug.cgi?id=196161
        <rdar://problem/49171413>

        Reviewed by Ryosuke Niwa.

        This is mostly just reverting r241728.

        * Shared/WebPreferences.yaml:
        * UIProcess/API/Cocoa/WKPreferences.h:
        * UIProcess/API/Cocoa/WKPreferences.mm:
        (-[WKPreferences setSafeBrowsingEnabled:]):
        (-[WKPreferences isSafeBrowsingEnabled]):

2019-06-05  Alex Christensen  <achristensen@webkit.org>

        Progress towards resurrecting Mac CMake build
        https://bugs.webkit.org/show_bug.cgi?id=197132

        Reviewed by Don Olmstead.

        * PlatformMac.cmake:

2019-06-05  Youenn Fablet  <youenn@apple.com>

        Remove logSiteIdentifier from UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame
        https://bugs.webkit.org/show_bug.cgi?id=198575

        Reviewed by Eric Carlson.

        * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
        (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):

== Rolled over to ChangeLog-2019-06-05 ==