Changeset 245944 in webkit


Ignore:
Timestamp:
May 30, 2019, 8:14:35 PM (6 years ago)
Author:
Ryan Haddad
Message:

Unreviewed, rolling out r245890, 245887.

Breaks internal builds.

Reverted changeset:
"Video playback in Safari should continue when CarPlay is plugged in"
https://bugs.webkit.org/show_bug.cgi?id=198345
https://trac.webkit.org/changeset/245887/webkit# Please enter the commit message for your changes. Lines starting

Location:
trunk
Files:
2 deleted
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r245942 r245944  
     12019-05-30  Ryan Haddad  <ryanhaddad@apple.com>
     2
     3        Unreviewed, rolling out r245890, 245887.
     4
     5        Breaks internal builds.
     6
     7        Reverted changeset:
     8        "Video playback in Safari should continue when CarPlay is plugged in"
     9        https://bugs.webkit.org/show_bug.cgi?id=198345
     10        https://trac.webkit.org/changeset/245887/webkit
     11
     12
    1132019-05-30  Dean Jackson  <dino@apple.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r245942 r245944  
     12019-05-30  Ryan Haddad  <ryanhaddad@apple.com>
     2
     3        Unreviewed, rolling out r245890, 245887.
     4
     5        Breaks internal builds.
     6
     7        Reverted changeset:
     8        "Video playback in Safari should continue when CarPlay is plugged in"
     9        https://bugs.webkit.org/show_bug.cgi?id=198345
     10        https://trac.webkit.org/changeset/245887/webkit
     11
    1122019-05-30  Dean Jackson  <dino@apple.com>
    213
  • trunk/Source/WebCore/html/HTMLMediaElement.cpp

    r245887 r245944  
    77167716            return true;
    77177717        }
    7718         if (PlatformMediaSessionManager::sharedManager().isPlayingToAutomotiveHeadUnit()) {
    7719             INFO_LOG(LOGIDENTIFIER, "returning true because isPlayingToAutomotiveHeadUnit() is true");
    7720             return true;
    7721         }
    77227718        if (m_videoFullscreenMode & VideoFullscreenModePictureInPicture)
    77237719            return true;
     
    77297725        if (isPlayingToExternalTarget()) {
    77307726            INFO_LOG(LOGIDENTIFIER, "returning true because isPlayingToExternalTarget() is true");
    7731             return true;
    7732         }
    7733         if (PlatformMediaSessionManager::sharedManager().isPlayingToAutomotiveHeadUnit()) {
    7734             INFO_LOG(LOGIDENTIFIER, "returning true because isPlayingToAutomotiveHeadUnit() is true");
    77357727            return true;
    77367728        }
  • trunk/Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp

    r245887 r245944  
    392392}
    393393
    394 void PlatformMediaSessionManager::setIsPlayingToAutomotiveHeadUnit(bool isPlayingToAutomotiveHeadUnit)
    395 {
    396     if (isPlayingToAutomotiveHeadUnit == m_isPlayingToAutomotiveHeadUnit)
    397         return;
    398 
    399     ALWAYS_LOG(LOGIDENTIFIER, isPlayingToAutomotiveHeadUnit);
    400     m_isPlayingToAutomotiveHeadUnit = isPlayingToAutomotiveHeadUnit;
    401 }
    402394
    403395void PlatformMediaSessionManager::sessionIsPlayingToWirelessPlaybackTargetChanged(PlatformMediaSession& session)
  • trunk/Source/WebCore/platform/audio/PlatformMediaSessionManager.h

    r245887 r245944  
    130130    void sessionIsPlayingToWirelessPlaybackTargetChanged(PlatformMediaSession&);
    131131
    132     WEBCORE_EXPORT void setIsPlayingToAutomotiveHeadUnit(bool);
    133     bool isPlayingToAutomotiveHeadUnit() const { return m_isPlayingToAutomotiveHeadUnit; }
    134 
    135132    void forEachMatchingSession(const Function<bool(const PlatformMediaSession&)>& predicate, const Function<void(PlatformMediaSession&)>& matchingCallback);
    136133
     
    192189    bool m_willIgnoreSystemInterruptions { false };
    193190    bool m_processIsSuspended { false };
    194     bool m_isPlayingToAutomotiveHeadUnit { false };
    195191
    196192#if USE(AUDIO_SESSION)
  • trunk/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.h

    r245887 r245944  
    4848    void externalOutputDeviceAvailableDidChange();
    4949    bool hasWirelessTargetsAvailable() override;
    50     void carPlayServerDied();
    51     void updateCarPlayIsConnected(Optional<bool>&&);
    5250
    5351private:
  • trunk/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.mm

    r245890 r245944  
    5757SOFT_LINK_CLASS_OPTIONAL(Celestial, AVSystemController)
    5858SOFT_LINK_CONSTANT_MAY_FAIL(Celestial, AVSystemController_PIDToInheritApplicationStateFrom, NSString *)
    59 SOFT_LINK_CONSTANT_MAY_FAIL(Celestial, AVSystemController_CarPlayIsConnectedAttribute, NSString *)
    60 SOFT_LINK_CONSTANT_MAY_FAIL(Celestial, AVSystemController_CarPlayIsConnectedDidChangeNotification, NSString *)
    61 SOFT_LINK_CONSTANT_MAY_FAIL(Celestial, AVSystemController_CarPlayIsConnectedNotificationParameter, NSString *)
    62 SOFT_LINK_CONSTANT_MAY_FAIL(Celestial, AVSystemController_ServerConnectionDiedNotification, NSString *)
    6359#endif
    6460
     
    114110    END_BLOCK_OBJC_EXCEPTIONS
    115111    resetRestrictions();
    116 
    117     updateCarPlayIsConnected(WTF::nullopt);
    118112}
    119113
     
    199193
    200194    END_BLOCK_OBJC_EXCEPTIONS
    201 }
    202 
    203 void MediaSessionManageriOS::carPlayServerDied()
    204 {
    205     ALWAYS_LOG(LOGIDENTIFIER);
    206     updateCarPlayIsConnected(WTF::nullopt);
    207 }
    208 
    209 void MediaSessionManageriOS::updateCarPlayIsConnected(Optional<bool>&& carPlayIsConnected)
    210 {
    211     if (carPlayIsConnected) {
    212         setIsPlayingToAutomotiveHeadUnit(carPlayIsConnected.value());
    213         return;
    214     }
    215 
    216     if (!canLoadAVSystemController_CarPlayIsConnectedAttribute()) {
    217         setIsPlayingToAutomotiveHeadUnit(false);
    218         return;
    219     }
    220 
    221     setIsPlayingToAutomotiveHeadUnit([[[getAVSystemControllerClass() sharedAVSystemController] attributeForKey:getAVSystemController_CarPlayIsConnectedAttribute()] boolValue]);
    222195}
    223196
     
    246219    [center addObserver:self selector:@selector(applicationDidEnterBackground:) name:PAL::get_UIKit_UIApplicationDidEnterBackgroundNotification() object:nil];
    247220    [center addObserver:self selector:@selector(applicationDidEnterBackground:) name:WebUIApplicationDidEnterBackgroundNotification object:nil];
    248     if (canLoadAVSystemController_ServerConnectionDiedNotification())
    249         [center addObserver:self selector:@selector(carPlayServerDied:) name:getAVSystemController_ServerConnectionDiedNotification() object:nil];
    250     if (canLoadAVSystemController_CarPlayIsConnectedDidChangeNotification())
    251         [center addObserver:self selector:@selector(carPlayIsConnectedDidChange:) name:getAVSystemController_CarPlayIsConnectedDidChangeNotification() object:nil];
    252221
    253222    // Now playing won't work unless we turn on the delivery of remote control events.
     
    318287    LOG(Media, "-[WebMediaSessionHelper startMonitoringAirPlayRoutes]");
    319288
    320     callOnWebThreadOrDispatchAsyncOnMainThread([protectedSelf = retainPtr(self)]() mutable {
     289    callOnWebThreadOrDispatchAsyncOnMainThread([protectedSelf = WTFMove(self)]() mutable {
    321290        ASSERT(!protectedSelf->_routeDetector);
    322291
     
    325294            protectedSelf->_routeDetector = adoptNS([PAL::allocAVRouteDetectorInstance() init]);
    326295            protectedSelf->_routeDetector.get().routeDetectionEnabled = protectedSelf->_monitoringAirPlayRoutes;
    327             [[NSNotificationCenter defaultCenter] addObserver:protectedSelf.get() selector:@selector(wirelessRoutesAvailableDidChange:) name:AVRouteDetectorMultipleRoutesDetectedDidChangeNotification object:protectedSelf->_routeDetector.get()];
     296            [[NSNotificationCenter defaultCenter] addObserver:protectedSelf selector:@selector(wirelessRoutesAvailableDidChange:) name:AVRouteDetectorMultipleRoutesDetectedDidChangeNotification object:protectedSelf->_routeDetector.get()];
    328297
    329298            protectedSelf->_callback->externalOutputDeviceAvailableDidChange();
     
    360329        flags = PlatformMediaSession::MayResumePlaying;
    361330
    362     callOnWebThreadOrDispatchAsyncOnMainThread([protectedSelf = retainPtr(self), type, flags]() mutable {
     331    callOnWebThreadOrDispatchAsyncOnMainThread([protectedSelf = WTFMove(self), type, flags]() mutable {
    363332        auto* callback = protectedSelf->_callback;
    364333        if (!callback)
     
    383352
    384353    BOOL isSuspendedUnderLock = [[[notification userInfo] objectForKey:@"isSuspendedUnderLock"] boolValue];
    385     callOnWebThreadOrDispatchAsyncOnMainThread([protectedSelf = retainPtr(self), isSuspendedUnderLock]() mutable {
     354    callOnWebThreadOrDispatchAsyncOnMainThread([protectedSelf = WTFMove(self), isSuspendedUnderLock]() mutable {
    386355        if (auto* callback = protectedSelf->_callback)
    387356            callback->applicationWillEnterForeground(isSuspendedUnderLock);
     
    398367    LOG(Media, "-[WebMediaSessionHelper applicationDidBecomeActive]");
    399368
    400     callOnWebThreadOrDispatchAsyncOnMainThread([protectedSelf = retainPtr(self)]() mutable {
     369    callOnWebThreadOrDispatchAsyncOnMainThread([protectedSelf = WTFMove(self)]() mutable {
    401370        if (auto* callback = protectedSelf->_callback)
    402371            callback->applicationDidBecomeActive();
     
    413382    LOG(Media, "-[WebMediaSessionHelper applicationWillResignActive]");
    414383
    415     callOnWebThreadOrDispatchAsyncOnMainThread([protectedSelf = retainPtr(self)]() mutable {
     384    callOnWebThreadOrDispatchAsyncOnMainThread([protectedSelf = WTFMove(self)]() mutable {
    416385        if (auto* callback = protectedSelf->_callback)
    417386            callback->applicationWillBecomeInactive();
     
    428397    LOG(Media, "-[WebMediaSessionHelper wirelessRoutesAvailableDidChange]");
    429398
    430     callOnWebThreadOrDispatchAsyncOnMainThread([protectedSelf = retainPtr(self)]() mutable {
     399    callOnWebThreadOrDispatchAsyncOnMainThread([protectedSelf = WTFMove(self)]() mutable {
    431400        if (auto* callback = protectedSelf->_callback)
    432401            callback->externalOutputDeviceAvailableDidChange();
     
    442411
    443412    BOOL isSuspendedUnderLock = [[[notification userInfo] objectForKey:@"isSuspendedUnderLock"] boolValue];
    444     callOnWebThreadOrDispatchAsyncOnMainThread([protectedSelf = retainPtr(self), isSuspendedUnderLock]() mutable {
     413    callOnWebThreadOrDispatchAsyncOnMainThread([protectedSelf = WTFMove(self), isSuspendedUnderLock]() mutable {
    445414        if (auto* callback = protectedSelf->_callback)
    446415            callback->applicationDidEnterBackground(isSuspendedUnderLock);
    447416    });
    448417}
    449 
    450 - (void)carPlayServerDied:(NSNotification *)notification
    451 {
    452     if (!_callback)
    453         return;
    454 
    455     LOG(Media, "-[WebMediaSessionHelper carPlayServerDied:]");
    456     UNUSED_PARAM(notification);
    457     callOnWebThreadOrDispatchAsyncOnMainThread([protectedSelf = retainPtr(self)]() mutable {
    458         if (auto* callback = protectedSelf->_callback)
    459             callback->carPlayServerDied();
    460     });
    461 }
    462 
    463 - (void)carPlayIsConnectedDidChange:(NSNotification *)notification
    464 {
    465     if (!_callback)
    466         return;
    467 
    468     Optional<bool> carPlayIsConnected;
    469     if (notification && canLoadAVSystemController_CarPlayIsConnectedNotificationParameter()) {
    470         NSNumber *nsCarPlayIsConnected = [[notification userInfo] valueForKey:getAVSystemController_CarPlayIsConnectedNotificationParameter()];
    471         if (nsCarPlayIsConnected)
    472             carPlayIsConnected = [nsCarPlayIsConnected boolValue];
    473     }
    474 
    475     callOnWebThreadOrDispatchAsyncOnMainThread([protectedSelf = retainPtr(self), carPlayIsConnected = WTFMove(carPlayIsConnected)]() mutable {
    476         if (auto* callback = protectedSelf->_callback)
    477             callback->updateCarPlayIsConnected(WTFMove(carPlayIsConnected));
    478     });
    479 }
    480418@end
    481419
  • trunk/Source/WebCore/testing/Internals.cpp

    r245887 r245944  
    493493    PlatformMediaSessionManager::sharedManager().setWillIgnoreSystemInterruptions(true);
    494494#endif
    495     PlatformMediaSessionManager::sharedManager().setIsPlayingToAutomotiveHeadUnit(false);
    496495#if HAVE(ACCESSIBILITY)
    497496    AXObjectCache::setEnhancedUserInterfaceAccessibility(false);
     
    50695068}
    50705069
    5071 void Internals::setIsPlayingToAutomotiveHeadUnit(bool isPlaying)
    5072 {
    5073     PlatformMediaSessionManager::sharedManager().setIsPlayingToAutomotiveHeadUnit(isPlaying);
    5074 }
    5075 
    50765070} // namespace WebCore
  • trunk/Source/WebCore/testing/Internals.h

    r245887 r245944  
    824824    void setXHRMaximumIntervalForUserGestureForwarding(XMLHttpRequest&, double);
    825825
    826     void setIsPlayingToAutomotiveHeadUnit(bool);
    827 
    828826private:
    829827    explicit Internals(Document&);
  • trunk/Source/WebCore/testing/Internals.idl

    r245887 r245944  
    754754
    755755    void setXHRMaximumIntervalForUserGestureForwarding(XMLHttpRequest xhr, double interval);
    756 
    757     void setIsPlayingToAutomotiveHeadUnit(boolean value);
    758 };
     756};
Note: See TracChangeset for help on using the changeset viewer.