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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 virtual const AtomicString& interfaceName() const override final; | 215 virtual const AtomicString& interfaceName() const override final; |
216 virtual ExecutionContext* executionContext() const override final; | 216 virtual ExecutionContext* executionContext() const override final; |
217 | 217 |
218 DEFINE_ATTRIBUTE_EVENT_LISTENER(complete); | 218 DEFINE_ATTRIBUTE_EVENT_LISTENER(complete); |
219 DEFINE_ATTRIBUTE_EVENT_LISTENER(statechange); | 219 DEFINE_ATTRIBUTE_EVENT_LISTENER(statechange); |
220 | 220 |
221 void startRendering(); | 221 void startRendering(); |
222 void fireCompletionEvent(); | 222 void fireCompletionEvent(); |
223 void notifyStateChange(); | 223 void notifyStateChange(); |
224 | 224 |
225 // A context is considered closed if closeContext() has been called, even if
the audio HW has | 225 // A context is considered closed if: |
226 // not yet been stopped. It will be stopped eventually. | 226 // - closeContext() has been called, even if the audio HW has not yet been |
227 bool isContextClosed() const { return m_closeResolver; } | 227 // stopped. It will be stopped eventually. |
| 228 // - it has been stopped (or is stopping) by its execution context. |
| 229 bool isContextClosed() const { return m_closeResolver || m_isStopScheduled |
| m_isCleared; } |
228 | 230 |
229 static unsigned s_hardwareContextCount; | 231 static unsigned s_hardwareContextCount; |
230 static unsigned s_contextId; | 232 static unsigned s_contextId; |
231 | 233 |
232 // Get the security origin for this audio context. | 234 // Get the security origin for this audio context. |
233 SecurityOrigin* securityOrigin() const; | 235 SecurityOrigin* securityOrigin() const; |
234 | 236 |
235 protected: | 237 protected: |
236 explicit AudioContext(Document*); | 238 explicit AudioContext(Document*); |
237 AudioContext(Document*, unsigned numberOfChannels, size_t numberOfFrames, fl
oat sampleRate); | 239 AudioContext(Document*, unsigned numberOfChannels, size_t numberOfFrames, fl
oat sampleRate); |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 // This is considering 32 is large enough for multiple channels audio. | 326 // This is considering 32 is large enough for multiple channels audio. |
325 // It is somewhat arbitrary and could be increased if necessary. | 327 // It is somewhat arbitrary and could be increased if necessary. |
326 enum { MaxNumberOfChannels = 32 }; | 328 enum { MaxNumberOfChannels = 32 }; |
327 | 329 |
328 unsigned m_contextId; | 330 unsigned m_contextId; |
329 }; | 331 }; |
330 | 332 |
331 } // namespace blink | 333 } // namespace blink |
332 | 334 |
333 #endif // AudioContext_h | 335 #endif // AudioContext_h |
OLD | NEW |