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

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

Issue 1952793002: Move the exception logic to the AudioNode creator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move more things to Node::create() Created 4 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 85 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&, float sampleRate, size_t bufferSize, unsigned numberOfInputChannels, unsigned numberOfOutputChanne ls); 106 static ScriptProcessorNode* create(AbstractAudioContext&, ExceptionState&);
107 static ScriptProcessorNode* create(AbstractAudioContext&, size_t bufferSize, ExceptionState&);
108 static ScriptProcessorNode* create(AbstractAudioContext&, size_t bufferSize, unsigned numberOfInputChannels, ExceptionState&);
109 static ScriptProcessorNode* create(
110 AbstractAudioContext&,
111 size_t bufferSize,
112 unsigned numberOfInputChannels,
113 unsigned numberOfOutputChannels,
114 ExceptionState&);
hongchan 2016/05/13 01:20:13 Let's make this consistent (by wrapping around 80
hongchan 2016/05/20 21:28:32 Can you take one more look on this?
Raymond Toy 2016/05/20 21:46:10 What kind of consistency? Just wrap line 108 to 8
hongchan 2016/05/20 22:57:48 Which style do you want to have here? wrapped or u
107 115
108 DEFINE_ATTRIBUTE_EVENT_LISTENER(audioprocess); 116 DEFINE_ATTRIBUTE_EVENT_LISTENER(audioprocess);
109 size_t bufferSize() const; 117 size_t bufferSize() const;
110 118
111 // ActiveScriptWrappable 119 // ActiveScriptWrappable
112 bool hasPendingActivity() const final; 120 bool hasPendingActivity() const final;
113 121
114 DEFINE_INLINE_VIRTUAL_TRACE() { AudioNode::trace(visitor); } 122 DEFINE_INLINE_VIRTUAL_TRACE() { AudioNode::trace(visitor); }
115 123
116 private: 124 private:
117 ScriptProcessorNode(AbstractAudioContext&, float sampleRate, size_t bufferSi ze, unsigned numberOfInputChannels, unsigned numberOfOutputChannels); 125 ScriptProcessorNode(AbstractAudioContext&, float sampleRate, size_t bufferSi ze, unsigned numberOfInputChannels, unsigned numberOfOutputChannels);
118 }; 126 };
119 127
120 } // namespace blink 128 } // namespace blink
121 129
122 #endif // ScriptProcessorNode_h 130 #endif // ScriptProcessorNode_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698