Changeset 215617 in webkit
- Timestamp:
- Apr 21, 2017, 11:09:41 AM (9 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
-
ChangeLog (modified) (1 diff)
-
html/MediaElementSession.cpp (modified) (1 diff)
-
platform/audio/PlatformMediaSessionManager.cpp (modified) (4 diffs)
-
platform/audio/PlatformMediaSessionManager.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r215614 r215617 1 2017-04-21 Jer Noble <jer.noble@apple.com> 2 3 Fix some spurious ASSERTs when working with capturing media elements 4 https://bugs.webkit.org/show_bug.cgi?id=171096 5 6 Reviewed by Youenn Fablet. 7 8 Two related ASSERTS: 9 10 1) When we added a new PlatformMediaSession MediaType (MediaStreamCapturingAudio), we did not update all the 11 places that validated the enum. This would lead to spurious ASSERTs when an element capturing audio would 12 fail various checks to enusre it's type's validity. 13 14 2) Audio elements will ASSERT when they change page visibility, as they do not have a renderer which implements 15 visibleInViewportStateChanged(). So opt out of visibility-state checking for non-video media elements. 16 17 * html/MediaElementSession.cpp: 18 (WebCore::MediaElementSession::wantsToObserveViewportVisibilityForAutoplay): 19 * platform/audio/PlatformMediaSessionManager.cpp: 20 (WebCore::PlatformMediaSessionManager::resetRestrictions): 21 (WebCore::PlatformMediaSessionManager::addRestriction): 22 (WebCore::PlatformMediaSessionManager::removeRestriction): 23 (WebCore::PlatformMediaSessionManager::restrictions): 24 * platform/audio/PlatformMediaSessionManager.h: 25 1 26 2017-04-21 Konstantin Tokarev <annulen@yandex.ru> 2 27 -
trunk/Source/WebCore/html/MediaElementSession.cpp
r215452 r215617 371 371 bool MediaElementSession::wantsToObserveViewportVisibilityForAutoplay() const 372 372 { 373 if (!m_element.isVideo()) 374 return false; 373 375 return hasBehaviorRestriction(InvisibleAutoplayNotPermitted) || hasBehaviorRestriction(OverrideUserGestureRequirementForMainContent); 374 376 } -
trunk/Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp
r215242 r215617 70 70 m_restrictions[PlatformMediaSession::VideoAudio] = NoRestrictions; 71 71 m_restrictions[PlatformMediaSession::WebAudio] = NoRestrictions; 72 m_restrictions[PlatformMediaSession::MediaStreamCapturingAudio] = NoRestrictions; 72 73 } 73 74 … … 169 170 void PlatformMediaSessionManager::addRestriction(PlatformMediaSession::MediaType type, SessionRestrictions restriction) 170 171 { 171 ASSERT(type > PlatformMediaSession::None && type <= PlatformMediaSession:: WebAudio);172 ASSERT(type > PlatformMediaSession::None && type <= PlatformMediaSession::MediaStreamCapturingAudio); 172 173 m_restrictions[type] |= restriction; 173 174 } … … 175 176 void PlatformMediaSessionManager::removeRestriction(PlatformMediaSession::MediaType type, SessionRestrictions restriction) 176 177 { 177 ASSERT(type > PlatformMediaSession::None && type <= PlatformMediaSession:: WebAudio);178 ASSERT(type > PlatformMediaSession::None && type <= PlatformMediaSession::MediaStreamCapturingAudio); 178 179 m_restrictions[type] &= ~restriction; 179 180 } … … 181 182 PlatformMediaSessionManager::SessionRestrictions PlatformMediaSessionManager::restrictions(PlatformMediaSession::MediaType type) 182 183 { 183 ASSERT(type > PlatformMediaSession::None && type <= PlatformMediaSession:: WebAudio);184 ASSERT(type > PlatformMediaSession::None && type <= PlatformMediaSession::MediaStreamCapturingAudio); 184 185 return m_restrictions[type]; 185 186 } -
trunk/Source/WebCore/platform/audio/PlatformMediaSessionManager.h
r210828 r215617 136 136 void systemDidWake() override; 137 137 138 SessionRestrictions m_restrictions[PlatformMediaSession:: WebAudio + 1];138 SessionRestrictions m_restrictions[PlatformMediaSession::MediaStreamCapturingAudio + 1]; 139 139 mutable Vector<PlatformMediaSession*> m_sessions; 140 140 std::unique_ptr<RemoteCommandListener> m_remoteCommandListener;
Note:
See TracChangeset
for help on using the changeset viewer.