| 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 12 matching lines...) Expand all Loading... |
| 23 */ | 23 */ |
| 24 | 24 |
| 25 #include "config.h" | 25 #include "config.h" |
| 26 | 26 |
| 27 #if ENABLE(WEB_AUDIO) | 27 #if ENABLE(WEB_AUDIO) |
| 28 | 28 |
| 29 #include "modules/webaudio/AudioBufferSourceNode.h" | 29 #include "modules/webaudio/AudioBufferSourceNode.h" |
| 30 | 30 |
| 31 #include "bindings/core/v8/ExceptionState.h" | 31 #include "bindings/core/v8/ExceptionState.h" |
| 32 #include "core/dom/ExceptionCode.h" | 32 #include "core/dom/ExceptionCode.h" |
| 33 #include "core/frame/UseCounter.h" |
| 33 #include "platform/audio/AudioUtilities.h" | 34 #include "platform/audio/AudioUtilities.h" |
| 34 #include "modules/webaudio/AudioContext.h" | 35 #include "modules/webaudio/AudioContext.h" |
| 35 #include "modules/webaudio/AudioNodeOutput.h" | 36 #include "modules/webaudio/AudioNodeOutput.h" |
| 36 #include "platform/FloatConversion.h" | 37 #include "platform/FloatConversion.h" |
| 37 #include "wtf/MainThread.h" | 38 #include "wtf/MainThread.h" |
| 38 #include "wtf/MathExtras.h" | 39 #include "wtf/MathExtras.h" |
| 39 #include <algorithm> | 40 #include <algorithm> |
| 40 | 41 |
| 41 namespace blink { | 42 namespace blink { |
| 42 | 43 |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 m_virtualReadIndex = virtualReadIndex; | 334 m_virtualReadIndex = virtualReadIndex; |
| 334 | 335 |
| 335 return true; | 336 return true; |
| 336 } | 337 } |
| 337 | 338 |
| 338 | 339 |
| 339 void AudioBufferSourceNode::setBuffer(AudioBuffer* buffer, ExceptionState& excep
tionState) | 340 void AudioBufferSourceNode::setBuffer(AudioBuffer* buffer, ExceptionState& excep
tionState) |
| 340 { | 341 { |
| 341 ASSERT(isMainThread()); | 342 ASSERT(isMainThread()); |
| 342 | 343 |
| 344 if (m_buffer) { |
| 345 // Setting the buffer more than once is deprecated. Change this to a DO
M exception in M45 |
| 346 // or so. |
| 347 UseCounter::countDeprecation(context()->executionContext(), UseCounter::
AudioBufferSourceBufferOnce); |
| 348 } |
| 349 |
| 343 // The context must be locked since changing the buffer can re-configure the
number of channels that are output. | 350 // The context must be locked since changing the buffer can re-configure the
number of channels that are output. |
| 344 AudioContext::AutoLocker contextLocker(context()); | 351 AudioContext::AutoLocker contextLocker(context()); |
| 345 | 352 |
| 346 // This synchronizes with process(). | 353 // This synchronizes with process(). |
| 347 MutexLocker processLocker(m_processLock); | 354 MutexLocker processLocker(m_processLock); |
| 348 | 355 |
| 349 if (buffer) { | 356 if (buffer) { |
| 350 // Do any necesssary re-configuration to the buffer's number of channels
. | 357 // Do any necesssary re-configuration to the buffer's number of channels
. |
| 351 unsigned numberOfChannels = buffer->numberOfChannels(); | 358 unsigned numberOfChannels = buffer->numberOfChannels(); |
| 352 | 359 |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 { | 523 { |
| 517 visitor->trace(m_buffer); | 524 visitor->trace(m_buffer); |
| 518 visitor->trace(m_playbackRate); | 525 visitor->trace(m_playbackRate); |
| 519 visitor->trace(m_pannerNode); | 526 visitor->trace(m_pannerNode); |
| 520 AudioScheduledSourceNode::trace(visitor); | 527 AudioScheduledSourceNode::trace(visitor); |
| 521 } | 528 } |
| 522 | 529 |
| 523 } // namespace blink | 530 } // namespace blink |
| 524 | 531 |
| 525 #endif // ENABLE(WEB_AUDIO) | 532 #endif // ENABLE(WEB_AUDIO) |
| OLD | NEW |