Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(675)

Side by Side Diff: third_party/WebKit/Source/modules/webaudio/BaseAudioContext.h

Issue 2793593002: AudioWorklet prototype
Patch Set: Rebase after ThreadedWorkletMessaginProxy change Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 18 matching lines...) Expand all
29 #include "bindings/core/v8/ScriptPromise.h" 29 #include "bindings/core/v8/ScriptPromise.h"
30 #include "bindings/core/v8/ScriptPromiseResolver.h" 30 #include "bindings/core/v8/ScriptPromiseResolver.h"
31 #include "core/dom/ArrayBufferViewHelpers.h" 31 #include "core/dom/ArrayBufferViewHelpers.h"
32 #include "core/dom/DOMTypedArray.h" 32 #include "core/dom/DOMTypedArray.h"
33 #include "core/dom/SuspendableObject.h" 33 #include "core/dom/SuspendableObject.h"
34 #include "core/events/EventListener.h" 34 #include "core/events/EventListener.h"
35 #include "modules/EventTargetModules.h" 35 #include "modules/EventTargetModules.h"
36 #include "modules/ModulesExport.h" 36 #include "modules/ModulesExport.h"
37 #include "modules/webaudio/AsyncAudioDecoder.h" 37 #include "modules/webaudio/AsyncAudioDecoder.h"
38 #include "modules/webaudio/AudioDestinationNode.h" 38 #include "modules/webaudio/AudioDestinationNode.h"
39 #include "modules/webaudio/AudioWorklet.h"
40 #include "modules/webaudio/AudioWorkletMessagingProxy.h"
41 #include "modules/webaudio/AudioWorkletThread.h"
39 #include "modules/webaudio/DeferredTaskHandler.h" 42 #include "modules/webaudio/DeferredTaskHandler.h"
40 #include "modules/webaudio/IIRFilterNode.h" 43 #include "modules/webaudio/IIRFilterNode.h"
44 #include "modules/webaudio/WindowAudioWorklet.h"
41 #include "platform/audio/AudioBus.h" 45 #include "platform/audio/AudioBus.h"
42 #include "platform/bindings/ActiveScriptWrappable.h" 46 #include "platform/bindings/ActiveScriptWrappable.h"
43 #include "platform/heap/Handle.h" 47 #include "platform/heap/Handle.h"
44 #include "platform/wtf/HashSet.h" 48 #include "platform/wtf/HashSet.h"
45 #include "platform/wtf/RefPtr.h" 49 #include "platform/wtf/RefPtr.h"
46 #include "platform/wtf/Threading.h" 50 #include "platform/wtf/Threading.h"
47 #include "platform/wtf/Vector.h" 51 #include "platform/wtf/Vector.h"
48 #include "platform/wtf/build_config.h" 52 #include "platform/wtf/build_config.h"
49 53
54
50 namespace blink { 55 namespace blink {
51 56
52 class AnalyserNode; 57 class AnalyserNode;
53 class AudioBuffer; 58 class AudioBuffer;
54 class AudioBufferCallback; 59 class AudioBufferCallback;
55 class AudioBufferSourceNode; 60 class AudioBufferSourceNode;
56 class AudioContextOptions; 61 class AudioContextOptions;
57 class AudioListener; 62 class AudioListener;
63 class AudioWorkletMessagingProxy;
58 class BaseAudioContextTest; 64 class BaseAudioContextTest;
59 class BiquadFilterNode; 65 class BiquadFilterNode;
60 class ChannelMergerNode; 66 class ChannelMergerNode;
61 class ChannelSplitterNode; 67 class ChannelSplitterNode;
62 class ConstantSourceNode; 68 class ConstantSourceNode;
63 class ConvolverNode; 69 class ConvolverNode;
64 class DelayNode; 70 class DelayNode;
65 class Document; 71 class Document;
66 class DynamicsCompressorNode; 72 class DynamicsCompressorNode;
67 class ExceptionState; 73 class ExceptionState;
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 330
325 // Get the PeriodicWave for the specified oscillator type. The table is 331 // Get the PeriodicWave for the specified oscillator type. The table is
326 // initialized internally if necessary. 332 // initialized internally if necessary.
327 PeriodicWave* GetPeriodicWave(int type); 333 PeriodicWave* GetPeriodicWave(int type);
328 334
329 // For metrics purpose, records when start() is called on a 335 // For metrics purpose, records when start() is called on a
330 // AudioScheduledSourceHandler or a AudioBufferSourceHandler without a user 336 // AudioScheduledSourceHandler or a AudioBufferSourceHandler without a user
331 // gesture while the AudioContext requires a user gesture. 337 // gesture while the AudioContext requires a user gesture.
332 void MaybeRecordStartAttempt(); 338 void MaybeRecordStartAttempt();
333 339
340 AudioWorklet* GetAudioWorklet();
341 AudioWorkletMessagingProxy* GetWorkletMessagingProxy();
342 WebThreadSupportingGC* GetRenderingThread();
343
334 protected: 344 protected:
335 explicit BaseAudioContext(Document*); 345 explicit BaseAudioContext(Document*);
336 BaseAudioContext(Document*, 346 BaseAudioContext(Document*,
337 unsigned number_of_channels, 347 unsigned number_of_channels,
338 size_t number_of_frames, 348 size_t number_of_frames,
339 float sample_rate); 349 float sample_rate);
340 350
341 void Initialize(); 351 void Initialize();
342 void Uninitialize(); 352 void Uninitialize();
343 353
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 Member<PeriodicWave> periodic_wave_square_; 485 Member<PeriodicWave> periodic_wave_square_;
476 Member<PeriodicWave> periodic_wave_sawtooth_; 486 Member<PeriodicWave> periodic_wave_sawtooth_;
477 Member<PeriodicWave> periodic_wave_triangle_; 487 Member<PeriodicWave> periodic_wave_triangle_;
478 488
479 // This is considering 32 is large enough for multiple channels audio. 489 // This is considering 32 is large enough for multiple channels audio.
480 // It is somewhat arbitrary and could be increased if necessary. 490 // It is somewhat arbitrary and could be increased if necessary.
481 enum { kMaxNumberOfChannels = 32 }; 491 enum { kMaxNumberOfChannels = 32 };
482 492
483 Optional<AutoplayStatus> autoplay_status_; 493 Optional<AutoplayStatus> autoplay_status_;
484 AudioIOPosition output_position_; 494 AudioIOPosition output_position_;
495
496 AudioWorkletMessagingProxy* worklet_messaging_proxy_;
485 }; 497 };
486 498
487 } // namespace blink 499 } // namespace blink
488 500
489 #endif // BaseAudioContext_h 501 #endif // BaseAudioContext_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698