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 19 matching lines...) Expand all Loading... |
30 #include "bindings/core/v8/ScriptPromiseResolver.h" | 30 #include "bindings/core/v8/ScriptPromiseResolver.h" |
31 #include "core/dom/SuspendableObject.h" | 31 #include "core/dom/SuspendableObject.h" |
32 #include "core/events/EventListener.h" | 32 #include "core/events/EventListener.h" |
33 #include "core/html/media/AutoplayPolicy.h" | 33 #include "core/html/media/AutoplayPolicy.h" |
34 #include "core/typed_arrays/ArrayBufferViewHelpers.h" | 34 #include "core/typed_arrays/ArrayBufferViewHelpers.h" |
35 #include "core/typed_arrays/DOMTypedArray.h" | 35 #include "core/typed_arrays/DOMTypedArray.h" |
36 #include "modules/EventTargetModules.h" | 36 #include "modules/EventTargetModules.h" |
37 #include "modules/ModulesExport.h" | 37 #include "modules/ModulesExport.h" |
38 #include "modules/webaudio/AsyncAudioDecoder.h" | 38 #include "modules/webaudio/AsyncAudioDecoder.h" |
39 #include "modules/webaudio/AudioDestinationNode.h" | 39 #include "modules/webaudio/AudioDestinationNode.h" |
| 40 #include "modules/webaudio/AudioWorklet.h" |
| 41 #include "modules/webaudio/AudioWorkletMessagingProxy.h" |
| 42 #include "modules/webaudio/AudioWorkletThread.h" |
40 #include "modules/webaudio/DeferredTaskHandler.h" | 43 #include "modules/webaudio/DeferredTaskHandler.h" |
41 #include "modules/webaudio/IIRFilterNode.h" | 44 #include "modules/webaudio/IIRFilterNode.h" |
| 45 #include "modules/webaudio/WindowAudioWorklet.h" |
42 #include "platform/audio/AudioBus.h" | 46 #include "platform/audio/AudioBus.h" |
43 #include "platform/bindings/ActiveScriptWrappable.h" | 47 #include "platform/bindings/ActiveScriptWrappable.h" |
44 #include "platform/bindings/TraceWrapperMember.h" | 48 #include "platform/bindings/TraceWrapperMember.h" |
45 #include "platform/heap/Handle.h" | 49 #include "platform/heap/Handle.h" |
46 #include "platform/wtf/HashSet.h" | 50 #include "platform/wtf/HashSet.h" |
47 #include "platform/wtf/RefPtr.h" | 51 #include "platform/wtf/RefPtr.h" |
48 #include "platform/wtf/Threading.h" | 52 #include "platform/wtf/Threading.h" |
49 #include "platform/wtf/Vector.h" | 53 #include "platform/wtf/Vector.h" |
50 #include "platform/wtf/build_config.h" | 54 #include "platform/wtf/build_config.h" |
51 | 55 |
| 56 |
52 namespace blink { | 57 namespace blink { |
53 | 58 |
54 class AnalyserNode; | 59 class AnalyserNode; |
55 class AudioBuffer; | 60 class AudioBuffer; |
56 class AudioBufferSourceNode; | 61 class AudioBufferSourceNode; |
57 class AudioContextOptions; | 62 class AudioContextOptions; |
58 class AudioListener; | 63 class AudioListener; |
| 64 class AudioWorkletMessagingProxy; |
| 65 class BaseAudioContextTest; |
59 class BiquadFilterNode; | 66 class BiquadFilterNode; |
60 class ChannelMergerNode; | 67 class ChannelMergerNode; |
61 class ChannelSplitterNode; | 68 class ChannelSplitterNode; |
62 class ConstantSourceNode; | 69 class ConstantSourceNode; |
63 class ConvolverNode; | 70 class ConvolverNode; |
64 class DelayNode; | 71 class DelayNode; |
65 class DecodeErrorCallback; | 72 class DecodeErrorCallback; |
66 class DecodeSuccessCallback; | 73 class DecodeSuccessCallback; |
67 class Document; | 74 class Document; |
68 class DynamicsCompressorNode; | 75 class DynamicsCompressorNode; |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 | 334 |
328 // Get the PeriodicWave for the specified oscillator type. The table is | 335 // Get the PeriodicWave for the specified oscillator type. The table is |
329 // initialized internally if necessary. | 336 // initialized internally if necessary. |
330 PeriodicWave* GetPeriodicWave(int type); | 337 PeriodicWave* GetPeriodicWave(int type); |
331 | 338 |
332 // For metrics purpose, records when start() is called on a | 339 // For metrics purpose, records when start() is called on a |
333 // AudioScheduledSourceHandler or a AudioBufferSourceHandler without a user | 340 // AudioScheduledSourceHandler or a AudioBufferSourceHandler without a user |
334 // gesture while the AudioContext requires a user gesture. | 341 // gesture while the AudioContext requires a user gesture. |
335 void MaybeRecordStartAttempt(); | 342 void MaybeRecordStartAttempt(); |
336 | 343 |
| 344 AudioWorklet* GetAudioWorklet(); |
| 345 AudioWorkletMessagingProxy* GetWorkletMessagingProxy(); |
| 346 WebThreadSupportingGC* GetRenderingThread(); |
| 347 |
337 protected: | 348 protected: |
338 explicit BaseAudioContext(Document*); | 349 explicit BaseAudioContext(Document*); |
339 BaseAudioContext(Document*, | 350 BaseAudioContext(Document*, |
340 unsigned number_of_channels, | 351 unsigned number_of_channels, |
341 size_t number_of_frames, | 352 size_t number_of_frames, |
342 float sample_rate); | 353 float sample_rate); |
343 | 354 |
344 void Initialize(); | 355 void Initialize(); |
345 void Uninitialize(); | 356 void Uninitialize(); |
346 | 357 |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 Member<PeriodicWave> periodic_wave_square_; | 514 Member<PeriodicWave> periodic_wave_square_; |
504 Member<PeriodicWave> periodic_wave_sawtooth_; | 515 Member<PeriodicWave> periodic_wave_sawtooth_; |
505 Member<PeriodicWave> periodic_wave_triangle_; | 516 Member<PeriodicWave> periodic_wave_triangle_; |
506 | 517 |
507 // This is considering 32 is large enough for multiple channels audio. | 518 // This is considering 32 is large enough for multiple channels audio. |
508 // It is somewhat arbitrary and could be increased if necessary. | 519 // It is somewhat arbitrary and could be increased if necessary. |
509 enum { kMaxNumberOfChannels = 32 }; | 520 enum { kMaxNumberOfChannels = 32 }; |
510 | 521 |
511 Optional<AutoplayStatus> autoplay_status_; | 522 Optional<AutoplayStatus> autoplay_status_; |
512 AudioIOPosition output_position_; | 523 AudioIOPosition output_position_; |
| 524 |
| 525 Member<AudioWorkletMessagingProxy> worklet_messaging_proxy_; |
513 }; | 526 }; |
514 | 527 |
515 } // namespace blink | 528 } // namespace blink |
516 | 529 |
517 #endif // BaseAudioContext_h | 530 #endif // BaseAudioContext_h |
OLD | NEW |