| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "modules/webaudio/AudioContext.h" | 5 #include "modules/webaudio/AudioContext.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/ExceptionMessages.h" | 7 #include "bindings/core/v8/ExceptionMessages.h" |
| 8 #include "bindings/core/v8/ExceptionState.h" | 8 #include "bindings/core/v8/ExceptionState.h" |
| 9 #include "bindings/core/v8/ScriptPromiseResolver.h" | 9 #include "bindings/core/v8/ScriptPromiseResolver.h" |
| 10 #include "core/dom/DOMException.h" | 10 #include "core/dom/DOMException.h" |
| 11 #include "core/dom/ExceptionCode.h" | 11 #include "core/dom/ExceptionCode.h" |
| 12 #include "platform/audio/AudioUtilities.h" | 12 #include "platform/audio/AudioUtilities.h" |
| 13 | 13 |
| 14 #if DEBUG_AUDIONODE_REFERENCES | 14 #if DEBUG_AUDIONODE_REFERENCES |
| 15 #include <stdio.h> | 15 #include <stdio.h> |
| 16 #endif | 16 #endif |
| 17 | 17 |
| 18 #if ENABLE(WEB_AUDIO) | |
| 19 | |
| 20 namespace blink { | 18 namespace blink { |
| 21 | 19 |
| 22 // Don't allow more than this number of simultaneous AudioContexts | 20 // Don't allow more than this number of simultaneous AudioContexts |
| 23 // talking to hardware. | 21 // talking to hardware. |
| 24 const unsigned MaxHardwareContexts = 6; | 22 const unsigned MaxHardwareContexts = 6; |
| 25 static unsigned s_hardwareContextCount = 0; | 23 static unsigned s_hardwareContextCount = 0; |
| 26 static unsigned s_contextId = 0; | 24 static unsigned s_contextId = 0; |
| 27 | 25 |
| 28 AbstractAudioContext* AudioContext::create(Document& document, ExceptionState& e
xceptionState) | 26 AbstractAudioContext* AudioContext::create(Document& document, ExceptionState& e
xceptionState) |
| 29 { | 27 { |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 | 188 |
| 191 if (contextState() == Running) { | 189 if (contextState() == Running) { |
| 192 destination()->audioDestinationHandler().stopRendering(); | 190 destination()->audioDestinationHandler().stopRendering(); |
| 193 setContextState(Suspended); | 191 setContextState(Suspended); |
| 194 deferredTaskHandler().clearHandlersToBeDeleted(); | 192 deferredTaskHandler().clearHandlersToBeDeleted(); |
| 195 } | 193 } |
| 196 } | 194 } |
| 197 | 195 |
| 198 } // namespace blink | 196 } // namespace blink |
| 199 | 197 |
| 200 #endif // ENABLE(WEB_AUDIO) | |
| OLD | NEW |