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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 AudioContext* AudioContext::create(Document& document, ExceptionState& exception
State) | 82 AudioContext* AudioContext::create(Document& document, ExceptionState& exception
State) |
83 { | 83 { |
84 ASSERT(isMainThread()); | 84 ASSERT(isMainThread()); |
85 if (s_hardwareContextCount >= MaxHardwareContexts) { | 85 if (s_hardwareContextCount >= MaxHardwareContexts) { |
86 exceptionState.throwDOMException( | 86 exceptionState.throwDOMException( |
87 SyntaxError, | 87 SyntaxError, |
88 "number of hardware contexts reached maximum (" + String::number(Max
HardwareContexts) + ")."); | 88 "number of hardware contexts reached maximum (" + String::number(Max
HardwareContexts) + ")."); |
89 return 0; | 89 return 0; |
90 } | 90 } |
91 | 91 |
92 AudioContext* audioContext = adoptRefCountedGarbageCollectedWillBeNoop(new A
udioContext(&document)); | 92 AudioContext* audioContext = new AudioContext(&document); |
93 audioContext->suspendIfNeeded(); | 93 audioContext->suspendIfNeeded(); |
94 return audioContext; | 94 return audioContext; |
95 } | 95 } |
96 | 96 |
97 // Constructor for rendering to the audio hardware. | 97 // Constructor for rendering to the audio hardware. |
98 AudioContext::AudioContext(Document* document) | 98 AudioContext::AudioContext(Document* document) |
99 : ActiveDOMObject(document) | 99 : ActiveDOMObject(document) |
100 , m_isStopScheduled(false) | 100 , m_isStopScheduled(false) |
101 , m_isCleared(false) | 101 , m_isCleared(false) |
102 , m_isInitialized(false) | 102 , m_isInitialized(false) |
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
867 | 867 |
868 for (HashSet<AudioNode*>::iterator k = m_deferredCountModeChange.begin(); k
!= m_deferredCountModeChange.end(); ++k) | 868 for (HashSet<AudioNode*>::iterator k = m_deferredCountModeChange.begin(); k
!= m_deferredCountModeChange.end(); ++k) |
869 (*k)->updateChannelCountMode(); | 869 (*k)->updateChannelCountMode(); |
870 | 870 |
871 m_deferredCountModeChange.clear(); | 871 m_deferredCountModeChange.clear(); |
872 } | 872 } |
873 | 873 |
874 } // namespace blink | 874 } // namespace blink |
875 | 875 |
876 #endif // ENABLE(WEB_AUDIO) | 876 #endif // ENABLE(WEB_AUDIO) |
OLD | NEW |