Changeset 245183 in webkit


Ignore:
Timestamp:
May 10, 2019 11:52:05 AM (5 years ago)
Author:
Chris Dumez
Message:

Add WKWebViewConfiguration._canShowWhileLocked SPI
https://bugs.webkit.org/show_bug.cgi?id=197777
<rdar://problem/50065100>

Reviewed by Tim Horton.

Source/WebCore/PAL:

  • pal/spi/cocoa/QuartzCoreSPI.h:

Source/WebKit:

  • 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):

Location:
trunk/Source
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/PAL/ChangeLog

    r245161 r245183  
     12019-05-10  Chris Dumez  <cdumez@apple.com>
     2
     3        Add WKWebViewConfiguration._canShowWhileLocked SPI
     4        https://bugs.webkit.org/show_bug.cgi?id=197777
     5        <rdar://problem/50065100>
     6
     7        Reviewed by Tim Horton.
     8
     9        * pal/spi/cocoa/QuartzCoreSPI.h:
     10
    1112019-05-09  Daniel Bates  <dabates@apple.com>
    212
  • trunk/Source/WebCore/PAL/pal/spi/cocoa/QuartzCoreSPI.h

    r237266 r245183  
    239239
    240240#if PLATFORM(IOS_FAMILY)
     241extern NSString * const kCAContextSecure;
    241242extern NSString * const kCAContentsFormatRGBA10XR;
    242243#endif
  • trunk/Source/WebKit/ChangeLog

    r245179 r245183  
     12019-05-10  Chris Dumez  <cdumez@apple.com>
     2
     3        Add WKWebViewConfiguration._canShowWhileLocked SPI
     4        https://bugs.webkit.org/show_bug.cgi?id=197777
     5        <rdar://problem/50065100>
     6
     7        Reviewed by Tim Horton.
     8
     9        * Platform/mac/LayerHostingContext.h:
     10        * Platform/mac/LayerHostingContext.mm:
     11        (WebKit::LayerHostingContext::createForExternalHostingProcess):
     12        * Shared/WebPageCreationParameters.cpp:
     13        (WebKit::WebPageCreationParameters::encode const):
     14        (WebKit::WebPageCreationParameters::decode):
     15        * Shared/WebPageCreationParameters.h:
     16        * UIProcess/API/APIPageConfiguration.cpp:
     17        (API::PageConfiguration::copy const):
     18        * UIProcess/API/APIPageConfiguration.h:
     19        (API::PageConfiguration::canShowWhileLocked const):
     20        (API::PageConfiguration::setCanShowWhileLocked):
     21        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
     22        (-[WKWebViewConfiguration _setCanShowWhileLocked:]):
     23        (-[WKWebViewConfiguration _canShowWhileLocked]):
     24        * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
     25        * UIProcess/WebPageProxy.cpp:
     26        (WebKit::WebPageProxy::creationParameters):
     27        * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm:
     28        (WebKit::PlatformCALayerRemoteCustom::PlatformCALayerRemoteCustom):
     29        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h:
     30        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
     31        (WebKit::RemoteLayerTreeContext::canShowWhileLocked const):
     32        * WebProcess/WebPage/WebPage.cpp:
     33        (WebKit::m_canShowWhileLocked):
     34        (WebKit::m_shrinkToFitContentTimer): Deleted.
     35        * WebProcess/WebPage/WebPage.h:
     36        (WebKit::WebPage::canShowWhileLocked const):
     37
    1382019-05-10  Michael Catanzaro  <mcatanzaro@igalia.com>
    239
  • trunk/Source/WebKit/Platform/mac/LayerHostingContext.h

    r244085 r245183  
    4141
    4242using LayerHostingContextID = uint32_t;
     43   
     44struct LayerHostingContextOptions {
     45#if PLATFORM(IOS_FAMILY)
     46    bool canShowWhileLocked { false };
     47#endif
     48};
    4349
    4450class LayerHostingContext {
     
    4652public:
    4753    static std::unique_ptr<LayerHostingContext> createForPort(const WTF::MachSendRight& serverPort);
     54   
    4855#if HAVE(OUT_OF_PROCESS_LAYER_HOSTING)
    49     static std::unique_ptr<LayerHostingContext> createForExternalHostingProcess();
     56    static std::unique_ptr<LayerHostingContext> createForExternalHostingProcess(const LayerHostingContextOptions& = { });
     57
    5058#if PLATFORM(MAC)
    5159    static std::unique_ptr<LayerHostingContext> createForExternalPluginHostingProcess();
    5260#endif
    53 #endif
     61   
     62#endif // HAVE(OUT_OF_PROCESS_LAYER_HOSTING)
    5463
    5564    LayerHostingContext();
  • trunk/Source/WebKit/Platform/mac/LayerHostingContext.mm

    r244085 r245183  
    5151
    5252#if HAVE(OUT_OF_PROCESS_LAYER_HOSTING)
    53 std::unique_ptr<LayerHostingContext> LayerHostingContext::createForExternalHostingProcess()
     53std::unique_ptr<LayerHostingContext> LayerHostingContext::createForExternalHostingProcess(const LayerHostingContextOptions& options)
    5454{
    5555    auto layerHostingContext = std::make_unique<LayerHostingContext>();
     
    6060    // without being explicitly parented. See <rdar://problem/16089267> for details.
    6161    layerHostingContext->m_context = [CAContext remoteContextWithOptions:@{
     62        kCAContextSecure: @(options.canShowWhileLocked),
    6263#if HAVE(CORE_ANIMATION_RENDER_SERVER)
    6364        kCAContextIgnoresHitTest : @YES,
     
    6768#elif !PLATFORM(IOSMAC) && ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING)
    6869    [CAContext setAllowsCGSConnections:NO];
    69     layerHostingContext->m_context = [CAContext remoteContextWithOptions:@{kCAContextCIFilterBehavior :  @"ignore"}];
     70    layerHostingContext->m_context = [CAContext remoteContextWithOptions:@{
     71        kCAContextCIFilterBehavior :  @"ignore",
     72    }];
    7073#else
    71     layerHostingContext->m_context = [CAContext contextWithCGSConnection:CGSMainConnectionID() options:@{ kCAContextCIFilterBehavior : @"ignore" }];
     74    layerHostingContext->m_context = [CAContext contextWithCGSConnection:CGSMainConnectionID() options:@{
     75        kCAContextCIFilterBehavior : @"ignore",
     76    }];
    7277#endif
    7378   
  • trunk/Source/WebKit/Shared/WebPageCreationParameters.cpp

    r245072 r245183  
    9797    encoder << deviceOrientation;
    9898    encoder << keyboardIsAttached;
     99    encoder << canShowWhileLocked;
    99100    encoder << overrideViewportArguments;
    100101#endif
     
    284285    if (!decoder.decode(parameters.keyboardIsAttached))
    285286        return WTF::nullopt;
     287    if (!decoder.decode(parameters.canShowWhileLocked))
     288        return WTF::nullopt;
    286289
    287290    Optional<Optional<WebCore::ViewportArguments>> overrideViewportArguments;
  • trunk/Source/WebKit/Shared/WebPageCreationParameters.h

    r245072 r245183  
    156156    int32_t deviceOrientation { 0 };
    157157    bool keyboardIsAttached { false };
     158    bool canShowWhileLocked { false };
    158159    Optional<WebCore::ViewportArguments> overrideViewportArguments;
    159160#endif
  • trunk/Source/WebKit/UIProcess/API/APIPageConfiguration.cpp

    r243787 r245183  
    7373#if PLATFORM(IOS_FAMILY)
    7474    copy->m_alwaysRunsAtForegroundPriority = this->m_alwaysRunsAtForegroundPriority;
     75    copy->m_canShowWhileLocked = this->m_canShowWhileLocked;
    7576#endif
    7677    copy->m_initialCapitalizationEnabled = this->m_initialCapitalizationEnabled;
  • trunk/Source/WebKit/UIProcess/API/APIPageConfiguration.h

    r243787 r245183  
    9595#if PLATFORM(IOS_FAMILY)
    9696    bool alwaysRunsAtForegroundPriority() { return m_alwaysRunsAtForegroundPriority; }
    97     void setAlwaysRunsAtForegroundPriority(bool alwaysRunsAtForegroundPriority) { m_alwaysRunsAtForegroundPriority = alwaysRunsAtForegroundPriority; }
     97    void setAlwaysRunsAtForegroundPriority(bool alwaysRunsAtForegroundPriority) { m_alwaysRunsAtForegroundPriority = alwaysRunsAtForegroundPriority; }
     98   
     99    bool canShowWhileLocked() const { return m_canShowWhileLocked; }
     100    void setCanShowWhileLocked(bool canShowWhileLocked) { m_canShowWhileLocked = canShowWhileLocked; }
    98101#endif
    99102    bool initialCapitalizationEnabled() { return m_initialCapitalizationEnabled; }
     
    148151#if PLATFORM(IOS_FAMILY)
    149152    bool m_alwaysRunsAtForegroundPriority { false };
     153    bool m_canShowWhileLocked { false };
    150154#endif
    151155    bool m_initialCapitalizationEnabled { true };
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.mm

    r244955 r245183  
    772772}
    773773
     774- (void)_setCanShowWhileLocked:(BOOL)value
     775{
     776    _pageConfiguration->setCanShowWhileLocked(value);
     777}
     778
     779- (BOOL)_canShowWhileLocked
     780{
     781    return _pageConfiguration->canShowWhileLocked();
     782}
     783
    774784#endif // PLATFORM(IOS_FAMILY)
    775785
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h

    r243682 r245183  
    8484@property (nonatomic, setter=_setSystemPreviewEnabled:) BOOL _systemPreviewEnabled WK_API_AVAILABLE(ios(12.0));
    8585@property (nonatomic, setter=_setShouldDecidePolicyBeforeLoadingQuickLookPreview:) BOOL _shouldDecidePolicyBeforeLoadingQuickLookPreview WK_API_AVAILABLE(ios(WK_IOS_TBA));
     86@property (nonatomic, setter=_setCanShowWhileLocked:) BOOL _canShowWhileLocked WK_API_AVAILABLE(ios(WK_IOS_TBA));
    8687#else
    8788@property (nonatomic, setter=_setShowsURLsInToolTips:) BOOL _showsURLsInToolTips WK_API_AVAILABLE(macos(10.12));
  • trunk/Source/WebKit/UIProcess/WebPageProxy.cpp

    r245079 r245183  
    71277127    parameters.keyboardIsAttached = isInHardwareKeyboardMode();
    71287128    parameters.overrideViewportArguments = m_overrideViewportArguments;
     7129    parameters.canShowWhileLocked = m_configuration->canShowWhileLocked();
    71297130#endif
    71307131
  • trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm

    r244704 r245183  
    6060#if HAVE(OUT_OF_PROCESS_LAYER_HOSTING)
    6161    case LayerHostingMode::OutOfProcess:
    62         m_layerHostingContext = LayerHostingContext::createForExternalHostingProcess();
     62        m_layerHostingContext = LayerHostingContext::createForExternalHostingProcess({
     63#if PLATFORM(IOS_FAMILY)
     64            context.canShowWhileLocked()
     65#endif
     66        });
    6367#if PLATFORM(IOS_FAMILY)
    6468        if (layerType == LayerTypeAVPlayerLayer) {
  • trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h

    r241899 r245183  
    7878
    7979    void adoptLayersFromContext(RemoteLayerTreeContext&);
     80   
     81#if PLATFORM(IOS_FAMILY)
     82    bool canShowWhileLocked() const;
     83#endif
    8084
    8185private:
  • trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm

    r241899 r245183  
    7878    return m_webPage.layerHostingMode();
    7979}
     80
     81#if PLATFORM(IOS_FAMILY)
     82bool RemoteLayerTreeContext::canShowWhileLocked() const
     83{
     84    return m_webPage.canShowWhileLocked();
     85}
     86#endif
    8087
    8188void RemoteLayerTreeContext::layerDidEnterContext(PlatformCALayerRemote& layer, PlatformCALayer::LayerType type)
  • trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp

    r245144 r245183  
    415415    , m_deviceOrientation(parameters.deviceOrientation)
    416416    , m_keyboardIsAttached(parameters.keyboardIsAttached)
     417    , m_canShowWhileLocked(parameters.canShowWhileLocked)
    417418#endif
    418419    , m_layerVolatilityTimer(*this, &WebPage::layerVolatilityTimerFired)
  • trunk/Source/WebKit/WebProcess/WebPage/WebPage.h

    r245079 r245183  
    959959
    960960    void updateStringForFind(const String&);
     961   
     962    bool canShowWhileLocked() const { return m_canShowWhileLocked; }
    961963#endif
    962964
     
    18301832    int32_t m_deviceOrientation { 0 };
    18311833    bool m_keyboardIsAttached { false };
     1834    bool m_canShowWhileLocked { false };
    18321835    bool m_inDynamicSizeUpdate { false };
    18331836    HashMap<std::pair<WebCore::IntSize, double>, WebCore::IntPoint> m_dynamicSizeUpdateHistory;
Note: See TracChangeset for help on using the changeset viewer.