| 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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 // - it has been stopped by its execution context. | 255 // - it has been stopped by its execution context. |
| 256 virtual bool isContextClosed() const { return m_isCleared; } | 256 virtual bool isContextClosed() const { return m_isCleared; } |
| 257 | 257 |
| 258 // Get the security origin for this audio context. | 258 // Get the security origin for this audio context. |
| 259 SecurityOrigin* getSecurityOrigin() const; | 259 SecurityOrigin* getSecurityOrigin() const; |
| 260 | 260 |
| 261 // Get the PeriodicWave for the specified oscillator type. The table is ini
tialized internally | 261 // Get the PeriodicWave for the specified oscillator type. The table is ini
tialized internally |
| 262 // if necessary. | 262 // if necessary. |
| 263 PeriodicWave* periodicWave(int type); | 263 PeriodicWave* periodicWave(int type); |
| 264 | 264 |
| 265 // Check whether the AudioContext requires a user gesture and whether the | 265 // Called by AudioContext nodes to start the AudioContext when it is |
| 266 // current stack is processing user gesture and record these information in | 266 // suspended because of gesture requirement. |
| 267 // a histogram. | 267 // It will be a no-op if: |
| 268 void recordUserGestureState(); | 268 // - no user gesture is required, or |
| 269 // - a user gesture is required but none was provided. |
| 270 void startRenderingIfNeeded(); |
| 269 | 271 |
| 270 protected: | 272 protected: |
| 271 explicit BaseAudioContext(Document*); | 273 explicit BaseAudioContext(Document*); |
| 272 BaseAudioContext(Document*, unsigned numberOfChannels, size_t numberOfFrames
, float sampleRate); | 274 BaseAudioContext(Document*, unsigned numberOfChannels, size_t numberOfFrames
, float sampleRate); |
| 273 | 275 |
| 274 void initialize(); | 276 void initialize(); |
| 275 void uninitialize(); | 277 void uninitialize(); |
| 276 | 278 |
| 277 void setContextState(AudioContextState); | 279 void setContextState(AudioContextState); |
| 278 | 280 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 Member<PeriodicWave> m_periodicWaveTriangle; | 375 Member<PeriodicWave> m_periodicWaveTriangle; |
| 374 | 376 |
| 375 // This is considering 32 is large enough for multiple channels audio. | 377 // This is considering 32 is large enough for multiple channels audio. |
| 376 // It is somewhat arbitrary and could be increased if necessary. | 378 // It is somewhat arbitrary and could be increased if necessary. |
| 377 enum { MaxNumberOfChannels = 32 }; | 379 enum { MaxNumberOfChannels = 32 }; |
| 378 }; | 380 }; |
| 379 | 381 |
| 380 } // namespace blink | 382 } // namespace blink |
| 381 | 383 |
| 382 #endif // BaseAudioContext_h | 384 #endif // BaseAudioContext_h |
| OLD | NEW |