| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010, Google Inc. All rights reserved. | 2 * Copyright (C) 2010, Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 } | 359 } |
| 360 | 360 |
| 361 return audioBuffer; | 361 return audioBuffer; |
| 362 } | 362 } |
| 363 | 363 |
| 364 void AudioContext::decodeAudioData(ArrayBuffer* audioData, PassOwnPtr<AudioBuffe
rCallback> successCallback, PassOwnPtr<AudioBufferCallback> errorCallback, Excep
tionState& exceptionState) | 364 void AudioContext::decodeAudioData(ArrayBuffer* audioData, PassOwnPtr<AudioBuffe
rCallback> successCallback, PassOwnPtr<AudioBufferCallback> errorCallback, Excep
tionState& exceptionState) |
| 365 { | 365 { |
| 366 if (!audioData) { | 366 if (!audioData) { |
| 367 exceptionState.throwDOMException( | 367 exceptionState.throwDOMException( |
| 368 SyntaxError, | 368 SyntaxError, |
| 369 ExceptionMessages::failedToExecute( | 369 "invalid ArrayBuffer for audioData."); |
| 370 "decodeAudioData", | |
| 371 "AudioContext", | |
| 372 "invalid ArrayBuffer for audioData.")); | |
| 373 return; | 370 return; |
| 374 } | 371 } |
| 375 m_audioDecoder.decodeAsync(audioData, sampleRate(), successCallback, errorCa
llback); | 372 m_audioDecoder.decodeAsync(audioData, sampleRate(), successCallback, errorCa
llback); |
| 376 } | 373 } |
| 377 | 374 |
| 378 PassRefPtr<AudioBufferSourceNode> AudioContext::createBufferSource() | 375 PassRefPtr<AudioBufferSourceNode> AudioContext::createBufferSource() |
| 379 { | 376 { |
| 380 ASSERT(isMainThread()); | 377 ASSERT(isMainThread()); |
| 381 lazyInitialize(); | 378 lazyInitialize(); |
| 382 RefPtr<AudioBufferSourceNode> node = AudioBufferSourceNode::create(this, m_d
estinationNode->sampleRate()); | 379 RefPtr<AudioBufferSourceNode> node = AudioBufferSourceNode::create(this, m_d
estinationNode->sampleRate()); |
| (...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1102 } | 1099 } |
| 1103 | 1100 |
| 1104 void AudioContext::decrementActiveSourceCount() | 1101 void AudioContext::decrementActiveSourceCount() |
| 1105 { | 1102 { |
| 1106 atomicDecrement(&m_activeSourceCount); | 1103 atomicDecrement(&m_activeSourceCount); |
| 1107 } | 1104 } |
| 1108 | 1105 |
| 1109 } // namespace WebCore | 1106 } // namespace WebCore |
| 1110 | 1107 |
| 1111 #endif // ENABLE(WEB_AUDIO) | 1108 #endif // ENABLE(WEB_AUDIO) |
| OLD | NEW |