WebKit Bugzilla
Attachment 369552 Details for
Bug 197777
: Add WKWebViewConfiguration._canShowWhileLocked SPI
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-197777-20190510091205.patch (text/plain), 16.36 KB, created by
Chris Dumez
on 2019-05-10 09:12:05 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Chris Dumez
Created:
2019-05-10 09:12:05 PDT
Size:
16.36 KB
patch
obsolete
>Subversion Revision: 245158 >diff --git a/Source/WebCore/PAL/ChangeLog b/Source/WebCore/PAL/ChangeLog >index 3d9f18293e8209803a6d9751df4eaefd93130efa..71fb6c1442980c86af6507702c3f75858748f97a 100644 >--- a/Source/WebCore/PAL/ChangeLog >+++ b/Source/WebCore/PAL/ChangeLog >@@ -1,3 +1,13 @@ >+2019-05-10 Chris Dumez <cdumez@apple.com> >+ >+ Add WKWebViewConfiguration._canShowWhileLocked SPI >+ https://bugs.webkit.org/show_bug.cgi?id=197777 >+ <rdar://problem/50065100> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * pal/spi/cocoa/QuartzCoreSPI.h: >+ > 2019-05-08 Alex Christensen <achristensen@webkit.org> > > Add SPI to set HSTS storage directory >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 0b1a48cbc7efca67cc27a40e1109535092a1ea95..3946f4dae315391daaac5a617b6664c14c612492 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,40 @@ >+2019-05-10 Chris Dumez <cdumez@apple.com> >+ >+ Add WKWebViewConfiguration._canShowWhileLocked SPI >+ https://bugs.webkit.org/show_bug.cgi?id=197777 >+ <rdar://problem/50065100> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Platform/mac/LayerHostingContext.h: >+ * Platform/mac/LayerHostingContext.mm: >+ (WebKit::LayerHostingContext::createForExternalHostingProcess): >+ * Shared/WebPageCreationParameters.cpp: >+ (WebKit::WebPageCreationParameters::encode const): >+ (WebKit::WebPageCreationParameters::decode): >+ * Shared/WebPageCreationParameters.h: >+ * UIProcess/API/APIPageConfiguration.cpp: >+ (API::PageConfiguration::copy const): >+ * UIProcess/API/APIPageConfiguration.h: >+ (API::PageConfiguration::canShowWhileLocked const): >+ (API::PageConfiguration::setCanShowWhileLocked): >+ * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: >+ (-[WKWebViewConfiguration _setCanShowWhileLocked:]): >+ (-[WKWebViewConfiguration _canShowWhileLocked]): >+ * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: >+ * UIProcess/WebPageProxy.cpp: >+ (WebKit::WebPageProxy::creationParameters): >+ * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm: >+ (WebKit::PlatformCALayerRemoteCustom::PlatformCALayerRemoteCustom): >+ * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h: >+ * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm: >+ (WebKit::RemoteLayerTreeContext::canShowWhileLocked const): >+ * WebProcess/WebPage/WebPage.cpp: >+ (WebKit::m_canShowWhileLocked): >+ (WebKit::m_shrinkToFitContentTimer): Deleted. >+ * WebProcess/WebPage/WebPage.h: >+ (WebKit::WebPage::canShowWhileLocked const): >+ > 2019-05-09 Daniel Bates <dabates@apple.com> > > [iOS] Lazily request keyboard on first hardware keydown when a non-editable element is focused >diff --git a/Source/WebCore/PAL/pal/spi/cocoa/QuartzCoreSPI.h b/Source/WebCore/PAL/pal/spi/cocoa/QuartzCoreSPI.h >index 3d4341e18da4d0051df03552e038cc9e2a98343b..7489859659b0738fb51906ecbd28263262c935d1 100644 >--- a/Source/WebCore/PAL/pal/spi/cocoa/QuartzCoreSPI.h >+++ b/Source/WebCore/PAL/pal/spi/cocoa/QuartzCoreSPI.h >@@ -236,6 +236,7 @@ extern NSString * const kCAContextDisplayName; > extern NSString * const kCAContextDisplayId; > extern NSString * const kCAContextIgnoresHitTest; > extern NSString * const kCAContextPortNumber; >+extern NSString * const kCAContextSecure; > > #if PLATFORM(IOS_FAMILY) > extern NSString * const kCAContentsFormatRGBA10XR; >diff --git a/Source/WebKit/Platform/mac/LayerHostingContext.h b/Source/WebKit/Platform/mac/LayerHostingContext.h >index 5797793e7b75953d6c71052fa817c3fe3cfc69d4..c8220d8c421a991b32ceb189ab1d148d8134a218 100644 >--- a/Source/WebKit/Platform/mac/LayerHostingContext.h >+++ b/Source/WebKit/Platform/mac/LayerHostingContext.h >@@ -46,7 +46,7 @@ class LayerHostingContext { > public: > static std::unique_ptr<LayerHostingContext> createForPort(const WTF::MachSendRight& serverPort); > #if HAVE(OUT_OF_PROCESS_LAYER_HOSTING) >- static std::unique_ptr<LayerHostingContext> createForExternalHostingProcess(); >+ static std::unique_ptr<LayerHostingContext> createForExternalHostingProcess(bool canShowWhileLocked = false); > #if PLATFORM(MAC) > static std::unique_ptr<LayerHostingContext> createForExternalPluginHostingProcess(); > #endif >diff --git a/Source/WebKit/Platform/mac/LayerHostingContext.mm b/Source/WebKit/Platform/mac/LayerHostingContext.mm >index 910bb3fd8b8b49852e48ead22c259301ff966d83..3abb3dd82ed759b5e2b9f97809eb73796342a979 100644 >--- a/Source/WebKit/Platform/mac/LayerHostingContext.mm >+++ b/Source/WebKit/Platform/mac/LayerHostingContext.mm >@@ -50,7 +50,7 @@ std::unique_ptr<LayerHostingContext> LayerHostingContext::createForPort(const Ma > } > > #if HAVE(OUT_OF_PROCESS_LAYER_HOSTING) >-std::unique_ptr<LayerHostingContext> LayerHostingContext::createForExternalHostingProcess() >+std::unique_ptr<LayerHostingContext> LayerHostingContext::createForExternalHostingProcess(bool canShowWhileLocked) > { > auto layerHostingContext = std::make_unique<LayerHostingContext>(); > layerHostingContext->m_layerHostingMode = LayerHostingMode::OutOfProcess; >@@ -59,6 +59,7 @@ std::unique_ptr<LayerHostingContext> LayerHostingContext::createForExternalHosti > // Use a very large display ID to ensure that the context is never put on-screen > // without being explicitly parented. See <rdar://problem/16089267> for details. > layerHostingContext->m_context = [CAContext remoteContextWithOptions:@{ >+ kCAContextSecure: canShowWhileLocked ? @YES : @NO, > #if HAVE(CORE_ANIMATION_RENDER_SERVER) > kCAContextIgnoresHitTest : @YES, > kCAContextDisplayId : @10000 >@@ -66,9 +67,14 @@ std::unique_ptr<LayerHostingContext> LayerHostingContext::createForExternalHosti > }]; > #elif !PLATFORM(IOSMAC) && ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING) > [CAContext setAllowsCGSConnections:NO]; >- layerHostingContext->m_context = [CAContext remoteContextWithOptions:@{kCAContextCIFilterBehavior : @"ignore"}]; >+ layerHostingContext->m_context = [CAContext remoteContextWithOptions:@{ >+ kCAContextCIFilterBehavior : @"ignore", >+ kCAContextSecure: canShowWhileLocked ? @YES : @NO >+ }]; > #else >- layerHostingContext->m_context = [CAContext contextWithCGSConnection:CGSMainConnectionID() options:@{ kCAContextCIFilterBehavior : @"ignore" }]; >+ layerHostingContext->m_context = [CAContext contextWithCGSConnection:CGSMainConnectionID() options:@{ kCAContextCIFilterBehavior : @"ignore" >+ kCAContextSecure: canShowWhileLocked ? @YES : @NO >+ }]; > #endif > > return layerHostingContext; >diff --git a/Source/WebKit/Shared/WebPageCreationParameters.cpp b/Source/WebKit/Shared/WebPageCreationParameters.cpp >index bd9db403b39a5ad6f76cf6360971407b3cc96dd8..b63f3cb84c6521d9b4f7bca0088709827df05383 100644 >--- a/Source/WebKit/Shared/WebPageCreationParameters.cpp >+++ b/Source/WebKit/Shared/WebPageCreationParameters.cpp >@@ -100,6 +100,7 @@ void WebPageCreationParameters::encode(IPC::Encoder& encoder) const > #endif > #if PLATFORM(COCOA) > encoder << smartInsertDeleteEnabled; >+ encoder << canShowWhileLocked; > encoder << additionalSupportedImageTypes; > #endif > #if PLATFORM(WPE) >@@ -294,6 +295,8 @@ Optional<WebPageCreationParameters> WebPageCreationParameters::decode(IPC::Decod > #if PLATFORM(COCOA) > if (!decoder.decode(parameters.smartInsertDeleteEnabled)) > return WTF::nullopt; >+ if (!decoder.decode(parameters.canShowWhileLocked)) >+ return WTF::nullopt; > if (!decoder.decode(parameters.additionalSupportedImageTypes)) > return WTF::nullopt; > #endif >diff --git a/Source/WebKit/Shared/WebPageCreationParameters.h b/Source/WebKit/Shared/WebPageCreationParameters.h >index 0243bd1cbacc59f286052e98e867e6a332df12e5..5b1dc8cafccf985db229581882ee4a31b56d5096 100644 >--- a/Source/WebKit/Shared/WebPageCreationParameters.h >+++ b/Source/WebKit/Shared/WebPageCreationParameters.h >@@ -159,6 +159,7 @@ struct WebPageCreationParameters { > #endif > #if PLATFORM(COCOA) > bool smartInsertDeleteEnabled; >+ bool canShowWhileLocked; > Vector<String> additionalSupportedImageTypes; > #endif > #if PLATFORM(WPE) >diff --git a/Source/WebKit/UIProcess/API/APIPageConfiguration.cpp b/Source/WebKit/UIProcess/API/APIPageConfiguration.cpp >index 177b99988402e3ceb9615c93cd1ae33d859fa3e5..825ad96f81e65c725ea14ec6a49599ac731cca05 100644 >--- a/Source/WebKit/UIProcess/API/APIPageConfiguration.cpp >+++ b/Source/WebKit/UIProcess/API/APIPageConfiguration.cpp >@@ -78,6 +78,9 @@ Ref<PageConfiguration> PageConfiguration::copy() const > copy->m_drawsBackground = this->m_drawsBackground; > copy->m_controlledByAutomation = this->m_controlledByAutomation; > copy->m_cpuLimit = this->m_cpuLimit; >+#if PLATFORM(COCOA) >+ copy->m_canShowWhileLocked = this->m_canShowWhileLocked; >+#endif > copy->m_overrideContentSecurityPolicy = this->m_overrideContentSecurityPolicy; > #if ENABLE(APPLICATION_MANIFEST) > copy->m_applicationManifest = this->m_applicationManifest; >diff --git a/Source/WebKit/UIProcess/API/APIPageConfiguration.h b/Source/WebKit/UIProcess/API/APIPageConfiguration.h >index 64a494a19b331a39a322205245bfae91f9e68442..3a2c3a552c4d5de4627fb81d131b664135e207fc 100644 >--- a/Source/WebKit/UIProcess/API/APIPageConfiguration.h >+++ b/Source/WebKit/UIProcess/API/APIPageConfiguration.h >@@ -117,6 +117,9 @@ public: > #if PLATFORM(COCOA) > const WTF::Vector<WTF::String>& additionalSupportedImageTypes() const { return m_additionalSupportedImageTypes; } > void setAdditionalSupportedImageTypes(WTF::Vector<WTF::String>&& additionalSupportedImageTypes) { m_additionalSupportedImageTypes = WTFMove(additionalSupportedImageTypes); } >+ >+ bool canShowWhileLocked() const { return m_canShowWhileLocked; } >+ void setCanShowWhileLocked(bool canShowWhileLocked) { m_canShowWhileLocked = canShowWhileLocked; } > #endif > > #if ENABLE(APPLICATION_MANIFEST) >@@ -158,6 +161,7 @@ private: > > #if PLATFORM(COCOA) > WTF::Vector<WTF::String> m_additionalSupportedImageTypes; >+ bool m_canShowWhileLocked { false }; > #endif > > #if ENABLE(APPLICATION_MANIFEST) >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.mm b/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.mm >index 7e8916a0a04ffde3078a6892c7a3be24c3133ae8..61ed92500d6c442e65fa801ce8a0bfd4d8b660de 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.mm >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.mm >@@ -1091,6 +1091,16 @@ - (BOOL)_undoManagerAPIEnabled > return _undoManagerAPIEnabled; > } > >+- (void)_setCanShowWhileLocked:(BOOL)value >+{ >+ _pageConfiguration->setCanShowWhileLocked(value); >+} >+ >+- (BOOL)_canShowWhileLocked >+{ >+ return _pageConfiguration->canShowWhileLocked(); >+} >+ > @end > > @implementation WKWebViewConfiguration (WKDeprecated) >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h b/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h >index 78027fd9f0721dfe14277f114130670d145c3666..87e784f7ef834420737a6718c071e85a6ca3f51b 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h >@@ -107,4 +107,6 @@ typedef NS_ENUM(NSUInteger, _WKDragLiftDelay) { > @property (nonatomic, setter=_setEditableImagesEnabled:) BOOL _editableImagesEnabled WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA)); > @property (nonatomic, setter=_setUndoManagerAPIEnabled:) BOOL _undoManagerAPIEnabled WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA)); > >+@property (nonatomic, setter=_setCanShowWhileLocked:) BOOL _canShowWhileLocked WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA)); >+ > @end >diff --git a/Source/WebKit/UIProcess/WebPageProxy.cpp b/Source/WebKit/UIProcess/WebPageProxy.cpp >index a8ab15e7550c4eb095b254b16094edd45f32d570..09e2f6866ae8cbc3644b9aab7b9c8f06af8dc831 100644 >--- a/Source/WebKit/UIProcess/WebPageProxy.cpp >+++ b/Source/WebKit/UIProcess/WebPageProxy.cpp >@@ -7143,6 +7143,7 @@ WebPageCreationParameters WebPageProxy::creationParameters(WebProcessProxy& proc > > #if PLATFORM(COCOA) > parameters.smartInsertDeleteEnabled = m_isSmartInsertDeleteEnabled; >+ parameters.canShowWhileLocked = m_configuration->canShowWhileLocked(); > parameters.additionalSupportedImageTypes = m_configuration->additionalSupportedImageTypes(); > #endif > parameters.shouldScaleViewToFitDocument = m_shouldScaleViewToFitDocument; >diff --git a/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm b/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm >index 52a9bd4dcc91758cdf000dbc0b4de727ac856cd8..7c1b9e372005d08bff468b8699a1e4c7fb3f8bee 100644 >--- a/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm >+++ b/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm >@@ -59,7 +59,7 @@ PlatformCALayerRemoteCustom::PlatformCALayerRemoteCustom(LayerType layerType, Pl > break; > #if HAVE(OUT_OF_PROCESS_LAYER_HOSTING) > case LayerHostingMode::OutOfProcess: >- m_layerHostingContext = LayerHostingContext::createForExternalHostingProcess(); >+ m_layerHostingContext = LayerHostingContext::createForExternalHostingProcess(context.canShowWhileLocked()); > #if PLATFORM(IOS_FAMILY) > if (layerType == LayerTypeAVPlayerLayer) { > float scaleFactor = context.deviceScaleFactor(); >diff --git a/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h b/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h >index d408057876372503b64527f36dacc80bb203e773..6791e32513d8eebde332bce3083d2e87c0a7fbfc 100644 >--- a/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h >+++ b/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h >@@ -77,6 +77,8 @@ public: > bool nextFlushIsForImmediatePaint() const { return m_nextFlushIsForImmediatePaint; } > > void adoptLayersFromContext(RemoteLayerTreeContext&); >+ >+ bool canShowWhileLocked() const; > > private: > // WebCore::GraphicsLayerFactory >diff --git a/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm b/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm >index 68b157a9d057ffe2847a56e65fa26db7e468db0d..e510ac118071f46f3ed0cc0ecdbf7cdb31312bb9 100644 >--- a/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm >+++ b/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm >@@ -77,6 +77,11 @@ LayerHostingMode RemoteLayerTreeContext::layerHostingMode() const > { > return m_webPage.layerHostingMode(); > } >+ >+bool RemoteLayerTreeContext::canShowWhileLocked() const >+{ >+ return m_webPage.canShowWhileLocked(); >+} > > void RemoteLayerTreeContext::layerDidEnterContext(PlatformCALayerRemote& layer, PlatformCALayer::LayerType type) > { >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.cpp b/Source/WebKit/WebProcess/WebPage/WebPage.cpp >index 944bea5404669dbbed857dae48de789eaf0c0107..7838742ffc460f4032297b9b5053267feb1ff3bc 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.cpp >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.cpp >@@ -424,6 +424,9 @@ WebPage::WebPage(uint64_t pageID, WebPageCreationParameters&& parameters) > #if PLATFORM(WPE) > , m_hostFileDescriptor(WTFMove(parameters.hostFileDescriptor)) > #endif >+#if PLATFORM(COCOA) >+ , m_canShowWhileLocked(parameters.canShowWhileLocked) >+#endif > #if ENABLE(VIEWPORT_RESIZING) > , m_shrinkToFitContentTimer(*this, &WebPage::shrinkToFitContentTimerFired, 0_s) > #endif >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.h b/Source/WebKit/WebProcess/WebPage/WebPage.h >index c29645d0c6174491070e39949845224df5fcfe6a..944a1b32dcae52972985c54c829e8804b19c0c2b 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.h >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.h >@@ -532,6 +532,7 @@ public: > void setLayerHostingMode(LayerHostingMode); > > #if PLATFORM(COCOA) >+ bool canShowWhileLocked() const { return m_canShowWhileLocked; } > void updatePluginsActiveAndFocusedState(); > const WebCore::FloatRect& windowFrameInScreenCoordinates() const { return m_windowFrameInScreenCoordinates; } > const WebCore::FloatRect& windowFrameInUnflippedScreenCoordinates() const { return m_windowFrameInUnflippedScreenCoordinates; } >@@ -1909,6 +1910,7 @@ private: > bool m_isSuspended { false }; > bool m_needsFontAttributes { false }; > #if PLATFORM(COCOA) >+ bool m_canShowWhileLocked { false }; > WeakPtr<RemoteObjectRegistry> m_remoteObjectRegistry; > #endif > WebCore::IntSize m_lastSentIntrinsicContentSize;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 197777
:
369552
|
369555
|
369568