Changeset 90853 in webkit
- Timestamp:
- Jul 12, 2011 2:46:35 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r90850 r90853 1 2011-07-12 Chris Rogers <crogers@google.com> 2 3 AudioDevice::Stop can close NULL handle. 4 https://bugs.webkit.org/show_bug.cgi?id=64157 5 6 Reviewed by Kenneth Russell. 7 8 No new tests since audio API is not yet implemented. 9 10 * bindings/js/JSAudioContextCustom.cpp: 11 (WebCore::JSAudioContextConstructor::constructJSAudioContext): 12 * bindings/v8/custom/V8AudioContextCustom.cpp: 13 (WebCore::V8AudioContext::constructorCallback): 14 * webaudio/AudioContext.cpp: 15 (WebCore::AudioContext::create): 16 (WebCore::AudioContext::uninitialize): 17 * webaudio/AudioContext.h: 18 1 19 2011-07-12 John Bates <jbates@google.com> 2 20 -
trunk/Source/WebCore/bindings/js/JSAudioContextCustom.cpp
r90839 r90853 69 69 // Constructor for default AudioContext which talks to audio hardware. 70 70 audioContext = AudioContext::create(document); 71 if (!audioContext.get()) 72 return throwVMError(exec, createSyntaxError(exec, "audio resources unavailable for AudioContext construction")); 71 73 } else { 72 74 // Constructor for offline (render-target) AudioContext which renders into an AudioBuffer. -
trunk/Source/WebCore/bindings/v8/custom/V8AudioContextCustom.cpp
r90839 r90853 60 60 // Constructor for default AudioContext which talks to audio hardware. 61 61 audioContext = AudioContext::create(document); 62 if (!audioContext.get()) 63 return throwError("audio resources unavailable for AudioContext construction", V8Proxy::SyntaxError); 62 64 } else { 63 65 // Constructor for offline (render-target) AudioContext which renders into an AudioBuffer. -
trunk/Source/WebCore/webaudio/AudioContext.cpp
r90839 r90853 83 83 } 84 84 85 // Don't allow more than this number of simultaneous AudioContexts talking to hardware. 86 const unsigned MaxHardwareContexts = 4; 87 unsigned AudioContext::s_hardwareContextCount = 0; 88 85 89 PassRefPtr<AudioContext> AudioContext::create(Document* document) 86 90 { 87 91 ASSERT(document); 92 ASSERT(isMainThread()); 93 if (s_hardwareContextCount >= MaxHardwareContexts) 94 return 0; 95 96 ++s_hardwareContextCount; 97 88 98 return adoptRef(new AudioContext(document)); 89 99 } … … 195 205 void AudioContext::uninitialize() 196 206 { 207 ASSERT(isMainThread()); 208 197 209 if (m_isInitialized) { 198 210 // This stops the audio thread and all audio rendering. … … 204 216 // We have to release our reference to the destination node before the context will ever be deleted since the destination node holds a reference to the context. 205 217 m_destinationNode.clear(); 218 219 if (!isOfflineContext()) { 220 ASSERT(s_hardwareContextCount); 221 --s_hardwareContextCount; 222 } 206 223 207 224 // Get rid of the sources which may still be playing. -
trunk/Source/WebCore/webaudio/AudioContext.h
r90839 r90853 214 214 void fireCompletionEvent(); 215 215 216 static unsigned s_hardwareContextCount; 217 216 218 private: 217 219 AudioContext(Document*);
Note: See TracChangeset
for help on using the changeset viewer.