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

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

Issue 2866503002: Revert removal of AudioBufferCallback (Closed)
Patch Set: Add AudioBufferCallback.{h,idl} Created 3 years, 7 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 #include "platform/wtf/HashSet.h" 44 #include "platform/wtf/HashSet.h"
45 #include "platform/wtf/RefPtr.h" 45 #include "platform/wtf/RefPtr.h"
46 #include "platform/wtf/Threading.h" 46 #include "platform/wtf/Threading.h"
47 #include "platform/wtf/Vector.h" 47 #include "platform/wtf/Vector.h"
48 #include "platform/wtf/build_config.h" 48 #include "platform/wtf/build_config.h"
49 49
50 namespace blink { 50 namespace blink {
51 51
52 class AnalyserNode; 52 class AnalyserNode;
53 class AudioBuffer; 53 class AudioBuffer;
54 class AudioBufferCallback;
54 class AudioBufferSourceNode; 55 class AudioBufferSourceNode;
55 class AudioContextOptions; 56 class AudioContextOptions;
56 class AudioListener; 57 class AudioListener;
57 class BaseAudioContextTest; 58 class BaseAudioContextTest;
58 class BiquadFilterNode; 59 class BiquadFilterNode;
59 class ChannelMergerNode; 60 class ChannelMergerNode;
60 class ChannelSplitterNode; 61 class ChannelSplitterNode;
61 class ConstantSourceNode; 62 class ConstantSourceNode;
62 class ConvolverNode; 63 class ConvolverNode;
63 class DelayNode; 64 class DelayNode;
64 class DecodeErrorCallback;
65 class DecodeSuccessCallback;
66 class Document; 65 class Document;
67 class DynamicsCompressorNode; 66 class DynamicsCompressorNode;
68 class ExceptionState; 67 class ExceptionState;
69 class GainNode; 68 class GainNode;
70 class HTMLMediaElement; 69 class HTMLMediaElement;
71 class IIRFilterNode; 70 class IIRFilterNode;
72 class MediaElementAudioSourceNode; 71 class MediaElementAudioSourceNode;
73 class MediaStream; 72 class MediaStream;
74 class MediaStreamAudioDestinationNode; 73 class MediaStreamAudioDestinationNode;
75 class MediaStreamAudioSourceNode; 74 class MediaStreamAudioSourceNode;
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 void ThrowExceptionForClosedState(ExceptionState&); 162 void ThrowExceptionForClosedState(ExceptionState&);
164 163
165 AudioBuffer* createBuffer(unsigned number_of_channels, 164 AudioBuffer* createBuffer(unsigned number_of_channels,
166 size_t number_of_frames, 165 size_t number_of_frames,
167 float sample_rate, 166 float sample_rate,
168 ExceptionState&); 167 ExceptionState&);
169 168
170 // Asynchronous audio file data decoding. 169 // Asynchronous audio file data decoding.
171 ScriptPromise decodeAudioData(ScriptState*, 170 ScriptPromise decodeAudioData(ScriptState*,
172 DOMArrayBuffer* audio_data, 171 DOMArrayBuffer* audio_data,
173 DecodeSuccessCallback*, 172 AudioBufferCallback* success_callback,
174 DecodeErrorCallback*, 173 AudioBufferCallback* error_callback,
175 ExceptionState&);
176
177 ScriptPromise decodeAudioData(ScriptState*,
178 DOMArrayBuffer* audio_data,
179 ExceptionState&);
180
181 ScriptPromise decodeAudioData(ScriptState*,
182 DOMArrayBuffer* audio_data,
183 DecodeSuccessCallback*,
184 ExceptionState&); 174 ExceptionState&);
185 175
186 // Handles the promise and callbacks when |decodeAudioData| is finished 176 // Handles the promise and callbacks when |decodeAudioData| is finished
187 // decoding. 177 // decoding.
188 void HandleDecodeAudioData(AudioBuffer*, 178 void HandleDecodeAudioData(AudioBuffer*,
189 ScriptPromiseResolver*, 179 ScriptPromiseResolver*,
190 DecodeSuccessCallback*, 180 AudioBufferCallback* success_callback,
191 DecodeErrorCallback*); 181 AudioBufferCallback* error_callback);
192 182
193 AudioListener* listener() { return listener_; } 183 AudioListener* listener() { return listener_; }
194 184
195 virtual bool HasRealtimeConstraint() = 0; 185 virtual bool HasRealtimeConstraint() = 0;
196 186
197 // The AudioNode create methods are called on the main thread (from 187 // The AudioNode create methods are called on the main thread (from
198 // JavaScript). 188 // JavaScript).
199 AudioBufferSourceNode* createBufferSource(ExceptionState&); 189 AudioBufferSourceNode* createBufferSource(ExceptionState&);
200 ConstantSourceNode* createConstantSource(ExceptionState&); 190 ConstantSourceNode* createConstantSource(ExceptionState&);
201 MediaElementAudioSourceNode* createMediaElementSource(HTMLMediaElement*, 191 MediaElementAudioSourceNode* createMediaElementSource(HTMLMediaElement*,
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 // It is somewhat arbitrary and could be increased if necessary. 480 // It is somewhat arbitrary and could be increased if necessary.
491 enum { kMaxNumberOfChannels = 32 }; 481 enum { kMaxNumberOfChannels = 32 };
492 482
493 Optional<AutoplayStatus> autoplay_status_; 483 Optional<AutoplayStatus> autoplay_status_;
494 AudioIOPosition output_position_; 484 AudioIOPosition output_position_;
495 }; 485 };
496 486
497 } // namespace blink 487 } // namespace blink
498 488
499 #endif // BaseAudioContext_h 489 #endif // BaseAudioContext_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/webaudio/BUILD.gn ('k') | third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698