| 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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 // - closeContext() has been called. | 253 // - closeContext() has been called. |
| 254 // - it has been stopped by its execution context. | 254 // - it has been stopped by its execution context. |
| 255 virtual bool isContextClosed() const { return m_isCleared; } | 255 virtual bool isContextClosed() const { return m_isCleared; } |
| 256 | 256 |
| 257 // Get the security origin for this audio context. | 257 // Get the security origin for this audio context. |
| 258 SecurityOrigin* getSecurityOrigin() const; | 258 SecurityOrigin* getSecurityOrigin() const; |
| 259 | 259 |
| 260 // Get the PeriodicWave for the specified oscillator type. The table is ini
tialized internally | 260 // Get the PeriodicWave for the specified oscillator type. The table is ini
tialized internally |
| 261 // if necessary. | 261 // if necessary. |
| 262 PeriodicWave* periodicWave(int type); | 262 PeriodicWave* periodicWave(int type); |
| 263 |
| 264 // Check whether the AudioContext requires a user gesture and whether the |
| 265 // current stack is processing user gesture and record these information in |
| 266 // a histogram. |
| 267 void recordUserGestureState(); |
| 268 |
| 263 protected: | 269 protected: |
| 264 explicit AbstractAudioContext(Document*); | 270 explicit AbstractAudioContext(Document*); |
| 265 AbstractAudioContext(Document*, unsigned numberOfChannels, size_t numberOfFr
ames, float sampleRate); | 271 AbstractAudioContext(Document*, unsigned numberOfChannels, size_t numberOfFr
ames, float sampleRate); |
| 266 | 272 |
| 267 void initialize(); | 273 void initialize(); |
| 268 void uninitialize(); | 274 void uninitialize(); |
| 269 | 275 |
| 270 void setContextState(AudioContextState); | 276 void setContextState(AudioContextState); |
| 271 | 277 |
| 272 virtual void didClose() {} | 278 virtual void didClose() {} |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 void resolvePromisesForResumeOnMainThread(); | 336 void resolvePromisesForResumeOnMainThread(); |
| 331 | 337 |
| 332 // When the context is going away, reject any pending script promise resolve
rs. | 338 // When the context is going away, reject any pending script promise resolve
rs. |
| 333 virtual void rejectPendingResolvers(); | 339 virtual void rejectPendingResolvers(); |
| 334 | 340 |
| 335 // True if we're in the process of resolving promises for resume(). Resolvi
ng can take some | 341 // True if we're in the process of resolving promises for resume(). Resolvi
ng can take some |
| 336 // time and the audio context process loop is very fast, so we don't want to
call resolve an | 342 // time and the audio context process loop is very fast, so we don't want to
call resolve an |
| 337 // excessive number of times. | 343 // excessive number of times. |
| 338 bool m_isResolvingResumePromises; | 344 bool m_isResolvingResumePromises; |
| 339 | 345 |
| 346 // Whether a user gesture is required to start this AudioContext. |
| 347 bool m_userGestureRequired; |
| 348 |
| 340 unsigned m_connectionCount; | 349 unsigned m_connectionCount; |
| 341 | 350 |
| 342 // Graph locking. | 351 // Graph locking. |
| 343 RefPtr<DeferredTaskHandler> m_deferredTaskHandler; | 352 RefPtr<DeferredTaskHandler> m_deferredTaskHandler; |
| 344 | 353 |
| 345 // The state of the AbstractAudioContext. | 354 // The state of the AbstractAudioContext. |
| 346 AudioContextState m_contextState; | 355 AudioContextState m_contextState; |
| 347 | 356 |
| 348 AsyncAudioDecoder m_audioDecoder; | 357 AsyncAudioDecoder m_audioDecoder; |
| 349 | 358 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 365 Member<PeriodicWave> m_periodicWaveTriangle; | 374 Member<PeriodicWave> m_periodicWaveTriangle; |
| 366 | 375 |
| 367 // This is considering 32 is large enough for multiple channels audio. | 376 // This is considering 32 is large enough for multiple channels audio. |
| 368 // It is somewhat arbitrary and could be increased if necessary. | 377 // It is somewhat arbitrary and could be increased if necessary. |
| 369 enum { MaxNumberOfChannels = 32 }; | 378 enum { MaxNumberOfChannels = 32 }; |
| 370 }; | 379 }; |
| 371 | 380 |
| 372 } // namespace blink | 381 } // namespace blink |
| 373 | 382 |
| 374 #endif // AbstractAudioContext_h | 383 #endif // AbstractAudioContext_h |
| OLD | NEW |