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

Side by Side Diff: third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.cpp

Issue 1897293002: Throw error if timeConstant is not positive for setTargetAtTime (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « third_party/WebKit/LayoutTests/webaudio/audioparam-exceptional-values-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 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 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 } 172 }
173 173
174 insertEvent(ParamEvent::createExponentialRampEvent(value, time), exceptionSt ate); 174 insertEvent(ParamEvent::createExponentialRampEvent(value, time), exceptionSt ate);
175 } 175 }
176 176
177 void AudioParamTimeline::setTargetAtTime(float target, double time, double timeC onstant, ExceptionState& exceptionState) 177 void AudioParamTimeline::setTargetAtTime(float target, double time, double timeC onstant, ExceptionState& exceptionState)
178 { 178 {
179 ASSERT(isMainThread()); 179 ASSERT(isMainThread());
180 180
181 if (!isNonNegativeAudioParamTime(time, exceptionState) 181 if (!isNonNegativeAudioParamTime(time, exceptionState)
182 || !isNonNegativeAudioParamTime(timeConstant, exceptionState, "Time cons tant")) 182 || !isPositiveAudioParamTime(timeConstant, exceptionState, "Time constan t"))
183 return; 183 return;
184 184
185 insertEvent(ParamEvent::createSetTargetEvent(target, time, timeConstant), ex ceptionState); 185 insertEvent(ParamEvent::createSetTargetEvent(target, time, timeConstant), ex ceptionState);
186 } 186 }
187 187
188 void AudioParamTimeline::setValueCurveAtTime(DOMFloat32Array* curve, double time , double duration, ExceptionState& exceptionState) 188 void AudioParamTimeline::setValueCurveAtTime(DOMFloat32Array* curve, double time , double duration, ExceptionState& exceptionState)
189 { 189 {
190 ASSERT(isMainThread()); 190 ASSERT(isMainThread());
191 ASSERT(curve); 191 ASSERT(curve);
192 192
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after
806 for (; writeIndex < numberOfValues; ++writeIndex) 806 for (; writeIndex < numberOfValues; ++writeIndex)
807 values[writeIndex] = value; 807 values[writeIndex] = value;
808 808
809 // This value is used to set the .value attribute of the AudioParam. it sho uld be the last 809 // This value is used to set the .value attribute of the AudioParam. it sho uld be the last
810 // computed value. 810 // computed value.
811 return values[numberOfValues - 1]; 811 return values[numberOfValues - 1];
812 } 812 }
813 813
814 } // namespace blink 814 } // namespace blink
815 815
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/webaudio/audioparam-exceptional-values-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698