haikuwebkit/Source/WebCore/SourcesCocoa.txt

601 lines
26 KiB
Plaintext
Raw Permalink Normal View History

// Copyright (C) 2017-2020 Apple Inc. All rights reserved.
Setup WebCore build to start using unified sources. https://bugs.webkit.org/show_bug.cgi?id=178362 Reviewed by Tim Horton. .: Pass features to the unified source bundler script. * Source/cmake/WebKitCommon.cmake: * Source/cmake/WebKitFeatures.cmake: * Source/cmake/WebKitMacros.cmake: Source/JavaScriptCore: Change comments in source list files. Also, pass explicit names for build files. * CMakeLists.txt: * PlatformGTK.cmake: * PlatformMac.cmake: * Sources.txt: * SourcesGTK.txt: * SourcesMac.txt: Source/WebCore: This patch adds all the long tooling needed to start adding unified sources to WebCore. Most of the source list files are empty to start but will be filled over the next few days. I started by moving all the non-derived bindings code to unified sources to make sure everything worked correctly. * CMakeLists.txt: * Configurations/GenerateUnifiedSources.xcconfig: Added. * Configurations/WebCore.xcconfig: * PlatformMac.cmake: * Sources.txt: Added. * SourcesCocoa.txt: Added. * SourcesIOS.txt: Added. * SourcesMac.txt: Added. * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSMediaStreamCapabilitiesCustom.cpp: Removed. No one seems to use this... Source/WTF: There are a number of changes to the bundler script. First, it is now possible to enable or disable building files based on if the associated feature flag is enabled or not. The syntax for this is similar to how we do #ifs in C++ code. e.g. #if ENABLE_APPLE_PAY myApplePayFile.cpp #endif would enable myApplePayFile.cpp if and only if the APPLE_PAY feature define is set. I also changed comments from # to // to make it less likely they would be confused with a #if. Finally, this patch enables bundling files in the same relative directory across source list files. Previously, if SourcesCocoa.txt had platform/cf/foo.cpp and SourcesMac.txt had platform/cf/bar.cpp those files would not be put in the same unified source bundle. Now, those files will be put into the same bundle but bar.cpp will always follow foo.cpp. The idea is that by putting more specific files after more general files we can avoid random build failures. * Scripts/generate-unified-source-bundles.rb: Canonical link: https://commits.webkit.org/194673@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223621 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-10-18 19:14:51 +00:00
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
// BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
// THE POSSIBILITY OF SUCH DAMAGE.
JSApplePayCancelEvent.cpp
JSApplePayContactField.cpp
[Payment Request] upstream new features https://bugs.webkit.org/show_bug.cgi?id=226740 <rdar://problem/78963132> Reviewed by Andy Estes. Source/WebCore: - recurring line items (`HAVE_PASSKIT_RECURRING_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_RECURRING_LINE_ITEM`) - deferred line items (`HAVE_PASSKIT_DEFERRED_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_DEFERRED_LINE_ITEM`) - estimated shipping dates (`HAVE_PASSKIT_SHIPPING_METHOD_DATE_COMPONENTS_RANGE` and `ENABLE_APPLE_PAY_SHIPPING_METHOD_DATE_COMPONENTS_RANGE`) - coupon code entry (`HAVE_PASSKIT_COUPON_CODE` and `ENABLE_APPLE_PAY_COUPON_CODE`) - shipped vs in-store pickup (`HAVE_PASSKIT_SHIPPING_CONTACT_EDITING_MODE` and `ENABLE_APPLE_PAY_SHIPPING_CONTACT_EDITING_MODE`) Tests: http/tests/paymentrequest/ApplePayModifier-additionalLineItems.https.html http/tests/paymentrequest/ApplePayModifier-additionalShippingMethods.https.html http/tests/paymentrequest/ApplePayModifier-total.https.html http/tests/paymentrequest/paymentmethodchange-couponCode.https.html http/tests/paymentrequest/paymentrequest-couponCode.https.html http/tests/paymentrequest/paymentrequest-shippingContactEditingMode.https.html http/tests/paymentrequest/paymentrequest-supportsCouponCode.https.html * Modules/applepay/ApplePayCouponCodeUpdate.idl: Copied from Source/WebCore/Modules/applepay/ApplePayPaymentMethodModeUpdate.idl. * Modules/applepay/ApplePayCouponCodeUpdate.h: Renamed from Source/WebCore/Modules/applepay/ApplePayPaymentMethodModeUpdate.h. (WebCore::ApplePayCouponCodeUpdate::encode const): (WebCore::ApplePayCouponCodeUpdate::decode): Object used to update the payment request via `ApplePaySession.prototype.completeCouponCodeChange` when responding to the user modifying the coupon code. * Modules/applepay/ApplePayErrorCode.idl: * Modules/applepay/ApplePayErrorCode.h: Add `"couponCodeInvalid"` and `"couponCodeExpired"`. * Modules/applepay/ApplePayLineItem.idl: * Modules/applepay/ApplePayLineItem.h: (WebCore::ApplePayLineItem::encode const): (WebCore::ApplePayLineItem::decode): * Modules/applepay/ApplePayPaymentTiming.idl: Added. * Modules/applepay/ApplePayPaymentTiming.h: Added. * Modules/applepay/ApplePayRecurringPaymentDateUnit.idl: Added. * Modules/applepay/ApplePayRecurringPaymentDateUnit.h: Added. Add members that indicate whether this line item is immediate, recurring, or deferred. Depending on that timing, additional members are added for further configuration (e.g. the start and/or end date of a recurring payment, it's frequency, etc.). * Modules/applepay/ApplePayShippingMethod.idl: * Modules/applepay/ApplePayShippingMethod.h: (WebCore::ApplePayShippingMethod::encode const): (WebCore::ApplePayShippingMethod::decode): * Modules/applepay/ApplePayDateComponentsRange.idl: Added. * Modules/applepay/ApplePayDateComponentsRange.h: Added. (WebCore::ApplePayDateComponentsRange::encode const): (WebCore::ApplePayDateComponentsRange::decode): * Modules/applepay/ApplePayDateComponents.idl: Added. * Modules/applepay/ApplePayDateComponents.h: Added. (WebCore::ApplePayDateComponents::encode const): (WebCore::ApplePayDateComponents::decode): Add members that can be used to indicate the estimated shipping dates for this shipping method. * Modules/applepay/ApplePayRequestBase.idl: * Modules/applepay/ApplePayRequestBase.h: * Modules/applepay/ApplePayRequestBase.cpp: (WebCore::convertAndValidate): * Modules/applepay/ApplePaySessionPaymentRequest.h: (WebCore::ApplePaySessionPaymentRequest::supportsCouponCode const): Added. (WebCore::ApplePaySessionPaymentRequest::setSupportsCouponCode): Added. (WebCore::ApplePaySessionPaymentRequest::couponCode const): Added. (WebCore::ApplePaySessionPaymentRequest::setCouponCode): Added. (WebCore::ApplePaySessionPaymentRequest::shippingContactEditingMode const): Added. (WebCore::ApplePaySessionPaymentRequest::setShippingContactEditingMode): Added. * Modules/applepay/ApplePayShippingContactEditingMode.idl: Added. * Modules/applepay/ApplePayShippingContactEditingMode.h: Added. Add members that indicate: - whether this payment request supports a coupon code at all - the initial coupon code (assuming the above) - whether this payment request allows editing the shipping contact (i.e. in-store pickup does not) * dom/EventNames.h: * dom/EventNames.in: * Modules/applepay/ApplePayCouponCodeChangedEvent.idl: Added. * Modules/applepay/ApplePayCouponCodeChangedEvent.h: Added. * Modules/applepay/ApplePayCouponCodeChangedEvent.cpp: Added. (WebCore::ApplePayCouponCodeChangedEvent::ApplePayCouponCodeChangedEvent): (WebCore::ApplePayCouponCodeChangedEvent::eventInterface const): Add a `"couponcodechange"` event that is dispatched whenever the user modifies the coupon code for an `ApplePaySession`. * Modules/applepay/ApplePayCouponCodeDetails.idl: Copied from Source/WebCore/Modules/applepay/ApplePayPaymentMethodModeDetails.idl. * Modules/applepay/ApplePayCouponCodeDetails.h: Copied from Source/WebCore/Modules/applepay/ApplePayPaymentMethodModeUpdate.idl. Used as the `object methodData` when a `PaymentMethodChangeEvent` is dispatched for a `PaymentRequest`. * Modules/applepay/ApplePaySession.idl: * Modules/applepay/ApplePaySession.h: * Modules/applepay/ApplePaySession.cpp: (WebCore::convertAndValidate): (WebCore::ApplePaySession::completeCouponCodeChange): Added. (WebCore::ApplePaySession::didChangeCouponCode): Renamed from `WebCore::ApplePaySession::didChangePaymentMethodMode`. (WebCore::ApplePaySession::canSuspendWithoutCanceling const): (WebCore::ApplePaySession::canBegin const): (WebCore::ApplePaySession::canAbort const): (WebCore::ApplePaySession::canCancel const): (WebCore::ApplePaySession::canCompleteShippingMethodSelection const): (WebCore::ApplePaySession::canCompleteShippingContactSelection const): (WebCore::ApplePaySession::canCompletePaymentMethodSelection const): (WebCore::ApplePaySession::canCompleteCouponCodeChange const): Renamed from `WebCore::ApplePaySession::canCompletePaymentMethodModeChange const`. (WebCore::ApplePaySession::canCompletePayment const): (WebCore::ApplePaySession::isFinalState const): * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h: * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp: (WebCore::ApplePayPaymentHandler::paymentMethodUpdated): (WebCore::ApplePayPaymentHandler::didChangeCouponCode): Renamed from `WebCore::ApplePayPaymentHandler::didChangePaymentMethodMode`. Add methods for JS to call and state logic to handle coupon code changes. * Modules/applepay/PaymentCoordinator.h: * Modules/applepay/PaymentCoordinator.cpp: (WebCore::PaymentCoordinator::completeCouponCodeChange): Renamed from `WebCore::PaymentCoordinator::completePaymentMethodModeChange`. (WebCore::PaymentCoordinator::didChangeCouponCode): Renamed from `WebCore::PaymentCoordinator::didChangePaymentMethodMode`. * Modules/applepay/PaymentCoordinatorClient.h: * loader/EmptyClients.cpp: (WebCore::EmptyPaymentCoordinatorClient::completeCouponCodeChange): Renamed from `WebCore::EmptyPaymentCoordinatorClient::completePaymentMethodModeChange`. Plumbing up to WebKit. * Modules/applepay/cocoa/PaymentSummaryItemsCocoa.mm: (WebCore::toDate): Added. (WebCore::toCalendarUnit): Added. (WebCore::toPKPaymentSummaryItem): Convert WebCore objects to PassKit objects. * testing/MockPaymentCoordinator.idl: * testing/MockPaymentCoordinator.h: * testing/MockPaymentCoordinator.cpp: (WebCore::MockPaymentCoordinator::showPaymentUI): (WebCore::MockPaymentCoordinator::completeCouponCodeChange): Renamed from `WebCore::MockPaymentCoordinator::completePaymentMethodModeChange`. (WebCore::MockPaymentCoordinator::changeCouponCode): Added. * Modules/applepay/cocoa/PaymentAPIVersionCocoa.mm: (WebCore::PaymentAPIVersion::current): * Modules/applepay/PaymentHeaders.h: * Modules/applepay/PaymentSession.h: * Modules/applepay/ApplePayLineItemData.idl: Removed. * Modules/applepay/ApplePayLineItemData.h: Removed. * Modules/applepay/ApplePayShippingMethodData.idl: Removed. * Modules/applepay/ApplePayShippingMethodData.h: Removed. Remove unnecessary base types after r275169. * PlatformMac.cmake: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: Source/WebCore/PAL: - recurring line items (`HAVE_PASSKIT_RECURRING_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_RECURRING_LINE_ITEM`) - deferred line items (`HAVE_PASSKIT_DEFERRED_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_DEFERRED_LINE_ITEM`) - estimated shipping dates (`HAVE_PASSKIT_SHIPPING_METHOD_DATE_COMPONENTS_RANGE` and `ENABLE_APPLE_PAY_SHIPPING_METHOD_DATE_COMPONENTS_RANGE`) - coupon code entry (`HAVE_PASSKIT_COUPON_CODE` and `ENABLE_APPLE_PAY_COUPON_CODE`) - shipped vs in-store pickup (`HAVE_PASSKIT_SHIPPING_CONTACT_EDITING_MODE` and `ENABLE_APPLE_PAY_SHIPPING_CONTACT_EDITING_MODE`) * pal/cocoa/PassKitSoftLink.h: * pal/cocoa/PassKitSoftLink.mm: * pal/spi/cocoa/PassKitSPI.h: Source/WebKit: - recurring line items (`HAVE_PASSKIT_RECURRING_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_RECURRING_LINE_ITEM`) - deferred line items (`HAVE_PASSKIT_DEFERRED_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_DEFERRED_LINE_ITEM`) - estimated shipping dates (`HAVE_PASSKIT_SHIPPING_METHOD_DATE_COMPONENTS_RANGE` and `ENABLE_APPLE_PAY_SHIPPING_METHOD_DATE_COMPONENTS_RANGE`) - coupon code entry (`HAVE_PASSKIT_COUPON_CODE` and `ENABLE_APPLE_PAY_COUPON_CODE`) - shipped vs in-store pickup (`HAVE_PASSKIT_SHIPPING_CONTACT_EDITING_MODE` and `ENABLE_APPLE_PAY_SHIPPING_CONTACT_EDITING_MODE`) * Platform/cocoa/PaymentAuthorizationViewController.mm: (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didChangeCouponCode:handler:]): Added. * Platform/ios/PaymentAuthorizationController.mm: (-[WKPaymentAuthorizationControllerDelegate paymentAuthorizationController:didChangeCouponCode:handler:]): Added. * Platform/cocoa/PaymentAuthorizationPresenter.h: * Platform/cocoa/PaymentAuthorizationPresenter.mm: (WebKit::toPKPaymentErrorCode): (WebKit::PaymentAuthorizationPresenter::completeCouponCodeChange): Renamed from `WebKit::PaymentAuthorizationPresenter::completePaymentMethodModeChange`. * Platform/cocoa/WKPaymentAuthorizationDelegate.h: * Platform/cocoa/WKPaymentAuthorizationDelegate.mm: (-[WKPaymentAuthorizationDelegate completeCouponCodeChange:]): Added. (toDateComponents): Added. (toDateComponentsRange): Added. (toShippingMethod): (-[WKPaymentAuthorizationDelegate _didChangeCouponCode:completion:]): Added. Add plumbing from/to PassKit for coupon code changes. * Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in: * Shared/ApplePay/WebPaymentCoordinatorProxy.h: * Shared/ApplePay/WebPaymentCoordinatorProxy.cpp: (WebKit::WebPaymentCoordinatorProxy::completeCouponCodeChange): Renamed from `WebKit::WebPaymentCoordinatorProxy::completePaymentMethodModeChange`. (WebKit::WebPaymentCoordinatorProxy::presenterDidChangeCouponCode): Renamed from `WebKit::WebPaymentCoordinatorProxy::presenterDidChangePaymentMethodMode`. (WebKit::WebPaymentCoordinatorProxy::canBegin const): (WebKit::WebPaymentCoordinatorProxy::canCancel const): (WebKit::WebPaymentCoordinatorProxy::canCompletePayment const): (WebKit::WebPaymentCoordinatorProxy::canAbort const): * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::toNSDateComponents): Added. (WebKit::toPKDateComponentsRange): Added. (WebKit::toPKShippingMethod): (WebKit::toPKShippingContactEditingMode): Added. (WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest): (WebKit::WebPaymentCoordinatorProxy::platformCompleteCouponCodeChange): Renamed from `WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentMethodModeChange`. Convert PassKit objects to/from WebCore objects. * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder<WebCore::ApplePaySessionPaymentRequest>::encode): (IPC::ArgumentCoder<WebCore::ApplePaySessionPaymentRequest>::decode): * WebProcess/ApplePay/WebPaymentCoordinator.messages.in: * WebProcess/ApplePay/WebPaymentCoordinator.h: * WebProcess/ApplePay/WebPaymentCoordinator.cpp: (WebKit::WebPaymentCoordinator::completeCouponCodeChange): Renamed from `WebKit::WebPaymentCoordinator::completePaymentMethodModeChange`. (WebKit::WebPaymentCoordinator::didChangeCouponCode): Renamed from `WebKit::WebPaymentCoordinator::didChangePaymentMethodMode`. Plumbing into/from WebCore. Source/WebKitLegacy/mac: - recurring line items (`HAVE_PASSKIT_RECURRING_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_RECURRING_LINE_ITEM`) - deferred line items (`HAVE_PASSKIT_DEFERRED_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_DEFERRED_LINE_ITEM`) - estimated shipping dates (`HAVE_PASSKIT_SHIPPING_METHOD_DATE_COMPONENTS_RANGE` and `ENABLE_APPLE_PAY_SHIPPING_METHOD_DATE_COMPONENTS_RANGE`) - coupon code entry (`HAVE_PASSKIT_COUPON_CODE` and `ENABLE_APPLE_PAY_COUPON_CODE`) - shipped vs in-store pickup (`HAVE_PASSKIT_SHIPPING_CONTACT_EDITING_MODE` and `ENABLE_APPLE_PAY_SHIPPING_CONTACT_EDITING_MODE`) * WebCoreSupport/WebPaymentCoordinatorClient.h: * WebCoreSupport/WebPaymentCoordinatorClient.mm: (WebPaymentCoordinatorClient::completeCouponCodeChange): Renamed from `WebPaymentCoordinatorClient::completePaymentMethodModeChange`. Source/WTF: - recurring line items (`HAVE_PASSKIT_RECURRING_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_RECURRING_LINE_ITEM`) - deferred line items (`HAVE_PASSKIT_DEFERRED_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_DEFERRED_LINE_ITEM`) - estimated shipping dates (`HAVE_PASSKIT_SHIPPING_METHOD_DATE_COMPONENTS_RANGE` and `ENABLE_APPLE_PAY_SHIPPING_METHOD_DATE_COMPONENTS_RANGE`) - coupon code entry (`HAVE_PASSKIT_COUPON_CODE` and `ENABLE_APPLE_PAY_COUPON_CODE`) - shipped vs in-store pickup (`HAVE_PASSKIT_SHIPPING_CONTACT_EDITING_MODE` and `ENABLE_APPLE_PAY_SHIPPING_CONTACT_EDITING_MODE`) * wtf/PlatformHave.h: * wtf/PlatformEnableCocoa.h: LayoutTests: * http/tests/paymentrequest/ApplePayModifier-additionalLineItems.https.html: Added. * http/tests/paymentrequest/ApplePayModifier-additionalLineItems.https-expected.txt: Added. * http/tests/paymentrequest/ApplePayModifier-additionalShippingMethods.https.html: Added. * http/tests/paymentrequest/ApplePayModifier-additionalShippingMethods.https-expected.txt: Added. * http/tests/paymentrequest/ApplePayModifier-total.https.html: Added. * http/tests/paymentrequest/ApplePayModifier-total.https-expected.txt: Added. * http/tests/paymentrequest/paymentmethodchange-couponCode.https.html: Added. * http/tests/paymentrequest/paymentmethodchange-couponCode.https-expected.txt: Added. * http/tests/paymentrequest/paymentrequest-couponCode.https.html: Added. * http/tests/paymentrequest/paymentrequest-couponCode.https-expected.txt: Added. * http/tests/paymentrequest/paymentrequest-shippingContactEditingMode.https.html: Added. * http/tests/paymentrequest/paymentrequest-shippingContactEditingMode.https-expected.txt: Added. * http/tests/paymentrequest/paymentrequest-supportsCouponCode.https.html: Added. * http/tests/paymentrequest/paymentrequest-supportsCouponCode.https-expected.txt: Added. * http/tests/ssl/applepay/ApplePayError-expected.txt: * platform/ios-wk2/TestExpectations: * platform/mac-wk2/TestExpectations: Canonical link: https://commits.webkit.org/238613@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278630 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-08 22:15:18 +00:00
JSApplePayCouponCodeChangedEvent.cpp
JSApplePayCouponCodeDetails.cpp
JSApplePayCouponCodeUpdate.cpp
JSApplePayDateComponents.cpp
JSApplePayDateComponentsRange.cpp
[Payment Request] add an `object data` to `PaymentDetailsBase` so that data specific to Apple Pay can be provided https://bugs.webkit.org/show_bug.cgi?id=222002 <rdar://problem/72319946> Reviewed by Tim Horton. Source/WebCore: * Modules/paymentrequest/PaymentDetailsBase.idl: * Modules/paymentrequest/PaymentDetailsBase.h: * Modules/applepay/ApplePayDetailsUpdateBase.idl: Added. * Modules/applepay/ApplePayDetailsUpdateBase.h: Added. (WebCore::ApplePayDetailsUpdateBase::encode const): (WebCore::ApplePayDetailsUpdateBase::decode): (WebCore::ApplePayDetailsUpdateBase::decodeBase): * Modules/applepay/ApplePayPaymentMethodUpdate.h: * Modules/applepay/ApplePayPaymentMethodUpdate.idl: (WebCore::ApplePayPaymentMethodUpdate::encode const): Added. (WebCore::ApplePayPaymentMethodUpdate::decode): Added. * Modules/applepay/ApplePayShippingContactUpdate.idl: * Modules/applepay/ApplePayShippingContactUpdate.h: (WebCore::ApplePayShippingContactUpdate::encode const): Added. (WebCore::ApplePayShippingContactUpdate::decode): Added. * Modules/applepay/ApplePayShippingMethodUpdate.idl: * Modules/applepay/ApplePayShippingMethodUpdate.h: (WebCore::ApplePayShippingMethodUpdate::encode const): Added. (WebCore::ApplePayShippingMethodUpdate::decode): Added. Introduce a common base class `ApplePayDetailsUpdateBase` instead of repeating members on each of the `ApplePay*Update` final classes. * Modules/applepay/ApplePayDetailsUpdateData.idl: Added. * Modules/applepay/ApplePayDetailsUpdateData.h: Added. (WebCore::ApplePayDetailsUpdateData::encode const): (WebCore::ApplePayDetailsUpdateData::decode): (WebCore::ApplePayDetailsUpdateData::decodeData): * Modules/paymentrequest/PaymentRequest.cpp: (WebCore::checkAndCanonicalizeDetails): (WebCore::PaymentRequest::settleDetailsPromise): Have the common base class above extend from `ApplePayDetailsUpdateData`, which is used to pull values out of the `object data` from `PaymentDetailsBase`. This way, both Apple Pay JS and PaymentRequest can be given the same data (albeit in slightly different places) and have the same capabilities. * Modules/applepay/ApplePayError.h: (WebCore::ApplePayError::encode const): Added. (WebCore::ApplePayError::decode): Added. * Modules/applepay/ApplePayError.cpp: Removed. * Modules/applepay/ApplePayErrorCode.h: * Modules/applepay/ApplePayErrorContactField.h: * Modules/applepay/ApplePayPaymentAuthorizationResult.h: * Modules/applepay/ApplePaySessionPaymentRequest.h: (WebCore::ApplePaySessionPaymentRequest::shippingMethods const): (WebCore::ApplePaySessionPaymentRequest::setShippingMethods): * Modules/applepay/ApplePaySession.h: * Modules/applepay/ApplePaySession.cpp: (WebCore::convertAndValidate): (WebCore::ApplePaySession::completeShippingContactSelection): (WebCore::ApplePaySession::didSelectShippingMethod): (WebCore::finishConverting): Deleted. (WebCore::convert): Deleted. * Modules/applepay/ApplePayShippingMethod.h: (WebCore::ApplePayShippingMethod::encode const): Added. (WebCore::ApplePayShippingMethod::decode): Added. * Modules/applepay/ApplePayShippingMethodSelectedEvent.h: * Modules/applepay/ApplePayShippingMethodSelectedEvent.cpp: (WebCore::ApplePayShippingMethodSelectedEvent::ApplePayShippingMethodSelectedEvent): (WebCore::convert): Deleted. * Modules/applepay/PaymentCoordinator.h: * Modules/applepay/PaymentCoordinator.cpp: (WebCore::PaymentCoordinator::completeShippingMethodSelection): (WebCore::PaymentCoordinator::completeShippingContactSelection): (WebCore::PaymentCoordinator::completePaymentMethodSelection): (WebCore::PaymentCoordinator::didSelectShippingMethod): * Modules/applepay/PaymentCoordinatorClient.h: * Modules/applepay/PaymentHeaders.h: * Modules/applepay/PaymentRequestValidator.mm: (WebCore::validateShippingMethod): (WebCore::validateShippingMethods): * Modules/applepay/PaymentSession.h: * Modules/applepay/PaymentSummaryItems.h: * Modules/applepay/cocoa/PaymentSummaryItemsCocoa.mm: * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h: * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp: (WebCore::convertAndValidate): (WebCore::validate): (WebCore::merge): (WebCore::ApplePayPaymentHandler::show): (WebCore::ApplePayPaymentHandler::computeShippingMethods): (WebCore::ApplePayPaymentHandler::computeTotalAndLineItems const): (WebCore::appendShippingContactInvalidError): (WebCore::ApplePayPaymentHandler::computeErrors const): (WebCore::ApplePayPaymentHandler::computeAddressErrors const): (WebCore::ApplePayPaymentHandler::computePayerErrors const): (WebCore::ApplePayPaymentHandler::computePaymentMethodErrors const): (WebCore::ApplePayPaymentHandler::shippingAddressUpdated): (WebCore::ApplePayPaymentHandler::shippingOptionUpdated): (WebCore::ApplePayPaymentHandler::paymentMethodUpdated): (WebCore::ApplePayPaymentHandler::retry): (WebCore::ApplePayPaymentHandler::didSelectShippingMethod): * loader/EmptyClients.cpp: * testing/MockPaymentCoordinator.h: * testing/MockPaymentCoordinator.cpp: (WebCore::MockPaymentCoordinator::showPaymentUI): (WebCore::MockPaymentCoordinator::completeShippingMethodSelection): (WebCore::convert): (WebCore::MockPaymentCoordinator::completeShippingContactSelection): (WebCore::MockPaymentCoordinator::completePaymentMethodSelection): (WebCore::MockPaymentCoordinator::changeShippingOption): (WebCore::MockPaymentCoordinator::completePaymentSession): (WebCore::MockPaymentCoordinator::updateTotalAndLineItems): Deleted. * testing/MockPaymentError.h: Use `ApplePay*Update` instead of duplicating its structure in another object (`ApplePaySessionPaymentRequest::*Update`). Use `ApplePayLineItem` instead of duplicating its structure in another object (`ApplePaySessionPaymentRequest::TotalAndLineItems`). Use `ApplePayShippingMethod` instead of duplicating its structure in another object (`ApplePaySessionPaymentRequest::ShippingMethod`). Use `ApplePayError*` instead of duplicating its structure in another object (`ApplePaySessionPaymentRequest::PaymentError::*`). * Modules/applepay/PaymentMethodUpdate.h: * Modules/applepay/cocoa/PaymentMethodUpdateCocoa.mm: Removed. Do the conversion from `ApplePayPaymentMethodUpdate` to `PKPaymentRequestPaymentMethodUpdate` in the UIProcess. * Modules/applepay/ApplePayPaymentRequest.h: * Modules/applepay/ApplePayRequestBase.cpp: (WebCore::convertAndValidate): * Modules/applepay/ApplePayRequestBase.h: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * PlatformMac.cmake: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: Source/WebKit: * Platform/cocoa/PaymentAuthorizationPresenter.h: * Platform/cocoa/PaymentAuthorizationPresenter.mm: (WebKit::toPKPaymentErrorCode): (WebKit::toNSError): (WebKit::toNSErrors): (WebKit::toPKShippingMethods): (WebKit::PaymentAuthorizationPresenter::completePaymentMethodSelection): (WebKit::PaymentAuthorizationPresenter::completeShippingContactSelection): (WebKit::PaymentAuthorizationPresenter::completeShippingMethodSelection): * Platform/cocoa/WKPaymentAuthorizationDelegate.mm: (toShippingMethod): * Scripts/webkit/messages.py: * Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in: * Shared/ApplePay/WebPaymentCoordinatorProxy.h: * Shared/ApplePay/WebPaymentCoordinatorProxy.cpp: (WebKit::WebPaymentCoordinatorProxy::completeShippingMethodSelection): (WebKit::WebPaymentCoordinatorProxy::completeShippingContactSelection): (WebKit::WebPaymentCoordinatorProxy::completePaymentMethodSelection): (WebKit::WebPaymentCoordinatorProxy::presenterDidSelectShippingMethod): * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h: * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::toPKShippingMethod): (WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest): (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection): (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection): (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection): (WebKit::finishCreating): Deleted. * Shared/WebCoreArgumentCoders.h: * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder<WebCore::PaymentAuthorizationResult>::decode): (IPC::ArgumentCoder<ApplePaySessionPaymentRequest>::decode): (IPC::ArgumentCoder<Vector<RefPtr<ApplePayError>>>::encode): Added. (IPC::ArgumentCoder<Vector<RefPtr<ApplePayError>>>::decode): Added. (IPC::ArgumentCoder<WebCore::PaymentError>::encode): Deleted. (IPC::ArgumentCoder<WebCore::PaymentError>::decode): Deleted. (IPC::ArgumentCoder<WebCore::PaymentMethodUpdate>::encode): Deleted. (IPC::ArgumentCoder<WebCore::PaymentMethodUpdate>::decode): Deleted. (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::ShippingMethod>::encode): Deleted. (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::ShippingMethod>::decode): Deleted. (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::TotalAndLineItems>::encode): Deleted. (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::TotalAndLineItems>::decode): Deleted. (IPC::ArgumentCoder<WebCore::ShippingContactUpdate>::encode): Deleted. (IPC::ArgumentCoder<WebCore::ShippingContactUpdate>::decode): Deleted. (IPC::ArgumentCoder<WebCore::ShippingMethodUpdate>::encode): Deleted. (IPC::ArgumentCoder<WebCore::ShippingMethodUpdate>::decode): Deleted. * WebProcess/ApplePay/WebPaymentCoordinator.messages.in: * WebProcess/ApplePay/WebPaymentCoordinator.h: * WebProcess/ApplePay/WebPaymentCoordinator.cpp: (WebKit::WebPaymentCoordinator::completeShippingMethodSelection): (WebKit::WebPaymentCoordinator::completeShippingContactSelection): (WebKit::WebPaymentCoordinator::completePaymentMethodSelection): (WebKit::WebPaymentCoordinator::didSelectShippingMethod): Use `ApplePay*Update` instead of duplicating its structure in another object (`ApplePaySessionPaymentRequest::*Update`). Use `ApplePayShippingMethod` instead of duplicating its structure in another object (`ApplePaySessionPaymentRequest::ShippingMethod`). Use `ApplePayError*` instead of duplicating its structure in another object (`ApplePaySessionPaymentRequest::PaymentError::*`). Source/WebKitLegacy/mac: * WebCoreSupport/WebPaymentCoordinatorClient.h: * WebCoreSupport/WebPaymentCoordinatorClient.mm: (WebPaymentCoordinatorClient::completeShippingMethodSelection): (WebPaymentCoordinatorClient::completeShippingContactSelection): (WebPaymentCoordinatorClient::completePaymentMethodSelection): Use `ApplePay*Update` instead of duplicating its structure in another object (`ApplePaySessionPaymentRequest::*Update`). Canonical link: https://commits.webkit.org/234340@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273143 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-02-19 17:38:37 +00:00
JSApplePayDetailsUpdateBase.cpp
JSApplePayDetailsUpdateData.cpp
JSApplePayError.cpp
JSApplePayErrorCode.cpp
JSApplePayErrorContactField.cpp
JSApplePayInstallmentConfiguration.cpp
JSApplePayInstallmentItem.cpp
JSApplePayInstallmentItemType.cpp
JSApplePayInstallmentRetailChannel.cpp
JSApplePayLineItem.cpp
JSApplePayMerchantCapability.cpp
JSApplePayModifier.cpp
JSApplePayPayment.cpp
JSApplePayPaymentAuthorizationResult.cpp
JSApplePayPaymentAuthorizedEvent.cpp
JSApplePayPaymentContact.cpp
JSApplePayPaymentMethod.cpp
JSApplePayPaymentMethodSelectedEvent.cpp
JSApplePayPaymentMethodType.cpp
JSApplePayPaymentMethodUpdate.cpp
JSApplePayPaymentPass.cpp
JSApplePayPaymentRequest.cpp
[Payment Request] upstream new features https://bugs.webkit.org/show_bug.cgi?id=226740 <rdar://problem/78963132> Reviewed by Andy Estes. Source/WebCore: - recurring line items (`HAVE_PASSKIT_RECURRING_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_RECURRING_LINE_ITEM`) - deferred line items (`HAVE_PASSKIT_DEFERRED_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_DEFERRED_LINE_ITEM`) - estimated shipping dates (`HAVE_PASSKIT_SHIPPING_METHOD_DATE_COMPONENTS_RANGE` and `ENABLE_APPLE_PAY_SHIPPING_METHOD_DATE_COMPONENTS_RANGE`) - coupon code entry (`HAVE_PASSKIT_COUPON_CODE` and `ENABLE_APPLE_PAY_COUPON_CODE`) - shipped vs in-store pickup (`HAVE_PASSKIT_SHIPPING_CONTACT_EDITING_MODE` and `ENABLE_APPLE_PAY_SHIPPING_CONTACT_EDITING_MODE`) Tests: http/tests/paymentrequest/ApplePayModifier-additionalLineItems.https.html http/tests/paymentrequest/ApplePayModifier-additionalShippingMethods.https.html http/tests/paymentrequest/ApplePayModifier-total.https.html http/tests/paymentrequest/paymentmethodchange-couponCode.https.html http/tests/paymentrequest/paymentrequest-couponCode.https.html http/tests/paymentrequest/paymentrequest-shippingContactEditingMode.https.html http/tests/paymentrequest/paymentrequest-supportsCouponCode.https.html * Modules/applepay/ApplePayCouponCodeUpdate.idl: Copied from Source/WebCore/Modules/applepay/ApplePayPaymentMethodModeUpdate.idl. * Modules/applepay/ApplePayCouponCodeUpdate.h: Renamed from Source/WebCore/Modules/applepay/ApplePayPaymentMethodModeUpdate.h. (WebCore::ApplePayCouponCodeUpdate::encode const): (WebCore::ApplePayCouponCodeUpdate::decode): Object used to update the payment request via `ApplePaySession.prototype.completeCouponCodeChange` when responding to the user modifying the coupon code. * Modules/applepay/ApplePayErrorCode.idl: * Modules/applepay/ApplePayErrorCode.h: Add `"couponCodeInvalid"` and `"couponCodeExpired"`. * Modules/applepay/ApplePayLineItem.idl: * Modules/applepay/ApplePayLineItem.h: (WebCore::ApplePayLineItem::encode const): (WebCore::ApplePayLineItem::decode): * Modules/applepay/ApplePayPaymentTiming.idl: Added. * Modules/applepay/ApplePayPaymentTiming.h: Added. * Modules/applepay/ApplePayRecurringPaymentDateUnit.idl: Added. * Modules/applepay/ApplePayRecurringPaymentDateUnit.h: Added. Add members that indicate whether this line item is immediate, recurring, or deferred. Depending on that timing, additional members are added for further configuration (e.g. the start and/or end date of a recurring payment, it's frequency, etc.). * Modules/applepay/ApplePayShippingMethod.idl: * Modules/applepay/ApplePayShippingMethod.h: (WebCore::ApplePayShippingMethod::encode const): (WebCore::ApplePayShippingMethod::decode): * Modules/applepay/ApplePayDateComponentsRange.idl: Added. * Modules/applepay/ApplePayDateComponentsRange.h: Added. (WebCore::ApplePayDateComponentsRange::encode const): (WebCore::ApplePayDateComponentsRange::decode): * Modules/applepay/ApplePayDateComponents.idl: Added. * Modules/applepay/ApplePayDateComponents.h: Added. (WebCore::ApplePayDateComponents::encode const): (WebCore::ApplePayDateComponents::decode): Add members that can be used to indicate the estimated shipping dates for this shipping method. * Modules/applepay/ApplePayRequestBase.idl: * Modules/applepay/ApplePayRequestBase.h: * Modules/applepay/ApplePayRequestBase.cpp: (WebCore::convertAndValidate): * Modules/applepay/ApplePaySessionPaymentRequest.h: (WebCore::ApplePaySessionPaymentRequest::supportsCouponCode const): Added. (WebCore::ApplePaySessionPaymentRequest::setSupportsCouponCode): Added. (WebCore::ApplePaySessionPaymentRequest::couponCode const): Added. (WebCore::ApplePaySessionPaymentRequest::setCouponCode): Added. (WebCore::ApplePaySessionPaymentRequest::shippingContactEditingMode const): Added. (WebCore::ApplePaySessionPaymentRequest::setShippingContactEditingMode): Added. * Modules/applepay/ApplePayShippingContactEditingMode.idl: Added. * Modules/applepay/ApplePayShippingContactEditingMode.h: Added. Add members that indicate: - whether this payment request supports a coupon code at all - the initial coupon code (assuming the above) - whether this payment request allows editing the shipping contact (i.e. in-store pickup does not) * dom/EventNames.h: * dom/EventNames.in: * Modules/applepay/ApplePayCouponCodeChangedEvent.idl: Added. * Modules/applepay/ApplePayCouponCodeChangedEvent.h: Added. * Modules/applepay/ApplePayCouponCodeChangedEvent.cpp: Added. (WebCore::ApplePayCouponCodeChangedEvent::ApplePayCouponCodeChangedEvent): (WebCore::ApplePayCouponCodeChangedEvent::eventInterface const): Add a `"couponcodechange"` event that is dispatched whenever the user modifies the coupon code for an `ApplePaySession`. * Modules/applepay/ApplePayCouponCodeDetails.idl: Copied from Source/WebCore/Modules/applepay/ApplePayPaymentMethodModeDetails.idl. * Modules/applepay/ApplePayCouponCodeDetails.h: Copied from Source/WebCore/Modules/applepay/ApplePayPaymentMethodModeUpdate.idl. Used as the `object methodData` when a `PaymentMethodChangeEvent` is dispatched for a `PaymentRequest`. * Modules/applepay/ApplePaySession.idl: * Modules/applepay/ApplePaySession.h: * Modules/applepay/ApplePaySession.cpp: (WebCore::convertAndValidate): (WebCore::ApplePaySession::completeCouponCodeChange): Added. (WebCore::ApplePaySession::didChangeCouponCode): Renamed from `WebCore::ApplePaySession::didChangePaymentMethodMode`. (WebCore::ApplePaySession::canSuspendWithoutCanceling const): (WebCore::ApplePaySession::canBegin const): (WebCore::ApplePaySession::canAbort const): (WebCore::ApplePaySession::canCancel const): (WebCore::ApplePaySession::canCompleteShippingMethodSelection const): (WebCore::ApplePaySession::canCompleteShippingContactSelection const): (WebCore::ApplePaySession::canCompletePaymentMethodSelection const): (WebCore::ApplePaySession::canCompleteCouponCodeChange const): Renamed from `WebCore::ApplePaySession::canCompletePaymentMethodModeChange const`. (WebCore::ApplePaySession::canCompletePayment const): (WebCore::ApplePaySession::isFinalState const): * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h: * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp: (WebCore::ApplePayPaymentHandler::paymentMethodUpdated): (WebCore::ApplePayPaymentHandler::didChangeCouponCode): Renamed from `WebCore::ApplePayPaymentHandler::didChangePaymentMethodMode`. Add methods for JS to call and state logic to handle coupon code changes. * Modules/applepay/PaymentCoordinator.h: * Modules/applepay/PaymentCoordinator.cpp: (WebCore::PaymentCoordinator::completeCouponCodeChange): Renamed from `WebCore::PaymentCoordinator::completePaymentMethodModeChange`. (WebCore::PaymentCoordinator::didChangeCouponCode): Renamed from `WebCore::PaymentCoordinator::didChangePaymentMethodMode`. * Modules/applepay/PaymentCoordinatorClient.h: * loader/EmptyClients.cpp: (WebCore::EmptyPaymentCoordinatorClient::completeCouponCodeChange): Renamed from `WebCore::EmptyPaymentCoordinatorClient::completePaymentMethodModeChange`. Plumbing up to WebKit. * Modules/applepay/cocoa/PaymentSummaryItemsCocoa.mm: (WebCore::toDate): Added. (WebCore::toCalendarUnit): Added. (WebCore::toPKPaymentSummaryItem): Convert WebCore objects to PassKit objects. * testing/MockPaymentCoordinator.idl: * testing/MockPaymentCoordinator.h: * testing/MockPaymentCoordinator.cpp: (WebCore::MockPaymentCoordinator::showPaymentUI): (WebCore::MockPaymentCoordinator::completeCouponCodeChange): Renamed from `WebCore::MockPaymentCoordinator::completePaymentMethodModeChange`. (WebCore::MockPaymentCoordinator::changeCouponCode): Added. * Modules/applepay/cocoa/PaymentAPIVersionCocoa.mm: (WebCore::PaymentAPIVersion::current): * Modules/applepay/PaymentHeaders.h: * Modules/applepay/PaymentSession.h: * Modules/applepay/ApplePayLineItemData.idl: Removed. * Modules/applepay/ApplePayLineItemData.h: Removed. * Modules/applepay/ApplePayShippingMethodData.idl: Removed. * Modules/applepay/ApplePayShippingMethodData.h: Removed. Remove unnecessary base types after r275169. * PlatformMac.cmake: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: Source/WebCore/PAL: - recurring line items (`HAVE_PASSKIT_RECURRING_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_RECURRING_LINE_ITEM`) - deferred line items (`HAVE_PASSKIT_DEFERRED_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_DEFERRED_LINE_ITEM`) - estimated shipping dates (`HAVE_PASSKIT_SHIPPING_METHOD_DATE_COMPONENTS_RANGE` and `ENABLE_APPLE_PAY_SHIPPING_METHOD_DATE_COMPONENTS_RANGE`) - coupon code entry (`HAVE_PASSKIT_COUPON_CODE` and `ENABLE_APPLE_PAY_COUPON_CODE`) - shipped vs in-store pickup (`HAVE_PASSKIT_SHIPPING_CONTACT_EDITING_MODE` and `ENABLE_APPLE_PAY_SHIPPING_CONTACT_EDITING_MODE`) * pal/cocoa/PassKitSoftLink.h: * pal/cocoa/PassKitSoftLink.mm: * pal/spi/cocoa/PassKitSPI.h: Source/WebKit: - recurring line items (`HAVE_PASSKIT_RECURRING_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_RECURRING_LINE_ITEM`) - deferred line items (`HAVE_PASSKIT_DEFERRED_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_DEFERRED_LINE_ITEM`) - estimated shipping dates (`HAVE_PASSKIT_SHIPPING_METHOD_DATE_COMPONENTS_RANGE` and `ENABLE_APPLE_PAY_SHIPPING_METHOD_DATE_COMPONENTS_RANGE`) - coupon code entry (`HAVE_PASSKIT_COUPON_CODE` and `ENABLE_APPLE_PAY_COUPON_CODE`) - shipped vs in-store pickup (`HAVE_PASSKIT_SHIPPING_CONTACT_EDITING_MODE` and `ENABLE_APPLE_PAY_SHIPPING_CONTACT_EDITING_MODE`) * Platform/cocoa/PaymentAuthorizationViewController.mm: (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didChangeCouponCode:handler:]): Added. * Platform/ios/PaymentAuthorizationController.mm: (-[WKPaymentAuthorizationControllerDelegate paymentAuthorizationController:didChangeCouponCode:handler:]): Added. * Platform/cocoa/PaymentAuthorizationPresenter.h: * Platform/cocoa/PaymentAuthorizationPresenter.mm: (WebKit::toPKPaymentErrorCode): (WebKit::PaymentAuthorizationPresenter::completeCouponCodeChange): Renamed from `WebKit::PaymentAuthorizationPresenter::completePaymentMethodModeChange`. * Platform/cocoa/WKPaymentAuthorizationDelegate.h: * Platform/cocoa/WKPaymentAuthorizationDelegate.mm: (-[WKPaymentAuthorizationDelegate completeCouponCodeChange:]): Added. (toDateComponents): Added. (toDateComponentsRange): Added. (toShippingMethod): (-[WKPaymentAuthorizationDelegate _didChangeCouponCode:completion:]): Added. Add plumbing from/to PassKit for coupon code changes. * Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in: * Shared/ApplePay/WebPaymentCoordinatorProxy.h: * Shared/ApplePay/WebPaymentCoordinatorProxy.cpp: (WebKit::WebPaymentCoordinatorProxy::completeCouponCodeChange): Renamed from `WebKit::WebPaymentCoordinatorProxy::completePaymentMethodModeChange`. (WebKit::WebPaymentCoordinatorProxy::presenterDidChangeCouponCode): Renamed from `WebKit::WebPaymentCoordinatorProxy::presenterDidChangePaymentMethodMode`. (WebKit::WebPaymentCoordinatorProxy::canBegin const): (WebKit::WebPaymentCoordinatorProxy::canCancel const): (WebKit::WebPaymentCoordinatorProxy::canCompletePayment const): (WebKit::WebPaymentCoordinatorProxy::canAbort const): * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::toNSDateComponents): Added. (WebKit::toPKDateComponentsRange): Added. (WebKit::toPKShippingMethod): (WebKit::toPKShippingContactEditingMode): Added. (WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest): (WebKit::WebPaymentCoordinatorProxy::platformCompleteCouponCodeChange): Renamed from `WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentMethodModeChange`. Convert PassKit objects to/from WebCore objects. * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder<WebCore::ApplePaySessionPaymentRequest>::encode): (IPC::ArgumentCoder<WebCore::ApplePaySessionPaymentRequest>::decode): * WebProcess/ApplePay/WebPaymentCoordinator.messages.in: * WebProcess/ApplePay/WebPaymentCoordinator.h: * WebProcess/ApplePay/WebPaymentCoordinator.cpp: (WebKit::WebPaymentCoordinator::completeCouponCodeChange): Renamed from `WebKit::WebPaymentCoordinator::completePaymentMethodModeChange`. (WebKit::WebPaymentCoordinator::didChangeCouponCode): Renamed from `WebKit::WebPaymentCoordinator::didChangePaymentMethodMode`. Plumbing into/from WebCore. Source/WebKitLegacy/mac: - recurring line items (`HAVE_PASSKIT_RECURRING_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_RECURRING_LINE_ITEM`) - deferred line items (`HAVE_PASSKIT_DEFERRED_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_DEFERRED_LINE_ITEM`) - estimated shipping dates (`HAVE_PASSKIT_SHIPPING_METHOD_DATE_COMPONENTS_RANGE` and `ENABLE_APPLE_PAY_SHIPPING_METHOD_DATE_COMPONENTS_RANGE`) - coupon code entry (`HAVE_PASSKIT_COUPON_CODE` and `ENABLE_APPLE_PAY_COUPON_CODE`) - shipped vs in-store pickup (`HAVE_PASSKIT_SHIPPING_CONTACT_EDITING_MODE` and `ENABLE_APPLE_PAY_SHIPPING_CONTACT_EDITING_MODE`) * WebCoreSupport/WebPaymentCoordinatorClient.h: * WebCoreSupport/WebPaymentCoordinatorClient.mm: (WebPaymentCoordinatorClient::completeCouponCodeChange): Renamed from `WebPaymentCoordinatorClient::completePaymentMethodModeChange`. Source/WTF: - recurring line items (`HAVE_PASSKIT_RECURRING_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_RECURRING_LINE_ITEM`) - deferred line items (`HAVE_PASSKIT_DEFERRED_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_DEFERRED_LINE_ITEM`) - estimated shipping dates (`HAVE_PASSKIT_SHIPPING_METHOD_DATE_COMPONENTS_RANGE` and `ENABLE_APPLE_PAY_SHIPPING_METHOD_DATE_COMPONENTS_RANGE`) - coupon code entry (`HAVE_PASSKIT_COUPON_CODE` and `ENABLE_APPLE_PAY_COUPON_CODE`) - shipped vs in-store pickup (`HAVE_PASSKIT_SHIPPING_CONTACT_EDITING_MODE` and `ENABLE_APPLE_PAY_SHIPPING_CONTACT_EDITING_MODE`) * wtf/PlatformHave.h: * wtf/PlatformEnableCocoa.h: LayoutTests: * http/tests/paymentrequest/ApplePayModifier-additionalLineItems.https.html: Added. * http/tests/paymentrequest/ApplePayModifier-additionalLineItems.https-expected.txt: Added. * http/tests/paymentrequest/ApplePayModifier-additionalShippingMethods.https.html: Added. * http/tests/paymentrequest/ApplePayModifier-additionalShippingMethods.https-expected.txt: Added. * http/tests/paymentrequest/ApplePayModifier-total.https.html: Added. * http/tests/paymentrequest/ApplePayModifier-total.https-expected.txt: Added. * http/tests/paymentrequest/paymentmethodchange-couponCode.https.html: Added. * http/tests/paymentrequest/paymentmethodchange-couponCode.https-expected.txt: Added. * http/tests/paymentrequest/paymentrequest-couponCode.https.html: Added. * http/tests/paymentrequest/paymentrequest-couponCode.https-expected.txt: Added. * http/tests/paymentrequest/paymentrequest-shippingContactEditingMode.https.html: Added. * http/tests/paymentrequest/paymentrequest-shippingContactEditingMode.https-expected.txt: Added. * http/tests/paymentrequest/paymentrequest-supportsCouponCode.https.html: Added. * http/tests/paymentrequest/paymentrequest-supportsCouponCode.https-expected.txt: Added. * http/tests/ssl/applepay/ApplePayError-expected.txt: * platform/ios-wk2/TestExpectations: * platform/mac-wk2/TestExpectations: Canonical link: https://commits.webkit.org/238613@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278630 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-08 22:15:18 +00:00
JSApplePayPaymentTiming.cpp
JSApplePayRecurringPaymentDateUnit.cpp
JSApplePayRequest.cpp
JSApplePayRequestBase.cpp
JSApplePaySession.cpp
JSApplePaySessionError.cpp
JSApplePaySetup.cpp
JSApplePaySetupConfiguration.cpp
JSApplePaySetupFeature.cpp
JSApplePaySetupFeatureState.cpp
JSApplePaySetupFeatureType.cpp
[Payment Request] upstream new features https://bugs.webkit.org/show_bug.cgi?id=226740 <rdar://problem/78963132> Reviewed by Andy Estes. Source/WebCore: - recurring line items (`HAVE_PASSKIT_RECURRING_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_RECURRING_LINE_ITEM`) - deferred line items (`HAVE_PASSKIT_DEFERRED_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_DEFERRED_LINE_ITEM`) - estimated shipping dates (`HAVE_PASSKIT_SHIPPING_METHOD_DATE_COMPONENTS_RANGE` and `ENABLE_APPLE_PAY_SHIPPING_METHOD_DATE_COMPONENTS_RANGE`) - coupon code entry (`HAVE_PASSKIT_COUPON_CODE` and `ENABLE_APPLE_PAY_COUPON_CODE`) - shipped vs in-store pickup (`HAVE_PASSKIT_SHIPPING_CONTACT_EDITING_MODE` and `ENABLE_APPLE_PAY_SHIPPING_CONTACT_EDITING_MODE`) Tests: http/tests/paymentrequest/ApplePayModifier-additionalLineItems.https.html http/tests/paymentrequest/ApplePayModifier-additionalShippingMethods.https.html http/tests/paymentrequest/ApplePayModifier-total.https.html http/tests/paymentrequest/paymentmethodchange-couponCode.https.html http/tests/paymentrequest/paymentrequest-couponCode.https.html http/tests/paymentrequest/paymentrequest-shippingContactEditingMode.https.html http/tests/paymentrequest/paymentrequest-supportsCouponCode.https.html * Modules/applepay/ApplePayCouponCodeUpdate.idl: Copied from Source/WebCore/Modules/applepay/ApplePayPaymentMethodModeUpdate.idl. * Modules/applepay/ApplePayCouponCodeUpdate.h: Renamed from Source/WebCore/Modules/applepay/ApplePayPaymentMethodModeUpdate.h. (WebCore::ApplePayCouponCodeUpdate::encode const): (WebCore::ApplePayCouponCodeUpdate::decode): Object used to update the payment request via `ApplePaySession.prototype.completeCouponCodeChange` when responding to the user modifying the coupon code. * Modules/applepay/ApplePayErrorCode.idl: * Modules/applepay/ApplePayErrorCode.h: Add `"couponCodeInvalid"` and `"couponCodeExpired"`. * Modules/applepay/ApplePayLineItem.idl: * Modules/applepay/ApplePayLineItem.h: (WebCore::ApplePayLineItem::encode const): (WebCore::ApplePayLineItem::decode): * Modules/applepay/ApplePayPaymentTiming.idl: Added. * Modules/applepay/ApplePayPaymentTiming.h: Added. * Modules/applepay/ApplePayRecurringPaymentDateUnit.idl: Added. * Modules/applepay/ApplePayRecurringPaymentDateUnit.h: Added. Add members that indicate whether this line item is immediate, recurring, or deferred. Depending on that timing, additional members are added for further configuration (e.g. the start and/or end date of a recurring payment, it's frequency, etc.). * Modules/applepay/ApplePayShippingMethod.idl: * Modules/applepay/ApplePayShippingMethod.h: (WebCore::ApplePayShippingMethod::encode const): (WebCore::ApplePayShippingMethod::decode): * Modules/applepay/ApplePayDateComponentsRange.idl: Added. * Modules/applepay/ApplePayDateComponentsRange.h: Added. (WebCore::ApplePayDateComponentsRange::encode const): (WebCore::ApplePayDateComponentsRange::decode): * Modules/applepay/ApplePayDateComponents.idl: Added. * Modules/applepay/ApplePayDateComponents.h: Added. (WebCore::ApplePayDateComponents::encode const): (WebCore::ApplePayDateComponents::decode): Add members that can be used to indicate the estimated shipping dates for this shipping method. * Modules/applepay/ApplePayRequestBase.idl: * Modules/applepay/ApplePayRequestBase.h: * Modules/applepay/ApplePayRequestBase.cpp: (WebCore::convertAndValidate): * Modules/applepay/ApplePaySessionPaymentRequest.h: (WebCore::ApplePaySessionPaymentRequest::supportsCouponCode const): Added. (WebCore::ApplePaySessionPaymentRequest::setSupportsCouponCode): Added. (WebCore::ApplePaySessionPaymentRequest::couponCode const): Added. (WebCore::ApplePaySessionPaymentRequest::setCouponCode): Added. (WebCore::ApplePaySessionPaymentRequest::shippingContactEditingMode const): Added. (WebCore::ApplePaySessionPaymentRequest::setShippingContactEditingMode): Added. * Modules/applepay/ApplePayShippingContactEditingMode.idl: Added. * Modules/applepay/ApplePayShippingContactEditingMode.h: Added. Add members that indicate: - whether this payment request supports a coupon code at all - the initial coupon code (assuming the above) - whether this payment request allows editing the shipping contact (i.e. in-store pickup does not) * dom/EventNames.h: * dom/EventNames.in: * Modules/applepay/ApplePayCouponCodeChangedEvent.idl: Added. * Modules/applepay/ApplePayCouponCodeChangedEvent.h: Added. * Modules/applepay/ApplePayCouponCodeChangedEvent.cpp: Added. (WebCore::ApplePayCouponCodeChangedEvent::ApplePayCouponCodeChangedEvent): (WebCore::ApplePayCouponCodeChangedEvent::eventInterface const): Add a `"couponcodechange"` event that is dispatched whenever the user modifies the coupon code for an `ApplePaySession`. * Modules/applepay/ApplePayCouponCodeDetails.idl: Copied from Source/WebCore/Modules/applepay/ApplePayPaymentMethodModeDetails.idl. * Modules/applepay/ApplePayCouponCodeDetails.h: Copied from Source/WebCore/Modules/applepay/ApplePayPaymentMethodModeUpdate.idl. Used as the `object methodData` when a `PaymentMethodChangeEvent` is dispatched for a `PaymentRequest`. * Modules/applepay/ApplePaySession.idl: * Modules/applepay/ApplePaySession.h: * Modules/applepay/ApplePaySession.cpp: (WebCore::convertAndValidate): (WebCore::ApplePaySession::completeCouponCodeChange): Added. (WebCore::ApplePaySession::didChangeCouponCode): Renamed from `WebCore::ApplePaySession::didChangePaymentMethodMode`. (WebCore::ApplePaySession::canSuspendWithoutCanceling const): (WebCore::ApplePaySession::canBegin const): (WebCore::ApplePaySession::canAbort const): (WebCore::ApplePaySession::canCancel const): (WebCore::ApplePaySession::canCompleteShippingMethodSelection const): (WebCore::ApplePaySession::canCompleteShippingContactSelection const): (WebCore::ApplePaySession::canCompletePaymentMethodSelection const): (WebCore::ApplePaySession::canCompleteCouponCodeChange const): Renamed from `WebCore::ApplePaySession::canCompletePaymentMethodModeChange const`. (WebCore::ApplePaySession::canCompletePayment const): (WebCore::ApplePaySession::isFinalState const): * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h: * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp: (WebCore::ApplePayPaymentHandler::paymentMethodUpdated): (WebCore::ApplePayPaymentHandler::didChangeCouponCode): Renamed from `WebCore::ApplePayPaymentHandler::didChangePaymentMethodMode`. Add methods for JS to call and state logic to handle coupon code changes. * Modules/applepay/PaymentCoordinator.h: * Modules/applepay/PaymentCoordinator.cpp: (WebCore::PaymentCoordinator::completeCouponCodeChange): Renamed from `WebCore::PaymentCoordinator::completePaymentMethodModeChange`. (WebCore::PaymentCoordinator::didChangeCouponCode): Renamed from `WebCore::PaymentCoordinator::didChangePaymentMethodMode`. * Modules/applepay/PaymentCoordinatorClient.h: * loader/EmptyClients.cpp: (WebCore::EmptyPaymentCoordinatorClient::completeCouponCodeChange): Renamed from `WebCore::EmptyPaymentCoordinatorClient::completePaymentMethodModeChange`. Plumbing up to WebKit. * Modules/applepay/cocoa/PaymentSummaryItemsCocoa.mm: (WebCore::toDate): Added. (WebCore::toCalendarUnit): Added. (WebCore::toPKPaymentSummaryItem): Convert WebCore objects to PassKit objects. * testing/MockPaymentCoordinator.idl: * testing/MockPaymentCoordinator.h: * testing/MockPaymentCoordinator.cpp: (WebCore::MockPaymentCoordinator::showPaymentUI): (WebCore::MockPaymentCoordinator::completeCouponCodeChange): Renamed from `WebCore::MockPaymentCoordinator::completePaymentMethodModeChange`. (WebCore::MockPaymentCoordinator::changeCouponCode): Added. * Modules/applepay/cocoa/PaymentAPIVersionCocoa.mm: (WebCore::PaymentAPIVersion::current): * Modules/applepay/PaymentHeaders.h: * Modules/applepay/PaymentSession.h: * Modules/applepay/ApplePayLineItemData.idl: Removed. * Modules/applepay/ApplePayLineItemData.h: Removed. * Modules/applepay/ApplePayShippingMethodData.idl: Removed. * Modules/applepay/ApplePayShippingMethodData.h: Removed. Remove unnecessary base types after r275169. * PlatformMac.cmake: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: Source/WebCore/PAL: - recurring line items (`HAVE_PASSKIT_RECURRING_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_RECURRING_LINE_ITEM`) - deferred line items (`HAVE_PASSKIT_DEFERRED_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_DEFERRED_LINE_ITEM`) - estimated shipping dates (`HAVE_PASSKIT_SHIPPING_METHOD_DATE_COMPONENTS_RANGE` and `ENABLE_APPLE_PAY_SHIPPING_METHOD_DATE_COMPONENTS_RANGE`) - coupon code entry (`HAVE_PASSKIT_COUPON_CODE` and `ENABLE_APPLE_PAY_COUPON_CODE`) - shipped vs in-store pickup (`HAVE_PASSKIT_SHIPPING_CONTACT_EDITING_MODE` and `ENABLE_APPLE_PAY_SHIPPING_CONTACT_EDITING_MODE`) * pal/cocoa/PassKitSoftLink.h: * pal/cocoa/PassKitSoftLink.mm: * pal/spi/cocoa/PassKitSPI.h: Source/WebKit: - recurring line items (`HAVE_PASSKIT_RECURRING_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_RECURRING_LINE_ITEM`) - deferred line items (`HAVE_PASSKIT_DEFERRED_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_DEFERRED_LINE_ITEM`) - estimated shipping dates (`HAVE_PASSKIT_SHIPPING_METHOD_DATE_COMPONENTS_RANGE` and `ENABLE_APPLE_PAY_SHIPPING_METHOD_DATE_COMPONENTS_RANGE`) - coupon code entry (`HAVE_PASSKIT_COUPON_CODE` and `ENABLE_APPLE_PAY_COUPON_CODE`) - shipped vs in-store pickup (`HAVE_PASSKIT_SHIPPING_CONTACT_EDITING_MODE` and `ENABLE_APPLE_PAY_SHIPPING_CONTACT_EDITING_MODE`) * Platform/cocoa/PaymentAuthorizationViewController.mm: (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didChangeCouponCode:handler:]): Added. * Platform/ios/PaymentAuthorizationController.mm: (-[WKPaymentAuthorizationControllerDelegate paymentAuthorizationController:didChangeCouponCode:handler:]): Added. * Platform/cocoa/PaymentAuthorizationPresenter.h: * Platform/cocoa/PaymentAuthorizationPresenter.mm: (WebKit::toPKPaymentErrorCode): (WebKit::PaymentAuthorizationPresenter::completeCouponCodeChange): Renamed from `WebKit::PaymentAuthorizationPresenter::completePaymentMethodModeChange`. * Platform/cocoa/WKPaymentAuthorizationDelegate.h: * Platform/cocoa/WKPaymentAuthorizationDelegate.mm: (-[WKPaymentAuthorizationDelegate completeCouponCodeChange:]): Added. (toDateComponents): Added. (toDateComponentsRange): Added. (toShippingMethod): (-[WKPaymentAuthorizationDelegate _didChangeCouponCode:completion:]): Added. Add plumbing from/to PassKit for coupon code changes. * Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in: * Shared/ApplePay/WebPaymentCoordinatorProxy.h: * Shared/ApplePay/WebPaymentCoordinatorProxy.cpp: (WebKit::WebPaymentCoordinatorProxy::completeCouponCodeChange): Renamed from `WebKit::WebPaymentCoordinatorProxy::completePaymentMethodModeChange`. (WebKit::WebPaymentCoordinatorProxy::presenterDidChangeCouponCode): Renamed from `WebKit::WebPaymentCoordinatorProxy::presenterDidChangePaymentMethodMode`. (WebKit::WebPaymentCoordinatorProxy::canBegin const): (WebKit::WebPaymentCoordinatorProxy::canCancel const): (WebKit::WebPaymentCoordinatorProxy::canCompletePayment const): (WebKit::WebPaymentCoordinatorProxy::canAbort const): * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::toNSDateComponents): Added. (WebKit::toPKDateComponentsRange): Added. (WebKit::toPKShippingMethod): (WebKit::toPKShippingContactEditingMode): Added. (WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest): (WebKit::WebPaymentCoordinatorProxy::platformCompleteCouponCodeChange): Renamed from `WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentMethodModeChange`. Convert PassKit objects to/from WebCore objects. * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder<WebCore::ApplePaySessionPaymentRequest>::encode): (IPC::ArgumentCoder<WebCore::ApplePaySessionPaymentRequest>::decode): * WebProcess/ApplePay/WebPaymentCoordinator.messages.in: * WebProcess/ApplePay/WebPaymentCoordinator.h: * WebProcess/ApplePay/WebPaymentCoordinator.cpp: (WebKit::WebPaymentCoordinator::completeCouponCodeChange): Renamed from `WebKit::WebPaymentCoordinator::completePaymentMethodModeChange`. (WebKit::WebPaymentCoordinator::didChangeCouponCode): Renamed from `WebKit::WebPaymentCoordinator::didChangePaymentMethodMode`. Plumbing into/from WebCore. Source/WebKitLegacy/mac: - recurring line items (`HAVE_PASSKIT_RECURRING_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_RECURRING_LINE_ITEM`) - deferred line items (`HAVE_PASSKIT_DEFERRED_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_DEFERRED_LINE_ITEM`) - estimated shipping dates (`HAVE_PASSKIT_SHIPPING_METHOD_DATE_COMPONENTS_RANGE` and `ENABLE_APPLE_PAY_SHIPPING_METHOD_DATE_COMPONENTS_RANGE`) - coupon code entry (`HAVE_PASSKIT_COUPON_CODE` and `ENABLE_APPLE_PAY_COUPON_CODE`) - shipped vs in-store pickup (`HAVE_PASSKIT_SHIPPING_CONTACT_EDITING_MODE` and `ENABLE_APPLE_PAY_SHIPPING_CONTACT_EDITING_MODE`) * WebCoreSupport/WebPaymentCoordinatorClient.h: * WebCoreSupport/WebPaymentCoordinatorClient.mm: (WebPaymentCoordinatorClient::completeCouponCodeChange): Renamed from `WebPaymentCoordinatorClient::completePaymentMethodModeChange`. Source/WTF: - recurring line items (`HAVE_PASSKIT_RECURRING_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_RECURRING_LINE_ITEM`) - deferred line items (`HAVE_PASSKIT_DEFERRED_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_DEFERRED_LINE_ITEM`) - estimated shipping dates (`HAVE_PASSKIT_SHIPPING_METHOD_DATE_COMPONENTS_RANGE` and `ENABLE_APPLE_PAY_SHIPPING_METHOD_DATE_COMPONENTS_RANGE`) - coupon code entry (`HAVE_PASSKIT_COUPON_CODE` and `ENABLE_APPLE_PAY_COUPON_CODE`) - shipped vs in-store pickup (`HAVE_PASSKIT_SHIPPING_CONTACT_EDITING_MODE` and `ENABLE_APPLE_PAY_SHIPPING_CONTACT_EDITING_MODE`) * wtf/PlatformHave.h: * wtf/PlatformEnableCocoa.h: LayoutTests: * http/tests/paymentrequest/ApplePayModifier-additionalLineItems.https.html: Added. * http/tests/paymentrequest/ApplePayModifier-additionalLineItems.https-expected.txt: Added. * http/tests/paymentrequest/ApplePayModifier-additionalShippingMethods.https.html: Added. * http/tests/paymentrequest/ApplePayModifier-additionalShippingMethods.https-expected.txt: Added. * http/tests/paymentrequest/ApplePayModifier-total.https.html: Added. * http/tests/paymentrequest/ApplePayModifier-total.https-expected.txt: Added. * http/tests/paymentrequest/paymentmethodchange-couponCode.https.html: Added. * http/tests/paymentrequest/paymentmethodchange-couponCode.https-expected.txt: Added. * http/tests/paymentrequest/paymentrequest-couponCode.https.html: Added. * http/tests/paymentrequest/paymentrequest-couponCode.https-expected.txt: Added. * http/tests/paymentrequest/paymentrequest-shippingContactEditingMode.https.html: Added. * http/tests/paymentrequest/paymentrequest-shippingContactEditingMode.https-expected.txt: Added. * http/tests/paymentrequest/paymentrequest-supportsCouponCode.https.html: Added. * http/tests/paymentrequest/paymentrequest-supportsCouponCode.https-expected.txt: Added. * http/tests/ssl/applepay/ApplePayError-expected.txt: * platform/ios-wk2/TestExpectations: * platform/mac-wk2/TestExpectations: Canonical link: https://commits.webkit.org/238613@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278630 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-08 22:15:18 +00:00
JSApplePayShippingContactEditingMode.cpp
JSApplePayShippingContactSelectedEvent.cpp
JSApplePayShippingContactUpdate.cpp
JSApplePayShippingMethod.cpp
JSApplePayShippingMethodSelectedEvent.cpp
JSApplePayShippingMethodUpdate.cpp
JSApplePayValidateMerchantEvent.cpp
Remove code behind ENABLE(MEDIA_SESSION), no ports enable it https://bugs.webkit.org/show_bug.cgi?id=216831 Reviewed by Alex Christensen. .: * Source/cmake/OptionsFTW.cmake: * Source/cmake/WebKitFeatures.cmake: Remove option to build with MEDIA_SESSION, no one was doing it. Source/WebCore: * CMakeLists.txt: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: Remove media session related files. * Modules/airplay/PlaybackTargetClientContextIdentifier.h: Added. * Modules/airplay/WebMediaSessionManager.cpp: Added. * Modules/airplay/WebMediaSessionManager.h: Added. * Modules/airplay/WebMediaSessionManagerClient.h: Added. * Modules/mediasession: Removed. * platform/mediasession: Removed. Delete Modules/mediasession and platform/mediasession. Move files that were actually used for the WIRELESS_PLAYBACK_TARGET feature to Modules/airplay where other parts of that feature are implemented. * dom/Document.cpp: * dom/Document.h: * dom/EventTargetFactory.in: * html/HTMLMediaElement.cpp: * html/HTMLMediaElement.h: * page/ChromeClient.h: * page/Page.cpp: * page/Page.h: * testing/Internals.cpp: * testing/Internals.h: * testing/Internals.idl: Remove all code inside ENABLE(MEDIA_SESSION). Source/WebKit: Removes all code in ENABLE(MEDIA_SESSION) and all media session related SPI. It was never enabled and nothing ever adopted it. * Sources.txt: * SourcesCocoa.txt: * WebKit.xcodeproj/project.pbxproj: Remove media session related files. * Shared/API/APIObject.h: * Shared/API/c/WKBase.h: * Shared/WebCoreArgumentCoders.cpp: * Shared/WebCoreArgumentCoders.h: * Shared/WebMediaSessionMetadata.cpp: Removed. * Shared/WebMediaSessionMetadata.h: Removed. * UIProcess/API/APIUIClient.h: * UIProcess/API/C/WKAPICast.h: * UIProcess/API/C/WKContext.cpp: * UIProcess/API/C/WKContext.h: * UIProcess/API/C/WKMediaSessionFocusManager.cpp: Removed. * UIProcess/API/C/WKMediaSessionFocusManager.h: Removed. * UIProcess/API/C/WKMediaSessionMetadata.cpp: Removed. * UIProcess/API/C/WKMediaSessionMetadata.h: Removed. * UIProcess/API/C/WKPage.cpp: * UIProcess/API/C/WKPagePrivate.h: * UIProcess/API/C/WKPageUIClient.h: * UIProcess/WebMediaSessionFocusManager.cpp: Removed. * UIProcess/WebMediaSessionFocusManager.h: Removed. * UIProcess/WebMediaSessionFocusManagerClient.cpp: Removed. * UIProcess/WebMediaSessionFocusManagerClient.h: Removed. * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/WebProcessPool.cpp: * UIProcess/WebProcessPool.h: * WebProcess/WebCoreSupport/WebChromeClient.cpp: * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/WebPage.cpp: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: Remove all code in ENABLE(MEDIA_SESSION). Tools: * Scripts/webkitperl/FeatureList.pm: Remove support for building with MEDIA_SESSION enabled. * WebKitTestRunner/TestController.cpp: (WTR::TestController::createOtherPage): (WTR::TestController::createWebViewWithOptions): Update names to new 'unused' naming. LayoutTests: Remove always skipped Media Session tests. * TestExpectations: * gpu-process/TestExpectations: * media/session: Removed. Canonical link: https://commits.webkit.org/230003@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267885 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-10-02 16:39:47 +00:00
Modules/airplay/WebMediaSessionManager.cpp
[Payment Request] upstream new features https://bugs.webkit.org/show_bug.cgi?id=226740 <rdar://problem/78963132> Reviewed by Andy Estes. Source/WebCore: - recurring line items (`HAVE_PASSKIT_RECURRING_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_RECURRING_LINE_ITEM`) - deferred line items (`HAVE_PASSKIT_DEFERRED_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_DEFERRED_LINE_ITEM`) - estimated shipping dates (`HAVE_PASSKIT_SHIPPING_METHOD_DATE_COMPONENTS_RANGE` and `ENABLE_APPLE_PAY_SHIPPING_METHOD_DATE_COMPONENTS_RANGE`) - coupon code entry (`HAVE_PASSKIT_COUPON_CODE` and `ENABLE_APPLE_PAY_COUPON_CODE`) - shipped vs in-store pickup (`HAVE_PASSKIT_SHIPPING_CONTACT_EDITING_MODE` and `ENABLE_APPLE_PAY_SHIPPING_CONTACT_EDITING_MODE`) Tests: http/tests/paymentrequest/ApplePayModifier-additionalLineItems.https.html http/tests/paymentrequest/ApplePayModifier-additionalShippingMethods.https.html http/tests/paymentrequest/ApplePayModifier-total.https.html http/tests/paymentrequest/paymentmethodchange-couponCode.https.html http/tests/paymentrequest/paymentrequest-couponCode.https.html http/tests/paymentrequest/paymentrequest-shippingContactEditingMode.https.html http/tests/paymentrequest/paymentrequest-supportsCouponCode.https.html * Modules/applepay/ApplePayCouponCodeUpdate.idl: Copied from Source/WebCore/Modules/applepay/ApplePayPaymentMethodModeUpdate.idl. * Modules/applepay/ApplePayCouponCodeUpdate.h: Renamed from Source/WebCore/Modules/applepay/ApplePayPaymentMethodModeUpdate.h. (WebCore::ApplePayCouponCodeUpdate::encode const): (WebCore::ApplePayCouponCodeUpdate::decode): Object used to update the payment request via `ApplePaySession.prototype.completeCouponCodeChange` when responding to the user modifying the coupon code. * Modules/applepay/ApplePayErrorCode.idl: * Modules/applepay/ApplePayErrorCode.h: Add `"couponCodeInvalid"` and `"couponCodeExpired"`. * Modules/applepay/ApplePayLineItem.idl: * Modules/applepay/ApplePayLineItem.h: (WebCore::ApplePayLineItem::encode const): (WebCore::ApplePayLineItem::decode): * Modules/applepay/ApplePayPaymentTiming.idl: Added. * Modules/applepay/ApplePayPaymentTiming.h: Added. * Modules/applepay/ApplePayRecurringPaymentDateUnit.idl: Added. * Modules/applepay/ApplePayRecurringPaymentDateUnit.h: Added. Add members that indicate whether this line item is immediate, recurring, or deferred. Depending on that timing, additional members are added for further configuration (e.g. the start and/or end date of a recurring payment, it's frequency, etc.). * Modules/applepay/ApplePayShippingMethod.idl: * Modules/applepay/ApplePayShippingMethod.h: (WebCore::ApplePayShippingMethod::encode const): (WebCore::ApplePayShippingMethod::decode): * Modules/applepay/ApplePayDateComponentsRange.idl: Added. * Modules/applepay/ApplePayDateComponentsRange.h: Added. (WebCore::ApplePayDateComponentsRange::encode const): (WebCore::ApplePayDateComponentsRange::decode): * Modules/applepay/ApplePayDateComponents.idl: Added. * Modules/applepay/ApplePayDateComponents.h: Added. (WebCore::ApplePayDateComponents::encode const): (WebCore::ApplePayDateComponents::decode): Add members that can be used to indicate the estimated shipping dates for this shipping method. * Modules/applepay/ApplePayRequestBase.idl: * Modules/applepay/ApplePayRequestBase.h: * Modules/applepay/ApplePayRequestBase.cpp: (WebCore::convertAndValidate): * Modules/applepay/ApplePaySessionPaymentRequest.h: (WebCore::ApplePaySessionPaymentRequest::supportsCouponCode const): Added. (WebCore::ApplePaySessionPaymentRequest::setSupportsCouponCode): Added. (WebCore::ApplePaySessionPaymentRequest::couponCode const): Added. (WebCore::ApplePaySessionPaymentRequest::setCouponCode): Added. (WebCore::ApplePaySessionPaymentRequest::shippingContactEditingMode const): Added. (WebCore::ApplePaySessionPaymentRequest::setShippingContactEditingMode): Added. * Modules/applepay/ApplePayShippingContactEditingMode.idl: Added. * Modules/applepay/ApplePayShippingContactEditingMode.h: Added. Add members that indicate: - whether this payment request supports a coupon code at all - the initial coupon code (assuming the above) - whether this payment request allows editing the shipping contact (i.e. in-store pickup does not) * dom/EventNames.h: * dom/EventNames.in: * Modules/applepay/ApplePayCouponCodeChangedEvent.idl: Added. * Modules/applepay/ApplePayCouponCodeChangedEvent.h: Added. * Modules/applepay/ApplePayCouponCodeChangedEvent.cpp: Added. (WebCore::ApplePayCouponCodeChangedEvent::ApplePayCouponCodeChangedEvent): (WebCore::ApplePayCouponCodeChangedEvent::eventInterface const): Add a `"couponcodechange"` event that is dispatched whenever the user modifies the coupon code for an `ApplePaySession`. * Modules/applepay/ApplePayCouponCodeDetails.idl: Copied from Source/WebCore/Modules/applepay/ApplePayPaymentMethodModeDetails.idl. * Modules/applepay/ApplePayCouponCodeDetails.h: Copied from Source/WebCore/Modules/applepay/ApplePayPaymentMethodModeUpdate.idl. Used as the `object methodData` when a `PaymentMethodChangeEvent` is dispatched for a `PaymentRequest`. * Modules/applepay/ApplePaySession.idl: * Modules/applepay/ApplePaySession.h: * Modules/applepay/ApplePaySession.cpp: (WebCore::convertAndValidate): (WebCore::ApplePaySession::completeCouponCodeChange): Added. (WebCore::ApplePaySession::didChangeCouponCode): Renamed from `WebCore::ApplePaySession::didChangePaymentMethodMode`. (WebCore::ApplePaySession::canSuspendWithoutCanceling const): (WebCore::ApplePaySession::canBegin const): (WebCore::ApplePaySession::canAbort const): (WebCore::ApplePaySession::canCancel const): (WebCore::ApplePaySession::canCompleteShippingMethodSelection const): (WebCore::ApplePaySession::canCompleteShippingContactSelection const): (WebCore::ApplePaySession::canCompletePaymentMethodSelection const): (WebCore::ApplePaySession::canCompleteCouponCodeChange const): Renamed from `WebCore::ApplePaySession::canCompletePaymentMethodModeChange const`. (WebCore::ApplePaySession::canCompletePayment const): (WebCore::ApplePaySession::isFinalState const): * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h: * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp: (WebCore::ApplePayPaymentHandler::paymentMethodUpdated): (WebCore::ApplePayPaymentHandler::didChangeCouponCode): Renamed from `WebCore::ApplePayPaymentHandler::didChangePaymentMethodMode`. Add methods for JS to call and state logic to handle coupon code changes. * Modules/applepay/PaymentCoordinator.h: * Modules/applepay/PaymentCoordinator.cpp: (WebCore::PaymentCoordinator::completeCouponCodeChange): Renamed from `WebCore::PaymentCoordinator::completePaymentMethodModeChange`. (WebCore::PaymentCoordinator::didChangeCouponCode): Renamed from `WebCore::PaymentCoordinator::didChangePaymentMethodMode`. * Modules/applepay/PaymentCoordinatorClient.h: * loader/EmptyClients.cpp: (WebCore::EmptyPaymentCoordinatorClient::completeCouponCodeChange): Renamed from `WebCore::EmptyPaymentCoordinatorClient::completePaymentMethodModeChange`. Plumbing up to WebKit. * Modules/applepay/cocoa/PaymentSummaryItemsCocoa.mm: (WebCore::toDate): Added. (WebCore::toCalendarUnit): Added. (WebCore::toPKPaymentSummaryItem): Convert WebCore objects to PassKit objects. * testing/MockPaymentCoordinator.idl: * testing/MockPaymentCoordinator.h: * testing/MockPaymentCoordinator.cpp: (WebCore::MockPaymentCoordinator::showPaymentUI): (WebCore::MockPaymentCoordinator::completeCouponCodeChange): Renamed from `WebCore::MockPaymentCoordinator::completePaymentMethodModeChange`. (WebCore::MockPaymentCoordinator::changeCouponCode): Added. * Modules/applepay/cocoa/PaymentAPIVersionCocoa.mm: (WebCore::PaymentAPIVersion::current): * Modules/applepay/PaymentHeaders.h: * Modules/applepay/PaymentSession.h: * Modules/applepay/ApplePayLineItemData.idl: Removed. * Modules/applepay/ApplePayLineItemData.h: Removed. * Modules/applepay/ApplePayShippingMethodData.idl: Removed. * Modules/applepay/ApplePayShippingMethodData.h: Removed. Remove unnecessary base types after r275169. * PlatformMac.cmake: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: Source/WebCore/PAL: - recurring line items (`HAVE_PASSKIT_RECURRING_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_RECURRING_LINE_ITEM`) - deferred line items (`HAVE_PASSKIT_DEFERRED_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_DEFERRED_LINE_ITEM`) - estimated shipping dates (`HAVE_PASSKIT_SHIPPING_METHOD_DATE_COMPONENTS_RANGE` and `ENABLE_APPLE_PAY_SHIPPING_METHOD_DATE_COMPONENTS_RANGE`) - coupon code entry (`HAVE_PASSKIT_COUPON_CODE` and `ENABLE_APPLE_PAY_COUPON_CODE`) - shipped vs in-store pickup (`HAVE_PASSKIT_SHIPPING_CONTACT_EDITING_MODE` and `ENABLE_APPLE_PAY_SHIPPING_CONTACT_EDITING_MODE`) * pal/cocoa/PassKitSoftLink.h: * pal/cocoa/PassKitSoftLink.mm: * pal/spi/cocoa/PassKitSPI.h: Source/WebKit: - recurring line items (`HAVE_PASSKIT_RECURRING_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_RECURRING_LINE_ITEM`) - deferred line items (`HAVE_PASSKIT_DEFERRED_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_DEFERRED_LINE_ITEM`) - estimated shipping dates (`HAVE_PASSKIT_SHIPPING_METHOD_DATE_COMPONENTS_RANGE` and `ENABLE_APPLE_PAY_SHIPPING_METHOD_DATE_COMPONENTS_RANGE`) - coupon code entry (`HAVE_PASSKIT_COUPON_CODE` and `ENABLE_APPLE_PAY_COUPON_CODE`) - shipped vs in-store pickup (`HAVE_PASSKIT_SHIPPING_CONTACT_EDITING_MODE` and `ENABLE_APPLE_PAY_SHIPPING_CONTACT_EDITING_MODE`) * Platform/cocoa/PaymentAuthorizationViewController.mm: (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didChangeCouponCode:handler:]): Added. * Platform/ios/PaymentAuthorizationController.mm: (-[WKPaymentAuthorizationControllerDelegate paymentAuthorizationController:didChangeCouponCode:handler:]): Added. * Platform/cocoa/PaymentAuthorizationPresenter.h: * Platform/cocoa/PaymentAuthorizationPresenter.mm: (WebKit::toPKPaymentErrorCode): (WebKit::PaymentAuthorizationPresenter::completeCouponCodeChange): Renamed from `WebKit::PaymentAuthorizationPresenter::completePaymentMethodModeChange`. * Platform/cocoa/WKPaymentAuthorizationDelegate.h: * Platform/cocoa/WKPaymentAuthorizationDelegate.mm: (-[WKPaymentAuthorizationDelegate completeCouponCodeChange:]): Added. (toDateComponents): Added. (toDateComponentsRange): Added. (toShippingMethod): (-[WKPaymentAuthorizationDelegate _didChangeCouponCode:completion:]): Added. Add plumbing from/to PassKit for coupon code changes. * Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in: * Shared/ApplePay/WebPaymentCoordinatorProxy.h: * Shared/ApplePay/WebPaymentCoordinatorProxy.cpp: (WebKit::WebPaymentCoordinatorProxy::completeCouponCodeChange): Renamed from `WebKit::WebPaymentCoordinatorProxy::completePaymentMethodModeChange`. (WebKit::WebPaymentCoordinatorProxy::presenterDidChangeCouponCode): Renamed from `WebKit::WebPaymentCoordinatorProxy::presenterDidChangePaymentMethodMode`. (WebKit::WebPaymentCoordinatorProxy::canBegin const): (WebKit::WebPaymentCoordinatorProxy::canCancel const): (WebKit::WebPaymentCoordinatorProxy::canCompletePayment const): (WebKit::WebPaymentCoordinatorProxy::canAbort const): * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::toNSDateComponents): Added. (WebKit::toPKDateComponentsRange): Added. (WebKit::toPKShippingMethod): (WebKit::toPKShippingContactEditingMode): Added. (WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest): (WebKit::WebPaymentCoordinatorProxy::platformCompleteCouponCodeChange): Renamed from `WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentMethodModeChange`. Convert PassKit objects to/from WebCore objects. * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder<WebCore::ApplePaySessionPaymentRequest>::encode): (IPC::ArgumentCoder<WebCore::ApplePaySessionPaymentRequest>::decode): * WebProcess/ApplePay/WebPaymentCoordinator.messages.in: * WebProcess/ApplePay/WebPaymentCoordinator.h: * WebProcess/ApplePay/WebPaymentCoordinator.cpp: (WebKit::WebPaymentCoordinator::completeCouponCodeChange): Renamed from `WebKit::WebPaymentCoordinator::completePaymentMethodModeChange`. (WebKit::WebPaymentCoordinator::didChangeCouponCode): Renamed from `WebKit::WebPaymentCoordinator::didChangePaymentMethodMode`. Plumbing into/from WebCore. Source/WebKitLegacy/mac: - recurring line items (`HAVE_PASSKIT_RECURRING_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_RECURRING_LINE_ITEM`) - deferred line items (`HAVE_PASSKIT_DEFERRED_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_DEFERRED_LINE_ITEM`) - estimated shipping dates (`HAVE_PASSKIT_SHIPPING_METHOD_DATE_COMPONENTS_RANGE` and `ENABLE_APPLE_PAY_SHIPPING_METHOD_DATE_COMPONENTS_RANGE`) - coupon code entry (`HAVE_PASSKIT_COUPON_CODE` and `ENABLE_APPLE_PAY_COUPON_CODE`) - shipped vs in-store pickup (`HAVE_PASSKIT_SHIPPING_CONTACT_EDITING_MODE` and `ENABLE_APPLE_PAY_SHIPPING_CONTACT_EDITING_MODE`) * WebCoreSupport/WebPaymentCoordinatorClient.h: * WebCoreSupport/WebPaymentCoordinatorClient.mm: (WebPaymentCoordinatorClient::completeCouponCodeChange): Renamed from `WebPaymentCoordinatorClient::completePaymentMethodModeChange`. Source/WTF: - recurring line items (`HAVE_PASSKIT_RECURRING_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_RECURRING_LINE_ITEM`) - deferred line items (`HAVE_PASSKIT_DEFERRED_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_DEFERRED_LINE_ITEM`) - estimated shipping dates (`HAVE_PASSKIT_SHIPPING_METHOD_DATE_COMPONENTS_RANGE` and `ENABLE_APPLE_PAY_SHIPPING_METHOD_DATE_COMPONENTS_RANGE`) - coupon code entry (`HAVE_PASSKIT_COUPON_CODE` and `ENABLE_APPLE_PAY_COUPON_CODE`) - shipped vs in-store pickup (`HAVE_PASSKIT_SHIPPING_CONTACT_EDITING_MODE` and `ENABLE_APPLE_PAY_SHIPPING_CONTACT_EDITING_MODE`) * wtf/PlatformHave.h: * wtf/PlatformEnableCocoa.h: LayoutTests: * http/tests/paymentrequest/ApplePayModifier-additionalLineItems.https.html: Added. * http/tests/paymentrequest/ApplePayModifier-additionalLineItems.https-expected.txt: Added. * http/tests/paymentrequest/ApplePayModifier-additionalShippingMethods.https.html: Added. * http/tests/paymentrequest/ApplePayModifier-additionalShippingMethods.https-expected.txt: Added. * http/tests/paymentrequest/ApplePayModifier-total.https.html: Added. * http/tests/paymentrequest/ApplePayModifier-total.https-expected.txt: Added. * http/tests/paymentrequest/paymentmethodchange-couponCode.https.html: Added. * http/tests/paymentrequest/paymentmethodchange-couponCode.https-expected.txt: Added. * http/tests/paymentrequest/paymentrequest-couponCode.https.html: Added. * http/tests/paymentrequest/paymentrequest-couponCode.https-expected.txt: Added. * http/tests/paymentrequest/paymentrequest-shippingContactEditingMode.https.html: Added. * http/tests/paymentrequest/paymentrequest-shippingContactEditingMode.https-expected.txt: Added. * http/tests/paymentrequest/paymentrequest-supportsCouponCode.https.html: Added. * http/tests/paymentrequest/paymentrequest-supportsCouponCode.https-expected.txt: Added. * http/tests/ssl/applepay/ApplePayError-expected.txt: * platform/ios-wk2/TestExpectations: * platform/mac-wk2/TestExpectations: Canonical link: https://commits.webkit.org/238613@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278630 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-08 22:15:18 +00:00
Modules/applepay/ApplePayCouponCodeChangedEvent.cpp
Modules/applepay/ApplePayCancelEvent.cpp
Modules/applepay/ApplePayContactField.cpp
Modules/applepay/ApplePayMerchantCapability.cpp
Modules/applepay/ApplePayPaymentAuthorizedEvent.cpp
Modules/applepay/ApplePayPaymentMethodSelectedEvent.cpp
Modules/applepay/ApplePayRequestBase.cpp
Modules/applepay/ApplePaySession.cpp
Modules/applepay/ApplePaySessionPaymentRequest.cpp
Modules/applepay/ApplePaySetup.cpp
Modules/applepay/ApplePaySetupFeature.mm
Modules/applepay/ApplePayShippingContactSelectedEvent.cpp
Modules/applepay/ApplePayShippingMethodSelectedEvent.cpp
Modules/applepay/ApplePayValidateMerchantEvent.cpp
Modules/applepay/PaymentCoordinator.cpp
Modules/applepay/PaymentCoordinatorClient.cpp
Modules/applepay/PaymentInstallmentConfiguration.mm
Modules/applepay/PaymentRequestValidator.mm
Modules/applepay/PaymentSession.cpp
Modules/applepay/cocoa/PaymentAPIVersionCocoa.mm
Modules/applepay/cocoa/PaymentCocoa.mm
Modules/applepay/cocoa/PaymentContactCocoa.mm
Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm
Modules/applepay/cocoa/PaymentMethodCocoa.mm
Modules/applepay/cocoa/PaymentSessionErrorCocoa.mm
Modules/applepay/cocoa/PaymentSummaryItemsCocoa.mm
Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp
[Clipboard API] Support reading "image/png" on ClipboardItem https://bugs.webkit.org/show_bug.cgi?id=212339 <rdar://problem/63588957> Reviewed by Tim Horton. Source/WebCore: Adds support for reading "image/png" data via ClipboardItem.getType(). See below for more details. Tests: ClipboardTests.ConvertTIFFToPNGWhenPasting editing/async-clipboard/clipboard-read-write-images.html * Modules/async-clipboard/Clipboard.cpp: (WebCore::Clipboard::getType): (WebCore::Clipboard::updateSessionValidity): Factor out logic for invalidating the `Clipboard`'s active `Pasteboard` object into a helper method. This is invoked after reading data from the clipboard, and verifies that the changeCount of the pasteboard is still the same as it was upon initially reading the contents of the clipboard. If the clipboard contents changed, we invalidate the session, and `Clipboard` is subsequently denied pasteboard access (until the next time the user explicitly grants programmatic pasteboard access). Note that this step is here for correctness rather than security. While it is true that a compromised web process could fake the changeCount at any given moment, other fairly recent changes around WebPasteboardProxy in the UI process makes it impossible to take advantage of this fact to arbitrarily read content from the system pasteboard. Instead of simply reading the empty string, this invalidation ensures that we actually reject the promise returned by the async clipboard API. * Modules/async-clipboard/Clipboard.h: * Modules/async-clipboard/ClipboardImageReader.cpp: Added. Add a PasteboardFileReader subclass that is responsible for sanitizing image data from the pasteboard into data that may be exposed to the page via clipboard API. On both macOS and iOS, this ensures that potentially sensitive EXIF data is stripped via conversion to the platform image type and back. On macOS, this additionally allows us to handle transcoding TIFF data on the pasteboard to PNG (this is covered by the new API test). (WebCore::ClipboardImageReader::readBuffer): Add a stub implementation for non-Cocoa platforms for now, which don't implement this part of the API. (WebCore::ClipboardImageReader::shouldReadBuffer const): Add a new hook to skip over certain types when reading pasteboard data into Files. In particular, `ClipboardImageReader` skips over any MIME type that does not match the MIME type specified (for now, this is limited to "image/png", but may be extended to include more image types in the future after we implement more transcoding logic). * Modules/async-clipboard/ClipboardImageReader.h: Added. (WebCore::ClipboardImageReader::ClipboardImageReader): (WebCore::ClipboardImageReader::takeResult): * Modules/async-clipboard/ios/ClipboardImageReaderIOS.mm: Added. (WebCore::ClipboardImageReader::readBuffer): Add iOS-specific `(PNG) => PNG` transcoding logic. * Modules/async-clipboard/mac/ClipboardImageReaderMac.mm: Added. (WebCore::ClipboardImageReader::readBuffer): Add macOS-specific `(PNG, TIFF) => PNG` transcoding logic. * Sources.txt: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/Pasteboard.h: (WebCore::PasteboardFileReader::shouldReadBuffer const): * platform/cocoa/PasteboardCocoa.mm: (WebCore::Pasteboard::read): Add support for targeting a given pasteboard item index when reading files on Cocoa platforms. * platform/gtk/PasteboardGtk.cpp: (WebCore::Pasteboard::read): * platform/ios/PlatformPasteboardIOS.mm: (WebCore::safeTypeForDOMToReadAndWriteForPlatformType): (WebCore::webSafeTypes): (WebCore::PlatformPasteboard::informationForItemAtIndex): Expose "image/png" as one of the readable pasteboard types on iOS when using the async clipboard API. For some reason, this adjustment was made on macOS, but wasn't done on iOS, which led to a missing "image/png" type when asking for `ClipboardItem.types`. (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const): Add support for writing "image/png "data to the system pasteboard (note that this data has been sanitized already, as it has been processed through `ClipboardItemTypeLoader::sanitizeDataIfNeeded()`). We simply needed to use `forEachPlatformStringOrBuffer` instead of just `forEachPlatformString` when writing the custom pasteboard data. (WebCore::createItemProviderRegistrationList): * platform/libwpe/PasteboardLibWPE.cpp: (WebCore::Pasteboard::read): * platform/win/PasteboardWin.cpp: (WebCore::Pasteboard::read): Source/WebCore/PAL: Soft link `UIImagePNGRepresentation`. * pal/ios/UIKitSoftLink.h: * pal/ios/UIKitSoftLink.mm: Tools: Add a new API test to verify that TIFF images on the system pasteboard on macOS are automatically converted to PNG data, and is accessible through `ClipboardItem` through the "image/png" type. * TestWebKitAPI/Tests/WebKitCocoa/ClipboardTests.mm: LayoutTests: Add a new layout test to verify that `Clipboard.write` and `Clipboard.read` can be used to copy and then read back PNG image data. * editing/async-clipboard/clipboard-read-write-images-expected.txt: Added. * editing/async-clipboard/clipboard-read-write-images.html: Added. * editing/async-clipboard/resources/async-clipboard-helpers.js: (sampleBase64PNGImageData1): (sampleBase64PNGImageData2): (imageBlob): (sampleBase64PNGImageData): Deleted. * platform/win/TestExpectations: Canonical link: https://commits.webkit.org/225268@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262209 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-05-27 19:50:42 +00:00
Modules/async-clipboard/ios/ClipboardImageReaderIOS.mm
Modules/async-clipboard/mac/ClipboardImageReaderMac.mm
Add a WebRTC SFrame transform https://bugs.webkit.org/show_bug.cgi?id=218752 Reviewed by Eric Carlson. Source/WebCore: Introduce a RTCRtpSFrameTransform that implements the SFrame format. RTCRtpSFrameTransform is a RTCRtpTransform that can be set to RTCRtp sender and receiver objects. API supports setting encryption key. Minor refactoring to reuse WebCrypto routines for encryption/decryption. Test: webrtc/audio-sframe.html * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/mediastream/RTCRtpSFrameTransform.cpp: Added. (WebCore::RTCRtpSFrameTransform::RTCRtpSFrameTransform): (WebCore::RTCRtpSFrameTransform::~RTCRtpSFrameTransform): (WebCore::RTCRtpSFrameTransform::setEncryptionKey): (WebCore::RTCRtpSFrameTransform::initializeTransformer): (WebCore::RTCRtpSFrameTransform::initializeBackendForReceiver): (WebCore::RTCRtpSFrameTransform::initializeBackendForSender): (WebCore::RTCRtpSFrameTransform::willClearBackend): * Modules/mediastream/RTCRtpSFrameTransform.h: Added. * Modules/mediastream/RTCRtpSFrameTransform.idl: Added. * Modules/mediastream/RTCRtpSFrameTransformer.cpp: Added. (WebCore::writeUInt64): (WebCore::lengthOfUInt64): (WebCore::computeFirstHeaderByte): (WebCore::computeIV): (WebCore::parseSFrameHeader): (WebCore::RTCRtpSFrameTransformer::create): (WebCore::RTCRtpSFrameTransformer::RTCRtpSFrameTransformer): (WebCore::RTCRtpSFrameTransformer::~RTCRtpSFrameTransformer): (WebCore::RTCRtpSFrameTransformer::setEncryptionKey): (WebCore::RTCRtpSFrameTransformer::decryptFrame): (WebCore::RTCRtpSFrameTransformer::encryptFrame): (WebCore::RTCRtpSFrameTransformer::transform): (WebCore::RTCRtpSFrameTransformer::computeSaltKey): (WebCore::RTCRtpSFrameTransformer::computeAuthenticationKey): (WebCore::RTCRtpSFrameTransformer::computeEncryptionKey): (WebCore::RTCRtpSFrameTransformer::decryptData): (WebCore::RTCRtpSFrameTransformer::encryptData): (WebCore::RTCRtpSFrameTransformer::computeEncryptedDataSignature): * Modules/mediastream/RTCRtpSFrameTransformer.h: Added. (WebCore::RTCRtpSFrameTransformer::setIsSending): (WebCore::RTCRtpSFrameTransformer::setIsProcessingAudio): * Modules/mediastream/RTCRtpSFrameTransformerCocoa.cpp: Added. (WebCore::deriveHDKFSHA256Bits): (WebCore::transformAES_CTR): (WebCore::RTCRtpSFrameTransformer::computeSaltKey): (WebCore::RTCRtpSFrameTransformer::computeAuthenticationKey): (WebCore::RTCRtpSFrameTransformer::computeEncryptionKey): (WebCore::RTCRtpSFrameTransformer::decryptData): (WebCore::RTCRtpSFrameTransformer::encryptData): (WebCore::RTCRtpSFrameTransformer::computeEncryptedDataSignature): * Sources.txt: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * WebCore.xcodeproj/project.pbxproj: * crypto/mac/CryptoAlgorithmAES_CTRMac.cpp: (WebCore::CryptoAlgorithmAES_CTR::platformEncrypt): (WebCore::CryptoAlgorithmAES_CTR::platformDecrypt): (WebCore::transformAES_CTR): Deleted. * crypto/mac/CryptoAlgorithmHKDFMac.cpp: (WebCore::CryptoAlgorithmHKDF::platformDeriveBits): * crypto/mac/CryptoUtilitiesCocoa.cpp: Added. (WebCore::transformAES_CTR): (WebCore::deriveHDKFSHA256Bits): * crypto/mac/CryptoUtilitiesCocoa.h: Added. * bindings/js/WebCoreBuiltinNames.h: Tools: Add unit tests that validate SFrame generation and parsing. * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WebCore/RTCRtpSFrameTransformerTests.cpp: Added. (TestWebKitAPI::getRawKey): (TestWebKitAPI::createVideoTransformer): (TestWebKitAPI::checkVectorsAreEqual): (TestWebKitAPI::TEST): LayoutTests: * webrtc/audio-sframe-expected.txt: Added. * webrtc/audio-sframe.html: Added. Canonical link: https://commits.webkit.org/231595@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269830 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-11-15 17:59:54 +00:00
Modules/mediastream/RTCRtpSFrameTransformerCocoa.cpp
[Model] [macOS] Add support for rendering model resources https://bugs.webkit.org/show_bug.cgi?id=227530 <rdar://problem/79968206> Reviewed by Dean Jackson. Source/WebCore: On macOS, ASVInlinePreview requires an instance in both the WebProcess and the UIProcess to exist with a matching UUID. On the WebCore side, in the WebProcess, after writing the model resource as a file to disk, we create an instance when a <model> element is created and message the UIProcess through the ChromeClient providing the UUID generated for it. When the UIProcess is done processing this message, it will reply with another message which calls into HTMLModelElement::inlinePreviewDidObtainContextId() with the matching UUID and a context ID for the remote context. We can then set that remote context ID on our ASVInlinePreview instance. We also introduce a HTMLModelElement::platformLayer() method such that RenderLayerBacking::updateConfiguration() can call it to host the ASVInlinePreview layer. * Modules/model-element/HTMLModelElement.cpp: (WebCore::HTMLModelElement::~HTMLModelElement): (WebCore::HTMLModelElement::setSourceURL): (WebCore::HTMLModelElement::notifyFinished): * Modules/model-element/HTMLModelElement.h: * Modules/model-element/HTMLModelElementCocoa.mm: Added. (WebCore::HTMLModelElement::createFile): (WebCore::HTMLModelElement::clearFile): (WebCore::HTMLModelElement::modelDidChange): (WebCore::HTMLModelElement::inlinePreviewDidObtainContextId): (WebCore::HTMLModelElement::platformLayer const): * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * loader/EmptyClients.cpp: (WebCore::EmptyChromeClient::modelElementDidCreatePreview const): * loader/EmptyClients.h: * page/ChromeClient.h: (WebCore::ChromeClient::modelElementDidCreatePreview const): * platform/Logging.h: * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateConfiguration): Source/WebCore/PAL: Declare the ASVInlinePreview class for macOS. * PAL.xcodeproj/project.pbxproj: * pal/spi/mac/SystemPreviewSPI.h: Added. Source/WebKit: On macOS, ASVInlinePreview requires an instance in both the WebProcess and the UIProcess to exist with a matching UUID. On the WebKit side, in the UIProcess, we receive a message from the WebProcess when the ASVInlinePreview in that process was created with its generated UUID. We provide this to the ModelElementController, set the remote connection up and load the file. When those tasks complete successfully we message back the WebProcess with the UUID and the provided ElementContext to talk back to the HTMLModelElement instance that initiated the message to the UIProcess in the first place. * UIProcess/Cocoa/ModelElementControllerCocoa.mm: (WebKit::ModelElementController::modelElementDidCreatePreview): * UIProcess/ModelElementController.h: * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::modelElementDidCreatePreview): (WebKit::WebPageProxy::modelElementPreviewDidObtainContextId): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::modelElementDidCreatePreview const): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::modelElementDidCreatePreview): (WebKit::WebPage::modelElementPreviewDidObtainContextId): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: Source/WTF: Add a new compile-time flag indicating the availability of the ASVInlinePreview SPI on macOS. We only define it when the header itself is present for now to avoid issues with older macOS 12 SDKs, but ultimately we will only use the macOS version check. * wtf/PlatformHave.h: Canonical link: https://commits.webkit.org/239307@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279451 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-01 06:32:12 +00:00
Modules/model-element/HTMLModelElementCocoa.mm
Modules/plugins/QuickTimePluginReplacement.mm
Modules/plugins/YouTubePluginReplacement.cpp
Implement recognizer for SpeechRecognition https://bugs.webkit.org/show_bug.cgi?id=219459 <rdar://problem/71914465> Reviewed by Youenn Fablet. Source/WebCore: Add WebSpeechRecognizerTask, which connects to speech recognition service using Speech framework APIs. Tests: fast/speechrecognition/ios/restart-recognition-after-stop.html fast/speechrecognition/ios/start-recognition-then-stop.html * Modules/speech/SpeechRecognizer.cpp: (WebCore::SpeechRecognizer::reset): (WebCore::SpeechRecognizer::abort): (WebCore::SpeechRecognizer::stop): (WebCore::SpeechRecognizer::start): (WebCore::SpeechRecognizer::startCapture): (WebCore::SpeechRecognizer::stopCapture): (WebCore::SpeechRecognizer::dataCaptured): (WebCore::SpeechRecognizer::startRecognition): (WebCore::SpeechRecognizer::abortRecognition): (WebCore::SpeechRecognizer::stopRecognition): (WebCore::SpeechRecognizer::resetRecognition): (WebCore::SpeechRecognizer::setSource): Deleted. (WebCore::SpeechRecognizer::stopInternal): Deleted. * Modules/speech/SpeechRecognizer.h: * Modules/speech/cocoa/SpeechRecognizerCocoa.mm: Added. (WebCore::SpeechRecognizer::dataCaptured): (WebCore::SpeechRecognizer::startRecognition): (WebCore::SpeechRecognizer::stopRecognition): (WebCore::SpeechRecognizer::abortRecognition): (WebCore::SpeechRecognizer::resetRecognition): * Modules/speech/cocoa/WebSpeechRecognizerTask.h: Added. * Modules/speech/cocoa/WebSpeechRecognizerTask.mm: Added. (-[WebSpeechRecognizerTaskImpl initWithIdentifier:locale:doMultipleRecognitions:reportInterimResults:maxAlternatives:delegateCallback:]): (-[WebSpeechRecognizerTaskImpl callbackWithResult:isFinal:]): (-[WebSpeechRecognizerTaskImpl audioSamplesAvailable:]): (-[WebSpeechRecognizerTaskImpl abort]): (-[WebSpeechRecognizerTaskImpl stop]): (-[WebSpeechRecognizerTaskImpl sendSpeechStartIfNeeded]): (-[WebSpeechRecognizerTaskImpl sendSpeechEndIfNeeded]): (-[WebSpeechRecognizerTaskImpl sendEndIfNeeded]): (-[WebSpeechRecognizerTaskImpl speechRecognizer:availabilityDidChange:]): (-[WebSpeechRecognizerTaskImpl speechRecognitionTask:didHypothesizeTranscription:]): (-[WebSpeechRecognizerTaskImpl speechRecognitionTask:didFinishRecognition:]): (-[WebSpeechRecognizerTaskImpl speechRecognitionTaskWasCancelled:]): (-[WebSpeechRecognizerTaskImpl speechRecognitionTask:didFinishSuccessfully:]): (-[WebSpeechRecognizerTask initWithIdentifier:locale:doMultipleRecognitions:reportInterimResults:maxAlternatives:delegateCallback:]): (-[WebSpeechRecognizerTask audioSamplesAvailable:]): (-[WebSpeechRecognizerTask abort]): (-[WebSpeechRecognizerTask stop]): * Modules/speech/cocoa/WebSpeechRecognizerTaskMock.h: Added. * Modules/speech/cocoa/WebSpeechRecognizerTaskMock.mm: Added. (-[WebSpeechRecognizerTaskMock initWithIdentifier:locale:doMultipleRecognitions:reportInterimResults:maxAlternatives:delegateCallback:]): (-[WebSpeechRecognizerTaskMock audioSamplesAvailable:]): (-[WebSpeechRecognizerTaskMock abort]): (-[WebSpeechRecognizerTaskMock stop]): * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: Source/WebCore/PAL: Add soft linking to Speech framework and SPI. * PAL.xcodeproj/project.pbxproj: * pal/cocoa/SpeechSoftLink.h: Added. * pal/cocoa/SpeechSoftLink.mm: Added. * pal/spi/cocoa/SpeechSPI.h: Added. Source/WebKit: * UIProcess/SpeechRecognitionServer.cpp: (WebKit::SpeechRecognitionServer::SpeechRecognitionServer): (WebKit::SpeechRecognitionServer::requestPermissionForRequest): (WebKit::SpeechRecognitionServer::handleRequest): (WebKit::SpeechRecognitionServer::abort): (WebKit::SpeechRecognitionServer::invalidate): * UIProcess/SpeechRecognitionServer.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::createSpeechRecognitionServer): LayoutTests: * fast/speechrecognition/ios/restart-recognition-after-stop-expected.txt: Added. * fast/speechrecognition/ios/restart-recognition-after-stop.html: Added. * fast/speechrecognition/ios/start-recognition-then-stop-expected.txt: Added. * fast/speechrecognition/ios/start-recognition-then-stop.html: Added. Canonical link: https://commits.webkit.org/232435@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270772 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-12-14 17:45:54 +00:00
Modules/speech/cocoa/SpeechRecognizerCocoa.mm
Modules/speech/cocoa/WebSpeechRecognizerTask.mm
Modules/speech/cocoa/WebSpeechRecognizerTaskMock.mm
Modules/webdatabase/cocoa/DatabaseManagerCocoa.mm
accessibility/ios/AXObjectCacheIOS.mm
accessibility/ios/AccessibilityObjectIOS.mm
accessibility/ios/WebAccessibilityObjectWrapperIOS.mm
Crash in AXIsolatedObject destruction. https://bugs.webkit.org/show_bug.cgi?id=206828 Reviewed by Chris Fleizach. - The previous AXCoreObject::detach method became detachRemoteParts, since this method detaches all references to and from other objects. - The new AXCoreObject::detach method performs three distinctive operations: 1. Detaches the platform wrapper. 2. Detaches all remote references to and from other objects. 3. Sets the object ID to InvalidAXID. - The detachPlatformWrapper method allows for platform-specific customizations. - Added accessibility/isolatedtree/mac/AXIsolatedobject.mm. * PlatformMac.cmake: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::~AXObjectCache): (WebCore::AXObjectCache::remove): * accessibility/AXObjectCache.h: * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::detachRemoteParts): (WebCore::AccessibilityNodeObject::detach): Became detachRemoteParts. * accessibility/AccessibilityNodeObject.h: * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::detachRemoteParts): (WebCore::AccessibilityObject::detach): Became detachRemoteParts. * accessibility/AccessibilityObject.h: * accessibility/AccessibilityObjectInterface.h: (WebCore::AXCoreObject::detachWrapper): (WebCore::AXCoreObject::detach): * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::detachRemoteParts): (WebCore::AccessibilityRenderObject::detach): Became detachRemoteParts. * accessibility/AccessibilityRenderObject.h: * accessibility/AccessibilityScrollView.cpp: (WebCore::AccessibilityScrollView::detachRemoteParts): (WebCore::AccessibilityScrollView::detach): Became detachRemoteParts. * accessibility/AccessibilityScrollView.h: * accessibility/atk/AccessibilityObjectAtk.cpp: (WebCore::AccessibilityObject::detachPlatformWrapper): * accessibility/ios/AXObjectCacheIOS.mm: (WebCore::AXObjectCache::detachWrapper): Deleted, no longer used in COCOA platforms. * accessibility/ios/AccessibilityObjectIOS.mm: (WebCore::AccessibilityObject::detachPlatformWrapper): * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::detachRemoteParts): (WebCore::AXIsolatedObject::detach): Became detachRemoteParts. (WebCore::AXIsolatedObject::disconnect): Replaced with AXCoreObject::detach. * accessibility/isolatedtree/AXIsolatedObject.h: * accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::removeTreeForPageID): (WebCore::AXIsolatedTree::applyPendingChanges): * accessibility/isolatedtree/mac/AXIsolatedObjectMac.mm: (WebCore::AXIsolatedObject::detachPlatformWrapper): * accessibility/mac/AXObjectCacheMac.mm: (WebCore::AXObjectCache::detachWrapper): Deleted, no longer used in COCOA platforms. * accessibility/mac/AccessibilityObjectMac.mm: (WebCore::AccessibilityObject::detachPlatformWrapper): * accessibility/win/AccessibilityObjectWin.cpp: (WebCore::AccessibilityObject::detachPlatformWrapper): Canonical link: https://commits.webkit.org/219831@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255167 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-01-27 21:31:01 +00:00
accessibility/isolatedtree/mac/AXIsolatedObjectMac.mm
accessibility/mac/AXObjectCacheMac.mm
AX: IsolatedTree: Implement more attributes https://bugs.webkit.org/show_bug.cgi?id=193911 <rdar://problem/47599217> Reviewed by Daniel Bates. Source/WebCore: Make use of new HIServices SPI to use a secondary AX thread. Store root node/focused node status in IsolatedTree rather than on the element. Implement the following attributes: children, parent, isIgnored, isTree, isTreeItem, relativeFrame, speechHint, title, description. Implement hit-testing using relative-frames. Ensure that WKAccessibilityWebPageObject queries happen on main thread when they need to. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::generateIsolatedAccessibilityTree): * accessibility/AXObjectCache.h: (WebCore::AXObjectCache::focusedUIElementForPage): * accessibility/AccessibilityAttachment.cpp: (WebCore::AccessibilityAttachment::accessibilityText const): (WebCore::AccessibilityAttachment::accessibilityText): Deleted. * accessibility/AccessibilityAttachment.h: * accessibility/AccessibilityImageMapLink.cpp: (WebCore::AccessibilityImageMapLink::accessibilityText const): (WebCore::AccessibilityImageMapLink::accessibilityText): Deleted. * accessibility/AccessibilityImageMapLink.h: * accessibility/AccessibilityMediaControls.cpp: (WebCore::AccessibilityMediaControl::accessibilityText const): (WebCore::AccessibilityMediaControl::accessibilityText): Deleted. * accessibility/AccessibilityMediaControls.h: * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::accessibilityText const): (WebCore::AccessibilityNodeObject::accessibilityText): Deleted. * accessibility/AccessibilityNodeObject.h: * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::convertFrameToSpace const): (WebCore::AccessibilityObject::relativeFrame const): (WebCore::AccessibilityObject::elementAccessibilityHitTest const): (WebCore::AccessibilityObject::focusedUIElement const): * accessibility/AccessibilityObject.h: (WebCore::AccessibilityObject::accessibilityText const): (WebCore::AccessibilityObject::isLink const): Deleted. (WebCore::AccessibilityObject::isImage const): Deleted. (WebCore::AccessibilityObject::isAttachment const): Deleted. (WebCore::AccessibilityObject::isFileUploadButton const): Deleted. (WebCore::AccessibilityObject::isImageMapLink const): Deleted. (WebCore::AccessibilityObject::isMediaControlLabel const): Deleted. (WebCore::AccessibilityObject::isTree const): Deleted. (WebCore::AccessibilityObject::isTreeItem const): Deleted. (WebCore::AccessibilityObject::isScrollbar const): Deleted. (WebCore::AccessibilityObject::accessibilityHitTest const): Deleted. (WebCore::AccessibilityObject::accessibilityText): Deleted. (WebCore::AccessibilityObject::roleValue const): Deleted. (WebCore::AccessibilityObject::wrapper const): Deleted. * accessibility/AccessibilityObjectInterface.h: Replaced. * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::isTabItemSelected const): (WebCore::AccessibilityRenderObject::remoteSVGElementHitTest const): (WebCore::AccessibilityRenderObject::elementAccessibilityHitTest const): (WebCore::AccessibilityRenderObject::accessibilityHitTest const): (WebCore::AccessibilityRenderObject::selectedChildren): * accessibility/AccessibilityRenderObject.h: * accessibility/AccessibilitySVGElement.cpp: (WebCore::AccessibilitySVGElement::accessibilityText const): (WebCore::AccessibilitySVGElement::accessibilityText): Deleted. * accessibility/AccessibilitySVGElement.h: * accessibility/AccessibilityScrollView.cpp: (WebCore::AccessibilityScrollView::accessibilityHitTest const): * accessibility/AccessibilityScrollView.h: * accessibility/ios/AccessibilityObjectIOS.mm: (WebCore::AccessibilityObject::fileUploadButtonReturnsValueInTitle const): * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper fileUploadButtonReturnsValueInTitle]): Deleted. * accessibility/isolatedtree: Replaced. * accessibility/isolatedtree/AXIsolatedTree.cpp: Added. (WebCore::AXIsolatedTree::treePageCache): (WebCore::AXIsolatedTree::AXIsolatedTree): (WebCore::AXIsolatedTree::nodeInTreeForID): (WebCore::AXIsolatedTree::nodeForID const): (WebCore::AXIsolatedTree::focusedUIElement): (WebCore::AXIsolatedTree::setRootNodeID): (WebCore::AXIsolatedTree::setFocusedNodeID): (WebCore::AXIsolatedTree::setInitialRequestInProgress): (WebCore::AXIsolatedTree::applyPendingChanges): * accessibility/isolatedtree/AXIsolatedTree.h: Added. * accessibility/isolatedtree/AXIsolatedTreeNode.cpp: Added. (WebCore::AXIsolatedTreeNode::AXIsolatedTreeNode): (WebCore::AXIsolatedTreeNode::~AXIsolatedTreeNode): (WebCore::AXIsolatedTreeNode::initializeAttributeData): (WebCore::AXIsolatedTreeNode::setProperty): (WebCore::AXIsolatedTreeNode::setParent): (WebCore::AXIsolatedTreeNode::setTreeIdentifier): (WebCore::AXIsolatedTreeNode::focusedUIElement const): (WebCore::AXIsolatedTreeNode::parentObjectInterfaceUnignored const): (WebCore::AXIsolatedTreeNode::accessibilityHitTest const): (WebCore::AXIsolatedTreeNode::tree const): (WebCore::AXIsolatedTreeNode::rectAttributeValue const): (WebCore::AXIsolatedTreeNode::stringAttributeValue const): * accessibility/isolatedtree/AXIsolatedTreeNode.h: Added. * accessibility/mac/AXObjectCacheMac.mm: (WebCore::AXObjectCache::associateIsolatedTreeNode): * accessibility/mac/AccessibilityObjectBase.mm: Added. (WebCore::AccessibilityObject::speechHintAttributeValue const): (WebCore::AccessibilityObject::descriptionAttributeValue const): (WebCore::AccessibilityObject::titleAttributeValue const): (WebCore::AccessibilityObject::helpTextAttributeValue const): * accessibility/mac/AccessibilityObjectMac.mm: (WebCore::AccessibilityObject::fileUploadButtonReturnsValueInTitle const): * accessibility/mac/WebAccessibilityObjectWrapperBase.h: * accessibility/mac/WebAccessibilityObjectWrapperBase.mm: (addChildToArray): (convertToNSArray): (-[WebAccessibilityObjectWrapperBase isolatedTreeNode]): (-[WebAccessibilityObjectWrapperBase detach]): (-[WebAccessibilityObjectWrapperBase updateObjectBackingStore]): (-[WebAccessibilityObjectWrapperBase accessibilityObject]): (-[WebAccessibilityObjectWrapperBase baseAccessibilityTitle]): (-[WebAccessibilityObjectWrapperBase axBackingObject]): (-[WebAccessibilityObjectWrapperBase baseAccessibilityDescription]): (-[WebAccessibilityObjectWrapperBase baseAccessibilitySpeechHint]): (-[WebAccessibilityObjectWrapperBase baseAccessibilityHelpText]): (convertPathToScreenSpaceFunction): (-[WebAccessibilityObjectWrapperBase convertRectToSpace:space:]): (-[WebAccessibilityObjectWrapperBase ariaLandmarkRoleDescription]): (-[WebAccessibilityObjectWrapperBase titleTagShouldBeUsedInDescriptionField]): Deleted. (-[WebAccessibilityObjectWrapperBase fileUploadButtonReturnsValueInTitle]): Deleted. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper IGNORE_WARNINGS_END]): (-[WebAccessibilityObjectWrapper childrenVectorSize]): (-[WebAccessibilityObjectWrapper childrenVectorArray]): (-[WebAccessibilityObjectWrapper position]): (-[WebAccessibilityObjectWrapper subrole]): (-[WebAccessibilityObjectWrapper roleDescription]): (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): (-[WebAccessibilityObjectWrapper accessibilityFocusedUIElement]): (-[WebAccessibilityObjectWrapper accessibilityHitTest:]): (-[WebAccessibilityObjectWrapper accessibilityIndexOfChild:]): (-[WebAccessibilityObjectWrapper accessibilityArrayAttributeCount:]): (-[WebAccessibilityObjectWrapper accessibilityArrayAttributeValues:index:maxCount:]): Source/WebCore/PAL: * pal/spi/mac/HIServicesSPI.h: Source/WebKit: * Platform/spi/mac/AccessibilityPrivSPI.h: Added. * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.h: * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm: (-[WKAccessibilityWebPageObjectBase clientSupportsIsolatedTree]): (-[WKAccessibilityWebPageObjectBase isolatedTreeRootObject]): (-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper]): * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm: (-[WKAccessibilityWebPageObject IGNORE_WARNINGS_END]): (-[WKAccessibilityWebPageObject convertScreenPointToRootView:]): (-[WKAccessibilityWebPageObject accessibilityAttributeValue:]): (-[WKAccessibilityWebPageObject accessibilityAttributeSizeValue]): (-[WKAccessibilityWebPageObject accessibilityAttributePositionValue]): (-[WKAccessibilityWebPageObject accessibilityDataDetectorValue:point:]): (-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]): (-[WKAccessibilityWebPageObject accessibilityHitTest:]): Canonical link: https://commits.webkit.org/208976@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241321 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-02-12 22:55:33 +00:00
accessibility/mac/AccessibilityObjectBase.mm
accessibility/mac/AccessibilityObjectMac.mm
accessibility/mac/WebAccessibilityObjectWrapperBase.mm @no-unify
accessibility/mac/WebAccessibilityObjectWrapperMac.mm @no-unify
bindings/js/ScriptControllerMac.mm
bridge/objc/ObjCRuntimeObject.mm @no-unify
bridge/objc/WebScriptObject.mm @no-unify
bridge/objc/objc_class.mm @no-unify
bridge/objc/objc_instance.mm @no-unify
bridge/objc/objc_runtime.mm @no-unify
bridge/objc/objc_utility.mm @no-unify
crypto/CommonCryptoUtilities.cpp
crypto/mac/CommonCryptoDERUtilities.cpp
crypto/mac/CryptoAlgorithmAES_CBCMac.cpp
crypto/mac/CryptoAlgorithmAES_CFBMac.cpp
crypto/mac/CryptoAlgorithmAES_CTRMac.cpp
crypto/mac/CryptoAlgorithmAES_GCMMac.cpp
crypto/mac/CryptoAlgorithmAES_KWMac.cpp
crypto/mac/CryptoAlgorithmECDHMac.cpp
crypto/mac/CryptoAlgorithmECDSAMac.cpp
crypto/mac/CryptoAlgorithmHKDFMac.cpp
crypto/mac/CryptoAlgorithmHMACMac.cpp
crypto/mac/CryptoAlgorithmPBKDF2Mac.cpp
crypto/mac/CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp
crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp
crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp
crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp
crypto/mac/CryptoAlgorithmRegistryMac.cpp
crypto/mac/CryptoKeyECMac.cpp
crypto/mac/CryptoKeyMac.cpp
crypto/mac/CryptoKeyRSAMac.cpp
Add a WebRTC SFrame transform https://bugs.webkit.org/show_bug.cgi?id=218752 Reviewed by Eric Carlson. Source/WebCore: Introduce a RTCRtpSFrameTransform that implements the SFrame format. RTCRtpSFrameTransform is a RTCRtpTransform that can be set to RTCRtp sender and receiver objects. API supports setting encryption key. Minor refactoring to reuse WebCrypto routines for encryption/decryption. Test: webrtc/audio-sframe.html * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/mediastream/RTCRtpSFrameTransform.cpp: Added. (WebCore::RTCRtpSFrameTransform::RTCRtpSFrameTransform): (WebCore::RTCRtpSFrameTransform::~RTCRtpSFrameTransform): (WebCore::RTCRtpSFrameTransform::setEncryptionKey): (WebCore::RTCRtpSFrameTransform::initializeTransformer): (WebCore::RTCRtpSFrameTransform::initializeBackendForReceiver): (WebCore::RTCRtpSFrameTransform::initializeBackendForSender): (WebCore::RTCRtpSFrameTransform::willClearBackend): * Modules/mediastream/RTCRtpSFrameTransform.h: Added. * Modules/mediastream/RTCRtpSFrameTransform.idl: Added. * Modules/mediastream/RTCRtpSFrameTransformer.cpp: Added. (WebCore::writeUInt64): (WebCore::lengthOfUInt64): (WebCore::computeFirstHeaderByte): (WebCore::computeIV): (WebCore::parseSFrameHeader): (WebCore::RTCRtpSFrameTransformer::create): (WebCore::RTCRtpSFrameTransformer::RTCRtpSFrameTransformer): (WebCore::RTCRtpSFrameTransformer::~RTCRtpSFrameTransformer): (WebCore::RTCRtpSFrameTransformer::setEncryptionKey): (WebCore::RTCRtpSFrameTransformer::decryptFrame): (WebCore::RTCRtpSFrameTransformer::encryptFrame): (WebCore::RTCRtpSFrameTransformer::transform): (WebCore::RTCRtpSFrameTransformer::computeSaltKey): (WebCore::RTCRtpSFrameTransformer::computeAuthenticationKey): (WebCore::RTCRtpSFrameTransformer::computeEncryptionKey): (WebCore::RTCRtpSFrameTransformer::decryptData): (WebCore::RTCRtpSFrameTransformer::encryptData): (WebCore::RTCRtpSFrameTransformer::computeEncryptedDataSignature): * Modules/mediastream/RTCRtpSFrameTransformer.h: Added. (WebCore::RTCRtpSFrameTransformer::setIsSending): (WebCore::RTCRtpSFrameTransformer::setIsProcessingAudio): * Modules/mediastream/RTCRtpSFrameTransformerCocoa.cpp: Added. (WebCore::deriveHDKFSHA256Bits): (WebCore::transformAES_CTR): (WebCore::RTCRtpSFrameTransformer::computeSaltKey): (WebCore::RTCRtpSFrameTransformer::computeAuthenticationKey): (WebCore::RTCRtpSFrameTransformer::computeEncryptionKey): (WebCore::RTCRtpSFrameTransformer::decryptData): (WebCore::RTCRtpSFrameTransformer::encryptData): (WebCore::RTCRtpSFrameTransformer::computeEncryptedDataSignature): * Sources.txt: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * WebCore.xcodeproj/project.pbxproj: * crypto/mac/CryptoAlgorithmAES_CTRMac.cpp: (WebCore::CryptoAlgorithmAES_CTR::platformEncrypt): (WebCore::CryptoAlgorithmAES_CTR::platformDecrypt): (WebCore::transformAES_CTR): Deleted. * crypto/mac/CryptoAlgorithmHKDFMac.cpp: (WebCore::CryptoAlgorithmHKDF::platformDeriveBits): * crypto/mac/CryptoUtilitiesCocoa.cpp: Added. (WebCore::transformAES_CTR): (WebCore::deriveHDKFSHA256Bits): * crypto/mac/CryptoUtilitiesCocoa.h: Added. * bindings/js/WebCoreBuiltinNames.h: Tools: Add unit tests that validate SFrame generation and parsing. * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WebCore/RTCRtpSFrameTransformerTests.cpp: Added. (TestWebKitAPI::getRawKey): (TestWebKitAPI::createVideoTransformer): (TestWebKitAPI::checkVectorsAreEqual): (TestWebKitAPI::TEST): LayoutTests: * webrtc/audio-sframe-expected.txt: Added. * webrtc/audio-sframe.html: Added. Canonical link: https://commits.webkit.org/231595@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269830 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-11-15 17:59:54 +00:00
crypto/mac/CryptoUtilitiesCocoa.cpp
crypto/mac/SerializedCryptoKeyWrapMac.mm
dom/DataTransferMac.mm
Support simulated mouse events on iOS based on a PlatformTouchEvent https://bugs.webkit.org/show_bug.cgi?id=194501 <rdar://problem/46910790> Reviewed by Dean Jackson. Source/WebCore: Add support for two new internal runtime flags to control whether simulated mouse events should be dipatched along with touch events and whether simulated mousemove events dispatched should automatically trigger the behavior preventDefault() would also trigger. To facilitate that, we allow for a MouseEvent to be created, much like a PointerEvent, based on a PlatformTouchEvent. Then, we set a flag on Event within EventTarget::innerInvokeEventListeners() to see whether any page code has been evaluated as a result of a mousemove event being dispatched. Finally, we also track mouse events when invalidating touch regions provided the required internal runtime flag is on. Test: fast/events/touch/ios/mouse-events-dispatch-with-touch.html * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * dom/Event.cpp: * dom/Event.h: (WebCore::Event::hasEncounteredListener const): (WebCore::Event::setHasEncounteredListener): * dom/EventNames.h: (WebCore::EventNames::isTouchRelatedEventType const): (WebCore::EventNames::touchRelatedEventNames const): (WebCore::EventNames::extendedTouchRelatedEventNames const): (WebCore::EventNames::isTouchEventType const): Deleted. (WebCore::EventNames::touchAndPointerEventNames const): Deleted. * dom/EventTarget.cpp: (WebCore::EventTarget::innerInvokeEventListeners): * dom/MouseEvent.h: * dom/Node.cpp: (WebCore::Node::moveNodeToNewDocument): (WebCore::tryAddEventListener): (WebCore::tryRemoveEventListener): (WebCore::Node::defaultEventHandler): * dom/ios/MouseEventIOS.cpp: Added. (WebCore::mouseEventType): (WebCore::MouseEvent::create): * dom/ios/PointerEventIOS.cpp: (WebCore::pointerEventType): (WebCore::PointerEvent::create): (WebCore::eventType): Deleted. * page/DOMWindow.cpp: (WebCore::DOMWindow::addEventListener): (WebCore::DOMWindow::removeEventListener): * page/EventHandler.h: * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::mouseEventsSimulationEnabled const): (WebCore::RuntimeEnabledFeatures::setMouseEventsSimulationEnabled): (WebCore::RuntimeEnabledFeatures::mousemoveEventHandlingPreventsDefaultEnabled const): (WebCore::RuntimeEnabledFeatures::setMousemoveEventHandlingPreventsDefaultEnabled): Source/WebKit: Add two new internal runtime flags to control whether simulated mouse events should be dipatched along with touch events and whether simulated mousemove events dispatched should automatically trigger the behavior preventDefault() would also trigger. We also ensure that we correctly create touch tracking regions for mouse events. * Shared/WebPreferences.yaml: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::updateTouchEventTracking): LayoutTests: Add a new test to check that we correctly dispatch mouse events as touches occur. * fast/events/touch/ios/mouse-events-dispatch-with-touch-expected.txt: Added. * fast/events/touch/ios/mouse-events-dispatch-with-touch.html: Added. * pointerevents/utils.js: (prototype.handleEvent): (prototype._handlePointerEvent): (prototype._handleMouseEvent): Canonical link: https://commits.webkit.org/209003@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241432 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-02-13 13:34:43 +00:00
dom/ios/MouseEventIOS.cpp
dom/ios/PointerEventIOS.cpp
dom/ios/TouchEvents.cpp
[macOS] ImageOverlayController should paint selection quads instead of bounding rects https://bugs.webkit.org/show_bug.cgi?id=225585 <rdar://problem/77725745> Reviewed by Tim Horton. Source/WebCore: Teach `SelectionRectGatherer` (now renamed to `SelectionGeometryGatherer`) to emit quads, rather than bounding rects around each quad. We use these quads in `ImageOverlayController` to render selection quads via page overlay (i.e., in the case where the image containing the overlay is transparent). Test: fast/images/image-extraction/mac/select-rotated-transparent-image-overlay.html * Headers.cmake: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * editing/SelectionGeometryGatherer.cpp: Renamed from Source/WebCore/editing/SelectionRectGatherer.cpp. Rename `SelectionRectGatherer` to `SelectionGeometryGatherer`, to reflect the fact that this helper class now aggregates both selection quads and gap rects. (WebCore::SelectionGeometryGatherer::SelectionGeometryGatherer): (WebCore::SelectionGeometryGatherer::addQuad): Rename `addRect` to `addQuad`, and make it take a `FloatQuad` instead. (WebCore::SelectionGeometryGatherer::addGapRects): (WebCore::SelectionGeometryGatherer::Notifier::Notifier): (WebCore::SelectionGeometryGatherer::Notifier::~Notifier): (WebCore::SelectionGeometryGatherer::boundingRects const): (WebCore::SelectionGeometryGatherer::clearAndCreateNotifier): * editing/SelectionGeometryGatherer.h: Renamed from Source/WebCore/editing/SelectionRectGatherer.h. (WebCore::SelectionGeometryGatherer::setTextOnly): (WebCore::SelectionGeometryGatherer::isTextOnly const): * html/HTMLElement.cpp: (WebCore::HTMLElement::updateWithImageExtractionResult): Minor tweak - don't add any margin around the word when the line only contains a single word. * page/ImageOverlayController.cpp: (WebCore::ImageOverlayController::selectionQuadsDidChange): Rename `selectionRectsDidChange` to `selectionQuadsDidChange`, and take a `FloatQuad` in absolute coordinates instead of a `LayoutRect`. Store these quads in `m_overlaySelectionQuads` (also renamed from `m_overlaySelectionRects`). (WebCore::ImageOverlayController::uninstallPageOverlayIfNeeded): (WebCore::ImageOverlayController::drawRect): Make a few changes when painting selections using the `ImageOverlayController`: 1. Instead of painting with `fillRect()`, coalesce all of the collected selection quads into a single `Path` object, and pass that `Path` into `fillPath()`. This allows us to render each piece of selected content as a quad instead of a bounding rect, and additionally prevents us from rendering overlapping selections when using `ImageOverlayController`. 2. Clip selections to the absolute bounds of the image overlay host element's renderer, which prevents the new selection quads from spilling out of the host element. (WebCore::ImageOverlayController::selectionRectsDidChange): Deleted. * page/ImageOverlayController.h: * rendering/RenderSelectionInfo.cpp: (WebCore::RenderSelectionInfo::RenderSelectionInfo): * rendering/RenderSelectionInfo.h: (WebCore::RenderSelectionInfo::collectedSelectionQuads const): (WebCore::RenderSelectionInfo::collectedSelectionRects const): Deleted. More minor refactoring: rename `collectedSelectionRects` to `collectedSelectionQuads`, and make it take the original `FloatQuad` instead of the quad's bounding box. * rendering/RenderText.cpp: (WebCore::RenderText::collectSelectionGeometriesForLineBoxes): * rendering/RenderText.h: * rendering/SelectionRangeData.cpp: (WebCore::SelectionRangeData::SelectionRangeData): (WebCore::SelectionRangeData::set): (WebCore::SelectionRangeData::apply): * rendering/SelectionRangeData.h: LayoutTests: Add a new layout test to cover the change. Currently, the below test case renders a visible selection rect in the image overlay since we render the bounding rect of the overlay text quad, which intersects with the image overlay's bounds. However, the text quad is positioned outside of the image overlay, so there shouldn't be any visible selection rect. As such, this test is expected to render the same content as a plain image (even without an image overlay). Unfortunately, I couldn't write a matching ref-test for the case where the selection rect is inside the bounds of the image overlay, since doing so led to tiny subpixel differences between the transparent image case (using `ImageOverlayController`) and the regular image overlay selection case. * fast/images/image-extraction/mac/select-rotated-transparent-image-overlay-expected.html: Added. * fast/images/image-extraction/mac/select-rotated-transparent-image-overlay.html: Added. Canonical link: https://commits.webkit.org/237541@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277274 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-10 18:10:03 +00:00
editing/SelectionGeometryGatherer.cpp
editing/SmartReplaceCF.cpp
[iOS] Implement support for dictation alternatives https://bugs.webkit.org/show_bug.cgi?id=208720 <rdar://problem/58540114> Reviewed by Wenson Hsieh. Part 1 Source/WebCore: Rename editing/mac/AlternativeTextUIController.{h, mm} to editing/cocoa/AlternativeTextUIController.{h, mm} as it can be shared by both Mac and iOS. I also took this opportunity to do some very minor modernization and cleanup to these files: use =default constructors and put the * on the right side for Objective-C types. 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. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * editing/cocoa/AlternativeTextContextController.h: * editing/cocoa/AlternativeTextContextController.mm: Added. (WebCore::AlternativeTextContextController::addAlternatives): (WebCore::AlternativeTextContextController::alternativesForContext): (WebCore::AlternativeTextContextController::removeAlternativesForContext): (WebCore::AlternativeTextContextController::clear): * editing/cocoa/AlternativeTextUIController.h: Renamed from Source/WebCore/editing/mac/AlternativeTextUIController.h. * editing/cocoa/AlternativeTextUIController.mm: Renamed from Source/WebCore/editing/mac/AlternativeTextUIController.mm. (WebCore::AlternativeTextUIController::addAlternatives): (WebCore::AlternativeTextUIController::alternativesForContext): (WebCore::AlternativeTextUIController::clear): (WebCore::AlternativeTextUIController::showAlternatives): (WebCore::AlternativeTextUIController::handleAcceptedAlternative): (WebCore::AlternativeTextUIController::dismissAlternatives): (WebCore::AlternativeTextUIController::removeAlternatives): Source/WebCore/PAL: Expose some more SPI. * pal/spi/ios/UIKitSPI.h: Source/WebKit: 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. Canonical link: https://commits.webkit.org/221694@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258085 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-03-08 00:26:17 +00:00
editing/cocoa/AlternativeTextContextController.mm
editing/cocoa/AlternativeTextUIController.mm
editing/cocoa/AutofillElements.cpp
editing/cocoa/DataDetection.mm
Move Lookup Code for better cross platform usage https://bugs.webkit.org/show_bug.cgi?id=191732 Reviewed by Alex Christensen. Source/WebCore: Not currenlty testable DictionaryLookup uses Reveal now, which is slated to be cross-platform. That patch gates the parts of DictionaryLookup that currently do not have an available implementation on iOS. Once Reveal is ready, this code will be replaced or expanded upon, as appropriate. * editing/mac/DictionaryLookup.h: * editing/mac/DictionaryLookup.mm: (WebCore::showPopupOrCreateAnimationController): (WebCore::DictionaryLookup::showPopup): (WebCore::DictionaryLookup::hidePopup): (WebCore::DictionaryLookup::animationControllerForPopup): Source/WebCore/PAL: * pal/spi/mac/LookupSPI.h: * pal/spi/mac/RevealSPI.h: Source/WebKit: Lookup is being replaced by Reveal. This framework should work on all platforms. The patch moves the code that we expect will be needed for all platforms to the more general cocoa area. This patch changes no funcationality, and should not change anything currently. This work will be build on later when Reveal is ready to support multiple platforms. * Platform/spi/ios/UIKitSPI.h: * UIProcess/Cocoa/WebPageProxyCocoa.mm: (WebKit::WebPageProxy::performDictionaryLookupAtLocation): (WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection): * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setupInteraction]): (-[WKContentView cleanupInteraction]): (-[WKContentView _removeDefaultGestureRecognizers]): (-[WKContentView _addDefaultGestureRecognizers]): (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]): (-[WKContentView _lookupGestureRecognized:]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::performDictionaryLookupAtLocation): Deleted. * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::performDictionaryLookupAtLocation): Deleted. (WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection): Deleted. * WebProcess/WebPage/Cocoa/WebPageCocoa.mm: (WebKit::WebPage::performDictionaryLookupAtLocation): (WebKit::WebPage::performDictionaryLookupForSelection): (WebKit::WebPage::performDictionaryLookupOfCurrentSelection): (WebKit::WebPage::performDictionaryLookupForRange): (WebKit::WebPage::dictionaryPopupInfoForRange): * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::performDictionaryLookupAtLocation): Deleted. (WebKit::WebPage::performDictionaryLookupForSelection): Deleted. (WebKit::WebPage::performDictionaryLookupForRange): Deleted. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::performDictionaryLookupAtLocation): Deleted. (WebKit::WebPage::performDictionaryLookupForSelection): Deleted. (WebKit::WebPage::performDictionaryLookupOfCurrentSelection): Deleted. (WebKit::WebPage::dictionaryPopupInfoForRange): Deleted. (WebKit::WebPage::performDictionaryLookupForRange): Deleted. Canonical link: https://commits.webkit.org/206847@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238697 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-11-29 22:59:07 +00:00
editing/cocoa/DictionaryLookup.mm
editing/cocoa/EditorCocoa.mm
[macOS] Cannot change font size at selection until font panel is shown https://bugs.webkit.org/show_bug.cgi?id=189295 <rdar://problem/35593389> Reviewed by Ryosuke Niwa. Source/WebCore: Currently, attempting to alter the font size of currently selected editable text in WKWebView via menu items will fail if the font panel has never been shown. This is because WebViewImpl::changeFontFromFontPanel, which is responsible for converting the current font at the selection to the new font using -[NSFontManager convertFont:] bails as a result of NSFontManager's currently selected font always being nil. WKWebView is responsible for keeping NSFontManager up-to-date with the currently selected font; in fact, this was initially the case in r180465, which introduced NSFontManager support in WebKit2 by propagating EditorState updates that contained font information for the current selection. However, this regressed performance due to selected font computation triggering extra layout passes; r180768 addressed this by introducing a mechanism for requesting the font at the current selection, and only updating NSFontManager with the new selected font when the shared font panel is visible (determined by KVO on NSFontPanel). However, this again regressed WKWebView launch performance, due to KVO registration always forcing the shared NSFontPanel to be created. r182037 addressed this by only registering for KVO on the font panel if the WKWebView has been made editable (SPI on WKWebView). This leads to two issues when attempting to alter font attributes using macOS UI: (1) in web views that have not been made editable using SPI, showing the font panel and attempting to change the font fails due to the selected font staying nil, because we've never begun registering for KVO notifications on the font panel so we don't try to keep the font manager up to date. (2) Even if the web view is made editable, if the font panel is never shown, then the font manager still won't be kept up to date with the current selection, so changing fonts using menu items still does not work. We fix both of these problems by refactoring font manager support on WebKit2 such that an up-to-date selected font in the UI process is no longer necessary in order to alter the font at the current selection. To do this, we figure out what changes the NSFontManager would've made to the currently selected font in the UI process, and then propagate this information to the web process, where we convert this information into an EditingStyle which we apply to the current selection. The code to both determine the attributes changed by NSFontManager and to convert these attributes into editing styles to be applied via Editor already exists in WebKitLegacy, in WebHTMLView.mm. This patch moves this existing logic into WebCore and teases it apart into two portions: the first portion probes NSFontManager to determine which aspects of the font changed and constructs FontChanges, which captures these differences. The second portion maps FontChanges to an EditingStyle, which can then be applied to the current selection. In WebKitLegacy, we construct FontChanges using the font manager, and then immediately use it to create and apply an EditingStyle. In WebKit, we construct FontChanges in the UI process using the font manager, and then send this over to the web process via WebPage::changeFont, which then creates and applies the EditingStyle. Note that this patch also introduces FontAttributeChanges, which is similar in concept to FontChanges, but captures a broader range of changes possible via NSFontPanel. This was done so that we can eliminate all of the font manager probing code (along with the two specimen fonts) from WebHTMLView, but is also necessary in order to allow changing font shadow, strikethrough, and underlines via the font panel to work in WebKit2. This will be fixed in a followup, by making FontAttributeChanges IPC encodable and by making WKWebView/WKView respond to the -changeAttributes: selector. Changes in behavior to WebKit2 are covered by new API tests; legacy WebKit behavior should remain unchanged. Tests: FontManagerTests.ChangeFontSizeWithMenuItems FontManagerTests.ChangeFontWithPanel * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * editing/Editor.h: Remove applyFontStyles. * editing/FontAttributeChanges.cpp: Added. (WebCore::FontChanges::platformFontFamilyNameForCSS const): Given a font family name and a font name, returns the string to use as the "font-family" style property value. Originally from WebHTMLView.mm. (WebCore::FontChanges::createEditingStyle const): Converts font changes to an EditingStyle that can be used to apply these changes. (WebCore::FontChanges::createStyleProperties const): Introduce FontChanges, which encapsulates changes which are to be applied to the font in the current selection. (WebCore::cssValueListForShadow): (WebCore::FontAttributeChanges::createEditingStyle const): Converts font attribute changes to an EditingStyle that can be used to apply these changes. * editing/FontAttributeChanges.h: Added. Introduce FontAttributeChanges, which encapsulates changes which are to be applied to the font attributes in the current selection. This includes a set of FontChanges, as well as additional attributes such as strike-through and underlines. (WebCore::FontChanges::setFontName): (WebCore::FontChanges::setFontFamily): (WebCore::FontChanges::setFontSize): (WebCore::FontChanges::setFontSizeDelta): (WebCore::FontChanges::setBold): (WebCore::FontChanges::setItalic): (WebCore::FontAttributeChanges::setVerticalAlign): (WebCore::FontAttributeChanges::setBackgroundColor): (WebCore::FontAttributeChanges::setForegroundColor): (WebCore::FontAttributeChanges::setShadow): (WebCore::FontAttributeChanges::setStrikeThrough): (WebCore::FontAttributeChanges::setUnderline): (WebCore::FontAttributeChanges::setFontChanges): Setters for FontChanges and FontAttributeChanges. Initially, most of these values are optional, indicating that there should be no change. (WebCore::FontChanges::encode const): (WebCore::FontChanges::decode): Add encoding/decoding support to FontChanges, so that it can be sent over IPC for WebKit2. * editing/cocoa/FontAttributeChangesCocoa.mm: Added. (WebCore::FontChanges::platformFontFamilyNameForCSS const): Helper method to determine whether the font family or the font name should be used, by looking up the PostScript font name using a FontDescriptor and comparing it against the result of -[NSFont fontName]. This logic was originally in WebHTMLView.mm. * editing/mac/EditorMac.mm: (WebCore::Editor::applyFontStyles): Deleted. * platform/mac/WebCoreNSFontManagerExtras.h: Added. * platform/mac/WebCoreNSFontManagerExtras.mm: Added. Add helper functions to compute FontChanges and FontAttributeChanges from NSFontManager. (WebCore::firstFontConversionSpecimen): (WebCore::secondFontConversionSpecimen): Two "specimen fonts" used to determine what changes NSFontManager or NSFontPanel makes when performing font or font attribute conversion. Moved from WebHTMLView.mm. (WebCore::computedFontChanges): (WebCore::computedFontAttributeChanges): Moved here from WebHTMLView.mm. Instead of converting font attributes to NSStrings and setting properties on DOMCSSStyleDeclaration, we instead specify properties on MutableStyleProperties using CSSValues. Source/WebKit: Refactors NSFontManager support in WebKit2. See WebCore ChangeLog for more details. * Scripts/webkit/messages.py: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView changeFont:]): * UIProcess/API/mac/WKView.mm: (-[WKView changeFont:]): * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::changeFontFromFontManager): (WebKit::WebViewImpl::changeFontFromFontPanel): Deleted. Renamed this from changeFontFromFontPanel to changeFontFromFontManager. This new name is more accurate in the case where a menu item is used to alter the font, which doesn't involve NSFontPanel at all. * UIProcess/WebPageProxy.h: * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::changeFont): (WebKit::WebPageProxy::setFont): Deleted. * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::changeFont): (WebKit::WebPage::setFont): Deleted. Source/WebKitLegacy/mac: Remove code in WebKitLegacy for diffing NSFonts to figure out which style properties need to be changed. See WebCore ChangeLog for more details. * WebView/WebHTMLView.mm: (-[WebHTMLView changeFont:]): (-[WebHTMLView changeAttributes:]): (-[WebHTMLView _originalFontA]): Deleted. (-[WebHTMLView _originalFontB]): Deleted. (fontNameForDescription): Deleted. (-[WebHTMLView _addToStyle:fontA:fontB:]): Deleted. (-[WebHTMLView _styleFromFontManagerOperation]): Deleted. (-[WebHTMLView _styleForAttributeChange:]): Deleted. Tools: Add API tests to simulate using menu items to increase or decrease font size, and also simulate using NSFontPanel to specify the font family, font size, and other traits. * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/mac/FontManagerTests.mm: Added. (-[TestWKWebView selectedText]): (-[TestWKWebView selectNextWord]): (-[TestWKWebView stylePropertyAtSelectionStart:]): (-[TestWKWebView stylePropertyAtSelectionEnd:]): (webViewForFontManagerTesting): (menuItemCellForFontAction): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/204355@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235748 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-09-06 19:46:38 +00:00
editing/cocoa/FontAttributeChangesCocoa.mm
Refactor Editor::fontAttributesForSelectionStart to be platform-agnostic https://bugs.webkit.org/show_bug.cgi?id=189918 Work towards <rdar://problem/44648705> Reviewed by Tim Horton. Source/WebCore: Refactors the functionality in Editor::fontAttributesForSelectionStart to not be Cocoa-only. Rename this to fontAttributesAtSelectionStart (to be consistent with `EditingStyle::styleAtSelectionStart`) and move it from EditorCocoa.mm to Editor.cpp; instead of creating and populating an NSDictionary with font attribute information, create and populate a new `FontAttributes` struct that contains the same information. Cocoa clients in WebKitLegacy may then create an `NSDictionary` as needed from the `FontAttributes`. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * editing/Editor.cpp: (WebCore::Editor::platformFontAttributesAtSelectionStart const): Add a hook to allow platforms to supply additional information in FontAttributes. On Cocoa, this adds a UIFont or NSFont to FontAttributes; otherwise, this is a no-op. (WebCore::Editor::fontAttributesAtSelectionStart const): * editing/Editor.h: * editing/FontAttributeChanges.cpp: (WebCore::cssValueListForShadow): * editing/FontAttributeChanges.h: (): Deleted. (WebCore::FontShadow::encode const): Deleted. (WebCore::FontShadow::decode): Deleted. * editing/FontAttributes.h: Added. Introduce a new struct that contains font attribute information. May be converted into an NSDictionary for use by Cocoa clients in WebKitLegacy and WebKit. In a future patch, this will become serializable over IPC for use in WebKit2. * editing/FontShadow.h: Added. Move FontShadow out into a separate header file, included in `FontAttributeChanges.h` and `FontAttributes.h`. (WebCore::FontShadow::encode const): (WebCore::FontShadow::decode): * editing/cocoa/EditorCocoa.mm: Add a helper function to convert a WebCore::Color to either `UIColor` on iOS or `NSColor` when AppKit is being used. (WebCore::Editor::platformFontAttributesAtSelectionStart const): (WebCore::Editor::getTextDecorationAttributesRespectingTypingStyle const): Deleted. Remove a helper function that was only used to compute text decoration attributes in fontAttributesForSelectionStart. (WebCore::Editor::fontAttributesForSelectionStart const): Deleted. * editing/cocoa/FontAttributesCocoa.mm: Added. (WebCore::FontAttributes::createDictionary const): * editing/cocoa/FontShadowCocoa.mm: Added. (WebCore::FontShadow::createShadow const): * editing/cocoa/HTMLConverter.mm: (_webKitBundle): (HTMLConverter::_colorForElement): (_platformColor): Deleted. Adopt platformColor(). * platform/graphics/cocoa/ColorCocoa.h: Added. * platform/graphics/cocoa/ColorCocoa.mm: Added. (WebCore::platformColor): * platform/graphics/metal/GPURenderPassDescriptorMetal.mm: Build fix due to changes in unified sources. * platform/mac/WebCoreNSFontManagerExtras.mm: (WebCore::computedFontAttributeChanges): * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm: * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm: More build fixes due to changes in unified sources. Source/WebCore/PAL: Add `+_disambiguated_due_to_CIImage_colorWithCGColor:` as a UIColor SPI definition. Also, import `UIColor_Private.h` directly when the Apple internal SDK is used. * pal/spi/ios/UIKitSPI.h: Source/WebKitLegacy/mac: Replace call sites of fontAttributesForSelectionStart() to fontAttributesAtSelectionStart().createDictionary(). * WebView/WebHTMLView.mm: (-[WebHTMLView _selectionStartFontAttributesAsRTF]): (-[WebHTMLView _updateFontPanel]): * WebView/WebView.mm: (-[WebView typingAttributes]): Canonical link: https://commits.webkit.org/204897@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236445 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-09-25 00:17:29 +00:00
editing/cocoa/FontAttributesCocoa.mm
editing/cocoa/FontShadowCocoa.mm
editing/cocoa/HTMLConverter.mm @no-unify
editing/cocoa/WebArchiveResourceFromNSAttributedString.mm
editing/cocoa/WebArchiveResourceWebResourceHandler.mm
editing/cocoa/WebContentReaderCocoa.mm
editing/ios/DictationCommandIOS.cpp
editing/ios/EditorIOS.mm
Adopt Reveal Framework to replace Lookup https://bugs.webkit.org/show_bug.cgi?id=191097 Source/WebCore: Reviewed by Tim Horton. Reveal is not currently testable. The Reveal framework does the same job as Lookup and DataDectors. In this patch we switch from using Lookup to determine what text to select and define to using Reveal and RVItems. Since this code needs to work on older systems, and Reveal is newer, we also need to keep around the old code for old systems so that they can also continue to work. Eventually we will remove this code and also likly switch to passing RVItems across from the web process rather than making them on each side. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * editing/mac/DictionaryLookup.h: * editing/mac/DictionaryLookup.mm: Create a delegate to respond to Reveal and help draw the string or highlight. (-[WebRevealHighlight initWithHighlightRect:useDefaultHighlight:attributedString:]): (-[WebRevealHighlight setClearTextIndicator:]): (-[WebRevealHighlight revealContext:rectsForItem:]): (-[WebRevealHighlight revealContext:drawRectsForItem:]): (-[WebRevealHighlight revealContext:shouldUseDefaultHighlightForItem:]): (-[WebRevealHighlight revealContext:stopHighlightingItem:]): (WebCore::showPopupOrCreateAnimationController): Unify the code paths and utalize the Reveal framework to create and/or display the popovers. (WebCore::DictionaryLookup::showPopup): (WebCore::DictionaryLookup::animationControllerForPopup): Pipe the new callback through. (WebCore::tokenRange): Deleted. Only used with Lookup (WebCore::selectionContainsPosition): Deleted. Only used with Lookup. * editing/mac/DictionaryLookupLegacy.mm: Copied from Source/WebCore/editing/mac/DictionaryLookup.mm. Keep a copy of the previous implementation of DictionaryLookup, because Reveal not available on older system. (WebCore::tokenRange): (WebCore::selectionContainsPosition): (WebCore::expandSelectionByCharacters): (WebCore::showPopupOrCreateAnimationController): (WebCore::DictionaryLookup::showPopup): (WebCore::DictionaryLookup::hidePopup): (WebCore::DictionaryLookup::animationControllerForPopup): Source/WebCore/PAL: <rdar://problem/45924508> Reviewed by Tim Horton. Add in reveal SPI so WebKit will continue to build without the internal SDK. * PAL.xcodeproj/project.pbxproj: * pal/spi/mac/RevealSPI.h: Added. Source/WebKit: <rdar://problem/45924508> Reviewed by Tim Horton. Pass in what it needed to clear the textIndicators. This is better than the current notification structure. * UIProcess/Cocoa/WebViewImpl.mm: (-[WKWindowVisibilityObserver dealloc]): (-[WKWindowVisibilityObserver startObservingLookupDismissalIfNeeded]): * UIProcess/mac/PageClientImplMac.mm: (WebKit::PageClientImpl::didPerformDictionaryLookup): * UIProcess/mac/WKImmediateActionController.mm: (-[WKImmediateActionController _animationControllerForText]): * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::showDefinitionForAttributedString): Generate and pass in the text indicator information, as this is needed now. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::dictionaryPopupInfoForSelectionInPDFPlugin): Source/WebKitLegacy/mac: <rdar://problem/45924508> Reviewed by Tim Horton. Pass in what it needed to clear the textIndicators. This is better than the current notification structure. * WebView/WebView.mm: (-[WebView _animationControllerForDictionaryLookupPopupInfo:]): (-[WebView _prepareForDictionaryLookup]): LayoutTests: Reviewed by Tim Horton. Reveal selects spaces instead of adjacent words, no matter how interesting they are. Update the tests to show this, and change the expections for previous platforms. * editing/mac/selection/context-menu-select-editability-expected.txt: * editing/mac/selection/context-menu-select-editability.html: * platform/mac-highsierra/editing/mac/selection/context-menu-select-editability-expected.txt: Copied from LayoutTests/editing/mac/selection/context-menu-select-editability-expected.txt. Canonical link: https://commits.webkit.org/206232@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238014 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-11-09 01:59:10 +00:00
editing/mac/DictionaryLookupLegacy.mm
editing/mac/EditorMac.mm
editing/mac/FrameSelectionMac.mm
[iOS] Implement support for dictation alternatives https://bugs.webkit.org/show_bug.cgi?id=208720 <rdar://problem/58540114> Reviewed by Brent Fulgham. Part 3 Source/WebCore: Separate code that is actually USE(AUTOCORRECTION_PANEL)-specific from code that can also be used when building with USE(DICTATION_ALTERNATIVES) 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. * SourcesCocoa.txt: Mark TextAlternativeWithRange.mm as @no-unify to fix build breakage when a unified source file includes both TextAlternativeWithRange.mm and a file that ultimately includes LengthBox.h (e.g. WebArchiveResourceFromNSAttributedString.mm). TextAlternativeWithRange.mm ultimately includes SFNTLayoutTypes.h, which defines a Fixed type that conflicts with enumerator Fixed (part of the LengthType enumeration) defined in Length.h. Ideally the LengthType enumeration would be an enum class or scoped to Length to avoid this ambiguity. This would be a big change to do and so for now I am fixing the build breakage using @no-unify. * WebCore.xcodeproj/project.pbxproj: Add TextAlternativeWithRange.mm to the project now that it is excluded from the unified build. * editing/AlternativeTextController.cpp: (WebCore::markerTypesForAppliedDictationAlternative): (WebCore::AlternativeTextController::alternativeTextClient): (WebCore::AlternativeTextController::markerDescriptionForAppliedAlternativeText): (WebCore::AlternativeTextController::applyAlternativeTextToRange): * editing/AlternativeTextController.h: Source/WebKit: 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: Source/WebKitLegacy/mac: Guard code that requires USE(AUTOCORRECTION_PANEL) to be enabled. Specifically, -_showDictationAlternativeUI calls -handleAcceptedAlternativeText, but the latter is only compiled in when USE(AUTOCORRECTION_PANEL) 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. * WebView/WebView.mm: Canonical link: https://commits.webkit.org/221696@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258087 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-03-08 00:30:28 +00:00
editing/mac/TextAlternativeWithRange.mm @no-unify
editing/mac/TextUndoInsertionMarkupMac.mm
fileapi/FileCocoa.mm
history/mac/HistoryItemMac.mm
html/shadow/YouTubeEmbedShadowElement.cpp
Web Inspector: rename `ScriptDebugServer` subclasses/methods https://bugs.webkit.org/show_bug.cgi?id=215363 <rdar://problem/67310441> Reviewed by Brian Burg. r266074 merged `Inspector::ScriptDebugServer` into `JSC::Debugger`. All subclasses and functions should be renamed to match this change. Source/JavaScriptCore: * JavaScriptCore.xcodeproj/project.pbxproj: * Sources.txt: * inspector/InspectorEnvironment.h: * inspector/JSGlobalObjectDebugger.h: Renamed from Source/JavaScriptCore/inspector/JSGlobalObjectScriptDebugServer.h. * inspector/JSGlobalObjectDebugger.cpp: Renamed from Source/JavaScriptCore/inspector/JSGlobalObjectScriptDebugServer.cpp. * inspector/JSGlobalObjectInspectorController.h: * inspector/JSGlobalObjectInspectorController.cpp: * inspector/agents/InspectorAuditAgent.h: * inspector/agents/InspectorAuditAgent.cpp: * inspector/agents/InspectorDebuggerAgent.h: * inspector/agents/InspectorDebuggerAgent.cpp: * inspector/agents/InspectorRuntimeAgent.h: * inspector/agents/InspectorRuntimeAgent.cpp: * inspector/agents/InspectorScriptProfilerAgent.cpp: * inspector/agents/JSGlobalObjectDebuggerAgent.cpp: * inspector/remote/RemoteInspectionTarget.cpp: * inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm: Source/WebCore: * Headers.cmake: * Sources.txt: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * inspector/InspectorController.h: * inspector/InspectorController.cpp: * inspector/PageDebugger.h: Renamed from Source/WebCore/inspector/PageScriptDebugServer.h. * inspector/PageDebugger.cpp: Renamed from Source/WebCore/inspector/PageScriptDebugServer.cpp. * inspector/mac/PageDebuggerMac.mm: Renamed from Source/WebCore/inspector/mac/PageScriptDebugServerMac.mm. * inspector/WorkerDebugger.h: Renamed from Source/WebCore/inspector/WorkerScriptDebugServer.h. * inspector/WorkerDebugger.cpp: Renamed from Source/WebCore/inspector/WorkerScriptDebugServer.cpp. * inspector/WorkerInspectorController.h: * inspector/WorkerInspectorController.cpp: * inspector/agents/InspectorTimelineAgent.cpp: * inspector/agents/page/PageDebuggerAgent.cpp: Canonical link: https://commits.webkit.org/228554@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266077 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-08-24 18:40:30 +00:00
inspector/mac/PageDebuggerMac.mm
loader/archive/cf/LegacyWebArchive.cpp
loader/archive/cf/LegacyWebArchiveMac.mm
loader/cocoa/DiskCacheMonitorCocoa.mm
PCM: Generate secret token and corresponding unlinkable token https://bugs.webkit.org/show_bug.cgi?id=222019 <rdar://problem/73581412> Reviewed by John Wilander. Source/WebCore: Covered by API tests. This patch utilizes RSABSSA to generate secret token for PCM fraud prevention. * Configurations/WebCore.xcconfig: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: Paperwork to link CryptoKitCBridging. * loader/PrivateClickMeasurement.cpp: (WebCore::PrivateClickMeasurement::EphemeralSourceNonce::isValid const): (WebCore::PrivateClickMeasurement::setEphemeralSourceNonce): * loader/PrivateClickMeasurement.h: (WebCore::PrivateClickMeasurement::attributeOnSite const): (WebCore::PrivateClickMeasurement::ephemeralSourceNonce const): (WebCore::PrivateClickMeasurement::clearEphemeralSourceNonce): (WebCore::PrivateClickMeasurement::EphemeralSourceNonce::EphemeralSourceNonce): Deleted. (WebCore::PrivateClickMeasurement::EphemeralSourceNonce::isValid const): Deleted. (WebCore::PrivateClickMeasurement::setEphemeralSourceNonce): Deleted. Groups functionalities behind HAVE_RSA_BSSA. * loader/cocoa/PrivateClickMeasurementCocoa.mm: Added. (WebCore::PrivateClickMeasurement::blindedSecretJson): (WebCore::PrivateClickMeasurement::calculatePersistentBlindedToken): Introduces new methods to generate the blinded secrets and unlinkable tokens. Source/WTF: * wtf/PlatformHave.h: Adds a compile time flag for RSABSSA. Tools: * TestWebKitAPI/Tests/WebCore/PrivateClickMeasurement.cpp: (TestWebKitAPI::TEST): Add tests. Canonical link: https://commits.webkit.org/234362@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273167 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-02-19 23:15:22 +00:00
loader/cocoa/PrivateClickMeasurementCocoa.mm
loader/cocoa/SubresourceLoaderCocoa.mm
[Quick Look] Rename PreviewLoader{,Client} to LegacyPreviewLoader{,Client} https://bugs.webkit.org/show_bug.cgi?id=203306 Reviewed by Tim Horton. Source/WebCore: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * loader/EmptyClients.cpp: * loader/EmptyFrameLoaderClient.h: * loader/FrameLoaderClient.h: * loader/ResourceLoader.cpp: * loader/ResourceLoader.h: * loader/SubresourceLoader.cpp: (WebCore::SubresourceLoader::didReceiveResponse): * loader/ios/LegacyPreviewLoader.h: Renamed from Source/WebCore/loader/ios/PreviewLoader.h. * loader/ios/LegacyPreviewLoader.mm: Renamed from Source/WebCore/loader/ios/PreviewLoader.mm. (testingClient): (emptyClient): (WebCore::LegacyPreviewLoader::LegacyPreviewLoader): (WebCore::LegacyPreviewLoader::~LegacyPreviewLoader): (WebCore::LegacyPreviewLoader::create): (WebCore::LegacyPreviewLoader::didReceiveResponse): (WebCore::LegacyPreviewLoader::didReceiveData): (WebCore::LegacyPreviewLoader::didReceiveBuffer): (WebCore::LegacyPreviewLoader::didFinishLoading): (WebCore::LegacyPreviewLoader::didFail): (WebCore::LegacyPreviewLoader::setClientForTesting): * platform/network/ios/LegacyPreviewLoaderClient.h: Renamed from Source/WebCore/platform/network/ios/PreviewLoaderClient.h. * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): (WebCore::Internals::setQuickLookPassword): * testing/MockPreviewLoaderClient.h: Source/WebKit: * WebProcess/Storage/WebSWContextManagerConnection.cpp: * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm: (WebKit::WebFrameLoaderClient::createPreviewLoaderClient): * WebProcess/WebCoreSupport/ios/WebPreviewLoaderClient.h: Source/WebKitLegacy/mac: * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::createPreviewLoaderClient): * WebView/WebDataSource.mm: (-[WebDataSource _quickLookPreviewLoaderClient]): (-[WebDataSource _setQuickLookPreviewLoaderClient:]): * WebView/WebDataSourceInternal.h: Canonical link: https://commits.webkit.org/216724@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251488 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-10-23 19:34:32 +00:00
loader/ios/LegacyPreviewLoader.mm
loader/mac/DocumentLoaderMac.cpp
loader/mac/LoaderNSURLExtras.mm
loader/mac/ResourceLoaderMac.mm
page/CaptionUserPreferencesMediaAF.cpp
page/cocoa/MemoryReleaseCocoa.mm
page/cocoa/PerformanceLoggingCocoa.mm
page/cocoa/ResourceUsageOverlayCocoa.mm
page/cocoa/ResourceUsageThreadCocoa.mm
page/cocoa/SettingsBaseCocoa.mm
page/cocoa/WebTextIndicatorLayer.mm
page/ios/ContentChangeObserver.cpp
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. Source/WebCore: Add a Google Sheets quirk. Put all DOM timers scheduled from keydown and keypress event listeners into a holding tank. The timers continue to tick, but are barred from executing their action until the next text insertion or deletion or 32 ms (on device) have elapsed, whichever is sooner. We only allocate a holding tank once per document, only if the quirk is active, and this allocation is done when the document schedules a timer on keydown or keypress. The holding tank lives for the lifetime of the document. The story behind the quirk: On keypress Google Sheets schedules timers and expects that a DOM update will occur (i.e. text will be inserted or deleted) within the same event loop iteration as the dispatched keypress. The UI Events spec. [1] makes no such guarantee of when a DOM update must occur in relation to the keypress event. It could happen in the same event loop iteration as the key press (as Google expects), the next iteration, 500ms later, 2 minutes later, etc. What the spec does guarantee is that by the time a DOM input event is dispatched that the DOM will be updated. And this is the solution to the problem Google Sheets is trying to solve, but is doing so using pre-IE 9 technology (though similar functionality was available via onpropertychange in IE < 9). See also <https://github.com/w3c/uievents/issues/238>, which is tracking a spec. text update for this quirk. Test: fast/events/ios/dom-update-on-keydown-quirk.html [1] <https://w3c.github.io/uievents/> (Editor's Draft, 14 October 2018) * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: Add some files to the project. * dom/Document.cpp: (WebCore::Document::domTimerHoldingTank): Added. * dom/Document.h: (WebCore::Document::domTimerHoldingTankIfExists): Added. * page/DOMTimer.cpp: (WebCore::DOMTimer::install): Put the newly instantiated timer into the holding tank. (WebCore::DOMTimer::removeById): Remove the timer from the holding tank. (WebCore::DOMTimer::fired): Check if the timer is in the holding tank. If it is and it is a one- shot timer then schedule it for the next event loop iteration. If it's a repeating timer just let it continue ticking. Otherwise, do what we no now and execute the timer's action. The reason we do not suspend timers in the holding tank is because: 1. Far out timers (Google Sheets registers timers as far out as 5 minutes!) are not penalized. Though smart supension logic could avoid this. See (3). 2. Empirical observations indicate that the keyboard will perform the insertion or deletion reasonably quickly (not the same event loop iteration as the keydown, but within two iterations out). So, the timers in the holding tank are short-lived. 3. Simplifies the code. There is no need to keep additional bookkeeping to track multiple timer suspension reasons (timers currently can only have one suspension reason) or alternatively defer scheduling a timer until a later time and computing a new "fair" firing time when scheduled. * page/EventHandler.cpp: (WebCore::EventHandler::internalKeyEvent): Place a token on the stack to put all DOM timers scheduled on keydown and keypress into the holding tank if the quirk is enabled. * page/Quirks.cpp: (WebCore::Quirks::needsDeferKeyDownAndKeyPressTimersUntilNextEditingCommand const): Added. * page/Quirks.h: * page/Settings.yaml: Added setting so that this quirk can be enabled from a layout test. This setting also lets us enable the quirk for all sites or for certain third-party apps if desired. * page/ios/DOMTimerHoldingTank.cpp: Added. (WebCore::DOMTimerHoldingTank::DOMTimerHoldingTank): (WebCore::DOMTimerHoldingTank::add): (WebCore::DOMTimerHoldingTank::remove): (WebCore::DOMTimerHoldingTank::contains): (WebCore::DOMTimerHoldingTank::removeAll): (WebCore::DOMTimerHoldingTank::stopExceededMaximumHoldTimer): * page/ios/DOMTimerHoldingTank.h: Added. (WebCore::DeferDOMTimersForScope::DeferDOMTimersForScope): (WebCore::DeferDOMTimersForScope::~DeferDOMTimersForScope): (WebCore::DeferDOMTimersForScope::isDeferring): Source/WebKit: 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. LayoutTests: Add a test that enables the quirk and ensures that the DOM is up-to-date on expiration of a zero timer scheduled from keydown, keypress, keyup, and input. * fast/events/ios/dom-update-on-keydown-quirk-expected.txt: Added. * fast/events/ios/dom-update-on-keydown-quirk.html: Added. Canonical link: https://commits.webkit.org/213750@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@247530 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-07-17 20:06:04 +00:00
page/ios/DOMTimerHoldingTank.cpp
page/ios/EventHandlerIOS.mm
page/ios/FrameIOS.mm
page/ios/WebEventRegion.mm
page/mac/ChromeMac.mm
page/mac/DragControllerMac.mm
page/mac/EventHandlerMac.mm
[macOS] Support painting data detector highlights inside image overlays https://bugs.webkit.org/show_bug.cgi?id=226227 Reviewed by Tim Horton. Add support for painting data detector highlights inside image overlays by leveraging `DataDetectorHighlight`. See comments below for more details. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * editing/Editor.cpp: (WebCore::scanForTelephoneNumbers): Avoid painting service-controls-based telephone number highlights for selected text inside image overlays, in order to avoid painting a redundant data detector highlight for telephone numbers in image overlays. * html/HTMLElement.cpp: (WebCore::imageOverlayDataDetectorClassName): (WebCore::HTMLElement::isImageOverlayDataDetectorResult const): (WebCore::HTMLElement::updateWithImageExtractionResult): * html/HTMLElement.h: * html/shadow/imageOverlay.css: (div.image-overlay-data-detector-result): Add support for injecting elements in the DOM that represent data detection results; these are transformed and overlaid on the image in the same way as existing text containers. Note that we lay out these elements on top of text, but make them invisible to hit-testing unless the `IgnoreCSSPointerEventsProperty` option is specified. We'll take advantage of this behavior in a future patch. * page/ImageOverlayController.cpp: (WebCore::ImageOverlayController::selectionQuadsDidChange): (WebCore::ImageOverlayController::uninstallPageOverlayIfNeeded): (WebCore::ImageOverlayController::drawRect): (WebCore::ImageOverlayController::platformHandleMouseEvent): * page/ImageOverlayController.h: Refactor the image overlay controller, such that we install the page overlay if there is any selection inside the image overlay (as opposed to only when we need to use this overlay to paint the text selection for transparent images). If data detectors are present, we'll additionally set up out `DataDetectorHighlight`s (one for each data detection result container). * page/mac/ImageOverlayControllerMac.mm: Added. (WebCore::ImageOverlayController::updateDataDetectorHighlights): Traverse the image overlay's subtree in search of container elements that correspond to data detection results; for each of these elements, we create a new `DataDetectorHighlight` using the element's bounds, and save the pair in `m_dataDetectorContainersAndHighlights`. Note that we hold a weak pointer to the container element, such that there's no risk of leaking any of these data detection result containers (or their documents). (WebCore::ImageOverlayController::platformHandleMouseEvent): (WebCore::ImageOverlayController::handleDataDetectorAction): Add a FIXME referencing the next patch in the sequence. (WebCore::ImageOverlayController::clearDataDetectorHighlights): * platform/mac/DataDetectorHighlight.h: * platform/mac/DataDetectorHighlight.mm: (WebCore::DataDetectorHighlight::createForImageOverlay): Add a helper method to create a `DataDetectorHighlight` for image overlays. Canonical link: https://commits.webkit.org/238171@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278121 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-26 20:06:32 +00:00
page/mac/ImageOverlayControllerMac.mm
page/mac/PageMac.mm
page/mac/ServicesOverlayController.mm
page/mac/TextIndicatorWindow.mm
page/mac/WheelEventDeltaFilterMac.mm
page/scrolling/cocoa/ScrollingStateNode.mm
Move some macOS/iOS scrolling code into the scrolling/cocoa directory https://bugs.webkit.org/show_bug.cgi?id=194245 Reviewed by Zalan Bujtas. Source/WebCore: ScrollingTreeFixedNode and ScrollingTreeStickyNode are used on iOS and macOS, so move them to the cocoa directory. Standardize on the ordering of ENABLE(ASYNC_SCROLLING) && PLATFORM(MAC). Stop building ScrollingThread for iOS (it's never used), and stub out some functions so things build. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * page/scrolling/ScrollingThread.cpp: (WebCore::ScrollingThread::initializeRunLoop): (WebCore::ScrollingThread::wakeUpRunLoop): (WebCore::ScrollingThread::threadRunLoopSourceCallback): * page/scrolling/cocoa/ScrollingTreeFixedNode.h: Renamed from Source/WebCore/page/scrolling/mac/ScrollingTreeFixedNode.h. * page/scrolling/cocoa/ScrollingTreeFixedNode.mm: Renamed from Source/WebCore/page/scrolling/mac/ScrollingTreeFixedNode.mm. * page/scrolling/cocoa/ScrollingTreeStickyNode.h: Renamed from Source/WebCore/page/scrolling/mac/ScrollingTreeStickyNode.h. * page/scrolling/cocoa/ScrollingTreeStickyNode.mm: Renamed from Source/WebCore/page/scrolling/mac/ScrollingTreeStickyNode.mm. * page/scrolling/mac/ScrollingThreadMac.mm: * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h: * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm: Source/WebKit: Use PLATFORM(MAC), not !PLATFORM(IOS_FAMILY). * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: Canonical link: https://commits.webkit.org/208723@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240963 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-02-05 04:34:56 +00:00
page/scrolling/cocoa/ScrollingTreeFixedNode.mm
Add OverflowScrollProxyNodes to the scrolling tree https://bugs.webkit.org/show_bug.cgi?id=199132 Reviewed by Antti Koivisto. Source/WebCore: 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. * Sources.txt: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::setRelatedOverflowScrollingNodes): * page/scrolling/ScrollingCoordinator.cpp: (WebCore::operator<<): * page/scrolling/ScrollingCoordinatorTypes.h: * page/scrolling/ScrollingStateNode.h: (WebCore::ScrollingStateNode::isOverflowScrollProxyNode const): * page/scrolling/ScrollingStateOverflowScrollProxyNode.cpp: Added. (WebCore::ScrollingStateOverflowScrollProxyNode::create): (WebCore::ScrollingStateOverflowScrollProxyNode::ScrollingStateOverflowScrollProxyNode): (WebCore::ScrollingStateOverflowScrollProxyNode::clone): (WebCore::ScrollingStateOverflowScrollProxyNode::setOverflowScrollingNode): (WebCore::ScrollingStateOverflowScrollProxyNode::dumpProperties const): * page/scrolling/ScrollingStateOverflowScrollProxyNode.h: Copied from Source/WebCore/page/scrolling/ScrollingStateOverflowScrollingNode.cpp. (WebCore::ScrollingStateOverflowScrollProxyNode::overflowScrollingNode const): * page/scrolling/ScrollingStateOverflowScrollingNode.cpp: * page/scrolling/ScrollingStateTree.cpp: (WebCore::ScrollingStateTree::createNode): * page/scrolling/ScrollingTreeNode.h: (WebCore::ScrollingTreeNode::isOverflowScrollProxyNode const): * page/scrolling/ScrollingTreeOverflowScrollProxyNode.cpp: Added. (WebCore::ScrollingTreeOverflowScrollProxyNode::create): (WebCore::ScrollingTreeOverflowScrollProxyNode::ScrollingTreeOverflowScrollProxyNode): (WebCore::ScrollingTreeOverflowScrollProxyNode::commitStateBeforeChildren): (WebCore::ScrollingTreeOverflowScrollProxyNode::applyLayerPositions): (WebCore::ScrollingTreeOverflowScrollProxyNode::dumpProperties const): * page/scrolling/ScrollingTreeOverflowScrollProxyNode.h: Copied from Source/WebCore/page/scrolling/ScrollingStateOverflowScrollingNode.cpp. * page/scrolling/ScrollingTreeScrollingNode.h: * page/scrolling/cocoa/ScrollingTreeOverflowScrollProxyNode.h: Copied from Source/WebCore/page/scrolling/ScrollingStateOverflowScrollingNode.cpp. (WebCore::ScrollingTreeOverflowScrollProxyNode::overflowScrollingNodeID const): (WebCore::ScrollingTreeOverflowScrollProxyNode::layer const): * page/scrolling/cocoa/ScrollingTreeOverflowScrollProxyNode.mm: Added. (WebCore::ScrollingTreeOverflowScrollProxyNode::create): (WebCore::ScrollingTreeOverflowScrollProxyNode::ScrollingTreeOverflowScrollProxyNode): (WebCore::ScrollingTreeOverflowScrollProxyNode::commitStateBeforeChildren): (WebCore::ScrollingTreeOverflowScrollProxyNode::scrollDeltaSinceLastCommit const): (WebCore::ScrollingTreeOverflowScrollProxyNode::applyLayerPositions): (WebCore::ScrollingTreeOverflowScrollProxyNode::dumpProperties const): * page/scrolling/cocoa/ScrollingTreePositionedNode.mm: * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm: * page/scrolling/mac/ScrollingTreeMac.cpp: (ScrollingTreeMac::createScrollingTreeNode): * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm: (WebCore::ScrollingTreeOverflowScrollingNodeMac::repositionScrollingLayers): * rendering/RenderLayerCompositor.cpp: (WebCore::scrollCoordinationRoleForNodeType): Source/WebKit: 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): Source/WTF: Setting indent is useful if you want to make a new stream with the indent of an existing stream. * wtf/text/TextStream.h: (WTF::TextStream::setIndent): Canonical link: https://commits.webkit.org/213108@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@246723 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-06-23 19:34:44 +00:00
page/scrolling/cocoa/ScrollingTreeOverflowScrollProxyNode.mm
Source/WebCore: Scrolling tree should reposition non-stacking order descendents of overflow:scroll https://bugs.webkit.org/show_bug.cgi?id=195608 Reviewed by Zalan Bujtas. Step 1: add scrolling tree positioning nodes classes (but don't create them yet). Add Scrolling{State,Tree}PositionedNode to track composited layers that have to be repositioned when an async overflow:scroll scrolls. There are two instances in which this is necessary, reflected by the values of ScrollPositioningBehavior: ScrollPositioningBehavior::Moves - a composited layer whose containing block chain includes an async overflow scroller, but whose composited (i.e. z-order) parent is outside of the overflow. When the overflow scrolls, this layer has to move along with the overflow. ScrollPositioningBehavior::Stationary - a composited layer whose containing block chain skips the overflow scroller, but whose compositing (z-order) parent is the scroller, or inside the scroller. This only applies to position:absolute, on, for example, an overflow:scroll ith opacity. PositionedNodes are modeled after Fixed/Sticky nodes, with a new type of layout constraint just called LayoutConstraints. This patch adds support for PositionedNodes in the scrolling trees, but RenderLayerCompositor::computeCoordinatedPositioningForLayer() is just a stub so the new node types aren't created yet. RenderLayerBacking stores a ScrollingNodeID for the positioning role (just like the other roles). Since the Positioning role is about position relative to ancestors, a node with both Positioning and FrameHosting or Scrolling roles treats the Positioning node as the parent of the other types. A node should never have both Positioning and ViewportConstrained roles. Test: scrollingcoordinator/scrolling-tree/positioned-nodes.html * Sources.txt: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::setPositionedNodeGeometry): (WebCore::AsyncScrollingCoordinator::setRelatedOverflowScrollingNodes): * page/scrolling/AsyncScrollingCoordinator.h: * page/scrolling/ScrollingConstraints.cpp: (WebCore::operator<<): * page/scrolling/ScrollingConstraints.h: (WebCore::LayoutConstraints::LayoutConstraints): (WebCore::LayoutConstraints::operator== const): (WebCore::LayoutConstraints::operator!= const): (WebCore::LayoutConstraints::alignmentOffset const): (WebCore::LayoutConstraints::setAlignmentOffset): (WebCore::LayoutConstraints::layerPositionAtLastLayout const): (WebCore::LayoutConstraints::setLayerPositionAtLastLayout): (WebCore::LayoutConstraints::scrollPositioningBehavior const): (WebCore::LayoutConstraints::setScrollPositioningBehavior): * page/scrolling/ScrollingCoordinator.cpp: (WebCore::operator<<): * page/scrolling/ScrollingCoordinator.h: (WebCore::ScrollingCoordinator::setPositionedNodeGeometry): (WebCore::ScrollingCoordinator::setRelatedOverflowScrollingNodes): * page/scrolling/ScrollingCoordinatorTypes.h: * page/scrolling/ScrollingStateNode.h: (WebCore::ScrollingStateNode::isPositionedNode const): * page/scrolling/ScrollingStatePositionedNode.cpp: Added. (WebCore::ScrollingStatePositionedNode::create): (WebCore::ScrollingStatePositionedNode::ScrollingStatePositionedNode): (WebCore::ScrollingStatePositionedNode::clone): (WebCore::ScrollingStatePositionedNode::setAllPropertiesChanged): (WebCore::ScrollingStatePositionedNode::setRelatedOverflowScrollingNodes): (WebCore::ScrollingStatePositionedNode::updateConstraints): (WebCore::ScrollingStatePositionedNode::dumpProperties const): * page/scrolling/ScrollingStatePositionedNode.h: Added. * page/scrolling/ScrollingStateTree.cpp: (WebCore::ScrollingStateTree::createNode): * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::updateTreeFromStateNode): * page/scrolling/ScrollingTree.h: * page/scrolling/ScrollingTreeNode.h: (WebCore::ScrollingTreeNode::isPositionedNode const): * page/scrolling/cocoa/ScrollingTreePositionedNode.h: Copied from Source/WebCore/page/scrolling/cocoa/ScrollingTreeStickyNode.h. * page/scrolling/cocoa/ScrollingTreePositionedNode.mm: Added. (WebCore::ScrollingTreePositionedNode::create): (WebCore::ScrollingTreePositionedNode::ScrollingTreePositionedNode): (WebCore::ScrollingTreePositionedNode::~ScrollingTreePositionedNode): (WebCore::ScrollingTreePositionedNode::commitStateBeforeChildren): (WebCore::ScrollingTreePositionedNode::applyLayerPositions): (WebCore::ScrollingTreePositionedNode::relatedNodeScrollPositionDidChange): (WebCore::ScrollingTreePositionedNode::dumpProperties const): * page/scrolling/cocoa/ScrollingTreeStickyNode.h: * page/scrolling/mac/ScrollingTreeMac.cpp: (ScrollingTreeMac::createScrollingTreeNode): * platform/ScrollTypes.h: * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::coordinatedScrollingRoles const): (WebCore::RenderLayerBacking::detachFromScrollingCoordinator): * rendering/RenderLayerBacking.h: * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::computeCoordinatedPositioningForLayer const): (WebCore::scrollCoordinationRoleForNodeType): (WebCore::RenderLayerCompositor::updateScrollCoordinationForLayer): (WebCore::RenderLayerCompositor::updateScrollingNodeForViewportConstrainedRole): (WebCore::RenderLayerCompositor::updateScrollingNodeLayers): (WebCore::RenderLayerCompositor::updateScrollingNodeForPositioningRole): * rendering/RenderLayerCompositor.h: Source/WebKit: Scrolling tree should reposition non-stacking order descendents of overflow:scroll. https://bugs.webkit.org/show_bug.cgi?id=195608 Reviewed by Zalan Bujtas. Step 1: add scrolling tree positioning nodes classes (but don't create them yet). Add Scrolling{State,Tree}PositionedNode to track composited layers that have to be repositioned when an async overflow:scroll scrolls. There are two instances in which this is necessary, reflected by the values of ScrollPositioningBehavior: ScrollPositioningBehavior::Moves - a composited layer whose containing block chain includes an async overflow scroller, but whose composited (i.e. z-order) parent is outside of the overflow. When the overflow scrolls, this layer has to move along with the overflow. ScrollPositioningBehavior::Stationary - a composited layer whose containing block chain skips the overflow scroller, but whose compositing (z-order) parent is the scroller, or inside the scroller. This only applies to position:absolute, on, for example, an overflow:scroll ith opacity. PositionedNodes are modeled after Fixed/Sticky nodes, with a new type of layout constraint just called LayoutConstraints. This patch adds support for PositionedNodes in the scrolling trees, but RenderLayerCompositor::computeCoordinatedPositioningForLayer() is just a stub so the new node types aren't created yet. RenderLayerBacking stores a ScrollingNodeID for the positioning role (just like the other roles). Since the Positioning role is about position relative to ancestors, a node with both Positioning and FrameHosting or Scrolling roles treats the Positioning node as the parent of the other types. A node should never have both Positioning and ViewportConstrained roles. * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp: (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode): (ArgumentCoder<ScrollingStatePositionedNode>::encode): (ArgumentCoder<ScrollingStatePositionedNode>::decode): (WebKit::encodeNodeAndDescendants): (WebKit::RemoteScrollingCoordinatorTransaction::decode): (WebKit::dump): * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder<LayoutConstraints>::encode): (IPC::ArgumentCoder<LayoutConstraints>::decode): (IPC::ArgumentCoder<StickyPositionViewportConstraints>::decode): * Shared/WebCoreArgumentCoders.h: * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp: (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers): * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp: (WebKit::RemoteScrollingTree::createScrollingTreeNode): * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm: (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers): LayoutTests: Scrolling tree should reposition non-stacking order descendents of overflow:scroll https://bugs.webkit.org/show_bug.cgi?id=195608 Reviewed by Zalan Bujtas. The results of this test will change when we enable positioned nodes. It tests various combinations of overflow and stacking. * platform/ios-wk2/scrollingcoordinator/scrolling-tree/positioned-nodes-expected.txt: Added. * scrollingcoordinator/scrolling-tree/positioned-nodes-expected.txt: Added. * scrollingcoordinator/scrolling-tree/positioned-nodes.html: Added. Canonical link: https://commits.webkit.org/210004@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242913 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-03-13 22:06:18 +00:00
page/scrolling/cocoa/ScrollingTreePositionedNode.mm
Move some macOS/iOS scrolling code into the scrolling/cocoa directory https://bugs.webkit.org/show_bug.cgi?id=194245 Reviewed by Zalan Bujtas. Source/WebCore: ScrollingTreeFixedNode and ScrollingTreeStickyNode are used on iOS and macOS, so move them to the cocoa directory. Standardize on the ordering of ENABLE(ASYNC_SCROLLING) && PLATFORM(MAC). Stop building ScrollingThread for iOS (it's never used), and stub out some functions so things build. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * page/scrolling/ScrollingThread.cpp: (WebCore::ScrollingThread::initializeRunLoop): (WebCore::ScrollingThread::wakeUpRunLoop): (WebCore::ScrollingThread::threadRunLoopSourceCallback): * page/scrolling/cocoa/ScrollingTreeFixedNode.h: Renamed from Source/WebCore/page/scrolling/mac/ScrollingTreeFixedNode.h. * page/scrolling/cocoa/ScrollingTreeFixedNode.mm: Renamed from Source/WebCore/page/scrolling/mac/ScrollingTreeFixedNode.mm. * page/scrolling/cocoa/ScrollingTreeStickyNode.h: Renamed from Source/WebCore/page/scrolling/mac/ScrollingTreeStickyNode.h. * page/scrolling/cocoa/ScrollingTreeStickyNode.mm: Renamed from Source/WebCore/page/scrolling/mac/ScrollingTreeStickyNode.mm. * page/scrolling/mac/ScrollingThreadMac.mm: * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h: * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm: Source/WebKit: Use PLATFORM(MAC), not !PLATFORM(IOS_FAMILY). * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: Canonical link: https://commits.webkit.org/208723@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240963 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-02-05 04:34:56 +00:00
page/scrolling/cocoa/ScrollingTreeStickyNode.mm
page/scrolling/mac/ScrollingCoordinatorMac.mm
page/scrolling/mac/ScrollingMomentumCalculatorMac.mm
Share more code between overflow and frame scrolling nodes, fixing overflow scrollbar display https://bugs.webkit.org/show_bug.cgi?id=195258 Reviewed by Antti Koivisto. This patch moves management of scrollbar layers and scrollbar painters ("NSScrollerImp") down to ScrollingStateScrollingNode to be shared between frame and overflow nodes, allowing for scrolling thread updates of overflow scrollbars. It also moves some scrolling tree-side code to ScrollingTreeScrollingNodeDelegateMac to be shared between the "tree" nodes for overflow and frames. Layers for scrollbars are given to scrolling state nodes via setNodeLayers() now, and RenderLayerCompositor::updateScrollingNodeLayers() is added to provide a bottleneck to call that. At some point AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange() should be relieved of the responsibility of pushing scrollbar layers (but the scrolling state tree needs to hold references to GraphicsLayers before that becomes safe). The actual fix that allows overflow scrollbars to show is the change in AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange() that calls scrollableArea.*ScrollbarLayerDidChange() for all ScrollableAreas. This ensures that the CALayer is pushed onto the NSScrollerImp. Source/WebCore: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange): (WebCore::AsyncScrollingCoordinator::setNodeLayers): (WebCore::AsyncScrollingCoordinator::setFrameScrollingNodeState): (WebCore::AsyncScrollingCoordinator::setScrollingNodeScrollableAreaGeometry): * page/scrolling/ScrollingCoordinator.h: * page/scrolling/ScrollingStateFrameScrollingNode.cpp: (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode): (WebCore::ScrollingStateFrameScrollingNode::setAllPropertiesChanged): (WebCore::ScrollingStateFrameScrollingNode::setVerticalScrollbarLayer): Deleted. (WebCore::ScrollingStateFrameScrollingNode::setHorizontalScrollbarLayer): Deleted. (WebCore::ScrollingStateFrameScrollingNode::setScrollerImpsFromScrollbars): Deleted. * page/scrolling/ScrollingStateFrameScrollingNode.h: * page/scrolling/ScrollingStateScrollingNode.cpp: (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode): (WebCore::ScrollingStateScrollingNode::setAllPropertiesChanged): (WebCore::ScrollingStateScrollingNode::setHorizontalScrollbarLayer): (WebCore::ScrollingStateScrollingNode::setVerticalScrollbarLayer): (WebCore::ScrollingStateScrollingNode::setScrollerImpsFromScrollbars): * page/scrolling/ScrollingStateScrollingNode.h: (WebCore::ScrollingStateScrollingNode::horizontalScrollbarLayer const): (WebCore::ScrollingStateScrollingNode::verticalScrollbarLayer const): (WebCore::ScrollingStateScrollingNode::verticalScrollerImp const): (WebCore::ScrollingStateScrollingNode::horizontalScrollerImp const): * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::setOrClearLatchedNode): (WebCore::ScrollingTree::handleWheelEvent): * page/scrolling/mac/ScrollingStateScrollingNodeMac.mm: Renamed from Source/WebCore/page/scrolling/mac/ScrollingStateFrameScrollingNodeMac.mm. (WebCore::ScrollingStateScrollingNode::setScrollerImpsFromScrollbars): * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h: * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm: (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren): (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent): (WebCore::ScrollingTreeFrameScrollingNodeMac::repositionRelatedLayers): (WebCore::ScrollingTreeFrameScrollingNodeMac::~ScrollingTreeFrameScrollingNodeMac): Deleted. (WebCore::ScrollingTreeFrameScrollingNodeMac::releaseReferencesToScrollerImpsOnTheMainThread): Deleted. * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h: * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm: (WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateBeforeChildren): (WebCore::ScrollingTreeOverflowScrollingNodeMac::handleWheelEvent): (WebCore::ScrollingTreeOverflowScrollingNodeMac::repositionRelatedLayers): * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h: * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm: (WebCore::ScrollingTreeScrollingNodeDelegateMac::~ScrollingTreeScrollingNodeDelegateMac): (WebCore::ScrollingTreeScrollingNodeDelegateMac::updateFromStateNode): (WebCore::ScrollingTreeScrollingNodeDelegateMac::handleWheelEvent): (WebCore::ScrollingTreeScrollingNodeDelegateMac::updateScrollbarPainters): (WebCore::ScrollingTreeScrollingNodeDelegateMac::releaseReferencesToScrollerImpsOnTheMainThread): * platform/ScrollbarThemeComposite.h: * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer): (WebCore::RenderLayerCompositor::updateScrollingNodeLayers): (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole): * rendering/RenderLayerCompositor.h: Source/WebKit: * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp: (ArgumentCoder<ScrollingStateScrollingNode>::encode): (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode): (ArgumentCoder<ScrollingStateScrollingNode>::decode): (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode): * SourcesCocoa.txt: * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp: (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers): * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp: (WebKit::RemoteScrollingTree::createScrollingTreeNode): * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp: (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::commitStateBeforeChildren): (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::repositionRelatedLayers): (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::handleMouseEvent): * UIProcess/RemoteLayerTree/mac/ScrollingTreeOverflowScrollingNodeRemoteMac.cpp: Copied from Source/WebKit/UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp. (WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::create): (WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::ScrollingTreeOverflowScrollingNodeRemoteMac): (WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::~ScrollingTreeOverflowScrollingNodeRemoteMac): (WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::commitStateBeforeChildren): (WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::repositionRelatedLayers): (WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::handleWheelEvent): (WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::handleMouseEvent): * WebKit.xcodeproj/project.pbxproj: Canonical link: https://commits.webkit.org/209623@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242359 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-03-04 16:57:38 +00:00
page/scrolling/mac/ScrollingStateScrollingNodeMac.mm
page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm
page/scrolling/mac/ScrollingTreeMac.mm
Stub out scrolling tree classes for overflow scrolling nodes on macOS https://bugs.webkit.org/show_bug.cgi?id=193524 Reviewed by Antti Koivisto. Add an empty implementation of ScrollingTreeOverflowScrollingNodeMac for macOS. Change ScrollingTreeMac::createScrollingTreeNode() to create these nodes. Minor refactor of RenderLayerCompositor::useCoordinatedScrollingForLayer() code to ask the scrolling coordinator if it can coordinate scrolling for this layer; no behavior change for existing code paths. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * page/scrolling/ScrollingCoordinator.cpp: (WebCore::ScrollingCoordinator::coordinatesScrollingForOverflowLayer const): * page/scrolling/ScrollingCoordinator.h: * page/scrolling/mac/ScrollingStateFrameScrollingNodeMac.mm: * page/scrolling/mac/ScrollingTreeMac.cpp: (ScrollingTreeMac::createScrollingTreeNode): * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h: Copied from Source/WebCore/page/scrolling/mac/ScrollingStateFrameScrollingNodeMac.mm. * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm: Added. (WebCore::ScrollingTreeOverflowScrollingNodeMac::create): (WebCore::ScrollingTreeOverflowScrollingNodeMac::ScrollingTreeOverflowScrollingNodeMac): (WebCore::ScrollingTreeOverflowScrollingNodeMac::~ScrollingTreeOverflowScrollingNodeMac): (WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateBeforeChildren): (WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateAfterChildren): (WebCore::ScrollingTreeOverflowScrollingNodeMac::updateLayersAfterAncestorChange): (WebCore::ScrollingTreeOverflowScrollingNodeMac::scrollPosition const): (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollLayerPosition): (WebCore::ScrollingTreeOverflowScrollingNodeMac::updateLayersAfterDelegatedScroll): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::usesAsyncScrolling const): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::useCoordinatedScrollingForLayer const): * rendering/RenderLayerCompositor.h: Canonical link: https://commits.webkit.org/208033@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240105 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-01-17 07:46:10 +00:00
page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm
Generalize ScrollingTreeScrollingNodeDelegate for use in macOS too, add a macOS subclass for frame/overflow scrolling https://bugs.webkit.org/show_bug.cgi?id=194080 Reviewed by Antti Koivisto. To share code between ScrollingTreeFrameScrollingNodeMac and ScrollingTreeOverflowScrollingNodeMac, build ScrollingTreeScrollingNodeDelegate for macOS too, and add some helper functions to ScrollingTreeScrollingNodeDelegate. Add a macOS subclass, ScrollingTreeScrollingNodeDelegateMac, which takes over the basic scrolling, rubber-banding and scroll snapping functionality from ScrollingTreeFrameScrollingNodeMac. The delegate owns the ScrollController and implements ScrollControllerClient. ScrollingTreeFrameScrollingNodeMac now owns a ScrollingTreeScrollingNodeDelegateMac. A future patch will add one to ScrollingTreeOverflowScrollingNodeMac. No behavior change. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * page/scrolling/ScrollingTreeFrameScrollingNode.cpp: (WebCore::ScrollingTreeFrameScrollingNode::scrollBy): Deleted. (WebCore::ScrollingTreeFrameScrollingNode::scrollByWithoutContentEdgeConstraints): Deleted. * page/scrolling/ScrollingTreeFrameScrollingNode.h: (WebCore::ScrollingTreeFrameScrollingNode::frameScaleFactor const): * page/scrolling/ScrollingTreeNode.cpp: (WebCore::ScrollingTreeNode::isRootNode const): * page/scrolling/ScrollingTreeNode.h: * page/scrolling/ScrollingTreeScrollingNode.cpp: (WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren): (WebCore::ScrollingTreeScrollingNode::scrollBy): (WebCore::ScrollingTreeScrollingNode::scrollByWithoutContentEdgeConstraints): * page/scrolling/ScrollingTreeScrollingNode.h: (WebCore::ScrollingTreeScrollingNode::expectsWheelEventTestTrigger const): * page/scrolling/ScrollingTreeScrollingNodeDelegate.cpp: * page/scrolling/ScrollingTreeScrollingNodeDelegate.h: (WebCore::ScrollingTreeScrollingNodeDelegate::scrollPosition const): (WebCore::ScrollingTreeScrollingNodeDelegate::minimumScrollPosition const): (WebCore::ScrollingTreeScrollingNodeDelegate::maximumScrollPosition const): (WebCore::ScrollingTreeScrollingNodeDelegate::scrollableAreaSize const): (WebCore::ScrollingTreeScrollingNodeDelegate::totalContentsSize const): (WebCore::ScrollingTreeScrollingNodeDelegate::hasEnabledHorizontalScrollbar const): (WebCore::ScrollingTreeScrollingNodeDelegate::hasEnabledVerticalScrollbar const): (WebCore::ScrollingTreeScrollingNodeDelegate::horizontalScrollElasticity const): (WebCore::ScrollingTreeScrollingNodeDelegate::verticalScrollElasticity const): * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h: * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm: (WebCore::ScrollingTreeFrameScrollingNodeMac::ScrollingTreeFrameScrollingNodeMac): (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren): (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent): (WebCore::ScrollingTreeFrameScrollingNodeMac::minimumScrollPosition const): (WebCore::ScrollingTreeFrameScrollingNodeMac::maximumScrollPosition const): (WebCore::newGestureIsStarting): Deleted. (WebCore::ScrollingTreeFrameScrollingNodeMac::isAlreadyPinnedInDirectionOfGesture): Deleted. (WebCore::ScrollingTreeFrameScrollingNodeMac::allowsHorizontalStretching): Deleted. (WebCore::ScrollingTreeFrameScrollingNodeMac::allowsVerticalStretching): Deleted. (WebCore::ScrollingTreeFrameScrollingNodeMac::stretchAmount): Deleted. (WebCore::ScrollingTreeFrameScrollingNodeMac::pinnedInDirection): Deleted. (WebCore::ScrollingTreeFrameScrollingNodeMac::canScrollHorizontally): Deleted. (WebCore::ScrollingTreeFrameScrollingNodeMac::canScrollVertically): Deleted. (WebCore::ScrollingTreeFrameScrollingNodeMac::shouldRubberBandInDirection): Deleted. (WebCore::ScrollingTreeFrameScrollingNodeMac::immediateScrollBy): Deleted. (WebCore::ScrollingTreeFrameScrollingNodeMac::immediateScrollByWithoutContentEdgeConstraints): Deleted. (WebCore::ScrollingTreeFrameScrollingNodeMac::stopSnapRubberbandTimer): Deleted. (WebCore::ScrollingTreeFrameScrollingNodeMac::adjustScrollPositionToBoundsIfNecessary): Deleted. (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollOffset const): Deleted. (WebCore::ScrollingTreeFrameScrollingNodeMac::immediateScrollOnAxis): Deleted. (WebCore::ScrollingTreeFrameScrollingNodeMac::pageScaleFactor const): Deleted. (WebCore::ScrollingTreeFrameScrollingNodeMac::startScrollSnapTimer): Deleted. (WebCore::ScrollingTreeFrameScrollingNodeMac::stopScrollSnapTimer): Deleted. (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollExtent const): Deleted. (WebCore::ScrollingTreeFrameScrollingNodeMac::viewportSize const): Deleted. (WebCore::ScrollingTreeFrameScrollingNodeMac::deferTestsForReason const): Deleted. (WebCore::ScrollingTreeFrameScrollingNodeMac::removeTestDeferralForReason const): Deleted. * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h: Copied from Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h. * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm: Added. (WebCore::ScrollingTreeScrollingNodeDelegateMac::ScrollingTreeScrollingNodeDelegateMac): (WebCore::ScrollingTreeScrollingNodeDelegateMac::updateScrollSnapPoints): (WebCore::ScrollingTreeScrollingNodeDelegateMac::setActiveScrollSnapIndexForAxis): (WebCore::ScrollingTreeScrollingNodeDelegateMac::activeScrollSnapIndexForAxis const): (WebCore::ScrollingTreeScrollingNodeDelegateMac::activeScrollSnapIndexDidChange const): (WebCore::ScrollingTreeScrollingNodeDelegateMac::handleWheelEvent): (WebCore::ScrollingTreeScrollingNodeDelegateMac::isScrollSnapInProgress const): (WebCore::newGestureIsStarting): (WebCore::ScrollingTreeScrollingNodeDelegateMac::isAlreadyPinnedInDirectionOfGesture): (WebCore::ScrollingTreeScrollingNodeDelegateMac::allowsHorizontalStretching): (WebCore::ScrollingTreeScrollingNodeDelegateMac::allowsVerticalStretching): (WebCore::ScrollingTreeScrollingNodeDelegateMac::stretchAmount): (WebCore::ScrollingTreeScrollingNodeDelegateMac::pinnedInDirection): (WebCore::ScrollingTreeScrollingNodeDelegateMac::canScrollHorizontally): (WebCore::ScrollingTreeScrollingNodeDelegateMac::canScrollVertically): (WebCore::ScrollingTreeScrollingNodeDelegateMac::shouldRubberBandInDirection): (WebCore::ScrollingTreeScrollingNodeDelegateMac::immediateScrollBy): (WebCore::ScrollingTreeScrollingNodeDelegateMac::immediateScrollByWithoutContentEdgeConstraints): (WebCore::ScrollingTreeScrollingNodeDelegateMac::stopSnapRubberbandTimer): (WebCore::ScrollingTreeScrollingNodeDelegateMac::adjustScrollPositionToBoundsIfNecessary): (WebCore::ScrollingTreeScrollingNodeDelegateMac::scrollOffset const): (WebCore::ScrollingTreeScrollingNodeDelegateMac::immediateScrollOnAxis): (WebCore::ScrollingTreeScrollingNodeDelegateMac::pageScaleFactor const): (WebCore::ScrollingTreeScrollingNodeDelegateMac::startScrollSnapTimer): (WebCore::ScrollingTreeScrollingNodeDelegateMac::stopScrollSnapTimer): (WebCore::ScrollingTreeScrollingNodeDelegateMac::scrollExtent const): (WebCore::ScrollingTreeScrollingNodeDelegateMac::viewportSize const): (WebCore::ScrollingTreeScrollingNodeDelegateMac::deferTestsForReason const): (WebCore::ScrollingTreeScrollingNodeDelegateMac::removeTestDeferralForReason const): Canonical link: https://commits.webkit.org/208598@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240825 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-01-31 23:26:38 +00:00
page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm
platform/audio/AudioSession.cpp
Share code between AudioDestinationIOS and AudioDestinationMac https://bugs.webkit.org/show_bug.cgi?id=203047 <rdar://problem/56340866> Reviewed by Eric Carlson. Source/WebCore: Introduce AudioDestinationCocoa to share code between iOS and Mac. Most code is now shared, except for the configuration of the audio unit which is slightly different between Mac and iOS. Introduce MockAudioDestinationCocoa to allow more code coverage of the shared code. This could also allow us to validate dynamic changes in frame rate, number of frames to process... Add Internals API to enable the mock destination. Covered by added test. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/audio/cocoa/AudioDestinationCocoa.cpp: Added. (WebCore::AudioDestination::create): (WebCore::AudioDestination::hardwareSampleRate): (WebCore::AudioDestination::maxChannelCount): (WebCore::AudioDestinationCocoa::AudioDestinationCocoa): (WebCore::AudioDestinationCocoa::~AudioDestinationCocoa): (WebCore::AudioDestinationCocoa::start): (WebCore::AudioDestinationCocoa::stop): (WebCore::AudioDestinationCocoa::setIsPlaying): (WebCore::AudioDestinationCocoa::setAudioStreamBasicDescription): (WebCore::assignAudioBuffersToBus): (WebCore::AudioDestinationCocoa::render): (WebCore::AudioDestinationCocoa::inputProc): * platform/audio/cocoa/AudioDestinationCocoa.h: Added. (WebCore::AudioDestinationCocoa::outputUnit): * platform/audio/ios/AudioDestinationIOS.cpp: (WebCore::AudioDestinationCocoa::configure): (WebCore::AudioDestinationCocoa::processBusAfterRender): * platform/audio/ios/AudioDestinationIOS.h: Removed. * platform/audio/mac/AudioDestinationMac.cpp: (WebCore::AudioDestinationCocoa::configure): (WebCore::AudioDestinationCocoa::processBusAfterRender): * platform/audio/mac/AudioDestinationMac.h: Removed. * platform/mock/MockAudioDestinationCocoa.cpp: Added. (WebCore::MockAudioDestinationCocoa::MockAudioDestinationCocoa): (WebCore::MockAudioDestinationCocoa::start): (WebCore::MockAudioDestinationCocoa::stop): (WebCore::MockAudioDestinationCocoa::tick): * platform/mock/MockAudioDestinationCocoa.h: Added. * testing/Internals.cpp: (WebCore::Internals::Internals): (WebCore::Internals::useMockAudioDestinationCocoa): * testing/Internals.h: * testing/Internals.idl: LayoutTests: * fast/mediastream/getUserMedia-webaudio-expected.txt: * fast/mediastream/getUserMedia-webaudio.html: Canonical link: https://commits.webkit.org/216605@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251367 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-10-21 16:29:06 +00:00
platform/audio/cocoa/AudioDestinationCocoa.cpp
WebCore::createBusFromInMemoryAudioFile() may crash under ExtAudioFileRead() https://bugs.webkit.org/show_bug.cgi?id=221642 <rdar://72789841> Reviewed by Geoffrey Garen. The crash seems to indicate we are passing an AudioBufferList to ExtAudioFileRead() that contains a null buffer. It is not obvious how this is happening but I have made the following changes: 1. createAudioBufferList() / destroyAudioListBuffer() implementation is now shared on both macOS and iOS. The implementation now uses fastCalloc and returns null in case of failure to allocate. 2. createAudioBufferList() was renamed to tryCreateAudioBufferList() to make it clear it can return null. All call sites now properly deal with tryCreateAudioBufferList() potentially return null 3. Add a new validateAudioBufferList() function which makes sure that the AudioBufferList we are about to pass to ExtAudioFileRead() does not contain any null buffer. In case of validation failure, we log an error, generate a simulated crash log and early return gracefully instead of crashing later on. 4. Added more assertions to help catch bugs. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/audio/cocoa/AudioFileReaderCocoa.cpp: Added. (WebCore::tryCreateAudioBufferList): (WebCore::destroyAudioBufferList): (WebCore::validateAudioBufferList): * platform/audio/cocoa/AudioFileReaderCocoa.h: Added. * platform/audio/ios/AudioFileReaderIOS.cpp: (WebCore::AudioFileReader::createBus): (WebCore::createAudioBufferList): Deleted. (WebCore::destroyAudioBufferList): Deleted. * platform/audio/mac/AudioFileReaderMac.cpp: (WebCore::AudioFileReader::createBus): (WebCore::createAudioBufferList): Deleted. (WebCore::destroyAudioBufferList): Deleted. Canonical link: https://commits.webkit.org/233929@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272678 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-02-10 20:34:18 +00:00
platform/audio/cocoa/AudioFileReaderCocoa.cpp
[Media in GPU Process] Use CARingBuffer to transfer audio data of an audio destination from a web process to the GPU Process https://bugs.webkit.org/show_bug.cgi?id=217715 Reviewed by Jer Noble. Source/WebCore: Decouple the audio output unit management from AudioDestinationCocoa so that we can run it remotely in other processes, like the GPU process. No new tests, no behavior change. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/audio/AudioDestination.h: Export hardwareSampleRate(). * platform/audio/cocoa/AudioDestinationCocoa.cpp: (WebCore::AudioDestination::create): Remove an unnecessary function call. (WebCore::AudioDestinationCocoa::AudioDestinationCocoa): Add a parameter configureAudioOutputUnit so that we can disable the AudioOutputUnitAdaptor in AudioDestinationCocoa when we need to run the AudioOutputUnitAdaptor in another process. (WebCore::AudioDestinationCocoa::start): (WebCore::AudioDestinationCocoa::stop): (WebCore::AudioDestinationCocoa::getAudioStreamBasicDescription): Rename setAudioStreamBasicDescription() to getAudioStreamBasicDescription() because the function essentially queries the description. (WebCore::AudioDestinationCocoa::hasEnoughFrames const): Add this function so that a subclass can check whether the FIFO has enough audio samples to render. (WebCore::AudioDestinationCocoa::render): Replace the AudioTimeStamp* parameter because we only need two fields of AudioTimeStamp in this function. (WebCore::AudioDestinationCocoa::~AudioDestinationCocoa): Deleted. (WebCore::AudioDestinationCocoa::setAudioStreamBasicDescription): Deleted. (WebCore::AudioDestinationCocoa::inputProc): Deleted. This function is moved to AudioOutputUnitAdaptor. * platform/audio/cocoa/AudioDestinationCocoa.h: (WebCore::AudioDestinationCocoa::outputUnit): Deleted. * platform/audio/cocoa/AudioOutputUnitAdaptor.cpp: Added. (WebCore::AudioOutputUnitAdaptor::AudioOutputUnitAdaptor): (WebCore::AudioOutputUnitAdaptor::~AudioOutputUnitAdaptor): (WebCore::AudioOutputUnitAdaptor::start): (WebCore::AudioOutputUnitAdaptor::stop): (WebCore::AudioOutputUnitAdaptor::inputProc): * platform/audio/cocoa/AudioOutputUnitAdaptor.h: Added. * platform/audio/ios/AudioOutputUnitAdaptorIOS.cpp: Renamed from Source/WebCore/platform/audio/ios/AudioDestinationIOS.cpp. (WebCore::AudioOutputUnitAdaptor::configure): * platform/audio/mac/AudioOutputUnitAdaptorMac.cpp: Renamed from Source/WebCore/platform/audio/mac/AudioDestinationMac.cpp. (WebCore::AudioOutputUnitAdaptor::configure): * platform/mock/MockAudioDestinationCocoa.cpp: (WebCore::MockAudioDestinationCocoa::tick): Source/WebKit: The current implementation of RemoteAudioDestination essentially runs the AudioDestinationCocoa in the GPU process, which is not good because we are adding AudioWorklet stuff into AudioDestinationCocoa, but the AudioWorklet stuff is irrelevant to the GPU process. What really needs to run in the GPU process (for Cocoa platforms at least) is the audio output unit. This patch adds WebCore::AudioOutputUnitAdaptor and WebCore::AudioUnitRenderer to implement that. With this patch, RemoteAudioDestination in the GPU process is an AudioUnitRenderer and it embeds an AudioOutputUnitAdaptor like AudioDestinationCocoa does in the Web process. Essentially, we run AudioOutputUnitAdaptor remotely from the AudioDestinationCocoa's perspective. Also, in the current implementation, the RemoteAudioDestinationProxy in a Web process transfers audio data to the RemoteAudioDestination in the GPU process with IPC messages (RemoteAudioBusData). This is not efficient because of the large number of IPC messages for audio samples. With this patch, RemoteAudioDestinationProxy (Web process) transfers audio samples to RemoteAudioDestination(GPU process) with a CARingBuffer providing shared buffers for the Web process and the GPU process. * GPUProcess/media/RemoteAudioDestinationManager.cpp: (WebKit::RemoteAudioDestination::create): (WebKit::RemoteAudioDestination::~RemoteAudioDestination): (WebKit::RemoteAudioDestination::audioSamplesStorageChanged): (WebKit::RemoteAudioDestination::start): (WebKit::RemoteAudioDestination::stop): (WebKit::RemoteAudioDestination::isPlaying const): (WebKit::RemoteAudioDestination::RemoteAudioDestination): (WebKit::RemoteAudioDestination::storage): (WebKit::RemoteAudioDestination::render): (WebKit::RemoteAudioDestinationManager::createAudioDestination): (WebKit::RemoteAudioDestinationManager::audioSamplesStorageChanged): (WebKit::RemoteAudioDestination::isPlaying): Deleted. (WebKit::RemoteAudioDestination::framesPerBuffer const): Deleted. * GPUProcess/media/RemoteAudioDestinationManager.h: (WebKit::RemoteAudioDestinationManager::didReceiveSyncMessageFromWebProcess): * GPUProcess/media/RemoteAudioDestinationManager.messages.in: Add a message AudioSamplesStorageChanged to support using CARingBuffer to transmit audio samples to the GPU process. * WebKit.xcodeproj/project.pbxproj: * WebProcess/GPU/media/RemoteAudioBusData.h: Removed. * WebProcess/GPU/media/RemoteAudioDestinationProxy.cpp: (WebKit::RemoteAudioDestinationProxy::RemoteAudioDestinationProxy): (WebKit::RemoteAudioDestinationProxy::start): (WebKit::RemoteAudioDestinationProxy::stop): (WebKit::RemoteAudioDestinationProxy::requestBuffer): (WebKit::RemoteAudioDestinationProxy::renderOnRenderingThead): (WebKit::RemoteAudioDestinationProxy::storageChanged): (WebKit::RemoteAudioDestinationProxy::renderBuffer): Deleted. (WebKit::RemoteAudioDestinationProxy::didChangeIsPlaying): Deleted. * WebProcess/GPU/media/RemoteAudioDestinationProxy.h: RemoteAudioDestinationProxy is a subclass of AudioDestinationCocoa. It pulls audio samples from the WebAudio side and use a CARingBuffer to push audio samples to the audio output unit (managed by RemoteAudioDestination) in the GPU process. * WebProcess/GPU/media/RemoteAudioDestinationProxy.messages.in: Add a message RequestBuffer, which can be used by RemoteAudioDestination to ask for (pull) audio samples. * WebProcess/GPU/webrtc/AudioMediaStreamTrackRenderer.cpp: (WebKit::AudioMediaStreamTrackRenderer::pushSamples): A minor fix to get rid of a type conversion. Canonical link: https://commits.webkit.org/230590@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@268632 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-10-17 04:18:37 +00:00
platform/audio/cocoa/AudioOutputUnitAdaptor.cpp
Move some audio buffer management related files from folder "mac" to folder "cocoa" https://bugs.webkit.org/show_bug.cgi?id=217497 Reviewed by Youenn Fablet. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/audio/cocoa/AudioSampleBufferList.cpp: Renamed from Source/WebCore/platform/audio/mac/AudioSampleBufferList.cpp. * platform/audio/cocoa/AudioSampleBufferList.h: Renamed from Source/WebCore/platform/audio/mac/AudioSampleBufferList.h. * platform/audio/cocoa/AudioSampleDataSource.h: Renamed from Source/WebCore/platform/audio/mac/AudioSampleDataSource.h. * platform/audio/cocoa/AudioSampleDataSource.mm: Renamed from Source/WebCore/platform/audio/mac/AudioSampleDataSource.mm. * platform/audio/cocoa/CAAudioStreamDescription.cpp: Renamed from Source/WebCore/platform/audio/mac/CAAudioStreamDescription.cpp. (WebCore::CAAudioStreamDescription::sampleRate const): (WebCore::CAAudioStreamDescription::isPCM const): (WebCore::CAAudioStreamDescription::isInterleaved const): (WebCore::CAAudioStreamDescription::isSignedInteger const): (WebCore::CAAudioStreamDescription::isFloat const): (WebCore::CAAudioStreamDescription::isNativeEndian const): (WebCore::CAAudioStreamDescription::numberOfInterleavedChannels const): (WebCore::CAAudioStreamDescription::numberOfChannelStreams const): (WebCore::CAAudioStreamDescription::numberOfChannels const): (WebCore::CAAudioStreamDescription::sampleWordSize const): (WebCore::CAAudioStreamDescription::bytesPerFrame const): (WebCore::CAAudioStreamDescription::bytesPerPacket const): (WebCore::CAAudioStreamDescription::formatFlags const): (WebCore::CAAudioStreamDescription::operator== const): (WebCore::CAAudioStreamDescription::operator!= const): (WebCore::CAAudioStreamDescription::streamDescription const): (WebCore::CAAudioStreamDescription::streamDescription): Move the inline function definitions out-of-line to fix styling issues. * platform/audio/cocoa/CAAudioStreamDescription.h: Renamed from Source/WebCore/platform/audio/mac/CAAudioStreamDescription.h. * platform/audio/cocoa/CARingBuffer.cpp: Renamed from Source/WebCore/platform/audio/mac/CARingBuffer.cpp. * platform/audio/cocoa/CARingBuffer.h: Renamed from Source/WebCore/platform/audio/mac/CARingBuffer.h. Canonical link: https://commits.webkit.org/230297@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@268266 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-10-09 17:10:13 +00:00
platform/audio/cocoa/AudioSampleBufferList.cpp
platform/audio/cocoa/AudioSampleDataSource.mm
platform/audio/cocoa/CAAudioStreamDescription.cpp
platform/audio/cocoa/CARingBuffer.cpp
Enable USE_MEDIAREMOTE on iOS https://bugs.webkit.org/show_bug.cgi?id=189096 Reviewed by Eric Carlson. Source/WebCore: Migrate to using MediaRemote.framework on iOS from MediaPlayer.framework. This unifies the Now Playing implementation on iOS and Mac. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/audio/cocoa/MediaSessionManagerCocoa.cpp: Removed. * platform/audio/cocoa/MediaSessionManagerCocoa.h: * platform/audio/cocoa/MediaSessionManagerCocoa.mm: Renamed from Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm. (PlatformMediaSessionManager::sharedManager): (PlatformMediaSessionManager::sharedManagerIfExists): (MediaSessionManagerCocoa::updateSessionState): (MediaSessionManagerCocoa::beginInterruption): (MediaSessionManagerCocoa::scheduleUpdateNowPlayingInfo): (MediaSessionManagerCocoa::sessionWillBeginPlayback): (MediaSessionManagerCocoa::sessionDidEndRemoteScrubbing): (MediaSessionManagerCocoa::removeSession): (MediaSessionManagerCocoa::sessionWillEndPlayback): (MediaSessionManagerCocoa::clientCharacteristicsChanged): (MediaSessionManagerCocoa::sessionCanProduceAudioChanged): (MediaSessionManagerCocoa::nowPlayingEligibleSession): (MediaSessionManagerCocoa::updateNowPlayingInfo): * platform/audio/ios/MediaSessionManagerIOS.h: (): Deleted. * platform/audio/ios/MediaSessionManagerIOS.mm: (WebCore::MediaSessionManageriOS::nowPlayingEligibleSession): Deleted. (WebCore::MediaSessionManageriOS::updateNowPlayingInfo): Deleted. (WebCore::MediaSessionManageriOS::sessionWillBeginPlayback): Deleted. (WebCore::MediaSessionManageriOS::removeSession): Deleted. (WebCore::MediaSessionManageriOS::sessionWillEndPlayback): Deleted. (WebCore::MediaSessionManageriOS::clientCharacteristicsChanged): Deleted. * platform/audio/mac/MediaSessionManagerMac.h: Removed. Source/WTF: * wtf/Platform.h: Canonical link: https://commits.webkit.org/204636@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236077 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-09-17 18:57:53 +00:00
platform/audio/cocoa/MediaSessionManagerCocoa.mm
platform/audio/cocoa/WebAudioBufferList.cpp
[Media in GPU Process] Use CARingBuffer to transfer audio data of an audio destination from a web process to the GPU Process https://bugs.webkit.org/show_bug.cgi?id=217715 Reviewed by Jer Noble. Source/WebCore: Decouple the audio output unit management from AudioDestinationCocoa so that we can run it remotely in other processes, like the GPU process. No new tests, no behavior change. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/audio/AudioDestination.h: Export hardwareSampleRate(). * platform/audio/cocoa/AudioDestinationCocoa.cpp: (WebCore::AudioDestination::create): Remove an unnecessary function call. (WebCore::AudioDestinationCocoa::AudioDestinationCocoa): Add a parameter configureAudioOutputUnit so that we can disable the AudioOutputUnitAdaptor in AudioDestinationCocoa when we need to run the AudioOutputUnitAdaptor in another process. (WebCore::AudioDestinationCocoa::start): (WebCore::AudioDestinationCocoa::stop): (WebCore::AudioDestinationCocoa::getAudioStreamBasicDescription): Rename setAudioStreamBasicDescription() to getAudioStreamBasicDescription() because the function essentially queries the description. (WebCore::AudioDestinationCocoa::hasEnoughFrames const): Add this function so that a subclass can check whether the FIFO has enough audio samples to render. (WebCore::AudioDestinationCocoa::render): Replace the AudioTimeStamp* parameter because we only need two fields of AudioTimeStamp in this function. (WebCore::AudioDestinationCocoa::~AudioDestinationCocoa): Deleted. (WebCore::AudioDestinationCocoa::setAudioStreamBasicDescription): Deleted. (WebCore::AudioDestinationCocoa::inputProc): Deleted. This function is moved to AudioOutputUnitAdaptor. * platform/audio/cocoa/AudioDestinationCocoa.h: (WebCore::AudioDestinationCocoa::outputUnit): Deleted. * platform/audio/cocoa/AudioOutputUnitAdaptor.cpp: Added. (WebCore::AudioOutputUnitAdaptor::AudioOutputUnitAdaptor): (WebCore::AudioOutputUnitAdaptor::~AudioOutputUnitAdaptor): (WebCore::AudioOutputUnitAdaptor::start): (WebCore::AudioOutputUnitAdaptor::stop): (WebCore::AudioOutputUnitAdaptor::inputProc): * platform/audio/cocoa/AudioOutputUnitAdaptor.h: Added. * platform/audio/ios/AudioOutputUnitAdaptorIOS.cpp: Renamed from Source/WebCore/platform/audio/ios/AudioDestinationIOS.cpp. (WebCore::AudioOutputUnitAdaptor::configure): * platform/audio/mac/AudioOutputUnitAdaptorMac.cpp: Renamed from Source/WebCore/platform/audio/mac/AudioDestinationMac.cpp. (WebCore::AudioOutputUnitAdaptor::configure): * platform/mock/MockAudioDestinationCocoa.cpp: (WebCore::MockAudioDestinationCocoa::tick): Source/WebKit: The current implementation of RemoteAudioDestination essentially runs the AudioDestinationCocoa in the GPU process, which is not good because we are adding AudioWorklet stuff into AudioDestinationCocoa, but the AudioWorklet stuff is irrelevant to the GPU process. What really needs to run in the GPU process (for Cocoa platforms at least) is the audio output unit. This patch adds WebCore::AudioOutputUnitAdaptor and WebCore::AudioUnitRenderer to implement that. With this patch, RemoteAudioDestination in the GPU process is an AudioUnitRenderer and it embeds an AudioOutputUnitAdaptor like AudioDestinationCocoa does in the Web process. Essentially, we run AudioOutputUnitAdaptor remotely from the AudioDestinationCocoa's perspective. Also, in the current implementation, the RemoteAudioDestinationProxy in a Web process transfers audio data to the RemoteAudioDestination in the GPU process with IPC messages (RemoteAudioBusData). This is not efficient because of the large number of IPC messages for audio samples. With this patch, RemoteAudioDestinationProxy (Web process) transfers audio samples to RemoteAudioDestination(GPU process) with a CARingBuffer providing shared buffers for the Web process and the GPU process. * GPUProcess/media/RemoteAudioDestinationManager.cpp: (WebKit::RemoteAudioDestination::create): (WebKit::RemoteAudioDestination::~RemoteAudioDestination): (WebKit::RemoteAudioDestination::audioSamplesStorageChanged): (WebKit::RemoteAudioDestination::start): (WebKit::RemoteAudioDestination::stop): (WebKit::RemoteAudioDestination::isPlaying const): (WebKit::RemoteAudioDestination::RemoteAudioDestination): (WebKit::RemoteAudioDestination::storage): (WebKit::RemoteAudioDestination::render): (WebKit::RemoteAudioDestinationManager::createAudioDestination): (WebKit::RemoteAudioDestinationManager::audioSamplesStorageChanged): (WebKit::RemoteAudioDestination::isPlaying): Deleted. (WebKit::RemoteAudioDestination::framesPerBuffer const): Deleted. * GPUProcess/media/RemoteAudioDestinationManager.h: (WebKit::RemoteAudioDestinationManager::didReceiveSyncMessageFromWebProcess): * GPUProcess/media/RemoteAudioDestinationManager.messages.in: Add a message AudioSamplesStorageChanged to support using CARingBuffer to transmit audio samples to the GPU process. * WebKit.xcodeproj/project.pbxproj: * WebProcess/GPU/media/RemoteAudioBusData.h: Removed. * WebProcess/GPU/media/RemoteAudioDestinationProxy.cpp: (WebKit::RemoteAudioDestinationProxy::RemoteAudioDestinationProxy): (WebKit::RemoteAudioDestinationProxy::start): (WebKit::RemoteAudioDestinationProxy::stop): (WebKit::RemoteAudioDestinationProxy::requestBuffer): (WebKit::RemoteAudioDestinationProxy::renderOnRenderingThead): (WebKit::RemoteAudioDestinationProxy::storageChanged): (WebKit::RemoteAudioDestinationProxy::renderBuffer): Deleted. (WebKit::RemoteAudioDestinationProxy::didChangeIsPlaying): Deleted. * WebProcess/GPU/media/RemoteAudioDestinationProxy.h: RemoteAudioDestinationProxy is a subclass of AudioDestinationCocoa. It pulls audio samples from the WebAudio side and use a CARingBuffer to push audio samples to the audio output unit (managed by RemoteAudioDestination) in the GPU process. * WebProcess/GPU/media/RemoteAudioDestinationProxy.messages.in: Add a message RequestBuffer, which can be used by RemoteAudioDestination to ask for (pull) audio samples. * WebProcess/GPU/webrtc/AudioMediaStreamTrackRenderer.cpp: (WebKit::AudioMediaStreamTrackRenderer::pushSamples): A minor fix to get rid of a type conversion. Canonical link: https://commits.webkit.org/230590@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@268632 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-10-17 04:18:37 +00:00
platform/audio/ios/AudioOutputUnitAdaptorIOS.cpp @no-unify
platform/audio/ios/AudioSessionIOS.mm @no-unify
[GPUP] Move AVSystemController code into the GPU process https://bugs.webkit.org/show_bug.cgi?id=208727 Reviewed by Eric Carlson. Source/WebCore: Move AVSystemController code out of MediaSessionManageriOS and into a new class MediaSessionHelper, which is currently iOS only. The abstract base class will be overriden by WebKit in the WebContent process. Drive-by fix: Don't call a virtual method (resetRestrictions()) from the constructor of a virtual base class; the virtual function table hasn't been created yet, and the subclasses' overridden methods won't be called. Move the call to post-creation. * platform/audio/PlatformMediaSessionManager.cpp: (WebCore::PlatformMediaSessionManager::sharedManager): (WebCore::PlatformMediaSessionManager::PlatformMediaSessionManager): * platform/audio/ios/MediaSessionHelperIOS.h: Added. * platform/audio/ios/MediaSessionHelperIOS.mm: Copied from Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.mm. (sharedHelperInstance): (MediaSessionHelper::sharedHelper): (MediaSessionHelper::resetSharedHelper): (MediaSessionHelper::setSharedHelper): (MediaSessionHelper::addClient): (MediaSessionHelper::removeClient): (MediaSessionHelperiOS::MediaSessionHelperiOS): (MediaSessionHelperiOS::~MediaSessionHelperiOS): (MediaSessionHelperiOS::providePresentingApplicationPID): (MediaSessionHelperiOS::startMonitoringWirelessRoutes): (MediaSessionHelperiOS::stopMonitoringWirelessRoutes): (MediaSessionHelperiOS::carPlayServerDied): (MediaSessionHelperiOS::updateCarPlayIsConnected): (MediaSessionHelperiOS::setIsPlayingToAutomotiveHeadUnit): (MediaSessionHelperiOS::activeAudioRouteDidChange): (MediaSessionHelperiOS::activeVideoRouteDidChange): (MediaSessionHelperiOS::receivedInterruption): (MediaSessionHelperiOS::applicationDidBecomeActive): (MediaSessionHelperiOS::applicationDidEnterBackground): (MediaSessionHelperiOS::applicationWillBecomeInactive): (MediaSessionHelperiOS::applicationWillEnterForeground): (MediaSessionHelperiOS::externalOutputDeviceAvailableDidChange): (-[WebMediaSessionHelper initWithCallback:]): (-[WebMediaSessionHelper dealloc]): (-[WebMediaSessionHelper clearCallback]): (-[WebMediaSessionHelper hasWirelessTargetsAvailable]): (-[WebMediaSessionHelper startMonitoringAirPlayRoutes]): (-[WebMediaSessionHelper stopMonitoringAirPlayRoutes]): (-[WebMediaSessionHelper interruption:]): (-[WebMediaSessionHelper applicationWillEnterForeground:]): (-[WebMediaSessionHelper applicationDidBecomeActive:]): (-[WebMediaSessionHelper applicationWillResignActive:]): (-[WebMediaSessionHelper wirelessRoutesAvailableDidChange:]): (-[WebMediaSessionHelper applicationDidEnterBackground:]): (-[WebMediaSessionHelper carPlayServerDied:]): (-[WebMediaSessionHelper carPlayIsConnectedDidChange:]): (-[WebMediaSessionHelper activeAudioRouteDidChange:]): * platform/audio/ios/MediaSessionManagerIOS.h: * platform/audio/ios/MediaSessionManagerIOS.mm: (WebCore::MediaSessionManageriOS::MediaSessionManageriOS): (WebCore::MediaSessionManageriOS::~MediaSessionManageriOS): (WebCore::MediaSessionManageriOS::hasWirelessTargetsAvailable): (WebCore::MediaSessionManageriOS::configureWireLessTargetMonitoring): (WebCore::MediaSessionManageriOS::providePresentingApplicationPIDIfNecessary): (WebCore::MediaSessionManageriOS::providePresentingApplicationPID): (WebCore::MediaSessionManageriOS::externalOutputDeviceAvailableDidChange): (WebCore::MediaSessionManageriOS::isPlayingToAutomotiveHeadUnitDidChange): (WebCore::MediaSessionManageriOS::activeAudioRouteDidChange): (WebCore::MediaSessionManageriOS::activeVideoRouteDidChange): (WebCore::MediaSessionManageriOS::receivedInterruption): (WebCore::MediaSessionManageriOS::applicationWillEnterForeground): (WebCore::MediaSessionManageriOS::applicationDidBecomeActive): (WebCore::MediaSessionManageriOS::applicationDidEnterBackground): (WebCore::MediaSessionManageriOS::applicationWillBecomeInactive): (WebCore::MediaSessionManageriOS::carPlayServerDied): Deleted. (WebCore::MediaSessionManageriOS::updateCarPlayIsConnected): Deleted. (-[WebMediaSessionHelper initWithCallback:]): Deleted. (-[WebMediaSessionHelper dealloc]): Deleted. (-[WebMediaSessionHelper clearCallback]): Deleted. (-[WebMediaSessionHelper hasWirelessTargetsAvailable]): Deleted. (-[WebMediaSessionHelper startMonitoringAirPlayRoutes]): Deleted. (-[WebMediaSessionHelper stopMonitoringAirPlayRoutes]): Deleted. (-[WebMediaSessionHelper interruption:]): Deleted. (-[WebMediaSessionHelper applicationWillEnterForeground:]): Deleted. (-[WebMediaSessionHelper applicationDidBecomeActive:]): Deleted. (-[WebMediaSessionHelper applicationWillResignActive:]): Deleted. (-[WebMediaSessionHelper wirelessRoutesAvailableDidChange:]): Deleted. (-[WebMediaSessionHelper applicationDidEnterBackground:]): Deleted. (-[WebMediaSessionHelper carPlayServerDied:]): Deleted. (-[WebMediaSessionHelper carPlayIsConnectedDidChange:]): Deleted. (-[WebMediaSessionHelper activeAudioRouteDidChange:]): Deleted. Source/WebKit: 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): Canonical link: https://commits.webkit.org/221716@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258109 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-03-08 19:22:33 +00:00
platform/audio/ios/MediaSessionHelperIOS.mm @no-unify
platform/audio/ios/MediaSessionManagerIOS.mm @no-unify
platform/audio/mac/AudioBusMac.mm
[Media in GPU Process] Use CARingBuffer to transfer audio data of an audio destination from a web process to the GPU Process https://bugs.webkit.org/show_bug.cgi?id=217715 Reviewed by Jer Noble. Source/WebCore: Decouple the audio output unit management from AudioDestinationCocoa so that we can run it remotely in other processes, like the GPU process. No new tests, no behavior change. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/audio/AudioDestination.h: Export hardwareSampleRate(). * platform/audio/cocoa/AudioDestinationCocoa.cpp: (WebCore::AudioDestination::create): Remove an unnecessary function call. (WebCore::AudioDestinationCocoa::AudioDestinationCocoa): Add a parameter configureAudioOutputUnit so that we can disable the AudioOutputUnitAdaptor in AudioDestinationCocoa when we need to run the AudioOutputUnitAdaptor in another process. (WebCore::AudioDestinationCocoa::start): (WebCore::AudioDestinationCocoa::stop): (WebCore::AudioDestinationCocoa::getAudioStreamBasicDescription): Rename setAudioStreamBasicDescription() to getAudioStreamBasicDescription() because the function essentially queries the description. (WebCore::AudioDestinationCocoa::hasEnoughFrames const): Add this function so that a subclass can check whether the FIFO has enough audio samples to render. (WebCore::AudioDestinationCocoa::render): Replace the AudioTimeStamp* parameter because we only need two fields of AudioTimeStamp in this function. (WebCore::AudioDestinationCocoa::~AudioDestinationCocoa): Deleted. (WebCore::AudioDestinationCocoa::setAudioStreamBasicDescription): Deleted. (WebCore::AudioDestinationCocoa::inputProc): Deleted. This function is moved to AudioOutputUnitAdaptor. * platform/audio/cocoa/AudioDestinationCocoa.h: (WebCore::AudioDestinationCocoa::outputUnit): Deleted. * platform/audio/cocoa/AudioOutputUnitAdaptor.cpp: Added. (WebCore::AudioOutputUnitAdaptor::AudioOutputUnitAdaptor): (WebCore::AudioOutputUnitAdaptor::~AudioOutputUnitAdaptor): (WebCore::AudioOutputUnitAdaptor::start): (WebCore::AudioOutputUnitAdaptor::stop): (WebCore::AudioOutputUnitAdaptor::inputProc): * platform/audio/cocoa/AudioOutputUnitAdaptor.h: Added. * platform/audio/ios/AudioOutputUnitAdaptorIOS.cpp: Renamed from Source/WebCore/platform/audio/ios/AudioDestinationIOS.cpp. (WebCore::AudioOutputUnitAdaptor::configure): * platform/audio/mac/AudioOutputUnitAdaptorMac.cpp: Renamed from Source/WebCore/platform/audio/mac/AudioDestinationMac.cpp. (WebCore::AudioOutputUnitAdaptor::configure): * platform/mock/MockAudioDestinationCocoa.cpp: (WebCore::MockAudioDestinationCocoa::tick): Source/WebKit: The current implementation of RemoteAudioDestination essentially runs the AudioDestinationCocoa in the GPU process, which is not good because we are adding AudioWorklet stuff into AudioDestinationCocoa, but the AudioWorklet stuff is irrelevant to the GPU process. What really needs to run in the GPU process (for Cocoa platforms at least) is the audio output unit. This patch adds WebCore::AudioOutputUnitAdaptor and WebCore::AudioUnitRenderer to implement that. With this patch, RemoteAudioDestination in the GPU process is an AudioUnitRenderer and it embeds an AudioOutputUnitAdaptor like AudioDestinationCocoa does in the Web process. Essentially, we run AudioOutputUnitAdaptor remotely from the AudioDestinationCocoa's perspective. Also, in the current implementation, the RemoteAudioDestinationProxy in a Web process transfers audio data to the RemoteAudioDestination in the GPU process with IPC messages (RemoteAudioBusData). This is not efficient because of the large number of IPC messages for audio samples. With this patch, RemoteAudioDestinationProxy (Web process) transfers audio samples to RemoteAudioDestination(GPU process) with a CARingBuffer providing shared buffers for the Web process and the GPU process. * GPUProcess/media/RemoteAudioDestinationManager.cpp: (WebKit::RemoteAudioDestination::create): (WebKit::RemoteAudioDestination::~RemoteAudioDestination): (WebKit::RemoteAudioDestination::audioSamplesStorageChanged): (WebKit::RemoteAudioDestination::start): (WebKit::RemoteAudioDestination::stop): (WebKit::RemoteAudioDestination::isPlaying const): (WebKit::RemoteAudioDestination::RemoteAudioDestination): (WebKit::RemoteAudioDestination::storage): (WebKit::RemoteAudioDestination::render): (WebKit::RemoteAudioDestinationManager::createAudioDestination): (WebKit::RemoteAudioDestinationManager::audioSamplesStorageChanged): (WebKit::RemoteAudioDestination::isPlaying): Deleted. (WebKit::RemoteAudioDestination::framesPerBuffer const): Deleted. * GPUProcess/media/RemoteAudioDestinationManager.h: (WebKit::RemoteAudioDestinationManager::didReceiveSyncMessageFromWebProcess): * GPUProcess/media/RemoteAudioDestinationManager.messages.in: Add a message AudioSamplesStorageChanged to support using CARingBuffer to transmit audio samples to the GPU process. * WebKit.xcodeproj/project.pbxproj: * WebProcess/GPU/media/RemoteAudioBusData.h: Removed. * WebProcess/GPU/media/RemoteAudioDestinationProxy.cpp: (WebKit::RemoteAudioDestinationProxy::RemoteAudioDestinationProxy): (WebKit::RemoteAudioDestinationProxy::start): (WebKit::RemoteAudioDestinationProxy::stop): (WebKit::RemoteAudioDestinationProxy::requestBuffer): (WebKit::RemoteAudioDestinationProxy::renderOnRenderingThead): (WebKit::RemoteAudioDestinationProxy::storageChanged): (WebKit::RemoteAudioDestinationProxy::renderBuffer): Deleted. (WebKit::RemoteAudioDestinationProxy::didChangeIsPlaying): Deleted. * WebProcess/GPU/media/RemoteAudioDestinationProxy.h: RemoteAudioDestinationProxy is a subclass of AudioDestinationCocoa. It pulls audio samples from the WebAudio side and use a CARingBuffer to push audio samples to the audio output unit (managed by RemoteAudioDestination) in the GPU process. * WebProcess/GPU/media/RemoteAudioDestinationProxy.messages.in: Add a message RequestBuffer, which can be used by RemoteAudioDestination to ask for (pull) audio samples. * WebProcess/GPU/webrtc/AudioMediaStreamTrackRenderer.cpp: (WebKit::AudioMediaStreamTrackRenderer::pushSamples): A minor fix to get rid of a type conversion. Canonical link: https://commits.webkit.org/230590@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@268632 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-10-17 04:18:37 +00:00
platform/audio/mac/AudioOutputUnitAdaptorMac.cpp
platform/audio/mac/AudioHardwareListenerMac.cpp
Adopt interface AVAudioRoutingArbiter for Mac https://bugs.webkit.org/show_bug.cgi?id=210167 Source/WebCore: Reviewed by Eric Carlson. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/audio/ios/AudioSessionIOS.mm: (WebCore::AudioSession::setCategory): (WebCore::categoryName): Deleted. * platform/audio/mac/AudioSessionMac.mm: Renamed from Source/WebCore/platform/audio/mac/AudioSessionMac.cpp. (WebCore::AudioSession::setCategory): (WebCore::AudioSession::categoryOverride const): (WebCore::AudioSession::setCategoryOverride): Fix unified build failures. * platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.h: Source/WebCore/PAL: Reviewed by Eric Carlson. Add softlink for AVAudioRoutingArbiter. * pal/cocoa/AVFoundationSoftLink.h: * pal/cocoa/AVFoundationSoftLink.mm: Source/WebKit: <rdar://problem/59113994> Reviewed by Eric Carlson. Add a new cross-process object pair, AudioSessionRouterAbitrator/Proxy which passes routing arbitration commands from WebContent -> UIProcess. Because the UIProcess can represent multiple WebContent processes, it must track all outstanding arbitration requests globally. * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * GPUProcess/GPUProcess.cpp: (WebKit::GPUProcess::initializeGPUProcess): * Sources.txt: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::mediaRelatedMachServices): * UIProcess/Media/AudioSessionRoutingArbitratorProxy.cpp: Added. (WebKit::AudioSessionRoutingArbitratorProxy::AudioSessionRoutingArbitratorProxy): (WebKit::AudioSessionRoutingArbitratorProxy::~AudioSessionRoutingArbitratorProxy): (WebKit::AudioSessionRoutingArbitratorProxy::beginRoutingArbitrationWithCategory): (WebKit::AudioSessionRoutingArbitratorProxy::leaveRoutingArbitration): * UIProcess/Media/AudioSessionRoutingArbitratorProxy.h: Added. (WebKit::AudioSessionRoutingArbitratorProxy::category const): (WebKit::AudioSessionRoutingArbitratorProxy::destinationId): * UIProcess/Media/AudioSessionRoutingArbitratorProxy.messages.in: Added. * UIProcess/Media/cocoa/AudioSessionRoutingArbitratorProxyCocoa.mm: Added. (WebKit::SharedArbitrator::sharedInstance): (WebKit::SharedArbitrator::beginRoutingArbitrationForArbitrator): (WebKit::SharedArbitrator::leaveRoutingArbitrationForArbitrator): (WebKit::AudioSessionRoutingArbitratorProxy::AudioSessionRoutingArbitratorProxy): (WebKit::AudioSessionRoutingArbitratorProxy::~AudioSessionRoutingArbitratorProxy): (WebKit::AudioSessionRoutingArbitratorProxy::beginRoutingArbitrationWithCategory): (WebKit::AudioSessionRoutingArbitratorProxy::leaveRoutingArbitration): * UIProcess/WebPageProxy.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::WebProcessProxy): * UIProcess/WebProcessProxy.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebPage/WebPage.cpp: (WebKit::m_processDisplayName): * WebProcess/WebProcess.cpp: * WebProcess/cocoa/AudioSessionRoutingArbitrator.cpp: Added. (WebKit::AudioSessionRoutingArbitrator::AudioSessionRoutingArbitrator): (WebKit::AudioSessionRoutingArbitrator::supplementName): (WebKit::AudioSessionRoutingArbitrator::beginRoutingArbitrationWithCategory): (WebKit::AudioSessionRoutingArbitrator::leaveRoutingAbritration): * WebProcess/cocoa/AudioSessionRoutingArbitrator.h: Added. * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::AudioFactory::createAudioCaptureSource): * WebProcess/com.apple.WebProcess.sb.in: Source/WTF: Reviewed by Eric Carlson. Add macro HAVE_AVAUDIO_ROUTING_ARBITER. * wtf/PlatformHave.h: Tools: Reviewed by Eric Carlson. Add test for softlink of AVAudioRoutingArbiter. * TestWebKitAPI/Tests/WebCore/cocoa/AVFoundationSoftLinkTest.mm: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/223396@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@260102 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-04-14 22:35:47 +00:00
platform/audio/mac/AudioSessionMac.mm
platform/audio/mac/FFTFrameMac.cpp
[Media in GPU Process] Move AudioSessionRoutingArbitratorProxy to the GPU process https://bugs.webkit.org/show_bug.cgi?id=217535 <rdar://problem/70152548> Reviewed by Eric Carlson. Source/WebCore: Add a new shared object, SharedRoutingArbitrator, to be used both in the UIProcess (when media in the GPU process is not enabled) and the GPUProcess (when it is). * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/audio/AudioSession.h: * platform/audio/mac/SharedRoutingArbitrator.h: Added. * platform/audio/mac/SharedRoutingArbitrator.mm: Added. (WebCore::SharedRoutingArbitrator::Token::create): (WebCore::SharedRoutingArbitrator::sharedInstance): (WebCore::SharedRoutingArbitrator::isInRoutingArbitrationForToken): (WebCore::SharedRoutingArbitrator::beginRoutingArbitrationForToken): (WebCore::SharedRoutingArbitrator::endRoutingArbitrationForToken): Source/WebKit: Add a new, local-only object which can aggregate changes to the audio routing. The UIProcess version of this object spans a process boundary, but this new object can operate locally without an XPC communication channel. As part of this change, the "SharedArbitrator" in AudioSessionRoutingArbitratorProxyCocoa has been moved into WebCore to be used both there and in this new object. * GPUProcess/GPUConnectionToWebProcess.cpp: (WebKit::GPUConnectionToWebProcess::GPUConnectionToWebProcess): (WebKit::GPUConnectionToWebProcess::didClose): * GPUProcess/GPUConnectionToWebProcess.h: * GPUProcess/mac/LocalAudioSessionRoutingArbitrator.cpp: Added. (WebKit::LocalAudioSessionRoutingArbitrator::create): (WebKit::LocalAudioSessionRoutingArbitrator::LocalAudioSessionRoutingArbitrator): (WebKit::LocalAudioSessionRoutingArbitrator::~LocalAudioSessionRoutingArbitrator): (WebKit::LocalAudioSessionRoutingArbitrator::processDidTerminate): (WebKit::LocalAudioSessionRoutingArbitrator::beginRoutingArbitrationWithCategory): (WebKit::LocalAudioSessionRoutingArbitrator::leaveRoutingAbritration): * GPUProcess/mac/LocalAudioSessionRoutingArbitrator.h: * SourcesCocoa.txt: * UIProcess/Media/AudioSessionRoutingArbitratorProxy.h: * UIProcess/Media/cocoa/AudioSessionRoutingArbitratorProxyCocoa.mm: (WebKit::AudioSessionRoutingArbitratorProxy::AudioSessionRoutingArbitratorProxy): (WebKit::AudioSessionRoutingArbitratorProxy::processDidTerminate): (WebKit::AudioSessionRoutingArbitratorProxy::beginRoutingArbitrationWithCategory): (WebKit::AudioSessionRoutingArbitratorProxy::endRoutingArbitration): (): Deleted. (WebKit::SharedArbitrator::sharedInstance): Deleted. (WebKit::SharedArbitrator::isInRoutingArbitrationForArbitrator): Deleted. (WebKit::SharedArbitrator::beginRoutingArbitrationForArbitrator): Deleted. (WebKit::SharedArbitrator::endRoutingArbitrationForArbitrator): Deleted. * WebKit.xcodeproj/project.pbxproj: * WebProcess/GPU/media/RemoteAudioSession.cpp: (WebKit::RemoteAudioSession::setCategory): Canonical link: https://commits.webkit.org/237316@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276993 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-04 23:50:04 +00:00
platform/audio/mac/SharedRoutingArbitrator.mm
platform/cf/KeyedDecoderCF.cpp
platform/cf/KeyedEncoderCF.cpp
platform/cf/MainThreadSharedTimerCF.cpp
platform/cf/MediaAccessibilitySoftLink.cpp
platform/cf/RunLoopObserver.cpp
platform/cf/SharedBufferCF.cpp
platform/cocoa/ContentFilterUnblockHandlerCocoa.mm @no-unify
platform/cocoa/CoreVideoSoftLink.cpp
Rename DragDataMac and DragImageMac to DragDataCocoa and DragImageCocoa https://bugs.webkit.org/show_bug.cgi?id=209523 Reviewed by Megan Gardner. Rename DragDataMac to DragDataCocoa, and DragImageMac to DragImageCocoa. These files contain logic relevant to both macOS and iOS, and as such, belong in platform/cocoa rather than platform/mac. No change in behavior. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/cocoa/DragDataCocoa.mm: Renamed from Source/WebCore/platform/mac/DragDataMac.mm. (WebCore::rtfPasteboardType): (WebCore::rtfdPasteboardType): (WebCore::stringPasteboardType): (WebCore::urlPasteboardType): (WebCore::htmlPasteboardType): (WebCore::colorPasteboardType): (WebCore::pdfPasteboardType): (WebCore::tiffPasteboardType): (WebCore::DragData::DragData): (WebCore::DragData::containsURLTypeIdentifier const): (WebCore::DragData::canSmartReplace const): (WebCore::DragData::containsColor const): (WebCore::DragData::containsFiles const): (WebCore::DragData::numberOfFiles const): (WebCore::DragData::asFilenames const): (WebCore::DragData::containsPlainText const): (WebCore::DragData::asPlainText const): (WebCore::DragData::asColor const): (WebCore::DragData::containsCompatibleContent const): (WebCore::DragData::containsPromise const): (WebCore::DragData::containsURL const): (WebCore::DragData::asURL const): * platform/cocoa/DragImageCocoa.mm: Renamed from Source/WebCore/platform/mac/DragImageMac.mm. (WebCore::dragImageSize): (WebCore::deleteDragImage): (WebCore::scaleDragImage): (WebCore::dissolveDragImageToFraction): (WebCore::createDragImageFromImage): (WebCore::createDragImageIconForCachedImageFilename): (WebCore::dragOffsetForLinkDragImage): (WebCore::anchorPointForLinkDragImage): (WebCore::LinkImageLayout::LinkImageLayout): (WebCore::createDragImageForLink): (WebCore::createDragImageForColor): * platform/graphics/gpu/cocoa/GPUShaderModuleMetal.mm: Unrelated build fix due to changing unified sources. Canonical link: https://commits.webkit.org/222452@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258966 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-03-25 01:22:03 +00:00
platform/cocoa/DragDataCocoa.mm
platform/cocoa/DragImageCocoa.mm
platform/cocoa/FileMonitorCocoa.mm
platform/cocoa/KeyEventCocoa.mm
platform/cocoa/LocalizedStringsCocoa.mm
platform/cocoa/LowPowerModeNotifier.mm
platform/cocoa/MIMETypeRegistryCocoa.mm
Implement audio capture for SpeechRecognition on macOS https://bugs.webkit.org/show_bug.cgi?id=218855 <rdar://problem/71331001> Reviewed by Youenn Fablet. Source/WebCore: Introduce SpeechRecognizer, which performs audio capture and speech recogntion operations. On start, SpeechRecognizer creates a SpeechRecognitionCaptureSource and starts audio capturing. On stop, SpeechRecognizer clears the source and stops recognizing. SpeechRecognizer can only handle one request at a time, so calling start on already started SpeechRecognizer would cause ongoing request to be aborted. Tests: fast/speechrecognition/start-recognition-then-stop.html fast/speechrecognition/start-second-recognition.html * Headers.cmake: * Modules/speech/SpeechRecognitionCaptureSource.cpp: Added. (WebCore::SpeechRecognitionCaptureSource::SpeechRecognitionCaptureSource): * Modules/speech/SpeechRecognitionCaptureSource.h: Added. * Modules/speech/SpeechRecognitionCaptureSourceImpl.cpp: Added. SpeechRecognitionCaptureSourceImpl provides implementation of SpeechRecognitionCaptureSource on when ENABLE(MEDIA_STREAM) is true. (WebCore::nextLogIdentifier): (WebCore::nullLogger): (WebCore::SpeechRecognitionCaptureSourceImpl::SpeechRecognitionCaptureSourceImpl): (WebCore::SpeechRecognitionCaptureSourceImpl::~SpeechRecognitionCaptureSourceImpl): (WebCore::SpeechRecognitionCaptureSourceImpl::audioSamplesAvailable): Push data to buffer, signal main thread to pull from buffer and invoke data callback. (WebCore::SpeechRecognitionCaptureSourceImpl::sourceStarted): (WebCore::SpeechRecognitionCaptureSourceImpl::sourceStopped): (WebCore::SpeechRecognitionCaptureSourceImpl::sourceMutedChanged): * Modules/speech/SpeechRecognitionCaptureSourceImpl.h: Added. * Modules/speech/SpeechRecognizer.cpp: Added. (WebCore::SpeechRecognizer::SpeechRecognizer): (WebCore::SpeechRecognizer::reset): (WebCore::SpeechRecognizer::start): (WebCore::SpeechRecognizer::startInternal): (WebCore::SpeechRecognizer::stop): (WebCore::SpeechRecognizer::stopInternal): * Modules/speech/SpeechRecognizer.h: Added. (WebCore::SpeechRecognizer::currentClientIdentifier const): * Sources.txt: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/cocoa/MediaUtilities.cpp: Added. (WebCore::createAudioFormatDescription): (WebCore::createAudioSampleBuffer): * platform/cocoa/MediaUtilities.h: Added. * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: Move code for creating CMSampleBufferRef to MediaUtilities.h/cpp so it can shared between SpeechRecognition and UserMedia, as Speech recognition backend will take CMSampleBufferRef as input. (WebCore::createAudioFormatDescription): Deleted. (WebCore::createAudioSampleBuffer): Deleted. Source/WebKit: * UIProcess/SpeechRecognitionPermissionManager.cpp: (WebKit::SpeechRecognitionPermissionManager::startProcessingRequest): Check and enable mock devices based on preference as SpeechRecognition needs it for testing. * UIProcess/SpeechRecognitionServer.cpp: (WebKit::SpeechRecognitionServer::start): (WebKit::SpeechRecognitionServer::requestPermissionForRequest): (WebKit::SpeechRecognitionServer::handleRequest): (WebKit::SpeechRecognitionServer::stop): (WebKit::SpeechRecognitionServer::abort): (WebKit::SpeechRecognitionServer::invalidate): (WebKit::SpeechRecognitionServer::sendUpdate): (WebKit::SpeechRecognitionServer::stopRequest): Deleted. (WebKit::SpeechRecognitionServer::abortRequest): Deleted. * UIProcess/SpeechRecognitionServer.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::syncIfMockDevicesEnabledChanged): * UIProcess/WebPageProxy.h: LayoutTests: * TestExpectations: * fast/speechrecognition/start-recognition-in-removed-iframe.html: mark test as async to avoid flakiness. * fast/speechrecognition/start-recognition-then-stop-expected.txt: Added. * fast/speechrecognition/start-recognition-then-stop.html: Added. * fast/speechrecognition/start-second-recognition-expected.txt: Added. * fast/speechrecognition/start-second-recognition.html: Added. * platform/wk2/TestExpectations: Canonical link: https://commits.webkit.org/231867@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270158 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-11-22 05:51:10 +00:00
platform/cocoa/MediaUtilities.cpp
platform/cocoa/NetworkExtensionContentFilter.mm
platform/cocoa/ParentalControlsContentFilter.mm
platform/cocoa/PasteboardCocoa.mm
[Clipboard API] Support writing multiple PasteboardCustomData with SharedBuffers to the pasteboard https://bugs.webkit.org/show_bug.cgi?id=202851 Reviewed by Darin Adler. Source/WebCore: This patch refactors some logic around WebCore::PasteboardCustomData, in preparation for implementing the async clipboard API. There are two main goals of this refactoring: 1. Enable writing multiple items (each backed by PasteboardCustomData) to the platform pasteboard. 2. Enable writing platform data in the form of SharedBuffers to the platform pasteboard. See below for more details; no tests, as there is no change in behavior yet. * Headers.cmake: * Sources.txt: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: Move PasteboardCustomData out of Pasteboard.h and into its own file. * dom/DataTransfer.cpp: (WebCore::DataTransfer::commitToPasteboard): * editing/cocoa/EditorCocoa.mm: (WebCore::Editor::getPasteboardTypesAndDataForAttachment): * platform/Pasteboard.cpp: (WebCore::PasteboardCustomData::createSharedBuffer const): Deleted. (WebCore::PasteboardCustomData::fromSharedBuffer): Deleted. Moved these method implementations to PasteboardCustomData.cpp. * platform/Pasteboard.h: Refactor PasteboardCustomData so that its member variables are now private, and encapsulated behind methods Additionally, make it so that the only way to set data on PasteboardCustomData is to use the writeString, writeData, and writeStringInCustomData methods, which ensure that the PasteboardCustomData is always in a consistent state. * platform/PasteboardCustomData.cpp: Added. (WebCore::copyPlatformData): (WebCore::PasteboardCustomData::Entry::Entry): (WebCore::PasteboardCustomData::Entry::operator=): Refactor the implementation of PasteboardCustomData, so that it contains a list of PasteboardCustomData entries instead of individual Vectors and HashMaps. (WebCore::PasteboardCustomData::PasteboardCustomData): (WebCore::PasteboardCustomData::createSharedBuffer const): (WebCore::PasteboardCustomData::fromSharedBuffer): (WebCore::PasteboardCustomData::writeString): (WebCore::PasteboardCustomData::writeData): (WebCore::PasteboardCustomData::writeStringInCustomData): (WebCore::PasteboardCustomData::addOrMoveEntryToEnd): Move logic from StaticPasteboard into PasteboardCustomData, and refactor these methods to handle Vector<PasteboardCustomData::Entry>. (WebCore::PasteboardCustomData::clear): (WebCore::PasteboardCustomData::operator=): (WebCore::PasteboardCustomData::orderedTypes const): (WebCore::PasteboardCustomData::hasData const): (WebCore::PasteboardCustomData::hasSameOriginCustomData const): (WebCore::PasteboardCustomData::sameOriginCustomStringData const): (WebCore::PasteboardCustomData::readBuffer const): (WebCore::PasteboardCustomData::readString const): (WebCore::PasteboardCustomData::readStringInCustomData const): (WebCore::PasteboardCustomData::forEachType const): (WebCore::PasteboardCustomData::forEachPlatformString const): (WebCore::PasteboardCustomData::forEachCustomString const): (WebCore::PasteboardCustomData::forEachPlatformStringOrBuffer const): Moved these method implementations from StaticPasteboard to PasteboardCustomData, and also introduced some new methods to help iterate through types and data. * platform/PasteboardCustomData.h: Added. (WebCore::PasteboardCustomData::origin const): (WebCore::PasteboardCustomData::setOrigin): (WebCore::PasteboardCustomData::data const): * platform/PasteboardStrategy.h: * platform/PlatformPasteboard.h: * platform/SharedBuffer.cpp: (WebCore::SharedBuffer::decoder const): * platform/SharedBuffer.h: * platform/StaticPasteboard.cpp: (WebCore::StaticPasteboard::hasData): (WebCore::StaticPasteboard::typesSafeForBindings): (WebCore::StaticPasteboard::typesForLegacyUnsafeBindings): (WebCore::StaticPasteboard::readString): (WebCore::StaticPasteboard::readStringInCustomData): (WebCore::StaticPasteboard::writeString): (WebCore::StaticPasteboard::writeData): (WebCore::StaticPasteboard::writeStringInCustomData): (WebCore::StaticPasteboard::clear): (WebCore::StaticPasteboard::takeCustomData): (WebCore::StaticPasteboard::StaticPasteboard): Deleted. Refactor StaticPasteboard to now contain a PasteboardCustomData; additionally, adjust several methods in StaticPasteboard to simply call into PasteboardCustomData to write, read, or clear data. (WebCore::updateTypes): Deleted. * platform/StaticPasteboard.h: * platform/cocoa/PasteboardCocoa.mm: (WebCore::Pasteboard::readStringInCustomData): (WebCore::Pasteboard::readOrigin): (WebCore::PasteboardCustomData::cocoaType): Deleted. Moved the implementation of PasteboardCustomData::cocoaType from PasteboardCocoa.mm to PasteboardCustomDataCocoa.mm. * platform/cocoa/PasteboardCustomDataCocoa.mm: Added. (WebCore::PasteboardCustomData::cocoaType): * platform/ios/AbstractPasteboard.h: * platform/ios/PlatformPasteboardIOS.mm: (WebCore::PlatformPasteboard::changeCount const): (WebCore::registerItemsToPasteboard): (WebCore::registerItemToPasteboard): (WebCore::PlatformPasteboard::write): Support writing multiple PasteboardCustomData objects to the platform pasteboard on iOS, by generating NSItemProviders for each one. This refactors the existing `registerItemToPasteboard` helper to handle multiple registration lists, renames it to `registerItemsToPasteboard` (plural), and then reimplements `registerItemToPasteboard` in terms of `registerItemsToPasteboard`. (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const): (WebCore::createItemProviderRegistrationList): Adjust these to use getters on PasteboardCustomData instead of accessing the member variables directly. * platform/ios/WebItemProviderPasteboard.mm: (-[WebItemProviderPasteboard init]): (-[WebItemProviderPasteboard stageRegistrationLists:]): (-[WebItemProviderPasteboard clearRegistrationLists]): (-[WebItemProviderPasteboard takeRegistrationLists]): Refactor registration list staging on WebItemProviderPasteboard to support multiple registration lists, each representing a single item provider. (-[WebItemProviderPasteboard stageRegistrationList:]): Deleted. (-[WebItemProviderPasteboard takeRegistrationList]): Deleted. * platform/mac/PasteboardMac.mm: (WebCore::Pasteboard::write): * platform/mac/PasteboardWriter.mm: (WebCore::createPasteboardWriter): * platform/mac/PlatformPasteboardMac.mm: (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const): (WebCore::PlatformPasteboard::write): Support writing multiple PasteboardCustomData objects to the platform pasteboard on macOS, by creating and setting NSPasteboardItems for each custom data. This means that instead of using legacy macOS pasteboard types, we need to use the "modern" NSPasteboardTypes when writing each item. This is because NSPasteboardItem quietly fails when attempting to set data for a legacy pasteboard type. (WebCore::createPasteboardItem): Source/WebKit: 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). Source/WebKitLegacy/mac: See WebCore ChangeLog for more details. * WebCoreSupport/WebPlatformStrategies.h: Canonical link: https://commits.webkit.org/216383@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251100 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-10-14 21:52:26 +00:00
platform/cocoa/PasteboardCustomDataCocoa.mm
[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. Source/WebCore: Moves some pasteboard helper functions out of iOS-specific code, and into platform-agnostic code. See below for more details. There is no change in behavior, as nothing exercises these new pasteboard functions on macOS yet. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/Pasteboard.cpp: (WebCore::Pasteboard::allPasteboardItemInfo const): (WebCore::Pasteboard::pasteboardItemInfo const): (WebCore::Pasteboard::readString): (WebCore::Pasteboard::readBuffer): (WebCore::Pasteboard::readURL): Add some new helpers on Pasteboard to read Strings, data, and URLs from the platform pasteboard. These forward to the platform strategy which, in WebKit2, are currently implemented using sync IPC, but could be changed in the future to be fully asynchronous. * platform/Pasteboard.h: (WebCore::Pasteboard::name const): Expose a cross-platform name() getter on Pasteboard. On non-Cocoa platforms, this simply returns the empty string, but on macOS and iOS, this returns the platform pasteboard name, which is stored in m_pasteboardName. * platform/PasteboardItemInfo.h: (WebCore::PasteboardItemInfo::pathForContentType const): (WebCore::PasteboardItemInfo::contentTypeForHighestFidelityItem const): (WebCore::PasteboardItemInfo::encode const): (WebCore::PasteboardItemInfo::decode): Adds a couple of new members to PasteboardItemInfo (which represents metadata about a given item in the platform pasteboard). These are changeCount (which is self explanatory), and webSafeTypesByFidelity, which is a list of types in fidelity order which contains the list of pasteboard types that are safe to expose to bindings. These may include types such as "text/plain", "text/html", "text/uri-list", and "image/png". To distinguish this list from the existing contentTypesByFidelity list, I've also renamed contentTypesByFidelity to platformTypesByFidelity, to make it more obvious that this other list of types are platform-specific, and not generally safe to expose to the web. * platform/PasteboardStrategy.h: * platform/PlatformPasteboard.h: Move several helpers out into platform-agnostic code. * platform/cocoa/PasteboardCocoa.mm: (WebCore::Pasteboard::fileContentState): * platform/cocoa/PlatformPasteboardCocoa.mm: Added. Add a new file to contain the implementation of PlatformPasteboard::allPasteboardItemInfo, which is the same across Cocoa platforms. (WebCore::PlatformPasteboard::allPasteboardItemInfo): * platform/ios/PasteboardIOS.mm: (WebCore::Pasteboard::readRespectingUTIFidelities): * platform/ios/PlatformPasteboardIOS.mm: (WebCore::PlatformPasteboard::informationForItemAtIndex): (WebCore::PlatformPasteboard::readBuffer const): (WebCore::PlatformPasteboard::readString const): (WebCore::PlatformPasteboard::readURL const): Additionally refactor all methods on PlatformPasteboard that take pasteboard item indices as signed integers (`int`) to receive `size_t` values instead. (WebCore::PlatformPasteboard::allPasteboardItemInfo): Deleted. * platform/libwpe/PasteboardLibWPE.cpp: (WebCore::Pasteboard::readString): (WebCore::Pasteboard::read): * platform/libwpe/PlatformPasteboardLibWPE.cpp: (WebCore::PlatformPasteboard::readString const): Add an implementation stub for WPE. * platform/mac/PlatformPasteboardMac.mm: (WebCore::modernPasteboardTypeForWebSafeMIMEType): (WebCore::webSafeMIMETypeForModernPasteboardType): Add helpers to convert between modern NSPasteboardTypes and web-safe types. While some logic exists today on macOS to convert between legacy pasteboard types and web-safe types, conversion between the modern pasteboard types and web-safe types are needed since NSPasteboardItem's types only support NSPasteboardTypes and dynamically declared types that match the format of a universal type identfier (for instance, "com.foo.bar"). (WebCore::PlatformPasteboard::readBuffer const): (WebCore::PlatformPasteboard::readString const): (WebCore::PlatformPasteboard::readURL const): (WebCore::PlatformPasteboard::count const): (WebCore::PlatformPasteboard::informationForItemAtIndex): Implement all of these helpers by looking up the NSPasteboardItem at the given item index and querying it for data for non-legacy pasteboard types. (WebCore::PlatformPasteboard::itemAtIndex const): Source/WebKit: 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: Source/WebKitLegacy/mac: Refactor iOS-specific pasteboard functions to be platform-agnostic. See WebCore ChangeLog for more details. * WebCoreSupport/WebPlatformStrategies.h: * WebCoreSupport/WebPlatformStrategies.mm: (WebPlatformStrategies::informationForItemAtIndex): (WebPlatformStrategies::allPasteboardItemInfo): (WebPlatformStrategies::getPasteboardItemsCount): (WebPlatformStrategies::readBufferFromPasteboard): (WebPlatformStrategies::readURLFromPasteboard): (WebPlatformStrategies::readStringFromPasteboard): (WebPlatformStrategies::writeToPasteboard): (WebPlatformStrategies::updateSupportedTypeIdentifiers): Canonical link: https://commits.webkit.org/216240@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250950 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-10-10 01:27:14 +00:00
platform/cocoa/PlatformPasteboardCocoa.mm
platform/cocoa/PlaybackSessionModelMediaElement.mm
[Cocoa] Add MediaCapabilities support for SW VP9 decoder. https://bugs.webkit.org/show_bug.cgi?id=214316 Reviewed by Eric Carlson. Source/WebCore: Test: platform/mac/media/mediacapabilities/vp9-decodingInfo-sw.html Add some foundational support for SW VP9, which due to policy decisions will need information both on the system battery status and the power adapter status, and these need to be shipped into the WebContent process from the UIProcess. Add some Internal override settings to allow the policies to be effectively tested through LayouTests. This includes overrides for system battery and AC state, as well as overrides for screen size and resolution. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/PlatformScreen.cpp: (WebCore::getScreenProperties): * platform/PlatformScreen.h: * platform/ScreenProperties.h: (WebCore::ScreenData::encode const): (WebCore::ScreenData::decode): * platform/cocoa/PowerSourceNotifier.h: * platform/cocoa/PowerSourceNotifier.mm: (WebCore::PowerSourceNotifier::PowerSourceNotifier): (WebCore::PowerSourceNotifier::~PowerSourceNotifier): (WebCore::PowerSourceNotifier::notifyPowerSourceChanged): * platform/cocoa/SystemBattery.h: * platform/cocoa/SystemBattery.mm: (WebCore::systemHasBattery): (WebCore::resetSystemHasAC): (WebCore::setSystemHasAC): (WebCore::systemHasAC): (WebCore::setOverrideSystemHasBatteryForTesting): (WebCore::setOverrideSystemHasACForTesting): * platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.cpp: (WebCore::videoCodecTypeFromRFC4281Type): (WebCore::createMediaPlayerDecodingConfigurationCocoa): * platform/graphics/cocoa/VP9UtilitiesCocoa.h: Copied from Source/WebCore/PAL/pal/spi/cocoa/IOPSLibSPI.h. * platform/graphics/cocoa/VP9UtilitiesCocoa.mm: Added. (WebCore::setOverrideVP9HardwareDecoderDisabledForTesting): (WebCore::setOverrideVP9ScreenSizeAndScaleForTesting): (WebCore::resetOverrideVP9ScreenSizeAndScaleForTesting): (WebCore::validateVPParameters): * platform/ios/PlatformScreenIOS.mm: (WebCore::collectScreenProperties): * platform/mac/PlatformScreenMac.mm: (WebCore::collectScreenProperties): * testing/Internals.cpp: (WebCore::Internals::Internals): (WebCore::Internals::setSystemHasBattery): (WebCore::Internals::setSystemHasAC): (WebCore::Internals::setHardwareVP9DecoderDisabledForTesting): (WebCore::Internals::setVP9ScreenSizeAndScale): * testing/Internals.h: * testing/Internals.idl: Source/WebCore/PAL: * pal/spi/cocoa/IOPSLibSPI.h: Source/WebKit: Pass the system AC state to the WebContent process at creation time, and also create a power state listener so the WebProcess can be updated dynamically. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): (WebKit::WebProcessPool::registerNotificationObservers): * UIProcess/WebProcessPool.cpp: * UIProcess/WebProcessPool.h: * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): (WebKit::WebProcess::powerSourceDidChange): LayoutTests: * platform/mac/media/mediacapabilities/vp9-decodingInfo-sw-expected.txt: Added. * platform/mac/media/mediacapabilities/vp9-decodingInfo-sw.html: Added. Canonical link: https://commits.webkit.org/227224@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@264476 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-07-16 20:49:35 +00:00
platform/cocoa/PowerSourceNotifier.mm
platform/cocoa/RemoteCommandListenerCocoa.mm
platform/cocoa/RuntimeApplicationChecksCocoa.mm
platform/cocoa/SearchPopupMenuCocoa.mm
platform/cocoa/SharedBufferCocoa.mm
platform/cocoa/SystemVersion.mm
platform/cocoa/TelephoneNumberDetectorCocoa.cpp
platform/cocoa/ThemeCocoa.mm
platform/cocoa/UserAgentCocoa.mm
Unify linkedOnOrAfter duplicate code and use SPI/WebCoreTestSupport instead of NSUserDefaults https://bugs.webkit.org/show_bug.cgi?id=217239 Reviewed by Darin Adler. Source/WebCore: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/cocoa/VersionChecks.h: Renamed from Source/WebKit/UIProcess/Cocoa/VersionChecks.h. * platform/cocoa/VersionChecks.mm: Renamed from Source/WebKit/UIProcess/Cocoa/VersionChecks.mm. (WebCore::linkedOnOrAfter): * testing/js/WebCoreTestSupport.cpp: (WebCoreTestSupport::setLinkedOnOrAfterEverythingForTesting): * testing/js/WebCoreTestSupport.h: Source/WebKit: * NetworkProcess/WebStorage/ios/LocalStorageDatabaseTrackerIOS.mm: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: * Shared/Cocoa/CompletionHandlerCallChecker.mm: (WebKit::shouldThrowExceptionForDuplicateCompletionHandlerCall): * Shared/Cocoa/DefaultWebBrowserChecks.mm: (WebKit::determineITPState): * Shared/Cocoa/WebKit2InitializeCocoa.mm: (WebKit::InitializeWebKit2): * Shared/WebPreferencesDefaultValues.cpp: (WebKit::defaultPassiveTouchListenersAsDefaultOnDocument): * SourcesCocoa.txt: * UIProcess/API/C/WKPage.cpp: (WKPageReload): * UIProcess/API/Cocoa/WKProcessPool.mm: (+[WKProcessPool _setLinkedOnOrAfterEverythingForTesting]): * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (shouldAllowSettingAnyXHRHeaderFromFileURLs): (shouldRestrictBaseURLSchemes): (-[WKWebView _initializeWithConfiguration:]): (-[WKWebView _setupPageConfiguration:]): (-[WKWebView reload]): (-[WKWebView takeSnapshotWithConfiguration:completionHandler:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (defaultShouldDecidePolicyBeforeLoadingQuickLookPreview): (-[WKWebViewConfiguration init]): * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore init]): * UIProcess/API/ios/WKWebViewIOS.mm: (-[WKWebView _computedObscuredInset]): * UIProcess/API/mac/WKWebViewMac.mm: (-[WKWebView _web_dragDestinationActionForDraggingInfo:]): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): (WebKit::WebProcessPool::platformInitializeNetworkProcess): * UIProcess/Inspector/mac/WKInspectorViewController.mm: (-[WKInspectorViewController inspectorWKWebViewReload:]): * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp: (WebKit::RemoteScrollingCoordinatorProxy::hasScrollableOrZoomedMainFrame const): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::createWebPage): * UIProcess/WebProcessProxy.cpp: (WebKit::isMainThreadOrCheckDisabled): * UIProcess/ios/WKContentView.mm: (-[WKContentView _commonInitializationWithProcessPool:configuration:]): * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _shouldUseContextMenus]): (applicationIsKnownToIgnoreMouseEvents): * UIProcess/ios/WKScrollView.mm: (-[WKScrollView _systemContentInset]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::desktopClassBrowsingRecommended): * WebKit.xcodeproj/project.pbxproj: * WebProcess/cocoa/WebProcessCocoa.mm: Source/WebKitLegacy/mac: * DefaultDelegates/WebDefaultUIDelegate.mm: (-[WebDefaultUIDelegate webView:dragDestinationActionMaskForDraggingInfo:]): * Misc/WebIconDatabase.mm: (+[WebIconDatabase sharedIconDatabase]): * Misc/WebKitVersionChecks.h: * Misc/WebKitVersionChecks.mm: (WebKitLinkTimeVersion): (linkedOnOrAfter): Deleted. * WebView/WebPreferencesDefaultValues.mm: (WebKit::defaultPassiveTouchListenersAsDefaultOnDocument): (WebKit::defaultShouldRestrictBaseURLSchemes): Tools: * DumpRenderTree/mac/DumpRenderTree.mm: (setDefaultsToConsistentValuesForTesting): (DumpRenderTreeMain): * MiniBrowser/mac/main.m: (main): * MobileMiniBrowser/MobileMiniBrowser/main.m: (main): * TestWebKitAPI/Configurations/TestWTF.xcconfig: * TestWebKitAPI/ios/mainIOS.mm: (main): * TestWebKitAPI/mac/mainMac.mm: (main): * WebKitTestRunner/ios/mainIOS.mm: (main): * WebKitTestRunner/mac/main.mm: (setDefaultsToConsistentValuesForTesting): (main): Canonical link: https://commits.webkit.org/230075@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267966 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-10-05 14:57:53 +00:00
platform/cocoa/VersionChecks.mm
platform/cocoa/VideoFullscreenModelVideoElement.mm
platform/cocoa/VideoToolboxSoftLink.cpp
[Cocoa] Add some WKA extension points https://bugs.webkit.org/show_bug.cgi?id=192131 <rdar://problem/46330293> Reviewed by Tim Horton. Source/WebCore: * DerivedSources.make: Added an extension point for derived sources. * Modules/applepay/PaymentCoordinatorClient.h: Added an extension point for PaymentCoordinatorClient. * SourcesCocoa.txt: Added WebCoreAdditions.mm as a non-unified source. * WebCore.xcodeproj/project.pbxproj: Added WebCoreAdditions.mm. * bindings/js/WebCoreBuiltinNames.h: Added an extension point for built-in names. * page/SettingsBase.h: Added an extension point for settings. * platform/cocoa/WebCoreAdditions.mm: Added. Source/WebKit: * DerivedSources.make: Added an extension point for WebPreferences.yaml. * Platform/IPC/MessageSender.h: (IPC::MessageSender::sendWithAsyncReply): Send async messages via IPC::MessageSender. * Platform/cocoa/WebKitAdditions.mm: A an extension point for additional WebKit sources. * SourcesCocoa.txt: Added WebKitAdditions.mm as non-unified source. * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp: (WebKit::WebPaymentCoordinatorProxy::WebPaymentCoordinatorProxy): Called finishConstruction. * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h: Added an extension point for WebPaymentCoordinatorProxy. * WebKit.xcodeproj/project.pbxproj: Added WebKitAdditions.mm. * WebProcess/ApplePay/WebPaymentCoordinator.h: Added an extension point for WebPaymentCoordinator. Canonical link: https://commits.webkit.org/206883@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238739 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-11-30 17:09:37 +00:00
platform/cocoa/WebCoreAdditions.mm @no-unify
platform/cocoa/WebCoreNSErrorExtras.mm
platform/gamepad/cocoa/GameControllerGamepad.mm
platform/gamepad/cocoa/GameControllerGamepadProvider.mm
Special HID mapping for the Dualshock 3 controller <rdar://problem/66255198> and https://bugs.webkit.org/show_bug.cgi?id=214911 Reviewed by Tim Horton. Source/WebCore: Covered by API tests. - Move GamepadButtons into a GamepadConstants header - Add a "KnownGamepads" header to hold all vendor/product pairs that WebKit knows about - Add a Dualshock3 controller mapping based on its HID report - Add a basic DS3 test based on the HID report * Sources.txt: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/gamepad/GamepadConstants.cpp: Copied from Source/WebCore/platform/gamepad/mac/GenericHIDGamepad.h. (WebCore::standardGamepadMappingString): * platform/gamepad/GamepadConstants.h: Added. * platform/gamepad/KnownGamepads.h: Copied from Source/WebCore/platform/gamepad/mac/GenericHIDGamepad.h. * platform/gamepad/cocoa/GameControllerGamepad.mm: (WebCore::GameControllerGamepad::setupAsExtendedGamepad): * platform/gamepad/mac/Dualshock3HIDGamepad.cpp: Added. (WebCore::Dualshock3HIDGamepad::Dualshock3HIDGamepad): * platform/gamepad/mac/Dualshock3HIDGamepad.h: Copied from Source/WebCore/platform/gamepad/mac/GenericHIDGamepad.h. * platform/gamepad/mac/GenericHIDGamepad.cpp: (WebCore::GenericHIDGamepad::GenericHIDGamepad): (WebCore::GenericHIDGamepad::id): Deleted. * platform/gamepad/mac/GenericHIDGamepad.h: * platform/gamepad/mac/HIDGamepad.cpp: (WebCore::HIDGamepad::create): (WebCore::HIDGamepad::HIDGamepad): (WebCore::HIDGamepad::initialize): * platform/gamepad/mac/HIDGamepad.h: * platform/mac/HIDDevice.h: (WebCore::HIDDevice::fullProductIdentifier const): * platform/mac/HIDElement.h: (WebCore::HIDElement::fullUsage const): Tools: Add a virtual Dualshock3 and verify a few attributes about it. * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/mac/HIDGamepads.mm: * TestWebKitAPI/mac/GamepadMappings/SonyDualShock3.mm: Added. (TestWebKitAPI::publishReportCallback): (TestWebKitAPI::VirtualGamepad::sonyDualshock3Mapping): * TestWebKitAPI/mac/VirtualGamepad.h: Canonical link: https://commits.webkit.org/227842@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@265156 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-07-31 19:50:33 +00:00
platform/gamepad/mac/Dualshock3HIDGamepad.cpp
Refactor HID gamepad code to be much less fragile and much easier to hack on. https://bugs.webkit.org/show_bug.cgi?id=214910 Reviewed by Darin Adler. Source/WebCore: Covered by API tests. Currently - for HID device gamepads - we throw all buttons and axes against the wall and see what sticks. Instead, for specific popular devices, we'd like to have device-specific mappings so the representation makes sense. To support that work, this is a major refactoring of the HID gamepad code. It does the following: - Breaks out logic specific to IOHIDDeviceRef into HIDDevice - Breaks out logic specific to IOHIDElementRef into HIDElement - Moves responsibities of managing things to the right places (e.g. HIDElement manages its own current value directly) - Makes HIDGamepadElement derive from HIDElement directly - Moves device specific logic from HIDGamepad into a subclass of HID gamepad. Currently the only subclass is "generic" which encompasses HIDGamepad's old behavior - Changes button/value vectors from Vector<double> to Vector<SharedGamepadValue> so multiple objects can reference the value at once. e.g. HIDGamepadButton can simply update it's own SharedGamepadValue without knowing which HIDGamepad owns it or which index into the gamepad's value vector it should be mutating. This will be critical in the "specific device mapping" work as some types of HIDElements actually drive more than one gamepad button value. e.g. a "direction pad axis" actually manages 2 button values, or a "hat-switch" direction pad manages 4 button values This patch doesn't change any current behavior. * Modules/gamepad/Gamepad.cpp: (WebCore::Gamepad::updateFromPlatformGamepad): * Sources.txt: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/Logging.h: * platform/gamepad/PlatformGamepad.h: * platform/gamepad/SharedGamepadValue.h: Copied from Source/WebKit/UIProcess/Gamepad/UIGamepad.h. (WebCore::SharedGamepadValue::SharedGamepadValue): (WebCore::SharedGamepadValue::setValue): (WebCore::SharedGamepadValue::value const): (WebCore::SharedGamepadValue::Data::Data): * platform/gamepad/cocoa/GameControllerGamepad.h: * platform/gamepad/cocoa/GameControllerGamepad.mm: (WebCore::GameControllerGamepad::setupAsExtendedGamepad): (WebCore::GameControllerGamepad::setupAsGamepad): * platform/gamepad/mac/GenericHIDGamepad.cpp: Added. (WebCore::GenericHIDGamepad::GenericHIDGamepad): (WebCore::GenericHIDGamepad::id): (WebCore::GenericHIDGamepad::maybeAddGenericDesktopElement): (WebCore::GenericHIDGamepad::maybeAddButtonElement): * platform/gamepad/mac/GenericHIDGamepad.h: Copied from Source/WebKit/WebProcess/Gamepad/WebGamepad.h. * platform/gamepad/mac/HIDGamepad.cpp: (WebCore::HIDGamepad::create): (WebCore::HIDGamepad::HIDGamepad): (WebCore::HIDGamepad::initialize): (WebCore::HIDGamepad::valueChanged): (WebCore::HIDGamepad::getCurrentValueForElement): Deleted. (WebCore::HIDGamepad::initElements): Deleted. (WebCore::HIDGamepad::initElementsFromArray): Deleted. (WebCore::HIDGamepad::maybeAddButton): Deleted. (WebCore::HIDGamepad::maybeAddAxis): Deleted. * platform/gamepad/mac/HIDGamepad.h: (WebCore::HIDGamepad::hidDevice const): (WebCore::HIDGamepadElement::HIDGamepadElement): Deleted. (WebCore::HIDGamepadElement::~HIDGamepadElement): Deleted. (WebCore::HIDGamepadElement::isButton const): Deleted. (WebCore::HIDGamepadElement::isAxis const): Deleted. (WebCore::HIDGamepadButton::HIDGamepadButton): Deleted. (WebCore::HIDGamepadAxis::HIDGamepadAxis): Deleted. * platform/gamepad/mac/HIDGamepadElement.cpp: Added. (WebCore::HIDGamepadElement::HIDGamepadElement): (WebCore::HIDGamepadElement::refreshCurrentValue): (WebCore::HIDGamepadElement::normalizedValue): (WebCore::HIDGamepadButton::gamepadValueChanged): (WebCore::HIDGamepadAxis::gamepadValueChanged): (WebCore::HIDGamepadAxis::normalizedValue): * platform/gamepad/mac/HIDGamepadElement.h: Copied from Source/WebCore/platform/gamepad/PlatformGamepad.h. (WebCore::HIDGamepadElement::~HIDGamepadElement): (WebCore::HIDGamepadElement::isButton const): (WebCore::HIDGamepadElement::isAxis const): * platform/gamepad/mac/HIDGamepadProvider.mm: (WebCore::HIDGamepadProvider::deviceAdded): * platform/gamepad/mac/MultiGamepadProvider.h: * platform/graphics/cocoa/SourceBufferParserWebM.cpp: * platform/mac/HIDDevice.cpp: Added. (WebCore::HIDDevice::HIDDevice): (WebCore::HIDDevice::uniqueInputElementsInDeviceTreeOrder const): * platform/mac/HIDDevice.h: Copied from Source/WebCore/platform/gamepad/PlatformGamepad.h. (WebCore::HIDDevice::rawElement const): (WebCore::HIDDevice::vendorID const): (WebCore::HIDDevice::productID const): (WebCore::HIDDevice::productName const): * platform/mac/HIDElement.cpp: Copied from Source/WebKit/UIProcess/Gamepad/UIGamepad.h. (WebCore::HIDElement::HIDElement): (WebCore::HIDElement::valueChanged): * platform/mac/HIDElement.h: Copied from Source/WebKit/UIProcess/Gamepad/UIGamepad.h. (WebCore::HIDElement::rawElement const): (WebCore::HIDElement::physicalMin const): (WebCore::HIDElement::physicalMax const): (WebCore::HIDElement::physicalValue const): (WebCore::HIDElement::usage const): (WebCore::HIDElement::usagePage const): (WebCore::HIDElement::cookie const): * testing/MockGamepad.cpp: (WebCore::MockGamepad::updateDetails): (WebCore::MockGamepad::setAxisValue): (WebCore::MockGamepad::setButtonValue): * testing/MockGamepad.h: Source/WebKit: * Shared/Gamepad/GamepadData.cpp: (WebKit::GamepadData::GamepadData): * Shared/Gamepad/GamepadData.h: * UIProcess/Gamepad/UIGamepad.h: * WebProcess/Gamepad/WebGamepad.cpp: (WebKit::WebGamepad::axisValues const): (WebKit::WebGamepad::buttonValues const): (WebKit::WebGamepad::updateValues): * WebProcess/Gamepad/WebGamepad.h: Tools: Add a test that verifies connect, basic button/axis changes, and disconnect of a HID gamepad. * TestWebKitAPI/Tests/mac/HIDGamepads.mm: Canonical link: https://commits.webkit.org/227779@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@265079 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-07-30 07:21:44 +00:00
platform/gamepad/mac/GenericHIDGamepad.cpp
platform/gamepad/mac/HIDGamepad.cpp
Refactor HID gamepad code to be much less fragile and much easier to hack on. https://bugs.webkit.org/show_bug.cgi?id=214910 Reviewed by Darin Adler. Source/WebCore: Covered by API tests. Currently - for HID device gamepads - we throw all buttons and axes against the wall and see what sticks. Instead, for specific popular devices, we'd like to have device-specific mappings so the representation makes sense. To support that work, this is a major refactoring of the HID gamepad code. It does the following: - Breaks out logic specific to IOHIDDeviceRef into HIDDevice - Breaks out logic specific to IOHIDElementRef into HIDElement - Moves responsibities of managing things to the right places (e.g. HIDElement manages its own current value directly) - Makes HIDGamepadElement derive from HIDElement directly - Moves device specific logic from HIDGamepad into a subclass of HID gamepad. Currently the only subclass is "generic" which encompasses HIDGamepad's old behavior - Changes button/value vectors from Vector<double> to Vector<SharedGamepadValue> so multiple objects can reference the value at once. e.g. HIDGamepadButton can simply update it's own SharedGamepadValue without knowing which HIDGamepad owns it or which index into the gamepad's value vector it should be mutating. This will be critical in the "specific device mapping" work as some types of HIDElements actually drive more than one gamepad button value. e.g. a "direction pad axis" actually manages 2 button values, or a "hat-switch" direction pad manages 4 button values This patch doesn't change any current behavior. * Modules/gamepad/Gamepad.cpp: (WebCore::Gamepad::updateFromPlatformGamepad): * Sources.txt: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/Logging.h: * platform/gamepad/PlatformGamepad.h: * platform/gamepad/SharedGamepadValue.h: Copied from Source/WebKit/UIProcess/Gamepad/UIGamepad.h. (WebCore::SharedGamepadValue::SharedGamepadValue): (WebCore::SharedGamepadValue::setValue): (WebCore::SharedGamepadValue::value const): (WebCore::SharedGamepadValue::Data::Data): * platform/gamepad/cocoa/GameControllerGamepad.h: * platform/gamepad/cocoa/GameControllerGamepad.mm: (WebCore::GameControllerGamepad::setupAsExtendedGamepad): (WebCore::GameControllerGamepad::setupAsGamepad): * platform/gamepad/mac/GenericHIDGamepad.cpp: Added. (WebCore::GenericHIDGamepad::GenericHIDGamepad): (WebCore::GenericHIDGamepad::id): (WebCore::GenericHIDGamepad::maybeAddGenericDesktopElement): (WebCore::GenericHIDGamepad::maybeAddButtonElement): * platform/gamepad/mac/GenericHIDGamepad.h: Copied from Source/WebKit/WebProcess/Gamepad/WebGamepad.h. * platform/gamepad/mac/HIDGamepad.cpp: (WebCore::HIDGamepad::create): (WebCore::HIDGamepad::HIDGamepad): (WebCore::HIDGamepad::initialize): (WebCore::HIDGamepad::valueChanged): (WebCore::HIDGamepad::getCurrentValueForElement): Deleted. (WebCore::HIDGamepad::initElements): Deleted. (WebCore::HIDGamepad::initElementsFromArray): Deleted. (WebCore::HIDGamepad::maybeAddButton): Deleted. (WebCore::HIDGamepad::maybeAddAxis): Deleted. * platform/gamepad/mac/HIDGamepad.h: (WebCore::HIDGamepad::hidDevice const): (WebCore::HIDGamepadElement::HIDGamepadElement): Deleted. (WebCore::HIDGamepadElement::~HIDGamepadElement): Deleted. (WebCore::HIDGamepadElement::isButton const): Deleted. (WebCore::HIDGamepadElement::isAxis const): Deleted. (WebCore::HIDGamepadButton::HIDGamepadButton): Deleted. (WebCore::HIDGamepadAxis::HIDGamepadAxis): Deleted. * platform/gamepad/mac/HIDGamepadElement.cpp: Added. (WebCore::HIDGamepadElement::HIDGamepadElement): (WebCore::HIDGamepadElement::refreshCurrentValue): (WebCore::HIDGamepadElement::normalizedValue): (WebCore::HIDGamepadButton::gamepadValueChanged): (WebCore::HIDGamepadAxis::gamepadValueChanged): (WebCore::HIDGamepadAxis::normalizedValue): * platform/gamepad/mac/HIDGamepadElement.h: Copied from Source/WebCore/platform/gamepad/PlatformGamepad.h. (WebCore::HIDGamepadElement::~HIDGamepadElement): (WebCore::HIDGamepadElement::isButton const): (WebCore::HIDGamepadElement::isAxis const): * platform/gamepad/mac/HIDGamepadProvider.mm: (WebCore::HIDGamepadProvider::deviceAdded): * platform/gamepad/mac/MultiGamepadProvider.h: * platform/graphics/cocoa/SourceBufferParserWebM.cpp: * platform/mac/HIDDevice.cpp: Added. (WebCore::HIDDevice::HIDDevice): (WebCore::HIDDevice::uniqueInputElementsInDeviceTreeOrder const): * platform/mac/HIDDevice.h: Copied from Source/WebCore/platform/gamepad/PlatformGamepad.h. (WebCore::HIDDevice::rawElement const): (WebCore::HIDDevice::vendorID const): (WebCore::HIDDevice::productID const): (WebCore::HIDDevice::productName const): * platform/mac/HIDElement.cpp: Copied from Source/WebKit/UIProcess/Gamepad/UIGamepad.h. (WebCore::HIDElement::HIDElement): (WebCore::HIDElement::valueChanged): * platform/mac/HIDElement.h: Copied from Source/WebKit/UIProcess/Gamepad/UIGamepad.h. (WebCore::HIDElement::rawElement const): (WebCore::HIDElement::physicalMin const): (WebCore::HIDElement::physicalMax const): (WebCore::HIDElement::physicalValue const): (WebCore::HIDElement::usage const): (WebCore::HIDElement::usagePage const): (WebCore::HIDElement::cookie const): * testing/MockGamepad.cpp: (WebCore::MockGamepad::updateDetails): (WebCore::MockGamepad::setAxisValue): (WebCore::MockGamepad::setButtonValue): * testing/MockGamepad.h: Source/WebKit: * Shared/Gamepad/GamepadData.cpp: (WebKit::GamepadData::GamepadData): * Shared/Gamepad/GamepadData.h: * UIProcess/Gamepad/UIGamepad.h: * WebProcess/Gamepad/WebGamepad.cpp: (WebKit::WebGamepad::axisValues const): (WebKit::WebGamepad::buttonValues const): (WebKit::WebGamepad::updateValues): * WebProcess/Gamepad/WebGamepad.h: Tools: Add a test that verifies connect, basic button/axis changes, and disconnect of a HID gamepad. * TestWebKitAPI/Tests/mac/HIDGamepads.mm: Canonical link: https://commits.webkit.org/227779@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@265079 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-07-30 07:21:44 +00:00
platform/gamepad/mac/HIDGamepadElement.cpp
Multiplex the HID and GameController gamepad providers on Mac. <rdar://problem/63192532> and https://bugs.webkit.org/show_bug.cgi?id=214126 Reviewed by Tim Horton. Source/WebCore: Mac has already supported both the HID provider and GameController provider. By adding an intermediate provider to multiplex both and tweaking a few other things, it can support both at the same time. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/gamepad/PlatformGamepad.h: (WebCore::PlatformGamepad::lastUpdateTime const): (WebCore::PlatformGamepad::source const): * platform/gamepad/cocoa/GameControllerGamepad.h: * platform/gamepad/cocoa/GameControllerGamepadProvider.h: * platform/gamepad/cocoa/GameControllerGamepadProvider.mm: (WebCore::GameControllerGamepadProvider::controllerDidConnect): (WebCore::GameControllerGamepadProvider::gamepadHadInput): (WebCore::GameControllerGamepadProvider::makeInvisibleGamepadsVisible): (WebCore::GameControllerGamepadProvider::inputNotificationTimerFired): (WebCore::GameControllerGamepadProvider::makeInvisibileGamepadsVisible): Deleted. * platform/gamepad/cocoa/GameControllerSPI.h: * platform/gamepad/cocoa/GameControllerSoftLink.h: * platform/gamepad/cocoa/GameControllerSoftLink.mm: * platform/gamepad/mac/HIDGamepad.h: * platform/gamepad/mac/HIDGamepadProvider.h: (WebCore::HIDGamepadProvider::ignoreGameControllerFrameworkDevices): * platform/gamepad/mac/HIDGamepadProvider.mm: Renamed from Source/WebCore/platform/gamepad/mac/HIDGamepadProvider.cpp. (WebCore::deviceMatchingDictionary): (WebCore::deviceAddedCallback): (WebCore::deviceRemovedCallback): (WebCore::deviceValuesChangedCallback): (WebCore::HIDGamepadProvider::singleton): (WebCore::HIDGamepadProvider::HIDGamepadProvider): (WebCore::HIDGamepadProvider::stopMonitoringInput): (WebCore::HIDGamepadProvider::startMonitoringInput): (WebCore::HIDGamepadProvider::indexForNewlyConnectedDevice): (WebCore::HIDGamepadProvider::initialGamepadsConnectedTimerFired): (WebCore::HIDGamepadProvider::openAndScheduleManager): (WebCore::HIDGamepadProvider::closeAndUnscheduleManager): (WebCore::HIDGamepadProvider::startMonitoringGamepads): (WebCore::HIDGamepadProvider::stopMonitoringGamepads): (WebCore::gameControllerFrameworkWillHandleHIDDevice): (WebCore::HIDGamepadProvider::deviceAdded): (WebCore::HIDGamepadProvider::deviceRemoved): (WebCore::HIDGamepadProvider::valuesChanged): (WebCore::HIDGamepadProvider::inputNotificationTimerFired): (WebCore::HIDGamepadProvider::removeGamepadForDevice): * platform/gamepad/mac/MultiGamepadProvider.h: Added. (WebCore::MultiGamepadProvider::isMockGamepadProvider const): (WebCore::MultiGamepadProvider::PlatformGamepadWrapper::PlatformGamepadWrapper): * platform/gamepad/mac/MultiGamepadProvider.mm: Added. (WebCore::MultiGamepadProvider::singleton): (WebCore::MultiGamepadProvider::startMonitoringGamepads): (WebCore::MultiGamepadProvider::stopMonitoringGamepads): (WebCore::MultiGamepadProvider::indexForNewlyConnectedDevice): (WebCore::MultiGamepadProvider::platformGamepadConnected): (WebCore::MultiGamepadProvider::platformGamepadDisconnected): (WebCore::MultiGamepadProvider::platformGamepadInputActivity): Source/WebCore/PAL: The current "IOKitSPI.h" is really weird. It is mostly needed for iOS, but also used on Mac a little... And since some of what it declares on Mac is actually public, anyone else that uses public headers on Mac runs into redefinitions. Since the use of it on iOS and Mac are so different, let's just make a Mac one. * PAL.xcodeproj/project.pbxproj: * pal/spi/mac/IOKitSPIMac.h: Copied from Source/WebCore/platform/gamepad/cocoa/GameControllerSoftLink.h. Source/WebKit: * UIProcess/Gamepad/cocoa/UIGamepadProviderCocoa.mm: (WebKit::UIGamepadProvider::platformSetDefaultGamepadProvider): Canonical link: https://commits.webkit.org/226976@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@264207 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-07-10 01:27:58 +00:00
platform/gamepad/mac/HIDGamepadProvider.mm
platform/gamepad/mac/LogitechGamepad.cpp
Multiplex the HID and GameController gamepad providers on Mac. <rdar://problem/63192532> and https://bugs.webkit.org/show_bug.cgi?id=214126 Reviewed by Tim Horton. Source/WebCore: Mac has already supported both the HID provider and GameController provider. By adding an intermediate provider to multiplex both and tweaking a few other things, it can support both at the same time. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/gamepad/PlatformGamepad.h: (WebCore::PlatformGamepad::lastUpdateTime const): (WebCore::PlatformGamepad::source const): * platform/gamepad/cocoa/GameControllerGamepad.h: * platform/gamepad/cocoa/GameControllerGamepadProvider.h: * platform/gamepad/cocoa/GameControllerGamepadProvider.mm: (WebCore::GameControllerGamepadProvider::controllerDidConnect): (WebCore::GameControllerGamepadProvider::gamepadHadInput): (WebCore::GameControllerGamepadProvider::makeInvisibleGamepadsVisible): (WebCore::GameControllerGamepadProvider::inputNotificationTimerFired): (WebCore::GameControllerGamepadProvider::makeInvisibileGamepadsVisible): Deleted. * platform/gamepad/cocoa/GameControllerSPI.h: * platform/gamepad/cocoa/GameControllerSoftLink.h: * platform/gamepad/cocoa/GameControllerSoftLink.mm: * platform/gamepad/mac/HIDGamepad.h: * platform/gamepad/mac/HIDGamepadProvider.h: (WebCore::HIDGamepadProvider::ignoreGameControllerFrameworkDevices): * platform/gamepad/mac/HIDGamepadProvider.mm: Renamed from Source/WebCore/platform/gamepad/mac/HIDGamepadProvider.cpp. (WebCore::deviceMatchingDictionary): (WebCore::deviceAddedCallback): (WebCore::deviceRemovedCallback): (WebCore::deviceValuesChangedCallback): (WebCore::HIDGamepadProvider::singleton): (WebCore::HIDGamepadProvider::HIDGamepadProvider): (WebCore::HIDGamepadProvider::stopMonitoringInput): (WebCore::HIDGamepadProvider::startMonitoringInput): (WebCore::HIDGamepadProvider::indexForNewlyConnectedDevice): (WebCore::HIDGamepadProvider::initialGamepadsConnectedTimerFired): (WebCore::HIDGamepadProvider::openAndScheduleManager): (WebCore::HIDGamepadProvider::closeAndUnscheduleManager): (WebCore::HIDGamepadProvider::startMonitoringGamepads): (WebCore::HIDGamepadProvider::stopMonitoringGamepads): (WebCore::gameControllerFrameworkWillHandleHIDDevice): (WebCore::HIDGamepadProvider::deviceAdded): (WebCore::HIDGamepadProvider::deviceRemoved): (WebCore::HIDGamepadProvider::valuesChanged): (WebCore::HIDGamepadProvider::inputNotificationTimerFired): (WebCore::HIDGamepadProvider::removeGamepadForDevice): * platform/gamepad/mac/MultiGamepadProvider.h: Added. (WebCore::MultiGamepadProvider::isMockGamepadProvider const): (WebCore::MultiGamepadProvider::PlatformGamepadWrapper::PlatformGamepadWrapper): * platform/gamepad/mac/MultiGamepadProvider.mm: Added. (WebCore::MultiGamepadProvider::singleton): (WebCore::MultiGamepadProvider::startMonitoringGamepads): (WebCore::MultiGamepadProvider::stopMonitoringGamepads): (WebCore::MultiGamepadProvider::indexForNewlyConnectedDevice): (WebCore::MultiGamepadProvider::platformGamepadConnected): (WebCore::MultiGamepadProvider::platformGamepadDisconnected): (WebCore::MultiGamepadProvider::platformGamepadInputActivity): Source/WebCore/PAL: The current "IOKitSPI.h" is really weird. It is mostly needed for iOS, but also used on Mac a little... And since some of what it declares on Mac is actually public, anyone else that uses public headers on Mac runs into redefinitions. Since the use of it on iOS and Mac are so different, let's just make a Mac one. * PAL.xcodeproj/project.pbxproj: * pal/spi/mac/IOKitSPIMac.h: Copied from Source/WebCore/platform/gamepad/cocoa/GameControllerSoftLink.h. Source/WebKit: * UIProcess/Gamepad/cocoa/UIGamepadProviderCocoa.mm: (WebKit::UIGamepadProvider::platformSetDefaultGamepadProvider): Canonical link: https://commits.webkit.org/226976@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@264207 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-07-10 01:27:58 +00:00
platform/gamepad/mac/MultiGamepadProvider.mm
platform/gamepad/mac/StadiaHIDGamepad.cpp
platform/graphics/MediaPlaybackTargetPicker.cpp
platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm @no-unify
platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm @no-unify
platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm @no-unify
platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.cpp
platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp @no-unify
platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp @no-unify
[iPad] YouTube does not automatically AirPlay when a route is selected from Control Center https://bugs.webkit.org/show_bug.cgi?id=206539 Source/WebCore: Patch by Jer Noble <jer.noble@apple.com> on 2020-01-21 Reviewed by Eric Carlson. No new tests; change affects an interaction with two platform features (local AirPlay route picking and actual remote playback over AirPlay routes) that is not testable in an automated fashion. The underlying source of the bug is the difference in how the platform communitcates that an AirPlay route was picked between iOS and macOS. On iOS, route changes are global and are generally pushed up from AVPlayer notifications. On macOS, route changes are local to the app and are pushed down from the UIProcess. But when MSE playback was enabled on iPadOS, there was now a limbo where media playback was no longer using an AVPlayer, but at the same time, route changes could be initiated globally. The end result is that MSE-based media elements are never notified that they "should play to playback target", and no remote playback events are ever fired. To re-create the same macOS behavior when MSE-backed media elements are used on iPadOS, re-use the existing route change detection logic in MediaSessionManageriOS to query whether the newly established route supports AirPlay Video, and if so, send a message to the "now playing" media element that it should begin AirPlaying, which will fail, but will trigger the YouTube player to switch to a HLS-backed media element. This requires renaming MediaPlaybackTargetMac -> MediaPlaybackTargetCocoa. * SourcesCocoa.txt: * PlatformMac.cmake: * WebCore.xcodeproj/project.pbxproj: * platform/audio/ios/MediaSessionManagerIOS.h: * platform/audio/ios/MediaSessionManagerIOS.mm: (WebCore::MediaSessionManageriOS::activeVideoRouteDidChange): (-[WebMediaSessionHelper activeAudioRouteDidChange:]): * platform/graphics/avfoundation/MediaPlaybackTargetCocoa.h: Renamed from Source/WebCore/platform/graphics/avfoundation/MediaPlaybackTargetMac.h. (WebCore::MediaPlaybackTargetCocoa::outputContext const): * platform/graphics/avfoundation/MediaPlaybackTargetCocoa.mm: Renamed from Source/WebCore/platform/graphics/avfoundation/MediaPlaybackTargetMac.mm. (WebCore::MediaPlaybackTargetCocoa::create): (WebCore::MediaPlaybackTargetCocoa::MediaPlaybackTargetCocoa): (WebCore::MediaPlaybackTargetCocoa::~MediaPlaybackTargetCocoa): (WebCore::MediaPlaybackTargetCocoa::targetContext const): (WebCore::MediaPlaybackTargetCocoa::hasActiveRoute const): (WebCore::MediaPlaybackTargetCocoa::deviceName const): (WebCore::toMediaPlaybackTargetCocoa): * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm: (WebCore::MediaPlaybackTargetPickerMac::playbackTarget): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessPlaybackTarget): Source/WebKit: <rdar://problem/54173689> Patch by Jer Noble <jer.noble@apple.com> on 2020-01-21 Reviewed by Eric Carlson. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::playbackTargetSelected const): Canonical link: https://commits.webkit.org/219613@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-01-21 21:44:00 +00:00
platform/graphics/avfoundation/MediaPlaybackTargetCocoa.mm @no-unify
platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp @no-unify
platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm @no-unify
platform/graphics/avfoundation/SampleBufferDisplayLayer.cpp
platform/graphics/avfoundation/WebMediaSessionManagerMac.cpp @no-unify
Adopt AVStreamDataParser.audiovisualMIMETypes https://bugs.webkit.org/show_bug.cgi?id=197581 <rdar://problem/50458981> Reviewed by Eric Carlson. Source/WebCore: Add a new singleton class, AVStreamDataParserMIMETypeCache, and rename AVFoundationMIMETypeCache to the more precise AVAssetMIMETypeCache. Update all the old AVFoundationMIMETypeCache with the new name. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.h: Renamed from Source/WebCore/platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.h. (WebCore::AVAssetMIMETypeCache::setCacheMIMETypesCallback): * platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm: Renamed from Source/WebCore/platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm. (WebCore::AVAssetMIMETypeCache::singleton): (WebCore::AVAssetMIMETypeCache::setSupportedTypes): (WebCore::AVAssetMIMETypeCache::types): (WebCore::AVAssetMIMETypeCache::supportsContentType): (WebCore::AVAssetMIMETypeCache::canDecodeType): (WebCore::AVAssetMIMETypeCache::isAvailable const): (WebCore::AVAssetMIMETypeCache::loadMIMETypes): * platform/graphics/avfoundation/objc/AVStreamDataParserMIMETypeCache.h: Added. * platform/graphics/avfoundation/objc/AVStreamDataParserMIMETypeCache.mm: Added. (WebCore::AVStreamDataParserMIMETypeCache::singleton): (WebCore::AVStreamDataParserMIMETypeCache::types): (WebCore::AVStreamDataParserMIMETypeCache::supportsContentType): (WebCore::AVStreamDataParserMIMETypeCache::canDecodeType): (WebCore::AVStreamDataParserMIMETypeCache::isAvailable const): (WebCore::AVStreamDataParserMIMETypeCache::loadMIMETypes): * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm: (WebCore::ImageDecoderAVFObjC::create): (WebCore::ImageDecoderAVFObjC::supportsMediaType): (WebCore::ImageDecoderAVFObjC::supportsContentType): (WebCore::ImageDecoderAVFObjC::canDecodeType): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::registerMediaEngine): (WebCore::MediaPlayerPrivateAVFoundationObjC::getSupportedTypes): (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType): (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsKeySystem): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::registerMediaEngine): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::getSupportedTypes): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType): Source/WebKit: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): (WebKit::WebProcess::platformTerminate): (WebKit::WebProcess::setMediaMIMETypes): Canonical link: https://commits.webkit.org/211765@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244980 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-05-06 22:22:26 +00:00
platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm @no-unify
platform/graphics/avfoundation/objc/AVAssetTrackUtilities.mm @no-unify
Use AVRoutePickerView when available for choosing AirPlay devices https://bugs.webkit.org/show_bug.cgi?id=213497 <rdar://problem/58610662> Reviewed by Jer Noble. Source/WebCore: Use an AVRoutePickerView, the replacement for AVOutputDeviceMenuController, when it is available to allow a user to pick an AirPlay device. To do this, create an AVPlaybackTargetPicker abstract base and create a concrete class from the AVOutputDeviceMenuController-specific code from MediaPlaybackTargetPickerMac, and create a new concrete class using AVRoutePickerView. Tested manually because these changes require an AirPlay device. * Modules/mediasession/WebMediaSessionManager.cpp: (WebCore::WebMediaSessionManager::showPlaybackTargetPicker): Pass the view to the target picker. * Modules/mediasession/WebMediaSessionManagerClient.h: * Modules/remoteplayback/RemotePlayback.cpp: (WebCore::RemotePlayback::playbackTargetPickerWasDismissed): Drive-by fix: return early if there are no pending promises. * SourcesCocoa.txt: Add new files. * WebCore.xcodeproj/project.pbxproj: Ditto. * platform/graphics/MediaPlaybackTargetPicker.cpp: (WebCore::MediaPlaybackTargetPicker::showPlaybackTargetPicker): Add new parameter. * platform/graphics/MediaPlaybackTargetPicker.h: * platform/graphics/avfoundation/objc/AVOutputDeviceMenuControllerTargetPicker.h: Copied from Source/WebCore/platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h. * platform/graphics/avfoundation/objc/AVOutputDeviceMenuControllerTargetPicker.mm: Copied from Source/WebCore/platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm. (WebCore::AVOutputDeviceMenuControllerTargetPicker::AVOutputDeviceMenuControllerTargetPicker): (WebCore::AVOutputDeviceMenuControllerTargetPicker::~AVOutputDeviceMenuControllerTargetPicker): (WebCore::AVOutputDeviceMenuControllerTargetPicker::devicePicker): (WebCore::AVOutputDeviceMenuControllerTargetPicker::availableDevicesDidChange): (WebCore::AVOutputDeviceMenuControllerTargetPicker::currentDeviceDidChange): (WebCore::AVOutputDeviceMenuControllerTargetPicker::showPlaybackTargetPicker): (WebCore::AVOutputDeviceMenuControllerTargetPicker::startingMonitoringPlaybackTargets): (WebCore::AVOutputDeviceMenuControllerTargetPicker::stopMonitoringPlaybackTargets): (WebCore::AVOutputDeviceMenuControllerTargetPicker::invalidatePlaybackTargets): (WebCore::AVOutputDeviceMenuControllerTargetPicker::externalOutputDeviceAvailable): (WebCore::AVOutputDeviceMenuControllerTargetPicker::outputContext): (-[WebAVOutputDeviceMenuControllerHelper initWithCallback:]): (-[WebAVOutputDeviceMenuControllerHelper clearCallback]): (-[WebAVOutputDeviceMenuControllerHelper observeValueForKeyPath:ofObject:change:context:]): * platform/graphics/avfoundation/objc/AVPlaybackTargetPicker.h: Added. (WebCore::AVPlaybackTargetPicker::AVPlaybackTargetPicker): (WebCore::AVPlaybackTargetPicker::client const): * platform/graphics/avfoundation/objc/AVRoutePickerViewTargetPicker.h: Added. * platform/graphics/avfoundation/objc/AVRoutePickerViewTargetPicker.mm: Added. (WebCore::AVRoutePickerViewTargetPicker::isAvailable): (WebCore::AVRoutePickerViewTargetPicker::AVRoutePickerViewTargetPicker): (WebCore::AVRoutePickerViewTargetPicker::~AVRoutePickerViewTargetPicker): (WebCore::AVRoutePickerViewTargetPicker::outputContextInternal): (WebCore::AVRoutePickerViewTargetPicker::devicePicker): (WebCore::AVRoutePickerViewTargetPicker::routeDetector): (WebCore::AVRoutePickerViewTargetPicker::showPlaybackTargetPicker): (WebCore::AVRoutePickerViewTargetPicker::startingMonitoringPlaybackTargets): (WebCore::AVRoutePickerViewTargetPicker::stopMonitoringPlaybackTargets): (WebCore::AVRoutePickerViewTargetPicker::externalOutputDeviceAvailable): (WebCore::AVRoutePickerViewTargetPicker::outputContext): (WebCore::AVRoutePickerViewTargetPicker::invalidatePlaybackTargets): (WebCore::AVRoutePickerViewTargetPicker::availableDevicesDidChange): (WebCore::AVRoutePickerViewTargetPicker::currentDeviceDidChange): (WebCore::AVRoutePickerViewTargetPicker::devicePickerWasDismissed): (-[WebAVRoutePickerViewHelper initWithCallback:]): (-[WebAVRoutePickerViewHelper dealloc]): (-[WebAVRoutePickerViewHelper clearCallback]): (-[WebAVRoutePickerViewHelper routePickerViewDidEndPresentingRoutes:]): (-[WebAVRoutePickerViewHelper notificationHandler:]): * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h: * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm: (WebCore::MediaPlaybackTargetPickerMac::MediaPlaybackTargetPickerMac): (WebCore::MediaPlaybackTargetPickerMac::~MediaPlaybackTargetPickerMac): (WebCore::MediaPlaybackTargetPickerMac::externalOutputDeviceAvailable): (WebCore::MediaPlaybackTargetPickerMac::playbackTarget): (WebCore::MediaPlaybackTargetPickerMac::routePicker): (WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker): (WebCore::MediaPlaybackTargetPickerMac::startingMonitoringPlaybackTargets): (WebCore::MediaPlaybackTargetPickerMac::stopMonitoringPlaybackTargets): (WebCore::MediaPlaybackTargetPickerMac::invalidatePlaybackTargets): (WebCore::MediaPlaybackTargetPickerMac::pickerWasDismissed): (WebCore::MediaPlaybackTargetPickerMac::availableDevicesChanged): (WebCore::MediaPlaybackTargetPickerMac::currentDeviceChanged): (WebCore::MediaPlaybackTargetPickerMac::devicePicker): Deleted. (-[WebAVOutputDeviceMenuControllerHelper initWithCallback:]): Deleted. (-[WebAVOutputDeviceMenuControllerHelper clearCallback]): Deleted. (-[WebAVOutputDeviceMenuControllerHelper observeValueForKeyPath:ofObject:change:context:]): Deleted. * platform/mock/MediaPlaybackTargetPickerMock.cpp: (WebCore::MediaPlaybackTargetPickerMock::showPlaybackTargetPicker): * platform/mock/MediaPlaybackTargetPickerMock.h: Source/WebCore/PAL: * pal/cocoa/AVFoundationSoftLink.h: * pal/cocoa/AVFoundationSoftLink.mm: Soft link AVRoutePickerView. * pal/spi/cocoa/AVKitSPI.h: Declare AVRoutePickerView. Source/WebKit: * UIProcess/WebPageProxy.h: * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::platformView const): Add new override. Source/WebKitLegacy/mac: * WebView/WebMediaPlaybackTargetPicker.h: (WebMediaPlaybackTargetPicker::~WebMediaPlaybackTargetPicker): Deleted. * WebView/WebMediaPlaybackTargetPicker.mm: (WebMediaPlaybackTargetPicker::create): (WebMediaPlaybackTargetPicker::WebMediaPlaybackTargetPicker): (WebMediaPlaybackTargetPicker::invalidate): (WebMediaPlaybackTargetPicker::platformView const): New override. * WebView/WebView.mm: (-[WebView _devicePicker]): Pass view to WebMediaPlaybackTargetPicker factory. Source/WTF: * wtf/PlatformHave.h: Define HAVE_AVROUTEPICKERVIEW. Tools: * TestWebKitAPI/Tests/WebCore/cocoa/AVFoundationSoftLinkTest.mm: (TestWebKitAPI::TEST): Test AVOutputContextOutputDevicesDidChangeNotification. Don't check AVRouteDetectorMultipleRoutesDetectedDidChangeNotification on watchOS, we don't use it there. Canonical link: https://commits.webkit.org/227408@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@264663 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-07-21 17:46:28 +00:00
platform/graphics/avfoundation/objc/AVOutputDeviceMenuControllerTargetPicker.mm @no-unify
platform/graphics/avfoundation/objc/AVRoutePickerViewTargetPicker.mm @no-unify
Adopt AVStreamDataParser.audiovisualMIMETypes https://bugs.webkit.org/show_bug.cgi?id=197581 <rdar://problem/50458981> Reviewed by Eric Carlson. Source/WebCore: Add a new singleton class, AVStreamDataParserMIMETypeCache, and rename AVFoundationMIMETypeCache to the more precise AVAssetMIMETypeCache. Update all the old AVFoundationMIMETypeCache with the new name. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.h: Renamed from Source/WebCore/platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.h. (WebCore::AVAssetMIMETypeCache::setCacheMIMETypesCallback): * platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm: Renamed from Source/WebCore/platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm. (WebCore::AVAssetMIMETypeCache::singleton): (WebCore::AVAssetMIMETypeCache::setSupportedTypes): (WebCore::AVAssetMIMETypeCache::types): (WebCore::AVAssetMIMETypeCache::supportsContentType): (WebCore::AVAssetMIMETypeCache::canDecodeType): (WebCore::AVAssetMIMETypeCache::isAvailable const): (WebCore::AVAssetMIMETypeCache::loadMIMETypes): * platform/graphics/avfoundation/objc/AVStreamDataParserMIMETypeCache.h: Added. * platform/graphics/avfoundation/objc/AVStreamDataParserMIMETypeCache.mm: Added. (WebCore::AVStreamDataParserMIMETypeCache::singleton): (WebCore::AVStreamDataParserMIMETypeCache::types): (WebCore::AVStreamDataParserMIMETypeCache::supportsContentType): (WebCore::AVStreamDataParserMIMETypeCache::canDecodeType): (WebCore::AVStreamDataParserMIMETypeCache::isAvailable const): (WebCore::AVStreamDataParserMIMETypeCache::loadMIMETypes): * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm: (WebCore::ImageDecoderAVFObjC::create): (WebCore::ImageDecoderAVFObjC::supportsMediaType): (WebCore::ImageDecoderAVFObjC::supportsContentType): (WebCore::ImageDecoderAVFObjC::canDecodeType): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::registerMediaEngine): (WebCore::MediaPlayerPrivateAVFoundationObjC::getSupportedTypes): (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType): (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsKeySystem): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::registerMediaEngine): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::getSupportedTypes): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType): Source/WebKit: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): (WebKit::WebProcess::platformTerminate): (WebKit::WebProcess::setMediaMIMETypes): Canonical link: https://commits.webkit.org/211765@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244980 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-05-06 22:22:26 +00:00
platform/graphics/avfoundation/objc/AVStreamDataParserMIMETypeCache.mm @no-unify
platform/graphics/avfoundation/objc/AudioTrackPrivateAVFObjC.mm @no-unify
platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.cpp @no-unify
platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm @no-unify
platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm @no-unify
platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm @no-unify
platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm @no-unify
platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm @no-unify
platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm @no-unify
Introduce an abstract SampleBufferDisplayLayer https://bugs.webkit.org/show_bug.cgi?id=206066 Reviewed by Eric Carlson. Move use of display layers in MediaPlayerPrivateMediaStreamAVFObjC to a new class LocalSampleBufferDisplayLayer that implements an interface named SampleBufferDisplayLayer. A future patch will implement this interface by IPCing to GPUProcess. We move both layers and handling of the sample queue to LocalSampleBufferDisplayLayer. Contrary to previously, we do not call again enqueueVideoSample in case we enqueued a sample for later use in the display layer. Instead, we directly render it, which should not change much since this is a realtime track and in the future the buffer will be in GPUProcess anyway. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/avfoundation/SampleBufferDisplayLayer.h: Added. (WebCore::SampleBufferDisplayLayer::SampleBufferDisplayLayer): * platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.h: Added. * platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.mm: Added. (-[WebAVSampleBufferStatusChangeListener initWithParent:]): (-[WebAVSampleBufferStatusChangeListener dealloc]): (-[WebAVSampleBufferStatusChangeListener invalidate]): (-[WebAVSampleBufferStatusChangeListener beginObservingLayers]): (-[WebAVSampleBufferStatusChangeListener stopObservingLayers]): (-[WebAVSampleBufferStatusChangeListener observeValueForKeyPath:ofObject:change:context:]): (WebCore::runWithoutAnimations): (WebCore::LocalSampleBufferDisplayLayer::LocalSampleBufferDisplayLayer): (WebCore::LocalSampleBufferDisplayLayer::~LocalSampleBufferDisplayLayer): (WebCore::LocalSampleBufferDisplayLayer::layerStatusDidChange): (WebCore::LocalSampleBufferDisplayLayer::layerErrorDidChange): (WebCore::LocalSampleBufferDisplayLayer::rootLayerBoundsDidChange): (WebCore::LocalSampleBufferDisplayLayer::displayLayer): (WebCore::LocalSampleBufferDisplayLayer::rootLayer): (WebCore::LocalSampleBufferDisplayLayer::didFail const): (WebCore::LocalSampleBufferDisplayLayer::updateDisplayMode): (WebCore::LocalSampleBufferDisplayLayer::bounds const): (WebCore::LocalSampleBufferDisplayLayer::updateAffineTransform): (WebCore::LocalSampleBufferDisplayLayer::updateBoundsAndPosition): (WebCore::LocalSampleBufferDisplayLayer::ensureLayers): (WebCore::LocalSampleBufferDisplayLayer::flush): (WebCore::LocalSampleBufferDisplayLayer::flushAndRemoveImage): (WebCore::LocalSampleBufferDisplayLayer::enqueueSample): (WebCore::LocalSampleBufferDisplayLayer::removeOldSamplesFromPendingQueue): (WebCore::LocalSampleBufferDisplayLayer::addSampleToPendingQueue): (WebCore::LocalSampleBufferDisplayLayer::clearEnqueuedSamples): (WebCore::LocalSampleBufferDisplayLayer::requestNotificationWhenReadyForVideoData): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::~MediaPlayerPrivateMediaStreamAVFObjC): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueCorrectedVideoSample): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::sampleBufferDisplayLayerStatusDidChange): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::applicationDidBecomeActive): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::flushRenderers): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyLayers): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::platformLayer const): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::displayLayer): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayMode): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::checkSelectedVideoTrack): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setBufferingPolicy): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayLayer): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::sampleBufferDisplayLayerBoundsDidChange): Canonical link: https://commits.webkit.org/219551@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254813 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-01-20 09:19:35 +00:00
platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.mm @no-unify
platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm @no-unify
platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm @no-unify
platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm @no-unify
platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm @no-unify
platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm @no-unify
platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm @no-unify
platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm @no-unify
[Cocoa] Add experimental MSE WebM parser https://bugs.webkit.org/show_bug.cgi?id=214529 Source/ThirdParty/libwebrtc: <rdar://problem/65782467> Reviewed by Eric Carlson. Add the vp9_header_parser from libwebrtc to the project, and add its symbols to the list of exported symbols. Because this header wants to be installed to a "common/vp9_header_parser.h" path, split up the default CopyHeadersInstallPhase into two separate CopyFiles build phases that put headers into different locations. * Configurations/libwebm.xcconfig: * Configurations/libwebrtc.iOS.exp: * Configurations/libwebrtc.iOSsim.exp: * Configurations/libwebrtc.mac.exp: * Source/third_party/libwebm/common/vp9_header_parser.h: (vp9_parser::Vp9HeaderParser::color_range const): (vp9_parser::Vp9HeaderParser::subsampling_x const): (vp9_parser::Vp9HeaderParser::subsampling_y const): * libwebrtc.xcodeproj/project.pbxproj: Source/WebCore: Reviewed by Eric Carlson. Test: media/media-source/media-source-webm.html Add an experimental MSE WebM parser to SourceBufferPrivateAVFObjC. This will require extensive refactoring of SourceBufferPrivateAVFObjC, to extract out the parser into a new, virtualized class. This new parser can take advantage of new C++>11 features such as lambdas to clean up some problematic existing code. The new virtualized SourceBufferParser class uses passed-in Function objects, rather than pure-virtual Client classes to notify it's parent object when the parser encounters initialization- or media-data. Because SourceBufferPrivateAVFObjC will now have to deal with AudioTrackPrivate and VideoTrackPrivate objects that are not necessarily Audio- and VideoTrackPrivateMediaSourceAVFObjC subclasses, move those classes notification features up into Audio- and VideoTrackPrivate, again using a Function object rather than a client class. Add a new SourceBufferParserWebM and associated AudioTrackPrivateWebM and VideoTrackPrivateWebM classes, which use libwebm via libwebrtc to parse appended buffers. SourceBufferParserWebM feeds passed-in data into a libwebm-provided parser of its own. It then builds up tracks and samples based on callbacks from that same parser, constructing CMSampleBuffers and VideoTrackPrivate objects out of the underlying libwebm primitives. Because WebM uses a UUID as its track identifier, the representation of a "trackID" inside WebCore must be increased from an int to a uint64_t, or trackIDs will be truncated or zeroed when passed between classes and when converted to and from AtomStrings. This early implementation is not yet able to pass the WebM WPT media-source/ tests, as we only have a VP9 decoder available, and those tests use both VP8 and Vorbis. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setWebMParserEnabled): (WebCore::RuntimeEnabledFeatures::webMParserEnabled const): * platform/graphics/AudioTrackPrivate.h: (WebCore::AudioTrackPrivate::setEnabled): (WebCore::AudioTrackPrivate::setEnabledChangedCallback): * platform/graphics/VP9Utilities.cpp: (WebCore::isValidVPColorPrimaries): (WebCore::isValidVPTransferCharacteristics): (WebCore::isValidVPMatrixCoefficients): (WebCore::parseVPCodecParameters): * platform/graphics/VP9Utilities.h: * platform/graphics/VideoTrackPrivate.h: (WebCore::VideoTrackPrivate::setSelected): (WebCore::VideoTrackPrivate::setSelectedChangedCallback): * platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.cpp: (WebCore::AudioTrackPrivateMediaSourceAVFObjC::AudioTrackPrivateMediaSourceAVFObjC): (WebCore::AudioTrackPrivateMediaSourceAVFObjC::setEnabled): * platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm: (WebCore::CDMSessionAVContentKeySession::update): * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm: (WebCore::CDMSessionAVStreamSession::update): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType): * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h: (WebCore::MediaSampleAVFObjC::create): (WebCore::MediaSampleAVFObjC::MediaSampleAVFObjC): * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm: (WebCore::MediaSourcePrivateAVFObjC::addSourceBuffer): * platform/graphics/avfoundation/objc/SourceBufferParserAVFObjC.h: Added. (isType): * platform/graphics/avfoundation/objc/SourceBufferParserAVFObjC.mm: Added. (-[WebAVStreamDataParserListener initWithParser:parent:]): (-[WebAVStreamDataParserListener dealloc]): (-[WebAVStreamDataParserListener invalidate]): (-[WebAVStreamDataParserListener streamDataParser:didParseStreamDataAsAsset:]): (-[WebAVStreamDataParserListener streamDataParser:didParseStreamDataAsAsset:withDiscontinuity:]): (-[WebAVStreamDataParserListener streamDataParser:didFailToParseStreamDataWithError:]): (-[WebAVStreamDataParserListener streamDataParser:didProvideMediaData:forTrackID:mediaType:flags:]): (-[WebAVStreamDataParserListener streamDataParserWillProvideContentKeyRequestInitializationData:forTrackID:]): (-[WebAVStreamDataParserListener streamDataParser:didProvideContentKeyRequestInitializationData:forTrackID:]): (WebCore::SourceBufferParserAVFObjC::isContentTypeSupported): (WebCore::SourceBufferParserAVFObjC::SourceBufferParserAVFObjC): (WebCore::SourceBufferParserAVFObjC::~SourceBufferParserAVFObjC): (WebCore::SourceBufferParserAVFObjC::appendData): (WebCore::SourceBufferParserAVFObjC::flushPendingMediaData): (WebCore::SourceBufferParserAVFObjC::setShouldProvideMediaDataForTrackID): (WebCore::SourceBufferParserAVFObjC::shouldProvideMediadataForTrackID): (WebCore::SourceBufferParserAVFObjC::resetParserState): (WebCore::SourceBufferParserAVFObjC::didParseStreamDataAsAsset): (WebCore::SourceBufferParserAVFObjC::didFailToParseStreamDataWithError): (WebCore::SourceBufferParserAVFObjC::didProvideMediaDataForTrackID): (WebCore::SourceBufferParserAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID): (WebCore::SourceBufferParserAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID): * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::SourceBufferPrivateAVFObjC::create): (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC): (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC): (WebCore::SourceBufferPrivateAVFObjC::didParseInitializationData): (WebCore::SourceBufferPrivateAVFObjC::didEncounterErrorDuringParsing): (WebCore::SourceBufferPrivateAVFObjC::didProvideMediaDataForTrackID): (WebCore::SourceBufferPrivateAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID): (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID): (WebCore::SourceBufferPrivateAVFObjC::append): (WebCore::SourceBufferPrivateAVFObjC::appendCompleted): (WebCore::SourceBufferPrivateAVFObjC::abort): (WebCore::SourceBufferPrivateAVFObjC::resetParserState): (WebCore::SourceBufferPrivateAVFObjC::destroyParser): (WebCore::SourceBufferPrivateAVFObjC::clearTracks): (WebCore::SourceBufferPrivateAVFObjC::hasSelectedVideo const): (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeSelected): (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled): (WebCore::SourceBufferPrivateAVFObjC::parser const): (WebCore::SourceBufferPrivateAVFObjC::attemptToDecrypt): (WebCore::SourceBufferPrivateAVFObjC::flush): (WebCore::SourceBufferPrivateAVFObjC::enqueueSample): (WebCore::SourceBufferPrivateAVFObjC::isReadyForMoreSamples): (WebCore::SourceBufferPrivateAVFObjC::didBecomeReadyForMoreSamples): (WebCore::SourceBufferPrivateAVFObjC::notifyClientWhenReadyForMoreSamples): (WebCore::SourceBufferPrivateAVFObjC::canSetMinimumUpcomingPresentationTime const): * platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.mm: (WebCore::VideoTrackPrivateMediaSourceAVFObjC::VideoTrackPrivateMediaSourceAVFObjC): * platform/graphics/cocoa/AudioTrackPrivateWebM.cpp: Copied from Source/WebCore/platform/graphics/cocoa/VP9UtilitiesCocoa.h. (WebCore::AudioTrackPrivateWebM::create): (WebCore::AudioTrackPrivateWebM::AudioTrackPrivateWebM): (WebCore::AudioTrackPrivateWebM::id const): (WebCore::AudioTrackPrivateWebM::label const): (WebCore::AudioTrackPrivateWebM::language const): (WebCore::AudioTrackPrivateWebM::trackIndex const): * platform/graphics/cocoa/AudioTrackPrivateWebM.h: Copied from Source/WebCore/platform/graphics/cocoa/VP9UtilitiesCocoa.h. * platform/graphics/cocoa/SourceBufferParser.cpp: Copied from Source/WebCore/platform/graphics/cocoa/VP9UtilitiesCocoa.h. (WebCore::SourceBufferParser::isContentTypeSupported): (WebCore::SourceBufferParser::create): * platform/graphics/cocoa/SourceBufferParser.h: Added. (WebCore::SourceBufferParser::setDidParseInitializationDataCallback): (WebCore::SourceBufferParser::setDidEncounterErrorDuringParsingCallback): (WebCore::SourceBufferParser::setDidProvideMediaDataCallback): (WebCore::SourceBufferParser::setWillProvideContentKeyRequestInitializationDataForTrackIDCallback): (WebCore::SourceBufferParser::setDidProvideContentKeyRequestInitializationDataForTrackIDCallback): * platform/graphics/cocoa/SourceBufferParserWebM.cpp: Added. (WebCore::isWebmParserAvailable): (WebCore::SourceBufferParserWebM::isContentTypeSupported): (WebCore::SourceBufferParserWebM::SourceBufferParserWebM): (WebCore::SourceBufferParserWebM::appendData): (WebCore::SourceBufferParserWebM::flushPendingMediaData): (WebCore::SourceBufferParserWebM::setShouldProvideMediaDataForTrackID): (WebCore::SourceBufferParserWebM::shouldProvideMediadataForTrackID): (WebCore::SourceBufferParserWebM::resetParserState): (WebCore::SourceBufferParserWebM::trackDataForTrackNumber): (WebCore::SourceBufferParserWebM::OnElementBegin): (WebCore::SourceBufferParserWebM::OnEbml): (WebCore::SourceBufferParserWebM::OnSegmentBegin): (WebCore::SourceBufferParserWebM::OnInfo): (WebCore::SourceBufferParserWebM::OnClusterBegin): (WebCore::SourceBufferParserWebM::OnTrackEntry): (WebCore::SourceBufferParserWebM::OnBlockBegin): (WebCore::SourceBufferParserWebM::OnBlockEnd): (WebCore::SourceBufferParserWebM::OnSimpleBlockBegin): (WebCore::SourceBufferParserWebM::OnSimpleBlockEnd): (WebCore::SourceBufferParserWebM::OnBlockGroupBegin): (WebCore::SourceBufferParserWebM::OnBlockGroupEnd): (WebCore::convertToColorPrimaries): (WebCore::convertToTransferCharacteristics): (WebCore::convertToMatrixCoefficients): (WebCore::convertSubsamplingXYToChromaSubsampling): (WebCore::createFormatDescriptionFromVP9HeaderParser): (WebCore::SourceBufferParserWebM::OnFrame): * platform/graphics/cocoa/SourceBufferParserWebM.h: Added. (WebCore::SourceBufferParserWebM::status const): (WebCore::SourceBufferParserWebM::type const): (isType): * platform/graphics/cocoa/VP9UtilitiesCocoa.h: * platform/graphics/cocoa/VP9UtilitiesCocoa.mm: (WebCore::isVP9DecoderAvailable): (WebCore::validateVPParameters): * platform/graphics/cocoa/VideoTrackPrivateWebM.cpp: (WebCore::VideoTrackPrivateWebM::create): (WebCore::VideoTrackPrivateWebM::VideoTrackPrivateWebM): (WebCore::VideoTrackPrivateWebM::id const): (WebCore::VideoTrackPrivateWebM::label const): (WebCore::VideoTrackPrivateWebM::language const): (WebCore::VideoTrackPrivateWebM::trackIndex const): * platform/graphics/cocoa/VideoTrackPrivateWebM.h: Source/WebKit: <rdar://problem/65782467> Reviewed by Eric Carlson. Add an Experimental setting to enable the MSE WebM parser (off by default). * Shared/WebPreferences.yaml: LayoutTests: <rdar://problem/65782467> Reviewed by Eric Carlson. * media/media-source/content/test-vp9-manifest.json: Added. * media/media-source/content/test-vp9.webm: Added. * media/media-source/media-source-webm-expected.txt: Added. * media/media-source/media-source-webm.html: Added. Canonical link: https://commits.webkit.org/227430@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@264685 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-07-22 00:25:09 +00:00
platform/graphics/avfoundation/objc/SourceBufferParserAVFObjC.mm @no-unify
Rename VideoFullscreenLayerManager to VideoLayerManager https://bugs.webkit.org/show_bug.cgi?id=207502 Reviewed by Youenn Fablet. No new tests -- no new or changed functionality. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/VideoLayerManager.h: Renamed from Source/WebCore/platform/graphics/VideoFullscreenLayerManager.h. (WebCore::VideoLayerManager::~VideoLayerManager): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC): (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer): (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyVideoLayer): (WebCore::MediaPlayerPrivateAVFoundationObjC::platformLayer const): (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoFullscreenInlineImage): (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer): (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenFrame): (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoLayerGravity): (WebCore::MediaPlayerPrivateAVFoundationObjC::requiresTextTrackRepresentation const): (WebCore::MediaPlayerPrivateAVFoundationObjC::syncTextTrackBounds): (WebCore::MediaPlayerPrivateAVFoundationObjC::setTextTrackRepresentation): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::platformLayer const): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::ensureLayer): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::destroyLayer): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVideoFullscreenLayer): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVideoFullscreenFrame): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::requiresTextTrackRepresentation const): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::syncTextTrackBounds): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setTextTrackRepresentation): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyLayers): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::platformLayer const): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVideoFullscreenLayer): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVideoFullscreenFrame): * platform/graphics/avfoundation/objc/VideoLayerManagerObjC.h: Renamed from Source/WebCore/platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.h. * platform/graphics/avfoundation/objc/VideoLayerManagerObjC.mm: Renamed from Source/WebCore/platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.mm. (WebCore::VideoLayerManagerObjC::VideoLayerManagerObjC): (WebCore::VideoLayerManagerObjC::setVideoLayer): (WebCore::VideoLayerManagerObjC::updateVideoFullscreenInlineImage): (WebCore::VideoLayerManagerObjC::setVideoFullscreenLayer): (WebCore::VideoLayerManagerObjC::setVideoFullscreenFrame): (WebCore::VideoLayerManagerObjC::didDestroyVideoLayer): (WebCore::VideoLayerManagerObjC::requiresTextTrackRepresentation const): (WebCore::VideoLayerManagerObjC::syncTextTrackBounds): (WebCore::VideoLayerManagerObjC::setTextTrackRepresentation): (WebCore::VideoLayerManagerObjC::logChannel const): Canonical link: https://commits.webkit.org/220583@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256424 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-02-12 05:11:22 +00:00
platform/graphics/avfoundation/objc/VideoLayerManagerObjC.mm @no-unify
platform/graphics/avfoundation/objc/VideoTrackPrivateAVFObjC.cpp @no-unify
platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.mm @no-unify
platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm @no-unify
platform/graphics/ca/GraphicsLayerCA.cpp
platform/graphics/ca/LayerPool.cpp
platform/graphics/ca/PlatformCAAnimation.cpp
platform/graphics/ca/PlatformCALayer.cpp
platform/graphics/ca/TileController.cpp
platform/graphics/ca/TileCoverageMap.cpp
platform/graphics/ca/TileGrid.cpp
platform/graphics/ca/TransformationMatrixCA.cpp
platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm
platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm
platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm
platform/graphics/ca/cocoa/WebSystemBackdropLayer.mm
platform/graphics/ca/cocoa/WebTiledBackingLayer.mm
ASSERT at PlatformCALayerCocoa::avPlayerLayer(): [platformLayer() sublayers].count == 1 https://bugs.webkit.org/show_bug.cgi?id=204077 <rdar://problem/56640423> Reviewed by Simon Fraser. Make PlatformCALayerCocoa::avPlayer() more robust against underlying layer changes. Promote WebVideoContainerLayer to its own header file and give the class a "playerLayer" property. In PlatformCALayerCocoa::avPlayer(), use that new property to retrieve the AVPlayerLayer. Drive-by fix: Make PlatformCALayerCocoa::create() return a Ref<PlatformCALayerCocoa> rather than its parent class type. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.h: * platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.mm: (WebCore::VideoFullscreenLayerManagerObjC::setVideoLayer): (-[WebVideoContainerLayer setBounds:]): Deleted. (-[WebVideoContainerLayer setPosition:]): Deleted. * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h: * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: (WebCore::PlatformCALayerCocoa::create): (WebCore::PlatformCALayerCocoa::layerTypeForPlatformLayer): (WebCore::PlatformCALayerCocoa::clone const): (WebCore::PlatformCALayerCocoa::avPlayerLayer const): * platform/graphics/ca/cocoa/WebVideoContainerLayer.h: Added. * platform/graphics/ca/cocoa/WebVideoContainerLayer.mm: Added. (-[WebVideoContainerLayer initWithPlayerLayer:]): (-[WebVideoContainerLayer playerLayer]): (-[WebVideoContainerLayer setBounds:]): (-[WebVideoContainerLayer setPosition:]): Canonical link: https://commits.webkit.org/217401@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@252346 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-11-12 01:04:57 +00:00
platform/graphics/ca/cocoa/WebVideoContainerLayer.mm
platform/graphics/cg/ColorCG.cpp
Simplify adding new color spaces to WebCore https://bugs.webkit.org/show_bug.cgi?id=220146 Reviewed by Dean Jackson. Reduce the number of places one needs to touch when adding new color types to: - ColorTypes.h - ColorConversion.h/cpp - ColorSpace.h/cpp (only needed if support in Color is required). - ColorSerialization.h (only needed if support in Color is required). - ColorSpaceCG.h/cpp (only needed if support in Color is required). * Sources.txt: * WebCore.xcodeproj/project.pbxproj: Add ColorSpace.cpp, ColorSpaceCG.h and ColorSpaceCG.cpp. * platform/graphics/Color.cpp: * platform/graphics/Color.h: (WebCore::Color::Color): (WebCore::Color::setColor): Replace specific overloads of the contructor and setColor with template functions that do the same things. These are safe to make as if a non-supported color type (one that doesn't have a colorSpace member) is passed it will fail to compile due to use beneath ExtendedColor::create(). Also moves WTF::TextStream operator<< overload for ColorSpace out and into ColorSpace.cpp where it makes more sense. * platform/graphics/ColorConversion.cpp: * platform/graphics/ColorConversion.h: Re-order and explicitly comment conversion functions to be more clear. As the comment indicates, all color types must implement at least the following conversions: XYZA<float> toXYZA(const ColorType<float>&); ColorType<float> toColorType(const XYZA<float>&); This allows generic fallback code, inline at the bottom of the header, to support conversion to and from any set of colors. Additional conversion functions are useful for the cases where the optimal or base conversion is not through XYZ such as from SRGBA to LinearSRGBA. To allow this to work a few additional conversion functions were added which just combine existing conversions together and one was added for SRGBA to CMYKA which was missing, though currently unused. * platform/graphics/ColorSpace.cpp: Added. (WebCore::operator<<): * platform/graphics/ColorSpace.h: Moved from Color.h * platform/graphics/ColorTypes.h: (WebCore::callWithColorType): This is a generalization of ExtendedColor::callOnUnderlyingType() that also has the benefit of now being in the same file as the color type definitions, reducing the number of files people need to touch. * platform/graphics/ColorUtilities.h: (WebCore::colorByModifingEachNonAlphaComponent): Update to not assume that colors use the names red/green/blue for non-alpha components. This makes it work generically for all four component color types. * platform/graphics/ExtendedColor.h: (WebCore::ExtendedColor::callOnUnderlyingType const): Use generalized form, callWithColorType to avoid requiring modiftying this when new color types are added. * platform/graphics/cg/ColorCG.cpp: (WebCore::leakCGColor): When going to generalize this (we could have simply called `return CGColorCreate(cachedCGColorSpace(colorSpace), cgFloatComponents))` I noticed this was not doing the right thing for CG ports that don't support all the color spaces WebCore requires (such as Windows). For instance, displayP3ColorSpaceRef() just returns sRGBColorSpaceRef() on windows, meaning we would be taking some DisplayP3 components and having CG interpret them as sRGB. To avoid this, we now check if the color space returned is the fallback color space, sRGB, and do our own conversion to sRGB using ColorConversion before creating the color. This also resolves a long standing bug / FIXME around LinearRGB where we were using sRGBColorSpaceRef() for them. In practice, we don't actually ever create LinearRGB CGColorRefs right now, but if we ever do in the future, makes sense to use the right color space. * platform/graphics/cg/ColorSpaceCG.cpp: Added. (WebCore::sRGBColorSpaceRef): (WebCore::linearRGBColorSpaceRef): (WebCore::displayP3ColorSpaceRef): (WebCore::extendedSRGBColorSpaceRef): * platform/graphics/cg/ColorSpaceCG.h: Added. (WebCore::cachedCGColorSpace): * platform/graphics/cg/GraphicsContextCG.cpp: (WebCore::sRGBColorSpaceRef): Deleted. (WebCore::linearRGBColorSpaceRef): Deleted. (WebCore::extendedSRGBColorSpaceRef): Deleted. (WebCore::displayP3ColorSpaceRef): Deleted. * platform/graphics/cg/GraphicsContextCG.h: (WebCore::cachedCGColorSpace): Deleted. Moved color space specific CG code to its own files to make it more clear where to find them. Canonical link: https://commits.webkit.org/232686@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271089 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-12-26 17:42:33 +00:00
platform/graphics/cg/ColorSpaceCG.cpp
platform/graphics/cg/FloatPointCG.cpp
platform/graphics/cg/FloatRectCG.cpp
platform/graphics/cg/FloatSizeCG.cpp
platform/graphics/cg/GradientCG.cpp
platform/graphics/cg/GraphicsContextCG.cpp
platform/graphics/cg/GraphicsContextGLCG.cpp
platform/graphics/cg/IOSurfacePool.cpp
Allow different back-ends for ImageBuffer https://bugs.webkit.org/show_bug.cgi?id=207048 Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2020-02-18 Reviewed by Tim Horton. Source/WebCore: ImageBuffer will be re-factored to decouple the platform specifics and the back-end details from the interface "ImageBuffer". A class hierarchy for the ImageBufferBackend will added to allow code sharing and to split the code according to the platform and the back-end details. ImageBuffer will be kept interface with the rest of the code but different back-ends will be created. ConcreteImageBuffer is a template class which inherits ImageBuffer and will act as a bridge to the concrete ImageBufferBackend. Based on the RenderingMode, a ConcreteImageBuffer<BackendType> will be created. Instead of checking the renderingMode in many places of the code and instead of and using preprocessor directives, all these decisions will be made in the concrete ImageBufferBackend. This re-factoring will allow creating new types of ImageBuffers backed by new ImageBufferBackends. These new ImageBufferBackends will implement DisplayList drawing and synchronize remote rendering. * Headers.cmake: * PlatformAppleWin.cmake: * PlatformFTW.cmake: * PlatformMac.cmake: * PlatformWin.cmake: * Sources.txt: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * html/CanvasBase.cpp: (WebCore::CanvasBase::setImageBuffer const): * platform/Cairo.cmake: * platform/SourcesCairo.txt: * platform/graphics/BitmapImage.cpp: (WebCore::BitmapImage::nativeImageForCurrentFrameRespectingOrientation): * platform/graphics/ConcreteImageBuffer.h: Added. (WebCore::ConcreteImageBuffer::create): (WebCore::ConcreteImageBuffer::ConcreteImageBuffer): (WebCore::ConcreteImageBuffer::ensureBackend const): (WebCore::ConcreteImageBuffer::putImageData): * platform/graphics/ImageBuffer.cpp: (WebCore::ImageBuffer::create): (WebCore::ImageBuffer::createCompatibleBuffer): (WebCore::ImageBuffer::sizeNeedsClamping): (WebCore::ImageBuffer::compatibleBufferSize): (WebCore::ImageBuffer::sinkIntoNativeImage): (WebCore::ImageBuffer::sinkIntoImage): (WebCore::ImageBuffer::drawConsuming): (WebCore::ImageBuffer::toBGRAData const): Deleted. (WebCore::ImageBuffer::transformColorSpace): Deleted. (WebCore::ImageBuffer::genericConvertToLuminanceMask): Deleted. (WebCore::ImageBuffer::convertToLuminanceMask): Deleted. (WebCore::ImageBuffer::platformLayer const): Deleted. (WebCore::ImageBuffer::copyToPlatformTexture): Deleted. (WebCore::ImageBuffer::memoryCost const): Deleted. (WebCore::ImageBuffer::externalMemoryCost const): Deleted. * platform/graphics/ImageBuffer.h: (WebCore::ImageBuffer::draw): (WebCore::ImageBuffer::drawPattern): (WebCore::ImageBuffer::drawConsuming): (WebCore::ImageBuffer::putImageData): (): Deleted. (WebCore::ImageBuffer::internalSize const): Deleted. (WebCore::ImageBuffer::logicalSize const): Deleted. (WebCore::ImageBuffer::resolutionScale const): Deleted. (WebCore::ImageBuffer::baseTransform const): Deleted. * platform/graphics/ImageBufferBackend.cpp: Added. (WebCore::ImageBufferBackend::ImageBufferBackend): (WebCore::ImageBufferBackend::calculateBackendSize): (WebCore::ImageBufferBackend::sinkIntoNativeImage): (WebCore::ImageBufferBackend::sinkIntoImage): (WebCore::ImageBufferBackend::drawConsuming): (WebCore::ImageBufferBackend::convertToLuminanceMask): (WebCore::ImageBufferBackend::toBGRAData const): (WebCore::copyPremultipliedToPremultiplied): (WebCore::copyPremultipliedToUnpremultiplied): (WebCore::copyUnpremultipliedToPremultiplied): (WebCore::copyFunctor): (WebCore::ImageBufferBackend::copyImagePixels const): (WebCore::ImageBufferBackend::getImageData const): (WebCore::ImageBufferBackend::putImageData): * platform/graphics/ImageBufferBackend.h: Added. (WebCore::ImageBufferBackend::flushContext): (WebCore::ImageBufferBackend::logicalSize const): (WebCore::ImageBufferBackend::backendSize const): (WebCore::ImageBufferBackend::resolutionScale const): (WebCore::ImageBufferBackend::colorSpace const): (WebCore::ImageBufferBackend::baseTransform const): (WebCore::ImageBufferBackend::memoryCost const): (WebCore::ImageBufferBackend::externalMemoryCost const): (WebCore::ImageBufferBackend::transformColorSpace): (WebCore::ImageBufferBackend::platformLayer const): (WebCore::ImageBufferBackend::copyToPlatformTexture const): (WebCore::ImageBufferBackend::bytesPerRow const): (WebCore::ImageBufferBackend::backendColorFormat const): (WebCore::ImageBufferBackend::toBackendCoordinates const): (WebCore::ImageBufferBackend::logicalRect const): (WebCore::ImageBufferBackend::backendRect const): * platform/graphics/PlatformImageBuffer.h: Added. * platform/graphics/ShadowBlur.cpp: (WebCore::ShadowBlur::drawShadowBuffer): * platform/graphics/cairo/CairoOperations.cpp: (WebCore::Cairo::drawShadowLayerBuffer): (WebCore::Cairo::drawShadowImage): (WebCore::Cairo::fillShadowBuffer): * platform/graphics/cairo/GraphicsContextCairo.cpp: (WebCore::GraphicsContext::clipToImageBuffer): * platform/graphics/cairo/GraphicsContextImplCairo.cpp: (WebCore::GraphicsContextImplCairo::clipToImageBuffer): * platform/graphics/cairo/ImageBufferCairo.cpp: Removed. * platform/graphics/cairo/ImageBufferCairoBackend.cpp: Added. (WebCore::ImageBufferCairoBackend::copyImage const): (WebCore::ImageBufferCairoBackend::draw): (WebCore::ImageBufferCairoBackend::drawPattern): (WebCore::ImageBufferCairoBackend::transformColorSpace): (WebCore::ImageBufferCairoBackend::toDataURL const): (WebCore::ImageBufferCairoBackend::toData const): * platform/graphics/cairo/ImageBufferCairoBackend.h: Added. (WebCore::ImageBufferCairoBackend::platformTransformColorSpace): * platform/graphics/cairo/ImageBufferCairoGLSurfaceBackend.cpp: Added. (WebCore::clearSurface): (WebCore::ImageBufferCairoGLSurfaceBackend::create): (WebCore::ImageBufferCairoGLSurfaceBackend::ImageBufferCairoGLSurfaceBackend): (WebCore::ImageBufferCairoGLSurfaceBackend::~ImageBufferCairoGLSurfaceBackend): (WebCore::ImageBuffer::platformLayer const): (WebCore::ImageBufferCairoGLSurfaceBackend::copyToPlatformTexture): (WebCore::ImageBufferCairoGLSurfaceBackend::createCompositorBuffer): (WebCore::ImageBufferCairoGLSurfaceBackend::swapBuffersIfNeeded): (WebCore::ImageBufferCairoGLSurfaceBackend::paintToTextureMapper): * platform/graphics/cairo/ImageBufferCairoGLSurfaceBackend.h: Added. * platform/graphics/cairo/ImageBufferCairoImageSurfaceBackend.cpp: Added. (WebCore::ImageBufferCairoImageSurfaceBackend::create): (WebCore::ImageBufferCairoImageSurfaceBackend::ImageBufferCairoImageSurfaceBackend): (WebCore::ImageBufferCairoImageSurfaceBackend::platformTransformColorSpace): * platform/graphics/cairo/ImageBufferCairoImageSurfaceBackend.h: Added. * platform/graphics/cairo/ImageBufferCairoSurfaceBackend.cpp: Added. (WebCore::ImageBufferCairoSurfaceBackend::ImageBufferCairoSurfaceBackend): (WebCore::ImageBufferCairoSurfaceBackend::context const): (WebCore::ImageBufferCairoSurfaceBackend::bytesPerRow const): (WebCore::ImageBufferCairoSurfaceBackend::copyNativeImage const): (WebCore::ImageBufferCairoSurfaceBackend::cairoSurfaceCoerceToImage const): (WebCore::ImageBufferCairoSurfaceBackend::toBGRAData const): (WebCore::ImageBufferCairoSurfaceBackend::getImageData const): (WebCore::ImageBufferCairoSurfaceBackend::putImageData): * platform/graphics/cairo/ImageBufferCairoSurfaceBackend.h: Added. * platform/graphics/cg/ImageBufferCG.cpp: Removed. * platform/graphics/cg/ImageBufferCGBackend.cpp: Added. (WebCore::ImageBufferCGBackend::contextColorSpace): (WebCore::ImageBufferCGBackend::setupContext): (WebCore::createCroppedImageIfNecessary): (WebCore::createBitmapImageAfterScalingIfNeeded): (WebCore::ImageBufferCGBackend::copyImage const): (WebCore::ImageBufferCGBackend::sinkIntoImage): (WebCore::ImageBufferCGBackend::draw): (WebCore::ImageBufferCGBackend::drawPattern): (WebCore::ImageBufferCGBackend::baseTransform const): (WebCore::ImageBufferCGBackend::toCFData const): (WebCore::ImageBufferCGBackend::toData const): (WebCore::ImageBufferCGBackend::toDataURL const): (WebCore::makeVImageBuffer): (WebCore::copyImagePixelsAccelerated): (WebCore::ImageBufferCGBackend::copyImagePixels const): * platform/graphics/cg/ImageBufferCGBackend.h: Added. * platform/graphics/cg/ImageBufferCGBitmapBackend.cpp: Added. (WebCore::ImageBufferCGBitmapBackend::create): (WebCore::ImageBufferCGBitmapBackend::ImageBufferCGBitmapBackend): (WebCore::ImageBufferCGBitmapBackend::context const): (WebCore::ImageBufferCGBitmapBackend::copyNativeImage const): (WebCore::ImageBufferCGBitmapBackend::toBGRAData const): (WebCore::ImageBufferCGBitmapBackend::getImageData const): (WebCore::ImageBufferCGBitmapBackend::putImageData): * platform/graphics/cg/ImageBufferCGBitmapBackend.h: Added. * platform/graphics/cg/ImageBufferDataCG.cpp: Removed. * platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp: Added. (WebCore::ImageBufferIOSurfaceBackend::calculateBackendSize): (WebCore::ImageBufferIOSurfaceBackend::contextColorSpace): (WebCore::ImageBufferIOSurfaceBackend::create): (WebCore::ImageBufferIOSurfaceBackend::ImageBufferIOSurfaceBackend): (WebCore::ImageBufferIOSurfaceBackend::context const): (WebCore::ImageBufferIOSurfaceBackend::flushContext): (WebCore::ImageBufferIOSurfaceBackend::memoryCost const): (WebCore::ImageBufferIOSurfaceBackend::externalMemoryCost const): (WebCore::ImageBufferIOSurfaceBackend::bytesPerRow const): (WebCore::ImageBufferIOSurfaceBackend::backendColorFormat const): (WebCore::ImageBufferIOSurfaceBackend::copyNativeImage const): (WebCore::ImageBufferIOSurfaceBackend::sinkIntoNativeImage): (WebCore::ImageBufferIOSurfaceBackend::drawConsuming): (WebCore::ImageBufferIOSurfaceBackend::toBGRAData const): (WebCore::ImageBufferIOSurfaceBackend::getImageData const): (WebCore::ImageBufferIOSurfaceBackend::putImageData): * platform/graphics/cg/ImageBufferIOSurfaceBackend.h: Added. * platform/graphics/cg/PDFDocumentImage.cpp: (WebCore::PDFDocumentImage::updateCachedImageIfNeeded): * platform/graphics/cocoa/IOSurface.mm: (WebCore::IOSurface::createFromImageBuffer): Deleted. * platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp: (WebCore::GraphicsContextGLOpenGL::paintRenderingResultsToCanvas): * platform/graphics/win/ImageBufferDataDirect2D.cpp: Removed. * platform/graphics/win/ImageBufferDataDirect2D.h: Removed. * platform/graphics/win/ImageBufferDirect2D.cpp: Removed. * platform/graphics/win/ImageBufferDirect2DBackend.cpp: Added. (WebCore::ImageBufferDirect2DBackend::create): (WebCore::ImageBufferDirect2DBackend::ImageBufferDirect2DBackend): (WebCore::ImageBufferDirect2DBackend::context const): (WebCore::ImageBufferDirect2DBackend::flushContext): (WebCore::ImageBufferDirect2DBackend::copyNativeImage const): (WebCore::createCroppedImageIfNecessary): (WebCore::createBitmapImageAfterScalingIfNeeded): (WebCore::ImageBufferDirect2DBackend::copyImage const): (WebCore::ImageBufferDirect2DBackend::sinkIntoImage): (WebCore::ImageBufferDirect2DBackend::compatibleBitmap): (WebCore::ImageBufferDirect2DBackend::draw): (WebCore::ImageBufferDirect2DBackend::drawPattern): (WebCore::ImageBufferDirect2DBackend::toDataURL const): (WebCore::ImageBufferDirect2DBackend::toData const): (WebCore::ImageBufferDirect2DBackend::toBGRAData const): (WebCore::ImageBufferDirect2DBackend::getImageData const): (WebCore::ImageBufferDirect2DBackend::putImageData): * platform/graphics/win/ImageBufferDirect2DBackend.h: Added. * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.cpp: (WebCore::WrappedMockRealtimeVideoSource::updateSampleBuffer): * rendering/svg/SVGRenderingContext.cpp: (WebCore::SVGRenderingContext::bufferForeground): Source/WebKit: * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::createSelectionSnapshot const): Canonical link: https://commits.webkit.org/220895@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256892 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-02-19 01:12:47 +00:00
platform/graphics/cg/ImageBufferCGBackend.cpp
platform/graphics/cg/ImageBufferCGBitmapBackend.cpp
platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp
platform/graphics/cg/ImageBufferUtilitiesCG.cpp
platform/graphics/cg/ImageDecoderCG.cpp
platform/graphics/cg/ImageSourceCGMac.mm
[macOS] Drag/drop an image of a unsupported format to an file input element should convert it to a supported format https://bugs.webkit.org/show_bug.cgi?id=212482 <rdar://problem/63731672> Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2020-08-09 Reviewed by Darin Adler. Source/WebCore: Although the list of the dropped files are sent from the UI process to the Web process through the WebPage channel, the file input settings are only known by the Web process. So we have to do the image transcoding in WebCore. Tests: fast/forms/file/entries-api/image-no-transcode-drag-drop.html fast/forms/file/entries-api/image-transcode-drag-drop.html * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * html/FileInputType.cpp: (WebCore::FileInputType::handleDOMActivateEvent): (WebCore::FileInputType::fileChooserSettings const): Move filling FileChooserSettings to the function: fileChooserSettings(). (WebCore::FileInputType::applyFileChooserSettings): Call fileChooserSettings() instead of receiving FileChooserSettings as an argument. (WebCore::FileInputType::filesChosen): Add this function which can be called from receiveDroppedFiles() or receiveDroppedFilesWithImageTranscoding(). (WebCore::FileInputType::receiveDroppedFilesWithImageTranscoding): Finds out whether image transcoding is needed for the dropped files. If it is needed, it will be done in a WorkQueue and call filesChosen() when it is done. Otherwise it will call filesChosen() immediately. (WebCore::FileInputType::receiveDroppedFiles): * html/FileInputType.h: * platform/graphics/ImageUtilities.h: Added. * platform/graphics/cg/ImageUtilitiesCG.cpp: Added. (WebCore::sharedImageTranscodingQueue): Provide a shared WorkQueue which can be used by WebCore and WebKit. (WebCore::transcodeImage): (WebCore::findImagesForTranscoding): (WebCore::transcodeImages): Source/WebKit: Move ImageUtilities.h and ImageUtilitiesCG.cpp from WebKit to WebCore. Use the image transcoding functions and shared WorkQueue from WebCore. * Platform/ImageUtilities.h: Removed. * Platform/cg: Removed. * SourcesCocoa.txt: * UIProcess/WebPageProxy.cpp: (WebKit::m_limitsNavigationsToAppBoundDomains): (WebKit::WebPageProxy::didChooseFilesForOpenPanelWithImageTranscoding): (WebKit::m_transcodingQueue): Deleted. * UIProcess/WebPageProxy.h: * WebKit.xcodeproj/project.pbxproj: LayoutTests: Enable the new tests on macOS WK1. eventSender.beginDragWithFiles is supported on WK1 only. * fast/forms/file/entries-api/image-no-transcode-drag-drop-expected.txt: Added. * fast/forms/file/entries-api/image-no-transcode-drag-drop.html: Added. * fast/forms/file/entries-api/image-transcode-drag-drop-expected.txt: Added. * fast/forms/file/entries-api/image-transcode-drag-drop.html: Added. * platform/ios/TestExpectations: * platform/win/TestExpectations: * platform/wincairo/TestExpectations: * platform/wk2/TestExpectations: Canonical link: https://commits.webkit.org/228100@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@265422 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-08-10 05:12:35 +00:00
platform/graphics/cg/ImageUtilitiesCG.cpp
platform/graphics/cg/IntPointCG.cpp
platform/graphics/cg/IntRectCG.cpp
platform/graphics/cg/IntSizeCG.cpp
platform/graphics/cg/NativeImageCG.cpp
platform/graphics/cg/PDFDocumentImage.cpp
platform/graphics/cg/PathCG.cpp
platform/graphics/cg/PatternCG.cpp
platform/graphics/cg/SubimageCacheWithTimer.cpp
platform/graphics/cg/TransformationMatrixCG.cpp
platform/graphics/cg/UTIRegistry.cpp
[Cocoa] Add experimental MSE WebM parser https://bugs.webkit.org/show_bug.cgi?id=214529 Source/ThirdParty/libwebrtc: <rdar://problem/65782467> Reviewed by Eric Carlson. Add the vp9_header_parser from libwebrtc to the project, and add its symbols to the list of exported symbols. Because this header wants to be installed to a "common/vp9_header_parser.h" path, split up the default CopyHeadersInstallPhase into two separate CopyFiles build phases that put headers into different locations. * Configurations/libwebm.xcconfig: * Configurations/libwebrtc.iOS.exp: * Configurations/libwebrtc.iOSsim.exp: * Configurations/libwebrtc.mac.exp: * Source/third_party/libwebm/common/vp9_header_parser.h: (vp9_parser::Vp9HeaderParser::color_range const): (vp9_parser::Vp9HeaderParser::subsampling_x const): (vp9_parser::Vp9HeaderParser::subsampling_y const): * libwebrtc.xcodeproj/project.pbxproj: Source/WebCore: Reviewed by Eric Carlson. Test: media/media-source/media-source-webm.html Add an experimental MSE WebM parser to SourceBufferPrivateAVFObjC. This will require extensive refactoring of SourceBufferPrivateAVFObjC, to extract out the parser into a new, virtualized class. This new parser can take advantage of new C++>11 features such as lambdas to clean up some problematic existing code. The new virtualized SourceBufferParser class uses passed-in Function objects, rather than pure-virtual Client classes to notify it's parent object when the parser encounters initialization- or media-data. Because SourceBufferPrivateAVFObjC will now have to deal with AudioTrackPrivate and VideoTrackPrivate objects that are not necessarily Audio- and VideoTrackPrivateMediaSourceAVFObjC subclasses, move those classes notification features up into Audio- and VideoTrackPrivate, again using a Function object rather than a client class. Add a new SourceBufferParserWebM and associated AudioTrackPrivateWebM and VideoTrackPrivateWebM classes, which use libwebm via libwebrtc to parse appended buffers. SourceBufferParserWebM feeds passed-in data into a libwebm-provided parser of its own. It then builds up tracks and samples based on callbacks from that same parser, constructing CMSampleBuffers and VideoTrackPrivate objects out of the underlying libwebm primitives. Because WebM uses a UUID as its track identifier, the representation of a "trackID" inside WebCore must be increased from an int to a uint64_t, or trackIDs will be truncated or zeroed when passed between classes and when converted to and from AtomStrings. This early implementation is not yet able to pass the WebM WPT media-source/ tests, as we only have a VP9 decoder available, and those tests use both VP8 and Vorbis. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setWebMParserEnabled): (WebCore::RuntimeEnabledFeatures::webMParserEnabled const): * platform/graphics/AudioTrackPrivate.h: (WebCore::AudioTrackPrivate::setEnabled): (WebCore::AudioTrackPrivate::setEnabledChangedCallback): * platform/graphics/VP9Utilities.cpp: (WebCore::isValidVPColorPrimaries): (WebCore::isValidVPTransferCharacteristics): (WebCore::isValidVPMatrixCoefficients): (WebCore::parseVPCodecParameters): * platform/graphics/VP9Utilities.h: * platform/graphics/VideoTrackPrivate.h: (WebCore::VideoTrackPrivate::setSelected): (WebCore::VideoTrackPrivate::setSelectedChangedCallback): * platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.cpp: (WebCore::AudioTrackPrivateMediaSourceAVFObjC::AudioTrackPrivateMediaSourceAVFObjC): (WebCore::AudioTrackPrivateMediaSourceAVFObjC::setEnabled): * platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm: (WebCore::CDMSessionAVContentKeySession::update): * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm: (WebCore::CDMSessionAVStreamSession::update): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType): * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h: (WebCore::MediaSampleAVFObjC::create): (WebCore::MediaSampleAVFObjC::MediaSampleAVFObjC): * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm: (WebCore::MediaSourcePrivateAVFObjC::addSourceBuffer): * platform/graphics/avfoundation/objc/SourceBufferParserAVFObjC.h: Added. (isType): * platform/graphics/avfoundation/objc/SourceBufferParserAVFObjC.mm: Added. (-[WebAVStreamDataParserListener initWithParser:parent:]): (-[WebAVStreamDataParserListener dealloc]): (-[WebAVStreamDataParserListener invalidate]): (-[WebAVStreamDataParserListener streamDataParser:didParseStreamDataAsAsset:]): (-[WebAVStreamDataParserListener streamDataParser:didParseStreamDataAsAsset:withDiscontinuity:]): (-[WebAVStreamDataParserListener streamDataParser:didFailToParseStreamDataWithError:]): (-[WebAVStreamDataParserListener streamDataParser:didProvideMediaData:forTrackID:mediaType:flags:]): (-[WebAVStreamDataParserListener streamDataParserWillProvideContentKeyRequestInitializationData:forTrackID:]): (-[WebAVStreamDataParserListener streamDataParser:didProvideContentKeyRequestInitializationData:forTrackID:]): (WebCore::SourceBufferParserAVFObjC::isContentTypeSupported): (WebCore::SourceBufferParserAVFObjC::SourceBufferParserAVFObjC): (WebCore::SourceBufferParserAVFObjC::~SourceBufferParserAVFObjC): (WebCore::SourceBufferParserAVFObjC::appendData): (WebCore::SourceBufferParserAVFObjC::flushPendingMediaData): (WebCore::SourceBufferParserAVFObjC::setShouldProvideMediaDataForTrackID): (WebCore::SourceBufferParserAVFObjC::shouldProvideMediadataForTrackID): (WebCore::SourceBufferParserAVFObjC::resetParserState): (WebCore::SourceBufferParserAVFObjC::didParseStreamDataAsAsset): (WebCore::SourceBufferParserAVFObjC::didFailToParseStreamDataWithError): (WebCore::SourceBufferParserAVFObjC::didProvideMediaDataForTrackID): (WebCore::SourceBufferParserAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID): (WebCore::SourceBufferParserAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID): * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::SourceBufferPrivateAVFObjC::create): (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC): (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC): (WebCore::SourceBufferPrivateAVFObjC::didParseInitializationData): (WebCore::SourceBufferPrivateAVFObjC::didEncounterErrorDuringParsing): (WebCore::SourceBufferPrivateAVFObjC::didProvideMediaDataForTrackID): (WebCore::SourceBufferPrivateAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID): (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID): (WebCore::SourceBufferPrivateAVFObjC::append): (WebCore::SourceBufferPrivateAVFObjC::appendCompleted): (WebCore::SourceBufferPrivateAVFObjC::abort): (WebCore::SourceBufferPrivateAVFObjC::resetParserState): (WebCore::SourceBufferPrivateAVFObjC::destroyParser): (WebCore::SourceBufferPrivateAVFObjC::clearTracks): (WebCore::SourceBufferPrivateAVFObjC::hasSelectedVideo const): (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeSelected): (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled): (WebCore::SourceBufferPrivateAVFObjC::parser const): (WebCore::SourceBufferPrivateAVFObjC::attemptToDecrypt): (WebCore::SourceBufferPrivateAVFObjC::flush): (WebCore::SourceBufferPrivateAVFObjC::enqueueSample): (WebCore::SourceBufferPrivateAVFObjC::isReadyForMoreSamples): (WebCore::SourceBufferPrivateAVFObjC::didBecomeReadyForMoreSamples): (WebCore::SourceBufferPrivateAVFObjC::notifyClientWhenReadyForMoreSamples): (WebCore::SourceBufferPrivateAVFObjC::canSetMinimumUpcomingPresentationTime const): * platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.mm: (WebCore::VideoTrackPrivateMediaSourceAVFObjC::VideoTrackPrivateMediaSourceAVFObjC): * platform/graphics/cocoa/AudioTrackPrivateWebM.cpp: Copied from Source/WebCore/platform/graphics/cocoa/VP9UtilitiesCocoa.h. (WebCore::AudioTrackPrivateWebM::create): (WebCore::AudioTrackPrivateWebM::AudioTrackPrivateWebM): (WebCore::AudioTrackPrivateWebM::id const): (WebCore::AudioTrackPrivateWebM::label const): (WebCore::AudioTrackPrivateWebM::language const): (WebCore::AudioTrackPrivateWebM::trackIndex const): * platform/graphics/cocoa/AudioTrackPrivateWebM.h: Copied from Source/WebCore/platform/graphics/cocoa/VP9UtilitiesCocoa.h. * platform/graphics/cocoa/SourceBufferParser.cpp: Copied from Source/WebCore/platform/graphics/cocoa/VP9UtilitiesCocoa.h. (WebCore::SourceBufferParser::isContentTypeSupported): (WebCore::SourceBufferParser::create): * platform/graphics/cocoa/SourceBufferParser.h: Added. (WebCore::SourceBufferParser::setDidParseInitializationDataCallback): (WebCore::SourceBufferParser::setDidEncounterErrorDuringParsingCallback): (WebCore::SourceBufferParser::setDidProvideMediaDataCallback): (WebCore::SourceBufferParser::setWillProvideContentKeyRequestInitializationDataForTrackIDCallback): (WebCore::SourceBufferParser::setDidProvideContentKeyRequestInitializationDataForTrackIDCallback): * platform/graphics/cocoa/SourceBufferParserWebM.cpp: Added. (WebCore::isWebmParserAvailable): (WebCore::SourceBufferParserWebM::isContentTypeSupported): (WebCore::SourceBufferParserWebM::SourceBufferParserWebM): (WebCore::SourceBufferParserWebM::appendData): (WebCore::SourceBufferParserWebM::flushPendingMediaData): (WebCore::SourceBufferParserWebM::setShouldProvideMediaDataForTrackID): (WebCore::SourceBufferParserWebM::shouldProvideMediadataForTrackID): (WebCore::SourceBufferParserWebM::resetParserState): (WebCore::SourceBufferParserWebM::trackDataForTrackNumber): (WebCore::SourceBufferParserWebM::OnElementBegin): (WebCore::SourceBufferParserWebM::OnEbml): (WebCore::SourceBufferParserWebM::OnSegmentBegin): (WebCore::SourceBufferParserWebM::OnInfo): (WebCore::SourceBufferParserWebM::OnClusterBegin): (WebCore::SourceBufferParserWebM::OnTrackEntry): (WebCore::SourceBufferParserWebM::OnBlockBegin): (WebCore::SourceBufferParserWebM::OnBlockEnd): (WebCore::SourceBufferParserWebM::OnSimpleBlockBegin): (WebCore::SourceBufferParserWebM::OnSimpleBlockEnd): (WebCore::SourceBufferParserWebM::OnBlockGroupBegin): (WebCore::SourceBufferParserWebM::OnBlockGroupEnd): (WebCore::convertToColorPrimaries): (WebCore::convertToTransferCharacteristics): (WebCore::convertToMatrixCoefficients): (WebCore::convertSubsamplingXYToChromaSubsampling): (WebCore::createFormatDescriptionFromVP9HeaderParser): (WebCore::SourceBufferParserWebM::OnFrame): * platform/graphics/cocoa/SourceBufferParserWebM.h: Added. (WebCore::SourceBufferParserWebM::status const): (WebCore::SourceBufferParserWebM::type const): (isType): * platform/graphics/cocoa/VP9UtilitiesCocoa.h: * platform/graphics/cocoa/VP9UtilitiesCocoa.mm: (WebCore::isVP9DecoderAvailable): (WebCore::validateVPParameters): * platform/graphics/cocoa/VideoTrackPrivateWebM.cpp: (WebCore::VideoTrackPrivateWebM::create): (WebCore::VideoTrackPrivateWebM::VideoTrackPrivateWebM): (WebCore::VideoTrackPrivateWebM::id const): (WebCore::VideoTrackPrivateWebM::label const): (WebCore::VideoTrackPrivateWebM::language const): (WebCore::VideoTrackPrivateWebM::trackIndex const): * platform/graphics/cocoa/VideoTrackPrivateWebM.h: Source/WebKit: <rdar://problem/65782467> Reviewed by Eric Carlson. Add an Experimental setting to enable the MSE WebM parser (off by default). * Shared/WebPreferences.yaml: LayoutTests: <rdar://problem/65782467> Reviewed by Eric Carlson. * media/media-source/content/test-vp9-manifest.json: Added. * media/media-source/content/test-vp9.webm: Added. * media/media-source/media-source-webm-expected.txt: Added. * media/media-source/media-source-webm.html: Added. Canonical link: https://commits.webkit.org/227430@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@264685 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-07-22 00:25:09 +00:00
platform/graphics/cocoa/AudioTrackPrivateWebM.cpp
Refactor Editor::fontAttributesForSelectionStart to be platform-agnostic https://bugs.webkit.org/show_bug.cgi?id=189918 Work towards <rdar://problem/44648705> Reviewed by Tim Horton. Source/WebCore: Refactors the functionality in Editor::fontAttributesForSelectionStart to not be Cocoa-only. Rename this to fontAttributesAtSelectionStart (to be consistent with `EditingStyle::styleAtSelectionStart`) and move it from EditorCocoa.mm to Editor.cpp; instead of creating and populating an NSDictionary with font attribute information, create and populate a new `FontAttributes` struct that contains the same information. Cocoa clients in WebKitLegacy may then create an `NSDictionary` as needed from the `FontAttributes`. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * editing/Editor.cpp: (WebCore::Editor::platformFontAttributesAtSelectionStart const): Add a hook to allow platforms to supply additional information in FontAttributes. On Cocoa, this adds a UIFont or NSFont to FontAttributes; otherwise, this is a no-op. (WebCore::Editor::fontAttributesAtSelectionStart const): * editing/Editor.h: * editing/FontAttributeChanges.cpp: (WebCore::cssValueListForShadow): * editing/FontAttributeChanges.h: (): Deleted. (WebCore::FontShadow::encode const): Deleted. (WebCore::FontShadow::decode): Deleted. * editing/FontAttributes.h: Added. Introduce a new struct that contains font attribute information. May be converted into an NSDictionary for use by Cocoa clients in WebKitLegacy and WebKit. In a future patch, this will become serializable over IPC for use in WebKit2. * editing/FontShadow.h: Added. Move FontShadow out into a separate header file, included in `FontAttributeChanges.h` and `FontAttributes.h`. (WebCore::FontShadow::encode const): (WebCore::FontShadow::decode): * editing/cocoa/EditorCocoa.mm: Add a helper function to convert a WebCore::Color to either `UIColor` on iOS or `NSColor` when AppKit is being used. (WebCore::Editor::platformFontAttributesAtSelectionStart const): (WebCore::Editor::getTextDecorationAttributesRespectingTypingStyle const): Deleted. Remove a helper function that was only used to compute text decoration attributes in fontAttributesForSelectionStart. (WebCore::Editor::fontAttributesForSelectionStart const): Deleted. * editing/cocoa/FontAttributesCocoa.mm: Added. (WebCore::FontAttributes::createDictionary const): * editing/cocoa/FontShadowCocoa.mm: Added. (WebCore::FontShadow::createShadow const): * editing/cocoa/HTMLConverter.mm: (_webKitBundle): (HTMLConverter::_colorForElement): (_platformColor): Deleted. Adopt platformColor(). * platform/graphics/cocoa/ColorCocoa.h: Added. * platform/graphics/cocoa/ColorCocoa.mm: Added. (WebCore::platformColor): * platform/graphics/metal/GPURenderPassDescriptorMetal.mm: Build fix due to changes in unified sources. * platform/mac/WebCoreNSFontManagerExtras.mm: (WebCore::computedFontAttributeChanges): * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm: * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm: More build fixes due to changes in unified sources. Source/WebCore/PAL: Add `+_disambiguated_due_to_CIImage_colorWithCGColor:` as a UIColor SPI definition. Also, import `UIColor_Private.h` directly when the Apple internal SDK is used. * pal/spi/ios/UIKitSPI.h: Source/WebKitLegacy/mac: Replace call sites of fontAttributesForSelectionStart() to fontAttributesAtSelectionStart().createDictionary(). * WebView/WebHTMLView.mm: (-[WebHTMLView _selectionStartFontAttributesAsRTF]): (-[WebHTMLView _updateFontPanel]): * WebView/WebView.mm: (-[WebView typingAttributes]): Canonical link: https://commits.webkit.org/204897@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236445 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-09-25 00:17:29 +00:00
platform/graphics/cocoa/ColorCocoa.mm
[Cocoa] Simplify NSArray, NSDictionary, and NSNumber idioms throughout WebKit https://bugs.webkit.org/show_bug.cgi?id=210138 Reviewed by Alex Christensen. Source/JavaScriptCore: * API/JSValue.mm: (valueToObjectWithoutCopy): Use @(). (valueToNumber): Ditto. * API/tests/testapi.mm: (-[TestObject callback:]): Use @[], @(), and @{}. (-[TextXYZ click]): Ditto. (testObjectiveCAPIMain): Ditto. Source/WebCore: - Added createNSArray and makeVector. - Use createNSArray and makeVector<String> in many places where we convert between NSArray and Vector, replacing multiple existing functions that were doing the same job before; later can use them even more. - Use @[] many places where we create an autoreleased NSArray. - Use @{} many places where we create an autoreleased NSDictionary. - Use @() many places where we create an autoreleased NSNumber. * PlatformMac.cmake: Moved Float/IntRectMac.mm to Float/IntRectCocoa.mm. * SourcesCocoa.txt: Ditto. * WebCore.xcodeproj/project.pbxproj: Ditto. * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (AXAttributeStringSetBlockquoteLevel): Use @(). (AXAttributeStringSetHeadingLevel): Use @(). (-[WebAccessibilityObjectWrapper textMarkerRangeForSelection]): Use @[]. (-[WebAccessibilityObjectWrapper _stringFromStartMarker:toEndMarker:attributed:]): Use @[]. (-[WebAccessibilityObjectWrapper elementsForRange:]): Use @[]. (-[WebAccessibilityObjectWrapper textMarkersForRange:]): Use @[]. * accessibility/mac/AXObjectCacheMac.mm: (WebCore::textReplacementChangeDictionary): Use @(). * accessibility/mac/WebAccessibilityObjectWrapperBase.mm: (makeVectorElement): Aded overload for AccessibilitySearchKey. (accessibilitySearchCriteriaForSearchPredicateParameterizedAttribute): Use makeVector<AccessibilitySearchKey>. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (accessibilityTextCriteriaForParameterizedAttribute): Use makeVector<String>. (accessibilitySearchTextCriteriaForParameterizedAttribute): Use makeVector<String>. (AXAttributeStringSetStyle): Use @(). (AXAttributeStringSetBlockquoteLevel): Use @(). (AXAttributeStringSetHeadingLevel): Use @(). (-[WebAccessibilityObjectWrapper accessibilityActionNames]): Use @[]. (convertStringsToNSArray): Deleted. (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): Use @(), @[], and createNSArray. (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]): Ditto. * bridge/objc/WebScriptObject.mm: (+[WebScriptObject _convertValueToObjcValue:originRootObject:rootObject:]): Use @(). * editing/cocoa/AlternativeTextUIController.mm: (WebCore::AlternativeTextUIController::alternativesForContext): Use makeVector<String>. * editing/cocoa/HTMLConverter.mm: (defaultParagraphStyle): Use @[]. (HTMLConverter::computedAttributesForElement): Use @(). (HTMLConverter::_processMetaElementWithName): Use @(). (HTMLConverter::_addTableForElement): Use @(). * page/ios/FrameIOS.mm: (WebCore::Frame::interpretationsForCurrentRoot const): Use @[]. * platform/cocoa/MIMETypeRegistryCocoa.mm: (WebCore::MIMETypeRegistry::getExtensionsForMIMEType): Use makeVector<String>. * platform/graphics/FloatRect.h: Added makeNSArrayElement overload so we can convert Vector<FloatRect> into NSArray<NSValue>. * platform/graphics/IntRect.h: Similarly for IntRect. * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm: (WebCore::MediaSelectionGroupAVFObjC::updateOptions): Use createNSArray. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::mediaDescriptionForKind): Use @[]. (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): Use @(). (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem): Use @(). (WebCore::MediaPlayerPrivateAVFoundationObjC::checkPlayability): Use @[]. (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput): Use @{} and @(). * platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm: (WebCore::PlatformCAAnimationCocoa::valueFunction const): (WebCore::PlatformCAAnimationCocoa::setFromValue): (WebCore::PlatformCAAnimationCocoa::copyFromValueFrom): (WebCore::PlatformCAAnimationCocoa::setToValue): (WebCore::PlatformCAAnimationCocoa::copyToValueFrom): (WebCore::PlatformCAAnimationCocoa::setValues): (WebCore::PlatformCAAnimationCocoa::copyValuesFrom): (WebCore::PlatformCAAnimationCocoa::setKeyTimes): (WebCore::PlatformCAAnimationCocoa::copyKeyTimesFrom): (WebCore::PlatformCAAnimationCocoa::setTimingFunctions): (WebCore::PlatformCAAnimationCocoa::copyTimingFunctionsFrom): Use @(), @[], modern for loops, auto, and allocate with capacity. * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm: (WebCore::PlatformCAFilters::filterValueForOperation): Use @(). * platform/graphics/cocoa/FloatRectCocoa.mm: Moved from mac/FloatRectMac.mm. (WebCore::makeNSArrayElement): Added so we can convert Vector<FloatRect> into NSArray<NSValue>. * platform/graphics/cocoa/IntRectCocoa.mm: Moved from mac/IntRectMac.mm. (WebCore::makeNSArrayElement): Similarly for IntRect. (WebCore::enclosingIntRect): Use clampTo to be consistent with what enclosingIntRect(FloatRect) does (while fixing check-webkit-style complaint). * platform/graphics/cocoa/WebGLLayer.mm: (-[WebGLLayer display]): Add WebCore namespace prefix; needed depending on how sources get unified (and was affecting my local build when it temporarily had an additional source file). (-[WebGLLayer allocateIOSurfaceBackingStoreWithSize:usingAlpha:]): Ditto. (-[WebGLLayer bindFramebufferToNextAvailableSurface]): Ditto. * platform/graphics/ios/FontCacheIOS.mm: (WebCore::systemFontModificationAttributes): Use @(). * platform/ios/PlatformPasteboardIOS.mm: (WebCore::PlatformPasteboard::getTypes): Use makeVector<String>. (WebCore::createItemProviderRegistrationList): Use createNSArray. (WebCore::PlatformPasteboard::updateSupportedTypeIdentifiers): Use createNSArray. * platform/ios/WebItemProviderPasteboard.mm: (-[WebItemProviderPasteboard setItemProviders:]): Use @[]. * platform/ios/wak/WAKView.mm: (-[WAKView subviews]): Dittto. * platform/mac/PlatformPasteboardMac.mm: (WebCore::PlatformPasteboard::getTypes): Use makeVector<String>. (WebCore::PlatformPasteboard::getPathnamesForType const): Use makeVector<String>. (WebCore::PlatformPasteboard::addTypes): Use makeVector<String>. (WebCore::PlatformPasteboard::setTypes): Use makeVector<String>. * platform/mac/StringUtilities.h: Removed webCoreStringVectorFromNSStringArray, replaced by makeVector<String> * platform/mac/StringUtilities.mm: (WebCore::webCoreStringVectorFromNSStringArray): Deleted. * platform/mac/WebCoreNSURLExtras.mm: Removed unneeded include. * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: (WebCore::MediaRecorderPrivateWriter::setVideoInput): Use @(). * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::setupCaptureSession): Use @(). * platform/network/cocoa/CookieCocoa.mm: (WebCore::Cookie::operator NSHTTPCookie * _Nullable const): Use @(). * platform/network/cocoa/NetworkStorageSessionCocoa.mm: (WebCore::NetworkStorageSession::setCookiesFromDOM const): Use @{}. * platform/network/cocoa/ResourceRequestCocoa.mm: (WebCore::ResourceRequest::doUpdatePlatformRequest): Use @YES/@NO. Source/WebKit: * 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>. Source/WebKitLegacy/ios: * WebCoreSupport/WebChromeClientIOS.mm: (WebChromeClientIOS::runOpenPanel): Use createNSArray. * WebCoreSupport/WebVisiblePosition.mm: (-[WebVisiblePosition enclosingRangeWithDictationPhraseAlternatives:]): Use createNSArray. * WebCoreSupport/WebVisiblePositionInternal.h: Added #if so that this correctly doesn't compile anything on Mac. * WebView/WebPDFViewIOS.mm: (+[WebPDFView supportedMIMETypes]): Use @[]. Source/WebKitLegacy/mac: * DOM/DOM.mm: (kit): Deleted overload that takes Vector<IntRect>. (-[DOMNode textRects]): Use createNSArray. (-[DOMRange textRects]): Ditto. * DOM/ExceptionHandlers.mm: (raiseDOMErrorException): Use @(). * History/WebBackForwardList.mm: (-[WebBackForwardList dictionaryRepresentation]): Use @{}. * History/WebHistory.mm: (+[WebHistoryPrivate initialize]): Use @{}. (-[WebHistory _sendNotification:entries:]): Use @{}. * History/WebHistoryItem.mm: (-[WebHistoryItem initFromDictionaryRepresentation:]): Use makeVector<String>. (-[WebHistoryItem dictionaryRepresentation:]): Use createNSArray and @(). * History/WebURLsWithTitles.m: (+[WebURLsWithTitles arrayWithIFURLsWithTitlesPboardType]): Use @[]. (+[WebURLsWithTitles writeURLs:andTitles:toPasteboard:]): Use @[]. * Misc/WebCache.mm: (+[WebCache statistics]): Use @[], @{}, and @(). * Misc/WebCoreStatistics.mm: (+[WebCoreStatistics memoryStatistics]): Ditto. * Misc/WebKitErrors.m: (-[NSError _webkit_initWithDomain:code:URL:]): Use @(). (+[NSError _registerWebKitErrors]): Use @(). (-[NSError _initWithPluginErrorCode:contentURL:pluginPageURL:pluginName:MIMEType:]): Use @(). * Misc/WebKitNSStringExtras.mm: (-[NSString _web_drawAtPoint:font:textColor:]): Use @{}. (-[NSString _web_widthWithFont:]): Use @{}. * Misc/WebNSFileManagerExtras.mm: Removed unneeded include. * Misc/WebNSPasteboardExtras.mm: (+[NSPasteboard _web_dragTypesForURL]): Use @[]. (-[NSPasteboard _web_writeURL:andTitle:types:]): Use @[]. (+[NSPasteboard _web_setFindPasteboardString:withOwner:]): Use @[]. * Misc/WebNSURLExtras.mm: Removed unneeded include. * Plugins/Hosted/NetscapePluginHostManager.mm: (WebKit::NetscapePluginHostManager::spawnPluginHost): Use @{}. * Plugins/Hosted/NetscapePluginHostProxy.mm: (WKPCIdentifierInfo): Use @(). * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::addValueToArray): Use @(). * Plugins/Hosted/WebHostedNetscapePluginView.mm: Removed unneeded include. * Plugins/WebBasePluginPackage.mm: Ditto. * Plugins/WebPluginContainerCheck.mm: (-[WebPluginContainerCheck _actionInformationWithURL:]): Use @{}. * Plugins/WebPluginDatabase.mm: (+[WebPluginDatabase _defaultPlugInPaths]): Use @[]. * Storage/WebDatabaseManager.mm: (-[WebDatabaseManager databasesWithOrigin:]): Use createNSArray. * WebCoreSupport/CorrectionPanel.mm: (CorrectionPanel::show): Use createNSArray. * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::addMessageToConsole): Use @(). * WebCoreSupport/WebEditorClient.mm: (attributesForAttributedStringConversion): Use @(). (WebEditorClient::getGuessesForWord): Use makeVector<String>. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::actionDictionary const): Use @(). (kit): Deleted overload that takes Vector<String>. (pluginView): Use @{}. (WebFrameLoaderClient::createPlugin): Use createNSArray, @{}, and @(). (WebFrameLoaderClient::createJavaAppletWidget): Use createNSArray. * WebCoreSupport/WebOpenPanelResultListener.mm: (-[WebOpenPanelResultListener chooseFilenames:]): Use makeVector<String>. (-[WebOpenPanelResultListener chooseFilename:displayString:iconImage:]): Use @[]. (-[WebOpenPanelResultListener chooseFilenames:displayString:iconImage:]): Use makeVector<String>. * WebCoreSupport/WebSelectionServiceController.mm: (WebSelectionServiceController::handleSelectionServiceClick): Comment out an unused argument. * WebView/WebFrame.mm: (-[WebFrame _rectsForRange:]): Use createNSArrray. (-[WebFrame _computePageRectsWithPrintScaleFactor:pageSize:]): Use createNSArray and @[]. (-[WebFrame childFrames]): Use @[]. * WebView/WebHTMLView.mm: (+[WebHTMLView _selectionPasteboardTypes]): Use @[]. (-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]): Use @[]. (-[WebHTMLView knowsPageRange:]): Use @[]. (-[WebHTMLView accessibilityAttributeValue:]): Use @[]. (-[WebHTMLView copyFont:]): Use @[]. (-[WebHTMLView _interpretKeyEvent:savingCommands:]): Use @[]. (-[WebHTMLView selectionTextRects]): Use createNSArray. (-[WebHTMLView rectsForTextMatches]): Use createNSArray and @[]. * WebView/WebPDFRepresentation.mm: Removed unneeded include. (+[WebPDFRepresentation postScriptMIMETypes]): Use @[]. (+[WebPDFRepresentation supportedMIMETypes]): Use @[]. * WebView/WebPDFView.mm: (-[WebPDFView elementAtPoint:]): Use @{} and @(). (-[WebPDFView viewState]): Use @(). (-[WebPDFView selectionTextRects]): Use @[]. (-[WebPDFView pasteboardTypesForSelection]): Use @[]. (-[WebPDFView _menuItemsFromPDFKitForEvent:]): Use @(). (-[WebPDFView _openWithFinder:]): Use @{} and @(). * WebView/WebPreferences.mm: (+[WebPreferences initialize]): Use @(). (-[WebPreferences _setUnsignedIntValue:forKey:]): Use @(). (+[WebPreferences _setInitialDefaultTextEncodingToSystemEncoding]): Use @(). (-[WebPreferences setStorageBlockingPolicy:]): Use @{} and @(). * WebView/WebScriptDebugger.mm: (WebScriptDebugger::sourceParsed): Use @(). * WebView/WebTextCompletionController.mm: (-[WebTextCompletionController _placePopupWindow:]): Use @{}. * WebView/WebView.mm: (-[WebView _preferencesChanged:]): Use makeVector<String>. (-[WebView _contentsOfUserInterfaceItem:]): Use @(). (toStringVector): Deleted. (+[WebView _addUserScriptToGroup:world:source:url:whitelist:blacklist:injectionTime:injectedFrames:]): Use makeVector<String>. (+[WebView _addUserStyleSheetToGroup:world:source:url:whitelist:blacklist:injectedFrames:]): Use makeVector<String>. (-[WebView _elementAtWindowPoint:]): Use @{}. (-[WebView pasteboardTypesForSelection]): Use @[]. (-[WebView pasteboardTypesForElement:]): Use @[]. (-[WebView rectsForTextMatches]): Use @[]. (-[WebView _searchWithGoogleFromMenu:]): Use @[]. (-[WebView _setFontWhitelist:]): Use makeVector<String>. Source/WTF: * WTF.xcodeproj/project.pbxproj: Added VectorCocoa.h. * wtf/PlatformMac.cmake: Ditto. * wtf/cocoa/NSURLExtras.mm: Removed unneeded include. * wtf/cocoa/URLCocoa.mm: Ditto. * wtf/cocoa/VectorCocoa.h: Added. Contains createNSArray and makeVector function templates for converting NSArray to and from Vector. * wtf/text/WTFString.h: Added makeNSArrayElement and makeVectorElement functions, making createNSArray and makeVector compatible with String. * wtf/text/cocoa/StringCocoa.mm: (WTF::makeNSArrayElement): Added. (WTF::makeVectorElement): Added. Tools: * DumpRenderTree/AccessibilityController.h: Remove use of NotificationHandler type; it's just "id". * DumpRenderTree/AccessibilityUIElement.cpp: (convertElementsToObjectArray): Moved this up in the file, removed unneeded use of JSValueToObject and unused exception argument. (elementsForRangeCallback): Use convertElementsToObjectArray. (columnHeadersCallback): Updated for removed exception argument. (rowHeadersCallback): Ditto. (uiElementArrayAttributeValueCallback): Ditto. * DumpRenderTree/AccessibilityUIElement.h: Changed to use RetainPtr. * DumpRenderTree/TestNetscapePlugIn/PluginObjectMac.mm: (createCoreAnimationLayer): Use @{}. * DumpRenderTree/ios/AccessibilityUIElementIOS.mm: (AccessibilityUIElement::AccessibilityUIElement): Removed some unneeded code now that we use RetainPtr. (AccessibilityUIElement::~AccessibilityUIElement): Deleted. (AccessibilityUIElement::lineTextMarkerRangeForTextMarker): Use @[]. (AccessibilityUIElement::textMarkerRangeForMarkers): Use @[]. (AccessibilityUIElement::textMarkerRangeMatchesTextNearMarkers): Use @[]. * DumpRenderTree/ios/TextInputControllerIOS.m: (-[TextInputController markedRange]): Use @[]. * DumpRenderTree/mac/AccessibilityCommonMac.mm: (searchPredicateParameterizedAttributeForSearchCriteria): Tweak a little. * DumpRenderTree/mac/AccessibilityNotificationHandler.mm: (-[NSString createJSStringRef]): Deleted. Duplicate of a method already implemented in anothe file. * DumpRenderTree/mac/AccessibilityUIElementMac.mm: (makeVectorElement): Added overloads to make both makeVector<AccessibilityTextMarkerRange> and makeVector<AccessibilityUIElement> work. (AccessibilityUIElement::AccessibilityUIElement): Removed some unneeded code now that we use RetainPtr. (convertVectorToObjectArray): Removed unneeded use of JSValueToObject and unneeded exception argument. (convertNSArrayToVector): Deleted. (AccessibilityUIElement::getLinkedUIElements): Use makeVector<AccessibilityUIElement>. (AccessibilityUIElement::getDocumentLinks): Ditto. (AccessibilityUIElement::getChildren): Ditto. (AccessibilityUIElement::getChildrenWithRange): Ditto. (AccessibilityUIElement::rowHeaders const): Ditto. (AccessibilityUIElement::columnHeaders const): Ditto. (AccessibilityUIElement::uiElementArrayAttributeValue const): Ditto. (AccessibilityUIElement::role): Updated since m_element is a RetainPtr. (AccessibilityUIElement::subrole): Ditto. (AccessibilityUIElement::roleDescription): Ditto. (AccessibilityUIElement::computedRoleString): Ditto. (AccessibilityUIElement::title): Ditto. (AccessibilityUIElement::description): Ditto. (AccessibilityUIElement::orientation const): Ditto. (AccessibilityUIElement::stringValue): Ditto. (AccessibilityUIElement::language): Ditto. (AccessibilityUIElement::helpText const): Ditto. (AccessibilityUIElement::lineForIndex): Use @(). (AccessibilityUIElement::rangeForLine): Use @(). (AccessibilityUIElement::searchTextWithCriteria): Use makeVector<AccessibilityTextMarkerRange>. (AccessibilityUIElement::attributesOfColumnHeaders): Use makeVector<AccessibilityUIElement>. (AccessibilityUIElement::attributesOfRowHeaders): Ditto. (AccessibilityUIElement::attributesOfColumns): Ditto. (AccessibilityUIElement::attributesOfRows): Ditto. (AccessibilityUIElement::attributesOfVisibleCells): Ditto. (AccessibilityUIElement::cellForColumnAndRow): Use @[] and @(). (AccessibilityUIElement::setSelectedChild const): Use @[]. (AccessibilityUIElement::setSelectedChildAtIndex const): Use @[]. (AccessibilityUIElement::attributedStringForTextMarkerRangeWithOptions): Use @{}, @YES, and @NO. (AccessibilityUIElement::textMarkerRangeForMarkers): Use @[]. * DumpRenderTree/mac/DumpRenderTree.mm: (addTestPluginsToPluginSearchPath): Use @[]. (resetWebViewToConsistentStateBeforeTesting): Use @[]. * DumpRenderTree/mac/DumpRenderTreePasteboard.mm: (-[DumpRenderTreePasteboard declareType:owner:]): Use @[]. * DumpRenderTree/mac/EventSendingController.mm: (-[EventSendingController beginDragWithFiles:]): Use @(). (-[EventSendingController sentTouchEventOfType:]): Use @(). * DumpRenderTree/mac/MockWebNotificationProvider.mm: (-[MockWebNotificationProvider cancelNotification:]): Use @[]. * DumpRenderTree/mac/ObjCController.m: (-[ObjCController objectOfClass:]): Use @(). (-[ObjCController arrayOfString]): Use @[]. (-[ObjCController testWrapperRoundTripping:]): Use @(). (-[ObjCController testArray]): Use @[]. * DumpRenderTree/mac/TestRunnerMac.mm: (originsArrayToJS): Removed unneeded use of JSValueToObject. * DumpRenderTree/mac/TextInputControllerMac.m: (-[TextInputController markedRange]): Use @[] and @(). (-[TextInputController selectedRange]): Use @[] and @(). (-[TextInputController firstRectForCharactersFrom:length:]): Use @[] and @(). (-[TextInputController dictatedStringWithPrimaryString:alternative:alternativeOffset:alternativeLength:]): Use @[]. (-[TextInputController interpretKeyEvents:withSender:]): Use @[]. * DumpRenderTree/mac/UIScriptControllerMac.mm: (WTR::UIScriptControllerMac::copyText): Use []. * DumpRenderTree/win/AccessibilityUIElementWin.cpp: Deleted an unneeded copy constructor and destructor. * TestRunnerShared/cocoa/LayoutTestSpellChecker.mm: (-[LayoutTestSpellChecker setResultsFromJSObject:inContext:]): Use @{}. * TestWebKitAPI/Tests/WebKitCocoa/ContentRuleListNotification.mm: (toVector): Deleted. (-[ContentRuleListNotificationDelegate _webView:contentRuleListWithIdentifier:performedAction:forURL:]): Use makeVector<String>. * TestWebKitAPI/Tests/WebKitCocoa/InAppBrowserPrivacy.mm: (TestWebKitAPI::TEST): Use @[]. * TestWebKitAPI/Tests/WebKitCocoa/PasteImage.mm: (writeImageDataToPasteboard): Use @[] and @{}. (writeBundleFileToPasteboard): Use @[]. * TestWebKitAPI/Tests/WebKitCocoa/PasteWebArchive.mm: (TestWebKitAPI::TEST): Use @[]. * TestWebKitAPI/Tests/WebKitCocoa/UserContentController.mm: (TestWebKitAPI::TEST): Use @[]. * TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm: (TestWebKitAPI::TEST): Use @[]. * TestWebKitAPI/Tests/WebKitCocoa/WKHTTPCookieStore.mm: (TestWebKitAPI::TEST): Use @[]. * TestWebKitAPI/Tests/WebKitCocoa/WKWebsiteDatastore.mm: (TestWebKitAPI::TEST): Use @[]. * TestWebKitAPI/Tests/WebKitCocoa/WebsiteDataStoreCustomPaths.mm: (runWebsiteDataStoreCustomPaths): Use @[]. * TestWebKitAPI/Tests/mac/WebViewCanPasteURL.mm: (TestWebKitAPI::TEST): Use @[]. * TestWebKitAPI/Tests/mac/WebViewCanPasteZeroPng.mm: (TestWebKitAPI::TEST): Use @[]. * TestWebKitAPI/Tests/mac/WebViewDidCreateJavaScriptContext.mm: (-[DidCreateJavaScriptContextFrameLoadDelegate webView:didCreateJavaScriptContext:forFrame:]): Use @[]. * TestWebKitAPI/ios/mainIOS.mm: (main): Use @{}. * TestWebKitAPI/mac/InjectedBundleControllerMac.mm: (TestWebKitAPI::InjectedBundleController::platformInitialize): Use @{} and @(). * TestWebKitAPI/mac/mainMac.mm: (main): Use {}. * WebKitTestRunner/InjectedBundle/AccessibilityController.h: Use id instead of NotificationHandler. * WebKitTestRunner/InjectedBundle/AccessibilityTextMarkerRange.h: Use id for PlatformTextMarkerRange. Added an overload of makeVectorElement to make makeVector<RefPtr<AccessibilityTextMarkerRange>> work. * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h: Use RetainPtr. Added an overload of makeVectorElement to make makeVector<RefPtr<AccessibilityUIElement>> work. * WebKitTestRunner/InjectedBundle/cocoa/ActivateFontsCocoa.mm: Removed unneeded include. * WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm: (WTR::convertNSArrayToVector): Deleted. (WTR::AccessibilityUIElement::AccessibilityUIElement): Simplified since we use RetainPtr. (WTR::AccessibilityUIElement::~AccessibilityUIElement): Ditto. (WTR::convertElementsToObjectArray): Removed unneeded use of JSValueToObject. (WTR::AccessibilityUIElement::elementsForRange): Use makeVector<RefPtr<AccessibilityUIElement>>. (WTR::AccessibilityUIElement::lineTextMarkerRangeForTextMarker): Use @[]. (WTR::AccessibilityUIElement::textMarkerRangeForMarkers): Use @[]. (WTR::AccessibilityUIElement::textMarkerRangeMatchesTextNearMarkers): * WebKitTestRunner/InjectedBundle/ios/InjectedBundleIOS.mm: (WTR::InjectedBundle::platformInitialize): Use @{}. * WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm: (WTR::AccessibilityUIElement::AccessibilityUIElement): Simplified since we use RetainPtr. (WTR::AccessibilityUIElement::~AccessibilityUIElement): Ditto. (WTR::convertNSArrayToVector): Deleted. (WTR::AccessibilityUIElement::getLinkedUIElements): Use makeVector<RefPtr<AccessibilityUIElement>>. (WTR::AccessibilityUIElement::getDocumentLinks): Ditto. (WTR::AccessibilityUIElement::getUIElementsWithAttribute const): Ditto. (WTR::AccessibilityUIElement::getChildren): Ditto. (WTR::AccessibilityUIElement::getChildrenWithRange): Ditto. (WTR::AccessibilityUIElement::rowHeaders const): Ditto. (WTR::AccessibilityUIElement::columnHeaders const): Ditto. (WTR::AccessibilityUIElement::allAttributes): Updated since m_element is a RetainPtr. (WTR::AccessibilityUIElement::stringDescriptionOfAttributeValue): Ditto. (WTR::AccessibilityUIElement::role): Ditto. (WTR::AccessibilityUIElement::subrole): Ditto. (WTR::AccessibilityUIElement::roleDescription): Ditto. (WTR::AccessibilityUIElement::computedRoleString): Ditto. (WTR::AccessibilityUIElement::title): Ditto. (WTR::AccessibilityUIElement::description): Ditto. (WTR::AccessibilityUIElement::orientation const): Ditto. (WTR::AccessibilityUIElement::stringValue): Ditto. (WTR::AccessibilityUIElement::language): Ditto. (WTR::AccessibilityUIElement::helpText const): Ditto. (WTR::AccessibilityUIElement::lineForIndex): Use @(). (WTR::AccessibilityUIElement::rangeForLine): Use @(). (WTR::AccessibilityUIElement::searchTextWithCriteria): Use makeVector<RefPtr<AccessibilityTextMarkerRange>>. (WTR::AccessibilityUIElement::attributesOfColumnHeaders): Ditto. (WTR::AccessibilityUIElement::attributesOfRowHeaders): Ditto. (WTR::AccessibilityUIElement::attributesOfColumns): Ditto. (WTR::AccessibilityUIElement::attributesOfRows): Ditto. (WTR::AccessibilityUIElement::attributesOfVisibleCells): Ditto. (WTR::AccessibilityUIElement::cellForColumnAndRow): Use @[] and @(). (WTR::AccessibilityUIElement::setSelectedChild const): Use @[]. (WTR::AccessibilityUIElement::setSelectedChildAtIndex const): Use @[]. (WTR::AccessibilityUIElement::textMarkerRangeForMarkers): Use @[]. * WebKitTestRunner/TestInvocation.cpp: (WTR::TestInvocation::didReceiveAllStorageAccessEntries): Take Vector&&. (WTR::TestInvocation::didReceiveWebViewCategory): Take String&&. * WebKitTestRunner/TestInvocation.h: Updated for the above. * WebKitTestRunner/cocoa/TestControllerCocoa.mm: (WTR::TestController::cocoaPlatformInitialize): Use @{}and @(). (WTR::TestController::getAllStorageAccessEntries): Use makeVector<String>. (WTR::TestController::loadedThirdPartyDomains): Use makeVector<String>. (WTR::TestController::getWebViewCategory): Update to pass String&&. (WTR::TestController::setAllowedMenuActions): Use createNSArray. * WebKitTestRunner/ios/HIDEventGenerator.mm: (-[HIDEventGenerator interpolatedEvents:]): Use @(). * WebKitTestRunner/mac/PlatformWebViewMac.mm: (WTR::PlatformWebView::changeWindowScaleIfNeeded): Use @{} and @(). * WebKitTestRunner/mac/TestControllerMac.mm: Removed unneeded include. * WebKitTestRunner/mac/UIScriptControllerMac.mm: (WTR::UIScriptControllerMac::copyText): Use @[]. * WebKitTestRunner/mac/WebKitTestRunnerPasteboard.mm: (-[WebKitTestRunnerPasteboard declareType:owner:]): Use @[]. Canonical link: https://commits.webkit.org/223199@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@259843 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-04-10 02:11:30 +00:00
platform/graphics/cocoa/FloatRectCocoa.mm
platform/graphics/cocoa/FontCacheCoreText.cpp
platform/graphics/cocoa/FontCascadeCocoa.mm
[Cocoa] Migrate CoreText-specific code from ***Cocoa.mm to ***CoreText.cpp https://bugs.webkit.org/show_bug.cgi?id=216400 Reviewed by Tim Horton. Source/WebCore: This is in preparation for sharing the CoreText code with the Apple Windows port. This patch doesn't actually cause Windows to use this code yet. That will happen in a series of subsequent patches. This patch is just the first stage. There isn't any actual behavior change here - it's just moving code around between files. This patch also adds a new USE() flag: USE(CORE_TEXT). It migrates CoreText-specific code from #if PLATFORM(COCOA) to #if USE(CORE_TEXT). No new tests because there is no behavior change. * PlatformMac.cmake: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/Font.cpp: * platform/graphics/Font.h: * platform/graphics/FontCascade.cpp: * platform/graphics/FontCascade.h: * platform/graphics/FontPlatformData.cpp: * platform/graphics/FontPlatformData.h: * platform/graphics/cocoa/FontCascadeCocoa.mm: (WebCore::showLetterpressedGlyphsWithAdvances): (WebCore::FontCascade::isSubpixelAntialiasingAvailable): Deleted. (WebCore::fillVectorWithHorizontalGlyphPositions): Deleted. (WebCore::shouldUseLetterpressEffect): Deleted. (WebCore::showGlyphsWithAdvances): Deleted. (WebCore::setCGFontRenderingMode): Deleted. (WebCore::FontCascade::drawGlyphs): Deleted. (WebCore::FontCascade::primaryFontIsSystemFont const): Deleted. (WebCore::FontCascade::fontForCombiningCharacterSequence const): Deleted. * platform/graphics/cocoa/FontCocoa.cpp: Added. (WebCore::Font::platformDestroy): * platform/graphics/cocoa/FontPlatformDataCocoa.mm: (WebCore::FontPlatformData::hash const): (WebCore::isSystemFont): Deleted. (): Deleted. (WebCore::FontPlatformData::FontPlatformData): Deleted. (WebCore::FontPlatformData::registeredFont const): Deleted. (WebCore::mapFontWidthVariantToCTFeatureSelector): Deleted. (WebCore::cascadeToLastResortAttributesDictionary): Deleted. (WebCore::cascadeToLastResortAndVariationsFontDescriptor): Deleted. (WebCore::FontPlatformData::ctFont const): Deleted. (WebCore::FontPlatformData::objectForEqualityCheck): Deleted. (WebCore::FontPlatformData::objectForEqualityCheck const): Deleted. (WebCore::FontPlatformData::openTypeTable const): Deleted. (WebCore::FontPlatformData::description const): Deleted. (WebCore::FontPlatformData::familyName const): Deleted. * platform/graphics/cocoa/SourceBufferParserWebM.cpp: * platform/graphics/ct/FontCascadeCoreText.cpp: Copied from Source/WebCore/platform/graphics/cocoa/FontCascadeCocoa.mm. (WebCore::FontCascade::isSubpixelAntialiasingAvailable): (WebCore::fillVectorWithHorizontalGlyphPositions): (WebCore::shouldUseLetterpressEffect): (WebCore::showGlyphsWithAdvances): (WebCore::setCGFontRenderingMode): (WebCore::FontCascade::drawGlyphs): (WebCore::FontCascade::primaryFontIsSystemFont const): (WebCore::FontCascade::fontForCombiningCharacterSequence const): * platform/graphics/ct/FontCoreText.cpp: Renamed from Source/WebCore/platform/graphics/cocoa/FontCocoa.mm. (WebCore::Font::platformInit): (WebCore::Font::platformCharWidthInit): (WebCore::Font::platformCreateScaledFont const): (WebCore::Font::applyTransforms const): * platform/graphics/ct/FontPlatformDataCoreText.cpp: Copied from Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm. (WebCore::FontPlatformData::FontPlatformData): (WebCore::isSystemFont): (WebCore::FontPlatformData::registeredFont const): (WebCore::mapFontWidthVariantToCTFeatureSelector): (WebCore::cascadeToLastResortAttributesDictionary): (WebCore::cascadeToLastResortAndVariationsFontDescriptor): (WebCore::FontPlatformData::ctFont const): (WebCore::FontPlatformData::objectForEqualityCheck): (WebCore::FontPlatformData::objectForEqualityCheck const): (WebCore::FontPlatformData::openTypeTable const): (WebCore::FontPlatformData::description const): (WebCore::FontPlatformData::familyName const): * platform/graphics/ct/GlyphPageCoreText.cpp: Renamed from Source/WebCore/platform/graphics/mac/GlyphPageMac.cpp. * platform/graphics/win/FontCascadeCGWin.cpp: Added. (WebCore::FontCascade::setFontSmoothingLevel): (WebCore::setCGFontSmoothingStyle): (WebCore::FontCascade::setFontSmoothingStyle): (WebCore::FontCascade::setFontSmoothingContrast): (WebCore::clearTypeContrast): (WebCore::FontCascade::systemFontSmoothingChanged): (WebCore::FontCascade::setCGContextFontRenderingStyle): (WebCore::renderingStyleForFont): (WebCore::FontCascade::getPlatformGlyphAdvances): Source/WebCore/PAL: * pal/spi/win/CoreTextSPIWin.h: Source/WTF: * wtf/PlatformUse.h: Canonical link: https://commits.webkit.org/229247@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266936 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-09-11 20:27:38 +00:00
platform/graphics/cocoa/FontCocoa.cpp
platform/graphics/cocoa/FontDescriptionCocoa.cpp
platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp
platform/graphics/cocoa/FontPlatformDataCocoa.mm
platform/graphics/cocoa/GraphicsContextCocoa.mm
Source/WebCore: Implement RemoteGraphicsContextGL https://bugs.webkit.org/show_bug.cgi?id=217216 <rdar://problem/69876258> Patch by Kimmo Kinnunen <kkinnunen@apple.com> on 2020-12-09 Reviewed by Simon Fraser. Implements a beginning of a remote version of GraphicsContextGL for GPU process. Current implementation is using WebKit IPC. Implemented with a generator script implementing the IPC to pass the GraphicsContextGL member function calls from web process to the GPU process. The script is run during development time and the results are committed to the repo for ease of review. Extracts an interface GraphicsContextGLIOSurfaceSwapChain which is used to submit IOSurfaces from GraphicsContextGLOpenGL. For web process WebGL, these go to WebGLLayer. For GPU process WebGL, the IOSurfaces go to the prepareForDisplay caller, e.g. the RemoteGraphicsContextGL, which then return the IOSurfaces back to Web process side. RemoteGraphicsContextGLProxy will send them to WebGLLayer. No new tests, tested by existing webgl tests once the implementation works. * PlatformMac.cmake: * Sources.txt: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::getBufferSubData): (WebCore::WebGL2RenderingContext::vertexAttribI4uiv): (WebCore::WebGL2RenderingContext::getQueryParameter): (WebCore::WebGL2RenderingContext::bindSampler): (WebCore::WebGL2RenderingContext::getSamplerParameter): (WebCore::WebGL2RenderingContext::clientWaitSync): (WebCore::WebGL2RenderingContext::deleteTransformFeedback): (WebCore::WebGL2RenderingContext::beginTransformFeedback): (WebCore::WebGL2RenderingContext::endTransformFeedback): (WebCore::WebGL2RenderingContext::transformFeedbackVaryings): (WebCore::WebGL2RenderingContext::getActiveUniforms): (WebCore::WebGL2RenderingContext::readPixels): * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::create): (WebCore::WebGLRenderingContextBase::readPixels): * html/canvas/WebGLSync.cpp: (WebCore::WebGLSync::updateCache): * page/Chrome.cpp: (WebCore::Chrome::createGraphicsContextGL const): (WebCore::Chrome::windowScreenDidChange): * page/Chrome.h: * page/ChromeClient.h: (WebCore::ChromeClient::createGraphicsContextGL const): * platform/HostWindow.h: * platform/RuntimeApplicationChecks.h: (WebCore::isInGPUProcess): * platform/cocoa/RuntimeApplicationChecksCocoa.mm: (WebCore::isInGPUProcess): * platform/graphics/ExtensionsGL.h: * platform/graphics/GraphicsContextGL.cpp: (WebCore::GraphicsContextGL::create): * platform/graphics/GraphicsContextGL.h: * platform/graphics/GraphicsTypesGL.h: (GCGLSpan::GCGLSpan): (GCGLSpan<GCGLvoid>::GCGLSpan): * platform/graphics/RemoteGraphicsContextGLProxyBase.cpp: Added. (WebCore::RemoteGraphicsContextGLProxyBase::RemoteGraphicsContextGLProxyBase): (WebCore::RemoteGraphicsContextGLProxyBase::platformGraphicsContextGL const): (WebCore::RemoteGraphicsContextGLProxyBase::platformTexture const): (WebCore::RemoteGraphicsContextGLProxyBase::getExtensions): (WebCore::RemoteGraphicsContextGLProxyBase::setContextVisibility): (WebCore::RemoteGraphicsContextGLProxyBase::powerPreferenceUsedForCreation const): (WebCore::RemoteGraphicsContextGLProxyBase::isGLES2Compliant const): (WebCore::RemoteGraphicsContextGLProxyBase::markContextChanged): (WebCore::RemoteGraphicsContextGLProxyBase::markLayerComposited): (WebCore::RemoteGraphicsContextGLProxyBase::layerComposited const): (WebCore::RemoteGraphicsContextGLProxyBase::setBuffersToAutoClear): (WebCore::RemoteGraphicsContextGLProxyBase::getBuffersToAutoClear const): (WebCore::RemoteGraphicsContextGLProxyBase::paintCompositedResultsToCanvas): (WebCore::RemoteGraphicsContextGLProxyBase::enablePreserveDrawingBuffer): (WebCore::RemoteGraphicsContextGLProxyBase::supports): (WebCore::RemoteGraphicsContextGLProxyBase::ensureEnabled): (WebCore::RemoteGraphicsContextGLProxyBase::isEnabled): (WebCore::RemoteGraphicsContextGLProxyBase::initialize): (WebCore::RemoteGraphicsContextGLProxyBase::platformInitialize): (WebCore::RemoteGraphicsContextGLProxyBase::platformLayer const): * platform/graphics/RemoteGraphicsContextGLProxyBase.h: Added. * platform/graphics/angle/ExtensionsGLANGLE.cpp: (WebCore::ExtensionsGLANGLE::ExtensionsGLANGLE): (WebCore::ExtensionsGLANGLE::getGraphicsResetStatusARB): (WebCore::ExtensionsGLANGLE::getTranslatedShaderSourceANGLE): (WebCore::ExtensionsGLANGLE::blitFramebufferANGLE): (WebCore::ExtensionsGLANGLE::renderbufferStorageMultisampleANGLE): (WebCore::ExtensionsGLANGLE::drawArraysInstancedANGLE): (WebCore::ExtensionsGLANGLE::drawElementsInstancedANGLE): (WebCore::ExtensionsGLANGLE::vertexAttribDivisorANGLE): (WebCore::ExtensionsGLANGLE::getUniformuivRobustANGLE): (WebCore::ExtensionsGLANGLE::getTexLevelParameterivRobustANGLE): (WebCore::ExtensionsGLANGLE::getTexLevelParameterfvRobustANGLE): (WebCore::ExtensionsGLANGLE::getnUniformfvRobustANGLE): (WebCore::ExtensionsGLANGLE::getnUniformivRobustANGLE): (WebCore::ExtensionsGLANGLE::getnUniformuivRobustANGLE): * platform/graphics/angle/ExtensionsGLANGLE.h: * platform/graphics/angle/GraphicsContextGLANGLE.cpp: (WebCore::GraphicsContextGLOpenGL::readnPixels): (WebCore::GraphicsContextGLOpenGL::readnPixelsImpl): (WebCore::GraphicsContextGLOpenGL::getBufferSubData): (WebCore::GraphicsContextGLOpenGL::getActiveUniforms): (WebCore::GraphicsContextGLOpenGL::getQueryObjectui): (WebCore::GraphicsContextGLOpenGL::getSamplerParameterf): (WebCore::GraphicsContextGLOpenGL::getSamplerParameteri): (WebCore::GraphicsContextGLOpenGL::getSynci): * platform/graphics/cocoa/GraphicsContextGLIOSurfaceSwapChain.cpp: Added. * platform/graphics/cocoa/GraphicsContextGLIOSurfaceSwapChain.h: Copied from Source/WebCore/platform/graphics/cocoa/WebGLLayer.h. * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm: (WebCore::InitializeEGLDisplay): (WebCore::GraphicsContextGLOpenGL::create): (WebCore::GraphicsContextGLOpenGL::createShared): (WebCore::GraphicsContextGLOpenGL::createForGPUProcess): (WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL): (WebCore::GraphicsContextGLOpenGL::~GraphicsContextGLOpenGL): (WebCore::GraphicsContextGLOpenGL::reshapeDisplayBufferBacking): (WebCore::GraphicsContextGLOpenGL::allocateAndBindDisplayBufferBacking): (WebCore::GraphicsContextGLOpenGL::allowOfflineRenderers const): (WebCore::GraphicsContextGLOpenGL::prepareForDisplay): * platform/graphics/cocoa/RemoteGraphicsContextGLProxyBaseCocoa.mm: Added. (WebCore::RemoteGraphicsContextGLProxyBase::platformInitialize): (WebCore::RemoteGraphicsContextGLProxyBase::platformLayer const): (WebCore::RemoteGraphicsContextGLProxyBase::asCV): (WebCore::RemoteGraphicsContextGLProxyBase::platformSwapChain): * platform/graphics/cocoa/WebGLLayer.h: * platform/graphics/cocoa/WebGLLayer.mm: (-[WebGLLayer initWithDevicePixelRatio:contentsOpaque:]): (-[WebGLLayer swapChain]): (-[WebGLLayer prepareForDisplay]): (-[WebGLLayer display]): (WebGLLayerSwapChain::present): * platform/graphics/coreimage/FilterEffectRendererCoreImage.mm: * platform/graphics/opengl/ExtensionsGLOpenGL.cpp: (WebCore::ExtensionsGLOpenGL::blitFramebufferANGLE): (WebCore::ExtensionsGLOpenGL::renderbufferStorageMultisampleANGLE): (WebCore::ExtensionsGLOpenGL::drawArraysInstancedANGLE): (WebCore::ExtensionsGLOpenGL::drawElementsInstancedANGLE): (WebCore::ExtensionsGLOpenGL::vertexAttribDivisorANGLE): * platform/graphics/opengl/ExtensionsGLOpenGL.h: * platform/graphics/opengl/ExtensionsGLOpenGLCommon.cpp: (WebCore::ExtensionsGLOpenGLCommon::readnPixelsRobustANGLE): * platform/graphics/opengl/ExtensionsGLOpenGLCommon.h: * platform/graphics/opengl/ExtensionsGLOpenGLES.cpp: (WebCore::ExtensionsGLOpenGLES::blitFramebufferANGLE): (WebCore::ExtensionsGLOpenGLES::renderbufferStorageMultisampleANGLE): (WebCore::ExtensionsGLOpenGLES::drawArraysInstancedANGLE): (WebCore::ExtensionsGLOpenGLES::drawElementsInstancedANGLE): (WebCore::ExtensionsGLOpenGLES::vertexAttribDivisorANGLE): * platform/graphics/opengl/ExtensionsGLOpenGLES.h: * platform/graphics/opengl/GraphicsContextGLOpenGL.h: * platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp: (WebCore::GraphicsContextGLOpenGL::drawArraysInstanced): (WebCore::GraphicsContextGLOpenGL::drawElementsInstanced): (WebCore::GraphicsContextGLOpenGL::vertexAttribDivisor): (WebCore::GraphicsContextGLOpenGL::getBufferSubData): (WebCore::GraphicsContextGLOpenGL::getQueryObjectui): (WebCore::GraphicsContextGLOpenGL::getSamplerParameterf): (WebCore::GraphicsContextGLOpenGL::getSamplerParameteri): (WebCore::GraphicsContextGLOpenGL::getSynci): (WebCore::GraphicsContextGLOpenGL::getActiveUniforms): * platform/graphics/opengl/GraphicsContextGLOpenGLES.cpp: (WebCore::GraphicsContextGLOpenGL::reshapeFBOs): Source/WebKit: Implement RemoteWebGLBackend https://bugs.webkit.org/show_bug.cgi?id=217216 <rdar://problem/69876258> Patch by Kimmo Kinnunen <kkinnunen@apple.com> on 2020-12-09 Reviewed by Simon Fraser. Implements a beginning of a remote version of GraphicsContextGL for GPU process. Current implementation is using WebKit IPC. Implemented with a generator script implementing the IPC to pass the GraphicsContextGL member function calls from web process to the GPU process. The script is run during development time and the results are committed to the repo for ease of review. Implement the RemoteGraphicsContextGL in WebKit side. This class will forward calls received via IPC to the GraphicsContextGLOpenGL. At the moment RemoteGraphicsContextGL instance is a direct child of GPUConnectionToWebProcess. Compositing is implemented only for PLATFORM(COCOA). Missing: - Simulated context loss - Simulated context change - Paint WebGL contents to 2D canvas - Upload video to WebGL - Upload canvas to WebGL * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * GPUProcess/GPUConnectionToWebProcess.cpp: (WebKit::GPUConnectionToWebProcess::createGraphicsContextGL): (WebKit::GPUConnectionToWebProcess::releaseGraphicsContextGL): * GPUProcess/GPUConnectionToWebProcess.h: * GPUProcess/GPUConnectionToWebProcess.messages.in: * GPUProcess/graphics/RemoteGraphicsContextGL.cpp: Added. (WebKit::RemoteGraphicsContextGL::create): (WebKit::RemoteGraphicsContextGL::RemoteGraphicsContextGL): (WebKit::RemoteGraphicsContextGL::~RemoteGraphicsContextGL): (WebKit::RemoteGraphicsContextGL::gpuConnectionToWebProcess const): (WebKit::RemoteGraphicsContextGL::messageSenderConnection const): (WebKit::RemoteGraphicsContextGL::messageSenderDestinationID const): (WebKit::RemoteGraphicsContextGL::didComposite): (WebKit::RemoteGraphicsContextGL::forceContextLost): (WebKit::RemoteGraphicsContextGL::recycleContext): (WebKit::RemoteGraphicsContextGL::dispatchContextChangedNotification): (WebKit::RemoteGraphicsContextGL::recycleBuffer): (WebKit::RemoteGraphicsContextGL::present): (WebKit::RemoteGraphicsContextGL::detachClient): (WebKit::RemoteGraphicsContextGL::reshape): (WebKit::RemoteGraphicsContextGL::prepareForDisplay): (WebKit::RemoteGraphicsContextGL::ensureExtensionEnabled): (WebKit::RemoteGraphicsContextGL::notifyMarkContextChanged): * GPUProcess/graphics/RemoteGraphicsContextGL.h: Added. * GPUProcess/graphics/RemoteGraphicsContextGL.messages.in: Added. * GPUProcess/graphics/RemoteGraphicsContextGLFunctionsGenerated.h: Added. (setFailNextGPUStatusCheck): (synthesizeGLError): (moveErrorsToSyntheticErrorList): (activeTexture): (attachShader): (bindAttribLocation): (bindBuffer): (bindFramebuffer): (bindRenderbuffer): (bindTexture): (blendColor): (blendEquation): (blendEquationSeparate): (blendFunc): (blendFuncSeparate): (checkFramebufferStatus): (clear): (clearColor): (clearDepth): (clearStencil): (colorMask): (compileShader): (copyTexImage2D): (copyTexSubImage2D): (createBuffer): (createFramebuffer): (createProgram): (createRenderbuffer): (createShader): (createTexture): (cullFace): (deleteBuffer): (deleteFramebuffer): (deleteProgram): (deleteRenderbuffer): (deleteShader): (deleteTexture): (depthFunc): (depthMask): (depthRange): (detachShader): (disable): (disableVertexAttribArray): (drawArrays): (drawElements): (enable): (enableVertexAttribArray): (finish): (flush): (framebufferRenderbuffer): (framebufferTexture2D): (frontFace): (generateMipmap): (getActiveAttrib): (getActiveUniform): (getAttribLocation): (getBufferParameteri): (getString): (getFloatv): (getIntegerv): (getInteger64): (getInteger64i): (getProgrami): (getBooleanv): (getError): (getFramebufferAttachmentParameteri): (getProgramInfoLog): (getRenderbufferParameteri): (getShaderi): (getShaderInfoLog): (getShaderPrecisionFormat): (getShaderSource): (getTexParameterf): (getTexParameteri): (getUniformfv): (getUniformiv): (getUniformuiv): (getUniformLocation): (getVertexAttribOffset): (hint): (isBuffer): (isEnabled): (isFramebuffer): (isProgram): (isRenderbuffer): (isShader): (isTexture): (lineWidth): (linkProgram): (pixelStorei): (polygonOffset): (renderbufferStorage): (sampleCoverage): (scissor): (shaderSource): (stencilFunc): (stencilFuncSeparate): (stencilMask): (stencilMaskSeparate): (stencilOp): (stencilOpSeparate): (texParameterf): (texParameteri): (uniform1f): (uniform1fv): (uniform1i): (uniform1iv): (uniform2f): (uniform2fv): (uniform2i): (uniform2iv): (uniform3f): (uniform3fv): (uniform3i): (uniform3iv): (uniform4f): (uniform4fv): (uniform4i): (uniform4iv): (uniformMatrix2fv): (uniformMatrix3fv): (uniformMatrix4fv): (useProgram): (validateProgram): (vertexAttrib1f): (vertexAttrib1fv): (vertexAttrib2f): (vertexAttrib2fv): (vertexAttrib3f): (vertexAttrib3fv): (vertexAttrib4f): (vertexAttrib4fv): (vertexAttribPointer): (viewport): (bufferData0): (bufferData1): (bufferSubData): (readnPixels0): (readnPixels1): (texImage2D0): (texImage2D1): (texSubImage2D0): (texSubImage2D1): (compressedTexImage2D0): (compressedTexImage2D1): (compressedTexSubImage2D0): (compressedTexSubImage2D1): (drawArraysInstanced): (drawElementsInstanced): (vertexAttribDivisor): (createVertexArray): (deleteVertexArray): (isVertexArray): (bindVertexArray): (copyBufferSubData): (getBufferSubData): (blitFramebuffer): (framebufferTextureLayer): (invalidateFramebuffer): (invalidateSubFramebuffer): (readBuffer): (renderbufferStorageMultisample): (texStorage2D): (texStorage3D): (texImage3D0): (texImage3D1): (texSubImage3D0): (texSubImage3D1): (copyTexSubImage3D): (compressedTexImage3D0): (compressedTexImage3D1): (compressedTexSubImage3D0): (compressedTexSubImage3D1): (getFragDataLocation): (uniform1ui): (uniform2ui): (uniform3ui): (uniform4ui): (uniform1uiv): (uniform2uiv): (uniform3uiv): (uniform4uiv): (uniformMatrix2x3fv): (uniformMatrix3x2fv): (uniformMatrix2x4fv): (uniformMatrix4x2fv): (uniformMatrix3x4fv): (uniformMatrix4x3fv): (vertexAttribI4i): (vertexAttribI4iv): (vertexAttribI4ui): (vertexAttribI4uiv): (vertexAttribIPointer): (drawRangeElements): (drawBuffers): (clearBufferiv): (clearBufferuiv): (clearBufferfv): (clearBufferfi): (createQuery): (deleteQuery): (isQuery): (beginQuery): (endQuery): (getQuery): (getQueryObjectui): (createSampler): (deleteSampler): (isSampler): (bindSampler): (samplerParameteri): (samplerParameterf): (getSamplerParameterf): (getSamplerParameteri): (fenceSync): (isSync): (deleteSync): (clientWaitSync): (waitSync): (getSynci): (createTransformFeedback): (deleteTransformFeedback): (isTransformFeedback): (bindTransformFeedback): (beginTransformFeedback): (endTransformFeedback): (transformFeedbackVaryings): (getTransformFeedbackVarying): (pauseTransformFeedback): (resumeTransformFeedback): (bindBufferBase): (bindBufferRange): (getUniformIndices): (getActiveUniforms): (getUniformBlockIndex): (getActiveUniformBlockName): (uniformBlockBinding): (getActiveUniformBlockiv): (getGraphicsResetStatusARB): (blitFramebufferANGLE): (renderbufferStorageMultisampleANGLE): (createVertexArrayOES): (deleteVertexArrayOES): (isVertexArrayOES): (bindVertexArrayOES): (getTranslatedShaderSourceANGLE): (insertEventMarkerEXT): (pushGroupMarkerEXT): (popGroupMarkerEXT): (drawBuffersEXT): (drawArraysInstancedANGLE): (drawElementsInstancedANGLE): (vertexAttribDivisorANGLE): * GPUProcess/mac/GPUProcessMac.mm: (WebKit::GPUProcess::initializeProcess): * GPUProcess/media/RemoteLegacyCDMProxy.h: * GPUProcess/media/RemoteLegacyCDMSessionProxy.cpp: * GPUProcess/media/RemoteMediaResourceManager.cpp: * GPUProcess/media/RemoteMediaResourceManager.h: * GPUProcess/media/RemoteMediaSourceProxy.h: * GPUProcess/media/RemoteSourceBufferProxy.cpp: * GPUProcess/media/RemoteSourceBufferProxy.h: * GPUProcess/webrtc/LibWebRTCCodecsProxy.h: * GPUProcess/webrtc/LibWebRTCCodecsProxy.mm: * GPUProcess/webrtc/RemoteMediaRecorder.h: * NetworkProcess/CustomProtocols/Cocoa/LegacyCustomProtocolManagerCocoa.mm: * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.h: * NetworkProcess/Downloads/Download.cpp: * NetworkProcess/Downloads/Download.h: * NetworkProcess/Downloads/DownloadManager.cpp: * NetworkProcess/Downloads/DownloadManager.h: * NetworkProcess/NetworkSocketChannel.cpp: * NetworkProcess/NetworkSocketChannel.h: * NetworkProcess/NetworkSocketStream.cpp: * NetworkProcess/NetworkSocketStream.h: * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h: * NetworkProcess/WebSocketTask.h: * NetworkProcess/cocoa/WebSocketTaskCocoa.h: * NetworkProcess/cocoa/WebSocketTaskCocoa.mm: * NetworkProcess/soup/WebSocketTaskSoup.cpp: * NetworkProcess/soup/WebSocketTaskSoup.h: * Platform/IPC/ArgumentCoders.h: * Platform/IPC/ArrayReference.h: Copied from Source/WebKit/Platform/IPC/DataReference.h. (IPC::ArrayReference::ArrayReference): (IPC::ArrayReference::isEmpty const): (IPC::ArrayReference::size const): (IPC::ArrayReference::data const): (IPC::ArrayReference::vector const): * Platform/IPC/Connection.h: (IPC::Connection::sendSync): * Platform/IPC/DataReference.h: * Platform/IPC/Decoder.cpp: (IPC::Decoder::decodeFixedLengthReference): * Platform/IPC/Decoder.h: * Platform/IPC/Encoder.cpp: (IPC::Encoder::wrapForTesting): * Platform/IPC/Encoder.h: * Platform/IPC/HandleMessage.h: * Platform/IPC/MessageSender.h: (IPC::MessageSender::sendSync): * Platform/IPC/SharedBufferCopy.cpp: (IPC::SharedBufferCopy::decode): * Platform/IPC/SharedBufferDataReference.cpp: * Platform/IPC/StringReference.cpp: * PluginProcess/PluginControllerProxy.cpp: * PluginProcess/PluginControllerProxy.h: * Scripts/webkit/messages.py: * Shared/API/APIData.cpp: * Shared/AuxiliaryProcess.h: * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder<WebCore::GraphicsContextGLAttributes>::encode): (IPC::ArgumentCoder<WebCore::GraphicsContextGLAttributes>::decode): (IPC::ArgumentCoder<WebCore::GraphicsContextGL::ActiveInfo>::encode): (IPC::ArgumentCoder<WebCore::GraphicsContextGL::ActiveInfo>::decode): * Shared/WebCoreArgumentCoders.h: * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode const): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: * Shared/cf/ArgumentCodersCF.cpp: * Shared/soup/WebCoreArgumentCodersSoup.cpp: (IPC::ArgumentCoder<CertificateInfo>::encode): (IPC::ArgumentCoder<CertificateInfo>::decode): * Sources.txt: * SourcesCocoa.txt: * UIProcess/API/APIIconLoadingClient.h: * UIProcess/AuxiliaryProcessProxy.h: (WebKit::AuxiliaryProcessProxy::sendSync): * UIProcess/Cocoa/SOAuthorization/SubFrameSOAuthorizationSession.h: * UIProcess/Network/CustomProtocols/LegacyCustomProtocolManagerProxy.h: * UIProcess/PageClient.h: * UIProcess/UserContent/WebUserContentControllerProxy.cpp: * UIProcess/UserContent/WebUserContentControllerProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::creationParameters): * UIProcess/WebPageProxy.h: * UIProcess/WebURLSchemeHandler.h: * UIProcess/WebURLSchemeTask.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/ApplePay/WebPaymentCoordinator.h: * WebProcess/GPU/GPUProcessConnection.h: * WebProcess/GPU/graphics/GraphicsContextGLIdentifier.h: Renamed from Source/WebKit/Platform/IPC/DataReference.cpp. * WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp: Added. (WebKit::RemoteGraphicsContextGLProxy::create): (WebKit::RemoteGraphicsContextGLProxy::RemoteGraphicsContextGLProxy): (WebKit::RemoteGraphicsContextGLProxy::~RemoteGraphicsContextGLProxy): (WebKit::RemoteGraphicsContextGLProxy::messageSenderConnection const): (WebKit::RemoteGraphicsContextGLProxy::messageSenderDestinationID const): (WebKit::RemoteGraphicsContextGLProxy::reshape): (WebKit::RemoteGraphicsContextGLProxy::prepareForDisplay): (WebKit::RemoteGraphicsContextGLProxy::ensureExtensionEnabled): (WebKit::RemoteGraphicsContextGLProxy::notifyMarkContextChanged): (WebKit::RemoteGraphicsContextGLProxy::simulateContextChanged): (WebKit::RemoteGraphicsContextGLProxy::paintRenderingResultsToCanvas): (WebKit::RemoteGraphicsContextGLProxy::paintRenderingResultsToImageData): (WebKit::RemoteGraphicsContextGLProxy::wasCreated): (WebKit::RemoteGraphicsContextGLProxy::wasLost): (WebKit::RemoteGraphicsContextGLProxy::wasChanged): (WebKit::RemoteGraphicsContextGLProxy::waitUntilInitialized): * WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.h: Added. * WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.messages.in: Copied from Source/WebKit/GPUProcess/GPUConnectionToWebProcess.messages.in. * WebProcess/GPU/graphics/RemoteGraphicsContextGLProxyFunctionsGenerated.cpp: Added. (WebKit::RemoteGraphicsContextGLProxy::setFailNextGPUStatusCheck): (WebKit::RemoteGraphicsContextGLProxy::synthesizeGLError): (WebKit::RemoteGraphicsContextGLProxy::moveErrorsToSyntheticErrorList): (WebKit::RemoteGraphicsContextGLProxy::activeTexture): (WebKit::RemoteGraphicsContextGLProxy::attachShader): (WebKit::RemoteGraphicsContextGLProxy::bindAttribLocation): (WebKit::RemoteGraphicsContextGLProxy::bindBuffer): (WebKit::RemoteGraphicsContextGLProxy::bindFramebuffer): (WebKit::RemoteGraphicsContextGLProxy::bindRenderbuffer): (WebKit::RemoteGraphicsContextGLProxy::bindTexture): (WebKit::RemoteGraphicsContextGLProxy::blendColor): (WebKit::RemoteGraphicsContextGLProxy::blendEquation): (WebKit::RemoteGraphicsContextGLProxy::blendEquationSeparate): (WebKit::RemoteGraphicsContextGLProxy::blendFunc): (WebKit::RemoteGraphicsContextGLProxy::blendFuncSeparate): (WebKit::RemoteGraphicsContextGLProxy::checkFramebufferStatus): (WebKit::RemoteGraphicsContextGLProxy::clear): (WebKit::RemoteGraphicsContextGLProxy::clearColor): (WebKit::RemoteGraphicsContextGLProxy::clearDepth): (WebKit::RemoteGraphicsContextGLProxy::clearStencil): (WebKit::RemoteGraphicsContextGLProxy::colorMask): (WebKit::RemoteGraphicsContextGLProxy::compileShader): (WebKit::RemoteGraphicsContextGLProxy::copyTexImage2D): (WebKit::RemoteGraphicsContextGLProxy::copyTexSubImage2D): (WebKit::RemoteGraphicsContextGLProxy::createBuffer): (WebKit::RemoteGraphicsContextGLProxy::createFramebuffer): (WebKit::RemoteGraphicsContextGLProxy::createProgram): (WebKit::RemoteGraphicsContextGLProxy::createRenderbuffer): (WebKit::RemoteGraphicsContextGLProxy::createShader): (WebKit::RemoteGraphicsContextGLProxy::createTexture): (WebKit::RemoteGraphicsContextGLProxy::cullFace): (WebKit::RemoteGraphicsContextGLProxy::deleteBuffer): (WebKit::RemoteGraphicsContextGLProxy::deleteFramebuffer): (WebKit::RemoteGraphicsContextGLProxy::deleteProgram): (WebKit::RemoteGraphicsContextGLProxy::deleteRenderbuffer): (WebKit::RemoteGraphicsContextGLProxy::deleteShader): (WebKit::RemoteGraphicsContextGLProxy::deleteTexture): (WebKit::RemoteGraphicsContextGLProxy::depthFunc): (WebKit::RemoteGraphicsContextGLProxy::depthMask): (WebKit::RemoteGraphicsContextGLProxy::depthRange): (WebKit::RemoteGraphicsContextGLProxy::detachShader): (WebKit::RemoteGraphicsContextGLProxy::disable): (WebKit::RemoteGraphicsContextGLProxy::disableVertexAttribArray): (WebKit::RemoteGraphicsContextGLProxy::drawArrays): (WebKit::RemoteGraphicsContextGLProxy::drawElements): (WebKit::RemoteGraphicsContextGLProxy::enable): (WebKit::RemoteGraphicsContextGLProxy::enableVertexAttribArray): (WebKit::RemoteGraphicsContextGLProxy::finish): (WebKit::RemoteGraphicsContextGLProxy::flush): (WebKit::RemoteGraphicsContextGLProxy::framebufferRenderbuffer): (WebKit::RemoteGraphicsContextGLProxy::framebufferTexture2D): (WebKit::RemoteGraphicsContextGLProxy::frontFace): (WebKit::RemoteGraphicsContextGLProxy::generateMipmap): (WebKit::RemoteGraphicsContextGLProxy::getActiveAttrib): (WebKit::RemoteGraphicsContextGLProxy::getActiveUniform): (WebKit::RemoteGraphicsContextGLProxy::getAttribLocation): (WebKit::RemoteGraphicsContextGLProxy::getBufferParameteri): (WebKit::RemoteGraphicsContextGLProxy::getString): (WebKit::RemoteGraphicsContextGLProxy::getFloatv): (WebKit::RemoteGraphicsContextGLProxy::getIntegerv): (WebKit::RemoteGraphicsContextGLProxy::getInteger64): (WebKit::RemoteGraphicsContextGLProxy::getInteger64i): (WebKit::RemoteGraphicsContextGLProxy::getProgrami): (WebKit::RemoteGraphicsContextGLProxy::getBooleanv): (WebKit::RemoteGraphicsContextGLProxy::getError): (WebKit::RemoteGraphicsContextGLProxy::getFramebufferAttachmentParameteri): (WebKit::RemoteGraphicsContextGLProxy::getProgramInfoLog): (WebKit::RemoteGraphicsContextGLProxy::getRenderbufferParameteri): (WebKit::RemoteGraphicsContextGLProxy::getShaderi): (WebKit::RemoteGraphicsContextGLProxy::getShaderInfoLog): (WebKit::RemoteGraphicsContextGLProxy::getShaderPrecisionFormat): (WebKit::RemoteGraphicsContextGLProxy::getShaderSource): (WebKit::RemoteGraphicsContextGLProxy::getTexParameterf): (WebKit::RemoteGraphicsContextGLProxy::getTexParameteri): (WebKit::RemoteGraphicsContextGLProxy::getUniformfv): (WebKit::RemoteGraphicsContextGLProxy::getUniformiv): (WebKit::RemoteGraphicsContextGLProxy::getUniformuiv): (WebKit::RemoteGraphicsContextGLProxy::getUniformLocation): (WebKit::RemoteGraphicsContextGLProxy::getVertexAttribOffset): (WebKit::RemoteGraphicsContextGLProxy::hint): (WebKit::RemoteGraphicsContextGLProxy::isBuffer): (WebKit::RemoteGraphicsContextGLProxy::isEnabled): (WebKit::RemoteGraphicsContextGLProxy::isFramebuffer): (WebKit::RemoteGraphicsContextGLProxy::isProgram): (WebKit::RemoteGraphicsContextGLProxy::isRenderbuffer): (WebKit::RemoteGraphicsContextGLProxy::isShader): (WebKit::RemoteGraphicsContextGLProxy::isTexture): (WebKit::RemoteGraphicsContextGLProxy::lineWidth): (WebKit::RemoteGraphicsContextGLProxy::linkProgram): (WebKit::RemoteGraphicsContextGLProxy::pixelStorei): (WebKit::RemoteGraphicsContextGLProxy::polygonOffset): (WebKit::RemoteGraphicsContextGLProxy::renderbufferStorage): (WebKit::RemoteGraphicsContextGLProxy::sampleCoverage): (WebKit::RemoteGraphicsContextGLProxy::scissor): (WebKit::RemoteGraphicsContextGLProxy::shaderSource): (WebKit::RemoteGraphicsContextGLProxy::stencilFunc): (WebKit::RemoteGraphicsContextGLProxy::stencilFuncSeparate): (WebKit::RemoteGraphicsContextGLProxy::stencilMask): (WebKit::RemoteGraphicsContextGLProxy::stencilMaskSeparate): (WebKit::RemoteGraphicsContextGLProxy::stencilOp): (WebKit::RemoteGraphicsContextGLProxy::stencilOpSeparate): (WebKit::RemoteGraphicsContextGLProxy::texParameterf): (WebKit::RemoteGraphicsContextGLProxy::texParameteri): (WebKit::RemoteGraphicsContextGLProxy::uniform1f): (WebKit::RemoteGraphicsContextGLProxy::uniform1fv): (WebKit::RemoteGraphicsContextGLProxy::uniform1i): (WebKit::RemoteGraphicsContextGLProxy::uniform1iv): (WebKit::RemoteGraphicsContextGLProxy::uniform2f): (WebKit::RemoteGraphicsContextGLProxy::uniform2fv): (WebKit::RemoteGraphicsContextGLProxy::uniform2i): (WebKit::RemoteGraphicsContextGLProxy::uniform2iv): (WebKit::RemoteGraphicsContextGLProxy::uniform3f): (WebKit::RemoteGraphicsContextGLProxy::uniform3fv): (WebKit::RemoteGraphicsContextGLProxy::uniform3i): (WebKit::RemoteGraphicsContextGLProxy::uniform3iv): (WebKit::RemoteGraphicsContextGLProxy::uniform4f): (WebKit::RemoteGraphicsContextGLProxy::uniform4fv): (WebKit::RemoteGraphicsContextGLProxy::uniform4i): (WebKit::RemoteGraphicsContextGLProxy::uniform4iv): (WebKit::RemoteGraphicsContextGLProxy::uniformMatrix2fv): (WebKit::RemoteGraphicsContextGLProxy::uniformMatrix3fv): (WebKit::RemoteGraphicsContextGLProxy::uniformMatrix4fv): (WebKit::RemoteGraphicsContextGLProxy::useProgram): (WebKit::RemoteGraphicsContextGLProxy::validateProgram): (WebKit::RemoteGraphicsContextGLProxy::vertexAttrib1f): (WebKit::RemoteGraphicsContextGLProxy::vertexAttrib1fv): (WebKit::RemoteGraphicsContextGLProxy::vertexAttrib2f): (WebKit::RemoteGraphicsContextGLProxy::vertexAttrib2fv): (WebKit::RemoteGraphicsContextGLProxy::vertexAttrib3f): (WebKit::RemoteGraphicsContextGLProxy::vertexAttrib3fv): (WebKit::RemoteGraphicsContextGLProxy::vertexAttrib4f): (WebKit::RemoteGraphicsContextGLProxy::vertexAttrib4fv): (WebKit::RemoteGraphicsContextGLProxy::vertexAttribPointer): (WebKit::RemoteGraphicsContextGLProxy::viewport): (WebKit::RemoteGraphicsContextGLProxy::bufferData): (WebKit::RemoteGraphicsContextGLProxy::bufferSubData): (WebKit::RemoteGraphicsContextGLProxy::readnPixels): (WebKit::RemoteGraphicsContextGLProxy::texImage2D): (WebKit::RemoteGraphicsContextGLProxy::texSubImage2D): (WebKit::RemoteGraphicsContextGLProxy::compressedTexImage2D): (WebKit::RemoteGraphicsContextGLProxy::compressedTexSubImage2D): (WebKit::RemoteGraphicsContextGLProxy::drawArraysInstanced): (WebKit::RemoteGraphicsContextGLProxy::drawElementsInstanced): (WebKit::RemoteGraphicsContextGLProxy::vertexAttribDivisor): (WebKit::RemoteGraphicsContextGLProxy::createVertexArray): (WebKit::RemoteGraphicsContextGLProxy::deleteVertexArray): (WebKit::RemoteGraphicsContextGLProxy::isVertexArray): (WebKit::RemoteGraphicsContextGLProxy::bindVertexArray): (WebKit::RemoteGraphicsContextGLProxy::copyBufferSubData): (WebKit::RemoteGraphicsContextGLProxy::getBufferSubData): (WebKit::RemoteGraphicsContextGLProxy::blitFramebuffer): (WebKit::RemoteGraphicsContextGLProxy::framebufferTextureLayer): (WebKit::RemoteGraphicsContextGLProxy::invalidateFramebuffer): (WebKit::RemoteGraphicsContextGLProxy::invalidateSubFramebuffer): (WebKit::RemoteGraphicsContextGLProxy::readBuffer): (WebKit::RemoteGraphicsContextGLProxy::renderbufferStorageMultisample): (WebKit::RemoteGraphicsContextGLProxy::texStorage2D): (WebKit::RemoteGraphicsContextGLProxy::texStorage3D): (WebKit::RemoteGraphicsContextGLProxy::texImage3D): (WebKit::RemoteGraphicsContextGLProxy::texSubImage3D): (WebKit::RemoteGraphicsContextGLProxy::copyTexSubImage3D): (WebKit::RemoteGraphicsContextGLProxy::compressedTexImage3D): (WebKit::RemoteGraphicsContextGLProxy::compressedTexSubImage3D): (WebKit::RemoteGraphicsContextGLProxy::getFragDataLocation): (WebKit::RemoteGraphicsContextGLProxy::uniform1ui): (WebKit::RemoteGraphicsContextGLProxy::uniform2ui): (WebKit::RemoteGraphicsContextGLProxy::uniform3ui): (WebKit::RemoteGraphicsContextGLProxy::uniform4ui): (WebKit::RemoteGraphicsContextGLProxy::uniform1uiv): (WebKit::RemoteGraphicsContextGLProxy::uniform2uiv): (WebKit::RemoteGraphicsContextGLProxy::uniform3uiv): (WebKit::RemoteGraphicsContextGLProxy::uniform4uiv): (WebKit::RemoteGraphicsContextGLProxy::uniformMatrix2x3fv): (WebKit::RemoteGraphicsContextGLProxy::uniformMatrix3x2fv): (WebKit::RemoteGraphicsContextGLProxy::uniformMatrix2x4fv): (WebKit::RemoteGraphicsContextGLProxy::uniformMatrix4x2fv): (WebKit::RemoteGraphicsContextGLProxy::uniformMatrix3x4fv): (WebKit::RemoteGraphicsContextGLProxy::uniformMatrix4x3fv): (WebKit::RemoteGraphicsContextGLProxy::vertexAttribI4i): (WebKit::RemoteGraphicsContextGLProxy::vertexAttribI4iv): (WebKit::RemoteGraphicsContextGLProxy::vertexAttribI4ui): (WebKit::RemoteGraphicsContextGLProxy::vertexAttribI4uiv): (WebKit::RemoteGraphicsContextGLProxy::vertexAttribIPointer): (WebKit::RemoteGraphicsContextGLProxy::drawRangeElements): (WebKit::RemoteGraphicsContextGLProxy::drawBuffers): (WebKit::RemoteGraphicsContextGLProxy::clearBufferiv): (WebKit::RemoteGraphicsContextGLProxy::clearBufferuiv): (WebKit::RemoteGraphicsContextGLProxy::clearBufferfv): (WebKit::RemoteGraphicsContextGLProxy::clearBufferfi): (WebKit::RemoteGraphicsContextGLProxy::createQuery): (WebKit::RemoteGraphicsContextGLProxy::deleteQuery): (WebKit::RemoteGraphicsContextGLProxy::isQuery): (WebKit::RemoteGraphicsContextGLProxy::beginQuery): (WebKit::RemoteGraphicsContextGLProxy::endQuery): (WebKit::RemoteGraphicsContextGLProxy::getQuery): (WebKit::RemoteGraphicsContextGLProxy::getQueryObjectui): (WebKit::RemoteGraphicsContextGLProxy::createSampler): (WebKit::RemoteGraphicsContextGLProxy::deleteSampler): (WebKit::RemoteGraphicsContextGLProxy::isSampler): (WebKit::RemoteGraphicsContextGLProxy::bindSampler): (WebKit::RemoteGraphicsContextGLProxy::samplerParameteri): (WebKit::RemoteGraphicsContextGLProxy::samplerParameterf): (WebKit::RemoteGraphicsContextGLProxy::getSamplerParameterf): (WebKit::RemoteGraphicsContextGLProxy::getSamplerParameteri): (WebKit::RemoteGraphicsContextGLProxy::fenceSync): (WebKit::RemoteGraphicsContextGLProxy::isSync): (WebKit::RemoteGraphicsContextGLProxy::deleteSync): (WebKit::RemoteGraphicsContextGLProxy::clientWaitSync): (WebKit::RemoteGraphicsContextGLProxy::waitSync): (WebKit::RemoteGraphicsContextGLProxy::getSynci): (WebKit::RemoteGraphicsContextGLProxy::createTransformFeedback): (WebKit::RemoteGraphicsContextGLProxy::deleteTransformFeedback): (WebKit::RemoteGraphicsContextGLProxy::isTransformFeedback): (WebKit::RemoteGraphicsContextGLProxy::bindTransformFeedback): (WebKit::RemoteGraphicsContextGLProxy::beginTransformFeedback): (WebKit::RemoteGraphicsContextGLProxy::endTransformFeedback): (WebKit::RemoteGraphicsContextGLProxy::transformFeedbackVaryings): (WebKit::RemoteGraphicsContextGLProxy::getTransformFeedbackVarying): (WebKit::RemoteGraphicsContextGLProxy::pauseTransformFeedback): (WebKit::RemoteGraphicsContextGLProxy::resumeTransformFeedback): (WebKit::RemoteGraphicsContextGLProxy::bindBufferBase): (WebKit::RemoteGraphicsContextGLProxy::bindBufferRange): (WebKit::RemoteGraphicsContextGLProxy::getUniformIndices): (WebKit::RemoteGraphicsContextGLProxy::getActiveUniforms): (WebKit::RemoteGraphicsContextGLProxy::getUniformBlockIndex): (WebKit::RemoteGraphicsContextGLProxy::getActiveUniformBlockName): (WebKit::RemoteGraphicsContextGLProxy::uniformBlockBinding): (WebKit::RemoteGraphicsContextGLProxy::getActiveUniformBlockiv): (WebKit::RemoteGraphicsContextGLProxy::getGraphicsResetStatusARB): (WebKit::RemoteGraphicsContextGLProxy::blitFramebufferANGLE): (WebKit::RemoteGraphicsContextGLProxy::renderbufferStorageMultisampleANGLE): (WebKit::RemoteGraphicsContextGLProxy::createVertexArrayOES): (WebKit::RemoteGraphicsContextGLProxy::deleteVertexArrayOES): (WebKit::RemoteGraphicsContextGLProxy::isVertexArrayOES): (WebKit::RemoteGraphicsContextGLProxy::bindVertexArrayOES): (WebKit::RemoteGraphicsContextGLProxy::getTranslatedShaderSourceANGLE): (WebKit::RemoteGraphicsContextGLProxy::insertEventMarkerEXT): (WebKit::RemoteGraphicsContextGLProxy::pushGroupMarkerEXT): (WebKit::RemoteGraphicsContextGLProxy::popGroupMarkerEXT): (WebKit::RemoteGraphicsContextGLProxy::drawBuffersEXT): (WebKit::RemoteGraphicsContextGLProxy::drawArraysInstancedANGLE): (WebKit::RemoteGraphicsContextGLProxy::drawElementsInstancedANGLE): (WebKit::RemoteGraphicsContextGLProxy::vertexAttribDivisorANGLE): (WebKit::RemoteGraphicsContextGLProxy::getInternalformativ): (WebKit::RemoteGraphicsContextGLProxy::readPixelsRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::texParameterfvRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::texParameterivRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getQueryivRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getQueryObjectuivRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getBufferPointervRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getInternalformativRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getVertexAttribIivRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getVertexAttribIuivRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getUniformuivRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getBufferParameteri64vRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::samplerParameterivRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::samplerParameterfvRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getSamplerParameterivRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getSamplerParameterfvRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getFramebufferParameterivRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getProgramInterfaceivRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getBooleani_vRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getMultisamplefvRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getTexLevelParameterivRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getTexLevelParameterfvRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getPointervRobustANGLERobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getnUniformfvRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getnUniformivRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getnUniformuivRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::texParameterIivRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::texParameterIuivRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getTexParameterIivRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getTexParameterIuivRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::samplerParameterIivRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::samplerParameterIuivRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getSamplerParameterIivRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getSamplerParameterIuivRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getQueryObjectivRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getQueryObjecti64vRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getQueryObjectui64vRobustANGLE): * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::copyVideoTextureToPlatformTexture): * WebProcess/GPU/media/RemoteAudioDestinationProxy.cpp: (WebKit::RemoteAudioDestinationProxy::connectToGPUProcess): * WebProcess/GPU/media/RemoteAudioSession.cpp: * WebProcess/GPU/media/RemoteAudioSourceProviderManager.cpp: * WebProcess/GPU/media/RemoteAudioSourceProviderManager.h: * WebProcess/GPU/media/RemoteLegacyCDMSession.cpp: * WebProcess/GPU/media/SourceBufferPrivateRemote.h: * WebProcess/GPU/media/TextTrackPrivateRemote.h: * WebProcess/GPU/webrtc/LibWebRTCCodecs.cpp: * WebProcess/GPU/webrtc/LibWebRTCCodecs.h: * WebProcess/InjectedBundle/InjectedBundle.h: * WebProcess/Network/NetworkProcessConnection.h: * WebProcess/Network/WebResourceLoader.cpp: * WebProcess/Network/WebResourceLoader.h: * WebProcess/Network/WebSocketChannel.cpp: * WebProcess/Network/WebSocketChannel.h: * WebProcess/Network/WebSocketStream.cpp: * WebProcess/Network/WebSocketStream.h: * WebProcess/Network/webrtc/LibWebRTCSocket.h: * WebProcess/Plugins/PDF/PDFPlugin.h: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::createGraphicsContextGL const): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::m_limitsNavigationsToAppBoundDomains): (WebKit::WebPage::updatePreferences): * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::sendSyncWithDelayedReply): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::handleEditingKeyboardEvent): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::setUseGPUProcessForWebGL): (WebKit::WebProcess::shouldUseRemoteRenderingForWebGL const): * WebProcess/WebProcess.h: Tools: Implement RemoteGraphicsContextGL https://bugs.webkit.org/show_bug.cgi?id=217216 <rdar://problem/69876258> Patch by Kimmo Kinnunen <kkinnunen@apple.com> on 2020-12-09 Reviewed by Simon Fraser. Implements a remote version of GraphicsContextGL for GPU process. Current implementation is using WebKit IPC and is incomplete. Add the code generator to generate the implementation. Currently the generator generates a WebKit IPC implementation. The input definition to the generator is the proxy implementation header files. The output of the generator is - WebKit IPC message definition file - Message sender code - Message receiver and payload invocation code The generator converts GraphicsContextGL GCGL -prefixed types to sized IPC types. The generator is invoked during development time and the results are stored in the repository. * Scripts/generate-gpup-webgl: Added. LayoutTests: Implement RemoteGraphicsContextGL https://bugs.webkit.org/show_bug.cgi?id=217216 <rdar://problem/69876258> Patch by Kimmo Kinnunen <kkinnunen@apple.com> on 2020-12-09 Reviewed by Simon Fraser. Implements a beginning of a remote version of GraphicsContextGL for GPU process. Current implementation is using WebKit IPC. Adds test expectations for the missing functionality. Does not yet enable the tests that actually pass but which were skipped before the implementation. * gpu-process/TestExpectations: Canonical link: https://commits.webkit.org/232258@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270587 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-12-09 18:32:29 +00:00
platform/graphics/cocoa/GraphicsContextGLIOSurfaceSwapChain.cpp
platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm
Add experimental "alphaChannel" property to VideoConfiguration https://bugs.webkit.org/show_bug.cgi?id=195853 Reviewed by Eric Carlson. Source/WebCore: Test: media/mediacapabilities/mock-decodingInfo-alphaChannel.html Add a new, experimental addition to Media Capabilities to allow pages to query for alpha channel support. * Modules/mediacapabilities/MediaCapabilities.cpp: (WebCore::MediaCapabilities::decodingInfo): * Modules/mediacapabilities/MediaCapabilities.h: * Modules/mediacapabilities/MediaCapabilities.idl: * Modules/mediacapabilities/VideoConfiguration.idl: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/cocoa/VideoToolboxSoftLink.cpp: * platform/cocoa/VideoToolboxSoftLink.h: * platform/graphics/cocoa/HEVCUtilitiesCocoa.h: * platform/graphics/cocoa/HEVCUtilitiesCocoa.mm: Renamed from Source/WebCore/platform/graphics/cocoa/HEVCUtilitiesCocoa.cpp. (WebCore::validateHEVCParameters): * platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.cpp: (WebCore::createMediaPlayerDecodingConfigurationCocoa): * platform/mediacapabilities/VideoConfiguration.h: * platform/mock/MediaEngineConfigurationFactoryMock.cpp: (WebCore::canDecodeMedia): (WebCore::canEncodeMedia): LayoutTests: * media/mediacapabilities/mock-decodingInfo-alphaChannel-expected.txt: Added. * media/mediacapabilities/mock-decodingInfo-alphaChannel.html: Added. Canonical link: https://commits.webkit.org/210178@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243109 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-03-18 22:29:55 +00:00
platform/graphics/cocoa/HEVCUtilitiesCocoa.mm
platform/graphics/cocoa/IOSurface.mm
platform/graphics/cocoa/IOSurfacePoolCocoa.mm
[Cocoa] Simplify NSArray, NSDictionary, and NSNumber idioms throughout WebKit https://bugs.webkit.org/show_bug.cgi?id=210138 Reviewed by Alex Christensen. Source/JavaScriptCore: * API/JSValue.mm: (valueToObjectWithoutCopy): Use @(). (valueToNumber): Ditto. * API/tests/testapi.mm: (-[TestObject callback:]): Use @[], @(), and @{}. (-[TextXYZ click]): Ditto. (testObjectiveCAPIMain): Ditto. Source/WebCore: - Added createNSArray and makeVector. - Use createNSArray and makeVector<String> in many places where we convert between NSArray and Vector, replacing multiple existing functions that were doing the same job before; later can use them even more. - Use @[] many places where we create an autoreleased NSArray. - Use @{} many places where we create an autoreleased NSDictionary. - Use @() many places where we create an autoreleased NSNumber. * PlatformMac.cmake: Moved Float/IntRectMac.mm to Float/IntRectCocoa.mm. * SourcesCocoa.txt: Ditto. * WebCore.xcodeproj/project.pbxproj: Ditto. * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (AXAttributeStringSetBlockquoteLevel): Use @(). (AXAttributeStringSetHeadingLevel): Use @(). (-[WebAccessibilityObjectWrapper textMarkerRangeForSelection]): Use @[]. (-[WebAccessibilityObjectWrapper _stringFromStartMarker:toEndMarker:attributed:]): Use @[]. (-[WebAccessibilityObjectWrapper elementsForRange:]): Use @[]. (-[WebAccessibilityObjectWrapper textMarkersForRange:]): Use @[]. * accessibility/mac/AXObjectCacheMac.mm: (WebCore::textReplacementChangeDictionary): Use @(). * accessibility/mac/WebAccessibilityObjectWrapperBase.mm: (makeVectorElement): Aded overload for AccessibilitySearchKey. (accessibilitySearchCriteriaForSearchPredicateParameterizedAttribute): Use makeVector<AccessibilitySearchKey>. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (accessibilityTextCriteriaForParameterizedAttribute): Use makeVector<String>. (accessibilitySearchTextCriteriaForParameterizedAttribute): Use makeVector<String>. (AXAttributeStringSetStyle): Use @(). (AXAttributeStringSetBlockquoteLevel): Use @(). (AXAttributeStringSetHeadingLevel): Use @(). (-[WebAccessibilityObjectWrapper accessibilityActionNames]): Use @[]. (convertStringsToNSArray): Deleted. (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): Use @(), @[], and createNSArray. (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]): Ditto. * bridge/objc/WebScriptObject.mm: (+[WebScriptObject _convertValueToObjcValue:originRootObject:rootObject:]): Use @(). * editing/cocoa/AlternativeTextUIController.mm: (WebCore::AlternativeTextUIController::alternativesForContext): Use makeVector<String>. * editing/cocoa/HTMLConverter.mm: (defaultParagraphStyle): Use @[]. (HTMLConverter::computedAttributesForElement): Use @(). (HTMLConverter::_processMetaElementWithName): Use @(). (HTMLConverter::_addTableForElement): Use @(). * page/ios/FrameIOS.mm: (WebCore::Frame::interpretationsForCurrentRoot const): Use @[]. * platform/cocoa/MIMETypeRegistryCocoa.mm: (WebCore::MIMETypeRegistry::getExtensionsForMIMEType): Use makeVector<String>. * platform/graphics/FloatRect.h: Added makeNSArrayElement overload so we can convert Vector<FloatRect> into NSArray<NSValue>. * platform/graphics/IntRect.h: Similarly for IntRect. * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm: (WebCore::MediaSelectionGroupAVFObjC::updateOptions): Use createNSArray. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::mediaDescriptionForKind): Use @[]. (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): Use @(). (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem): Use @(). (WebCore::MediaPlayerPrivateAVFoundationObjC::checkPlayability): Use @[]. (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput): Use @{} and @(). * platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm: (WebCore::PlatformCAAnimationCocoa::valueFunction const): (WebCore::PlatformCAAnimationCocoa::setFromValue): (WebCore::PlatformCAAnimationCocoa::copyFromValueFrom): (WebCore::PlatformCAAnimationCocoa::setToValue): (WebCore::PlatformCAAnimationCocoa::copyToValueFrom): (WebCore::PlatformCAAnimationCocoa::setValues): (WebCore::PlatformCAAnimationCocoa::copyValuesFrom): (WebCore::PlatformCAAnimationCocoa::setKeyTimes): (WebCore::PlatformCAAnimationCocoa::copyKeyTimesFrom): (WebCore::PlatformCAAnimationCocoa::setTimingFunctions): (WebCore::PlatformCAAnimationCocoa::copyTimingFunctionsFrom): Use @(), @[], modern for loops, auto, and allocate with capacity. * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm: (WebCore::PlatformCAFilters::filterValueForOperation): Use @(). * platform/graphics/cocoa/FloatRectCocoa.mm: Moved from mac/FloatRectMac.mm. (WebCore::makeNSArrayElement): Added so we can convert Vector<FloatRect> into NSArray<NSValue>. * platform/graphics/cocoa/IntRectCocoa.mm: Moved from mac/IntRectMac.mm. (WebCore::makeNSArrayElement): Similarly for IntRect. (WebCore::enclosingIntRect): Use clampTo to be consistent with what enclosingIntRect(FloatRect) does (while fixing check-webkit-style complaint). * platform/graphics/cocoa/WebGLLayer.mm: (-[WebGLLayer display]): Add WebCore namespace prefix; needed depending on how sources get unified (and was affecting my local build when it temporarily had an additional source file). (-[WebGLLayer allocateIOSurfaceBackingStoreWithSize:usingAlpha:]): Ditto. (-[WebGLLayer bindFramebufferToNextAvailableSurface]): Ditto. * platform/graphics/ios/FontCacheIOS.mm: (WebCore::systemFontModificationAttributes): Use @(). * platform/ios/PlatformPasteboardIOS.mm: (WebCore::PlatformPasteboard::getTypes): Use makeVector<String>. (WebCore::createItemProviderRegistrationList): Use createNSArray. (WebCore::PlatformPasteboard::updateSupportedTypeIdentifiers): Use createNSArray. * platform/ios/WebItemProviderPasteboard.mm: (-[WebItemProviderPasteboard setItemProviders:]): Use @[]. * platform/ios/wak/WAKView.mm: (-[WAKView subviews]): Dittto. * platform/mac/PlatformPasteboardMac.mm: (WebCore::PlatformPasteboard::getTypes): Use makeVector<String>. (WebCore::PlatformPasteboard::getPathnamesForType const): Use makeVector<String>. (WebCore::PlatformPasteboard::addTypes): Use makeVector<String>. (WebCore::PlatformPasteboard::setTypes): Use makeVector<String>. * platform/mac/StringUtilities.h: Removed webCoreStringVectorFromNSStringArray, replaced by makeVector<String> * platform/mac/StringUtilities.mm: (WebCore::webCoreStringVectorFromNSStringArray): Deleted. * platform/mac/WebCoreNSURLExtras.mm: Removed unneeded include. * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: (WebCore::MediaRecorderPrivateWriter::setVideoInput): Use @(). * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::setupCaptureSession): Use @(). * platform/network/cocoa/CookieCocoa.mm: (WebCore::Cookie::operator NSHTTPCookie * _Nullable const): Use @(). * platform/network/cocoa/NetworkStorageSessionCocoa.mm: (WebCore::NetworkStorageSession::setCookiesFromDOM const): Use @{}. * platform/network/cocoa/ResourceRequestCocoa.mm: (WebCore::ResourceRequest::doUpdatePlatformRequest): Use @YES/@NO. Source/WebKit: * 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>. Source/WebKitLegacy/ios: * WebCoreSupport/WebChromeClientIOS.mm: (WebChromeClientIOS::runOpenPanel): Use createNSArray. * WebCoreSupport/WebVisiblePosition.mm: (-[WebVisiblePosition enclosingRangeWithDictationPhraseAlternatives:]): Use createNSArray. * WebCoreSupport/WebVisiblePositionInternal.h: Added #if so that this correctly doesn't compile anything on Mac. * WebView/WebPDFViewIOS.mm: (+[WebPDFView supportedMIMETypes]): Use @[]. Source/WebKitLegacy/mac: * DOM/DOM.mm: (kit): Deleted overload that takes Vector<IntRect>. (-[DOMNode textRects]): Use createNSArray. (-[DOMRange textRects]): Ditto. * DOM/ExceptionHandlers.mm: (raiseDOMErrorException): Use @(). * History/WebBackForwardList.mm: (-[WebBackForwardList dictionaryRepresentation]): Use @{}. * History/WebHistory.mm: (+[WebHistoryPrivate initialize]): Use @{}. (-[WebHistory _sendNotification:entries:]): Use @{}. * History/WebHistoryItem.mm: (-[WebHistoryItem initFromDictionaryRepresentation:]): Use makeVector<String>. (-[WebHistoryItem dictionaryRepresentation:]): Use createNSArray and @(). * History/WebURLsWithTitles.m: (+[WebURLsWithTitles arrayWithIFURLsWithTitlesPboardType]): Use @[]. (+[WebURLsWithTitles writeURLs:andTitles:toPasteboard:]): Use @[]. * Misc/WebCache.mm: (+[WebCache statistics]): Use @[], @{}, and @(). * Misc/WebCoreStatistics.mm: (+[WebCoreStatistics memoryStatistics]): Ditto. * Misc/WebKitErrors.m: (-[NSError _webkit_initWithDomain:code:URL:]): Use @(). (+[NSError _registerWebKitErrors]): Use @(). (-[NSError _initWithPluginErrorCode:contentURL:pluginPageURL:pluginName:MIMEType:]): Use @(). * Misc/WebKitNSStringExtras.mm: (-[NSString _web_drawAtPoint:font:textColor:]): Use @{}. (-[NSString _web_widthWithFont:]): Use @{}. * Misc/WebNSFileManagerExtras.mm: Removed unneeded include. * Misc/WebNSPasteboardExtras.mm: (+[NSPasteboard _web_dragTypesForURL]): Use @[]. (-[NSPasteboard _web_writeURL:andTitle:types:]): Use @[]. (+[NSPasteboard _web_setFindPasteboardString:withOwner:]): Use @[]. * Misc/WebNSURLExtras.mm: Removed unneeded include. * Plugins/Hosted/NetscapePluginHostManager.mm: (WebKit::NetscapePluginHostManager::spawnPluginHost): Use @{}. * Plugins/Hosted/NetscapePluginHostProxy.mm: (WKPCIdentifierInfo): Use @(). * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::addValueToArray): Use @(). * Plugins/Hosted/WebHostedNetscapePluginView.mm: Removed unneeded include. * Plugins/WebBasePluginPackage.mm: Ditto. * Plugins/WebPluginContainerCheck.mm: (-[WebPluginContainerCheck _actionInformationWithURL:]): Use @{}. * Plugins/WebPluginDatabase.mm: (+[WebPluginDatabase _defaultPlugInPaths]): Use @[]. * Storage/WebDatabaseManager.mm: (-[WebDatabaseManager databasesWithOrigin:]): Use createNSArray. * WebCoreSupport/CorrectionPanel.mm: (CorrectionPanel::show): Use createNSArray. * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::addMessageToConsole): Use @(). * WebCoreSupport/WebEditorClient.mm: (attributesForAttributedStringConversion): Use @(). (WebEditorClient::getGuessesForWord): Use makeVector<String>. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::actionDictionary const): Use @(). (kit): Deleted overload that takes Vector<String>. (pluginView): Use @{}. (WebFrameLoaderClient::createPlugin): Use createNSArray, @{}, and @(). (WebFrameLoaderClient::createJavaAppletWidget): Use createNSArray. * WebCoreSupport/WebOpenPanelResultListener.mm: (-[WebOpenPanelResultListener chooseFilenames:]): Use makeVector<String>. (-[WebOpenPanelResultListener chooseFilename:displayString:iconImage:]): Use @[]. (-[WebOpenPanelResultListener chooseFilenames:displayString:iconImage:]): Use makeVector<String>. * WebCoreSupport/WebSelectionServiceController.mm: (WebSelectionServiceController::handleSelectionServiceClick): Comment out an unused argument. * WebView/WebFrame.mm: (-[WebFrame _rectsForRange:]): Use createNSArrray. (-[WebFrame _computePageRectsWithPrintScaleFactor:pageSize:]): Use createNSArray and @[]. (-[WebFrame childFrames]): Use @[]. * WebView/WebHTMLView.mm: (+[WebHTMLView _selectionPasteboardTypes]): Use @[]. (-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]): Use @[]. (-[WebHTMLView knowsPageRange:]): Use @[]. (-[WebHTMLView accessibilityAttributeValue:]): Use @[]. (-[WebHTMLView copyFont:]): Use @[]. (-[WebHTMLView _interpretKeyEvent:savingCommands:]): Use @[]. (-[WebHTMLView selectionTextRects]): Use createNSArray. (-[WebHTMLView rectsForTextMatches]): Use createNSArray and @[]. * WebView/WebPDFRepresentation.mm: Removed unneeded include. (+[WebPDFRepresentation postScriptMIMETypes]): Use @[]. (+[WebPDFRepresentation supportedMIMETypes]): Use @[]. * WebView/WebPDFView.mm: (-[WebPDFView elementAtPoint:]): Use @{} and @(). (-[WebPDFView viewState]): Use @(). (-[WebPDFView selectionTextRects]): Use @[]. (-[WebPDFView pasteboardTypesForSelection]): Use @[]. (-[WebPDFView _menuItemsFromPDFKitForEvent:]): Use @(). (-[WebPDFView _openWithFinder:]): Use @{} and @(). * WebView/WebPreferences.mm: (+[WebPreferences initialize]): Use @(). (-[WebPreferences _setUnsignedIntValue:forKey:]): Use @(). (+[WebPreferences _setInitialDefaultTextEncodingToSystemEncoding]): Use @(). (-[WebPreferences setStorageBlockingPolicy:]): Use @{} and @(). * WebView/WebScriptDebugger.mm: (WebScriptDebugger::sourceParsed): Use @(). * WebView/WebTextCompletionController.mm: (-[WebTextCompletionController _placePopupWindow:]): Use @{}. * WebView/WebView.mm: (-[WebView _preferencesChanged:]): Use makeVector<String>. (-[WebView _contentsOfUserInterfaceItem:]): Use @(). (toStringVector): Deleted. (+[WebView _addUserScriptToGroup:world:source:url:whitelist:blacklist:injectionTime:injectedFrames:]): Use makeVector<String>. (+[WebView _addUserStyleSheetToGroup:world:source:url:whitelist:blacklist:injectedFrames:]): Use makeVector<String>. (-[WebView _elementAtWindowPoint:]): Use @{}. (-[WebView pasteboardTypesForSelection]): Use @[]. (-[WebView pasteboardTypesForElement:]): Use @[]. (-[WebView rectsForTextMatches]): Use @[]. (-[WebView _searchWithGoogleFromMenu:]): Use @[]. (-[WebView _setFontWhitelist:]): Use makeVector<String>. Source/WTF: * WTF.xcodeproj/project.pbxproj: Added VectorCocoa.h. * wtf/PlatformMac.cmake: Ditto. * wtf/cocoa/NSURLExtras.mm: Removed unneeded include. * wtf/cocoa/URLCocoa.mm: Ditto. * wtf/cocoa/VectorCocoa.h: Added. Contains createNSArray and makeVector function templates for converting NSArray to and from Vector. * wtf/text/WTFString.h: Added makeNSArrayElement and makeVectorElement functions, making createNSArray and makeVector compatible with String. * wtf/text/cocoa/StringCocoa.mm: (WTF::makeNSArrayElement): Added. (WTF::makeVectorElement): Added. Tools: * DumpRenderTree/AccessibilityController.h: Remove use of NotificationHandler type; it's just "id". * DumpRenderTree/AccessibilityUIElement.cpp: (convertElementsToObjectArray): Moved this up in the file, removed unneeded use of JSValueToObject and unused exception argument. (elementsForRangeCallback): Use convertElementsToObjectArray. (columnHeadersCallback): Updated for removed exception argument. (rowHeadersCallback): Ditto. (uiElementArrayAttributeValueCallback): Ditto. * DumpRenderTree/AccessibilityUIElement.h: Changed to use RetainPtr. * DumpRenderTree/TestNetscapePlugIn/PluginObjectMac.mm: (createCoreAnimationLayer): Use @{}. * DumpRenderTree/ios/AccessibilityUIElementIOS.mm: (AccessibilityUIElement::AccessibilityUIElement): Removed some unneeded code now that we use RetainPtr. (AccessibilityUIElement::~AccessibilityUIElement): Deleted. (AccessibilityUIElement::lineTextMarkerRangeForTextMarker): Use @[]. (AccessibilityUIElement::textMarkerRangeForMarkers): Use @[]. (AccessibilityUIElement::textMarkerRangeMatchesTextNearMarkers): Use @[]. * DumpRenderTree/ios/TextInputControllerIOS.m: (-[TextInputController markedRange]): Use @[]. * DumpRenderTree/mac/AccessibilityCommonMac.mm: (searchPredicateParameterizedAttributeForSearchCriteria): Tweak a little. * DumpRenderTree/mac/AccessibilityNotificationHandler.mm: (-[NSString createJSStringRef]): Deleted. Duplicate of a method already implemented in anothe file. * DumpRenderTree/mac/AccessibilityUIElementMac.mm: (makeVectorElement): Added overloads to make both makeVector<AccessibilityTextMarkerRange> and makeVector<AccessibilityUIElement> work. (AccessibilityUIElement::AccessibilityUIElement): Removed some unneeded code now that we use RetainPtr. (convertVectorToObjectArray): Removed unneeded use of JSValueToObject and unneeded exception argument. (convertNSArrayToVector): Deleted. (AccessibilityUIElement::getLinkedUIElements): Use makeVector<AccessibilityUIElement>. (AccessibilityUIElement::getDocumentLinks): Ditto. (AccessibilityUIElement::getChildren): Ditto. (AccessibilityUIElement::getChildrenWithRange): Ditto. (AccessibilityUIElement::rowHeaders const): Ditto. (AccessibilityUIElement::columnHeaders const): Ditto. (AccessibilityUIElement::uiElementArrayAttributeValue const): Ditto. (AccessibilityUIElement::role): Updated since m_element is a RetainPtr. (AccessibilityUIElement::subrole): Ditto. (AccessibilityUIElement::roleDescription): Ditto. (AccessibilityUIElement::computedRoleString): Ditto. (AccessibilityUIElement::title): Ditto. (AccessibilityUIElement::description): Ditto. (AccessibilityUIElement::orientation const): Ditto. (AccessibilityUIElement::stringValue): Ditto. (AccessibilityUIElement::language): Ditto. (AccessibilityUIElement::helpText const): Ditto. (AccessibilityUIElement::lineForIndex): Use @(). (AccessibilityUIElement::rangeForLine): Use @(). (AccessibilityUIElement::searchTextWithCriteria): Use makeVector<AccessibilityTextMarkerRange>. (AccessibilityUIElement::attributesOfColumnHeaders): Use makeVector<AccessibilityUIElement>. (AccessibilityUIElement::attributesOfRowHeaders): Ditto. (AccessibilityUIElement::attributesOfColumns): Ditto. (AccessibilityUIElement::attributesOfRows): Ditto. (AccessibilityUIElement::attributesOfVisibleCells): Ditto. (AccessibilityUIElement::cellForColumnAndRow): Use @[] and @(). (AccessibilityUIElement::setSelectedChild const): Use @[]. (AccessibilityUIElement::setSelectedChildAtIndex const): Use @[]. (AccessibilityUIElement::attributedStringForTextMarkerRangeWithOptions): Use @{}, @YES, and @NO. (AccessibilityUIElement::textMarkerRangeForMarkers): Use @[]. * DumpRenderTree/mac/DumpRenderTree.mm: (addTestPluginsToPluginSearchPath): Use @[]. (resetWebViewToConsistentStateBeforeTesting): Use @[]. * DumpRenderTree/mac/DumpRenderTreePasteboard.mm: (-[DumpRenderTreePasteboard declareType:owner:]): Use @[]. * DumpRenderTree/mac/EventSendingController.mm: (-[EventSendingController beginDragWithFiles:]): Use @(). (-[EventSendingController sentTouchEventOfType:]): Use @(). * DumpRenderTree/mac/MockWebNotificationProvider.mm: (-[MockWebNotificationProvider cancelNotification:]): Use @[]. * DumpRenderTree/mac/ObjCController.m: (-[ObjCController objectOfClass:]): Use @(). (-[ObjCController arrayOfString]): Use @[]. (-[ObjCController testWrapperRoundTripping:]): Use @(). (-[ObjCController testArray]): Use @[]. * DumpRenderTree/mac/TestRunnerMac.mm: (originsArrayToJS): Removed unneeded use of JSValueToObject. * DumpRenderTree/mac/TextInputControllerMac.m: (-[TextInputController markedRange]): Use @[] and @(). (-[TextInputController selectedRange]): Use @[] and @(). (-[TextInputController firstRectForCharactersFrom:length:]): Use @[] and @(). (-[TextInputController dictatedStringWithPrimaryString:alternative:alternativeOffset:alternativeLength:]): Use @[]. (-[TextInputController interpretKeyEvents:withSender:]): Use @[]. * DumpRenderTree/mac/UIScriptControllerMac.mm: (WTR::UIScriptControllerMac::copyText): Use []. * DumpRenderTree/win/AccessibilityUIElementWin.cpp: Deleted an unneeded copy constructor and destructor. * TestRunnerShared/cocoa/LayoutTestSpellChecker.mm: (-[LayoutTestSpellChecker setResultsFromJSObject:inContext:]): Use @{}. * TestWebKitAPI/Tests/WebKitCocoa/ContentRuleListNotification.mm: (toVector): Deleted. (-[ContentRuleListNotificationDelegate _webView:contentRuleListWithIdentifier:performedAction:forURL:]): Use makeVector<String>. * TestWebKitAPI/Tests/WebKitCocoa/InAppBrowserPrivacy.mm: (TestWebKitAPI::TEST): Use @[]. * TestWebKitAPI/Tests/WebKitCocoa/PasteImage.mm: (writeImageDataToPasteboard): Use @[] and @{}. (writeBundleFileToPasteboard): Use @[]. * TestWebKitAPI/Tests/WebKitCocoa/PasteWebArchive.mm: (TestWebKitAPI::TEST): Use @[]. * TestWebKitAPI/Tests/WebKitCocoa/UserContentController.mm: (TestWebKitAPI::TEST): Use @[]. * TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm: (TestWebKitAPI::TEST): Use @[]. * TestWebKitAPI/Tests/WebKitCocoa/WKHTTPCookieStore.mm: (TestWebKitAPI::TEST): Use @[]. * TestWebKitAPI/Tests/WebKitCocoa/WKWebsiteDatastore.mm: (TestWebKitAPI::TEST): Use @[]. * TestWebKitAPI/Tests/WebKitCocoa/WebsiteDataStoreCustomPaths.mm: (runWebsiteDataStoreCustomPaths): Use @[]. * TestWebKitAPI/Tests/mac/WebViewCanPasteURL.mm: (TestWebKitAPI::TEST): Use @[]. * TestWebKitAPI/Tests/mac/WebViewCanPasteZeroPng.mm: (TestWebKitAPI::TEST): Use @[]. * TestWebKitAPI/Tests/mac/WebViewDidCreateJavaScriptContext.mm: (-[DidCreateJavaScriptContextFrameLoadDelegate webView:didCreateJavaScriptContext:forFrame:]): Use @[]. * TestWebKitAPI/ios/mainIOS.mm: (main): Use @{}. * TestWebKitAPI/mac/InjectedBundleControllerMac.mm: (TestWebKitAPI::InjectedBundleController::platformInitialize): Use @{} and @(). * TestWebKitAPI/mac/mainMac.mm: (main): Use {}. * WebKitTestRunner/InjectedBundle/AccessibilityController.h: Use id instead of NotificationHandler. * WebKitTestRunner/InjectedBundle/AccessibilityTextMarkerRange.h: Use id for PlatformTextMarkerRange. Added an overload of makeVectorElement to make makeVector<RefPtr<AccessibilityTextMarkerRange>> work. * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h: Use RetainPtr. Added an overload of makeVectorElement to make makeVector<RefPtr<AccessibilityUIElement>> work. * WebKitTestRunner/InjectedBundle/cocoa/ActivateFontsCocoa.mm: Removed unneeded include. * WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm: (WTR::convertNSArrayToVector): Deleted. (WTR::AccessibilityUIElement::AccessibilityUIElement): Simplified since we use RetainPtr. (WTR::AccessibilityUIElement::~AccessibilityUIElement): Ditto. (WTR::convertElementsToObjectArray): Removed unneeded use of JSValueToObject. (WTR::AccessibilityUIElement::elementsForRange): Use makeVector<RefPtr<AccessibilityUIElement>>. (WTR::AccessibilityUIElement::lineTextMarkerRangeForTextMarker): Use @[]. (WTR::AccessibilityUIElement::textMarkerRangeForMarkers): Use @[]. (WTR::AccessibilityUIElement::textMarkerRangeMatchesTextNearMarkers): * WebKitTestRunner/InjectedBundle/ios/InjectedBundleIOS.mm: (WTR::InjectedBundle::platformInitialize): Use @{}. * WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm: (WTR::AccessibilityUIElement::AccessibilityUIElement): Simplified since we use RetainPtr. (WTR::AccessibilityUIElement::~AccessibilityUIElement): Ditto. (WTR::convertNSArrayToVector): Deleted. (WTR::AccessibilityUIElement::getLinkedUIElements): Use makeVector<RefPtr<AccessibilityUIElement>>. (WTR::AccessibilityUIElement::getDocumentLinks): Ditto. (WTR::AccessibilityUIElement::getUIElementsWithAttribute const): Ditto. (WTR::AccessibilityUIElement::getChildren): Ditto. (WTR::AccessibilityUIElement::getChildrenWithRange): Ditto. (WTR::AccessibilityUIElement::rowHeaders const): Ditto. (WTR::AccessibilityUIElement::columnHeaders const): Ditto. (WTR::AccessibilityUIElement::allAttributes): Updated since m_element is a RetainPtr. (WTR::AccessibilityUIElement::stringDescriptionOfAttributeValue): Ditto. (WTR::AccessibilityUIElement::role): Ditto. (WTR::AccessibilityUIElement::subrole): Ditto. (WTR::AccessibilityUIElement::roleDescription): Ditto. (WTR::AccessibilityUIElement::computedRoleString): Ditto. (WTR::AccessibilityUIElement::title): Ditto. (WTR::AccessibilityUIElement::description): Ditto. (WTR::AccessibilityUIElement::orientation const): Ditto. (WTR::AccessibilityUIElement::stringValue): Ditto. (WTR::AccessibilityUIElement::language): Ditto. (WTR::AccessibilityUIElement::helpText const): Ditto. (WTR::AccessibilityUIElement::lineForIndex): Use @(). (WTR::AccessibilityUIElement::rangeForLine): Use @(). (WTR::AccessibilityUIElement::searchTextWithCriteria): Use makeVector<RefPtr<AccessibilityTextMarkerRange>>. (WTR::AccessibilityUIElement::attributesOfColumnHeaders): Ditto. (WTR::AccessibilityUIElement::attributesOfRowHeaders): Ditto. (WTR::AccessibilityUIElement::attributesOfColumns): Ditto. (WTR::AccessibilityUIElement::attributesOfRows): Ditto. (WTR::AccessibilityUIElement::attributesOfVisibleCells): Ditto. (WTR::AccessibilityUIElement::cellForColumnAndRow): Use @[] and @(). (WTR::AccessibilityUIElement::setSelectedChild const): Use @[]. (WTR::AccessibilityUIElement::setSelectedChildAtIndex const): Use @[]. (WTR::AccessibilityUIElement::textMarkerRangeForMarkers): Use @[]. * WebKitTestRunner/TestInvocation.cpp: (WTR::TestInvocation::didReceiveAllStorageAccessEntries): Take Vector&&. (WTR::TestInvocation::didReceiveWebViewCategory): Take String&&. * WebKitTestRunner/TestInvocation.h: Updated for the above. * WebKitTestRunner/cocoa/TestControllerCocoa.mm: (WTR::TestController::cocoaPlatformInitialize): Use @{}and @(). (WTR::TestController::getAllStorageAccessEntries): Use makeVector<String>. (WTR::TestController::loadedThirdPartyDomains): Use makeVector<String>. (WTR::TestController::getWebViewCategory): Update to pass String&&. (WTR::TestController::setAllowedMenuActions): Use createNSArray. * WebKitTestRunner/ios/HIDEventGenerator.mm: (-[HIDEventGenerator interpolatedEvents:]): Use @(). * WebKitTestRunner/mac/PlatformWebViewMac.mm: (WTR::PlatformWebView::changeWindowScaleIfNeeded): Use @{} and @(). * WebKitTestRunner/mac/TestControllerMac.mm: Removed unneeded include. * WebKitTestRunner/mac/UIScriptControllerMac.mm: (WTR::UIScriptControllerMac::copyText): Use @[]. * WebKitTestRunner/mac/WebKitTestRunnerPasteboard.mm: (-[WebKitTestRunnerPasteboard declareType:owner:]): Use @[]. Canonical link: https://commits.webkit.org/223199@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@259843 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-04-10 02:11:30 +00:00
platform/graphics/cocoa/IntRectCocoa.mm
Add support for HEVC codec types in Media Capabilities https://bugs.webkit.org/show_bug.cgi?id=189565 Reviewed by Eric Carlson. Source/WebCore: Test: media/hevc-codec-parameters.html Add some utility methods for parsing HEVC codec strings, and using those parsed values to query the platform for detailed support for HEVC decoding. Drive-by fix: Modify MediaEngineConfigurationFactory to allow for null function pointers in the encode/decode factory pair. * Sources.txt: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/cocoa/VideoToolboxSoftLink.cpp: * platform/cocoa/VideoToolboxSoftLink.h: * platform/graphics/HEVCUtilities.cpp: Added. (WebCore::parseHEVCCodecParameters): * platform/graphics/HEVCUtilities.h: Added. * platform/graphics/cocoa/HEVCUtilitiesCocoa.cpp: Added. (WebCore::validateHEVCParameters): * platform/graphics/cocoa/HEVCUtilitiesCocoa.h: Added. * platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.cpp: Added. (WebCore::videoCodecTypeFromRFC4281Type): (WebCore::createMediaPlayerDecodingConfigurationCocoa): * platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.h: Added. * platform/mediacapabilities/MediaEngineConfigurationFactory.cpp: (WebCore::factories): (WebCore::MediaEngineConfigurationFactory::createDecodingConfiguration): (WebCore::MediaEngineConfigurationFactory::createEncodingConfiguration): * testing/Internals.cpp: (WebCore::Internals::parseHEVCCodecParameters): * testing/Internals.h: * testing/Internals.idl: Source/WTF: Extract the toIntegralType template into its own header. * wtf/CMakeLists.txt: * wtf/text/StringConversion.h: Added. (isCharacterAllowedInBase): (toIntegralType): * wtf/text/WTFString.cpp: LayoutTests: * media/hevc-codec-parameters-expected.txt: Added. * media/hevc-codec-parameters.html: Added. Canonical link: https://commits.webkit.org/204650@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236094 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-09-17 23:24:21 +00:00
platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.cpp
[GPUP] WebContent process should not create AVOutputContext instances when media in GPU Process is enabled https://bugs.webkit.org/show_bug.cgi?id=224469 Reviewed by Eric Carlson. Source/WebCore: This patch modifies `MediaPlaybackTargetContext` to provide interfaces to serialize/deserialize `AVOutputContext` and modifies `MediaPlaybackTargetCocoa` to use `MediaPlaybackTargetContext` to manage its `AVOutputContext` instead of keeping a pointer to the `AVOutputContext` object. With these changes, a WebContent process can forward a serialized `AVOutputContext` object to other processes (e.g., the GPU process) without deserializing it. Therefore, the WebContent process does not need access to the CoreMedia routing service. So we can remove the fix (r275669) for bug 224328. Covered by existing tests. * Modules/airplay/WebMediaSessionManager.cpp: (WebCore::WebMediaSessionManager::setMockMediaPlaybackTargetPickerState): * Modules/airplay/WebMediaSessionManager.h: * Headers.cmake: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: Modify the project file because `MediaPlaybackTargetContext` is used in Cocoa ports only. * page/ChromeClient.h: (WebCore::ChromeClient::setMockMediaPlaybackTargetPickerState): * page/Page.cpp: (WebCore::Page::setMockMediaPlaybackTargetPickerState): * page/Page.h: * platform/graphics/MediaPlaybackTarget.h: (WebCore::MediaPlaybackTarget::hasActiveRoute const): (WebCore::MediaPlaybackTarget::deviceName const): (WebCore::MediaPlaybackTarget::supportsRemoteVideoPlayback): (): Deleted. * platform/graphics/MediaPlaybackTargetContext.h: Removed. * platform/graphics/avfoundation/MediaPlaybackTargetCocoa.h: (WebCore::MediaPlaybackTargetCocoa::outputContext const): Deleted. * platform/graphics/avfoundation/MediaPlaybackTargetCocoa.mm: (WebCore::MediaPlaybackTargetCocoa::create): (WebCore::MediaPlaybackTargetCocoa::MediaPlaybackTargetCocoa): (WebCore::MediaPlaybackTargetCocoa::~MediaPlaybackTargetCocoa): (WebCore::toMediaPlaybackTargetCocoa): (WebCore::MediaPlaybackTargetCocoa::supportsRemoteVideoPlayback const): Deleted. (WebCore::MediaPlaybackTargetCocoa::targetContext const): Deleted. (WebCore::MediaPlaybackTargetCocoa::hasActiveRoute const): Deleted. (WebCore::MediaPlaybackTargetCocoa::deviceName const): Deleted. Don't directly use `AVOutputContext` in this class. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::isCurrentPlaybackTargetWireless const): (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessPlaybackTarget): (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget): * platform/graphics/cocoa/MediaPlaybackTargetContext.h: Added. (WebCore::MediaPlaybackTargetContext::MediaPlaybackTargetContext): (WebCore::MediaPlaybackTargetContext::type const): (WebCore::MediaPlaybackTargetContext::mockState const): (WebCore::MediaPlaybackTargetContext::outputContext const): (WebCore::MediaPlaybackTargetContext::serializedOutputContext const): (WebCore::MediaPlaybackTargetContext::encodingRequiresPlatformData const): * platform/graphics/cocoa/MediaPlaybackTargetContext.mm: Added. (WebCore::MediaPlaybackTargetContext::MediaPlaybackTargetContext): (WebCore::MediaPlaybackTargetContext::deviceName const): (WebCore::MediaPlaybackTargetContext::hasActiveRoute const): (WebCore::MediaPlaybackTargetContext::supportsRemoteVideoPlayback const): (WebCore::MediaPlaybackTargetContext::serializeOutputContext): (WebCore::MediaPlaybackTargetContext::deserializeOutputContext): * platform/mock/MediaPlaybackTargetMock.cpp: (WebCore::MediaPlaybackTargetMock::create): (WebCore::MediaPlaybackTargetMock::MediaPlaybackTargetMock): (WebCore::toMediaPlaybackTargetMock): (WebCore::MediaPlaybackTargetMock::targetContext const): Deleted. * platform/mock/MediaPlaybackTargetMock.h: (WebCore::MediaPlaybackTargetMock::state const): * platform/mock/MediaPlaybackTargetPickerMock.cpp: (WebCore::MediaPlaybackTargetPickerMock::externalOutputDeviceAvailable): (WebCore::MediaPlaybackTargetPickerMock::startingMonitoringPlaybackTargets): (WebCore::MediaPlaybackTargetPickerMock::invalidatePlaybackTargets): (WebCore::MediaPlaybackTargetPickerMock::setState): * platform/mock/MediaPlaybackTargetPickerMock.h: * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): (WebCore::Internals::setMockMediaPlaybackTargetPickerState): Source/WebKit: * Scripts/webkit/messages.py: Fix clean build failures on the WinCairo port. * GPUProcess/media/RemoteMediaPlayerProxy.cpp: (WebKit::RemoteMediaPlayerProxy::setWirelessPlaybackTarget): * GPUProcess/media/RemoteMediaPlayerProxy.h: * GPUProcess/media/ios/RemoteMediaSessionHelperProxy.cpp: (WebKit::RemoteMediaSessionHelperProxy::activeVideoRouteDidChange): * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder<WebCore::MediaPlaybackTargetContext>::encodePlatformData): (IPC::ArgumentCoder<WebCore::MediaPlaybackTargetContext>::decodePlatformData): * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder<MediaPlaybackTargetContext>::encode): (IPC::ArgumentCoder<MediaPlaybackTargetContext>::decode): * Shared/WebCoreArgumentCoders.h: * Shared/mac/WebCoreArgumentCodersMac.mm: (IPC::ArgumentCoder<WebCore::MediaPlaybackTargetContext>::encodePlatformData): Deleted. (IPC::ArgumentCoder<WebCore::MediaPlaybackTargetContext>::decodePlatformData): Deleted. * UIProcess/WebPageProxy.cpp: (WebKit::mediaRelatedIOKitClasses): (WebKit::WebPageProxy::creationParameters): (WebKit::WebPageProxy::setMockMediaPlaybackTargetPickerState): (WebKit::WebPageProxy::setPlaybackTarget): (WebKit::temporaryMachServices): Deleted. * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/GPU/media/ios/RemoteMediaSessionHelper.cpp: (WebKit::RemoteMediaSessionHelper::activeVideoRouteDidChange): * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::setMockMediaPlaybackTargetPickerState): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::playbackTargetSelected const): Source/WebKitLegacy/mac: * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::setMockMediaPlaybackTargetPickerState): * WebView/WebMediaPlaybackTargetPicker.h: * WebView/WebMediaPlaybackTargetPicker.mm: (WebMediaPlaybackTargetPicker::setMockMediaPlaybackTargetPickerState): * WebView/WebView.mm: (-[WebView _setMockMediaPlaybackTargetPickerName:state:]): * WebView/WebViewInternal.h: Canonical link: https://commits.webkit.org/236661@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276177 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-16 22:54:15 +00:00
platform/graphics/cocoa/MediaPlaybackTargetContext.mm
Source/WebCore: Implement RemoteGraphicsContextGL https://bugs.webkit.org/show_bug.cgi?id=217216 <rdar://problem/69876258> Patch by Kimmo Kinnunen <kkinnunen@apple.com> on 2020-12-09 Reviewed by Simon Fraser. Implements a beginning of a remote version of GraphicsContextGL for GPU process. Current implementation is using WebKit IPC. Implemented with a generator script implementing the IPC to pass the GraphicsContextGL member function calls from web process to the GPU process. The script is run during development time and the results are committed to the repo for ease of review. Extracts an interface GraphicsContextGLIOSurfaceSwapChain which is used to submit IOSurfaces from GraphicsContextGLOpenGL. For web process WebGL, these go to WebGLLayer. For GPU process WebGL, the IOSurfaces go to the prepareForDisplay caller, e.g. the RemoteGraphicsContextGL, which then return the IOSurfaces back to Web process side. RemoteGraphicsContextGLProxy will send them to WebGLLayer. No new tests, tested by existing webgl tests once the implementation works. * PlatformMac.cmake: * Sources.txt: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::getBufferSubData): (WebCore::WebGL2RenderingContext::vertexAttribI4uiv): (WebCore::WebGL2RenderingContext::getQueryParameter): (WebCore::WebGL2RenderingContext::bindSampler): (WebCore::WebGL2RenderingContext::getSamplerParameter): (WebCore::WebGL2RenderingContext::clientWaitSync): (WebCore::WebGL2RenderingContext::deleteTransformFeedback): (WebCore::WebGL2RenderingContext::beginTransformFeedback): (WebCore::WebGL2RenderingContext::endTransformFeedback): (WebCore::WebGL2RenderingContext::transformFeedbackVaryings): (WebCore::WebGL2RenderingContext::getActiveUniforms): (WebCore::WebGL2RenderingContext::readPixels): * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::create): (WebCore::WebGLRenderingContextBase::readPixels): * html/canvas/WebGLSync.cpp: (WebCore::WebGLSync::updateCache): * page/Chrome.cpp: (WebCore::Chrome::createGraphicsContextGL const): (WebCore::Chrome::windowScreenDidChange): * page/Chrome.h: * page/ChromeClient.h: (WebCore::ChromeClient::createGraphicsContextGL const): * platform/HostWindow.h: * platform/RuntimeApplicationChecks.h: (WebCore::isInGPUProcess): * platform/cocoa/RuntimeApplicationChecksCocoa.mm: (WebCore::isInGPUProcess): * platform/graphics/ExtensionsGL.h: * platform/graphics/GraphicsContextGL.cpp: (WebCore::GraphicsContextGL::create): * platform/graphics/GraphicsContextGL.h: * platform/graphics/GraphicsTypesGL.h: (GCGLSpan::GCGLSpan): (GCGLSpan<GCGLvoid>::GCGLSpan): * platform/graphics/RemoteGraphicsContextGLProxyBase.cpp: Added. (WebCore::RemoteGraphicsContextGLProxyBase::RemoteGraphicsContextGLProxyBase): (WebCore::RemoteGraphicsContextGLProxyBase::platformGraphicsContextGL const): (WebCore::RemoteGraphicsContextGLProxyBase::platformTexture const): (WebCore::RemoteGraphicsContextGLProxyBase::getExtensions): (WebCore::RemoteGraphicsContextGLProxyBase::setContextVisibility): (WebCore::RemoteGraphicsContextGLProxyBase::powerPreferenceUsedForCreation const): (WebCore::RemoteGraphicsContextGLProxyBase::isGLES2Compliant const): (WebCore::RemoteGraphicsContextGLProxyBase::markContextChanged): (WebCore::RemoteGraphicsContextGLProxyBase::markLayerComposited): (WebCore::RemoteGraphicsContextGLProxyBase::layerComposited const): (WebCore::RemoteGraphicsContextGLProxyBase::setBuffersToAutoClear): (WebCore::RemoteGraphicsContextGLProxyBase::getBuffersToAutoClear const): (WebCore::RemoteGraphicsContextGLProxyBase::paintCompositedResultsToCanvas): (WebCore::RemoteGraphicsContextGLProxyBase::enablePreserveDrawingBuffer): (WebCore::RemoteGraphicsContextGLProxyBase::supports): (WebCore::RemoteGraphicsContextGLProxyBase::ensureEnabled): (WebCore::RemoteGraphicsContextGLProxyBase::isEnabled): (WebCore::RemoteGraphicsContextGLProxyBase::initialize): (WebCore::RemoteGraphicsContextGLProxyBase::platformInitialize): (WebCore::RemoteGraphicsContextGLProxyBase::platformLayer const): * platform/graphics/RemoteGraphicsContextGLProxyBase.h: Added. * platform/graphics/angle/ExtensionsGLANGLE.cpp: (WebCore::ExtensionsGLANGLE::ExtensionsGLANGLE): (WebCore::ExtensionsGLANGLE::getGraphicsResetStatusARB): (WebCore::ExtensionsGLANGLE::getTranslatedShaderSourceANGLE): (WebCore::ExtensionsGLANGLE::blitFramebufferANGLE): (WebCore::ExtensionsGLANGLE::renderbufferStorageMultisampleANGLE): (WebCore::ExtensionsGLANGLE::drawArraysInstancedANGLE): (WebCore::ExtensionsGLANGLE::drawElementsInstancedANGLE): (WebCore::ExtensionsGLANGLE::vertexAttribDivisorANGLE): (WebCore::ExtensionsGLANGLE::getUniformuivRobustANGLE): (WebCore::ExtensionsGLANGLE::getTexLevelParameterivRobustANGLE): (WebCore::ExtensionsGLANGLE::getTexLevelParameterfvRobustANGLE): (WebCore::ExtensionsGLANGLE::getnUniformfvRobustANGLE): (WebCore::ExtensionsGLANGLE::getnUniformivRobustANGLE): (WebCore::ExtensionsGLANGLE::getnUniformuivRobustANGLE): * platform/graphics/angle/ExtensionsGLANGLE.h: * platform/graphics/angle/GraphicsContextGLANGLE.cpp: (WebCore::GraphicsContextGLOpenGL::readnPixels): (WebCore::GraphicsContextGLOpenGL::readnPixelsImpl): (WebCore::GraphicsContextGLOpenGL::getBufferSubData): (WebCore::GraphicsContextGLOpenGL::getActiveUniforms): (WebCore::GraphicsContextGLOpenGL::getQueryObjectui): (WebCore::GraphicsContextGLOpenGL::getSamplerParameterf): (WebCore::GraphicsContextGLOpenGL::getSamplerParameteri): (WebCore::GraphicsContextGLOpenGL::getSynci): * platform/graphics/cocoa/GraphicsContextGLIOSurfaceSwapChain.cpp: Added. * platform/graphics/cocoa/GraphicsContextGLIOSurfaceSwapChain.h: Copied from Source/WebCore/platform/graphics/cocoa/WebGLLayer.h. * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm: (WebCore::InitializeEGLDisplay): (WebCore::GraphicsContextGLOpenGL::create): (WebCore::GraphicsContextGLOpenGL::createShared): (WebCore::GraphicsContextGLOpenGL::createForGPUProcess): (WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL): (WebCore::GraphicsContextGLOpenGL::~GraphicsContextGLOpenGL): (WebCore::GraphicsContextGLOpenGL::reshapeDisplayBufferBacking): (WebCore::GraphicsContextGLOpenGL::allocateAndBindDisplayBufferBacking): (WebCore::GraphicsContextGLOpenGL::allowOfflineRenderers const): (WebCore::GraphicsContextGLOpenGL::prepareForDisplay): * platform/graphics/cocoa/RemoteGraphicsContextGLProxyBaseCocoa.mm: Added. (WebCore::RemoteGraphicsContextGLProxyBase::platformInitialize): (WebCore::RemoteGraphicsContextGLProxyBase::platformLayer const): (WebCore::RemoteGraphicsContextGLProxyBase::asCV): (WebCore::RemoteGraphicsContextGLProxyBase::platformSwapChain): * platform/graphics/cocoa/WebGLLayer.h: * platform/graphics/cocoa/WebGLLayer.mm: (-[WebGLLayer initWithDevicePixelRatio:contentsOpaque:]): (-[WebGLLayer swapChain]): (-[WebGLLayer prepareForDisplay]): (-[WebGLLayer display]): (WebGLLayerSwapChain::present): * platform/graphics/coreimage/FilterEffectRendererCoreImage.mm: * platform/graphics/opengl/ExtensionsGLOpenGL.cpp: (WebCore::ExtensionsGLOpenGL::blitFramebufferANGLE): (WebCore::ExtensionsGLOpenGL::renderbufferStorageMultisampleANGLE): (WebCore::ExtensionsGLOpenGL::drawArraysInstancedANGLE): (WebCore::ExtensionsGLOpenGL::drawElementsInstancedANGLE): (WebCore::ExtensionsGLOpenGL::vertexAttribDivisorANGLE): * platform/graphics/opengl/ExtensionsGLOpenGL.h: * platform/graphics/opengl/ExtensionsGLOpenGLCommon.cpp: (WebCore::ExtensionsGLOpenGLCommon::readnPixelsRobustANGLE): * platform/graphics/opengl/ExtensionsGLOpenGLCommon.h: * platform/graphics/opengl/ExtensionsGLOpenGLES.cpp: (WebCore::ExtensionsGLOpenGLES::blitFramebufferANGLE): (WebCore::ExtensionsGLOpenGLES::renderbufferStorageMultisampleANGLE): (WebCore::ExtensionsGLOpenGLES::drawArraysInstancedANGLE): (WebCore::ExtensionsGLOpenGLES::drawElementsInstancedANGLE): (WebCore::ExtensionsGLOpenGLES::vertexAttribDivisorANGLE): * platform/graphics/opengl/ExtensionsGLOpenGLES.h: * platform/graphics/opengl/GraphicsContextGLOpenGL.h: * platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp: (WebCore::GraphicsContextGLOpenGL::drawArraysInstanced): (WebCore::GraphicsContextGLOpenGL::drawElementsInstanced): (WebCore::GraphicsContextGLOpenGL::vertexAttribDivisor): (WebCore::GraphicsContextGLOpenGL::getBufferSubData): (WebCore::GraphicsContextGLOpenGL::getQueryObjectui): (WebCore::GraphicsContextGLOpenGL::getSamplerParameterf): (WebCore::GraphicsContextGLOpenGL::getSamplerParameteri): (WebCore::GraphicsContextGLOpenGL::getSynci): (WebCore::GraphicsContextGLOpenGL::getActiveUniforms): * platform/graphics/opengl/GraphicsContextGLOpenGLES.cpp: (WebCore::GraphicsContextGLOpenGL::reshapeFBOs): Source/WebKit: Implement RemoteWebGLBackend https://bugs.webkit.org/show_bug.cgi?id=217216 <rdar://problem/69876258> Patch by Kimmo Kinnunen <kkinnunen@apple.com> on 2020-12-09 Reviewed by Simon Fraser. Implements a beginning of a remote version of GraphicsContextGL for GPU process. Current implementation is using WebKit IPC. Implemented with a generator script implementing the IPC to pass the GraphicsContextGL member function calls from web process to the GPU process. The script is run during development time and the results are committed to the repo for ease of review. Implement the RemoteGraphicsContextGL in WebKit side. This class will forward calls received via IPC to the GraphicsContextGLOpenGL. At the moment RemoteGraphicsContextGL instance is a direct child of GPUConnectionToWebProcess. Compositing is implemented only for PLATFORM(COCOA). Missing: - Simulated context loss - Simulated context change - Paint WebGL contents to 2D canvas - Upload video to WebGL - Upload canvas to WebGL * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * GPUProcess/GPUConnectionToWebProcess.cpp: (WebKit::GPUConnectionToWebProcess::createGraphicsContextGL): (WebKit::GPUConnectionToWebProcess::releaseGraphicsContextGL): * GPUProcess/GPUConnectionToWebProcess.h: * GPUProcess/GPUConnectionToWebProcess.messages.in: * GPUProcess/graphics/RemoteGraphicsContextGL.cpp: Added. (WebKit::RemoteGraphicsContextGL::create): (WebKit::RemoteGraphicsContextGL::RemoteGraphicsContextGL): (WebKit::RemoteGraphicsContextGL::~RemoteGraphicsContextGL): (WebKit::RemoteGraphicsContextGL::gpuConnectionToWebProcess const): (WebKit::RemoteGraphicsContextGL::messageSenderConnection const): (WebKit::RemoteGraphicsContextGL::messageSenderDestinationID const): (WebKit::RemoteGraphicsContextGL::didComposite): (WebKit::RemoteGraphicsContextGL::forceContextLost): (WebKit::RemoteGraphicsContextGL::recycleContext): (WebKit::RemoteGraphicsContextGL::dispatchContextChangedNotification): (WebKit::RemoteGraphicsContextGL::recycleBuffer): (WebKit::RemoteGraphicsContextGL::present): (WebKit::RemoteGraphicsContextGL::detachClient): (WebKit::RemoteGraphicsContextGL::reshape): (WebKit::RemoteGraphicsContextGL::prepareForDisplay): (WebKit::RemoteGraphicsContextGL::ensureExtensionEnabled): (WebKit::RemoteGraphicsContextGL::notifyMarkContextChanged): * GPUProcess/graphics/RemoteGraphicsContextGL.h: Added. * GPUProcess/graphics/RemoteGraphicsContextGL.messages.in: Added. * GPUProcess/graphics/RemoteGraphicsContextGLFunctionsGenerated.h: Added. (setFailNextGPUStatusCheck): (synthesizeGLError): (moveErrorsToSyntheticErrorList): (activeTexture): (attachShader): (bindAttribLocation): (bindBuffer): (bindFramebuffer): (bindRenderbuffer): (bindTexture): (blendColor): (blendEquation): (blendEquationSeparate): (blendFunc): (blendFuncSeparate): (checkFramebufferStatus): (clear): (clearColor): (clearDepth): (clearStencil): (colorMask): (compileShader): (copyTexImage2D): (copyTexSubImage2D): (createBuffer): (createFramebuffer): (createProgram): (createRenderbuffer): (createShader): (createTexture): (cullFace): (deleteBuffer): (deleteFramebuffer): (deleteProgram): (deleteRenderbuffer): (deleteShader): (deleteTexture): (depthFunc): (depthMask): (depthRange): (detachShader): (disable): (disableVertexAttribArray): (drawArrays): (drawElements): (enable): (enableVertexAttribArray): (finish): (flush): (framebufferRenderbuffer): (framebufferTexture2D): (frontFace): (generateMipmap): (getActiveAttrib): (getActiveUniform): (getAttribLocation): (getBufferParameteri): (getString): (getFloatv): (getIntegerv): (getInteger64): (getInteger64i): (getProgrami): (getBooleanv): (getError): (getFramebufferAttachmentParameteri): (getProgramInfoLog): (getRenderbufferParameteri): (getShaderi): (getShaderInfoLog): (getShaderPrecisionFormat): (getShaderSource): (getTexParameterf): (getTexParameteri): (getUniformfv): (getUniformiv): (getUniformuiv): (getUniformLocation): (getVertexAttribOffset): (hint): (isBuffer): (isEnabled): (isFramebuffer): (isProgram): (isRenderbuffer): (isShader): (isTexture): (lineWidth): (linkProgram): (pixelStorei): (polygonOffset): (renderbufferStorage): (sampleCoverage): (scissor): (shaderSource): (stencilFunc): (stencilFuncSeparate): (stencilMask): (stencilMaskSeparate): (stencilOp): (stencilOpSeparate): (texParameterf): (texParameteri): (uniform1f): (uniform1fv): (uniform1i): (uniform1iv): (uniform2f): (uniform2fv): (uniform2i): (uniform2iv): (uniform3f): (uniform3fv): (uniform3i): (uniform3iv): (uniform4f): (uniform4fv): (uniform4i): (uniform4iv): (uniformMatrix2fv): (uniformMatrix3fv): (uniformMatrix4fv): (useProgram): (validateProgram): (vertexAttrib1f): (vertexAttrib1fv): (vertexAttrib2f): (vertexAttrib2fv): (vertexAttrib3f): (vertexAttrib3fv): (vertexAttrib4f): (vertexAttrib4fv): (vertexAttribPointer): (viewport): (bufferData0): (bufferData1): (bufferSubData): (readnPixels0): (readnPixels1): (texImage2D0): (texImage2D1): (texSubImage2D0): (texSubImage2D1): (compressedTexImage2D0): (compressedTexImage2D1): (compressedTexSubImage2D0): (compressedTexSubImage2D1): (drawArraysInstanced): (drawElementsInstanced): (vertexAttribDivisor): (createVertexArray): (deleteVertexArray): (isVertexArray): (bindVertexArray): (copyBufferSubData): (getBufferSubData): (blitFramebuffer): (framebufferTextureLayer): (invalidateFramebuffer): (invalidateSubFramebuffer): (readBuffer): (renderbufferStorageMultisample): (texStorage2D): (texStorage3D): (texImage3D0): (texImage3D1): (texSubImage3D0): (texSubImage3D1): (copyTexSubImage3D): (compressedTexImage3D0): (compressedTexImage3D1): (compressedTexSubImage3D0): (compressedTexSubImage3D1): (getFragDataLocation): (uniform1ui): (uniform2ui): (uniform3ui): (uniform4ui): (uniform1uiv): (uniform2uiv): (uniform3uiv): (uniform4uiv): (uniformMatrix2x3fv): (uniformMatrix3x2fv): (uniformMatrix2x4fv): (uniformMatrix4x2fv): (uniformMatrix3x4fv): (uniformMatrix4x3fv): (vertexAttribI4i): (vertexAttribI4iv): (vertexAttribI4ui): (vertexAttribI4uiv): (vertexAttribIPointer): (drawRangeElements): (drawBuffers): (clearBufferiv): (clearBufferuiv): (clearBufferfv): (clearBufferfi): (createQuery): (deleteQuery): (isQuery): (beginQuery): (endQuery): (getQuery): (getQueryObjectui): (createSampler): (deleteSampler): (isSampler): (bindSampler): (samplerParameteri): (samplerParameterf): (getSamplerParameterf): (getSamplerParameteri): (fenceSync): (isSync): (deleteSync): (clientWaitSync): (waitSync): (getSynci): (createTransformFeedback): (deleteTransformFeedback): (isTransformFeedback): (bindTransformFeedback): (beginTransformFeedback): (endTransformFeedback): (transformFeedbackVaryings): (getTransformFeedbackVarying): (pauseTransformFeedback): (resumeTransformFeedback): (bindBufferBase): (bindBufferRange): (getUniformIndices): (getActiveUniforms): (getUniformBlockIndex): (getActiveUniformBlockName): (uniformBlockBinding): (getActiveUniformBlockiv): (getGraphicsResetStatusARB): (blitFramebufferANGLE): (renderbufferStorageMultisampleANGLE): (createVertexArrayOES): (deleteVertexArrayOES): (isVertexArrayOES): (bindVertexArrayOES): (getTranslatedShaderSourceANGLE): (insertEventMarkerEXT): (pushGroupMarkerEXT): (popGroupMarkerEXT): (drawBuffersEXT): (drawArraysInstancedANGLE): (drawElementsInstancedANGLE): (vertexAttribDivisorANGLE): * GPUProcess/mac/GPUProcessMac.mm: (WebKit::GPUProcess::initializeProcess): * GPUProcess/media/RemoteLegacyCDMProxy.h: * GPUProcess/media/RemoteLegacyCDMSessionProxy.cpp: * GPUProcess/media/RemoteMediaResourceManager.cpp: * GPUProcess/media/RemoteMediaResourceManager.h: * GPUProcess/media/RemoteMediaSourceProxy.h: * GPUProcess/media/RemoteSourceBufferProxy.cpp: * GPUProcess/media/RemoteSourceBufferProxy.h: * GPUProcess/webrtc/LibWebRTCCodecsProxy.h: * GPUProcess/webrtc/LibWebRTCCodecsProxy.mm: * GPUProcess/webrtc/RemoteMediaRecorder.h: * NetworkProcess/CustomProtocols/Cocoa/LegacyCustomProtocolManagerCocoa.mm: * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.h: * NetworkProcess/Downloads/Download.cpp: * NetworkProcess/Downloads/Download.h: * NetworkProcess/Downloads/DownloadManager.cpp: * NetworkProcess/Downloads/DownloadManager.h: * NetworkProcess/NetworkSocketChannel.cpp: * NetworkProcess/NetworkSocketChannel.h: * NetworkProcess/NetworkSocketStream.cpp: * NetworkProcess/NetworkSocketStream.h: * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h: * NetworkProcess/WebSocketTask.h: * NetworkProcess/cocoa/WebSocketTaskCocoa.h: * NetworkProcess/cocoa/WebSocketTaskCocoa.mm: * NetworkProcess/soup/WebSocketTaskSoup.cpp: * NetworkProcess/soup/WebSocketTaskSoup.h: * Platform/IPC/ArgumentCoders.h: * Platform/IPC/ArrayReference.h: Copied from Source/WebKit/Platform/IPC/DataReference.h. (IPC::ArrayReference::ArrayReference): (IPC::ArrayReference::isEmpty const): (IPC::ArrayReference::size const): (IPC::ArrayReference::data const): (IPC::ArrayReference::vector const): * Platform/IPC/Connection.h: (IPC::Connection::sendSync): * Platform/IPC/DataReference.h: * Platform/IPC/Decoder.cpp: (IPC::Decoder::decodeFixedLengthReference): * Platform/IPC/Decoder.h: * Platform/IPC/Encoder.cpp: (IPC::Encoder::wrapForTesting): * Platform/IPC/Encoder.h: * Platform/IPC/HandleMessage.h: * Platform/IPC/MessageSender.h: (IPC::MessageSender::sendSync): * Platform/IPC/SharedBufferCopy.cpp: (IPC::SharedBufferCopy::decode): * Platform/IPC/SharedBufferDataReference.cpp: * Platform/IPC/StringReference.cpp: * PluginProcess/PluginControllerProxy.cpp: * PluginProcess/PluginControllerProxy.h: * Scripts/webkit/messages.py: * Shared/API/APIData.cpp: * Shared/AuxiliaryProcess.h: * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder<WebCore::GraphicsContextGLAttributes>::encode): (IPC::ArgumentCoder<WebCore::GraphicsContextGLAttributes>::decode): (IPC::ArgumentCoder<WebCore::GraphicsContextGL::ActiveInfo>::encode): (IPC::ArgumentCoder<WebCore::GraphicsContextGL::ActiveInfo>::decode): * Shared/WebCoreArgumentCoders.h: * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode const): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: * Shared/cf/ArgumentCodersCF.cpp: * Shared/soup/WebCoreArgumentCodersSoup.cpp: (IPC::ArgumentCoder<CertificateInfo>::encode): (IPC::ArgumentCoder<CertificateInfo>::decode): * Sources.txt: * SourcesCocoa.txt: * UIProcess/API/APIIconLoadingClient.h: * UIProcess/AuxiliaryProcessProxy.h: (WebKit::AuxiliaryProcessProxy::sendSync): * UIProcess/Cocoa/SOAuthorization/SubFrameSOAuthorizationSession.h: * UIProcess/Network/CustomProtocols/LegacyCustomProtocolManagerProxy.h: * UIProcess/PageClient.h: * UIProcess/UserContent/WebUserContentControllerProxy.cpp: * UIProcess/UserContent/WebUserContentControllerProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::creationParameters): * UIProcess/WebPageProxy.h: * UIProcess/WebURLSchemeHandler.h: * UIProcess/WebURLSchemeTask.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/ApplePay/WebPaymentCoordinator.h: * WebProcess/GPU/GPUProcessConnection.h: * WebProcess/GPU/graphics/GraphicsContextGLIdentifier.h: Renamed from Source/WebKit/Platform/IPC/DataReference.cpp. * WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp: Added. (WebKit::RemoteGraphicsContextGLProxy::create): (WebKit::RemoteGraphicsContextGLProxy::RemoteGraphicsContextGLProxy): (WebKit::RemoteGraphicsContextGLProxy::~RemoteGraphicsContextGLProxy): (WebKit::RemoteGraphicsContextGLProxy::messageSenderConnection const): (WebKit::RemoteGraphicsContextGLProxy::messageSenderDestinationID const): (WebKit::RemoteGraphicsContextGLProxy::reshape): (WebKit::RemoteGraphicsContextGLProxy::prepareForDisplay): (WebKit::RemoteGraphicsContextGLProxy::ensureExtensionEnabled): (WebKit::RemoteGraphicsContextGLProxy::notifyMarkContextChanged): (WebKit::RemoteGraphicsContextGLProxy::simulateContextChanged): (WebKit::RemoteGraphicsContextGLProxy::paintRenderingResultsToCanvas): (WebKit::RemoteGraphicsContextGLProxy::paintRenderingResultsToImageData): (WebKit::RemoteGraphicsContextGLProxy::wasCreated): (WebKit::RemoteGraphicsContextGLProxy::wasLost): (WebKit::RemoteGraphicsContextGLProxy::wasChanged): (WebKit::RemoteGraphicsContextGLProxy::waitUntilInitialized): * WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.h: Added. * WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.messages.in: Copied from Source/WebKit/GPUProcess/GPUConnectionToWebProcess.messages.in. * WebProcess/GPU/graphics/RemoteGraphicsContextGLProxyFunctionsGenerated.cpp: Added. (WebKit::RemoteGraphicsContextGLProxy::setFailNextGPUStatusCheck): (WebKit::RemoteGraphicsContextGLProxy::synthesizeGLError): (WebKit::RemoteGraphicsContextGLProxy::moveErrorsToSyntheticErrorList): (WebKit::RemoteGraphicsContextGLProxy::activeTexture): (WebKit::RemoteGraphicsContextGLProxy::attachShader): (WebKit::RemoteGraphicsContextGLProxy::bindAttribLocation): (WebKit::RemoteGraphicsContextGLProxy::bindBuffer): (WebKit::RemoteGraphicsContextGLProxy::bindFramebuffer): (WebKit::RemoteGraphicsContextGLProxy::bindRenderbuffer): (WebKit::RemoteGraphicsContextGLProxy::bindTexture): (WebKit::RemoteGraphicsContextGLProxy::blendColor): (WebKit::RemoteGraphicsContextGLProxy::blendEquation): (WebKit::RemoteGraphicsContextGLProxy::blendEquationSeparate): (WebKit::RemoteGraphicsContextGLProxy::blendFunc): (WebKit::RemoteGraphicsContextGLProxy::blendFuncSeparate): (WebKit::RemoteGraphicsContextGLProxy::checkFramebufferStatus): (WebKit::RemoteGraphicsContextGLProxy::clear): (WebKit::RemoteGraphicsContextGLProxy::clearColor): (WebKit::RemoteGraphicsContextGLProxy::clearDepth): (WebKit::RemoteGraphicsContextGLProxy::clearStencil): (WebKit::RemoteGraphicsContextGLProxy::colorMask): (WebKit::RemoteGraphicsContextGLProxy::compileShader): (WebKit::RemoteGraphicsContextGLProxy::copyTexImage2D): (WebKit::RemoteGraphicsContextGLProxy::copyTexSubImage2D): (WebKit::RemoteGraphicsContextGLProxy::createBuffer): (WebKit::RemoteGraphicsContextGLProxy::createFramebuffer): (WebKit::RemoteGraphicsContextGLProxy::createProgram): (WebKit::RemoteGraphicsContextGLProxy::createRenderbuffer): (WebKit::RemoteGraphicsContextGLProxy::createShader): (WebKit::RemoteGraphicsContextGLProxy::createTexture): (WebKit::RemoteGraphicsContextGLProxy::cullFace): (WebKit::RemoteGraphicsContextGLProxy::deleteBuffer): (WebKit::RemoteGraphicsContextGLProxy::deleteFramebuffer): (WebKit::RemoteGraphicsContextGLProxy::deleteProgram): (WebKit::RemoteGraphicsContextGLProxy::deleteRenderbuffer): (WebKit::RemoteGraphicsContextGLProxy::deleteShader): (WebKit::RemoteGraphicsContextGLProxy::deleteTexture): (WebKit::RemoteGraphicsContextGLProxy::depthFunc): (WebKit::RemoteGraphicsContextGLProxy::depthMask): (WebKit::RemoteGraphicsContextGLProxy::depthRange): (WebKit::RemoteGraphicsContextGLProxy::detachShader): (WebKit::RemoteGraphicsContextGLProxy::disable): (WebKit::RemoteGraphicsContextGLProxy::disableVertexAttribArray): (WebKit::RemoteGraphicsContextGLProxy::drawArrays): (WebKit::RemoteGraphicsContextGLProxy::drawElements): (WebKit::RemoteGraphicsContextGLProxy::enable): (WebKit::RemoteGraphicsContextGLProxy::enableVertexAttribArray): (WebKit::RemoteGraphicsContextGLProxy::finish): (WebKit::RemoteGraphicsContextGLProxy::flush): (WebKit::RemoteGraphicsContextGLProxy::framebufferRenderbuffer): (WebKit::RemoteGraphicsContextGLProxy::framebufferTexture2D): (WebKit::RemoteGraphicsContextGLProxy::frontFace): (WebKit::RemoteGraphicsContextGLProxy::generateMipmap): (WebKit::RemoteGraphicsContextGLProxy::getActiveAttrib): (WebKit::RemoteGraphicsContextGLProxy::getActiveUniform): (WebKit::RemoteGraphicsContextGLProxy::getAttribLocation): (WebKit::RemoteGraphicsContextGLProxy::getBufferParameteri): (WebKit::RemoteGraphicsContextGLProxy::getString): (WebKit::RemoteGraphicsContextGLProxy::getFloatv): (WebKit::RemoteGraphicsContextGLProxy::getIntegerv): (WebKit::RemoteGraphicsContextGLProxy::getInteger64): (WebKit::RemoteGraphicsContextGLProxy::getInteger64i): (WebKit::RemoteGraphicsContextGLProxy::getProgrami): (WebKit::RemoteGraphicsContextGLProxy::getBooleanv): (WebKit::RemoteGraphicsContextGLProxy::getError): (WebKit::RemoteGraphicsContextGLProxy::getFramebufferAttachmentParameteri): (WebKit::RemoteGraphicsContextGLProxy::getProgramInfoLog): (WebKit::RemoteGraphicsContextGLProxy::getRenderbufferParameteri): (WebKit::RemoteGraphicsContextGLProxy::getShaderi): (WebKit::RemoteGraphicsContextGLProxy::getShaderInfoLog): (WebKit::RemoteGraphicsContextGLProxy::getShaderPrecisionFormat): (WebKit::RemoteGraphicsContextGLProxy::getShaderSource): (WebKit::RemoteGraphicsContextGLProxy::getTexParameterf): (WebKit::RemoteGraphicsContextGLProxy::getTexParameteri): (WebKit::RemoteGraphicsContextGLProxy::getUniformfv): (WebKit::RemoteGraphicsContextGLProxy::getUniformiv): (WebKit::RemoteGraphicsContextGLProxy::getUniformuiv): (WebKit::RemoteGraphicsContextGLProxy::getUniformLocation): (WebKit::RemoteGraphicsContextGLProxy::getVertexAttribOffset): (WebKit::RemoteGraphicsContextGLProxy::hint): (WebKit::RemoteGraphicsContextGLProxy::isBuffer): (WebKit::RemoteGraphicsContextGLProxy::isEnabled): (WebKit::RemoteGraphicsContextGLProxy::isFramebuffer): (WebKit::RemoteGraphicsContextGLProxy::isProgram): (WebKit::RemoteGraphicsContextGLProxy::isRenderbuffer): (WebKit::RemoteGraphicsContextGLProxy::isShader): (WebKit::RemoteGraphicsContextGLProxy::isTexture): (WebKit::RemoteGraphicsContextGLProxy::lineWidth): (WebKit::RemoteGraphicsContextGLProxy::linkProgram): (WebKit::RemoteGraphicsContextGLProxy::pixelStorei): (WebKit::RemoteGraphicsContextGLProxy::polygonOffset): (WebKit::RemoteGraphicsContextGLProxy::renderbufferStorage): (WebKit::RemoteGraphicsContextGLProxy::sampleCoverage): (WebKit::RemoteGraphicsContextGLProxy::scissor): (WebKit::RemoteGraphicsContextGLProxy::shaderSource): (WebKit::RemoteGraphicsContextGLProxy::stencilFunc): (WebKit::RemoteGraphicsContextGLProxy::stencilFuncSeparate): (WebKit::RemoteGraphicsContextGLProxy::stencilMask): (WebKit::RemoteGraphicsContextGLProxy::stencilMaskSeparate): (WebKit::RemoteGraphicsContextGLProxy::stencilOp): (WebKit::RemoteGraphicsContextGLProxy::stencilOpSeparate): (WebKit::RemoteGraphicsContextGLProxy::texParameterf): (WebKit::RemoteGraphicsContextGLProxy::texParameteri): (WebKit::RemoteGraphicsContextGLProxy::uniform1f): (WebKit::RemoteGraphicsContextGLProxy::uniform1fv): (WebKit::RemoteGraphicsContextGLProxy::uniform1i): (WebKit::RemoteGraphicsContextGLProxy::uniform1iv): (WebKit::RemoteGraphicsContextGLProxy::uniform2f): (WebKit::RemoteGraphicsContextGLProxy::uniform2fv): (WebKit::RemoteGraphicsContextGLProxy::uniform2i): (WebKit::RemoteGraphicsContextGLProxy::uniform2iv): (WebKit::RemoteGraphicsContextGLProxy::uniform3f): (WebKit::RemoteGraphicsContextGLProxy::uniform3fv): (WebKit::RemoteGraphicsContextGLProxy::uniform3i): (WebKit::RemoteGraphicsContextGLProxy::uniform3iv): (WebKit::RemoteGraphicsContextGLProxy::uniform4f): (WebKit::RemoteGraphicsContextGLProxy::uniform4fv): (WebKit::RemoteGraphicsContextGLProxy::uniform4i): (WebKit::RemoteGraphicsContextGLProxy::uniform4iv): (WebKit::RemoteGraphicsContextGLProxy::uniformMatrix2fv): (WebKit::RemoteGraphicsContextGLProxy::uniformMatrix3fv): (WebKit::RemoteGraphicsContextGLProxy::uniformMatrix4fv): (WebKit::RemoteGraphicsContextGLProxy::useProgram): (WebKit::RemoteGraphicsContextGLProxy::validateProgram): (WebKit::RemoteGraphicsContextGLProxy::vertexAttrib1f): (WebKit::RemoteGraphicsContextGLProxy::vertexAttrib1fv): (WebKit::RemoteGraphicsContextGLProxy::vertexAttrib2f): (WebKit::RemoteGraphicsContextGLProxy::vertexAttrib2fv): (WebKit::RemoteGraphicsContextGLProxy::vertexAttrib3f): (WebKit::RemoteGraphicsContextGLProxy::vertexAttrib3fv): (WebKit::RemoteGraphicsContextGLProxy::vertexAttrib4f): (WebKit::RemoteGraphicsContextGLProxy::vertexAttrib4fv): (WebKit::RemoteGraphicsContextGLProxy::vertexAttribPointer): (WebKit::RemoteGraphicsContextGLProxy::viewport): (WebKit::RemoteGraphicsContextGLProxy::bufferData): (WebKit::RemoteGraphicsContextGLProxy::bufferSubData): (WebKit::RemoteGraphicsContextGLProxy::readnPixels): (WebKit::RemoteGraphicsContextGLProxy::texImage2D): (WebKit::RemoteGraphicsContextGLProxy::texSubImage2D): (WebKit::RemoteGraphicsContextGLProxy::compressedTexImage2D): (WebKit::RemoteGraphicsContextGLProxy::compressedTexSubImage2D): (WebKit::RemoteGraphicsContextGLProxy::drawArraysInstanced): (WebKit::RemoteGraphicsContextGLProxy::drawElementsInstanced): (WebKit::RemoteGraphicsContextGLProxy::vertexAttribDivisor): (WebKit::RemoteGraphicsContextGLProxy::createVertexArray): (WebKit::RemoteGraphicsContextGLProxy::deleteVertexArray): (WebKit::RemoteGraphicsContextGLProxy::isVertexArray): (WebKit::RemoteGraphicsContextGLProxy::bindVertexArray): (WebKit::RemoteGraphicsContextGLProxy::copyBufferSubData): (WebKit::RemoteGraphicsContextGLProxy::getBufferSubData): (WebKit::RemoteGraphicsContextGLProxy::blitFramebuffer): (WebKit::RemoteGraphicsContextGLProxy::framebufferTextureLayer): (WebKit::RemoteGraphicsContextGLProxy::invalidateFramebuffer): (WebKit::RemoteGraphicsContextGLProxy::invalidateSubFramebuffer): (WebKit::RemoteGraphicsContextGLProxy::readBuffer): (WebKit::RemoteGraphicsContextGLProxy::renderbufferStorageMultisample): (WebKit::RemoteGraphicsContextGLProxy::texStorage2D): (WebKit::RemoteGraphicsContextGLProxy::texStorage3D): (WebKit::RemoteGraphicsContextGLProxy::texImage3D): (WebKit::RemoteGraphicsContextGLProxy::texSubImage3D): (WebKit::RemoteGraphicsContextGLProxy::copyTexSubImage3D): (WebKit::RemoteGraphicsContextGLProxy::compressedTexImage3D): (WebKit::RemoteGraphicsContextGLProxy::compressedTexSubImage3D): (WebKit::RemoteGraphicsContextGLProxy::getFragDataLocation): (WebKit::RemoteGraphicsContextGLProxy::uniform1ui): (WebKit::RemoteGraphicsContextGLProxy::uniform2ui): (WebKit::RemoteGraphicsContextGLProxy::uniform3ui): (WebKit::RemoteGraphicsContextGLProxy::uniform4ui): (WebKit::RemoteGraphicsContextGLProxy::uniform1uiv): (WebKit::RemoteGraphicsContextGLProxy::uniform2uiv): (WebKit::RemoteGraphicsContextGLProxy::uniform3uiv): (WebKit::RemoteGraphicsContextGLProxy::uniform4uiv): (WebKit::RemoteGraphicsContextGLProxy::uniformMatrix2x3fv): (WebKit::RemoteGraphicsContextGLProxy::uniformMatrix3x2fv): (WebKit::RemoteGraphicsContextGLProxy::uniformMatrix2x4fv): (WebKit::RemoteGraphicsContextGLProxy::uniformMatrix4x2fv): (WebKit::RemoteGraphicsContextGLProxy::uniformMatrix3x4fv): (WebKit::RemoteGraphicsContextGLProxy::uniformMatrix4x3fv): (WebKit::RemoteGraphicsContextGLProxy::vertexAttribI4i): (WebKit::RemoteGraphicsContextGLProxy::vertexAttribI4iv): (WebKit::RemoteGraphicsContextGLProxy::vertexAttribI4ui): (WebKit::RemoteGraphicsContextGLProxy::vertexAttribI4uiv): (WebKit::RemoteGraphicsContextGLProxy::vertexAttribIPointer): (WebKit::RemoteGraphicsContextGLProxy::drawRangeElements): (WebKit::RemoteGraphicsContextGLProxy::drawBuffers): (WebKit::RemoteGraphicsContextGLProxy::clearBufferiv): (WebKit::RemoteGraphicsContextGLProxy::clearBufferuiv): (WebKit::RemoteGraphicsContextGLProxy::clearBufferfv): (WebKit::RemoteGraphicsContextGLProxy::clearBufferfi): (WebKit::RemoteGraphicsContextGLProxy::createQuery): (WebKit::RemoteGraphicsContextGLProxy::deleteQuery): (WebKit::RemoteGraphicsContextGLProxy::isQuery): (WebKit::RemoteGraphicsContextGLProxy::beginQuery): (WebKit::RemoteGraphicsContextGLProxy::endQuery): (WebKit::RemoteGraphicsContextGLProxy::getQuery): (WebKit::RemoteGraphicsContextGLProxy::getQueryObjectui): (WebKit::RemoteGraphicsContextGLProxy::createSampler): (WebKit::RemoteGraphicsContextGLProxy::deleteSampler): (WebKit::RemoteGraphicsContextGLProxy::isSampler): (WebKit::RemoteGraphicsContextGLProxy::bindSampler): (WebKit::RemoteGraphicsContextGLProxy::samplerParameteri): (WebKit::RemoteGraphicsContextGLProxy::samplerParameterf): (WebKit::RemoteGraphicsContextGLProxy::getSamplerParameterf): (WebKit::RemoteGraphicsContextGLProxy::getSamplerParameteri): (WebKit::RemoteGraphicsContextGLProxy::fenceSync): (WebKit::RemoteGraphicsContextGLProxy::isSync): (WebKit::RemoteGraphicsContextGLProxy::deleteSync): (WebKit::RemoteGraphicsContextGLProxy::clientWaitSync): (WebKit::RemoteGraphicsContextGLProxy::waitSync): (WebKit::RemoteGraphicsContextGLProxy::getSynci): (WebKit::RemoteGraphicsContextGLProxy::createTransformFeedback): (WebKit::RemoteGraphicsContextGLProxy::deleteTransformFeedback): (WebKit::RemoteGraphicsContextGLProxy::isTransformFeedback): (WebKit::RemoteGraphicsContextGLProxy::bindTransformFeedback): (WebKit::RemoteGraphicsContextGLProxy::beginTransformFeedback): (WebKit::RemoteGraphicsContextGLProxy::endTransformFeedback): (WebKit::RemoteGraphicsContextGLProxy::transformFeedbackVaryings): (WebKit::RemoteGraphicsContextGLProxy::getTransformFeedbackVarying): (WebKit::RemoteGraphicsContextGLProxy::pauseTransformFeedback): (WebKit::RemoteGraphicsContextGLProxy::resumeTransformFeedback): (WebKit::RemoteGraphicsContextGLProxy::bindBufferBase): (WebKit::RemoteGraphicsContextGLProxy::bindBufferRange): (WebKit::RemoteGraphicsContextGLProxy::getUniformIndices): (WebKit::RemoteGraphicsContextGLProxy::getActiveUniforms): (WebKit::RemoteGraphicsContextGLProxy::getUniformBlockIndex): (WebKit::RemoteGraphicsContextGLProxy::getActiveUniformBlockName): (WebKit::RemoteGraphicsContextGLProxy::uniformBlockBinding): (WebKit::RemoteGraphicsContextGLProxy::getActiveUniformBlockiv): (WebKit::RemoteGraphicsContextGLProxy::getGraphicsResetStatusARB): (WebKit::RemoteGraphicsContextGLProxy::blitFramebufferANGLE): (WebKit::RemoteGraphicsContextGLProxy::renderbufferStorageMultisampleANGLE): (WebKit::RemoteGraphicsContextGLProxy::createVertexArrayOES): (WebKit::RemoteGraphicsContextGLProxy::deleteVertexArrayOES): (WebKit::RemoteGraphicsContextGLProxy::isVertexArrayOES): (WebKit::RemoteGraphicsContextGLProxy::bindVertexArrayOES): (WebKit::RemoteGraphicsContextGLProxy::getTranslatedShaderSourceANGLE): (WebKit::RemoteGraphicsContextGLProxy::insertEventMarkerEXT): (WebKit::RemoteGraphicsContextGLProxy::pushGroupMarkerEXT): (WebKit::RemoteGraphicsContextGLProxy::popGroupMarkerEXT): (WebKit::RemoteGraphicsContextGLProxy::drawBuffersEXT): (WebKit::RemoteGraphicsContextGLProxy::drawArraysInstancedANGLE): (WebKit::RemoteGraphicsContextGLProxy::drawElementsInstancedANGLE): (WebKit::RemoteGraphicsContextGLProxy::vertexAttribDivisorANGLE): (WebKit::RemoteGraphicsContextGLProxy::getInternalformativ): (WebKit::RemoteGraphicsContextGLProxy::readPixelsRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::texParameterfvRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::texParameterivRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getQueryivRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getQueryObjectuivRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getBufferPointervRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getInternalformativRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getVertexAttribIivRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getVertexAttribIuivRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getUniformuivRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getBufferParameteri64vRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::samplerParameterivRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::samplerParameterfvRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getSamplerParameterivRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getSamplerParameterfvRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getFramebufferParameterivRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getProgramInterfaceivRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getBooleani_vRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getMultisamplefvRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getTexLevelParameterivRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getTexLevelParameterfvRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getPointervRobustANGLERobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getnUniformfvRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getnUniformivRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getnUniformuivRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::texParameterIivRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::texParameterIuivRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getTexParameterIivRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getTexParameterIuivRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::samplerParameterIivRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::samplerParameterIuivRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getSamplerParameterIivRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getSamplerParameterIuivRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getQueryObjectivRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getQueryObjecti64vRobustANGLE): (WebKit::RemoteGraphicsContextGLProxy::getQueryObjectui64vRobustANGLE): * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::copyVideoTextureToPlatformTexture): * WebProcess/GPU/media/RemoteAudioDestinationProxy.cpp: (WebKit::RemoteAudioDestinationProxy::connectToGPUProcess): * WebProcess/GPU/media/RemoteAudioSession.cpp: * WebProcess/GPU/media/RemoteAudioSourceProviderManager.cpp: * WebProcess/GPU/media/RemoteAudioSourceProviderManager.h: * WebProcess/GPU/media/RemoteLegacyCDMSession.cpp: * WebProcess/GPU/media/SourceBufferPrivateRemote.h: * WebProcess/GPU/media/TextTrackPrivateRemote.h: * WebProcess/GPU/webrtc/LibWebRTCCodecs.cpp: * WebProcess/GPU/webrtc/LibWebRTCCodecs.h: * WebProcess/InjectedBundle/InjectedBundle.h: * WebProcess/Network/NetworkProcessConnection.h: * WebProcess/Network/WebResourceLoader.cpp: * WebProcess/Network/WebResourceLoader.h: * WebProcess/Network/WebSocketChannel.cpp: * WebProcess/Network/WebSocketChannel.h: * WebProcess/Network/WebSocketStream.cpp: * WebProcess/Network/WebSocketStream.h: * WebProcess/Network/webrtc/LibWebRTCSocket.h: * WebProcess/Plugins/PDF/PDFPlugin.h: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::createGraphicsContextGL const): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::m_limitsNavigationsToAppBoundDomains): (WebKit::WebPage::updatePreferences): * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::sendSyncWithDelayedReply): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::handleEditingKeyboardEvent): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::setUseGPUProcessForWebGL): (WebKit::WebProcess::shouldUseRemoteRenderingForWebGL const): * WebProcess/WebProcess.h: Tools: Implement RemoteGraphicsContextGL https://bugs.webkit.org/show_bug.cgi?id=217216 <rdar://problem/69876258> Patch by Kimmo Kinnunen <kkinnunen@apple.com> on 2020-12-09 Reviewed by Simon Fraser. Implements a remote version of GraphicsContextGL for GPU process. Current implementation is using WebKit IPC and is incomplete. Add the code generator to generate the implementation. Currently the generator generates a WebKit IPC implementation. The input definition to the generator is the proxy implementation header files. The output of the generator is - WebKit IPC message definition file - Message sender code - Message receiver and payload invocation code The generator converts GraphicsContextGL GCGL -prefixed types to sized IPC types. The generator is invoked during development time and the results are stored in the repository. * Scripts/generate-gpup-webgl: Added. LayoutTests: Implement RemoteGraphicsContextGL https://bugs.webkit.org/show_bug.cgi?id=217216 <rdar://problem/69876258> Patch by Kimmo Kinnunen <kkinnunen@apple.com> on 2020-12-09 Reviewed by Simon Fraser. Implements a beginning of a remote version of GraphicsContextGL for GPU process. Current implementation is using WebKit IPC. Adds test expectations for the missing functionality. Does not yet enable the tests that actually pass but which were skipped before the implementation. * gpu-process/TestExpectations: Canonical link: https://commits.webkit.org/232258@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270587 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-12-09 18:32:29 +00:00
platform/graphics/cocoa/RemoteGraphicsContextGLProxyBaseCocoa.mm
[Cocoa] Add experimental MSE WebM parser https://bugs.webkit.org/show_bug.cgi?id=214529 Source/ThirdParty/libwebrtc: <rdar://problem/65782467> Reviewed by Eric Carlson. Add the vp9_header_parser from libwebrtc to the project, and add its symbols to the list of exported symbols. Because this header wants to be installed to a "common/vp9_header_parser.h" path, split up the default CopyHeadersInstallPhase into two separate CopyFiles build phases that put headers into different locations. * Configurations/libwebm.xcconfig: * Configurations/libwebrtc.iOS.exp: * Configurations/libwebrtc.iOSsim.exp: * Configurations/libwebrtc.mac.exp: * Source/third_party/libwebm/common/vp9_header_parser.h: (vp9_parser::Vp9HeaderParser::color_range const): (vp9_parser::Vp9HeaderParser::subsampling_x const): (vp9_parser::Vp9HeaderParser::subsampling_y const): * libwebrtc.xcodeproj/project.pbxproj: Source/WebCore: Reviewed by Eric Carlson. Test: media/media-source/media-source-webm.html Add an experimental MSE WebM parser to SourceBufferPrivateAVFObjC. This will require extensive refactoring of SourceBufferPrivateAVFObjC, to extract out the parser into a new, virtualized class. This new parser can take advantage of new C++>11 features such as lambdas to clean up some problematic existing code. The new virtualized SourceBufferParser class uses passed-in Function objects, rather than pure-virtual Client classes to notify it's parent object when the parser encounters initialization- or media-data. Because SourceBufferPrivateAVFObjC will now have to deal with AudioTrackPrivate and VideoTrackPrivate objects that are not necessarily Audio- and VideoTrackPrivateMediaSourceAVFObjC subclasses, move those classes notification features up into Audio- and VideoTrackPrivate, again using a Function object rather than a client class. Add a new SourceBufferParserWebM and associated AudioTrackPrivateWebM and VideoTrackPrivateWebM classes, which use libwebm via libwebrtc to parse appended buffers. SourceBufferParserWebM feeds passed-in data into a libwebm-provided parser of its own. It then builds up tracks and samples based on callbacks from that same parser, constructing CMSampleBuffers and VideoTrackPrivate objects out of the underlying libwebm primitives. Because WebM uses a UUID as its track identifier, the representation of a "trackID" inside WebCore must be increased from an int to a uint64_t, or trackIDs will be truncated or zeroed when passed between classes and when converted to and from AtomStrings. This early implementation is not yet able to pass the WebM WPT media-source/ tests, as we only have a VP9 decoder available, and those tests use both VP8 and Vorbis. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setWebMParserEnabled): (WebCore::RuntimeEnabledFeatures::webMParserEnabled const): * platform/graphics/AudioTrackPrivate.h: (WebCore::AudioTrackPrivate::setEnabled): (WebCore::AudioTrackPrivate::setEnabledChangedCallback): * platform/graphics/VP9Utilities.cpp: (WebCore::isValidVPColorPrimaries): (WebCore::isValidVPTransferCharacteristics): (WebCore::isValidVPMatrixCoefficients): (WebCore::parseVPCodecParameters): * platform/graphics/VP9Utilities.h: * platform/graphics/VideoTrackPrivate.h: (WebCore::VideoTrackPrivate::setSelected): (WebCore::VideoTrackPrivate::setSelectedChangedCallback): * platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.cpp: (WebCore::AudioTrackPrivateMediaSourceAVFObjC::AudioTrackPrivateMediaSourceAVFObjC): (WebCore::AudioTrackPrivateMediaSourceAVFObjC::setEnabled): * platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm: (WebCore::CDMSessionAVContentKeySession::update): * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm: (WebCore::CDMSessionAVStreamSession::update): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType): * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h: (WebCore::MediaSampleAVFObjC::create): (WebCore::MediaSampleAVFObjC::MediaSampleAVFObjC): * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm: (WebCore::MediaSourcePrivateAVFObjC::addSourceBuffer): * platform/graphics/avfoundation/objc/SourceBufferParserAVFObjC.h: Added. (isType): * platform/graphics/avfoundation/objc/SourceBufferParserAVFObjC.mm: Added. (-[WebAVStreamDataParserListener initWithParser:parent:]): (-[WebAVStreamDataParserListener dealloc]): (-[WebAVStreamDataParserListener invalidate]): (-[WebAVStreamDataParserListener streamDataParser:didParseStreamDataAsAsset:]): (-[WebAVStreamDataParserListener streamDataParser:didParseStreamDataAsAsset:withDiscontinuity:]): (-[WebAVStreamDataParserListener streamDataParser:didFailToParseStreamDataWithError:]): (-[WebAVStreamDataParserListener streamDataParser:didProvideMediaData:forTrackID:mediaType:flags:]): (-[WebAVStreamDataParserListener streamDataParserWillProvideContentKeyRequestInitializationData:forTrackID:]): (-[WebAVStreamDataParserListener streamDataParser:didProvideContentKeyRequestInitializationData:forTrackID:]): (WebCore::SourceBufferParserAVFObjC::isContentTypeSupported): (WebCore::SourceBufferParserAVFObjC::SourceBufferParserAVFObjC): (WebCore::SourceBufferParserAVFObjC::~SourceBufferParserAVFObjC): (WebCore::SourceBufferParserAVFObjC::appendData): (WebCore::SourceBufferParserAVFObjC::flushPendingMediaData): (WebCore::SourceBufferParserAVFObjC::setShouldProvideMediaDataForTrackID): (WebCore::SourceBufferParserAVFObjC::shouldProvideMediadataForTrackID): (WebCore::SourceBufferParserAVFObjC::resetParserState): (WebCore::SourceBufferParserAVFObjC::didParseStreamDataAsAsset): (WebCore::SourceBufferParserAVFObjC::didFailToParseStreamDataWithError): (WebCore::SourceBufferParserAVFObjC::didProvideMediaDataForTrackID): (WebCore::SourceBufferParserAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID): (WebCore::SourceBufferParserAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID): * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::SourceBufferPrivateAVFObjC::create): (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC): (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC): (WebCore::SourceBufferPrivateAVFObjC::didParseInitializationData): (WebCore::SourceBufferPrivateAVFObjC::didEncounterErrorDuringParsing): (WebCore::SourceBufferPrivateAVFObjC::didProvideMediaDataForTrackID): (WebCore::SourceBufferPrivateAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID): (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID): (WebCore::SourceBufferPrivateAVFObjC::append): (WebCore::SourceBufferPrivateAVFObjC::appendCompleted): (WebCore::SourceBufferPrivateAVFObjC::abort): (WebCore::SourceBufferPrivateAVFObjC::resetParserState): (WebCore::SourceBufferPrivateAVFObjC::destroyParser): (WebCore::SourceBufferPrivateAVFObjC::clearTracks): (WebCore::SourceBufferPrivateAVFObjC::hasSelectedVideo const): (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeSelected): (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled): (WebCore::SourceBufferPrivateAVFObjC::parser const): (WebCore::SourceBufferPrivateAVFObjC::attemptToDecrypt): (WebCore::SourceBufferPrivateAVFObjC::flush): (WebCore::SourceBufferPrivateAVFObjC::enqueueSample): (WebCore::SourceBufferPrivateAVFObjC::isReadyForMoreSamples): (WebCore::SourceBufferPrivateAVFObjC::didBecomeReadyForMoreSamples): (WebCore::SourceBufferPrivateAVFObjC::notifyClientWhenReadyForMoreSamples): (WebCore::SourceBufferPrivateAVFObjC::canSetMinimumUpcomingPresentationTime const): * platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.mm: (WebCore::VideoTrackPrivateMediaSourceAVFObjC::VideoTrackPrivateMediaSourceAVFObjC): * platform/graphics/cocoa/AudioTrackPrivateWebM.cpp: Copied from Source/WebCore/platform/graphics/cocoa/VP9UtilitiesCocoa.h. (WebCore::AudioTrackPrivateWebM::create): (WebCore::AudioTrackPrivateWebM::AudioTrackPrivateWebM): (WebCore::AudioTrackPrivateWebM::id const): (WebCore::AudioTrackPrivateWebM::label const): (WebCore::AudioTrackPrivateWebM::language const): (WebCore::AudioTrackPrivateWebM::trackIndex const): * platform/graphics/cocoa/AudioTrackPrivateWebM.h: Copied from Source/WebCore/platform/graphics/cocoa/VP9UtilitiesCocoa.h. * platform/graphics/cocoa/SourceBufferParser.cpp: Copied from Source/WebCore/platform/graphics/cocoa/VP9UtilitiesCocoa.h. (WebCore::SourceBufferParser::isContentTypeSupported): (WebCore::SourceBufferParser::create): * platform/graphics/cocoa/SourceBufferParser.h: Added. (WebCore::SourceBufferParser::setDidParseInitializationDataCallback): (WebCore::SourceBufferParser::setDidEncounterErrorDuringParsingCallback): (WebCore::SourceBufferParser::setDidProvideMediaDataCallback): (WebCore::SourceBufferParser::setWillProvideContentKeyRequestInitializationDataForTrackIDCallback): (WebCore::SourceBufferParser::setDidProvideContentKeyRequestInitializationDataForTrackIDCallback): * platform/graphics/cocoa/SourceBufferParserWebM.cpp: Added. (WebCore::isWebmParserAvailable): (WebCore::SourceBufferParserWebM::isContentTypeSupported): (WebCore::SourceBufferParserWebM::SourceBufferParserWebM): (WebCore::SourceBufferParserWebM::appendData): (WebCore::SourceBufferParserWebM::flushPendingMediaData): (WebCore::SourceBufferParserWebM::setShouldProvideMediaDataForTrackID): (WebCore::SourceBufferParserWebM::shouldProvideMediadataForTrackID): (WebCore::SourceBufferParserWebM::resetParserState): (WebCore::SourceBufferParserWebM::trackDataForTrackNumber): (WebCore::SourceBufferParserWebM::OnElementBegin): (WebCore::SourceBufferParserWebM::OnEbml): (WebCore::SourceBufferParserWebM::OnSegmentBegin): (WebCore::SourceBufferParserWebM::OnInfo): (WebCore::SourceBufferParserWebM::OnClusterBegin): (WebCore::SourceBufferParserWebM::OnTrackEntry): (WebCore::SourceBufferParserWebM::OnBlockBegin): (WebCore::SourceBufferParserWebM::OnBlockEnd): (WebCore::SourceBufferParserWebM::OnSimpleBlockBegin): (WebCore::SourceBufferParserWebM::OnSimpleBlockEnd): (WebCore::SourceBufferParserWebM::OnBlockGroupBegin): (WebCore::SourceBufferParserWebM::OnBlockGroupEnd): (WebCore::convertToColorPrimaries): (WebCore::convertToTransferCharacteristics): (WebCore::convertToMatrixCoefficients): (WebCore::convertSubsamplingXYToChromaSubsampling): (WebCore::createFormatDescriptionFromVP9HeaderParser): (WebCore::SourceBufferParserWebM::OnFrame): * platform/graphics/cocoa/SourceBufferParserWebM.h: Added. (WebCore::SourceBufferParserWebM::status const): (WebCore::SourceBufferParserWebM::type const): (isType): * platform/graphics/cocoa/VP9UtilitiesCocoa.h: * platform/graphics/cocoa/VP9UtilitiesCocoa.mm: (WebCore::isVP9DecoderAvailable): (WebCore::validateVPParameters): * platform/graphics/cocoa/VideoTrackPrivateWebM.cpp: (WebCore::VideoTrackPrivateWebM::create): (WebCore::VideoTrackPrivateWebM::VideoTrackPrivateWebM): (WebCore::VideoTrackPrivateWebM::id const): (WebCore::VideoTrackPrivateWebM::label const): (WebCore::VideoTrackPrivateWebM::language const): (WebCore::VideoTrackPrivateWebM::trackIndex const): * platform/graphics/cocoa/VideoTrackPrivateWebM.h: Source/WebKit: <rdar://problem/65782467> Reviewed by Eric Carlson. Add an Experimental setting to enable the MSE WebM parser (off by default). * Shared/WebPreferences.yaml: LayoutTests: <rdar://problem/65782467> Reviewed by Eric Carlson. * media/media-source/content/test-vp9-manifest.json: Added. * media/media-source/content/test-vp9.webm: Added. * media/media-source/media-source-webm-expected.txt: Added. * media/media-source/media-source-webm.html: Added. Canonical link: https://commits.webkit.org/227430@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@264685 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-07-22 00:25:09 +00:00
platform/graphics/cocoa/SourceBufferParser.cpp
platform/graphics/cocoa/SourceBufferParserWebM.cpp
Move SystemFontDatabase to a file of its own https://bugs.webkit.org/show_bug.cgi?id=190347 Reviewed by Chris Dumez. Also rename it to SystemFontDatabaseCoreText as it is CoreText specific. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * page/MemoryRelease.cpp: (WebCore::releaseNoncriticalMemory): * page/cocoa/MemoryReleaseCocoa.mm: Release SystemFontDatabaseCoreText directly from platform specific cleanup code. (WebCore::platformReleaseMemory): * platform/graphics/cocoa/FontDescriptionCocoa.cpp: (WebCore::FontDescription::invalidateCaches): (WebCore::systemFontCascadeList): (WebCore::FontCascadeDescription::effectiveFamilyCount const): (WebCore::FontCascadeDescription::effectiveFamilyAt const): (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::CoreTextCascadeListParameters): Deleted. (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::isHashTableDeletedValue const): Deleted. (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::operator== const): Deleted. (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::hash const): Deleted. (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::CoreTextCascadeListParametersHash::hash): Deleted. (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::CoreTextCascadeListParametersHash::equal): Deleted. (): Deleted. (WebCore::SystemFontDatabase::singleton): Deleted. (WebCore::SystemFontDatabase::systemFontCascadeList): Deleted. (WebCore::SystemFontDatabase::clear): Deleted. (WebCore::SystemFontDatabase::SystemFontDatabase): Deleted. (WebCore::SystemFontDatabase::applyWeightItalicsAndFallbackBehavior): Deleted. (WebCore::SystemFontDatabase::removeCascadeList): Deleted. (WebCore::SystemFontDatabase::computeCascadeList): Deleted. (WebCore::systemFontParameters): Deleted. * platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp: Added. (WebCore::SystemFontDatabaseCoreText::singleton): (WebCore::SystemFontDatabaseCoreText::SystemFontDatabaseCoreText): (WebCore::SystemFontDatabaseCoreText::systemFontCascadeList): (WebCore::SystemFontDatabaseCoreText::clear): (WebCore::SystemFontDatabaseCoreText::applyWeightItalicsAndFallbackBehavior): (WebCore::SystemFontDatabaseCoreText::removeCascadeList): (WebCore::SystemFontDatabaseCoreText::computeCascadeList): (WebCore::SystemFontDatabaseCoreText::systemFontParameters): * platform/graphics/cocoa/SystemFontDatabaseCoreText.h: Added. (WebCore::SystemFontDatabaseCoreText::CascadeListParameters::CascadeListParameters): (WebCore::SystemFontDatabaseCoreText::CascadeListParameters::isHashTableDeletedValue const): (WebCore::SystemFontDatabaseCoreText::CascadeListParameters::operator== const): (WebCore::SystemFontDatabaseCoreText::CascadeListParameters::hash const): (WebCore::SystemFontDatabaseCoreText::CascadeListParameters::CascadeListParametersHash::hash): (WebCore::SystemFontDatabaseCoreText::CascadeListParameters::CascadeListParametersHash::equal): * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp: Canonical link: https://commits.webkit.org/205326@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236938 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-08 20:37:26 +00:00
platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp
platform/graphics/cocoa/TextTrackRepresentationCocoa.mm
platform/graphics/cocoa/VP9UtilitiesCocoa.mm @no-unify
platform/graphics/cocoa/WebActionDisablingCALayerDelegate.mm
platform/graphics/cocoa/WebCoreCALayerExtras.mm
platform/graphics/cocoa/WebCoreDecompressionSession.mm
platform/graphics/cocoa/WebGLLayer.mm
[Cocoa] Add experimental MSE WebM parser https://bugs.webkit.org/show_bug.cgi?id=214529 Source/ThirdParty/libwebrtc: <rdar://problem/65782467> Reviewed by Eric Carlson. Add the vp9_header_parser from libwebrtc to the project, and add its symbols to the list of exported symbols. Because this header wants to be installed to a "common/vp9_header_parser.h" path, split up the default CopyHeadersInstallPhase into two separate CopyFiles build phases that put headers into different locations. * Configurations/libwebm.xcconfig: * Configurations/libwebrtc.iOS.exp: * Configurations/libwebrtc.iOSsim.exp: * Configurations/libwebrtc.mac.exp: * Source/third_party/libwebm/common/vp9_header_parser.h: (vp9_parser::Vp9HeaderParser::color_range const): (vp9_parser::Vp9HeaderParser::subsampling_x const): (vp9_parser::Vp9HeaderParser::subsampling_y const): * libwebrtc.xcodeproj/project.pbxproj: Source/WebCore: Reviewed by Eric Carlson. Test: media/media-source/media-source-webm.html Add an experimental MSE WebM parser to SourceBufferPrivateAVFObjC. This will require extensive refactoring of SourceBufferPrivateAVFObjC, to extract out the parser into a new, virtualized class. This new parser can take advantage of new C++>11 features such as lambdas to clean up some problematic existing code. The new virtualized SourceBufferParser class uses passed-in Function objects, rather than pure-virtual Client classes to notify it's parent object when the parser encounters initialization- or media-data. Because SourceBufferPrivateAVFObjC will now have to deal with AudioTrackPrivate and VideoTrackPrivate objects that are not necessarily Audio- and VideoTrackPrivateMediaSourceAVFObjC subclasses, move those classes notification features up into Audio- and VideoTrackPrivate, again using a Function object rather than a client class. Add a new SourceBufferParserWebM and associated AudioTrackPrivateWebM and VideoTrackPrivateWebM classes, which use libwebm via libwebrtc to parse appended buffers. SourceBufferParserWebM feeds passed-in data into a libwebm-provided parser of its own. It then builds up tracks and samples based on callbacks from that same parser, constructing CMSampleBuffers and VideoTrackPrivate objects out of the underlying libwebm primitives. Because WebM uses a UUID as its track identifier, the representation of a "trackID" inside WebCore must be increased from an int to a uint64_t, or trackIDs will be truncated or zeroed when passed between classes and when converted to and from AtomStrings. This early implementation is not yet able to pass the WebM WPT media-source/ tests, as we only have a VP9 decoder available, and those tests use both VP8 and Vorbis. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setWebMParserEnabled): (WebCore::RuntimeEnabledFeatures::webMParserEnabled const): * platform/graphics/AudioTrackPrivate.h: (WebCore::AudioTrackPrivate::setEnabled): (WebCore::AudioTrackPrivate::setEnabledChangedCallback): * platform/graphics/VP9Utilities.cpp: (WebCore::isValidVPColorPrimaries): (WebCore::isValidVPTransferCharacteristics): (WebCore::isValidVPMatrixCoefficients): (WebCore::parseVPCodecParameters): * platform/graphics/VP9Utilities.h: * platform/graphics/VideoTrackPrivate.h: (WebCore::VideoTrackPrivate::setSelected): (WebCore::VideoTrackPrivate::setSelectedChangedCallback): * platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.cpp: (WebCore::AudioTrackPrivateMediaSourceAVFObjC::AudioTrackPrivateMediaSourceAVFObjC): (WebCore::AudioTrackPrivateMediaSourceAVFObjC::setEnabled): * platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm: (WebCore::CDMSessionAVContentKeySession::update): * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm: (WebCore::CDMSessionAVStreamSession::update): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType): * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h: (WebCore::MediaSampleAVFObjC::create): (WebCore::MediaSampleAVFObjC::MediaSampleAVFObjC): * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm: (WebCore::MediaSourcePrivateAVFObjC::addSourceBuffer): * platform/graphics/avfoundation/objc/SourceBufferParserAVFObjC.h: Added. (isType): * platform/graphics/avfoundation/objc/SourceBufferParserAVFObjC.mm: Added. (-[WebAVStreamDataParserListener initWithParser:parent:]): (-[WebAVStreamDataParserListener dealloc]): (-[WebAVStreamDataParserListener invalidate]): (-[WebAVStreamDataParserListener streamDataParser:didParseStreamDataAsAsset:]): (-[WebAVStreamDataParserListener streamDataParser:didParseStreamDataAsAsset:withDiscontinuity:]): (-[WebAVStreamDataParserListener streamDataParser:didFailToParseStreamDataWithError:]): (-[WebAVStreamDataParserListener streamDataParser:didProvideMediaData:forTrackID:mediaType:flags:]): (-[WebAVStreamDataParserListener streamDataParserWillProvideContentKeyRequestInitializationData:forTrackID:]): (-[WebAVStreamDataParserListener streamDataParser:didProvideContentKeyRequestInitializationData:forTrackID:]): (WebCore::SourceBufferParserAVFObjC::isContentTypeSupported): (WebCore::SourceBufferParserAVFObjC::SourceBufferParserAVFObjC): (WebCore::SourceBufferParserAVFObjC::~SourceBufferParserAVFObjC): (WebCore::SourceBufferParserAVFObjC::appendData): (WebCore::SourceBufferParserAVFObjC::flushPendingMediaData): (WebCore::SourceBufferParserAVFObjC::setShouldProvideMediaDataForTrackID): (WebCore::SourceBufferParserAVFObjC::shouldProvideMediadataForTrackID): (WebCore::SourceBufferParserAVFObjC::resetParserState): (WebCore::SourceBufferParserAVFObjC::didParseStreamDataAsAsset): (WebCore::SourceBufferParserAVFObjC::didFailToParseStreamDataWithError): (WebCore::SourceBufferParserAVFObjC::didProvideMediaDataForTrackID): (WebCore::SourceBufferParserAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID): (WebCore::SourceBufferParserAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID): * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::SourceBufferPrivateAVFObjC::create): (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC): (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC): (WebCore::SourceBufferPrivateAVFObjC::didParseInitializationData): (WebCore::SourceBufferPrivateAVFObjC::didEncounterErrorDuringParsing): (WebCore::SourceBufferPrivateAVFObjC::didProvideMediaDataForTrackID): (WebCore::SourceBufferPrivateAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID): (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID): (WebCore::SourceBufferPrivateAVFObjC::append): (WebCore::SourceBufferPrivateAVFObjC::appendCompleted): (WebCore::SourceBufferPrivateAVFObjC::abort): (WebCore::SourceBufferPrivateAVFObjC::resetParserState): (WebCore::SourceBufferPrivateAVFObjC::destroyParser): (WebCore::SourceBufferPrivateAVFObjC::clearTracks): (WebCore::SourceBufferPrivateAVFObjC::hasSelectedVideo const): (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeSelected): (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled): (WebCore::SourceBufferPrivateAVFObjC::parser const): (WebCore::SourceBufferPrivateAVFObjC::attemptToDecrypt): (WebCore::SourceBufferPrivateAVFObjC::flush): (WebCore::SourceBufferPrivateAVFObjC::enqueueSample): (WebCore::SourceBufferPrivateAVFObjC::isReadyForMoreSamples): (WebCore::SourceBufferPrivateAVFObjC::didBecomeReadyForMoreSamples): (WebCore::SourceBufferPrivateAVFObjC::notifyClientWhenReadyForMoreSamples): (WebCore::SourceBufferPrivateAVFObjC::canSetMinimumUpcomingPresentationTime const): * platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.mm: (WebCore::VideoTrackPrivateMediaSourceAVFObjC::VideoTrackPrivateMediaSourceAVFObjC): * platform/graphics/cocoa/AudioTrackPrivateWebM.cpp: Copied from Source/WebCore/platform/graphics/cocoa/VP9UtilitiesCocoa.h. (WebCore::AudioTrackPrivateWebM::create): (WebCore::AudioTrackPrivateWebM::AudioTrackPrivateWebM): (WebCore::AudioTrackPrivateWebM::id const): (WebCore::AudioTrackPrivateWebM::label const): (WebCore::AudioTrackPrivateWebM::language const): (WebCore::AudioTrackPrivateWebM::trackIndex const): * platform/graphics/cocoa/AudioTrackPrivateWebM.h: Copied from Source/WebCore/platform/graphics/cocoa/VP9UtilitiesCocoa.h. * platform/graphics/cocoa/SourceBufferParser.cpp: Copied from Source/WebCore/platform/graphics/cocoa/VP9UtilitiesCocoa.h. (WebCore::SourceBufferParser::isContentTypeSupported): (WebCore::SourceBufferParser::create): * platform/graphics/cocoa/SourceBufferParser.h: Added. (WebCore::SourceBufferParser::setDidParseInitializationDataCallback): (WebCore::SourceBufferParser::setDidEncounterErrorDuringParsingCallback): (WebCore::SourceBufferParser::setDidProvideMediaDataCallback): (WebCore::SourceBufferParser::setWillProvideContentKeyRequestInitializationDataForTrackIDCallback): (WebCore::SourceBufferParser::setDidProvideContentKeyRequestInitializationDataForTrackIDCallback): * platform/graphics/cocoa/SourceBufferParserWebM.cpp: Added. (WebCore::isWebmParserAvailable): (WebCore::SourceBufferParserWebM::isContentTypeSupported): (WebCore::SourceBufferParserWebM::SourceBufferParserWebM): (WebCore::SourceBufferParserWebM::appendData): (WebCore::SourceBufferParserWebM::flushPendingMediaData): (WebCore::SourceBufferParserWebM::setShouldProvideMediaDataForTrackID): (WebCore::SourceBufferParserWebM::shouldProvideMediadataForTrackID): (WebCore::SourceBufferParserWebM::resetParserState): (WebCore::SourceBufferParserWebM::trackDataForTrackNumber): (WebCore::SourceBufferParserWebM::OnElementBegin): (WebCore::SourceBufferParserWebM::OnEbml): (WebCore::SourceBufferParserWebM::OnSegmentBegin): (WebCore::SourceBufferParserWebM::OnInfo): (WebCore::SourceBufferParserWebM::OnClusterBegin): (WebCore::SourceBufferParserWebM::OnTrackEntry): (WebCore::SourceBufferParserWebM::OnBlockBegin): (WebCore::SourceBufferParserWebM::OnBlockEnd): (WebCore::SourceBufferParserWebM::OnSimpleBlockBegin): (WebCore::SourceBufferParserWebM::OnSimpleBlockEnd): (WebCore::SourceBufferParserWebM::OnBlockGroupBegin): (WebCore::SourceBufferParserWebM::OnBlockGroupEnd): (WebCore::convertToColorPrimaries): (WebCore::convertToTransferCharacteristics): (WebCore::convertToMatrixCoefficients): (WebCore::convertSubsamplingXYToChromaSubsampling): (WebCore::createFormatDescriptionFromVP9HeaderParser): (WebCore::SourceBufferParserWebM::OnFrame): * platform/graphics/cocoa/SourceBufferParserWebM.h: Added. (WebCore::SourceBufferParserWebM::status const): (WebCore::SourceBufferParserWebM::type const): (isType): * platform/graphics/cocoa/VP9UtilitiesCocoa.h: * platform/graphics/cocoa/VP9UtilitiesCocoa.mm: (WebCore::isVP9DecoderAvailable): (WebCore::validateVPParameters): * platform/graphics/cocoa/VideoTrackPrivateWebM.cpp: (WebCore::VideoTrackPrivateWebM::create): (WebCore::VideoTrackPrivateWebM::VideoTrackPrivateWebM): (WebCore::VideoTrackPrivateWebM::id const): (WebCore::VideoTrackPrivateWebM::label const): (WebCore::VideoTrackPrivateWebM::language const): (WebCore::VideoTrackPrivateWebM::trackIndex const): * platform/graphics/cocoa/VideoTrackPrivateWebM.h: Source/WebKit: <rdar://problem/65782467> Reviewed by Eric Carlson. Add an Experimental setting to enable the MSE WebM parser (off by default). * Shared/WebPreferences.yaml: LayoutTests: <rdar://problem/65782467> Reviewed by Eric Carlson. * media/media-source/content/test-vp9-manifest.json: Added. * media/media-source/content/test-vp9.webm: Added. * media/media-source/media-source-webm-expected.txt: Added. * media/media-source/media-source-webm.html: Added. Canonical link: https://commits.webkit.org/227430@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@264685 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-07-22 00:25:09 +00:00
platform/graphics/cocoa/VideoTrackPrivateWebM.cpp
platform/graphics/coretext/FontCascadeCoreText.cpp
platform/graphics/coretext/FontCoreText.cpp
platform/graphics/coretext/FontPlatformDataCoreText.cpp
platform/graphics/coretext/GlyphPageCoreText.cpp
[MediaStream] Consolidate all image conversion and resizing into one class https://bugs.webkit.org/show_bug.cgi?id=190519 <rdar://problem/45224307> Reviewed by Youenn Fablet. No new tests, no functional change. * SourcesCocoa.txt: Add ImageTransferSessionVT. * WebCore.xcodeproj/project.pbxproj: Ditto. * platform/MediaSample.h: (WebCore::MediaSample::videoPixelFormat const): New. * platform/cocoa/VideoToolboxSoftLink.cpp: Add new kVTPixelTransferProperty keys. * platform/cocoa/VideoToolboxSoftLink.h: * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h: (WebCore::MediaSampleAVFObjC::create): Remove unimplemented variant. * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm: (WebCore::MediaSampleAVFObjC::videoPixelFormat const): New. * platform/graphics/cv/ImageTransferSessionVT.h: Added. (WebCore::ImageTransferSessionVT::create): * platform/graphics/cv/ImageTransferSessionVT.mm: Added. (WebCore::ImageTransferSessionVT::ImageTransferSessionVT): (WebCore::ImageTransferSessionVT::~ImageTransferSessionVT): (WebCore::ImageTransferSessionVT::setSize): (WebCore::ImageTransferSessionVT::createPixelBuffer): (WebCore::ImageTransferSessionVT::createCMSampleBuffer): (WebCore::roundUpToMacroblockMultiple): (WebCore::ImageTransferSessionVT::ioSurfacePixelBufferCreationOptions): (WebCore::ImageTransferSessionVT::createMediaSample): * platform/graphics/cv/PixelBufferResizer.h: Removed. * platform/graphics/cv/PixelBufferResizer.mm: Removed. * platform/mediastream/mac/AVVideoCaptureSource.h: * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::prefersPreset): (WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection): Remove the resizing logic, it is handled by the base class. * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp: (WebCore::DisplayCaptureSourceCocoa::capabilities): (WebCore::DisplayCaptureSourceCocoa::settingsDidChange): (WebCore::DisplayCaptureSourceCocoa::setIntrinsicSize): (WebCore::DisplayCaptureSourceCocoa::emitFrame): Remove resizing logic, just use a transfer session to create an image from the capture source native output format. (WebCore::DisplayCaptureSourceCocoa::sampleBufferFromPixelBuffer): Deleted. (WebCore::roundUpToMacroblockMultiple): Deleted. (WebCore::DisplayCaptureSourceCocoa::pixelBufferFromIOSurface): Deleted. * platform/mediastream/mac/DisplayCaptureSourceCocoa.h: * platform/mediastream/mac/MockRealtimeVideoSourceMac.h: * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm: (WebCore::MockRealtimeVideoSourceMac::updateSampleBuffer): Use image transfer session. (WebCore::MockRealtimeVideoSourceMac::CMSampleBufferFromPixelBuffer): Deleted. (WebCore::MockRealtimeVideoSourceMac::pixelBufferFromCGImage const): Deleted. (WebCore::MockRealtimeVideoSourceMac::setSizeAndFrameRateWithPreset): Deleted. * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h: * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm: (WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream): (WebCore::ScreenDisplayCaptureSourceMac::generateFrame): Return the IOSurface directly. * platform/mediastream/mac/WindowDisplayCaptureSourceMac.h: * platform/mediastream/mac/WindowDisplayCaptureSourceMac.mm: (WebCore::WindowDisplayCaptureSourceMac::generateFrame): Return the CGImage directly. (WebCore::WindowDisplayCaptureSourceMac::pixelBufferFromCGImage): Deleted. * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::MockRealtimeVideoSource::capabilities): Only the camera supports device ID. (WebCore::MockRealtimeVideoSource::settings): Ditto. Canonical link: https://commits.webkit.org/205607@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237236 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-17 21:55:36 +00:00
platform/graphics/cv/ImageTransferSessionVT.mm
platform/graphics/cv/PixelBufferConformerCV.cpp
Refactor VideoTextureCopier to be specific to a particular GraphicsContextGL and polymorphic to it https://bugs.webkit.org/show_bug.cgi?id=217218 <rdar://problem/69876433> Patch by Kimmo Kinnunen <kkinnunen@apple.com> on 2020-11-11 Reviewed by Dean Jackson. Work towards WebGL implementation which uses GraphicsContextGL abstract base class instead of GraphicsContextGLOpenGL concrete class. Relatively minimal changes to make AVFOUNDATION variants of MediaPlayerPrivate compile when GraphicsContextGL is passed as the context instead of GraphicsContextGLOpenGL. Changes functionality so that the conversion resources (shaders, FBO) are allocated per context instead of previously per video element. This also means that context loss is handled correctly for the element. Removes unused RGB texture copying code from the copy implementation. This was left unused when OpenGL and OpenGL ES backends for AVF users were removed. Makes it possible to have GraphicsContextGLRemote that is able to copy both AVF media textures as well as remote media textures. Makes it possible to have Cocoa variant of GraphicsContextGLOpenGL that is able to copy both AVF media textures as well as remote media textures. Changes only the AVF variants of MediaPlayerPrivate, not the GStreamer variants. Similar interface GraphicsContextGLGStreamer could be implemented for GStreamer if/when remote WebGL would support GStreamer. If this is not done, a downcast from GraphicsContextGL to GraphicsContextGLOpenGL can be added at the moment when the GraphicsContextGLOpenGL uses in core WebGL are modified to GraphicsContextGL uses. No new tests, a refactor. * PlatformMac.cmake: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/GraphicsContextGL.h: * platform/graphics/angle/GraphicsContextGLANGLE.cpp: (WebCore::GraphicsContextGLOpenGL::asCV): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::copyVideoTextureToPlatformTexture): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::copyVideoTextureToPlatformTexture): * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm: (WebCore::GraphicsContextGLOpenGL::~GraphicsContextGLOpenGL): * platform/graphics/cv/GraphicsContextGLCV.h: Added. * platform/graphics/cv/GraphicsContextGLCVANGLE.cpp: Renamed from Source/WebCore/platform/graphics/cv/VideoTextureCopierCV.cpp. (WebCore::GraphicsContextGLCVANGLE::GraphicsContextGLCVANGLE): (WebCore::GraphicsContextGLCVANGLE::~GraphicsContextGLCVANGLE): (WebCore::GraphicsContextGLCVANGLE::initializeUVContextObjects): (WebCore::GraphicsContextGLCVANGLE::attachIOSurfaceToTexture): (WebCore::GraphicsContextGLCVANGLE::detachIOSurfaceFromTexture): (WebCore::GraphicsContextGLCVANGLE::copyPixelBufferToTexture): * platform/graphics/cv/GraphicsContextGLCVANGLE.h: Renamed from Source/WebCore/platform/graphics/cv/VideoTextureCopierCV.h. * platform/graphics/opengl/GraphicsContextGLOpenGL.h: Canonical link: https://commits.webkit.org/231457@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269678 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-11-11 10:44:25 +00:00
platform/graphics/cv/GraphicsContextGLCVANGLE.cpp
Infrastructure Work for Integrating CoreImage for Accelerated CSS/SVG Filter Rendering https://bugs.webkit.org/show_bug.cgi?id=213672 Patch by Guowei Yang <guowei_yang@apple.com> on 2020-07-23 Reviewed by Simon Fraser. This patch is the infrastructure work to enable filter rendering using CoreImage. The design of this code is as follows: 0) changing WebCore configuration for using CoreImage framework from iOS/mac only to unconditional, so watchOS and tvOS could also use CoreImage 1) adding a new API to obtain the IOSurface from an AcceleratedImageBuffer since CoreImage needs to render to an IOSurface 2) Instead of applying the filters inside FilterEffect, a new class, FilterEffectRendererCoreImage is designed to handle the rendering. We hide the implementation details by subclassing from a generic FilterEffectRenderer class. This also has the benefit of organizing CoreImage obj-c calls in one place. This class owns a FilterEffect node, that is the last FilterEffect of a given filter graph. The filter graph will be traversed backwards and filter parameters is gathered along the way. Then CIFilters will be created and connected to a larger CIFilter graph. The output of the CIFilter graph will be rendered to the IOSurface of a newly created AcceleratedImageBuffer. This image buffer will be returned to RenderLayerFilters and rendered to the screen 3) Inside CSSFilter::build, we first try to create a FilterEffectRenderer by passing in a renderer setting. A valid pointer will be returned only when the following two conditions are met: . CoreImage rendering is enabled in settings . All the filters inside the filter graph is implemented using CIFilters No new tests are required as this is the infrastructure code for integrating CoreImage This patch should pass all the existing css3/filters tests * Configurations/WebCore.xcconfig: modified flag definition so that CoreImage is used on all Apple Platforms, not only iPhone. * Sources.txt: Added the generic FilterEffectRenderer class file * SourcesCocoa.txt: added FilterEffectRendererCoreImage.mm * WebCore.xcodeproj/project.pbxproj: Reflecting newly added files, with some ordering changes * platform/graphics/ConcreteImageBuffer.h: overrides isAccelerated() function that returns true only if the backend is IOSurface * platform/graphics/ImageBuffer.h: defined virtual function isAccelerated() * platform/graphics/ImageBufferBackend.h: defined virtual function isAccelerated() that returns false in the base class (WebCore::ImageBufferBackend::isAccelerated const): returns false for the base class * platform/graphics/PlatformImageBuffer.h: added SPECIALIZE_TYPE_TRAITS to check what type of ImageBufferBackend is * platform/graphics/PlatformImageBuffer.h: Added API to obtain IOSurface from IOSurfaceBackend; added SPECIALIZE_TYPE_TRAITS (WebCore::AcceleratedImageBuffer::surface): Obtain the IOSurface pointer from ImageBufferIOSurfaceBackend (isType): check if a given ImageBuffer is type AcceleratedImageBuffer * platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp: (WebCore::ImageBufferIOSurfaceBackend::surface): added an API to get the IOSurface pointer (WebCore::ImageBufferIOSurfaceBackend::isAccelerated const): returns true because it is an accelerated image buffer * platform/graphics/cg/ImageBufferIOSurfaceBackend.h: added function surface() and isAccelerated() * platform/graphics/coreimage/FilterEffectRendererCoreImage.h: Added. * platform/graphics/coreimage/FilterEffectRendererCoreImage.mm: Added. (WebCore::FilterEffectRendererCoreImage::tryCreate): creates a FilterEffectRendererCoreImage unique pointer. If the filters inside the graph are not all implemented, we return nullptr (WebCore::FilterEffectRendererCoreImage::supportsCoreImageRendering): a function that takes in FilterEffect& and returns true if its a filter effect type that is implemented in CoreImage, false otherwise (WebCore::FilterEffectRendererCoreImage::applyEffects): takes in a FilterEffect pointer, calls FilterEffectRendererCoreImage::connectCIFilters to create the final output CIImage (WebCore::FilterEffectRendererCoreImage::connectCIFilters): recursive helper function that traverses the FilterEffect graph backwards, creates CIFilter graph based on the subclass type of current processing FilterEffect node. It will cache the CIFilter in a hashmap, whose key is the corresponding FilterEffect pointer. (WebCore::FilterEffectRendererCoreImage::canRenderUsingCIFilters): unction that takes in the last FilterEffect node and determines whether all of the filters inside the filter graph is already implemented using CIFilters. It returns false as long as there is one filter that hasn't been implemented. The rendering procedure will fallback to software mode if this function returns false (WebCore::FilterEffectRendererCoreImage::output const): returns the ImageBuffer that contains the data of the final output image (WebCore::FilterEffectRendererCoreImage::renderToImageBuffer): r enders CIImage* to an ImageBuffer (WebCore::FilterEffectRendererCoreImage::destRect const): calculates the destination bounding box (WebCore::FilterEffectRendererCoreImage::clearResult): clears all the saved results (WebCore::FilterEffectRendererCoreImage::FilterEffectRendererCoreImage): constructor * platform/graphics/filters/FEBlend.cpp: (WebCore::FEBlend::FEBlend): Pass an additional FilterEffect::Type argument to base class constructor * platform/graphics/filters/FEColorMatrix.cpp: (WebCore::FEColorMatrix::FEColorMatrix): ditto * platform/graphics/filters/FEComponentTransfer.cpp: (WebCore::FEComponentTransfer::FEComponentTransfer): ditto * platform/graphics/filters/FEComposite.cpp: (WebCore::FEComposite::FEComposite): ditto * platform/graphics/filters/FEConvolveMatrix.cpp: (WebCore::FEConvolveMatrix::FEConvolveMatrix): ditto * platform/graphics/filters/FEDiffuseLighting.cpp: (WebCore::FEDiffuseLighting::FEDiffuseLighting):ditto * platform/graphics/filters/FEDisplacementMap.cpp: (WebCore::FEDisplacementMap::FEDisplacementMap):ditto * platform/graphics/filters/FEDisplacementMap.h: * platform/graphics/filters/FEDropShadow.cpp: (WebCore::FEDropShadow::FEDropShadow):ditto * platform/graphics/filters/FEFlood.cpp: (WebCore::FEFlood::FEFlood):ditto * platform/graphics/filters/FEGaussianBlur.cpp: (WebCore::FEGaussianBlur::FEGaussianBlur):ditto * platform/graphics/filters/FELighting.cpp: (WebCore::FELighting::FELighting):ditto * platform/graphics/filters/FELighting.h: * platform/graphics/filters/FEMerge.cpp: (WebCore::FEMerge::FEMerge): ditto * platform/graphics/filters/FEMorphology.cpp: (WebCore::FEMorphology::FEMorphology): ditto * platform/graphics/filters/FEOffset.cpp: (WebCore::FEOffset::FEOffset): ditto * platform/graphics/filters/FESpecularLighting.cpp: (WebCore::FESpecularLighting::FESpecularLighting): ditto * platform/graphics/filters/FETile.cpp: (WebCore::FETile::FETile): ditto * platform/graphics/filters/FETurbulence.cpp: (WebCore::FETurbulence::FETurbulence): ditto * platform/graphics/filters/FilterEffect.cpp: (WebCore::FilterEffect::FilterEffect): ditto * platform/graphics/filters/FilterEffect.h: added a const member, m_filterEffectType (WebCore::FilterEffect::filterEffectClassType): returns the FilterEffect class type * platform/graphics/filters/FilterEffectRenderer.cpp: Added. (WebCore::FilterEffectRenderer::tryCreate): tries creates a new FilterEffectRenderer unique pointer. Here, we check whether the renderer setting has CoreImage accelerated filter rendering enabled; we also check if all the filters in the given FilterEffect graph is already implemented using CoreImage. If both conditions are satisfied, create a FilterEffectRendererCoreImage otherwise returns nullptr. * platform/graphics/filters/FilterEffectRenderer.h: Added. * platform/graphics/filters/SourceAlpha.cpp: (WebCore::SourceAlpha::SourceAlpha): Pass an additional FilterEffect::Type argument to base class constructor * platform/graphics/filters/SourceAlpha.h: * platform/graphics/filters/SourceGraphic.h: (WebCore::SourceGraphic::SourceGraphic): ditto * rendering/CSSFilter.cpp: (WebCore::CSSFilter::build): we try to create a FilterEffectRenderer here by passing in the state of the CoreImage Accelerated Rendering feature switch (WebCore::CSSFilter::apply): If we have a valid m_filterRenderer pointer, that means we can render the result image using CoreImage path, thus we don't call effect.apply() fall back to software mode if hasResult() returns false. (WebCore::CSSFilter::output const): if we have a valid m_filterRenderer, then we will obtain the ImageBuffer result from it, not FilterEffect (WebCore::CSSFilter::outputRect const): if we have a valid m_filterRenderer, then we will obtain the ImageBuffer result from it, not FilterEffect * rendering/CSSFilter.h: * svg/graphics/filters/SVGFEImage.cpp: (WebCore::FEImage::FEImage): Pass an additional FilterEffect::Type argument to base class constructor Canonical link: https://commits.webkit.org/227531@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@264805 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-07-23 23:42:42 +00:00
platform/graphics/coreimage/FilterEffectRendererCoreImage.mm
[Cocoa] [GPU Process] Perform image decoding of color fonts in the Web Process https://bugs.webkit.org/show_bug.cgi?id=217506 Reviewed by Simon Fraser. Source/WebCore: Core Text itself doesn't know how to draw things; it has to rely on Core Graphics to do that. However, Core Graphics only understands the simplest of text drawing concepts; it doesn't understand things like color fonts or emoji. Core Text sits between the application and Core Graphics, and is responsible for splitting up an arbitrary draw command into individual simple pieces which Core Graphics can understand. For example, when you ask Core Text to draw a string which is of the form "outlines emoji outlines", Core Text will end up telling Core Graphics to draw the first outlines, then draw the emoji image (using Core Graphics's normal image drawing routines), then draw the remaining outlines. This is exactly the same kind of filtering we want to do for the GPU Process. We want to be able to separate out the glyphs which are rendered using outlines from the emoji glyphs which are rendered using images. We want to handle the image glyphs ourself in WebKit using our own image drawing display list facilities, which will cause images to be decoded in the Web Process, thereby increasing the security of the GPU Process. So, this patch implements a custom CGContext, backed by a function table that is populated in WebKit. We pass this custom CGContext into Core Text, which does its normal splitting up of outlines / images, and calls glyph / image drawing functions on our CGContext. Because these functions are implemented by WebKit, this effectively makes WebKit able to intercept the drawing calls, and implement them ourself by appending items to the current display list. So, when Core Text tells our CGContext to draw an emoji, our callback runs and we "just" append a DrawImage display list item. I use scare-quotes around "just" because it is a bit more complicated than that. Core Text internally can change the fill/stroke color (for COLR glyphs), the text matrix (it should be updated between adjacent runs), the CTM, and the shadow state (because Core Text sometimes will implement shadows itself by just drawing the text two times). So, in our CGContext callback, we have to look at the state of the CGContext, figure out if anything changed (because we're not notified when changes happen), and if things did change, append additional display list items to make a parallel change happen at draw time. Tests added in https://trac.webkit.org/r269177 * Headers.cmake: * PlatformAppleWin.cmake: * PlatformWinCairo.cmake: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/FreeType.cmake: * platform/graphics/cg/ImageBufferCGBackend.cpp: (WebCore::ImageBufferCGBackend::setupContext): * platform/graphics/coretext/FontCascadeCoreText.cpp: (WebCore::fillVectorWithHorizontalGlyphPositions): * platform/graphics/displaylists/DisplayListDrawGlyphsRecorder.h: Added. * platform/graphics/displaylists/DisplayListDrawGlyphsRecorderCoreText.cpp: Added. (WebCore::DisplayList::beginLayer): VTable callback for creating a transparency layer. (WebCore::DisplayList::endLayer): Ditto for ending a transparency layer. (WebCore::DisplayList::drawGlyphs): VTable callback for drawing outline glyphs. (WebCore::DisplayList::drawImage): VTable callback for drawing an image. (WebCore::DisplayList::DrawGlyphsRecorder::createInternalContext): Set up the custom CGContext infrastructure. Hook up the VTable callbacks. (WebCore::DisplayList::DrawGlyphsRecorder::DrawGlyphsRecorder): (WebCore::DisplayList::DrawGlyphsRecorder::populateInternalState): We need to save the GraphicsContext state at the beginning of the entry point, so we can restore anything that changed when we're done. (WebCore::DisplayList::DrawGlyphsRecorder::populateInternalContext): Because Core Text internally interrogates the CGContext to see if it needs to do things like draw shadows itself, we need to make sure that the recorder's state is mirrored in our custom CGContext. This applies all the relevant state to our CGContext so it's ready when Core Text asks for it. (WebCore::DisplayList::DrawGlyphsRecorder::prepareInternalContext): Call the above two functions. (WebCore::DisplayList::DrawGlyphsRecorder::concludeInternalContext): Called once when we're done. This function cleans up, by possibly appending additional display list items to restore the state back to what it was when we started. (WebCore::DisplayList::DrawGlyphsRecorder::updateFillColor): Detect a changed fill color, and if it has changed, append a display list item to make a parallel change at drawing time. (WebCore::DisplayList::DrawGlyphsRecorder::updateStrokeColor): Ditto for the stroke color. (WebCore::DisplayList::DrawGlyphsRecorder::updateCTM): Ditto for the CTM. (WebCore::DisplayList::shadowIsCleared): (WebCore::DisplayList::DrawGlyphsRecorder::updateShadow): Ditto for the shadow state. (WebCore::DisplayList::DrawGlyphsRecorder::recordBeginLayer): Hook this up to beginTransparencyLayer(). (WebCore::DisplayList::DrawGlyphsRecorder::recordEndLayer): Hook this up to endTransparencyLayer(). (WebCore::DisplayList::computeAdvancesFromPositions): CGContext gives us positions, but our display list infrastructure requires advances. Simply subtract to convert between them. (WebCore::DisplayList::DrawGlyphsRecorder::recordDrawGlyphs): The callback that appends a DrawGlyphs display list item. Note it has to call the various update() functions to detect changes in the CGContext state. (WebCore::DisplayList::DrawGlyphsRecorder::recordDrawImage): Ditto for a DrawImage display list item. (WebCore::DisplayList::DrawGlyphsRecorder::drawGlyphs): The main entry point. Simply set up, do the work, then clean up. * platform/graphics/displaylists/DisplayListDrawGlyphsRecorderHarfBuzz.cpp: Added. Dummy implementation to make the other ports continue to compile. (WebCore::DisplayList::DrawGlyphsRecorder::DrawGlyphsRecorder): (WebCore::DisplayList::DrawGlyphsRecorder::drawGlyphs): * platform/graphics/displaylists/DisplayListRecorder.cpp: (WebCore::DisplayList::Recorder::Recorder): (WebCore::DisplayList::Recorder::drawGlyphs): Call m_drawGlyphsRecorder.drawGlyphs() instead of just appending a DrawGlyphs command. (WebCore::DisplayList::Recorder::concatCTM): Tiny optimization. (WebCore::DisplayList::Recorder::clipToDrawingCommands): The current clipToDrawingCommands's context CTM didn't match the parallel one used during playback. In order to make the CTMs match are recording and playback time, we have to make sure they start off the same. * platform/graphics/displaylists/DisplayListRecorder.h: DisplayList::Recorder owns a DrawGlyphsRecorder, whose lifetime equals that of the DisplayList::Recorder. Rather than destroying / recreating the DrawGlyphsRecorder, the DrawGlyphsRecorder class is smart enough to clean up after itself so it can be reused multiple times. Source/WebCore/PAL: Add some new entry points, and do some various cleanup. * pal/spi/cg/CoreGraphicsSPI.h: Canonical link: https://commits.webkit.org/231072@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269211 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-10-31 00:01:02 +00:00
platform/graphics/displaylists/DisplayListDrawGlyphsRecorderCoreText.cpp
Move WebGPU platform code to platform/graphics/gpu https://bugs.webkit.org/show_bug.cgi?id=191867 <rdar://problem/46190993> Reviewed by Antoine Quint. The underlying implementation of WebGPU doesn't need to live in Modules, since it technically could be used by other parts of the system. It makes more sense for it to be in platform/graphics/gpu. Move... - Modules/webgpu/GPU* -> platform/graphics/gpu - Modules/webgpu/cocoa -> platform/graphics/gpu/cocoa - platform/graphics/gpu/GPULegacy* -> platform/graphics/gpu/legacy/ - platform/graphics/gpu/cocoa/GPULegacy* -> platform/graphics/gpu/legacy/cocoa * Sources.txt: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/gpu/GPUCommandBuffer.h: Renamed from Source/WebCore/Modules/webgpu/GPUCommandBuffer.h. * platform/graphics/gpu/GPUDevice.cpp: Renamed from Source/WebCore/Modules/webgpu/GPUDevice.cpp. (WebCore::GPUDevice::createShaderModule const): (WebCore::GPUDevice::createRenderPipeline const): (WebCore::GPUDevice::createCommandBuffer): (WebCore::GPUDevice::getQueue): * platform/graphics/gpu/GPUDevice.h: Renamed from Source/WebCore/Modules/webgpu/GPUDevice.h. (WebCore::GPUDevice::platformDevice const): * platform/graphics/gpu/GPUPipelineDescriptorBase.h: Renamed from Source/WebCore/Modules/webgpu/GPUPipelineDescriptorBase.h. * platform/graphics/gpu/GPUPipelineStageDescriptor.h: Renamed from Source/WebCore/Modules/webgpu/GPUPipelineStageDescriptor.h. * platform/graphics/gpu/GPUQueue.h: Renamed from Source/WebCore/Modules/webgpu/GPUQueue.h. (WebCore::GPUQueue::platformQueue const): * platform/graphics/gpu/GPURenderPipeline.h: Renamed from Source/WebCore/Modules/webgpu/GPURenderPipeline.h. (WebCore::GPURenderPipeline::platformRenderPipeline const): * platform/graphics/gpu/GPURenderPipelineDescriptor.h: Renamed from Source/WebCore/Modules/webgpu/GPURenderPipelineDescriptor.h. * platform/graphics/gpu/GPUShaderModule.h: Renamed from Source/WebCore/Modules/webgpu/GPUShaderModule.h. (WebCore::GPUShaderModule::platformShaderModule const): * platform/graphics/gpu/GPUShaderModuleDescriptor.h: Renamed from Source/WebCore/Modules/webgpu/GPUShaderModuleDescriptor.h. * platform/graphics/gpu/GPUSwapChain.h: Renamed from Source/WebCore/Modules/webgpu/GPUSwapChain.h. (WebCore::GPUSwapChain::platformLayer const): * platform/graphics/gpu/GPUTexture.h: Renamed from Source/WebCore/Modules/webgpu/GPUTexture.h. * platform/graphics/gpu/GPUTextureFormatEnum.h: Renamed from Source/WebCore/Modules/webgpu/GPUTextureFormatEnum.h. * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPUCommandBufferMetal.mm. (WebCore::GPUCommandBuffer::create): (WebCore::GPUCommandBuffer::GPUCommandBuffer): * platform/graphics/gpu/cocoa/GPUDeviceMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPUDeviceMetal.mm. (WebCore::GPUDevice::create): (WebCore::GPUDevice::GPUDevice): * platform/graphics/gpu/cocoa/GPUQueueMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPUQueueMetal.mm. (WebCore::GPUQueue::create): (WebCore::GPUQueue::GPUQueue): * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPURenderPipelineMetal.mm. (WebCore::setFunctionsForPipelineDescriptor): (WebCore::GPURenderPipeline::create): (WebCore::GPURenderPipeline::GPURenderPipeline): * platform/graphics/gpu/cocoa/GPUShaderModuleMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPUShaderModuleMetal.mm. (WebCore::GPUShaderModule::create): (WebCore::GPUShaderModule::GPUShaderModule): * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPUSwapChainMetal.mm. (WebCore::GPUSwapChain::create): (WebCore::GPUSwapChain::GPUSwapChain): (WebCore::GPUSwapChain::setDevice): (WebCore::platformTextureFormatForGPUTextureFormat): (WebCore::GPUSwapChain::setFormat): (WebCore::GPUSwapChain::reshape): (WebCore::GPUSwapChain::getNextTexture): (WebCore::GPUSwapChain::present): * platform/graphics/gpu/cocoa/GPUTextureMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPUTextureMetal.mm. (WebCore::GPUTexture::create): (WebCore::GPUTexture::GPUTexture): (WebCore::GPUTexture::createDefaultTextureView): * platform/graphics/gpu/legacy/GPULegacyBuffer.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyBuffer.cpp. (WebCore::GPULegacyBuffer::~GPULegacyBuffer): (WebCore::GPULegacyBuffer::length const): * platform/graphics/gpu/legacy/GPULegacyBuffer.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyBuffer.h. (WebCore::GPULegacyBuffer::contents const): (WebCore::GPULegacyBuffer::metal const): * platform/graphics/gpu/legacy/GPULegacyCommandBuffer.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyCommandBuffer.cpp. (WebCore::GPULegacyCommandBuffer::~GPULegacyCommandBuffer): * platform/graphics/gpu/legacy/GPULegacyCommandBuffer.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyCommandBuffer.h. (WebCore::GPULegacyCommandBuffer::metal const): * platform/graphics/gpu/legacy/GPULegacyCommandQueue.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyCommandQueue.cpp. (WebCore::GPULegacyCommandQueue::~GPULegacyCommandQueue): * platform/graphics/gpu/legacy/GPULegacyCommandQueue.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyCommandQueue.h. (WebCore::GPULegacyCommandQueue::metal const): * platform/graphics/gpu/legacy/GPULegacyComputeCommandEncoder.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyComputeCommandEncoder.cpp. (WebCore::GPULegacyComputeCommandEncoder::~GPULegacyComputeCommandEncoder): * platform/graphics/gpu/legacy/GPULegacyComputeCommandEncoder.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyComputeCommandEncoder.h. * platform/graphics/gpu/legacy/GPULegacyComputePipelineState.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyComputePipelineState.cpp. (WebCore::GPULegacyComputePipelineState::~GPULegacyComputePipelineState): * platform/graphics/gpu/legacy/GPULegacyComputePipelineState.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyComputePipelineState.h. (WebCore::GPULegacyComputePipelineState::metal const): * platform/graphics/gpu/legacy/GPULegacyDepthStencilDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDepthStencilDescriptor.cpp. (WebCore::GPULegacyDepthStencilDescriptor::~GPULegacyDepthStencilDescriptor): * platform/graphics/gpu/legacy/GPULegacyDepthStencilDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDepthStencilDescriptor.h. (WebCore::GPULegacyDepthStencilDescriptor::metal const): * platform/graphics/gpu/legacy/GPULegacyDepthStencilState.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDepthStencilState.cpp. (WebCore::GPULegacyDepthStencilState::~GPULegacyDepthStencilState): * platform/graphics/gpu/legacy/GPULegacyDepthStencilState.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDepthStencilState.h. (WebCore::GPULegacyDepthStencilState::metal const): * platform/graphics/gpu/legacy/GPULegacyDevice.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDevice.cpp. (WebCore::GPULegacyDevice::~GPULegacyDevice): * platform/graphics/gpu/legacy/GPULegacyDevice.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDevice.h. (WebCore::GPULegacyDevice::layer const): (WebCore::GPULegacyDevice::metal const): (WebCore::GPULegacyDevice::markLayerComposited const): * platform/graphics/gpu/legacy/GPULegacyDrawable.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDrawable.cpp. (WebCore::GPULegacyDrawable::~GPULegacyDrawable): * platform/graphics/gpu/legacy/GPULegacyDrawable.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDrawable.h. * platform/graphics/gpu/legacy/GPULegacyEnums.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyEnums.h. * platform/graphics/gpu/legacy/GPULegacyFunction.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyFunction.cpp. (WebCore::GPULegacyFunction::~GPULegacyFunction): * platform/graphics/gpu/legacy/GPULegacyFunction.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyFunction.h. (WebCore::GPULegacyFunction::metal const): * platform/graphics/gpu/legacy/GPULegacyLibrary.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyLibrary.cpp. (WebCore::GPULegacyLibrary::~GPULegacyLibrary): * platform/graphics/gpu/legacy/GPULegacyLibrary.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyLibrary.h. (WebCore::GPULegacyLibrary::metal const): * platform/graphics/gpu/legacy/GPULegacyRenderCommandEncoder.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderCommandEncoder.cpp. (WebCore::GPULegacyRenderCommandEncoder::~GPULegacyRenderCommandEncoder): * platform/graphics/gpu/legacy/GPULegacyRenderCommandEncoder.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderCommandEncoder.h. * platform/graphics/gpu/legacy/GPULegacyRenderPassAttachmentDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassAttachmentDescriptor.cpp. (WebCore::GPULegacyRenderPassAttachmentDescriptor::~GPULegacyRenderPassAttachmentDescriptor): * platform/graphics/gpu/legacy/GPULegacyRenderPassAttachmentDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassAttachmentDescriptor.h. * platform/graphics/gpu/legacy/GPULegacyRenderPassColorAttachmentDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassColorAttachmentDescriptor.cpp. (WebCore::GPULegacyRenderPassColorAttachmentDescriptor::~GPULegacyRenderPassColorAttachmentDescriptor): * platform/graphics/gpu/legacy/GPULegacyRenderPassColorAttachmentDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassColorAttachmentDescriptor.h. * platform/graphics/gpu/legacy/GPULegacyRenderPassDepthAttachmentDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassDepthAttachmentDescriptor.cpp. (WebCore::GPULegacyRenderPassDepthAttachmentDescriptor::~GPULegacyRenderPassDepthAttachmentDescriptor): * platform/graphics/gpu/legacy/GPULegacyRenderPassDepthAttachmentDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassDepthAttachmentDescriptor.h. * platform/graphics/gpu/legacy/GPULegacyRenderPassDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassDescriptor.cpp. (WebCore::GPULegacyRenderPassDescriptor::~GPULegacyRenderPassDescriptor): * platform/graphics/gpu/legacy/GPULegacyRenderPassDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassDescriptor.h. * platform/graphics/gpu/legacy/GPULegacyRenderPipelineColorAttachmentDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPipelineColorAttachmentDescriptor.cpp. (WebCore::GPULegacyRenderPipelineColorAttachmentDescriptor::~GPULegacyRenderPipelineColorAttachmentDescriptor): * platform/graphics/gpu/legacy/GPULegacyRenderPipelineColorAttachmentDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPipelineColorAttachmentDescriptor.h. * platform/graphics/gpu/legacy/GPULegacyRenderPipelineDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPipelineDescriptor.cpp. (WebCore::GPULegacyRenderPipelineDescriptor::~GPULegacyRenderPipelineDescriptor): * platform/graphics/gpu/legacy/GPULegacyRenderPipelineDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPipelineDescriptor.h. * platform/graphics/gpu/legacy/GPULegacyRenderPipelineState.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPipelineState.cpp. (WebCore::GPULegacyRenderPipelineState::~GPULegacyRenderPipelineState): * platform/graphics/gpu/legacy/GPULegacyRenderPipelineState.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPipelineState.h. * platform/graphics/gpu/legacy/GPULegacySize.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacySize.h. * platform/graphics/gpu/legacy/GPULegacyTexture.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyTexture.cpp. (WebCore::GPULegacyTexture::~GPULegacyTexture): * platform/graphics/gpu/legacy/GPULegacyTexture.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyTexture.h. * platform/graphics/gpu/legacy/GPULegacyTextureDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyTextureDescriptor.cpp. (WebCore::GPULegacyTextureDescriptor::~GPULegacyTextureDescriptor): * platform/graphics/gpu/legacy/GPULegacyTextureDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyTextureDescriptor.h. * platform/graphics/gpu/legacy/cocoa/GPULegacyBufferMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyBufferMetal.mm. (WebCore::GPULegacyBuffer::GPULegacyBuffer): * platform/graphics/gpu/legacy/cocoa/GPULegacyCommandBufferMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyCommandBufferMetal.mm. (WebCore::GPULegacyCommandBuffer::GPULegacyCommandBuffer): (WebCore::GPULegacyCommandBuffer::presentDrawable const): (WebCore::GPULegacyCommandBuffer::commit const): * platform/graphics/gpu/legacy/cocoa/GPULegacyCommandQueueMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyCommandQueueMetal.mm. (WebCore::GPULegacyCommandQueue::GPULegacyCommandQueue): (WebCore::GPULegacyCommandQueue::label const): (WebCore::GPULegacyCommandQueue::setLabel const): * platform/graphics/gpu/legacy/cocoa/GPULegacyComputeCommandEncoderMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyComputeCommandEncoderMetal.mm. (WebCore::MTLSizeMake): (WebCore::GPULegacyComputeCommandEncoder::GPULegacyComputeCommandEncoder): (WebCore::GPULegacyComputeCommandEncoder::setComputePipelineState const): (WebCore::GPULegacyComputeCommandEncoder::setBuffer const): (WebCore::GPULegacyComputeCommandEncoder::dispatch const): (WebCore::GPULegacyComputeCommandEncoder::endEncoding const): * platform/graphics/gpu/legacy/cocoa/GPULegacyComputePipelineStateMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyComputePipelineStateMetal.mm. (WebCore::GPULegacyComputePipelineState::GPULegacyComputePipelineState): * platform/graphics/gpu/legacy/cocoa/GPULegacyDepthStencilDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyDepthStencilDescriptorMetal.mm. (WebCore::GPULegacyDepthStencilDescriptor::GPULegacyDepthStencilDescriptor): (WebCore::GPULegacyDepthStencilDescriptor::depthWriteEnabled const): (WebCore::GPULegacyDepthStencilDescriptor::setDepthWriteEnabled const): (WebCore::GPULegacyDepthStencilDescriptor::depthCompareFunction const): (WebCore::GPULegacyDepthStencilDescriptor::setDepthCompareFunction const): * platform/graphics/gpu/legacy/cocoa/GPULegacyDepthStencilStateMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyDepthStencilStateMetal.mm. (WebCore::GPULegacyDepthStencilState::GPULegacyDepthStencilState): (WebCore::GPULegacyDepthStencilState::label const): (WebCore::GPULegacyDepthStencilState::setLabel const): * platform/graphics/gpu/legacy/cocoa/GPULegacyDeviceMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyDeviceMetal.mm. (WebCore::GPULegacyDevice::GPULegacyDevice): (WebCore::GPULegacyDevice::disconnect): (WebCore::GPULegacyDevice::reshape const): (WebCore::GPULegacyDevice::platformLayer const): (WebCore::GPULegacyDevice::operator! const): * platform/graphics/gpu/legacy/cocoa/GPULegacyDrawableMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyDrawableMetal.mm. (WebCore::GPULegacyDrawable::GPULegacyDrawable): (WebCore::GPULegacyDrawable::release): (WebCore::GPULegacyDrawable::metal const): (WebCore::GPULegacyDrawable::texture const): * platform/graphics/gpu/legacy/cocoa/GPULegacyFunctionMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyFunctionMetal.mm. (WebCore::GPULegacyFunction::GPULegacyFunction): (WebCore::GPULegacyFunction::name const): (WebCore::GPULegacyFunction::operator! const): * platform/graphics/gpu/legacy/cocoa/GPULegacyLibraryMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyLibraryMetal.mm. (WebCore::GPULegacyLibrary::GPULegacyLibrary): (WebCore::GPULegacyLibrary::label const): (WebCore::GPULegacyLibrary::setLabel const): (WebCore::GPULegacyLibrary::functionNames const): * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderCommandEncoderMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderCommandEncoderMetal.mm. (WebCore::GPULegacyRenderCommandEncoder::GPULegacyRenderCommandEncoder): (WebCore::GPULegacyRenderCommandEncoder::setRenderPipelineState const): (WebCore::GPULegacyRenderCommandEncoder::setDepthStencilState const): (WebCore::GPULegacyRenderCommandEncoder::setVertexBuffer const): (WebCore::GPULegacyRenderCommandEncoder::setFragmentBuffer const): (WebCore::GPULegacyRenderCommandEncoder::drawPrimitives const): (WebCore::GPULegacyRenderCommandEncoder::endEncoding const): * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPassAttachmentDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPassAttachmentDescriptorMetal.mm. (WebCore::GPULegacyRenderPassAttachmentDescriptor::GPULegacyRenderPassAttachmentDescriptor): (WebCore::GPULegacyRenderPassAttachmentDescriptor::loadAction const): (WebCore::GPULegacyRenderPassAttachmentDescriptor::setLoadAction const): (WebCore::GPULegacyRenderPassAttachmentDescriptor::storeAction const): (WebCore::GPULegacyRenderPassAttachmentDescriptor::setStoreAction const): (WebCore::GPULegacyRenderPassAttachmentDescriptor::setTexture const): (WebCore::GPULegacyRenderPassAttachmentDescriptor::metal const): * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPassColorAttachmentDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPassColorAttachmentDescriptorMetal.mm. (WebCore::GPULegacyRenderPassColorAttachmentDescriptor::GPULegacyRenderPassColorAttachmentDescriptor): (WebCore::GPULegacyRenderPassColorAttachmentDescriptor::clearColor const): (WebCore::GPULegacyRenderPassColorAttachmentDescriptor::setClearColor const): (WebCore::GPULegacyRenderPassColorAttachmentDescriptor::metal const): * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPassDepthAttachmentDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPassDepthAttachmentDescriptorMetal.mm. (WebCore::GPULegacyRenderPassDepthAttachmentDescriptor::GPULegacyRenderPassDepthAttachmentDescriptor): (WebCore::GPULegacyRenderPassDepthAttachmentDescriptor::clearDepth const): (WebCore::GPULegacyRenderPassDepthAttachmentDescriptor::setClearDepth const): (WebCore::GPULegacyRenderPassDepthAttachmentDescriptor::metal const): * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPassDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPassDescriptorMetal.mm. (WebCore::GPULegacyRenderPassDescriptor::GPULegacyRenderPassDescriptor): (WebCore::GPULegacyRenderPassDescriptor::colorAttachments const): (WebCore::GPULegacyRenderPassDescriptor::depthAttachment const): (WebCore::GPULegacyRenderPassDescriptor::metal const): * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPipelineColorAttachmentDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPipelineColorAttachmentDescriptorMetal.mm. (WebCore::GPULegacyRenderPipelineColorAttachmentDescriptor::GPULegacyRenderPipelineColorAttachmentDescriptor): (WebCore::GPULegacyRenderPipelineColorAttachmentDescriptor::pixelFormat const): (WebCore::GPULegacyRenderPipelineColorAttachmentDescriptor::setPixelFormat const): (WebCore::GPULegacyRenderPipelineColorAttachmentDescriptor::metal const): * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPipelineDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPipelineDescriptorMetal.mm. (WebCore::GPULegacyRenderPipelineDescriptor::GPULegacyRenderPipelineDescriptor): (WebCore::GPULegacyRenderPipelineDescriptor::depthAttachmentPixelFormat const): (WebCore::GPULegacyRenderPipelineDescriptor::setDepthAttachmentPixelFormat const): (WebCore::GPULegacyRenderPipelineDescriptor::setVertexFunction const): (WebCore::GPULegacyRenderPipelineDescriptor::setFragmentFunction const): (WebCore::GPULegacyRenderPipelineDescriptor::colorAttachments const): (WebCore::GPULegacyRenderPipelineDescriptor::reset const): (WebCore::GPULegacyRenderPipelineDescriptor::metal const): * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPipelineStateMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPipelineStateMetal.mm. (WebCore::GPULegacyRenderPipelineState::GPULegacyRenderPipelineState): (WebCore::GPULegacyRenderPipelineState::label const): (WebCore::GPULegacyRenderPipelineState::setLabel const): (WebCore::GPULegacyRenderPipelineState::metal const): * platform/graphics/gpu/legacy/cocoa/GPULegacyTextureDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyTextureDescriptorMetal.mm. (WebCore::GPULegacyTextureDescriptor::GPULegacyTextureDescriptor): (WebCore::GPULegacyTextureDescriptor::width const): (WebCore::GPULegacyTextureDescriptor::setWidth const): (WebCore::GPULegacyTextureDescriptor::height const): (WebCore::GPULegacyTextureDescriptor::setHeight const): (WebCore::GPULegacyTextureDescriptor::sampleCount const): (WebCore::GPULegacyTextureDescriptor::setSampleCount const): (WebCore::GPULegacyTextureDescriptor::textureType const): (WebCore::GPULegacyTextureDescriptor::setTextureType const): (WebCore::GPULegacyTextureDescriptor::storageMode const): (WebCore::GPULegacyTextureDescriptor::setStorageMode const): (WebCore::GPULegacyTextureDescriptor::usage const): (WebCore::GPULegacyTextureDescriptor::setUsage const): (WebCore::GPULegacyTextureDescriptor::metal const): * platform/graphics/gpu/legacy/cocoa/GPULegacyTextureMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyTextureMetal.mm. (WebCore::GPULegacyTexture::GPULegacyTexture): (WebCore::GPULegacyTexture::width const): (WebCore::GPULegacyTexture::height const): (WebCore::GPULegacyTexture::metal const): Canonical link: https://commits.webkit.org/206593@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238419 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-11-21 17:24:47 +00:00
platform/graphics/gpu/cocoa/GPUDeviceMetal.mm
platform/graphics/ios/DisplayRefreshMonitorIOS.mm
platform/graphics/ios/IconIOS.mm
platform/graphics/mac/ColorMac.mm
platform/graphics/mac/ComplexTextControllerCoreText.mm
platform/graphics/mac/FloatPointMac.mm
platform/graphics/mac/FloatSizeMac.mm
platform/graphics/mac/FontCustomPlatformData.cpp
WebGL power preference and discrete/internal gpu selection implemented incorrectly with ANGLE https://bugs.webkit.org/show_bug.cgi?id=220843 Patch by Kimmo Kinnunen <kkinnunen@apple.com> on 2021-01-26 Reviewed by Dean Jackson. Source/WebCore: Use ANGLE extension EGL_ANGLE_power_preference to signal to ANGLE that the underlying CGL context should be updated as a response to display reconfiguration signal. This ensures that ANGLE state stays consistent with the actual CGL context behavior, as we don't change the context behind ANGLE's back. Remove the feature where the context GPU is selected based on the display the window is on. This cannot work with the logic of "powerPreference = "high-performance" goes to discrete GPU". Also, this cannot work with ANGLE at all, since all contexts are backed by a single platform context. Thus all contexts will use the same underlying GPU. No new tests due to the test runner missing features. The bug blockers track the testing. * PlatformMac.cmake: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::isHighPerformanceContext): * page/Chrome.cpp: (WebCore::Chrome::windowScreenDidChange): * platform/graphics/GraphicsContextGL.h: * platform/graphics/RemoteGraphicsContextGLProxyBase.cpp: * platform/graphics/RemoteGraphicsContextGLProxyBase.h: * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm: (WebCore::GraphicsContextGLOpenGL::create): (WebCore::GraphicsContextGLOpenGL::createShared): (WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL): (WebCore::GraphicsContextGLOpenGL::setContextVisibility): (WebCore::GraphicsContextGLOpenGL::displayWasReconfigured): (WebCore::GraphicsContextGLOpenGL::simulateContextChanged): * platform/graphics/mac/GraphicsChecksMac.cpp: Added. (WebCore::attachToAppleGraphicsControl): (WebCore::hasMuxCapability): (WebCore::hasLowAndHighPowerGPUs): * platform/graphics/mac/GraphicsChecksMac.h: Copied from Source/WebKit/WebProcess/WebCoreSupport/mac/WebSwitchingGPUClient.h. * platform/graphics/mac/ScopedHighPerformanceGPURequest.h: Copied from Source/WebCore/platform/graphics/mac/SwitchingGPUClient.h. (WebCore::ScopedHighPerformanceGPURequest::ScopedHighPerformanceGPURequest): (WebCore::ScopedHighPerformanceGPURequest::~ScopedHighPerformanceGPURequest): (WebCore::ScopedHighPerformanceGPURequest::operator=): (WebCore::ScopedHighPerformanceGPURequest::acquire): * platform/graphics/mac/SwitchingGPUClient.h: * platform/graphics/opengl/GraphicsContextGLOpenGL.h: * platform/graphics/opengl/GraphicsContextGLOpenGLManager.cpp: (WebCore::GraphicsContextGLOpenGLManager::displayWasReconfigured): (WebCore::GraphicsContextGLOpenGLManager::addContext): (WebCore::GraphicsContextGLOpenGLManager::removeContext): * platform/graphics/opengl/GraphicsContextGLOpenGLManager.h: * testing/Internals.cpp: Source/WebKit: Move the high-performance GPU shutdown timer from individual web processes to the main class in the ui process. This simplifies the implementation and reduces the number of timers. * UIProcess/mac/HighPerformanceGPUManager.h: * UIProcess/mac/HighPerformanceGPUManager.mm: (WebKit::HighPerformanceGPUManager::HighPerformanceGPUManager): (WebKit::HighPerformanceGPUManager::removeProcessRequiringHighPerformance): (WebKit::HighPerformanceGPUManager::updateState): * WebProcess/WebCoreSupport/mac/WebSwitchingGPUClient.cpp: (WebKit::WebSwitchingGPUClient::requestHighPerformanceGPU): (WebKit::WebSwitchingGPUClient::releaseHighPerformanceGPU): * WebProcess/WebCoreSupport/mac/WebSwitchingGPUClient.h: Canonical link: https://commits.webkit.org/233341@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271880 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-26 13:43:59 +00:00
platform/graphics/mac/GraphicsChecksMac.cpp
platform/graphics/mac/IconMac.mm
platform/graphics/mac/ImageMac.mm
platform/graphics/mac/IntPointMac.mm
platform/graphics/mac/IntSizeMac.mm
Rename WebCore's DisplayRefreshMonitorMac to indicate that it's only used in legacy WebKit https://bugs.webkit.org/show_bug.cgi?id=223543 Reviewed by Tim Horton. DisplayRefreshMonitorMac in WebCore is only used for WebKitLegacy; WebProcess doesn't have WindowServer access so is unable to create CVDisplayLinkRefs. Rename it to indicate this, and reduce confusion with DisplayRefreshMonitorMac in WebKit2. Also add an assertion that LegacyDisplayRefreshMonitorMac is not being created in the WebProcess. For EmptyPageClients (like the Page used by createPageForSanitizingWebContent()) we need a DisplayRefreshMonitor implementation that doesn't try to CVDisplayLinkRefs in the Web Process, so add an EmptyDisplayRefreshMonitor that never fires. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * loader/EmptyClients.cpp: (WebCore::EmptyDisplayRefreshMonitor::create): (WebCore::EmptyDisplayRefreshMonitor::EmptyDisplayRefreshMonitor): (WebCore::EmptyChromeClient::createDisplayRefreshMonitor const): * loader/EmptyClients.h: * platform/graphics/DisplayRefreshMonitor.cpp: (WebCore::DisplayRefreshMonitor::createDefaultDisplayRefreshMonitor): * platform/graphics/mac/LegacyDisplayRefreshMonitorMac.cpp: Renamed from Source/WebCore/platform/graphics/mac/DisplayRefreshMonitorMac.cpp. (WebCore::LegacyDisplayRefreshMonitorMac::LegacyDisplayRefreshMonitorMac): (WebCore::LegacyDisplayRefreshMonitorMac::~LegacyDisplayRefreshMonitorMac): (WebCore::LegacyDisplayRefreshMonitorMac::stop): (WebCore::displayLinkCallback): (WebCore::LegacyDisplayRefreshMonitorMac::requestRefreshCallback): (WebCore::LegacyDisplayRefreshMonitorMac::displayLinkFired): * platform/graphics/mac/LegacyDisplayRefreshMonitorMac.h: Renamed from Source/WebCore/platform/graphics/mac/DisplayRefreshMonitorMac.h. (WebCore::LegacyDisplayRefreshMonitorMac::create): Canonical link: https://commits.webkit.org/235570@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274755 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-22 18:25:00 +00:00
platform/graphics/mac/LegacyDisplayRefreshMonitorMac.cpp
platform/graphics/mac/PDFDocumentImageMac.mm
platform/graphics/mac/SimpleFontDataCoreText.cpp
platform/graphics/mac/SwitchingGPUClient.cpp
platform/graphics/mac/WebKitNSImageExtras.mm
platform/graphics/mac/WebLayer.mm
platform/graphics/opentype/OpenTypeCG.cpp
CSS auto focus-ring outlines don't render on iOS https://bugs.webkit.org/show_bug.cgi?id=193583 <rdar://problem/6508697> Reviewed by Simon Fraser. Source/WebCore: Implement support for drawing focus rings on iOS when built with ENABLE(FULL_KEYBOARD_ACCESS) enabled. For now the focus ring drawing for iOS is tangled up into the Mac-specific code to draw animated focus rings. I will fix this in <https://bugs.webkit.org/show_bug.cgi?id=193591>. * SourcesCocoa.txt: Add file ColorIOS.mm. * WebCore.xcodeproj/project.pbxproj: Add files ColorIOS.{h, mm}. * platform/graphics/GraphicsContext.h: * platform/graphics/cocoa/GraphicsContextCocoa.mm: (WebCore::drawFocusRingAtTime): (WebCore::GraphicsContext::drawFocusRing): Compile focus ring drawing code when building with ENABLE(FULL_KEYBOARD_ACCESS) enabled. This is always enabled on Mac. * platform/ios/ColorIOS.h: Added. * platform/ios/ColorIOS.mm: Added. (WebCore::colorFromUIColor): Convert a UIColor to a WebCore::Color. * rendering/RenderElement.cpp: (WebCore::RenderElement::paintFocusRing): * rendering/RenderImage.cpp: (WebCore::RenderImage::paintAreaElementFocusRing): Compile focus ring drawing code when building with ENABLE(FULL_KEYBOARD_ACCESS) enabled. This is always enabled on Mac. * rendering/RenderThemeIOS.h: * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::platformFocusRingColor const): Implement this override for iOS. (WebCore::RenderThemeIOS::supportsFocusRing const): Implement this override for iOS to always return false - the iOS theme code does not support painting focus rings. By returning false we will use the platform-independent, non-theme code path to draw focus rings. Source/WebCore/PAL: Forward declare some IPI. * pal/spi/ios/UIKitSPI.h: Canonical link: https://commits.webkit.org/208096@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240174 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-01-18 22:26:37 +00:00
platform/ios/ColorIOS.mm
platform/ios/Device.cpp
platform/ios/DeviceMotionClientIOS.mm
platform/ios/DeviceOrientationClientIOS.mm
platform/ios/DragImageIOS.mm
platform/ios/KeyEventIOS.mm
platform/ios/LegacyTileCache.mm
platform/ios/LegacyTileGrid.mm
platform/ios/LegacyTileGridTile.mm
platform/ios/LegacyTileLayer.mm
platform/ios/LegacyTileLayerPool.mm
Adapt LocalCurrentGraphicsContext for iOS <https://webkit.org/b/211660> Reviewed by Darin Adler. Source/WebCore: * PlatformMac.cmake: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: - Update build files for: - Rename of LocalCurrentGraphicsContext.mm to LocalCurrentGraphicsContextMac.mm. - Move of LocalCurrentGraphicsContext.h from platform/mac to platform/cocoa. - Addition of LocalCurrentGraphicsContextIOS.mm. * platform/cocoa/LocalCurrentGraphicsContext.h: Renamed from Source/WebCore/platform/mac/LocalCurrentGraphicsContext.h. - Make this work for iOS by using PLATFORM(COCOA) for the outer guard and USE(APPKIT) for the Mac-specific bits. - Use RetainPtr<> for NSGraphicsContext to clean up code in LocalCurrentGraphicsContextMac.mm. (WebCore::LocalCurrentGraphicsContext::cgContext): - Inline from LocalCurrentGraphicsContextMac.mm. * platform/ios/LocalCurrentGraphicsContextIOS.mm: Copied from Source/WebCore/platform/mac/LocalCurrentGraphicsContext.mm. (WebCore::LocalCurrentGraphicsContext::LocalCurrentGraphicsContext): (WebCore::LocalCurrentGraphicsContext::~LocalCurrentGraphicsContext): - Implement based on LocalCurrentGraphicsContextMac.mm. Use UIGraphics{GetCurrent,Pop,Push}Context() functions added to UIKitSoftLink.h. * platform/mac/LocalCurrentGraphicsContextMac.mm: Renamed from Source/WebCore/platform/mac/LocalCurrentGraphicsContext.mm. (WebCore::LocalCurrentGraphicsContext::LocalCurrentGraphicsContext): - Use m_savedGraphicsContext instead of graphicsContext in the body of the constructor. - Remove set-to-nil/retain of m_savedNSGraphicsContext since that is handled by RetainPtr<> now. (WebCore::LocalCurrentGraphicsContext::~LocalCurrentGraphicsContext): - Remove release of m_savedNSGraphicsContext since that is handled by RetainPtr<> now. (WebCore::LocalCurrentGraphicsContext::cgContext): Delete. - Inline into header to share implementation with iOS. Source/WebCore/PAL: * pal/ios/UIKitSoftLink.h: * pal/ios/UIKitSoftLink.mm: - Add soft linking of UIGraphics{GetCurrent,Pop,Push}Context() functions. Source/WebKit: * UIProcess/Cocoa/WebPageProxyCocoa.mm: (WebKit::convertPlatformImageToBitmap): - Use LocalCurrentGraphicsContext for both iOS and Mac code paths. * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: - Switch from PLATFORM(MAC) and PLATFORM(IOS_FAMIY) to USE(APPKIT) to separate platform code. (WebKit::convertDragImageToBitmap): (WebKit::convertImageToBitmap): Delete. (WebKit::convertCGImageToBitmap): Delete. - Combine Mac-specific convertImageToBitmap() and iOS-specific convertCGImageToBitmap() into a single method using DragImage type and special-casing one line of code. (WebKit::WebDragClient::startDrag): (WebKit::WebDragClient::didConcludeEditDrag): - Combine iOS and Mac methods into a singe method. Canonical link: https://commits.webkit.org/224588@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@261442 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-05-09 23:10:41 +00:00
platform/ios/LocalCurrentGraphicsContextIOS.mm
Integrate dark mode support for iOS. https://bugs.webkit.org/show_bug.cgi?id=198687 rdar://problem/51545643 Reviewed by Tim Horton. Source/JavaScriptCore: * Configurations/FeatureDefines.xcconfig: Source/WebCore: Tests: css-dark-mode * Configurations/FeatureDefines.xcconfig: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/cocoa/FontCascadeCocoa.mm: (WebCore::showLetterpressedGlyphsWithAdvances): * platform/ios/LocalCurrentTraitCollection.h: Added. * platform/ios/LocalCurrentTraitCollection.mm: Added. * platform/ios/PasteboardIOS.mm: * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::systemColor const): * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::systemColor const): Source/WebCore/PAL: * Configurations/FeatureDefines.xcconfig: * pal/spi/ios/UIKitSPI.h: Source/WebKit: * 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. Source/WebKitLegacy/mac: * Configurations/FeatureDefines.xcconfig: Source/WTF: * wtf/Platform.h: Tools: * TestWebKitAPI/Configurations/FeatureDefines.xcconfig: LayoutTests: * platform/ios/TestExpectations: Canonical link: https://commits.webkit.org/212698@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@246270 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-06-10 19:19:16 +00:00
platform/ios/LocalCurrentTraitCollection.mm
Move [UIDevice currentDevice] calls to UI process https://bugs.webkit.org/show_bug.cgi?id=204320 Reviewed by Darin Adler. Source/WebCore: Calling [UIDevice currentDevice] will cause the runningboard daemon to be accessed. Since this service will be removed from the WebContent sandbox, these calls should be moved to the UI process. The function exernalDeviceDisplayNameForPlayer in MediaPlayerPrivateAVFoundationObjC.mm is calling [[PAL::getUIDeviceClass() currentDevice] localizedModel], which should be moved to the UI process. API test: WebKit.LocalizedDeviceName * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::exernalDeviceDisplayNameForPlayer): * platform/ios/LocalizedDeviceModel.h: Added. * platform/ios/LocalizedDeviceModel.mm: Added. (WebCore::cachedLocalizedDeviceModel): (WebCore::localizedDeviceModel): (WebCore::setLocalizedDeviceModel): Source/WebKit: 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): Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WebKit/LocalizedDeviceModel.mm: Added. (TEST): Canonical link: https://commits.webkit.org/220872@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256839 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-02-18 18:27:01 +00:00
platform/ios/LocalizedDeviceModel.mm
platform/ios/PasteboardIOS.mm
[iOS] Arrow keys do not dispatch DOM events to non-editable elements https://bugs.webkit.org/show_bug.cgi?id=189389 Reviewed by Simon Fraser. Source/WebCore: On iOS the arrow keys are identified by special multi character key strings: UIKeyInput{Up, Down, Left, Right}Arrow as opposed to special key codes as on Mac. When converting the iOS- specific WebEvent we need to take care to recognize when the key string for the event is one of these special key strings when computing key code, character code, and key identifier properties for the WebCore platform-specific event. These details will be included in the corresponding DOM keyboard events that are dispatched when the arrow keys are pressed. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: Mark file PlatformEventFactoryIOS as @no-unify as it is not compatible with the unified sources build strategy given its use of wtf/cocoa/SoftLinking.h macros. * platform/ios/PlatformEventFactoryIOS.h: * platform/ios/PlatformEventFactoryIOS.mm: (WebCore::convertSpecialKeyToCharCode): Manufacture the appropriate character code for an event that represents an arrow key. Otherwise, return std::nullopt to indicate that the event is not for an arrow key. (WebCore::keyCodeForEvent): Manufacture the appropriate Windows virtual key code for an event that represents an arrow key. Otherwise, do what we do now and return the key code associated with the WebEvent. (WebCore::keyIdentifierForKeyEvent): Modified to test if the event is for an arrow key and return the appropriate key identifier. (WebCore::keyForKeyEvent): Modified to test if the event is for an arrow key and return the appropriate character code. (WebCore::codeForKeyEvent): Modified to call keyCodeForEvent(), which knows how to account for events that represent arrow keys. (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder): Source/WebKit: Use WebCore::keyCodeForEvent() to retrieve the key code for a WebEvent instead of querying the key code from the WebEvent directly. The function WebCore::keyCodeForEvent() knows how to compute the key code for an event that represents an arrow key. * Shared/ios/WebIOSEventFactory.mm: (WebIOSEventFactory::createWebKeyboardEvent): LayoutTests: Update expected result now that we compute the correct keyIdentifier, keycode, and which properties for DOM keyboard events dispatched when the arrow keys are pressed. * fast/events/ios/keydown-keyup-in-non-editable-content-expected.txt: Canonical link: https://commits.webkit.org/204446@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235860 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-09-10 21:02:50 +00:00
platform/ios/PlatformEventFactoryIOS.mm @no-unify
platform/ios/PlatformPasteboardIOS.mm
platform/ios/PlatformScreenIOS.mm
platform/ios/PlatformSpeechSynthesizerIOS.mm @no-unify
platform/ios/PlaybackSessionInterfaceAVKit.mm @no-unify
platform/ios/PreviewConverterIOS.mm
platform/ios/QuickLook.mm
platform/ios/ScrollAnimatorIOS.mm
platform/ios/ScrollViewIOS.mm
platform/ios/ScrollbarThemeIOS.mm
Rename WebCore::SelectionRect to WebCore::SelectionGeometry https://bugs.webkit.org/show_bug.cgi?id=224820 Reviewed by Megan Gardner. Source/WebCore: To prepare for rendering non-rectilinear selection quads on iOS using UIKit, rename `WebCore::SelectionRect` to `WebCore::SelectionGeometry`. In a subsequent patch, this class will be backed by a `FloatQuad` instead of an `IntRect`, and will additionally contain a flag indicating whether it should render using the bounding rect of the quad (and should additionally be coalesced with surrounding selection rects), or if it should render the selection quad without coalescing. No change in behavior. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper textRectsFromMarkers:withText:]): * page/DragController.cpp: * page/TextIndicator.cpp: (WebCore::initializeIndicator): * platform/ios/SelectionGeometry.cpp: Renamed from Source/WebCore/platform/ios/SelectionRect.cpp. (WebCore::SelectionGeometry::SelectionGeometry): (WebCore::SelectionGeometry::setLogicalLeft): (WebCore::SelectionGeometry::setLogicalWidth): (WebCore::SelectionGeometry::setLogicalTop): (WebCore::SelectionGeometry::setLogicalHeight): (WebCore::operator<<): * platform/ios/SelectionGeometry.h: Renamed from Source/WebCore/platform/ios/SelectionRect.h. (WebCore::SelectionGeometry::rect const): (WebCore::SelectionGeometry::logicalLeft const): (WebCore::SelectionGeometry::logicalWidth const): (WebCore::SelectionGeometry::logicalTop const): (WebCore::SelectionGeometry::logicalHeight const): (WebCore::SelectionGeometry::direction const): (WebCore::SelectionGeometry::minX const): (WebCore::SelectionGeometry::maxX const): (WebCore::SelectionGeometry::maxY const): (WebCore::SelectionGeometry::lineNumber const): (WebCore::SelectionGeometry::isLineBreak const): (WebCore::SelectionGeometry::isFirstOnLine const): (WebCore::SelectionGeometry::isLastOnLine const): (WebCore::SelectionGeometry::containsStart const): (WebCore::SelectionGeometry::containsEnd const): (WebCore::SelectionGeometry::isHorizontal const): (WebCore::SelectionGeometry::isInFixedPosition const): (WebCore::SelectionGeometry::isRubyText const): (WebCore::SelectionGeometry::pageNumber const): (WebCore::SelectionGeometry::setRect): (WebCore::SelectionGeometry::setDirection): (WebCore::SelectionGeometry::setMinX): (WebCore::SelectionGeometry::setMaxX): (WebCore::SelectionGeometry::setMaxY): (WebCore::SelectionGeometry::setLineNumber): (WebCore::SelectionGeometry::setIsLineBreak): (WebCore::SelectionGeometry::setIsFirstOnLine): (WebCore::SelectionGeometry::setIsLastOnLine): (WebCore::SelectionGeometry::setContainsStart): (WebCore::SelectionGeometry::setContainsEnd): (WebCore::SelectionGeometry::setIsHorizontal): * rendering/RenderImage.cpp: (WebCore::RenderImage::collectSelectionGeometries): (WebCore::RenderImage::collectSelectionRects): Deleted. * rendering/RenderImage.h: * rendering/RenderLineBreak.cpp: (WebCore::RenderLineBreak::collectSelectionGeometries): (WebCore::RenderLineBreak::collectSelectionRects): Deleted. * rendering/RenderLineBreak.h: * rendering/RenderObject.cpp: (WebCore::RenderObject::collectSelectionGeometries): (WebCore::adjustLineHeightOfSelectionGeometries): (WebCore::coalesceSelectionGeometries): (WebCore::RenderObject::collectSelectionGeometriesWithoutUnionInteriorLines): (WebCore::RenderObject::collectSelectionGeometriesInternal): (WebCore::RenderObject::collectSelectionRects): Deleted. (WebCore::adjustLineHeightOfSelectionRects): Deleted. (WebCore::coalesceSelectionRects): Deleted. (WebCore::RenderObject::collectSelectionRectsWithoutUnionInteriorLines): Deleted. (WebCore::RenderObject::collectSelectionRectsInternal): Deleted. * rendering/RenderObject.h: * rendering/RenderSelectionInfo.cpp: (WebCore::RenderSelectionInfo::RenderSelectionInfo): * rendering/RenderText.cpp: (WebCore::RenderText::collectSelectionGeometries): (WebCore::RenderText::collectSelectionGeometriesForLineBoxes): (WebCore::RenderText::selectionRectForRepaint): (WebCore::RenderText::collectSelectionRects): Deleted. (WebCore::RenderText::collectSelectionRectsForLineBoxes): Deleted. * rendering/RenderText.h: Source/WebKit: See WebCore/ChangeLog for more details. * Scripts/webkit/messages.py: (headers_for_type): * Shared/EditorState.cpp: (WebKit::EditorState::PostLayoutData::encode const): (WebKit::EditorState::PostLayoutData::decode): (WebKit::operator<<): * Shared/EditorState.h: * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder<SelectionGeometry>::encode): (IPC::ArgumentCoder<SelectionGeometry>::decode): (IPC::ArgumentCoder<SelectionRect>::encode): Deleted. (IPC::ArgumentCoder<SelectionRect>::decode): Deleted. * Shared/WebCoreArgumentCoders.h: * Shared/ios/InteractionInformationAtPosition.h: * Shared/ios/InteractionInformationRequest.h: * UIProcess/API/ios/WKWebViewIOS.mm: (-[WKWebView _accessibilityRetrieveRectsAtSelectionOffset:withText:completionHandler:]): * UIProcess/WebPageProxy.h: * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (WebKit::WKSelectionDrawingInfo::WKSelectionDrawingInfo): (WebKit::operator==): (WebKit::operator<<): (-[WKContentView _pointIsInsideSelectionRect:outBoundingRect:]): (-[WKContentView _shouldToggleSelectionCommandsAfterTapAt:]): (-[WKContentView webSelectionRectsForSelectionGeometries:]): (-[WKContentView webSelectionRects]): (-[WKContentView _lookupForWebView:]): (-[WKContentView _shareForWebView:]): (-[WKContentView _translateForWebView:]): (-[WKContentView _addShortcutForWebView:]): (-[WKContentView _showDictionary:]): (-[WKContentView _accessibilityRetrieveRectsEnclosingSelectionOffset:withGranularity:]): (-[WKContentView _accessibilityRetrieveRectsAtSelectionOffset:withText:completionHandler:]): (-[WKContentView selectedTextRange]): (-[WKContentView webSelectionRectsForSelectionRects:]): Deleted. * UIProcess/ios/WKTextSelectionRect.h: * UIProcess/ios/WKTextSelectionRect.mm: (-[WKTextSelectionRect initWithCGRect:]): (-[WKTextSelectionRect initWithSelectionGeometry:]): (-[WKTextSelectionRect rect]): (-[WKTextSelectionRect writingDirection]): (-[WKTextSelectionRect containsStart]): (-[WKTextSelectionRect containsEnd]): (-[WKTextSelectionRect isVertical]): (-[WKTextSelectionRect initWithSelectionRect:]): Deleted. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::requestRectsForGranularityWithSelectionOffset): (WebKit::WebPageProxy::requestRectsAtSelectionOffsetWithText): (WebKit::WebPageProxy::selectionBoundingRectInRootViewCoordinates const): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::convertContentToRootView): (WebKit::WebPage::getPlatformEditorState const): (WebKit::WebPage::getRectsForGranularityWithSelectionOffset): (WebKit::WebPage::getRectsAtSelectionOffsetWithText): (WebKit::WebPage::requestAutocorrectionData): (WebKit::convertContentToRootViewSelectionRects): Deleted. Source/WebKitLegacy/ios: * WebCoreSupport/WebFrameIOS.mm: (-[WebFrame selectionRectsForCoreRange:]): Canonical link: https://commits.webkit.org/236811@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276331 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-21 00:03:56 +00:00
platform/ios/SelectionGeometry.cpp
platform/ios/SystemMemoryIOS.cpp
Switch remaining UIKit soft-linking in WebCore, WebKitLegacy over to UIKitSoftLink.{cpp,h} <https://webkit.org/b/193568> <rdar://problem/47381130> Reviewed by Alex Christensen. Source/WebCore: This does the following: - Removes local soft-linking of UIKit. - Switches to using PAL functions for soft-linking. * SourcesCocoa.txt: Add 4 source files to UnifiedSources. * WebCore.xcodeproj/project.pbxproj: Remove 4 sources files from WebCore target now that they are in UnifiedSources. * editing/cocoa/DictionaryLookup.mm: * editing/cocoa/HTMLConverter.mm: Move SPI to UIKitSPI.h. Remove declarations in public headers. (_fontForNameAndSize): Change use of getUIFontClass() to PlatformFontClass. (HTMLConverter::_processElement): Add cast here since compiler finds the wrong selector for +clearColor and thinks it returns a `CIColor *` object. The same cast already exists in VideoFullscreenInterfaceAVKit.mm. * page/cocoa/SettingsBaseCocoa.mm: (WebCore::SettingsBase::defaultTextAutosizingEnabled): * platform/audio/ios/MediaSessionManagerIOS.mm: (-[WebMediaSessionHelper initWithCallback:]): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::exernalDeviceDisplayNameForPlayer): * platform/graphics/cocoa/FontCascadeCocoa.mm: (WebCore::showLetterpressedGlyphsWithAdvances): * platform/ios/DragImageIOS.mm: (WebCore::scaleDragImage): (WebCore::createDragImageFromImage): (WebCore::cascadeForSystemFont): (WebCore::createDragImageForLink): (WebCore::createDragImageForSelection): (WebCore::createDragImageForRange): (WebCore::createDragImageForColor): * platform/ios/PlatformPasteboardIOS.mm: (WebCore::PlatformPasteboard::PlatformPasteboard): (WebCore::PlatformPasteboard::color): (WebCore::registerItemToPasteboard): (WebCore::PlatformPasteboard::setColor): * platform/ios/ThemeIOS.mm: (WebCore::ThemeIOS::userPrefersReducedMotion const): * platform/ios/UserAgentIOS.mm: (WebCore::isClassic): (WebCore::isClassicPad): (WebCore::isClassicPhone): * platform/ios/ValidationBubbleIOS.mm: (-[WebValidationBubbleTapRecognizer initWithPopoverController:]): (WebCore::ValidationBubble::ValidationBubble): (WebCore::ValidationBubble::show): (WebCore::fallbackViewController): * platform/ios/VideoFullscreenInterfaceAVKit.mm: (clearUIColor): (allocWebAVPictureInPicturePlayerLayerViewInstance): (WebAVPlayerLayerView_videoView): (fallbackViewController): (VideoFullscreenInterfaceAVKit::doSetup): * platform/ios/WebEvent.mm: (+[WebEvent modifierFlags]): * platform/ios/WebItemProviderPasteboard.mm: (allLoadableClasses): * platform/ios/WebVideoFullscreenControllerAVKit.mm: (VideoFullscreenControllerContext::setUpFullscreen): * platform/network/mac/WebCoreURLResponse.mm: Add missing header after unified sources were updated. * rendering/RenderThemeIOS.mm: (WebCore::contentSizeCategoryDidChange): (WebCore::RenderThemeIOS::RenderThemeIOS): (WebCore::RenderThemeIOS::contentSizeCategory): (WebCore::RenderThemeIOS::systemColor const): (WebCore::attachmentActionColor): (WebCore::attachmentTitleColor): (WebCore::attachmentSubtitleColor): (WebCore::iconForAttachment): * testing/Internals.mm: (WebCore::Internals::userPrefersReducedMotion const): Source/WebCore/PAL: * pal/ios/UIKitSoftLink.h: * pal/ios/UIKitSoftLink.mm: - Add constants, classes and functions that were previously soft-linked in separate source files. - UIAccessibilityAnnouncementNotification is declared as a variable because this constant is not marked as `const` in UIKit. * pal/spi/ios/UIKitSPI.h: - Move SPI declarations from HTMLConverter.mm to here. Source/WebKitLegacy/mac: * WebView/WebView.mm: - Remove unused soft-linking macros. (-[WebUITextIndicatorData initWithImage:textIndicatorData:scale:]): (-[WebUITextIndicatorData initWithImage:scale:]): - Update to use exported PAL functions. Tools: Make sure no one re-introduces UIKit soft-linking by adding a style rule. * Scripts/webkitpy/style/checkers/cpp.py: (check_language): Add softlink/uikit check. (CppChecker): Enable softlink/uikit check. * Scripts/webkitpy/style/checkers/cpp_unittest.py: (CppStyleTest): Add test for softlink/uikit. Canonical link: https://commits.webkit.org/208092@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240168 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-01-18 20:41:58 +00:00
platform/ios/ThemeIOS.mm
platform/ios/TileControllerMemoryHandlerIOS.cpp
Switch remaining UIKit soft-linking in WebCore, WebKitLegacy over to UIKitSoftLink.{cpp,h} <https://webkit.org/b/193568> <rdar://problem/47381130> Reviewed by Alex Christensen. Source/WebCore: This does the following: - Removes local soft-linking of UIKit. - Switches to using PAL functions for soft-linking. * SourcesCocoa.txt: Add 4 source files to UnifiedSources. * WebCore.xcodeproj/project.pbxproj: Remove 4 sources files from WebCore target now that they are in UnifiedSources. * editing/cocoa/DictionaryLookup.mm: * editing/cocoa/HTMLConverter.mm: Move SPI to UIKitSPI.h. Remove declarations in public headers. (_fontForNameAndSize): Change use of getUIFontClass() to PlatformFontClass. (HTMLConverter::_processElement): Add cast here since compiler finds the wrong selector for +clearColor and thinks it returns a `CIColor *` object. The same cast already exists in VideoFullscreenInterfaceAVKit.mm. * page/cocoa/SettingsBaseCocoa.mm: (WebCore::SettingsBase::defaultTextAutosizingEnabled): * platform/audio/ios/MediaSessionManagerIOS.mm: (-[WebMediaSessionHelper initWithCallback:]): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::exernalDeviceDisplayNameForPlayer): * platform/graphics/cocoa/FontCascadeCocoa.mm: (WebCore::showLetterpressedGlyphsWithAdvances): * platform/ios/DragImageIOS.mm: (WebCore::scaleDragImage): (WebCore::createDragImageFromImage): (WebCore::cascadeForSystemFont): (WebCore::createDragImageForLink): (WebCore::createDragImageForSelection): (WebCore::createDragImageForRange): (WebCore::createDragImageForColor): * platform/ios/PlatformPasteboardIOS.mm: (WebCore::PlatformPasteboard::PlatformPasteboard): (WebCore::PlatformPasteboard::color): (WebCore::registerItemToPasteboard): (WebCore::PlatformPasteboard::setColor): * platform/ios/ThemeIOS.mm: (WebCore::ThemeIOS::userPrefersReducedMotion const): * platform/ios/UserAgentIOS.mm: (WebCore::isClassic): (WebCore::isClassicPad): (WebCore::isClassicPhone): * platform/ios/ValidationBubbleIOS.mm: (-[WebValidationBubbleTapRecognizer initWithPopoverController:]): (WebCore::ValidationBubble::ValidationBubble): (WebCore::ValidationBubble::show): (WebCore::fallbackViewController): * platform/ios/VideoFullscreenInterfaceAVKit.mm: (clearUIColor): (allocWebAVPictureInPicturePlayerLayerViewInstance): (WebAVPlayerLayerView_videoView): (fallbackViewController): (VideoFullscreenInterfaceAVKit::doSetup): * platform/ios/WebEvent.mm: (+[WebEvent modifierFlags]): * platform/ios/WebItemProviderPasteboard.mm: (allLoadableClasses): * platform/ios/WebVideoFullscreenControllerAVKit.mm: (VideoFullscreenControllerContext::setUpFullscreen): * platform/network/mac/WebCoreURLResponse.mm: Add missing header after unified sources were updated. * rendering/RenderThemeIOS.mm: (WebCore::contentSizeCategoryDidChange): (WebCore::RenderThemeIOS::RenderThemeIOS): (WebCore::RenderThemeIOS::contentSizeCategory): (WebCore::RenderThemeIOS::systemColor const): (WebCore::attachmentActionColor): (WebCore::attachmentTitleColor): (WebCore::attachmentSubtitleColor): (WebCore::iconForAttachment): * testing/Internals.mm: (WebCore::Internals::userPrefersReducedMotion const): Source/WebCore/PAL: * pal/ios/UIKitSoftLink.h: * pal/ios/UIKitSoftLink.mm: - Add constants, classes and functions that were previously soft-linked in separate source files. - UIAccessibilityAnnouncementNotification is declared as a variable because this constant is not marked as `const` in UIKit. * pal/spi/ios/UIKitSPI.h: - Move SPI declarations from HTMLConverter.mm to here. Source/WebKitLegacy/mac: * WebView/WebView.mm: - Remove unused soft-linking macros. (-[WebUITextIndicatorData initWithImage:textIndicatorData:scale:]): (-[WebUITextIndicatorData initWithImage:scale:]): - Update to use exported PAL functions. Tools: Make sure no one re-introduces UIKit soft-linking by adding a style rule. * Scripts/webkitpy/style/checkers/cpp.py: (check_language): Add softlink/uikit check. (CppChecker): Enable softlink/uikit check. * Scripts/webkitpy/style/checkers/cpp_unittest.py: (CppStyleTest): Add test for softlink/uikit. Canonical link: https://commits.webkit.org/208092@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240168 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-01-18 20:41:58 +00:00
platform/ios/UserAgentIOS.mm
platform/ios/ValidationBubbleIOS.mm
platform/ios/VideoFullscreenInterfaceAVKit.mm @no-unify
platform/ios/WebAVPlayerController.mm
platform/ios/WebBackgroundTaskController.mm
platform/ios/WebCoreMotionManager.mm
platform/ios/WebEvent.mm @no-unify
platform/ios/WebItemProviderPasteboard.mm @no-unify
platform/ios/WebSQLiteDatabaseTrackerClient.mm
platform/ios/WebVideoFullscreenControllerAVKit.mm @no-unify
platform/ios/WidgetIOS.mm
platform/ios/wak/FloatingPointEnvironment.cpp
platform/ios/wak/WAKScrollView.mm
platform/ios/wak/WAKView.mm @no-unify
platform/ios/wak/WAKWindow.mm
platform/ios/wak/WKGraphics.mm
platform/ios/wak/WKView.mm
platform/ios/wak/WebCoreThread.mm
platform/ios/wak/WebCoreThreadRun.cpp
platform/ios/wak/WebCoreThreadSystemInterface.cpp
Stop using discriminatory names for WebGL and Plugin blocking https://bugs.webkit.org/show_bug.cgi?id=213000 Reviewed by Simon Fraser. Source/WebCore: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/mac/BlocklistUpdater.h: Renamed from Source/WebCore/platform/mac/BlacklistUpdater.h. (WebCore::BlocklistUpdater::pluginBlocklist): (WebCore::BlocklistUpdater::webGLBlocklist): * platform/mac/BlocklistUpdater.mm: Renamed from Source/WebCore/platform/mac/BlacklistUpdater.mm. (WebCore::BlocklistUpdater::readBlocklistData): (WebCore::BlocklistUpdater::reloadIfNecessary): (WebCore::BlocklistUpdater::initializeQueue): * platform/mac/PluginBlocklist.h: Renamed from Source/WebCore/platform/mac/PluginBlacklist.h. * platform/mac/PluginBlocklist.mm: Renamed from Source/WebCore/platform/mac/PluginBlacklist.mm. (WebCore::PluginBlocklist::loadPolicyForPluginVersion): (WebCore::PluginBlocklist::isPluginUpdateAvailable): (WebCore::PluginBlocklist::create): (WebCore::PluginBlocklist::~PluginBlocklist): (WebCore::PluginBlocklist::splitOSVersion): (WebCore::PluginBlocklist::loadPolicyForPlugin const): (WebCore::PluginBlocklist::isUpdateAvailable const): (WebCore::PluginBlocklist::PluginBlocklist): * platform/mac/WebGLBlocklist.h: Renamed from Source/WebCore/platform/mac/WebGLBlacklist.h. * platform/mac/WebGLBlocklist.mm: Renamed from Source/WebCore/platform/mac/WebGLBlacklist.mm. (WebCore::buildInfoFromOSBuildString): (WebCore::WebGLBlocklist::shouldBlockWebGL): (WebCore::WebGLBlocklist::shouldSuggestBlockingWebGL): (WebCore::matchesBuildInfo): (WebCore::WebGLBlocklist::create): (WebCore::WebGLBlocklist::shouldBlock const): (WebCore::WebGLBlocklist::shouldSuggestBlocking const): (WebCore::WebGLBlocklist::WebGLBlocklist): (WebCore::WebGLBlocklist::~WebGLBlocklist): Source/WebKit: * Shared/Plugins/Netscape/mac/PluginInformationMac.mm: (WebKit::getPlatformPluginModuleInformation): * UIProcess/API/C/mac/WKContextPrivateMac.mm: (WKContextIsPlugInUpdateAvailable): (WKContextShouldBlockWebGL): (WKContextShouldSuggestBlockWebGL): * UIProcess/Plugins/mac/PluginInfoStoreMac.mm: (WebKit::PluginInfoStore::defaultLoadPolicyForPlugin): Source/WebKitLegacy/mac: * WebCoreSupport/WebFrameLoaderClient.mm: (shouldBlockPlugin): (shouldBlockWebGL): Canonical link: https://commits.webkit.org/225796@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262826 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-06-10 00:05:48 +00:00
platform/mac/BlocklistUpdater.mm
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. Source/WebCore: * Configurations/WebCore.xcconfig: Link AppKit for NSCursor. * SourcesCocoa.txt: Remove CursorIOS.cpp. De-unify CursorMac; because it imports AppKit headers, we have to take care to make sure it doesn't also get WAK (which it does if you leave it unified). * WebCore.xcodeproj/project.pbxproj: Remove CursorIOS.cpp and de-unify CursorMac (by adding it to the target) * loader/EmptyClients.h: * page/Chrome.cpp: (WebCore::Chrome::setCursor): (WebCore::Chrome::setCursorHiddenUntilMouseMoves): Unifdef many things. * page/ChromeClient.h: (WebCore::ChromeClient::supportsSettingCursor): Add a ChromeClient bit, supportsSettingCursor, which can be used to guard work that shouldn't happen if a platform doesn't support pushing cursor updates out from WebCore. This will be true everywhere except iOS, and does the work of the old platform ifdefs. * page/EventHandler.cpp: (WebCore::EventHandler::EventHandler): (WebCore::EventHandler::clear): (WebCore::EventHandler::updateCursor): (WebCore::EventHandler::selectCursor): (WebCore::EventHandler::handleMouseMoveEvent): (WebCore::EventHandler::scheduleCursorUpdate): * page/EventHandler.h: * platform/Cursor.cpp: * platform/Cursor.h: Unifdef, and use supportsSettingCursor to avoid some unnecessary work. * platform/ios/CursorIOS.cpp: Removed. * platform/ios/WidgetIOS.mm: (WebCore::Widget::setCursor): Propagate cursor changes upwards. * platform/mac/CursorMac.mm: (WebCore::cursor): (WebCore::Cursor::ensurePlatformCursor const): CursorMac is now built in macCatalyst. However, parts that depend on HIServices or NSImage are #ifdeffed out, and fall back to an arrow. Source/WebKit: * 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(). Source/WebKitLegacy/ios: * WebCoreSupport/WebChromeClientIOS.h: Provide a stub implementation of cursor-related ChromeClient methods. Source/WTF: * wtf/FeatureDefines.h: Make ENABLE_CURSOR_SUPPORT true on iOS, for macCatalyst. This results in it being true everywhere, so remove it. Add a new ENABLE_CUSTOM_CURSOR_SUPPORT, indicating whether we support custom bitmap cursors. It covers the subset of ENABLE_CURSOR_SUPPORT code that we still don't support in macCatalyst. * wtf/Platform.h: Add HAVE_HISERVICES (true on macOS but not macCatalyst) and HAVE_NSCURSOR (true on macOS and macCatalyst but not e.g. iOS). Canonical link: https://commits.webkit.org/218543@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@253636 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-12-17 19:57:25 +00:00
platform/mac/CursorMac.mm @no-unify
[macOS] Pull ServicesOverlayController::Highlight out into a separate helper class https://bugs.webkit.org/show_bug.cgi?id=225968 Reviewed by Tim Horton. Refactor some code for painting data detector highlights (`DDHighlightRef`), by pulling what is currently `ServicesOverlayController::Highlight` out into a separate helper class. In a future patch, I plan on using this functionality for the image overlay controller to support rendering data detector highlights there. This patch also makes some minor adjustments: - Make `DataDetectorHighlight` capable of being stored in a `WeakPtr`, and have `ServicesOverlayController` hold on to a `WeakHashSet<DataDetectorHighlight>` instead of a hash set of raw pointers. This additionally makes it unnecessary to add methods for `DataDetectorHighlight` to notify `ServicesOverlayController` upon creation or destruction, since we can simply add the newly created highlight to the weak set after creating it, and since it's a `WeakPtr`, it will get cleaned up upon destruction. - Make DataDetectorHighlight::Type an enum class, and make `m_dirtyHighlightTypes` an `OptionSet` instead of a raw bitmask. - Use `auto` in a few places where the type is apparent (e.g. in some places where we use `adoptCF`). - Make `highlightFadeAnimationDuration` a `WTF::Seconds` instead of a raw floating point value. - Add a FIXME in `DataDetectorHighlight::paintContents` about the need to refactor this painting logic so that it does *not* use the platform `CGContextRef` directly. No change in behavior. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * page/mac/ServicesOverlayController.h: (WebCore::ServicesOverlayController::activeHighlight const): (WebCore::ServicesOverlayController::Highlight::ddHighlight const): Deleted. (WebCore::ServicesOverlayController::Highlight::range const): Deleted. (WebCore::ServicesOverlayController::Highlight::layer const): Deleted. (WebCore::ServicesOverlayController::Highlight::type const): Deleted. * page/mac/ServicesOverlayController.mm: (WebCore::ServicesOverlayController::~ServicesOverlayController): (WebCore::ServicesOverlayController::selectionRectsDidChange): (WebCore::ServicesOverlayController::selectedTelephoneNumberRangesChanged): (WebCore::ServicesOverlayController::invalidateHighlightsOfType): (WebCore::ServicesOverlayController::buildPotentialHighlightsIfNeeded): (WebCore::ServicesOverlayController::mouseIsOverHighlight const): (WebCore::ServicesOverlayController::remainingTimeUntilHighlightShouldBeShown const): (WebCore::ServicesOverlayController::removeAllPotentialHighlightsOfType): (WebCore::ServicesOverlayController::buildPhoneNumberHighlights): (WebCore::ServicesOverlayController::buildSelectionHighlight): (WebCore::ServicesOverlayController::replaceHighlightsOfTypePreservingEquivalentHighlights): (WebCore::ServicesOverlayController::findTelephoneNumberHighlightContainingSelectionHighlight): (WebCore::ServicesOverlayController::determineActiveHighlight): (WebCore::ServicesOverlayController::mouseEvent): (WebCore::ServicesOverlayController::didScrollFrame): (WebCore::ServicesOverlayController::handleClick): (WebCore::ServicesOverlayController::shouldRemoveHighlightLayerAfterFadingOut const): (WebCore::ServicesOverlayController::Highlight::createForSelection): Deleted. (WebCore::ServicesOverlayController::Highlight::createForTelephoneNumber): Deleted. (WebCore::ServicesOverlayController::Highlight::Highlight): Deleted. (WebCore::ServicesOverlayController::Highlight::~Highlight): Deleted. (WebCore::ServicesOverlayController::Highlight::setDDHighlight): Deleted. (WebCore::ServicesOverlayController::Highlight::invalidate): Deleted. (WebCore::ServicesOverlayController::Highlight::notifyFlushRequired): Deleted. (WebCore::ServicesOverlayController::Highlight::paintContents): Deleted. (WebCore::ServicesOverlayController::Highlight::deviceScaleFactor const): Deleted. (WebCore::ServicesOverlayController::Highlight::fadeIn): Deleted. (WebCore::ServicesOverlayController::Highlight::fadeOut): Deleted. (WebCore::ServicesOverlayController::Highlight::didFinishFadeOutAnimation): Deleted. (WebCore::ServicesOverlayController::highlightsAreEquivalent): Deleted. (WebCore::ServicesOverlayController::didCreateHighlight): Deleted. (WebCore::ServicesOverlayController::willDestroyHighlight): Deleted. * platform/mac/DataDetectorHighlight.h: Added. (WebCore::DataDetectorHighlightClient::shouldRemoveHighlightLayerAfterFadingOut const): (WebCore::DataDetectorHighlight::highlight const): (WebCore::DataDetectorHighlight::range const): (WebCore::DataDetectorHighlight::layer const): (WebCore::DataDetectorHighlight::type const): * platform/mac/DataDetectorHighlight.mm: Added. (WebCore::DataDetectorHighlight::createForSelection): (WebCore::DataDetectorHighlight::createForTelephoneNumber): (WebCore::DataDetectorHighlight::DataDetectorHighlight): (WebCore::DataDetectorHighlight::setHighlight): (WebCore::DataDetectorHighlight::invalidate): (WebCore::DataDetectorHighlight::notifyFlushRequired): (WebCore::DataDetectorHighlight::paintContents): (WebCore::DataDetectorHighlight::deviceScaleFactor const): (WebCore::DataDetectorHighlight::fadeIn): (WebCore::DataDetectorHighlight::fadeOut): (WebCore::DataDetectorHighlight::didFinishFadeOutAnimation): (WebCore::areEquivalent): Canonical link: https://commits.webkit.org/237917@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277747 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-19 20:30:27 +00:00
platform/mac/DataDetectorHighlight.mm
Refactor HID gamepad code to be much less fragile and much easier to hack on. https://bugs.webkit.org/show_bug.cgi?id=214910 Reviewed by Darin Adler. Source/WebCore: Covered by API tests. Currently - for HID device gamepads - we throw all buttons and axes against the wall and see what sticks. Instead, for specific popular devices, we'd like to have device-specific mappings so the representation makes sense. To support that work, this is a major refactoring of the HID gamepad code. It does the following: - Breaks out logic specific to IOHIDDeviceRef into HIDDevice - Breaks out logic specific to IOHIDElementRef into HIDElement - Moves responsibities of managing things to the right places (e.g. HIDElement manages its own current value directly) - Makes HIDGamepadElement derive from HIDElement directly - Moves device specific logic from HIDGamepad into a subclass of HID gamepad. Currently the only subclass is "generic" which encompasses HIDGamepad's old behavior - Changes button/value vectors from Vector<double> to Vector<SharedGamepadValue> so multiple objects can reference the value at once. e.g. HIDGamepadButton can simply update it's own SharedGamepadValue without knowing which HIDGamepad owns it or which index into the gamepad's value vector it should be mutating. This will be critical in the "specific device mapping" work as some types of HIDElements actually drive more than one gamepad button value. e.g. a "direction pad axis" actually manages 2 button values, or a "hat-switch" direction pad manages 4 button values This patch doesn't change any current behavior. * Modules/gamepad/Gamepad.cpp: (WebCore::Gamepad::updateFromPlatformGamepad): * Sources.txt: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/Logging.h: * platform/gamepad/PlatformGamepad.h: * platform/gamepad/SharedGamepadValue.h: Copied from Source/WebKit/UIProcess/Gamepad/UIGamepad.h. (WebCore::SharedGamepadValue::SharedGamepadValue): (WebCore::SharedGamepadValue::setValue): (WebCore::SharedGamepadValue::value const): (WebCore::SharedGamepadValue::Data::Data): * platform/gamepad/cocoa/GameControllerGamepad.h: * platform/gamepad/cocoa/GameControllerGamepad.mm: (WebCore::GameControllerGamepad::setupAsExtendedGamepad): (WebCore::GameControllerGamepad::setupAsGamepad): * platform/gamepad/mac/GenericHIDGamepad.cpp: Added. (WebCore::GenericHIDGamepad::GenericHIDGamepad): (WebCore::GenericHIDGamepad::id): (WebCore::GenericHIDGamepad::maybeAddGenericDesktopElement): (WebCore::GenericHIDGamepad::maybeAddButtonElement): * platform/gamepad/mac/GenericHIDGamepad.h: Copied from Source/WebKit/WebProcess/Gamepad/WebGamepad.h. * platform/gamepad/mac/HIDGamepad.cpp: (WebCore::HIDGamepad::create): (WebCore::HIDGamepad::HIDGamepad): (WebCore::HIDGamepad::initialize): (WebCore::HIDGamepad::valueChanged): (WebCore::HIDGamepad::getCurrentValueForElement): Deleted. (WebCore::HIDGamepad::initElements): Deleted. (WebCore::HIDGamepad::initElementsFromArray): Deleted. (WebCore::HIDGamepad::maybeAddButton): Deleted. (WebCore::HIDGamepad::maybeAddAxis): Deleted. * platform/gamepad/mac/HIDGamepad.h: (WebCore::HIDGamepad::hidDevice const): (WebCore::HIDGamepadElement::HIDGamepadElement): Deleted. (WebCore::HIDGamepadElement::~HIDGamepadElement): Deleted. (WebCore::HIDGamepadElement::isButton const): Deleted. (WebCore::HIDGamepadElement::isAxis const): Deleted. (WebCore::HIDGamepadButton::HIDGamepadButton): Deleted. (WebCore::HIDGamepadAxis::HIDGamepadAxis): Deleted. * platform/gamepad/mac/HIDGamepadElement.cpp: Added. (WebCore::HIDGamepadElement::HIDGamepadElement): (WebCore::HIDGamepadElement::refreshCurrentValue): (WebCore::HIDGamepadElement::normalizedValue): (WebCore::HIDGamepadButton::gamepadValueChanged): (WebCore::HIDGamepadAxis::gamepadValueChanged): (WebCore::HIDGamepadAxis::normalizedValue): * platform/gamepad/mac/HIDGamepadElement.h: Copied from Source/WebCore/platform/gamepad/PlatformGamepad.h. (WebCore::HIDGamepadElement::~HIDGamepadElement): (WebCore::HIDGamepadElement::isButton const): (WebCore::HIDGamepadElement::isAxis const): * platform/gamepad/mac/HIDGamepadProvider.mm: (WebCore::HIDGamepadProvider::deviceAdded): * platform/gamepad/mac/MultiGamepadProvider.h: * platform/graphics/cocoa/SourceBufferParserWebM.cpp: * platform/mac/HIDDevice.cpp: Added. (WebCore::HIDDevice::HIDDevice): (WebCore::HIDDevice::uniqueInputElementsInDeviceTreeOrder const): * platform/mac/HIDDevice.h: Copied from Source/WebCore/platform/gamepad/PlatformGamepad.h. (WebCore::HIDDevice::rawElement const): (WebCore::HIDDevice::vendorID const): (WebCore::HIDDevice::productID const): (WebCore::HIDDevice::productName const): * platform/mac/HIDElement.cpp: Copied from Source/WebKit/UIProcess/Gamepad/UIGamepad.h. (WebCore::HIDElement::HIDElement): (WebCore::HIDElement::valueChanged): * platform/mac/HIDElement.h: Copied from Source/WebKit/UIProcess/Gamepad/UIGamepad.h. (WebCore::HIDElement::rawElement const): (WebCore::HIDElement::physicalMin const): (WebCore::HIDElement::physicalMax const): (WebCore::HIDElement::physicalValue const): (WebCore::HIDElement::usage const): (WebCore::HIDElement::usagePage const): (WebCore::HIDElement::cookie const): * testing/MockGamepad.cpp: (WebCore::MockGamepad::updateDetails): (WebCore::MockGamepad::setAxisValue): (WebCore::MockGamepad::setButtonValue): * testing/MockGamepad.h: Source/WebKit: * Shared/Gamepad/GamepadData.cpp: (WebKit::GamepadData::GamepadData): * Shared/Gamepad/GamepadData.h: * UIProcess/Gamepad/UIGamepad.h: * WebProcess/Gamepad/WebGamepad.cpp: (WebKit::WebGamepad::axisValues const): (WebKit::WebGamepad::buttonValues const): (WebKit::WebGamepad::updateValues): * WebProcess/Gamepad/WebGamepad.h: Tools: Add a test that verifies connect, basic button/axis changes, and disconnect of a HID gamepad. * TestWebKitAPI/Tests/mac/HIDGamepads.mm: Canonical link: https://commits.webkit.org/227779@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@265079 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-07-30 07:21:44 +00:00
platform/mac/HIDDevice.cpp
platform/mac/HIDElement.cpp
platform/mac/KeyEventMac.mm @no-unify
Adapt LocalCurrentGraphicsContext for iOS <https://webkit.org/b/211660> Reviewed by Darin Adler. Source/WebCore: * PlatformMac.cmake: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: - Update build files for: - Rename of LocalCurrentGraphicsContext.mm to LocalCurrentGraphicsContextMac.mm. - Move of LocalCurrentGraphicsContext.h from platform/mac to platform/cocoa. - Addition of LocalCurrentGraphicsContextIOS.mm. * platform/cocoa/LocalCurrentGraphicsContext.h: Renamed from Source/WebCore/platform/mac/LocalCurrentGraphicsContext.h. - Make this work for iOS by using PLATFORM(COCOA) for the outer guard and USE(APPKIT) for the Mac-specific bits. - Use RetainPtr<> for NSGraphicsContext to clean up code in LocalCurrentGraphicsContextMac.mm. (WebCore::LocalCurrentGraphicsContext::cgContext): - Inline from LocalCurrentGraphicsContextMac.mm. * platform/ios/LocalCurrentGraphicsContextIOS.mm: Copied from Source/WebCore/platform/mac/LocalCurrentGraphicsContext.mm. (WebCore::LocalCurrentGraphicsContext::LocalCurrentGraphicsContext): (WebCore::LocalCurrentGraphicsContext::~LocalCurrentGraphicsContext): - Implement based on LocalCurrentGraphicsContextMac.mm. Use UIGraphics{GetCurrent,Pop,Push}Context() functions added to UIKitSoftLink.h. * platform/mac/LocalCurrentGraphicsContextMac.mm: Renamed from Source/WebCore/platform/mac/LocalCurrentGraphicsContext.mm. (WebCore::LocalCurrentGraphicsContext::LocalCurrentGraphicsContext): - Use m_savedGraphicsContext instead of graphicsContext in the body of the constructor. - Remove set-to-nil/retain of m_savedNSGraphicsContext since that is handled by RetainPtr<> now. (WebCore::LocalCurrentGraphicsContext::~LocalCurrentGraphicsContext): - Remove release of m_savedNSGraphicsContext since that is handled by RetainPtr<> now. (WebCore::LocalCurrentGraphicsContext::cgContext): Delete. - Inline into header to share implementation with iOS. Source/WebCore/PAL: * pal/ios/UIKitSoftLink.h: * pal/ios/UIKitSoftLink.mm: - Add soft linking of UIGraphics{GetCurrent,Pop,Push}Context() functions. Source/WebKit: * UIProcess/Cocoa/WebPageProxyCocoa.mm: (WebKit::convertPlatformImageToBitmap): - Use LocalCurrentGraphicsContext for both iOS and Mac code paths. * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: - Switch from PLATFORM(MAC) and PLATFORM(IOS_FAMIY) to USE(APPKIT) to separate platform code. (WebKit::convertDragImageToBitmap): (WebKit::convertImageToBitmap): Delete. (WebKit::convertCGImageToBitmap): Delete. - Combine Mac-specific convertImageToBitmap() and iOS-specific convertCGImageToBitmap() into a single method using DragImage type and special-casing one line of code. (WebKit::WebDragClient::startDrag): (WebKit::WebDragClient::didConcludeEditDrag): - Combine iOS and Mac methods into a singe method. Canonical link: https://commits.webkit.org/224588@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@261442 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-05-09 23:10:41 +00:00
platform/mac/LocalCurrentGraphicsContextMac.mm
platform/mac/LocalDefaultSystemAppearance.mm
platform/mac/LoggingMac.mm
platform/mac/MediaRemoteSoftLink.mm
platform/mac/NSScrollerImpDetails.mm
platform/mac/PasteboardMac.mm
platform/mac/PasteboardWriter.mm
platform/mac/PlatformEventFactoryMac.mm
platform/mac/PlatformPasteboardMac.mm
platform/mac/PlatformScreenMac.mm
platform/mac/PlatformSpeechSynthesizerMac.mm
platform/mac/PlaybackSessionInterfaceMac.mm @no-unify
Stop using discriminatory names for WebGL and Plugin blocking https://bugs.webkit.org/show_bug.cgi?id=213000 Reviewed by Simon Fraser. Source/WebCore: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/mac/BlocklistUpdater.h: Renamed from Source/WebCore/platform/mac/BlacklistUpdater.h. (WebCore::BlocklistUpdater::pluginBlocklist): (WebCore::BlocklistUpdater::webGLBlocklist): * platform/mac/BlocklistUpdater.mm: Renamed from Source/WebCore/platform/mac/BlacklistUpdater.mm. (WebCore::BlocklistUpdater::readBlocklistData): (WebCore::BlocklistUpdater::reloadIfNecessary): (WebCore::BlocklistUpdater::initializeQueue): * platform/mac/PluginBlocklist.h: Renamed from Source/WebCore/platform/mac/PluginBlacklist.h. * platform/mac/PluginBlocklist.mm: Renamed from Source/WebCore/platform/mac/PluginBlacklist.mm. (WebCore::PluginBlocklist::loadPolicyForPluginVersion): (WebCore::PluginBlocklist::isPluginUpdateAvailable): (WebCore::PluginBlocklist::create): (WebCore::PluginBlocklist::~PluginBlocklist): (WebCore::PluginBlocklist::splitOSVersion): (WebCore::PluginBlocklist::loadPolicyForPlugin const): (WebCore::PluginBlocklist::isUpdateAvailable const): (WebCore::PluginBlocklist::PluginBlocklist): * platform/mac/WebGLBlocklist.h: Renamed from Source/WebCore/platform/mac/WebGLBlacklist.h. * platform/mac/WebGLBlocklist.mm: Renamed from Source/WebCore/platform/mac/WebGLBlacklist.mm. (WebCore::buildInfoFromOSBuildString): (WebCore::WebGLBlocklist::shouldBlockWebGL): (WebCore::WebGLBlocklist::shouldSuggestBlockingWebGL): (WebCore::matchesBuildInfo): (WebCore::WebGLBlocklist::create): (WebCore::WebGLBlocklist::shouldBlock const): (WebCore::WebGLBlocklist::shouldSuggestBlocking const): (WebCore::WebGLBlocklist::WebGLBlocklist): (WebCore::WebGLBlocklist::~WebGLBlocklist): Source/WebKit: * Shared/Plugins/Netscape/mac/PluginInformationMac.mm: (WebKit::getPlatformPluginModuleInformation): * UIProcess/API/C/mac/WKContextPrivateMac.mm: (WKContextIsPlugInUpdateAvailable): (WKContextShouldBlockWebGL): (WKContextShouldSuggestBlockWebGL): * UIProcess/Plugins/mac/PluginInfoStoreMac.mm: (WebKit::PluginInfoStore::defaultLoadPolicyForPlugin): Source/WebKitLegacy/mac: * WebCoreSupport/WebFrameLoaderClient.mm: (shouldBlockPlugin): (shouldBlockWebGL): Canonical link: https://commits.webkit.org/225796@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262826 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-06-10 00:05:48 +00:00
platform/mac/PluginBlocklist.mm
platform/mac/PowerObserverMac.cpp
platform/mac/PublicSuffixMac.mm
platform/mac/SSLKeyGeneratorMac.mm
platform/mac/ScrollAnimatorMac.mm @no-unify
Pull Mac-only code out of ScrollController https://bugs.webkit.org/show_bug.cgi?id=221462 <rdar://problem/74273853> Patch by Martin Robinson <mrobinson@igalia.com> on 2021-02-15 Reviewed by Simon Fraser. No new tests. This should not change behavior. Split out Mac-specific code from ScrollController and prepare it for use on non-Cocoa platforms. This code must be pulled out primarily because it is Objective-C++ code and should maintain the .mm extension. The idea here is to isolate the basic platform-independent scroll snapping code and gradually make the rest (related to handling wheel events) more-and-more platform-independent. * PlatformMac.cmake: Update source list. * Sources.txt: Ditto. * SourcesCocoa.txt: Ditto. * WebCore.xcodeproj/project.pbxproj: Ditto. * page/scrolling/ScrollingMomentumCalculator.cpp: Guard code with ENABLE(CSS_SCROLL_SNAP). * platform/ScrollController.cpp: Added. This file contains only the platform-independent scroll snapping code that will be used to add initial scroll snap support to other ports. * platform/ScrollController.h: Renamed from Source/WebCore/platform/cocoa/ScrollController.h. * platform/ScrollSnapAnimatorState.cpp: Renamed from Source/WebCore/platform/cocoa/ScrollSnapAnimatorState.mm. * platform/ScrollSnapAnimatorState.h: Renamed from Source/WebCore/platform/cocoa/ScrollSnapAnimatorState.h. * platform/graphics/cg/GraphicsContextGLCG.cpp: Fix unified source build issue exposed by this change. * platform/mac/ScrollController.mm: Renamed from Source/WebCore/platform/cocoa/ScrollController.mm. * platform/mac/VideoFullscreenInterfaceMac.mm: Fix unified source build issue. Canonical link: https://commits.webkit.org/234111@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-02-15 21:48:10 +00:00
platform/mac/ScrollController.mm
platform/mac/ScrollViewMac.mm
platform/mac/ScrollbarThemeMac.mm @no-unify
Rename SerializedPlatformRepresentation to SerializedPlatformDataCue https://bugs.webkit.org/show_bug.cgi?id=207695 <rdar://problem/59422673> Reviewed by Youenn Fablet. No new tests, no functional change. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * html/track/DataCue.cpp: (WebCore::DataCue::DataCue): (WebCore::DataCue::cueContentsMatch const): * html/track/DataCue.h: * html/track/InbandDataTextTrack.cpp: (WebCore::InbandDataTextTrack::addDataCue): (WebCore::InbandDataTextTrack::updateDataCue): (WebCore::InbandDataTextTrack::removeDataCue): (WebCore::InbandDataTextTrack::removeCue): * html/track/InbandDataTextTrack.h: * html/track/InbandTextTrack.h: * platform/SerializedPlatformDataCue.h: Renamed from Source/WebCore/platform/SerializedPlatformRepresentation.h. * platform/graphics/InbandTextTrackPrivateClient.h: * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp: (WebCore::InbandMetadataTextTrackPrivateAVF::addDataCue): * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive): * platform/mac/SerializedPlatformDataCueMac.h: Renamed from Source/WebCore/platform/mac/SerializedPlatformRepresentationMac.h. (WebCore::SerializedPlatformDataCueMac::nativeValue const): * platform/mac/SerializedPlatformDataCueMac.mm: Renamed from Source/WebCore/platform/mac/SerializedPlatformRepresentationMac.mm. (WebCore::SerializedPlatformDataCueMac::SerializedPlatformDataCueMac): (WebCore::SerializedPlatformDataCueMac::~SerializedPlatformDataCueMac): (WebCore::SerializedPlatformDataCueMac::create): (WebCore::SerializedPlatformDataCueMac::data const): (WebCore::SerializedPlatformDataCueMac::deserialize const): (WebCore::SerializedPlatformDataCueMac::isEqual const): (WebCore::toSerializedPlatformDataCueMac): (WebCore::jsValueWithValueInContext): (WebCore::jsValueWithDataInContext): (WebCore::jsValueWithArrayInContext): (WebCore::jsValueWithDictionaryInContext): (WebCore::jsValueWithAVMetadataItemInContext): Canonical link: https://commits.webkit.org/220683@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256536 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-02-13 21:40:08 +00:00
platform/mac/SerializedPlatformDataCueMac.mm
platform/mac/StringUtilities.mm
platform/mac/SuddenTermination.mm
platform/mac/ThemeMac.mm
platform/mac/ThreadCheck.mm @no-unify
platform/mac/UserActivityMac.mm
platform/mac/UserAgentMac.mm
platform/mac/ValidationBubbleMac.mm
platform/mac/VideoFullscreenInterfaceMac.mm
platform/mac/WebCoreFullScreenPlaceholderView.mm
platform/mac/WebCoreFullScreenWarningView.mm
platform/mac/WebCoreFullScreenWindow.mm
[macOS] Cannot change font size at selection until font panel is shown https://bugs.webkit.org/show_bug.cgi?id=189295 <rdar://problem/35593389> Reviewed by Ryosuke Niwa. Source/WebCore: Currently, attempting to alter the font size of currently selected editable text in WKWebView via menu items will fail if the font panel has never been shown. This is because WebViewImpl::changeFontFromFontPanel, which is responsible for converting the current font at the selection to the new font using -[NSFontManager convertFont:] bails as a result of NSFontManager's currently selected font always being nil. WKWebView is responsible for keeping NSFontManager up-to-date with the currently selected font; in fact, this was initially the case in r180465, which introduced NSFontManager support in WebKit2 by propagating EditorState updates that contained font information for the current selection. However, this regressed performance due to selected font computation triggering extra layout passes; r180768 addressed this by introducing a mechanism for requesting the font at the current selection, and only updating NSFontManager with the new selected font when the shared font panel is visible (determined by KVO on NSFontPanel). However, this again regressed WKWebView launch performance, due to KVO registration always forcing the shared NSFontPanel to be created. r182037 addressed this by only registering for KVO on the font panel if the WKWebView has been made editable (SPI on WKWebView). This leads to two issues when attempting to alter font attributes using macOS UI: (1) in web views that have not been made editable using SPI, showing the font panel and attempting to change the font fails due to the selected font staying nil, because we've never begun registering for KVO notifications on the font panel so we don't try to keep the font manager up to date. (2) Even if the web view is made editable, if the font panel is never shown, then the font manager still won't be kept up to date with the current selection, so changing fonts using menu items still does not work. We fix both of these problems by refactoring font manager support on WebKit2 such that an up-to-date selected font in the UI process is no longer necessary in order to alter the font at the current selection. To do this, we figure out what changes the NSFontManager would've made to the currently selected font in the UI process, and then propagate this information to the web process, where we convert this information into an EditingStyle which we apply to the current selection. The code to both determine the attributes changed by NSFontManager and to convert these attributes into editing styles to be applied via Editor already exists in WebKitLegacy, in WebHTMLView.mm. This patch moves this existing logic into WebCore and teases it apart into two portions: the first portion probes NSFontManager to determine which aspects of the font changed and constructs FontChanges, which captures these differences. The second portion maps FontChanges to an EditingStyle, which can then be applied to the current selection. In WebKitLegacy, we construct FontChanges using the font manager, and then immediately use it to create and apply an EditingStyle. In WebKit, we construct FontChanges in the UI process using the font manager, and then send this over to the web process via WebPage::changeFont, which then creates and applies the EditingStyle. Note that this patch also introduces FontAttributeChanges, which is similar in concept to FontChanges, but captures a broader range of changes possible via NSFontPanel. This was done so that we can eliminate all of the font manager probing code (along with the two specimen fonts) from WebHTMLView, but is also necessary in order to allow changing font shadow, strikethrough, and underlines via the font panel to work in WebKit2. This will be fixed in a followup, by making FontAttributeChanges IPC encodable and by making WKWebView/WKView respond to the -changeAttributes: selector. Changes in behavior to WebKit2 are covered by new API tests; legacy WebKit behavior should remain unchanged. Tests: FontManagerTests.ChangeFontSizeWithMenuItems FontManagerTests.ChangeFontWithPanel * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * editing/Editor.h: Remove applyFontStyles. * editing/FontAttributeChanges.cpp: Added. (WebCore::FontChanges::platformFontFamilyNameForCSS const): Given a font family name and a font name, returns the string to use as the "font-family" style property value. Originally from WebHTMLView.mm. (WebCore::FontChanges::createEditingStyle const): Converts font changes to an EditingStyle that can be used to apply these changes. (WebCore::FontChanges::createStyleProperties const): Introduce FontChanges, which encapsulates changes which are to be applied to the font in the current selection. (WebCore::cssValueListForShadow): (WebCore::FontAttributeChanges::createEditingStyle const): Converts font attribute changes to an EditingStyle that can be used to apply these changes. * editing/FontAttributeChanges.h: Added. Introduce FontAttributeChanges, which encapsulates changes which are to be applied to the font attributes in the current selection. This includes a set of FontChanges, as well as additional attributes such as strike-through and underlines. (WebCore::FontChanges::setFontName): (WebCore::FontChanges::setFontFamily): (WebCore::FontChanges::setFontSize): (WebCore::FontChanges::setFontSizeDelta): (WebCore::FontChanges::setBold): (WebCore::FontChanges::setItalic): (WebCore::FontAttributeChanges::setVerticalAlign): (WebCore::FontAttributeChanges::setBackgroundColor): (WebCore::FontAttributeChanges::setForegroundColor): (WebCore::FontAttributeChanges::setShadow): (WebCore::FontAttributeChanges::setStrikeThrough): (WebCore::FontAttributeChanges::setUnderline): (WebCore::FontAttributeChanges::setFontChanges): Setters for FontChanges and FontAttributeChanges. Initially, most of these values are optional, indicating that there should be no change. (WebCore::FontChanges::encode const): (WebCore::FontChanges::decode): Add encoding/decoding support to FontChanges, so that it can be sent over IPC for WebKit2. * editing/cocoa/FontAttributeChangesCocoa.mm: Added. (WebCore::FontChanges::platformFontFamilyNameForCSS const): Helper method to determine whether the font family or the font name should be used, by looking up the PostScript font name using a FontDescriptor and comparing it against the result of -[NSFont fontName]. This logic was originally in WebHTMLView.mm. * editing/mac/EditorMac.mm: (WebCore::Editor::applyFontStyles): Deleted. * platform/mac/WebCoreNSFontManagerExtras.h: Added. * platform/mac/WebCoreNSFontManagerExtras.mm: Added. Add helper functions to compute FontChanges and FontAttributeChanges from NSFontManager. (WebCore::firstFontConversionSpecimen): (WebCore::secondFontConversionSpecimen): Two "specimen fonts" used to determine what changes NSFontManager or NSFontPanel makes when performing font or font attribute conversion. Moved from WebHTMLView.mm. (WebCore::computedFontChanges): (WebCore::computedFontAttributeChanges): Moved here from WebHTMLView.mm. Instead of converting font attributes to NSStrings and setting properties on DOMCSSStyleDeclaration, we instead specify properties on MutableStyleProperties using CSSValues. Source/WebKit: Refactors NSFontManager support in WebKit2. See WebCore ChangeLog for more details. * Scripts/webkit/messages.py: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView changeFont:]): * UIProcess/API/mac/WKView.mm: (-[WKView changeFont:]): * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::changeFontFromFontManager): (WebKit::WebViewImpl::changeFontFromFontPanel): Deleted. Renamed this from changeFontFromFontPanel to changeFontFromFontManager. This new name is more accurate in the case where a menu item is used to alter the font, which doesn't involve NSFontPanel at all. * UIProcess/WebPageProxy.h: * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::changeFont): (WebKit::WebPageProxy::setFont): Deleted. * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::changeFont): (WebKit::WebPage::setFont): Deleted. Source/WebKitLegacy/mac: Remove code in WebKitLegacy for diffing NSFonts to figure out which style properties need to be changed. See WebCore ChangeLog for more details. * WebView/WebHTMLView.mm: (-[WebHTMLView changeFont:]): (-[WebHTMLView changeAttributes:]): (-[WebHTMLView _originalFontA]): Deleted. (-[WebHTMLView _originalFontB]): Deleted. (fontNameForDescription): Deleted. (-[WebHTMLView _addToStyle:fontA:fontB:]): Deleted. (-[WebHTMLView _styleFromFontManagerOperation]): Deleted. (-[WebHTMLView _styleForAttributeChange:]): Deleted. Tools: Add API tests to simulate using menu items to increase or decrease font size, and also simulate using NSFontPanel to specify the font family, font size, and other traits. * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/mac/FontManagerTests.mm: Added. (-[TestWKWebView selectedText]): (-[TestWKWebView selectNextWord]): (-[TestWKWebView stylePropertyAtSelectionStart:]): (-[TestWKWebView stylePropertyAtSelectionEnd:]): (webViewForFontManagerTesting): (menuItemCellForFontAction): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/204355@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235748 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-09-06 19:46:38 +00:00
platform/mac/WebCoreNSFontManagerExtras.mm
platform/mac/WebCoreNSURLExtras.mm
platform/mac/WebCoreObjCExtras.mm
Stop using discriminatory names for WebGL and Plugin blocking https://bugs.webkit.org/show_bug.cgi?id=213000 Reviewed by Simon Fraser. Source/WebCore: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/mac/BlocklistUpdater.h: Renamed from Source/WebCore/platform/mac/BlacklistUpdater.h. (WebCore::BlocklistUpdater::pluginBlocklist): (WebCore::BlocklistUpdater::webGLBlocklist): * platform/mac/BlocklistUpdater.mm: Renamed from Source/WebCore/platform/mac/BlacklistUpdater.mm. (WebCore::BlocklistUpdater::readBlocklistData): (WebCore::BlocklistUpdater::reloadIfNecessary): (WebCore::BlocklistUpdater::initializeQueue): * platform/mac/PluginBlocklist.h: Renamed from Source/WebCore/platform/mac/PluginBlacklist.h. * platform/mac/PluginBlocklist.mm: Renamed from Source/WebCore/platform/mac/PluginBlacklist.mm. (WebCore::PluginBlocklist::loadPolicyForPluginVersion): (WebCore::PluginBlocklist::isPluginUpdateAvailable): (WebCore::PluginBlocklist::create): (WebCore::PluginBlocklist::~PluginBlocklist): (WebCore::PluginBlocklist::splitOSVersion): (WebCore::PluginBlocklist::loadPolicyForPlugin const): (WebCore::PluginBlocklist::isUpdateAvailable const): (WebCore::PluginBlocklist::PluginBlocklist): * platform/mac/WebGLBlocklist.h: Renamed from Source/WebCore/platform/mac/WebGLBlacklist.h. * platform/mac/WebGLBlocklist.mm: Renamed from Source/WebCore/platform/mac/WebGLBlacklist.mm. (WebCore::buildInfoFromOSBuildString): (WebCore::WebGLBlocklist::shouldBlockWebGL): (WebCore::WebGLBlocklist::shouldSuggestBlockingWebGL): (WebCore::matchesBuildInfo): (WebCore::WebGLBlocklist::create): (WebCore::WebGLBlocklist::shouldBlock const): (WebCore::WebGLBlocklist::shouldSuggestBlocking const): (WebCore::WebGLBlocklist::WebGLBlocklist): (WebCore::WebGLBlocklist::~WebGLBlocklist): Source/WebKit: * Shared/Plugins/Netscape/mac/PluginInformationMac.mm: (WebKit::getPlatformPluginModuleInformation): * UIProcess/API/C/mac/WKContextPrivateMac.mm: (WKContextIsPlugInUpdateAvailable): (WKContextShouldBlockWebGL): (WKContextShouldSuggestBlockWebGL): * UIProcess/Plugins/mac/PluginInfoStoreMac.mm: (WebKit::PluginInfoStore::defaultLoadPolicyForPlugin): Source/WebKitLegacy/mac: * WebCoreSupport/WebFrameLoaderClient.mm: (shouldBlockPlugin): (shouldBlockWebGL): Canonical link: https://commits.webkit.org/225796@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262826 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-06-10 00:05:48 +00:00
platform/mac/WebGLBlocklist.mm
platform/mac/WebNSAttributedStringExtras.mm
platform/mac/WebPlaybackControlsManager.mm
platform/mac/WidgetMac.mm
Implement non-timeslice mode encoding for MediaRecorder https://bugs.webkit.org/show_bug.cgi?id=192069 <rdar://problem/46443290> Patch by YUHAN WU <yuhan_wu@apple.com> on 2018-12-12 Reviewed by Eric Carlson. Source/WebCore: Implement the encoding for non-timeslice mode of MediaRecorder. It only supports to record MP4 file through H264 and AAC encoding, we will need to support more MIME types and encoding methods. Add a API in internals to allow testings to turn on the mock source. Test: http/wpt/mediarecorder/MediaRecorder-AV-audio-video-dataavailable.html * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::create): (WebCore::MediaRecorder::setCustomPrivateRecorderCreator): (WebCore::MediaRecorder::getPrivateImpl): (WebCore::MediaRecorder::MediaRecorder): (WebCore::MediaRecorder::stopRecording): (WebCore::MediaRecorder::stopRecordingInternal): (WebCore::MediaRecorder::createRecordingDataBlob): (WebCore::MediaRecorder::scheduleDeferredTask): * Modules/mediarecorder/MediaRecorder.h: * Modules/mediarecorder/MediaRecorder.idl: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/mediarecorder/MediaRecorderPrivate.h: (WebCore::MediaRecorderPrivate::stopRecording): * platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp: Added. (WebCore::MediaRecorderPrivateAVFImpl::create): (WebCore::MediaRecorderPrivateAVFImpl::MediaRecorderPrivateAVFImpl): (WebCore::MediaRecorderPrivateAVFImpl::sampleBufferUpdated): (WebCore::MediaRecorderPrivateAVFImpl::audioSamplesAvailable): (WebCore::MediaRecorderPrivateAVFImpl::stopRecording): (WebCore::MediaRecorderPrivateAVFImpl::fetchData): (WebCore::MediaRecorderPrivateAVFImpl::mimeType): * platform/mediarecorder/MediaRecorderPrivateAVFImpl.h: Added. * platform/mediarecorder/MediaRecorderPrivateMock.cpp: (WebCore::MediaRecorderPrivateMock::fetchData): (WebCore::MediaRecorderPrivateMock::mimeType): * platform/mediarecorder/MediaRecorderPrivateMock.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: added. * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: Added. (WebCore::MediaRecorderPrivateWriter::clear): (WebCore::MediaRecorderPrivateWriter::setupWriter): (WebCore::MediaRecorderPrivateWriter::setVideoInput): (WebCore::MediaRecorderPrivateWriter::setAudioInput): (WebCore::copySampleBufferWithCurrentTimeStamp): (WebCore::MediaRecorderPrivateWriter::appendVideoSampleBuffer): (WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer): (WebCore::MediaRecorderPrivateWriter::stopRecording): * testing/Internals.cpp: (WebCore::createRecorderMockSource): (WebCore::Internals::setCustomPrivateRecorderCreator): * testing/Internals.h: * testing/Internals.idl: LayoutTests: Create new tests for encoding of MediaRecorder. Check if the produced video and audio are correct. Add code to turn on the mock source of MediaRecorder for the two old tests because the real source is enabled by default. * http/wpt/mediarecorder/MediaRecorder-AV-audio-video-dataavailable-expected.txt: Added. * http/wpt/mediarecorder/MediaRecorder-AV-audio-video-dataavailable.html: Added. * http/wpt/mediarecorder/MediaRecorder-dataavailable.html: * http/wpt/mediarecorder/MediaRecorder-mock-dataavailable.html: Canonical link: https://commits.webkit.org/207224@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239145 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-13 02:34:19 +00:00
platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp
[Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder https://bugs.webkit.org/show_bug.cgi?id=206582 Source/WebCore: <rdar://problem/58985368> Reviewed by Eric Carlson. AVAssetWriterDelegate allows to grab recorded data whenever wanted. This delegate requires passing compressed samples to AVAssetWriter. Implement video encoding and audio encoding in dedicated classes and use these classes before adding buffers to AVAssetWriter. These classes are AudioSampleBufferCompressor and VideoSampleBufferCompressor. They support AAC and H264 so far and should be further improved to support more encoding options. Instantiate real writer only for platforms supporting AVAssetWriterDelegate, since it is not supported everywhere. The writer, doing the pacakging, is receiving compressed buffer from the audio/video compressors. It then sends data when being request to flush to its delegate, which will send data to the MediaRecorderPrivateWriter. The MediaRecorderPrivateWriter stores the data in a SharedBuffer until MediaRecorder asks for data. Note that, whenever we request data, we flush the writer and insert an end of video sample to make sure video data gets flushed. Therefore data should not be requested too fast to get adequate video compression. Covered by existing tests. * Modules/mediarecorder/MediaRecorderProvider.cpp: (WebCore::MediaRecorderProvider::createMediaRecorderPrivate): * WebCore.xcodeproj/project.pbxproj: * platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp: (WebCore::MediaRecorderPrivateAVFImpl::create): * platform/mediarecorder/MediaRecorderPrivateAVFImpl.h: * platform/mediarecorder/cocoa/AudioSampleBufferCompressor.h: Added. * platform/mediarecorder/cocoa/AudioSampleBufferCompressor.mm: Added. (WebCore::AudioSampleBufferCompressor::create): (WebCore::AudioSampleBufferCompressor::AudioSampleBufferCompressor): (WebCore::AudioSampleBufferCompressor::~AudioSampleBufferCompressor): (WebCore::AudioSampleBufferCompressor::initialize): (WebCore::AudioSampleBufferCompressor::finish): (WebCore::AudioSampleBufferCompressor::initAudioConverterForSourceFormatDescription): (WebCore::AudioSampleBufferCompressor::computeBufferSizeForAudioFormat): (WebCore::AudioSampleBufferCompressor::attachPrimingTrimsIfNeeded): (WebCore::AudioSampleBufferCompressor::gradualDecoderRefreshCount): (WebCore::AudioSampleBufferCompressor::sampleBufferWithNumPackets): (WebCore::AudioSampleBufferCompressor::audioConverterComplexInputDataProc): (WebCore::AudioSampleBufferCompressor::provideSourceDataNumOutputPackets): (WebCore::AudioSampleBufferCompressor::processSampleBuffersUntilLowWaterTime): (WebCore::AudioSampleBufferCompressor::processSampleBuffer): (WebCore::AudioSampleBufferCompressor::addSampleBuffer): (WebCore::AudioSampleBufferCompressor::getOutputSampleBuffer): (WebCore::AudioSampleBufferCompressor::takeOutputSampleBuffer): * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: (-[WebAVAssetWriterDelegate initWithWriter:]): (-[WebAVAssetWriterDelegate assetWriter:didProduceFragmentedHeaderData:]): (-[WebAVAssetWriterDelegate assetWriter:didProduceFragmentedMediaData:fragmentedMediaDataReport:]): (-[WebAVAssetWriterDelegate close]): (WebCore::MediaRecorderPrivateWriter::create): (WebCore::MediaRecorderPrivateWriter::compressedVideoOutputBufferCallback): (WebCore::MediaRecorderPrivateWriter::compressedAudioOutputBufferCallback): (WebCore::MediaRecorderPrivateWriter::MediaRecorderPrivateWriter): (WebCore::MediaRecorderPrivateWriter::~MediaRecorderPrivateWriter): (WebCore::MediaRecorderPrivateWriter::initialize): (WebCore::MediaRecorderPrivateWriter::processNewCompressedVideoSampleBuffers): (WebCore::MediaRecorderPrivateWriter::processNewCompressedAudioSampleBuffers): (WebCore::MediaRecorderPrivateWriter::startAssetWriter): (WebCore::MediaRecorderPrivateWriter::appendCompressedAudioSampleBuffer): (WebCore::MediaRecorderPrivateWriter::appendCompressedVideoSampleBuffer): (WebCore::MediaRecorderPrivateWriter::appendCompressedSampleBuffers): (WebCore::appendEndsPreviousSampleDurationMarker): (WebCore::MediaRecorderPrivateWriter::appendEndOfVideoSampleDurationIfNeeded): (WebCore::MediaRecorderPrivateWriter::flushCompressedSampleBuffers): (WebCore::MediaRecorderPrivateWriter::clear): (WebCore::copySampleBufferWithCurrentTimeStamp): (WebCore::MediaRecorderPrivateWriter::appendVideoSampleBuffer): (WebCore::createAudioFormatDescription): (WebCore::createAudioSampleBuffer): (WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer): (WebCore::MediaRecorderPrivateWriter::stopRecording): (WebCore::MediaRecorderPrivateWriter::appendData): * platform/mediarecorder/cocoa/VideoSampleBufferCompressor.h: Copied from Source/WebCore/platform/mediarecorder/MediaRecorderPrivateAVFImpl.h. * platform/mediarecorder/cocoa/VideoSampleBufferCompressor.mm: Added. (WebCore::VideoSampleBufferCompressor::create): (WebCore::VideoSampleBufferCompressor::VideoSampleBufferCompressor): (WebCore::VideoSampleBufferCompressor::~VideoSampleBufferCompressor): (WebCore::VideoSampleBufferCompressor::initialize): (WebCore::VideoSampleBufferCompressor::finish): (WebCore::VideoSampleBufferCompressor::videoCompressionCallback): (WebCore::VideoSampleBufferCompressor::initCompressionSession): (WebCore::VideoSampleBufferCompressor::processSampleBuffer): (WebCore::VideoSampleBufferCompressor::addSampleBuffer): (WebCore::VideoSampleBufferCompressor::getOutputSampleBuffer): (WebCore::VideoSampleBufferCompressor::takeOutputSampleBuffer): Source/WebCore/PAL: <rdar://problem/58985368> Reviewed by Eric Carlson. Add soft link macros for VideoToolbox and AudioToolbox. * PAL.xcodeproj/project.pbxproj: * pal/cf/AudioToolboxSoftLink.cpp: Added. * pal/cf/AudioToolboxSoftLink.h: Added. * pal/cf/CoreMediaSoftLink.cpp: * pal/cf/CoreMediaSoftLink.h: * pal/cf/VideoToolboxSoftLink.cpp: Added. * pal/cf/VideoToolboxSoftLink.h: Added. Source/WebKit: <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): Source/WTF: Reviewed by Eric Carlson. * wtf/PlatformHave.h: LayoutTests: Reviewed by Eric Carlson. Disable tests on all platforms except the ones supporting AVAssetWriterDelegate. * TestExpectations: * http/wpt/mediarecorder/MediaRecorder-AV-audio-video-dataavailable-gpuprocess.html: Remove web audio generation since there seems to be some unstability in web audio -> stream -> media recorder. which should be fixed as follow-up specific patches. * platform/mac/TestExpectations: Enable running tests. Canonical link: https://commits.webkit.org/225705@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262708 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-06-08 11:49:15 +00:00
platform/mediarecorder/cocoa/AudioSampleBufferCompressor.mm
Implement non-timeslice mode encoding for MediaRecorder https://bugs.webkit.org/show_bug.cgi?id=192069 <rdar://problem/46443290> Patch by YUHAN WU <yuhan_wu@apple.com> on 2018-12-12 Reviewed by Eric Carlson. Source/WebCore: Implement the encoding for non-timeslice mode of MediaRecorder. It only supports to record MP4 file through H264 and AAC encoding, we will need to support more MIME types and encoding methods. Add a API in internals to allow testings to turn on the mock source. Test: http/wpt/mediarecorder/MediaRecorder-AV-audio-video-dataavailable.html * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::create): (WebCore::MediaRecorder::setCustomPrivateRecorderCreator): (WebCore::MediaRecorder::getPrivateImpl): (WebCore::MediaRecorder::MediaRecorder): (WebCore::MediaRecorder::stopRecording): (WebCore::MediaRecorder::stopRecordingInternal): (WebCore::MediaRecorder::createRecordingDataBlob): (WebCore::MediaRecorder::scheduleDeferredTask): * Modules/mediarecorder/MediaRecorder.h: * Modules/mediarecorder/MediaRecorder.idl: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/mediarecorder/MediaRecorderPrivate.h: (WebCore::MediaRecorderPrivate::stopRecording): * platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp: Added. (WebCore::MediaRecorderPrivateAVFImpl::create): (WebCore::MediaRecorderPrivateAVFImpl::MediaRecorderPrivateAVFImpl): (WebCore::MediaRecorderPrivateAVFImpl::sampleBufferUpdated): (WebCore::MediaRecorderPrivateAVFImpl::audioSamplesAvailable): (WebCore::MediaRecorderPrivateAVFImpl::stopRecording): (WebCore::MediaRecorderPrivateAVFImpl::fetchData): (WebCore::MediaRecorderPrivateAVFImpl::mimeType): * platform/mediarecorder/MediaRecorderPrivateAVFImpl.h: Added. * platform/mediarecorder/MediaRecorderPrivateMock.cpp: (WebCore::MediaRecorderPrivateMock::fetchData): (WebCore::MediaRecorderPrivateMock::mimeType): * platform/mediarecorder/MediaRecorderPrivateMock.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: added. * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: Added. (WebCore::MediaRecorderPrivateWriter::clear): (WebCore::MediaRecorderPrivateWriter::setupWriter): (WebCore::MediaRecorderPrivateWriter::setVideoInput): (WebCore::MediaRecorderPrivateWriter::setAudioInput): (WebCore::copySampleBufferWithCurrentTimeStamp): (WebCore::MediaRecorderPrivateWriter::appendVideoSampleBuffer): (WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer): (WebCore::MediaRecorderPrivateWriter::stopRecording): * testing/Internals.cpp: (WebCore::createRecorderMockSource): (WebCore::Internals::setCustomPrivateRecorderCreator): * testing/Internals.h: * testing/Internals.idl: LayoutTests: Create new tests for encoding of MediaRecorder. Check if the produced video and audio are correct. Add code to turn on the mock source of MediaRecorder for the two old tests because the real source is enabled by default. * http/wpt/mediarecorder/MediaRecorder-AV-audio-video-dataavailable-expected.txt: Added. * http/wpt/mediarecorder/MediaRecorder-AV-audio-video-dataavailable.html: Added. * http/wpt/mediarecorder/MediaRecorder-dataavailable.html: * http/wpt/mediarecorder/MediaRecorder-mock-dataavailable.html: Canonical link: https://commits.webkit.org/207224@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239145 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-13 02:34:19 +00:00
platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm
[Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder https://bugs.webkit.org/show_bug.cgi?id=206582 Source/WebCore: <rdar://problem/58985368> Reviewed by Eric Carlson. AVAssetWriterDelegate allows to grab recorded data whenever wanted. This delegate requires passing compressed samples to AVAssetWriter. Implement video encoding and audio encoding in dedicated classes and use these classes before adding buffers to AVAssetWriter. These classes are AudioSampleBufferCompressor and VideoSampleBufferCompressor. They support AAC and H264 so far and should be further improved to support more encoding options. Instantiate real writer only for platforms supporting AVAssetWriterDelegate, since it is not supported everywhere. The writer, doing the pacakging, is receiving compressed buffer from the audio/video compressors. It then sends data when being request to flush to its delegate, which will send data to the MediaRecorderPrivateWriter. The MediaRecorderPrivateWriter stores the data in a SharedBuffer until MediaRecorder asks for data. Note that, whenever we request data, we flush the writer and insert an end of video sample to make sure video data gets flushed. Therefore data should not be requested too fast to get adequate video compression. Covered by existing tests. * Modules/mediarecorder/MediaRecorderProvider.cpp: (WebCore::MediaRecorderProvider::createMediaRecorderPrivate): * WebCore.xcodeproj/project.pbxproj: * platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp: (WebCore::MediaRecorderPrivateAVFImpl::create): * platform/mediarecorder/MediaRecorderPrivateAVFImpl.h: * platform/mediarecorder/cocoa/AudioSampleBufferCompressor.h: Added. * platform/mediarecorder/cocoa/AudioSampleBufferCompressor.mm: Added. (WebCore::AudioSampleBufferCompressor::create): (WebCore::AudioSampleBufferCompressor::AudioSampleBufferCompressor): (WebCore::AudioSampleBufferCompressor::~AudioSampleBufferCompressor): (WebCore::AudioSampleBufferCompressor::initialize): (WebCore::AudioSampleBufferCompressor::finish): (WebCore::AudioSampleBufferCompressor::initAudioConverterForSourceFormatDescription): (WebCore::AudioSampleBufferCompressor::computeBufferSizeForAudioFormat): (WebCore::AudioSampleBufferCompressor::attachPrimingTrimsIfNeeded): (WebCore::AudioSampleBufferCompressor::gradualDecoderRefreshCount): (WebCore::AudioSampleBufferCompressor::sampleBufferWithNumPackets): (WebCore::AudioSampleBufferCompressor::audioConverterComplexInputDataProc): (WebCore::AudioSampleBufferCompressor::provideSourceDataNumOutputPackets): (WebCore::AudioSampleBufferCompressor::processSampleBuffersUntilLowWaterTime): (WebCore::AudioSampleBufferCompressor::processSampleBuffer): (WebCore::AudioSampleBufferCompressor::addSampleBuffer): (WebCore::AudioSampleBufferCompressor::getOutputSampleBuffer): (WebCore::AudioSampleBufferCompressor::takeOutputSampleBuffer): * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: (-[WebAVAssetWriterDelegate initWithWriter:]): (-[WebAVAssetWriterDelegate assetWriter:didProduceFragmentedHeaderData:]): (-[WebAVAssetWriterDelegate assetWriter:didProduceFragmentedMediaData:fragmentedMediaDataReport:]): (-[WebAVAssetWriterDelegate close]): (WebCore::MediaRecorderPrivateWriter::create): (WebCore::MediaRecorderPrivateWriter::compressedVideoOutputBufferCallback): (WebCore::MediaRecorderPrivateWriter::compressedAudioOutputBufferCallback): (WebCore::MediaRecorderPrivateWriter::MediaRecorderPrivateWriter): (WebCore::MediaRecorderPrivateWriter::~MediaRecorderPrivateWriter): (WebCore::MediaRecorderPrivateWriter::initialize): (WebCore::MediaRecorderPrivateWriter::processNewCompressedVideoSampleBuffers): (WebCore::MediaRecorderPrivateWriter::processNewCompressedAudioSampleBuffers): (WebCore::MediaRecorderPrivateWriter::startAssetWriter): (WebCore::MediaRecorderPrivateWriter::appendCompressedAudioSampleBuffer): (WebCore::MediaRecorderPrivateWriter::appendCompressedVideoSampleBuffer): (WebCore::MediaRecorderPrivateWriter::appendCompressedSampleBuffers): (WebCore::appendEndsPreviousSampleDurationMarker): (WebCore::MediaRecorderPrivateWriter::appendEndOfVideoSampleDurationIfNeeded): (WebCore::MediaRecorderPrivateWriter::flushCompressedSampleBuffers): (WebCore::MediaRecorderPrivateWriter::clear): (WebCore::copySampleBufferWithCurrentTimeStamp): (WebCore::MediaRecorderPrivateWriter::appendVideoSampleBuffer): (WebCore::createAudioFormatDescription): (WebCore::createAudioSampleBuffer): (WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer): (WebCore::MediaRecorderPrivateWriter::stopRecording): (WebCore::MediaRecorderPrivateWriter::appendData): * platform/mediarecorder/cocoa/VideoSampleBufferCompressor.h: Copied from Source/WebCore/platform/mediarecorder/MediaRecorderPrivateAVFImpl.h. * platform/mediarecorder/cocoa/VideoSampleBufferCompressor.mm: Added. (WebCore::VideoSampleBufferCompressor::create): (WebCore::VideoSampleBufferCompressor::VideoSampleBufferCompressor): (WebCore::VideoSampleBufferCompressor::~VideoSampleBufferCompressor): (WebCore::VideoSampleBufferCompressor::initialize): (WebCore::VideoSampleBufferCompressor::finish): (WebCore::VideoSampleBufferCompressor::videoCompressionCallback): (WebCore::VideoSampleBufferCompressor::initCompressionSession): (WebCore::VideoSampleBufferCompressor::processSampleBuffer): (WebCore::VideoSampleBufferCompressor::addSampleBuffer): (WebCore::VideoSampleBufferCompressor::getOutputSampleBuffer): (WebCore::VideoSampleBufferCompressor::takeOutputSampleBuffer): Source/WebCore/PAL: <rdar://problem/58985368> Reviewed by Eric Carlson. Add soft link macros for VideoToolbox and AudioToolbox. * PAL.xcodeproj/project.pbxproj: * pal/cf/AudioToolboxSoftLink.cpp: Added. * pal/cf/AudioToolboxSoftLink.h: Added. * pal/cf/CoreMediaSoftLink.cpp: * pal/cf/CoreMediaSoftLink.h: * pal/cf/VideoToolboxSoftLink.cpp: Added. * pal/cf/VideoToolboxSoftLink.h: Added. Source/WebKit: <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): Source/WTF: Reviewed by Eric Carlson. * wtf/PlatformHave.h: LayoutTests: Reviewed by Eric Carlson. Disable tests on all platforms except the ones supporting AVAssetWriterDelegate. * TestExpectations: * http/wpt/mediarecorder/MediaRecorder-AV-audio-video-dataavailable-gpuprocess.html: Remove web audio generation since there seems to be some unstability in web audio -> stream -> media recorder. which should be fixed as follow-up specific patches. * platform/mac/TestExpectations: Enable running tests. Canonical link: https://commits.webkit.org/225705@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262708 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-06-08 11:49:15 +00:00
platform/mediarecorder/cocoa/VideoSampleBufferCompressor.mm
Introduce an internal unit to render audio MediaStreamTrack(s) https://bugs.webkit.org/show_bug.cgi?id=225601 Reviewed by Eric Carlson. Source/WebCore: Move files from platform/mediastream/mac to platform/mediastream/cocoa since they are used in both iOS and macOS. Move Audio Unit functionality out of AudioMediaStreamTrackRendererUnit. AudioMediaStreamTrackRendererUnit is responsible to manage sources and do the mixing. To actually render audio, it will use an InternalUnit, which is currently done in process. A future work will add support for a remote InternalUnit, that would run on GPUProcess. To prepare for that, a callback allows customizing the Internal Unit creation. We also change renderer start to be asynchronous, since it requires fetching the audio description from GPUProcess. No change of behavior, covered by existing tests. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/audio/cocoa/AudioSampleBufferList.h: * platform/mediastream/AudioMediaStreamTrackRenderer.h: * platform/mediastream/AudioTrackPrivateMediaStream.cpp: (WebCore::AudioTrackPrivateMediaStream::startRenderer): * platform/mediastream/cocoa/AudioMediaStreamTrackRendererCocoa.cpp: Renamed from Source/WebCore/platform/mediastream/mac/AudioMediaStreamTrackRendererCocoa.cpp. (WebCore::AudioMediaStreamTrackRendererCocoa::start): * platform/mediastream/cocoa/AudioMediaStreamTrackRendererCocoa.h: Copied from Source/WebCore/platform/mediastream/mac/AudioMediaStreamTrackRendererCocoa.h. * platform/mediastream/cocoa/AudioMediaStreamTrackRendererInternalUnit.cpp: Renamed from Source/WebCore/platform/mediastream/mac/AudioMediaStreamTrackRendererUnit.cpp. (WebCore::AudioMediaStreamTrackRendererInternalUnit::createLocalInternalUnit): (WebCore::LocalAudioMediaStreamTrackRendererInternalUnit::LocalAudioMediaStreamTrackRendererInternalUnit): (WebCore::LocalAudioMediaStreamTrackRendererInternalUnit::retrieveFormatDescription): (WebCore::LocalAudioMediaStreamTrackRendererInternalUnit::setAudioOutputDevice): (WebCore::LocalAudioMediaStreamTrackRendererInternalUnit::start): (WebCore::LocalAudioMediaStreamTrackRendererInternalUnit::stop): (WebCore::LocalAudioMediaStreamTrackRendererInternalUnit::createAudioUnitIfNeeded): (WebCore::LocalAudioMediaStreamTrackRendererInternalUnit::renderingCallback): * platform/mediastream/cocoa/AudioMediaStreamTrackRendererInternalUnit.h: Renamed from Source/WebCore/platform/mediastream/mac/AudioMediaStreamTrackRendererCocoa.h. * platform/mediastream/cocoa/AudioMediaStreamTrackRendererUnit.cpp: Added. (WebCore::getCreateInternalUnitFunction): (WebCore::AudioMediaStreamTrackRendererUnit::setCreateInternalUnitFunction): (WebCore::createInternalUnit): (WebCore::AudioMediaStreamTrackRendererUnit::singleton): (WebCore::AudioMediaStreamTrackRendererUnit::AudioMediaStreamTrackRendererUnit): (WebCore::AudioMediaStreamTrackRendererUnit::~AudioMediaStreamTrackRendererUnit): (WebCore::AudioMediaStreamTrackRendererUnit::setAudioOutputDevice): (WebCore::AudioMediaStreamTrackRendererUnit::addSource): (WebCore::AudioMediaStreamTrackRendererUnit::removeSource): (WebCore::AudioMediaStreamTrackRendererUnit::start): (WebCore::AudioMediaStreamTrackRendererUnit::stop): (WebCore::AudioMediaStreamTrackRendererUnit::retrieveFormatDescription): (WebCore::AudioMediaStreamTrackRendererUnit::render): * platform/mediastream/cocoa/AudioMediaStreamTrackRendererUnit.h: Renamed from Source/WebCore/platform/mediastream/mac/AudioMediaStreamTrackRendererUnit.h. Source/WebKit: Update according new WebCore API. * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRenderer.cpp: (WebKit::RemoteAudioMediaStreamTrackRenderer::start): * WebProcess/GPU/webrtc/AudioMediaStreamTrackRenderer.cpp: (WebKit::AudioMediaStreamTrackRenderer::start): * WebProcess/GPU/webrtc/AudioMediaStreamTrackRenderer.h: Canonical link: https://commits.webkit.org/237622@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277364 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-12 08:57:38 +00:00
platform/mediastream/cocoa/AudioMediaStreamTrackRendererCocoa.cpp
platform/mediastream/cocoa/AudioMediaStreamTrackRendererInternalUnit.cpp
platform/mediastream/cocoa/AudioMediaStreamTrackRendererUnit.cpp
platform/mediastream/ios/AVAudioSessionCaptureDevice.mm
platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm @no-unify
platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm @no-unify
platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp
platform/mediastream/mac/AVCaptureDeviceManager.mm @no-unify
platform/mediastream/mac/AVVideoCaptureSource.mm @no-unify
platform/mediastream/mac/BaseAudioSharedUnit.cpp
platform/mediastream/mac/CoreAudioCaptureDevice.cpp
platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp
platform/mediastream/mac/CoreAudioCaptureSource.cpp
platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp
platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp
Introduce a RemoteAudioSourceProvider to receive audio samples for web audio from GPUProcess https://bugs.webkit.org/show_bug.cgi?id=217710 Reviewed by Eric Carlson. Source/WebCore: Split WebAudioSourceProviderAVFObjC MediaStreamTrack specific bits in a separate MediaStreamTrackAudioSourceProviderAVFObjC class. This allows reusing WebAudioSourceProviderAVFObjC for samples coming from audio playback living in GPUProcess. No change of behavior. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/audio/cocoa/AudioSampleBufferList.cpp: * platform/audio/cocoa/AudioSampleBufferList.h: * platform/audio/cocoa/AudioSampleDataSource.h: * platform/audio/cocoa/AudioSampleDataSource.mm: * platform/mediastream/MediaStreamTrackPrivate.cpp: (WebCore::MediaStreamTrackPrivate::audioSourceProvider): * platform/mediastream/RealtimeMediaSource.h: * platform/mediastream/WebAudioSourceProvider.h: * platform/mediastream/mac/CoreAudioCaptureSource.cpp: * platform/mediastream/mac/MediaStreamTrackAudioSourceProviderCocoa.cpp: Added. (WebCore::MediaStreamTrackAudioSourceProviderCocoa::create): (WebCore::MediaStreamTrackAudioSourceProviderCocoa::MediaStreamTrackAudioSourceProviderCocoa): (WebCore::MediaStreamTrackAudioSourceProviderCocoa::~MediaStreamTrackAudioSourceProviderCocoa): (WebCore::MediaStreamTrackAudioSourceProviderCocoa::hasNewClient): (WebCore::MediaStreamTrackAudioSourceProviderCocoa::trackEnabledChanged): (WebCore::MediaStreamTrackAudioSourceProviderCocoa::audioSamplesAvailable): * platform/mediastream/mac/MediaStreamTrackAudioSourceProviderCocoa.h: Added. * platform/mediastream/mac/MockAudioSharedUnit.h: * platform/mediastream/mac/MockAudioSharedUnit.mm: * platform/mediastream/mac/WebAudioSourceProviderCocoa.h: Renamed from Source/WebCore/platform/mediastream/mac/WebAudioSourceProviderAVFObjC.h. * platform/mediastream/mac/WebAudioSourceProviderCocoa.mm: Renamed from Source/WebCore/platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm. (WebCore::WebAudioSourceProviderCocoa::WebAudioSourceProviderCocoa): (WebCore::WebAudioSourceProviderCocoa::~WebAudioSourceProviderCocoa): (WebCore::WebAudioSourceProviderCocoa::setClient): (WebCore::WebAudioSourceProviderCocoa::provideInput): (WebCore::WebAudioSourceProviderCocoa::prepare): (WebCore::WebAudioSourceProviderCocoa::receivedNewAudioSamples): Source/WebKit: Make use of WebAudioSourceProviderAVFObjC to implement RemoteAudioSourceProvider. RemoteAudioSourceProvider currently implements an AudioSourceProvider but it is not yet connected to GPUProcess media players. This will be implemented in a follow-up. * SourcesCocoa.txt: * WebKit.xcodeproj/project.pbxproj: * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::~MediaPlayerPrivateRemote): (WebKit::MediaPlayerPrivateRemote::audioSourceProvider): * WebProcess/GPU/media/MediaPlayerPrivateRemote.h: * WebProcess/GPU/media/RemoteAudioSourceProvider.cpp: Added. (WebKit::RemoteAudioSourceProvider::create): (WebKit::RemoteAudioSourceProvider::RemoteAudioSourceProvider): (WebKit::RemoteAudioSourceProvider::~RemoteAudioSourceProvider): (WebKit::RemoteAudioSourceProvider::close): (WebKit::RemoteAudioSourceProvider::hasNewClient): (WebKit::RemoteAudioSourceProvider::audioSamplesAvailable): (WebKit::RemoteAudioSourceProvider::logChannel const): * WebProcess/GPU/media/RemoteAudioSourceProvider.h: Added. * WebProcess/GPU/media/cocoa/MediaPlayerPrivateRemoteCocoa.mm: Canonical link: https://commits.webkit.org/230492@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@268521 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-10-15 11:36:46 +00:00
platform/mediastream/mac/MediaStreamTrackAudioSourceProviderCocoa.cpp
platform/mediastream/mac/MockAudioSharedUnit.mm
platform/mediastream/mac/MockRealtimeVideoSourceMac.mm
platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.cpp
platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm
platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp
platform/mediastream/mac/RealtimeMediaSourceCenterMac.mm
platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp
platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp
platform/mediastream/mac/RealtimeVideoUtilities.mm
platform/mediastream/mac/ScreenDisplayCapturerMac.mm
Introduce a RemoteAudioSourceProvider to receive audio samples for web audio from GPUProcess https://bugs.webkit.org/show_bug.cgi?id=217710 Reviewed by Eric Carlson. Source/WebCore: Split WebAudioSourceProviderAVFObjC MediaStreamTrack specific bits in a separate MediaStreamTrackAudioSourceProviderAVFObjC class. This allows reusing WebAudioSourceProviderAVFObjC for samples coming from audio playback living in GPUProcess. No change of behavior. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/audio/cocoa/AudioSampleBufferList.cpp: * platform/audio/cocoa/AudioSampleBufferList.h: * platform/audio/cocoa/AudioSampleDataSource.h: * platform/audio/cocoa/AudioSampleDataSource.mm: * platform/mediastream/MediaStreamTrackPrivate.cpp: (WebCore::MediaStreamTrackPrivate::audioSourceProvider): * platform/mediastream/RealtimeMediaSource.h: * platform/mediastream/WebAudioSourceProvider.h: * platform/mediastream/mac/CoreAudioCaptureSource.cpp: * platform/mediastream/mac/MediaStreamTrackAudioSourceProviderCocoa.cpp: Added. (WebCore::MediaStreamTrackAudioSourceProviderCocoa::create): (WebCore::MediaStreamTrackAudioSourceProviderCocoa::MediaStreamTrackAudioSourceProviderCocoa): (WebCore::MediaStreamTrackAudioSourceProviderCocoa::~MediaStreamTrackAudioSourceProviderCocoa): (WebCore::MediaStreamTrackAudioSourceProviderCocoa::hasNewClient): (WebCore::MediaStreamTrackAudioSourceProviderCocoa::trackEnabledChanged): (WebCore::MediaStreamTrackAudioSourceProviderCocoa::audioSamplesAvailable): * platform/mediastream/mac/MediaStreamTrackAudioSourceProviderCocoa.h: Added. * platform/mediastream/mac/MockAudioSharedUnit.h: * platform/mediastream/mac/MockAudioSharedUnit.mm: * platform/mediastream/mac/WebAudioSourceProviderCocoa.h: Renamed from Source/WebCore/platform/mediastream/mac/WebAudioSourceProviderAVFObjC.h. * platform/mediastream/mac/WebAudioSourceProviderCocoa.mm: Renamed from Source/WebCore/platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm. (WebCore::WebAudioSourceProviderCocoa::WebAudioSourceProviderCocoa): (WebCore::WebAudioSourceProviderCocoa::~WebAudioSourceProviderCocoa): (WebCore::WebAudioSourceProviderCocoa::setClient): (WebCore::WebAudioSourceProviderCocoa::provideInput): (WebCore::WebAudioSourceProviderCocoa::prepare): (WebCore::WebAudioSourceProviderCocoa::receivedNewAudioSamples): Source/WebKit: Make use of WebAudioSourceProviderAVFObjC to implement RemoteAudioSourceProvider. RemoteAudioSourceProvider currently implements an AudioSourceProvider but it is not yet connected to GPUProcess media players. This will be implemented in a follow-up. * SourcesCocoa.txt: * WebKit.xcodeproj/project.pbxproj: * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::~MediaPlayerPrivateRemote): (WebKit::MediaPlayerPrivateRemote::audioSourceProvider): * WebProcess/GPU/media/MediaPlayerPrivateRemote.h: * WebProcess/GPU/media/RemoteAudioSourceProvider.cpp: Added. (WebKit::RemoteAudioSourceProvider::create): (WebKit::RemoteAudioSourceProvider::RemoteAudioSourceProvider): (WebKit::RemoteAudioSourceProvider::~RemoteAudioSourceProvider): (WebKit::RemoteAudioSourceProvider::close): (WebKit::RemoteAudioSourceProvider::hasNewClient): (WebKit::RemoteAudioSourceProvider::audioSamplesAvailable): (WebKit::RemoteAudioSourceProvider::logChannel const): * WebProcess/GPU/media/RemoteAudioSourceProvider.h: Added. * WebProcess/GPU/media/cocoa/MediaPlayerPrivateRemoteCocoa.mm: Canonical link: https://commits.webkit.org/230492@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@268521 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-10-15 11:36:46 +00:00
platform/mediastream/mac/WebAudioSourceProviderCocoa.mm
platform/mediastream/mac/WindowDisplayCapturerMac.mm
platform/mock/MediaPlaybackTargetMock.cpp
platform/mock/MediaPlaybackTargetPickerMock.cpp
Share code between AudioDestinationIOS and AudioDestinationMac https://bugs.webkit.org/show_bug.cgi?id=203047 <rdar://problem/56340866> Reviewed by Eric Carlson. Source/WebCore: Introduce AudioDestinationCocoa to share code between iOS and Mac. Most code is now shared, except for the configuration of the audio unit which is slightly different between Mac and iOS. Introduce MockAudioDestinationCocoa to allow more code coverage of the shared code. This could also allow us to validate dynamic changes in frame rate, number of frames to process... Add Internals API to enable the mock destination. Covered by added test. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/audio/cocoa/AudioDestinationCocoa.cpp: Added. (WebCore::AudioDestination::create): (WebCore::AudioDestination::hardwareSampleRate): (WebCore::AudioDestination::maxChannelCount): (WebCore::AudioDestinationCocoa::AudioDestinationCocoa): (WebCore::AudioDestinationCocoa::~AudioDestinationCocoa): (WebCore::AudioDestinationCocoa::start): (WebCore::AudioDestinationCocoa::stop): (WebCore::AudioDestinationCocoa::setIsPlaying): (WebCore::AudioDestinationCocoa::setAudioStreamBasicDescription): (WebCore::assignAudioBuffersToBus): (WebCore::AudioDestinationCocoa::render): (WebCore::AudioDestinationCocoa::inputProc): * platform/audio/cocoa/AudioDestinationCocoa.h: Added. (WebCore::AudioDestinationCocoa::outputUnit): * platform/audio/ios/AudioDestinationIOS.cpp: (WebCore::AudioDestinationCocoa::configure): (WebCore::AudioDestinationCocoa::processBusAfterRender): * platform/audio/ios/AudioDestinationIOS.h: Removed. * platform/audio/mac/AudioDestinationMac.cpp: (WebCore::AudioDestinationCocoa::configure): (WebCore::AudioDestinationCocoa::processBusAfterRender): * platform/audio/mac/AudioDestinationMac.h: Removed. * platform/mock/MockAudioDestinationCocoa.cpp: Added. (WebCore::MockAudioDestinationCocoa::MockAudioDestinationCocoa): (WebCore::MockAudioDestinationCocoa::start): (WebCore::MockAudioDestinationCocoa::stop): (WebCore::MockAudioDestinationCocoa::tick): * platform/mock/MockAudioDestinationCocoa.h: Added. * testing/Internals.cpp: (WebCore::Internals::Internals): (WebCore::Internals::useMockAudioDestinationCocoa): * testing/Internals.h: * testing/Internals.idl: LayoutTests: * fast/mediastream/getUserMedia-webaudio-expected.txt: * fast/mediastream/getUserMedia-webaudio.html: Canonical link: https://commits.webkit.org/216605@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251367 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-10-21 16:29:06 +00:00
platform/mock/MockAudioDestinationCocoa.cpp
Web Inspector: Network: show secure certificate details per-request https://bugs.webkit.org/show_bug.cgi?id=191447 <rdar://problem/30019476> Reviewed by Joseph Pecoraro. Source/JavaScriptCore: Add Security domain to hold security related protocol types. * CMakeLists.txt: * DerivedSources.make: * inspector/protocol/Network.json: * inspector/protocol/Security.json: Added. * inspector/scripts/codegen/objc_generator.py: (ObjCGenerator): Source/WebCore: Test: http/tests/inspector/network/resource-response-security.html * loader/ResourceLoader.h: (WebCore::ResourceLoader::shouldIncludeCertificateInfo const): * loader/ResourceLoader.cpp: (WebCore::ResourceLoader::shouldIncludeCertificateInfo const): Added. Always save certificate information when WebInspector is open. * platform/network/CertificateInfoBase.h: Added. (WebCore::CertificateInfoBase::containsNonRootSHA1SignedCertificate const): (WebCore::CertificateInfoBase::summaryInfo const): (WebCore::CertificateInfoBase::isEmpty const): * platform/network/cf/CertificateInfo.h: (WebCore::CertificateInfo::summaryInfo const): Added. * platform/network/cf/CertificateInfoCFNet.cpp: Renamed from Source/WebCore/platform/network/mac/CertificateInfoMac.mm. (WebCore::CertificateInfo::containsNonRootSHA1SignedCertificate): (WebCore::CertificateInfo::summaryInfo const): Added. * platform/network/curl/CertificateInfo.h: (WebCore::CertificateInfo::summaryInfo const): Added. (WebCore::CertificateInfo::isEmpty const): Added. * platform/network/soup/CertificateInfo.h: (WebCore::CertificateInfo::summaryInfo const): Added. (WebCore::CertificateInfo::isEmpty const): Added. Create base class for `CertificateInfo` so that `InspectorNetworkAgent` doesn't need to have platform-specific code in its implementation. * platform/network/cocoa/CertificateInfoCocoa.mm: Renamed from Source/WebCore/platform/network/mac/CertificateInfoMac.mm. * platform/network/curl/CertificateInfoCFNet.cpp: Renamed from Source/WebCore/platform/network/curl/CertificateInfo.cpp. * platform/network/soup/CertificateInfoSoup.cpp: Renamed from Source/WebCore/platform/network/soup/CertificateInfo.cpp. * inspector/NetworkResourcesData.h: (WebCore::NetworkResourcesData::ResourceData::certificateInfo const): Added. (WebCore::NetworkResourcesData::ResourceData::setCertificateInfo): Added. * inspector/NetworkResourcesData.cpp: (WebCore::NetworkResourcesData::responseReceived): * inspector/agents/InspectorNetworkAgent.cpp: (WebCore::InspectorNetworkAgent::buildObjectForResourceResponse): * PlatformAppleWin.cmake: * PlatformMac.cmake: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/Curl.cmake: * platform/SourcesSoup.txt: Source/WebInspectorUI: * UserInterface/Controllers/NetworkManager.js: (WI.NetworkManager.prototype.resourceRequestWasServedFromMemoryCache): (WI.NetworkManager.prototype.resourceRequestDidReceiveResponse): * UserInterface/Models/Resource.js: (WI.Resource.prototype.get responseSecurity): Added. (WI.Resource.prototype.get loadedSecurely): Added. (WI.Resource.prototype.updateForResponse): * UserInterface/Views/NetworkResourceDetailView.js: (WI.NetworkResourceDetailView): (WI.NetworkResourceDetailView.prototype.initialLayout): (WI.NetworkResourceDetailView.prototype.showContentViewForIdentifier): * UserInterface/Views/NetworkResourceDetailView.css: (.content-view.resource-details .go-to-arrow): Added. (.content-view.resource-details.showing-find-banner .search-highlight): Added. * UserInterface/Views/ResourceSecurityContentView.js: Added. (WI.ResourceSecurityContentView): (WI.ResourceSecurityContentView.prototype.initialLayout): (WI.ResourceSecurityContentView.prototype.layout): (WI.ResourceSecurityContentView.prototype.closed): (WI.ResourceSecurityContentView.prototype.get supportsSearch): (WI.ResourceSecurityContentView.prototype.get numberOfSearchResults): (WI.ResourceSecurityContentView.prototype.get hasPerformedSearch): (WI.ResourceSecurityContentView.prototype.set automaticallyRevealFirstSearchResult): (WI.ResourceSecurityContentView.prototype.performSearch): (WI.ResourceSecurityContentView.prototype.searchCleared): (WI.ResourceSecurityContentView.prototype.revealPreviousSearchResult): (WI.ResourceSecurityContentView.prototype.revealNextSearchResult): (WI.ResourceSecurityContentView.prototype._refreshCetificateSection): (WI.ResourceSecurityContentView.prototype._perfomSearchOnKeyValuePairs): (WI.ResourceSecurityContentView.prototype._revealSearchResult): (WI.ResourceSecurityContentView.prototype._handleResourceResponseReceived): * UserInterface/Views/ResourceSecurityContentView.css: Added. (body[dir] .resource-security > section.certificate > .details): (.resource-security .details .key): (.resource-security .dns-name + .dns-name > .key,): (.resource-security .show-more): (@media (prefers-dark-interface) body[dir] .resource-security > section.certificate > .details): (@media (prefers-dark-interface) .resource-security .details .key): * UserInterface/Views/ResourceCookiesContentView.js: (WI.ResourceCookiesContentView.prototype._refreshRequestCookiesSection): (WI.ResourceCookiesContentView.prototype._refreshResponseCookiesSection): (WI.ResourceCookiesContentView.prototype._markIncompleteSectionWithMessage): Deleted. (WI.ResourceCookiesContentView.prototype._markIncompleteSectionWithLoadingIndicator): Deleted. * UserInterface/Views/ResourceHeadersContentView.js: (WI.ResourceHeadersContentView.prototype._refreshSummarySection): (WI.ResourceHeadersContentView.prototype._refreshRedirectHeadersSections): (WI.ResourceHeadersContentView.prototype._refreshRequestHeadersSection): (WI.ResourceHeadersContentView.prototype._refreshResponseHeadersSection): (WI.ResourceHeadersContentView.prototype._refreshQueryStringSection): (WI.ResourceHeadersContentView.prototype._refreshRequestDataSection): (WI.ResourceHeadersContentView.prototype._markIncompleteSectionWithMessage): Deleted. (WI.ResourceHeadersContentView.prototype._markIncompleteSectionWithLoadingIndicator): Deleted. (WI.ResourceHeadersContentView.prototype._appendKeyValuePair): Deleted. * UserInterface/Views/ResourceHeadersContentView.css: (.resource-headers .h1-status > .key,): (body[dir] .resource-headers > section.error > .details): Deleted. (.resource-headers > section.error .key): Deleted. (.resource-headers .details): Deleted. (.resource-headers .details .pair): Deleted. (body[dir=rtl] .resource-headers .details .pair): Deleted. (.resource-headers .details .key): Deleted. (.resource-headers .value): Deleted. (.resource-headers .go-to-arrow): Deleted. (.resource-headers.showing-find-banner .search-highlight): Deleted. * UserInterface/Views/ResourceDetailsSection.js: (WI.ResourceDetailsSection.prototype.markIncompleteSectionWithMessage): Added. (WI.ResourceDetailsSection.prototype.markIncompleteSectionWithLoadingIndicator): Added. (WI.ResourceDetailsSection.prototype.appendKeyValuePair): Added. * UserInterface/Views/ResourceDetailsSection.css: (.resource-details > section > .details): Added. (.resource-details > section > .details > .pair): Added. (body[dir=rtl] .resource-details > section > .details > .pair): Added. (.resource-details > section > .details > .pair > .key): Added. (.resource-details > section > .details > .pair > .value): Added. (body[dir] .resource-details > section.error > .details): Added. (.resource-details > section.error > .details > .pair > .key): Added. Move commonly used functions/styles from container classes onto this object. * UserInterface/Main.html: * Localizations/en.lproj/localizedStrings.js: LayoutTests: * http/tests/inspector/network/resource-response-security-expected.txt: Added. * http/tests/inspector/network/resource-response-security.html: Added. * platform/gtk/TestExpectations: * platform/wincairo/TestExpectations: * platform/wpe/TestExpectations: Canonical link: https://commits.webkit.org/206331@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238122 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-11-13 07:07:21 +00:00
platform/network/cf/CertificateInfoCFNet.cpp
Make NetworkRTCResolver port agnostic https://bugs.webkit.org/show_bug.cgi?id=178855 Patch by Alejandro G. Castro <alex@igalia.com> on 2018-03-07 Reviewed by Youenn Fablet. Source/WebCore: Add new API in the DNSResolveQueue allowing to revolve hostnames and get the result. Add platform specific code for soup platform and refactor the other platforms. Added new API to the DNS API header and move the general code to the DNS.cpp file, that way we can reuse that code in all the platforms and leave the ResolveQueue class of the platforms in a file. No new tests because this is a refactor. * PlatformAppleWin.cmake: Move the DNSCFNet class to DNSResolveQueueCFNet. * PlatformMac.cmake: Ditto. * Sources.txt: Add the DNS.cpp for compilation. * SourcesCocoa.txt: Move the DNSCFNet class to DNSResolveQueueCFNet. * WebCore.xcodeproj/project.pbxproj: Move the DNSCFNet class to DNSResolveQueueCFNet, add the DNS.cpp for compilation. Add the new DNSResolveQueueCFNet class. * platform/Curl.cmake: Move the DNSCFNet class to DNSResolveQueueCurl. * platform/network/DNS.cpp: Add this file with the default implementation of the DNS functions for all the platforms. (WebCore::prefetchDNS): Copied from every platform implementation. (WebCore::resolveDNS): Add the function, resolves a hostname, receives the identifier of the operation and the completion handler. (WebCore::stopResolveDNS): Add the function, stops a resolution operation, receives the identifier of the operation. * platform/network/DNS.h: Add the new APIs resolveDNS and stopResolveDNS with the classes used for the implementation. (WebCore::IPAddress::IPAddress): Add this class used to send the resolved address information, it does not depend on libwebrtc rtc classes. (WebCore::IPAddress::get): Get a reference to the struct sockaddr_in in the IPAddress class. (WebCore::DNSCompletionHandler): Add this CompletionHandler type to be used when resolving the DNS address. * platform/network/DNSResolveQueue.cpp: Add the DNSResolveQueue platform instantiation in the singleton. (WebCore::DNSResolveQueue::singleton): Use DNSResolveQueue platform classes when creating the singleton.. (WebCore::DNSResolveQueue::resolve): Add this method to get the address of a hostname, it sends the identifier and the completion handler to use when returning the result. (WebCore::DNSResolveQueue::stopResolve): Add this method to stop the resolve operation when required. * platform/network/DNSResolveQueue.h: Add the new methods and make the class abstract, so that every platform can implement the functions. * platform/network/cf/DNSResolveQueueCFNet.cpp: Renamed from Source/WebCore/platform/network/cf/DNSCFNet.cpp. Add the methods to the new class DNSResolveQueueCFNet, move the prefetchDNS to the DNS.cpp general implementation. * platform/network/cf/DNSResolveQueueCFNet.h: Add the new class inheriting from the DNSResolveQueue. Add the new methods, we have to implement these methods and move the NetworkRTCResolver for COCOA code here. (WebCore::DNSResolveQueueCF::resolve): Dummy method, not implemented. (WebCore::DNSResolveQueueCF::stopResolve): Ditto. * platform/network/curl/DNSResolveQueueCurl.cpp: Renamed from Source/WebCore/platform/network/curl/DNSCurl.cpp. * platform/network/curl/DNSResolveQueueCurl.h: Add the new class inheriting from the DNSResolveQueue. (WebCore::DNSResolveQueueCurl::resolve): Ditto. (WebCore::DNSResolveQueueCurl::stopResolve): Ditto. * platform/network/soup/DNSResolveQueueSoup.h: New class inheriting from the DNSResolveQueue class, adding a HasMap with the active operations, it allows stopping them. * platform/network/soup/DNSResolveQueueSoup.cpp: Renamed from Source/WebCore/platform/network/curl/DNSSoup.cpp. (WebCore::resolvedWithObserverCallback): Called when the result address from the soup platform is ready, sends the address to the completion handler. (WebCore::DNSResolveQueueSoup::resolve): Launch the resolve operation with the soup library. (WebCore::DNSResolveQueueSoup::stopResolve): Stop the resolve operation on process with a GCancellable. Source/WebKit: Create a specific Cocoa class to isolate the generic code in the base class, make the base implementation port agnostic and dependent on DNS API in the platform directory which encapsulates the platform specific details. * NetworkProcess/webrtc/NetworkRTCProvider.cpp: Create an alias class name defined per platform to instantiate the resolver. (WebKit::NetworkRTCProvider::createResolver): Used the alias class name and receive a new IPAddress class that is not dependent on rtc libwebrtc library. * NetworkProcess/webrtc/NetworkRTCResolver.cpp: Remove the platform specific code. Use the DNS API to implement the platform specific code in the default start and stop methods. Add the identifier of the resolve operation to the class. (WebKit::NetworkRTCResolver::NetworkRTCResolver): Add the identifier in the initialization. (WebKit::NetworkRTCResolver::~NetworkRTCResolver): Remove the platform specific code. (WebKit::NetworkRTCResolver::completed): Ditto. (WebKit::NetworkRTCResolver::start): Add a new implementation using the DNS API. (WebKit::NetworkRTCResolver::stop): Ditto * NetworkProcess/webrtc/NetworkRTCResolver.h: Remove the platform specific code and use the DNSResolveQueue for a general solution to implement the platform specific code. Avoid using the IPAddress class that depends on libwertc classes to make it more general regarding DNS name resolution. (WebKit::NetworkRTCResolver::start): Make this class virtual. (WebKit::NetworkRTCResolver::stop): Ditto. * NetworkProcess/webrtc/NetworkRTCResolverCocoa.cpp: Copied Cocoa code from Source/WebKit/NetworkProcess/webrtc/NetworkRTCResolver.cpp. Now this class overrides the start and stop methods that use DNS, cocoa implementation should use the DNS methods in the future and remove this class, making sure all the platform specific class is in the platform directory. * NetworkProcess/webrtc/NetworkRTCResolverCocoa.h: Copied Cocoa code from Source/WebKit/NetworkProcess/webrtc/NetworkRTCResolver.h. * PlatformGTK.cmake: Add NetworkRTCResolver compilation for GTK. * WebKit.xcodeproj/project.pbxproj: Add the NetworkRTCResolverCocoa class to the compilation. Tools: Added new unit tests for he resolve and stopResolve functions. We need to compile them for the other platforms when the APIs are supported. * TestWebKitAPI/PlatformGTK.cmake: * TestWebKitAPI/Tests/WebCore/DNS.cpp: Canonical link: https://commits.webkit.org/199068@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229359 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-03-07 15:21:24 +00:00
platform/network/cf/DNSResolveQueueCFNet.cpp
platform/network/cf/FormDataStreamCFNet.cpp
platform/network/cf/NetworkStorageSessionCFNet.cpp
platform/network/cf/ProxyServerCFNet.cpp
platform/network/cf/ResourceRequestCFNet.cpp
platform/network/cf/SocketStreamHandleImplCFNet.cpp
Web Inspector: Network: show secure certificate details per-request https://bugs.webkit.org/show_bug.cgi?id=191447 <rdar://problem/30019476> Reviewed by Joseph Pecoraro. Source/JavaScriptCore: Add Security domain to hold security related protocol types. * CMakeLists.txt: * DerivedSources.make: * inspector/protocol/Network.json: * inspector/protocol/Security.json: Added. * inspector/scripts/codegen/objc_generator.py: (ObjCGenerator): Source/WebCore: Test: http/tests/inspector/network/resource-response-security.html * loader/ResourceLoader.h: (WebCore::ResourceLoader::shouldIncludeCertificateInfo const): * loader/ResourceLoader.cpp: (WebCore::ResourceLoader::shouldIncludeCertificateInfo const): Added. Always save certificate information when WebInspector is open. * platform/network/CertificateInfoBase.h: Added. (WebCore::CertificateInfoBase::containsNonRootSHA1SignedCertificate const): (WebCore::CertificateInfoBase::summaryInfo const): (WebCore::CertificateInfoBase::isEmpty const): * platform/network/cf/CertificateInfo.h: (WebCore::CertificateInfo::summaryInfo const): Added. * platform/network/cf/CertificateInfoCFNet.cpp: Renamed from Source/WebCore/platform/network/mac/CertificateInfoMac.mm. (WebCore::CertificateInfo::containsNonRootSHA1SignedCertificate): (WebCore::CertificateInfo::summaryInfo const): Added. * platform/network/curl/CertificateInfo.h: (WebCore::CertificateInfo::summaryInfo const): Added. (WebCore::CertificateInfo::isEmpty const): Added. * platform/network/soup/CertificateInfo.h: (WebCore::CertificateInfo::summaryInfo const): Added. (WebCore::CertificateInfo::isEmpty const): Added. Create base class for `CertificateInfo` so that `InspectorNetworkAgent` doesn't need to have platform-specific code in its implementation. * platform/network/cocoa/CertificateInfoCocoa.mm: Renamed from Source/WebCore/platform/network/mac/CertificateInfoMac.mm. * platform/network/curl/CertificateInfoCFNet.cpp: Renamed from Source/WebCore/platform/network/curl/CertificateInfo.cpp. * platform/network/soup/CertificateInfoSoup.cpp: Renamed from Source/WebCore/platform/network/soup/CertificateInfo.cpp. * inspector/NetworkResourcesData.h: (WebCore::NetworkResourcesData::ResourceData::certificateInfo const): Added. (WebCore::NetworkResourcesData::ResourceData::setCertificateInfo): Added. * inspector/NetworkResourcesData.cpp: (WebCore::NetworkResourcesData::responseReceived): * inspector/agents/InspectorNetworkAgent.cpp: (WebCore::InspectorNetworkAgent::buildObjectForResourceResponse): * PlatformAppleWin.cmake: * PlatformMac.cmake: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/Curl.cmake: * platform/SourcesSoup.txt: Source/WebInspectorUI: * UserInterface/Controllers/NetworkManager.js: (WI.NetworkManager.prototype.resourceRequestWasServedFromMemoryCache): (WI.NetworkManager.prototype.resourceRequestDidReceiveResponse): * UserInterface/Models/Resource.js: (WI.Resource.prototype.get responseSecurity): Added. (WI.Resource.prototype.get loadedSecurely): Added. (WI.Resource.prototype.updateForResponse): * UserInterface/Views/NetworkResourceDetailView.js: (WI.NetworkResourceDetailView): (WI.NetworkResourceDetailView.prototype.initialLayout): (WI.NetworkResourceDetailView.prototype.showContentViewForIdentifier): * UserInterface/Views/NetworkResourceDetailView.css: (.content-view.resource-details .go-to-arrow): Added. (.content-view.resource-details.showing-find-banner .search-highlight): Added. * UserInterface/Views/ResourceSecurityContentView.js: Added. (WI.ResourceSecurityContentView): (WI.ResourceSecurityContentView.prototype.initialLayout): (WI.ResourceSecurityContentView.prototype.layout): (WI.ResourceSecurityContentView.prototype.closed): (WI.ResourceSecurityContentView.prototype.get supportsSearch): (WI.ResourceSecurityContentView.prototype.get numberOfSearchResults): (WI.ResourceSecurityContentView.prototype.get hasPerformedSearch): (WI.ResourceSecurityContentView.prototype.set automaticallyRevealFirstSearchResult): (WI.ResourceSecurityContentView.prototype.performSearch): (WI.ResourceSecurityContentView.prototype.searchCleared): (WI.ResourceSecurityContentView.prototype.revealPreviousSearchResult): (WI.ResourceSecurityContentView.prototype.revealNextSearchResult): (WI.ResourceSecurityContentView.prototype._refreshCetificateSection): (WI.ResourceSecurityContentView.prototype._perfomSearchOnKeyValuePairs): (WI.ResourceSecurityContentView.prototype._revealSearchResult): (WI.ResourceSecurityContentView.prototype._handleResourceResponseReceived): * UserInterface/Views/ResourceSecurityContentView.css: Added. (body[dir] .resource-security > section.certificate > .details): (.resource-security .details .key): (.resource-security .dns-name + .dns-name > .key,): (.resource-security .show-more): (@media (prefers-dark-interface) body[dir] .resource-security > section.certificate > .details): (@media (prefers-dark-interface) .resource-security .details .key): * UserInterface/Views/ResourceCookiesContentView.js: (WI.ResourceCookiesContentView.prototype._refreshRequestCookiesSection): (WI.ResourceCookiesContentView.prototype._refreshResponseCookiesSection): (WI.ResourceCookiesContentView.prototype._markIncompleteSectionWithMessage): Deleted. (WI.ResourceCookiesContentView.prototype._markIncompleteSectionWithLoadingIndicator): Deleted. * UserInterface/Views/ResourceHeadersContentView.js: (WI.ResourceHeadersContentView.prototype._refreshSummarySection): (WI.ResourceHeadersContentView.prototype._refreshRedirectHeadersSections): (WI.ResourceHeadersContentView.prototype._refreshRequestHeadersSection): (WI.ResourceHeadersContentView.prototype._refreshResponseHeadersSection): (WI.ResourceHeadersContentView.prototype._refreshQueryStringSection): (WI.ResourceHeadersContentView.prototype._refreshRequestDataSection): (WI.ResourceHeadersContentView.prototype._markIncompleteSectionWithMessage): Deleted. (WI.ResourceHeadersContentView.prototype._markIncompleteSectionWithLoadingIndicator): Deleted. (WI.ResourceHeadersContentView.prototype._appendKeyValuePair): Deleted. * UserInterface/Views/ResourceHeadersContentView.css: (.resource-headers .h1-status > .key,): (body[dir] .resource-headers > section.error > .details): Deleted. (.resource-headers > section.error .key): Deleted. (.resource-headers .details): Deleted. (.resource-headers .details .pair): Deleted. (body[dir=rtl] .resource-headers .details .pair): Deleted. (.resource-headers .details .key): Deleted. (.resource-headers .value): Deleted. (.resource-headers .go-to-arrow): Deleted. (.resource-headers.showing-find-banner .search-highlight): Deleted. * UserInterface/Views/ResourceDetailsSection.js: (WI.ResourceDetailsSection.prototype.markIncompleteSectionWithMessage): Added. (WI.ResourceDetailsSection.prototype.markIncompleteSectionWithLoadingIndicator): Added. (WI.ResourceDetailsSection.prototype.appendKeyValuePair): Added. * UserInterface/Views/ResourceDetailsSection.css: (.resource-details > section > .details): Added. (.resource-details > section > .details > .pair): Added. (body[dir=rtl] .resource-details > section > .details > .pair): Added. (.resource-details > section > .details > .pair > .key): Added. (.resource-details > section > .details > .pair > .value): Added. (body[dir] .resource-details > section.error > .details): Added. (.resource-details > section.error > .details > .pair > .key): Added. Move commonly used functions/styles from container classes onto this object. * UserInterface/Main.html: * Localizations/en.lproj/localizedStrings.js: LayoutTests: * http/tests/inspector/network/resource-response-security-expected.txt: Added. * http/tests/inspector/network/resource-response-security.html: Added. * platform/gtk/TestExpectations: * platform/wincairo/TestExpectations: * platform/wpe/TestExpectations: Canonical link: https://commits.webkit.org/206331@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238122 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-11-13 07:07:21 +00:00
platform/network/cocoa/CertificateInfoCocoa.mm
platform/network/cocoa/CookieCocoa.mm
platform/network/cocoa/CookieStorageObserver.mm
platform/network/cocoa/CredentialCocoa.mm
platform/network/cocoa/NetworkLoadMetrics.mm
platform/network/cocoa/NetworkStorageSessionCocoa.mm
platform/network/cocoa/ProtectionSpaceCocoa.mm
Synthesize range responses if needed in WebCoreNSURLSession https://bugs.webkit.org/show_bug.cgi?id=221072 Reviewed by Geoff Garen. Source/WebCore: When we make a media request with a Range HTTP header field and the server doesn't respond with a 206 with Content-Range header field, until now we would just fail to play the video. In order to successfully play these videos, I introduce the RangeResponseGenerator class, which will receive the data for a request for such a video and feed the data into WebCoreNSURLSession as the requested ranges are received. Seeking is problematic, but at least we will try our best to play the video. I added API tests that try to play a video that didn't play before using a server that doesn't support range requests. Manual verification is also necessary. * Sources.txt: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/PlatformMediaResourceLoader.h: (WebCore::PlatformMediaResource::setClient): * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm: (WebCore::PlatformResourceMediaLoader::create): * platform/network/ParsedRequestRange.cpp: Added. (WebCore::ParsedRequestRange::parse): * platform/network/ParsedRequestRange.h: Added. (WebCore::ParsedRequestRange::begin const): (WebCore::ParsedRequestRange::end const): (WebCore::ParsedRequestRange::ParsedRequestRange): * platform/network/cocoa/RangeResponseGenerator.h: Added. * platform/network/cocoa/RangeResponseGenerator.mm: Added. (WebCore::RangeResponseGenerator::Data::Data): (WebCore::RangeResponseGenerator::Data::TaskData::TaskData): (WebCore::synthesizedResponseForRange): (WebCore::RangeResponseGenerator::removeTask): (WebCore::RangeResponseGenerator::giveResponseToTaskIfBytesInRangeReceived): (WebCore::RangeResponseGenerator::expectedContentLengthFromData): (WebCore::RangeResponseGenerator::giveResponseToTasksWithFinishedRanges): (WebCore::RangeResponseGenerator::willHandleRequest): (WebCore::RangeResponseGenerator::willSynthesizeRangeResponses): * platform/network/cocoa/WebCoreNSURLSession.h: * platform/network/cocoa/WebCoreNSURLSession.mm: (-[WebCoreNSURLSession rangeResponseGenerator]): (-[WebCoreNSURLSession dataTaskWithURL:]): (WebCore::WebCoreNSURLSessionDataTaskClient::dataSent): (WebCore::WebCoreNSURLSessionDataTaskClient::responseReceived): (WebCore::WebCoreNSURLSessionDataTaskClient::shouldCacheResponse): (WebCore::WebCoreNSURLSessionDataTaskClient::dataReceived): (WebCore::WebCoreNSURLSessionDataTaskClient::redirectReceived): (WebCore::WebCoreNSURLSessionDataTaskClient::accessControlCheckFailed): (WebCore::WebCoreNSURLSessionDataTaskClient::loadFailed): (WebCore::WebCoreNSURLSessionDataTaskClient::loadFinished): (-[WebCoreNSURLSessionDataTask _restart]): (-[WebCoreNSURLSessionDataTask _finish]): (-[WebCoreNSURLSessionDataTask resource:sentBytes:totalBytesToBeSent:]): (-[WebCoreNSURLSessionDataTask resource:receivedResponse:completionHandler:]): (-[WebCoreNSURLSessionDataTask resource:shouldCacheResponse:]): (-[WebCoreNSURLSessionDataTask resource:receivedData:length:]): (-[WebCoreNSURLSessionDataTask resource:receivedRedirect:request:completionHandler:]): (-[WebCoreNSURLSessionDataTask _resource:loadFinishedWithError:metrics:]): (-[WebCoreNSURLSessionDataTask resource:accessControlCheckFailedWithError:]): (-[WebCoreNSURLSessionDataTask resource:loadFailedWithError:]): (-[WebCoreNSURLSessionDataTask resourceFinished:metrics:]): (-[WebCoreNSURLSessionDataTask initWithSession:identifier:URL:]): Deleted. Source/WebKit: * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::requestResource): Tools: * TestWebKitAPI/Tests/WebCore/ParsedContentRange.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKitCocoa/Challenge.mm: (TestWebKitAPI::clientCertServer): * TestWebKitAPI/Tests/WebKitCocoa/MediaLoading.mm: (TestWebKitAPI::testVideoBytes): (TestWebKitAPI::runVideoTest): (TestWebKitAPI::TEST): * TestWebKitAPI/cocoa/HTTPServer.h: (TestWebKitAPI::HTTPResponse::HTTPResponse): (TestWebKitAPI::HTTPServer::HTTPResponse::HTTPResponse): Deleted. * TestWebKitAPI/cocoa/HTTPServer.mm: (TestWebKitAPI::HTTPServer::RequestData::RequestData): (TestWebKitAPI::appendToVector): (TestWebKitAPI::HTTPServer::parsePath): (TestWebKitAPI::HTTPServer::respondToRequests): (TestWebKitAPI::HTTPResponse::bodyFromString): (TestWebKitAPI::HTTPResponse::serialize): Canonical link: https://commits.webkit.org/234141@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272908 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-02-16 16:59:26 +00:00
platform/network/cocoa/RangeResponseGenerator.mm
platform/network/cocoa/ResourceRequestCocoa.mm
platform/network/cocoa/ResourceResponseCocoa.mm @no-unify // Unsafe to unify until rdar://problem/48853137 is resolved
platform/network/cocoa/WebCoreNSURLSession.mm @no-unify
platform/network/ios/NetworkStateNotifierIOS.mm
platform/network/ios/WebCoreURLResponseIOS.mm
platform/network/mac/AuthenticationMac.mm
platform/network/mac/BlobDataFileReferenceMac.mm
platform/network/mac/CookieStorageMac.mm
platform/network/mac/CredentialStorageMac.mm
platform/network/mac/FormDataStreamMac.mm
platform/network/mac/NetworkStateNotifierMac.cpp
platform/network/mac/ResourceErrorMac.mm
platform/network/mac/ResourceHandleMac.mm
platform/network/mac/SynchronousLoaderClient.mm
platform/network/mac/UTIUtilities.mm
platform/network/mac/WebCoreURLResponse.mm
platform/text/cf/HyphenationCF.cpp
platform/text/cocoa/LocaleCocoa.mm
Resurrect Mac CMake build https://bugs.webkit.org/show_bug.cgi?id=224084 Patch by Alex Christensen <achristensen@webkit.org> on 2021-04-05 Reviewed by Tim Horton. .: * Source/cmake/OptionsMac.cmake: Source/JavaScriptCore: * PlatformMac.cmake: Source/ThirdParty/ANGLE: * PlatformMac.cmake: Added. Source/ThirdParty/libwebrtc: * CMakeLists.txt: Source/WebCore: * PlatformMac.cmake: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/mac/WebGLBlocklist.mm: * platform/text/cocoa/LocalizedDateCache.h: Renamed from Source/WebCore/platform/text/ios/LocalizedDateCache.h. * platform/text/cocoa/LocalizedDateCache.mm: Renamed from Source/WebCore/platform/text/ios/LocalizedDateCache.mm. (WebCore::localizedDateCache): (WebCore::_localeChanged): (WebCore::LocalizedDateCache::LocalizedDateCache): (WebCore::LocalizedDateCache::~LocalizedDateCache): (WebCore::LocalizedDateCache::localeChanged): (WebCore::LocalizedDateCache::formatterForDateType): (WebCore::LocalizedDateCache::maximumWidthForDateType): (WebCore::LocalizedDateCache::createFormatterForType): (WebCore::LocalizedDateCache::calculateMaximumWidth): * testing/cocoa/WebViewVisualIdentificationOverlay.mm: Source/WebCore/PAL: * pal/PlatformMac.cmake: Source/WebKit: * NetworkProcess/PrivateClickMeasurementNetworkLoader.cpp: (WebKit::PrivateClickMeasurementNetworkLoader::didReceiveBuffer): * PlatformMac.cmake: * Shared/Cocoa/SandboxExtensionCocoa.mm: * SourcesCocoa.txt: * UIProcess/Media/MediaSessionCoordinatorProxyPrivate.h: Source/WebKitLegacy: * PlatformMac.cmake: Source/WTF: * wtf/PlatformMac.cmake: Tools: * TestWebKitAPI/PlatformMac.cmake: * WebKitTestRunner/PlatformMac.cmake: Canonical link: https://commits.webkit.org/236142@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275484 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-06 03:19:14 +00:00
platform/text/cocoa/LocalizedDateCache.mm
platform/text/ios/TextEncodingRegistryIOS.mm
platform/text/mac/TextBoundaries.mm
Replace TextCheckingTypeMask with OptionSet https://bugs.webkit.org/show_bug.cgi?id=188678 Reviewed by Antti Koivisto. Source/WebCore: Replaces TextCheckingTypeMask with an OptionSet to improve type safety and code clarity. Additionally change the values of TextCheckingType such that all the enumerators fit within an uint8_t. * PlatformMac.cmake: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::hasMisspelling const): * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (AXAttributeStringSetSpelling): * editing/AlternativeTextController.cpp: (WebCore::AlternativeTextController::timerFired): (WebCore::AlternativeTextController::processMarkersOnTextToBeReplacedByResult): * editing/Editor.cpp: (WebCore::Editor::replaceSelectionWithFragment): (WebCore::Editor::markMisspellingsAfterTypingToWord): (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges): (WebCore::isAutomaticTextReplacementType): (WebCore::Editor::markAndReplaceFor): For now, change a local variable from const to non-const to work around the following MSVC compiler bug: <https://developercommunity.visualstudio.com/content/problem/316713/msvc-cant-compile-webkits-optionsetcontainsany.html>. (WebCore::Editor::markMisspellingsAndBadGrammar): (WebCore::Editor::updateMarkersForWordsAffectedByEditing): (WebCore::Editor::editorUIUpdateTimerFired): (WebCore::Editor::resolveTextCheckingTypeMask): * editing/Editor.h: * editing/SpellChecker.cpp: (WebCore::SpellCheckRequest::SpellCheckRequest): (WebCore::SpellCheckRequest::create): (WebCore::SpellChecker::didCheckSucceed): * editing/SpellChecker.h: * editing/TextCheckingHelper.cpp: (WebCore::findGrammaticalErrors): (WebCore::findMisspellings): (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar): (WebCore::TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange const): (WebCore::checkTextOfParagraph): * editing/TextCheckingHelper.h: * loader/EmptyClients.cpp: * platform/text/TextCheckerClient.h: * platform/text/TextChecking.h: Remove TextCheckingTypeMask. Reorganized the fields of TextCheckingRequestData to coallesce padding and move it to the end of class. Also used default initializer syntax and defaulted (= default) the default constructor of TextCheckingRequestData, removing the need for a user-defined default constructor. (WebCore::TextCheckingRequestData::TextCheckingRequestData): (WebCore::TextCheckingRequestData::text const): Changed return type from String to const String& to avoid unnecessary ref-count churn for callers that do not need to take a shared ownership in this string. (WebCore::TextCheckingRequestData::checkingTypes const): Renamed; formerly named mask. (WebCore::TextCheckingRequestData::mask const): Deleted. * platform/text/mac/TextCheckingMac.mm: Added. (WebCore::nsTextCheckingTypes): * testing/Internals.cpp: (WebCore::Internals::handleAcceptedCandidate): Source/WebKit: * Scripts/webkit/messages.py: Add WebCore::TextCheckingType to the special case map so that the generator knows what header has the definition for this type. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder<TextCheckingRequestData>::encode): (IPC::ArgumentCoder<TextCheckingRequestData>::decode): * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::coreTextCheckingType): (WebKit::textCheckingResultFromNSTextCheckingResult): * UIProcess/TextChecker.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::checkTextOfParagraph): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/gtk/TextCheckerGtk.cpp: (WebKit::TextChecker::requestCheckingOfString): (WebKit::TextChecker::checkTextOfParagraph): Also simplified return expressions. * UIProcess/ios/TextCheckerIOS.mm: (WebKit::TextChecker::checkTextOfParagraph): * UIProcess/mac/TextCheckerMac.mm: (WebKit::TextChecker::checkTextOfParagraph): * UIProcess/win/TextCheckerWin.cpp: (WebKit::TextChecker::checkTextOfParagraph): * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::shouldEraseMarkersAfterChangeSelection const): (WebKit::WebEditorClient::checkTextOfParagraph): * WebProcess/WebCoreSupport/WebEditorClient.h: Source/WebKitLegacy/mac: Currently we have code in WebEditorClient::checkTextOfParagraph() that incorrectly assumes that the enumerators of TextCheckingType have a one-to-one correspondence with NSTextCheckingType. (This is not the case because there is not corresponding NSTextCheckingType for TextCheckingTypeShowCorrectionPanel). We now explicitly convert from OptionSet<TextCheckingType> to NSTextCheckingTypes. * WebCoreSupport/WebEditorClient.h: * WebCoreSupport/WebEditorClient.mm: (WebEditorClient::checkTextOfParagraph): (WebEditorClient::shouldEraseMarkersAfterChangeSelection const): (core): Fix up code style nits; compare resultType on the right-hand side instead of the left as this is more readable and unncessary now that modern compilers like Clang have diagnostics to catch accidental assignments when equality was intended. (WebEditorClient::didCheckSucceed): * WebView/WebView.mm: (coreTextCheckingType): (textCheckingResultFromNSTextCheckingResult): Canonical link: https://commits.webkit.org/203837@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235120 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-08-21 16:47:43 +00:00
platform/text/mac/TextCheckingMac.mm
platform/text/mac/TextEncodingRegistryMac.mm
platform/xr/cocoa/PlatformXRCocoa.mm
rendering/RenderThemeCocoa.mm
rendering/RenderThemeIOS.mm
rendering/RenderThemeMac.mm
rendering/TextAutoSizing.cpp
testing/cocoa/WebViewVisualIdentificationOverlay.mm
// The following files aren't unified with others to prevent them from being merged
// with files that use the system OpenGL.
platform/graphics/angle/ExtensionsGLANGLE.cpp @no-unify
platform/graphics/angle/GraphicsContextGLANGLE.cpp @no-unify
Shutdown ANGLE on GPU process when last WebGL context is destroyed https://bugs.webkit.org/show_bug.cgi?id=223082 Patch by Kimmo Kinnunen <kkinnunen@apple.com> on 2021-03-17 Reviewed by Kenneth Russell. Source/WebCore: * CMakeLists.txt: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm: (WebCore::InitializeEGLDisplay): (WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL): * platform/graphics/opengl/GraphicsContextGLOpenGL.h: Hold the default EGLDisplay with a scoped holder that counts the references to the default display. (WebCore::GraphicsContextGLOpenGL::releaseAllResourcesIfUnused): Add a call that uninitializes the ANGLE default display if there are no uses of the default display. Source/WebKit: Schedule a check for releasing the ANGLE default display when global count of remote graphics contexts reach zero. This should decrease the memory use of sessions where WebGL is not always on. Dispatch the check 0.2s after hitting zero, so that the optimization still affects page navigations but maybe does not redundantly deinitialize / reinitialize ANGLE in the cases where the context #1 is created and destroyed frequently. * GPUProcess/graphics/RemoteGraphicsContextGL.cpp: (WebKit::dispatchReleaseAllResourcesIfUnused): (WebKit::RemoteGraphicsContextGL::initialize): (WebKit::RemoteGraphicsContextGL::stopListeningForIPC): Canonical link: https://commits.webkit.org/235402@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274557 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-17 11:47:47 +00:00
platform/graphics/angle/GraphicsContextGLANGLEEGLUtilities.cpp @no-unify
platform/graphics/angle/TemporaryANGLESetting.cpp @no-unify