Changeset 245889 in webkit
- Timestamp:
- May 30, 2019, 9:49:29 AM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
Modules/webaudio/AudioContext.cpp (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r245887 r245889 1 2019-05-30 Jer Noble <jer.noble@apple.com> 2 3 ASSERTION FAILED: m_scriptExecutionContext under WebCore::AudioContext::isPlayingAudioDidChange() 4 https://bugs.webkit.org/show_bug.cgi?id=181597 5 <rdar://problem/36474088> 6 7 Reviewed by Eric Carlson. 8 9 Because document() is usually null-checked before using (and we can add null-checks where missing), 10 there's no good reason to debug-assert that m_scriptExecutionContext is non-null before downcast<>ing 11 to Document*. 12 13 * Modules/webaudio/AudioContext.cpp: 14 (WebCore::AudioContext::constructCommon): 15 (WebCore::AudioContext::stop): 16 (WebCore::AudioContext::document const): 17 (WebCore::AudioContext::visibilityStateChanged): 18 (WebCore::AudioContext::willBeginPlayback): 19 (WebCore::AudioContext::willPausePlayback): 20 (WebCore::AudioContext::pageMutedStateDidChange): 21 1 22 2019-05-30 Jer Noble <jer.noble@apple.com> 2 23 -
trunk/Source/WebCore/Modules/webaudio/AudioContext.cpp
r244899 r245889 108 108 WTF_MAKE_ISO_ALLOCATED_IMPL(AudioContext); 109 109 110 #define RELEASE_LOG_IF_ALLOWED(fmt, ...) RELEASE_LOG_IF(document() ->page() && document()->page()->isAlwaysOnLoggingAllowed(), Media, "%p - AudioContext::" fmt, this, ##__VA_ARGS__)110 #define RELEASE_LOG_IF_ALLOWED(fmt, ...) RELEASE_LOG_IF(document() && document()->page() && document()->page()->isAlwaysOnLoggingAllowed(), Media, "%p - AudioContext::" fmt, this, ##__VA_ARGS__) 111 111 112 112 bool AudioContext::isSampleRateRangeGood(float sampleRate) … … 181 181 m_listener = AudioListener::create(); 182 182 183 ASSERT(document()); 183 184 if (document()->audioPlaybackRequiresUserGesture()) 184 185 addBehaviorRestriction(RequireUserGestureForAudioStartRestriction); … … 330 331 m_isStopScheduled = true; 331 332 333 ASSERT(document()); 332 334 document()->updateIsPlayingMedia(); 333 335 … … 351 353 Document* AudioContext::document() const 352 354 { 353 ASSERT(m_scriptExecutionContext);354 355 return downcast<Document>(m_scriptExecutionContext); 355 356 } … … 383 384 { 384 385 // Do not suspend if audio is audible. 385 if ( mediaState() == MediaProducer::IsPlayingAudio || m_isStopScheduled)386 if (!document() || mediaState() == MediaProducer::IsPlayingAudio || m_isStopScheduled) 386 387 return; 387 388 … … 1084 1085 bool AudioContext::willBeginPlayback() 1085 1086 { 1087 if (!document()) 1088 return false; 1089 1086 1090 if (userGestureRequiredForAudioStart()) { 1087 1091 if (!processingUserGestureForMedia() && !document()->isCapturing()) { … … 1110 1114 bool AudioContext::willPausePlayback() 1111 1115 { 1116 if (!document()) 1117 return false; 1118 1112 1119 if (userGestureRequiredForAudioStart()) { 1113 1120 if (!processingUserGestureForMedia()) … … 1155 1162 void AudioContext::pageMutedStateDidChange() 1156 1163 { 1157 if (m_destinationNode && document() ->page())1164 if (m_destinationNode && document() && document()->page()) 1158 1165 m_destinationNode->setMuted(document()->page()->isAudioMuted()); 1159 1166 }
Note:
See TracChangeset
for help on using the changeset viewer.