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

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

Issue 2103043007: Rename AbstractAudioContext to BaseAudioContext (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use ASSERT(isGraphOwner()) instead of DCHECK Created 4 years, 5 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/ActiveScriptWrappable.h" 29 #include "bindings/core/v8/ActiveScriptWrappable.h"
30 #include "modules/webaudio/AudioNode.h" 30 #include "modules/webaudio/AudioNode.h"
31 #include "platform/audio/AudioBus.h" 31 #include "platform/audio/AudioBus.h"
32 #include "wtf/Forward.h" 32 #include "wtf/Forward.h"
33 #include "wtf/PassRefPtr.h" 33 #include "wtf/PassRefPtr.h"
34 #include "wtf/RefPtr.h" 34 #include "wtf/RefPtr.h"
35 #include "wtf/Vector.h" 35 #include "wtf/Vector.h"
36 36
37 namespace blink { 37 namespace blink {
38 38
39 class AbstractAudioContext; 39 class BaseAudioContext;
40 class AudioBuffer; 40 class AudioBuffer;
41 41
42 // ScriptProcessorNode is an AudioNode which allows for arbitrary synthesis or p rocessing directly using JavaScript. 42 // ScriptProcessorNode is an AudioNode which allows for arbitrary synthesis or p rocessing directly using JavaScript.
43 // The API allows for a variable number of inputs and outputs, although it must have at least one input or output. 43 // The API allows for a variable number of inputs and outputs, although it must have at least one input or output.
44 // This basic implementation supports no more than one input and output. 44 // This basic implementation supports no more than one input and output.
45 // The "onaudioprocess" attribute is an event listener which will get called per iodically with an AudioProcessingEvent which has 45 // The "onaudioprocess" attribute is an event listener which will get called per iodically with an AudioProcessingEvent which has
46 // AudioBuffers for each input and output. 46 // AudioBuffers for each input and output.
47 47
48 class ScriptProcessorHandler final : public AudioHandler { 48 class ScriptProcessorHandler final : public AudioHandler {
49 public: 49 public:
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 USING_GARBAGE_COLLECTED_MIXIN(ScriptProcessorNode); 96 USING_GARBAGE_COLLECTED_MIXIN(ScriptProcessorNode);
97 public: 97 public:
98 // bufferSize must be one of the following values: 256, 512, 1024, 2048, 98 // bufferSize must be one of the following values: 256, 512, 1024, 2048,
99 // 4096, 8192, 16384. 99 // 4096, 8192, 16384.
100 // This value controls how frequently the onaudioprocess event handler is 100 // This value controls how frequently the onaudioprocess event handler is
101 // called and how many sample-frames need to be processed each call. 101 // called and how many sample-frames need to be processed each call.
102 // Lower numbers for bufferSize will result in a lower (better) 102 // Lower numbers for bufferSize will result in a lower (better)
103 // latency. Higher numbers will be necessary to avoid audio breakup and 103 // latency. Higher numbers will be necessary to avoid audio breakup and
104 // glitches. 104 // glitches.
105 // The value chosen must carefully balance between latency and audio quality . 105 // The value chosen must carefully balance between latency and audio quality .
106 static ScriptProcessorNode* create(AbstractAudioContext&, ExceptionState&); 106 static ScriptProcessorNode* create(BaseAudioContext&, ExceptionState&);
107 static ScriptProcessorNode* create(AbstractAudioContext&, size_t bufferSize, ExceptionState&); 107 static ScriptProcessorNode* create(BaseAudioContext&, size_t bufferSize, Exc eptionState&);
108 static ScriptProcessorNode* create(AbstractAudioContext&, size_t bufferSize, unsigned numberOfInputChannels, ExceptionState&); 108 static ScriptProcessorNode* create(BaseAudioContext&, size_t bufferSize, uns igned numberOfInputChannels, ExceptionState&);
109 static ScriptProcessorNode* create(AbstractAudioContext&, size_t bufferSize, unsigned numberOfInputChannels, unsigned numberOfOutputChannels, ExceptionState &); 109 static ScriptProcessorNode* create(BaseAudioContext&, size_t bufferSize, uns igned numberOfInputChannels, unsigned numberOfOutputChannels, ExceptionState&);
110 110
111 DEFINE_ATTRIBUTE_EVENT_LISTENER(audioprocess); 111 DEFINE_ATTRIBUTE_EVENT_LISTENER(audioprocess);
112 size_t bufferSize() const; 112 size_t bufferSize() const;
113 113
114 // ActiveScriptWrappable 114 // ActiveScriptWrappable
115 bool hasPendingActivity() const final; 115 bool hasPendingActivity() const final;
116 116
117 DEFINE_INLINE_VIRTUAL_TRACE() { AudioNode::trace(visitor); } 117 DEFINE_INLINE_VIRTUAL_TRACE() { AudioNode::trace(visitor); }
118 118
119 private: 119 private:
120 ScriptProcessorNode(AbstractAudioContext&, float sampleRate, size_t bufferSi ze, unsigned numberOfInputChannels, unsigned numberOfOutputChannels); 120 ScriptProcessorNode(BaseAudioContext&, float sampleRate, size_t bufferSize, unsigned numberOfInputChannels, unsigned numberOfOutputChannels);
121 }; 121 };
122 122
123 } // namespace blink 123 } // namespace blink
124 124
125 #endif // ScriptProcessorNode_h 125 #endif // ScriptProcessorNode_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698