| 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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 // Returns true if this thread owns the context's lock. | 230 // Returns true if this thread owns the context's lock. |
| 231 bool isGraphOwner() { return deferredTaskHandler().isGraphOwner(); } | 231 bool isGraphOwner() { return deferredTaskHandler().isGraphOwner(); } |
| 232 #endif | 232 #endif |
| 233 using AutoLocker = DeferredTaskHandler::AutoLocker; | 233 using AutoLocker = DeferredTaskHandler::AutoLocker; |
| 234 | 234 |
| 235 // Returns the maximum numuber of channels we can support. | 235 // Returns the maximum numuber of channels we can support. |
| 236 static unsigned maxNumberOfChannels() { return MaxNumberOfChannels;} | 236 static unsigned maxNumberOfChannels() { return MaxNumberOfChannels;} |
| 237 | 237 |
| 238 // EventTarget | 238 // EventTarget |
| 239 const AtomicString& interfaceName() const final; | 239 const AtomicString& interfaceName() const final; |
| 240 ExecutionContext* executionContext() const final; | 240 ExecutionContext* getExecutionContext() const final; |
| 241 | 241 |
| 242 DEFINE_ATTRIBUTE_EVENT_LISTENER(statechange); | 242 DEFINE_ATTRIBUTE_EVENT_LISTENER(statechange); |
| 243 | 243 |
| 244 void startRendering(); | 244 void startRendering(); |
| 245 void notifyStateChange(); | 245 void notifyStateChange(); |
| 246 | 246 |
| 247 // A context is considered closed if: | 247 // A context is considered closed if: |
| 248 // - closeContext() has been called. | 248 // - closeContext() has been called. |
| 249 // - it has been stopped by its execution context. | 249 // - it has been stopped by its execution context. |
| 250 virtual bool isContextClosed() const { return m_isCleared; } | 250 virtual bool isContextClosed() const { return m_isCleared; } |
| 251 | 251 |
| 252 // Get the security origin for this audio context. | 252 // Get the security origin for this audio context. |
| 253 SecurityOrigin* securityOrigin() const; | 253 SecurityOrigin* getSecurityOrigin() const; |
| 254 | 254 |
| 255 // Get the PeriodicWave for the specified oscillator type. The table is ini
tialized internally | 255 // Get the PeriodicWave for the specified oscillator type. The table is ini
tialized internally |
| 256 // if necessary. | 256 // if necessary. |
| 257 PeriodicWave* periodicWave(int type); | 257 PeriodicWave* periodicWave(int type); |
| 258 protected: | 258 protected: |
| 259 explicit AbstractAudioContext(Document*); | 259 explicit AbstractAudioContext(Document*); |
| 260 AbstractAudioContext(Document*, unsigned numberOfChannels, size_t numberOfFr
ames, float sampleRate); | 260 AbstractAudioContext(Document*, unsigned numberOfChannels, size_t numberOfFr
ames, float sampleRate); |
| 261 | 261 |
| 262 void initialize(); | 262 void initialize(); |
| 263 void uninitialize(); | 263 void uninitialize(); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 Member<PeriodicWave> m_periodicWaveTriangle; | 348 Member<PeriodicWave> m_periodicWaveTriangle; |
| 349 | 349 |
| 350 // This is considering 32 is large enough for multiple channels audio. | 350 // This is considering 32 is large enough for multiple channels audio. |
| 351 // It is somewhat arbitrary and could be increased if necessary. | 351 // It is somewhat arbitrary and could be increased if necessary. |
| 352 enum { MaxNumberOfChannels = 32 }; | 352 enum { MaxNumberOfChannels = 32 }; |
| 353 }; | 353 }; |
| 354 | 354 |
| 355 } // namespace blink | 355 } // namespace blink |
| 356 | 356 |
| 357 #endif // AbstractAudioContext_h | 357 #endif // AbstractAudioContext_h |
| OLD | NEW |