Changeset 244771 in webkit
- Timestamp:
- Apr 30, 2019, 8:03:38 AM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
Modules/webaudio/AudioContext.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r244768 r244771 1 2019-04-30 Youenn Fablet <youenn@apple.com> 2 3 Refactor AudioContext to register/unregister itself at construction/destruction time 4 https://bugs.webkit.org/show_bug.cgi?id=197383 5 6 Reviewed by Eric Carlson. 7 8 Registering/Unregistering is cheap. 9 Instead of registering/unregistering in initialize/uninitialize, 10 move this code to constructor/destructor. 11 No observable change of behavior. 12 13 * Modules/webaudio/AudioContext.cpp: 14 (WebCore::AudioContext::AudioContext): 15 (WebCore::AudioContext::~AudioContext): 16 (WebCore::AudioContext::lazyInitialize): 17 (WebCore::AudioContext::uninitialize): 18 (WebCore::AudioContext::visibilityStateChanged): 19 1 20 2019-04-30 Michael Catanzaro <mcatanzaro@igalia.com> 2 21 -
trunk/Source/WebCore/Modules/webaudio/AudioContext.cpp
r243887 r244771 148 148 // Initialize the destination node's muted state to match the page's current muted state. 149 149 pageMutedStateDidChange(); 150 151 if (!isOfflineContext()) { 152 document.addAudioProducer(*this); 153 document.registerForVisibilityStateChangedCallbacks(*this); 154 } 150 155 } 151 156 … … 203 208 ASSERT(m_renderingAutomaticPullNodes.isEmpty()); 204 209 // FIXME: Can we assert that m_deferredFinishDerefList is empty? 210 211 if (!isOfflineContext() && scriptExecutionContext()) { 212 document()->removeAudioProducer(*this); 213 document()->unregisterForVisibilityStateChangedCallbacks(*this); 214 } 205 215 } 206 216 … … 219 229 220 230 if (!isOfflineContext()) { 221 document()->addAudioProducer(*this);222 document()->registerForVisibilityStateChangedCallbacks(*this);223 224 231 // This starts the audio thread. The destination node's provideInput() method will now be called repeatedly to render audio. 225 232 // Each time provideInput() is called, a portion of the audio stream is rendered. Let's call this time period a "render quantum". … … 266 273 267 274 if (!isOfflineContext()) { 268 document()->removeAudioProducer(*this);269 document()->unregisterForVisibilityStateChangedCallbacks(*this);270 271 275 ASSERT(s_hardwareContextCount); 272 276 --s_hardwareContextCount; … … 379 383 { 380 384 // Do not suspend if audio is audible. 381 if (mediaState() == MediaProducer::IsPlayingAudio )385 if (mediaState() == MediaProducer::IsPlayingAudio || m_isStopScheduled) 382 386 return; 383 387
Note:
See TracChangeset
for help on using the changeset viewer.