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

Side by Side Diff: Source/modules/webaudio/AudioParam.cpp

Issue 927333004: Add [TypeChecking=Unrestricted] to Web Audio interfaces (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 10 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 | « Source/modules/webaudio/AudioListener.idl ('k') | Source/modules/webaudio/AudioParam.idl » ('j') | 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) 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 * 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 49
50 if (hasValue) 50 if (hasValue)
51 m_value = timelineValue; 51 m_value = timelineValue;
52 } 52 }
53 53
54 return narrowPrecisionToFloat(m_value); 54 return narrowPrecisionToFloat(m_value);
55 } 55 }
56 56
57 void AudioParam::setValue(float value) 57 void AudioParam::setValue(float value)
58 { 58 {
59 // Check against JavaScript giving us bogus floating-point values. 59 m_value = value;
60 // Don't ASSERT, since this can happen if somebody writes bad JS.
61 if (!std::isnan(value) && !std::isinf(value))
62 m_value = value;
63 } 60 }
64 61
65 float AudioParam::smoothedValue() 62 float AudioParam::smoothedValue()
66 { 63 {
67 return narrowPrecisionToFloat(m_smoothedValue); 64 return narrowPrecisionToFloat(m_smoothedValue);
68 } 65 }
69 66
70 bool AudioParam::smooth() 67 bool AudioParam::smooth()
71 { 68 {
72 // If values have been explicitly scheduled on the timeline, then use the ex act value. 69 // If values have been explicitly scheduled on the timeline, then use the ex act value.
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 if (m_outputs.contains(&output)) { 180 if (m_outputs.contains(&output)) {
184 m_outputs.remove(&output); 181 m_outputs.remove(&output);
185 changedOutputs(); 182 changedOutputs();
186 output.removeParam(*this); 183 output.removeParam(*this);
187 } 184 }
188 } 185 }
189 186
190 } // namespace blink 187 } // namespace blink
191 188
192 #endif // ENABLE(WEB_AUDIO) 189 #endif // ENABLE(WEB_AUDIO)
OLDNEW
« no previous file with comments | « Source/modules/webaudio/AudioListener.idl ('k') | Source/modules/webaudio/AudioParam.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698