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 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 | 310 |
311 // Handle Promises for resume() and suspend() | 311 // Handle Promises for resume() and suspend() |
312 void resolvePromisesForResume(); | 312 void resolvePromisesForResume(); |
313 void resolvePromisesForResumeOnMainThread(); | 313 void resolvePromisesForResumeOnMainThread(); |
314 | 314 |
315 void resolvePromisesForSuspend(); | 315 void resolvePromisesForSuspend(); |
316 void resolvePromisesForSuspendOnMainThread(); | 316 void resolvePromisesForSuspendOnMainThread(); |
317 | 317 |
318 // Vector of promises created by resume(). It takes time to handle them, so
we collect all of | 318 // Vector of promises created by resume(). It takes time to handle them, so
we collect all of |
319 // the promises here until they can be resolved or rejected. | 319 // the promises here until they can be resolved or rejected. |
320 Vector<RefPtr<ScriptPromiseResolver> > m_resumeResolvers; | 320 WillBeHeapVector<RefPtrWillBeMember<ScriptPromiseResolver> > m_resumeResolve
rs; |
321 // Like m_resumeResolvers but for suspend(). | 321 // Like m_resumeResolvers but for suspend(). |
322 Vector<RefPtr<ScriptPromiseResolver> > m_suspendResolvers; | 322 WillBeHeapVector<RefPtrWillBeMember<ScriptPromiseResolver> > m_suspendResolv
ers; |
323 void rejectPendingResolvers(); | 323 void rejectPendingResolvers(); |
324 | 324 |
325 // True if we're in the process of resolving promises for resume(). Resolvi
ng can take some | 325 // True if we're in the process of resolving promises for resume(). Resolvi
ng can take some |
326 // time and the audio context process loop is very fast, so we don't want to
call resolve an | 326 // time and the audio context process loop is very fast, so we don't want to
call resolve an |
327 // excessive number of times. | 327 // excessive number of times. |
328 bool m_isResolvingResumePromises; | 328 bool m_isResolvingResumePromises; |
329 | 329 |
330 class AudioNodeDisposer { | 330 class AudioNodeDisposer { |
331 public: | 331 public: |
332 explicit AudioNodeDisposer(AudioNode& node) : m_node(node) { } | 332 explicit AudioNodeDisposer(AudioNode& node) : m_node(node) { } |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 size_t m_cachedSampleFrame; | 406 size_t m_cachedSampleFrame; |
407 | 407 |
408 // This is considering 32 is large enough for multiple channels audio. | 408 // This is considering 32 is large enough for multiple channels audio. |
409 // It is somewhat arbitrary and could be increased if necessary. | 409 // It is somewhat arbitrary and could be increased if necessary. |
410 enum { MaxNumberOfChannels = 32 }; | 410 enum { MaxNumberOfChannels = 32 }; |
411 }; | 411 }; |
412 | 412 |
413 } // namespace blink | 413 } // namespace blink |
414 | 414 |
415 #endif // AudioContext_h | 415 #endif // AudioContext_h |
OLD | NEW |