Changeset 245944 in webkit
- Timestamp:
- May 30, 2019, 8:14:35 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 deleted
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r245942 r245944 1 2019-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 1 13 2019-05-30 Dean Jackson <dino@apple.com> 2 14 -
trunk/Source/WebCore/ChangeLog
r245942 r245944 1 2019-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 1 12 2019-05-30 Dean Jackson <dino@apple.com> 2 13 -
trunk/Source/WebCore/html/HTMLMediaElement.cpp
r245887 r245944 7716 7716 return true; 7717 7717 } 7718 if (PlatformMediaSessionManager::sharedManager().isPlayingToAutomotiveHeadUnit()) {7719 INFO_LOG(LOGIDENTIFIER, "returning true because isPlayingToAutomotiveHeadUnit() is true");7720 return true;7721 }7722 7718 if (m_videoFullscreenMode & VideoFullscreenModePictureInPicture) 7723 7719 return true; … … 7729 7725 if (isPlayingToExternalTarget()) { 7730 7726 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");7735 7727 return true; 7736 7728 } -
trunk/Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp
r245887 r245944 392 392 } 393 393 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 }402 394 403 395 void PlatformMediaSessionManager::sessionIsPlayingToWirelessPlaybackTargetChanged(PlatformMediaSession& session) -
trunk/Source/WebCore/platform/audio/PlatformMediaSessionManager.h
r245887 r245944 130 130 void sessionIsPlayingToWirelessPlaybackTargetChanged(PlatformMediaSession&); 131 131 132 WEBCORE_EXPORT void setIsPlayingToAutomotiveHeadUnit(bool);133 bool isPlayingToAutomotiveHeadUnit() const { return m_isPlayingToAutomotiveHeadUnit; }134 135 132 void forEachMatchingSession(const Function<bool(const PlatformMediaSession&)>& predicate, const Function<void(PlatformMediaSession&)>& matchingCallback); 136 133 … … 192 189 bool m_willIgnoreSystemInterruptions { false }; 193 190 bool m_processIsSuspended { false }; 194 bool m_isPlayingToAutomotiveHeadUnit { false };195 191 196 192 #if USE(AUDIO_SESSION) -
trunk/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.h
r245887 r245944 48 48 void externalOutputDeviceAvailableDidChange(); 49 49 bool hasWirelessTargetsAvailable() override; 50 void carPlayServerDied();51 void updateCarPlayIsConnected(Optional<bool>&&);52 50 53 51 private: -
trunk/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.mm
r245890 r245944 57 57 SOFT_LINK_CLASS_OPTIONAL(Celestial, AVSystemController) 58 58 SOFT_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 *)63 59 #endif 64 60 … … 114 110 END_BLOCK_OBJC_EXCEPTIONS 115 111 resetRestrictions(); 116 117 updateCarPlayIsConnected(WTF::nullopt);118 112 } 119 113 … … 199 193 200 194 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]);222 195 } 223 196 … … 246 219 [center addObserver:self selector:@selector(applicationDidEnterBackground:) name:PAL::get_UIKit_UIApplicationDidEnterBackgroundNotification() object:nil]; 247 220 [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];252 221 253 222 // Now playing won't work unless we turn on the delivery of remote control events. … … 318 287 LOG(Media, "-[WebMediaSessionHelper startMonitoringAirPlayRoutes]"); 319 288 320 callOnWebThreadOrDispatchAsyncOnMainThread([protectedSelf = retainPtr(self)]() mutable {289 callOnWebThreadOrDispatchAsyncOnMainThread([protectedSelf = WTFMove(self)]() mutable { 321 290 ASSERT(!protectedSelf->_routeDetector); 322 291 … … 325 294 protectedSelf->_routeDetector = adoptNS([PAL::allocAVRouteDetectorInstance() init]); 326 295 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()]; 328 297 329 298 protectedSelf->_callback->externalOutputDeviceAvailableDidChange(); … … 360 329 flags = PlatformMediaSession::MayResumePlaying; 361 330 362 callOnWebThreadOrDispatchAsyncOnMainThread([protectedSelf = retainPtr(self), type, flags]() mutable {331 callOnWebThreadOrDispatchAsyncOnMainThread([protectedSelf = WTFMove(self), type, flags]() mutable { 363 332 auto* callback = protectedSelf->_callback; 364 333 if (!callback) … … 383 352 384 353 BOOL isSuspendedUnderLock = [[[notification userInfo] objectForKey:@"isSuspendedUnderLock"] boolValue]; 385 callOnWebThreadOrDispatchAsyncOnMainThread([protectedSelf = retainPtr(self), isSuspendedUnderLock]() mutable {354 callOnWebThreadOrDispatchAsyncOnMainThread([protectedSelf = WTFMove(self), isSuspendedUnderLock]() mutable { 386 355 if (auto* callback = protectedSelf->_callback) 387 356 callback->applicationWillEnterForeground(isSuspendedUnderLock); … … 398 367 LOG(Media, "-[WebMediaSessionHelper applicationDidBecomeActive]"); 399 368 400 callOnWebThreadOrDispatchAsyncOnMainThread([protectedSelf = retainPtr(self)]() mutable {369 callOnWebThreadOrDispatchAsyncOnMainThread([protectedSelf = WTFMove(self)]() mutable { 401 370 if (auto* callback = protectedSelf->_callback) 402 371 callback->applicationDidBecomeActive(); … … 413 382 LOG(Media, "-[WebMediaSessionHelper applicationWillResignActive]"); 414 383 415 callOnWebThreadOrDispatchAsyncOnMainThread([protectedSelf = retainPtr(self)]() mutable {384 callOnWebThreadOrDispatchAsyncOnMainThread([protectedSelf = WTFMove(self)]() mutable { 416 385 if (auto* callback = protectedSelf->_callback) 417 386 callback->applicationWillBecomeInactive(); … … 428 397 LOG(Media, "-[WebMediaSessionHelper wirelessRoutesAvailableDidChange]"); 429 398 430 callOnWebThreadOrDispatchAsyncOnMainThread([protectedSelf = retainPtr(self)]() mutable {399 callOnWebThreadOrDispatchAsyncOnMainThread([protectedSelf = WTFMove(self)]() mutable { 431 400 if (auto* callback = protectedSelf->_callback) 432 401 callback->externalOutputDeviceAvailableDidChange(); … … 442 411 443 412 BOOL isSuspendedUnderLock = [[[notification userInfo] objectForKey:@"isSuspendedUnderLock"] boolValue]; 444 callOnWebThreadOrDispatchAsyncOnMainThread([protectedSelf = retainPtr(self), isSuspendedUnderLock]() mutable {413 callOnWebThreadOrDispatchAsyncOnMainThread([protectedSelf = WTFMove(self), isSuspendedUnderLock]() mutable { 445 414 if (auto* callback = protectedSelf->_callback) 446 415 callback->applicationDidEnterBackground(isSuspendedUnderLock); 447 416 }); 448 417 } 449 450 - (void)carPlayServerDied:(NSNotification *)notification451 {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 *)notification464 {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 }480 418 @end 481 419 -
trunk/Source/WebCore/testing/Internals.cpp
r245887 r245944 493 493 PlatformMediaSessionManager::sharedManager().setWillIgnoreSystemInterruptions(true); 494 494 #endif 495 PlatformMediaSessionManager::sharedManager().setIsPlayingToAutomotiveHeadUnit(false);496 495 #if HAVE(ACCESSIBILITY) 497 496 AXObjectCache::setEnhancedUserInterfaceAccessibility(false); … … 5069 5068 } 5070 5069 5071 void Internals::setIsPlayingToAutomotiveHeadUnit(bool isPlaying)5072 {5073 PlatformMediaSessionManager::sharedManager().setIsPlayingToAutomotiveHeadUnit(isPlaying);5074 }5075 5076 5070 } // namespace WebCore -
trunk/Source/WebCore/testing/Internals.h
r245887 r245944 824 824 void setXHRMaximumIntervalForUserGestureForwarding(XMLHttpRequest&, double); 825 825 826 void setIsPlayingToAutomotiveHeadUnit(bool);827 828 826 private: 829 827 explicit Internals(Document&); -
trunk/Source/WebCore/testing/Internals.idl
r245887 r245944 754 754 755 755 void setXHRMaximumIntervalForUserGestureForwarding(XMLHttpRequest xhr, double interval); 756 757 void setIsPlayingToAutomotiveHeadUnit(boolean value); 758 }; 756 };
Note:
See TracChangeset
for help on using the changeset viewer.