⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 245228 in webkit


Ignore:
Timestamp:
May 12, 2019, 11:51:13 PM (7 years ago)
Author:
bshafiei@apple.com
Message:

Cherry-pick r245183. rdar://problem/50065100

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

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245183 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Location:
branches/safari-608.1.24-branch/Source
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-608.1.24-branch/Source/WebCore/PAL/ChangeLog

    r245075 r245228  
     12019-05-12  Babak Shafiei  <bshafiei@apple.com>
     2
     3        Cherry-pick r245183. rdar://problem/50065100
     4
     5    Add WKWebViewConfiguration._canShowWhileLocked SPI
     6    https://bugs.webkit.org/show_bug.cgi?id=197777
     7    <rdar://problem/50065100>
     8   
     9    Reviewed by Tim Horton.
     10   
     11    Source/WebCore/PAL:
     12   
     13    * pal/spi/cocoa/QuartzCoreSPI.h:
     14   
     15    Source/WebKit:
     16   
     17    * Platform/mac/LayerHostingContext.h:
     18    * Platform/mac/LayerHostingContext.mm:
     19    (WebKit::LayerHostingContext::createForExternalHostingProcess):
     20    * Shared/WebPageCreationParameters.cpp:
     21    (WebKit::WebPageCreationParameters::encode const):
     22    (WebKit::WebPageCreationParameters::decode):
     23    * Shared/WebPageCreationParameters.h:
     24    * UIProcess/API/APIPageConfiguration.cpp:
     25    (API::PageConfiguration::copy const):
     26    * UIProcess/API/APIPageConfiguration.h:
     27    (API::PageConfiguration::canShowWhileLocked const):
     28    (API::PageConfiguration::setCanShowWhileLocked):
     29    * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
     30    (-[WKWebViewConfiguration _setCanShowWhileLocked:]):
     31    (-[WKWebViewConfiguration _canShowWhileLocked]):
     32    * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
     33    * UIProcess/WebPageProxy.cpp:
     34    (WebKit::WebPageProxy::creationParameters):
     35    * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm:
     36    (WebKit::PlatformCALayerRemoteCustom::PlatformCALayerRemoteCustom):
     37    * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h:
     38    * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
     39    (WebKit::RemoteLayerTreeContext::canShowWhileLocked const):
     40    * WebProcess/WebPage/WebPage.cpp:
     41    (WebKit::m_canShowWhileLocked):
     42    (WebKit::m_shrinkToFitContentTimer): Deleted.
     43    * WebProcess/WebPage/WebPage.h:
     44    (WebKit::WebPage::canShowWhileLocked const):
     45   
     46   
     47    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245183 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     48
     49    2019-05-10  Chris Dumez  <cdumez@apple.com>
     50
     51            Add WKWebViewConfiguration._canShowWhileLocked SPI
     52            https://bugs.webkit.org/show_bug.cgi?id=197777
     53            <rdar://problem/50065100>
     54
     55            Reviewed by Tim Horton.
     56
     57            * pal/spi/cocoa/QuartzCoreSPI.h:
     58
    1592019-05-08  Alex Christensen  <achristensen@webkit.org>
    260
  • branches/safari-608.1.24-branch/Source/WebCore/PAL/pal/spi/cocoa/QuartzCoreSPI.h

    r237266 r245228  
    239239
    240240#if PLATFORM(IOS_FAMILY)
     241extern NSString * const kCAContextSecure;
    241242extern NSString * const kCAContentsFormatRGBA10XR;
    242243#endif
  • branches/safari-608.1.24-branch/Source/WebKit/ChangeLog

    r245227 r245228  
     12019-05-12  Babak Shafiei  <bshafiei@apple.com>
     2
     3        Cherry-pick r245183. rdar://problem/50065100
     4
     5    Add WKWebViewConfiguration._canShowWhileLocked SPI
     6    https://bugs.webkit.org/show_bug.cgi?id=197777
     7    <rdar://problem/50065100>
     8   
     9    Reviewed by Tim Horton.
     10   
     11    Source/WebCore/PAL:
     12   
     13    * pal/spi/cocoa/QuartzCoreSPI.h:
     14   
     15    Source/WebKit:
     16   
     17    * Platform/mac/LayerHostingContext.h:
     18    * Platform/mac/LayerHostingContext.mm:
     19    (WebKit::LayerHostingContext::createForExternalHostingProcess):
     20    * Shared/WebPageCreationParameters.cpp:
     21    (WebKit::WebPageCreationParameters::encode const):
     22    (WebKit::WebPageCreationParameters::decode):
     23    * Shared/WebPageCreationParameters.h:
     24    * UIProcess/API/APIPageConfiguration.cpp:
     25    (API::PageConfiguration::copy const):
     26    * UIProcess/API/APIPageConfiguration.h:
     27    (API::PageConfiguration::canShowWhileLocked const):
     28    (API::PageConfiguration::setCanShowWhileLocked):
     29    * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
     30    (-[WKWebViewConfiguration _setCanShowWhileLocked:]):
     31    (-[WKWebViewConfiguration _canShowWhileLocked]):
     32    * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
     33    * UIProcess/WebPageProxy.cpp:
     34    (WebKit::WebPageProxy::creationParameters):
     35    * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm:
     36    (WebKit::PlatformCALayerRemoteCustom::PlatformCALayerRemoteCustom):
     37    * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h:
     38    * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
     39    (WebKit::RemoteLayerTreeContext::canShowWhileLocked const):
     40    * WebProcess/WebPage/WebPage.cpp:
     41    (WebKit::m_canShowWhileLocked):
     42    (WebKit::m_shrinkToFitContentTimer): Deleted.
     43    * WebProcess/WebPage/WebPage.h:
     44    (WebKit::WebPage::canShowWhileLocked const):
     45   
     46   
     47    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245183 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     48
     49    2019-05-10  Chris Dumez  <cdumez@apple.com>
     50
     51            Add WKWebViewConfiguration._canShowWhileLocked SPI
     52            https://bugs.webkit.org/show_bug.cgi?id=197777
     53            <rdar://problem/50065100>
     54
     55            Reviewed by Tim Horton.
     56
     57            * Platform/mac/LayerHostingContext.h:
     58            * Platform/mac/LayerHostingContext.mm:
     59            (WebKit::LayerHostingContext::createForExternalHostingProcess):
     60            * Shared/WebPageCreationParameters.cpp:
     61            (WebKit::WebPageCreationParameters::encode const):
     62            (WebKit::WebPageCreationParameters::decode):
     63            * Shared/WebPageCreationParameters.h:
     64            * UIProcess/API/APIPageConfiguration.cpp:
     65            (API::PageConfiguration::copy const):
     66            * UIProcess/API/APIPageConfiguration.h:
     67            (API::PageConfiguration::canShowWhileLocked const):
     68            (API::PageConfiguration::setCanShowWhileLocked):
     69            * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
     70            (-[WKWebViewConfiguration _setCanShowWhileLocked:]):
     71            (-[WKWebViewConfiguration _canShowWhileLocked]):
     72            * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
     73            * UIProcess/WebPageProxy.cpp:
     74            (WebKit::WebPageProxy::creationParameters):
     75            * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm:
     76            (WebKit::PlatformCALayerRemoteCustom::PlatformCALayerRemoteCustom):
     77            * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h:
     78            * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
     79            (WebKit::RemoteLayerTreeContext::canShowWhileLocked const):
     80            * WebProcess/WebPage/WebPage.cpp:
     81            (WebKit::m_canShowWhileLocked):
     82            (WebKit::m_shrinkToFitContentTimer): Deleted.
     83            * WebProcess/WebPage/WebPage.h:
     84            (WebKit::WebPage::canShowWhileLocked const):
     85
    1862019-05-12  Babak Shafiei  <bshafiei@apple.com>
    287
  • branches/safari-608.1.24-branch/Source/WebKit/Platform/mac/LayerHostingContext.h

    r244085 r245228  
    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();
  • branches/safari-608.1.24-branch/Source/WebKit/Platform/mac/LayerHostingContext.mm

    r244085 r245228  
    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   
  • branches/safari-608.1.24-branch/Source/WebKit/Shared/WebPageCreationParameters.cpp

    r245072 r245228  
    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;
  • branches/safari-608.1.24-branch/Source/WebKit/Shared/WebPageCreationParameters.h

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

    r243787 r245228  
    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;
  • branches/safari-608.1.24-branch/Source/WebKit/UIProcess/API/APIPageConfiguration.h

    r243787 r245228  
    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 };
  • branches/safari-608.1.24-branch/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.mm

    r244955 r245228  
    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
  • branches/safari-608.1.24-branch/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h

    r243682 r245228  
    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));
  • branches/safari-608.1.24-branch/Source/WebKit/UIProcess/WebPageProxy.cpp

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

    r244704 r245228  
    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) {
  • branches/safari-608.1.24-branch/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h

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

    r241899 r245228  
    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)
  • branches/safari-608.1.24-branch/Source/WebKit/WebProcess/WebPage/WebPage.cpp

    r245225 r245228  
    415415    , m_deviceOrientation(parameters.deviceOrientation)
    416416    , m_keyboardIsAttached(parameters.keyboardIsAttached)
     417    , m_canShowWhileLocked(parameters.canShowWhileLocked)
    417418#endif
    418419    , m_layerVolatilityTimer(*this, &WebPage::layerVolatilityTimerFired)
  • branches/safari-608.1.24-branch/Source/WebKit/WebProcess/WebPage/WebPage.h

    r245079 r245228  
    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.