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

Side by Side Diff: Source/modules/webaudio/DelayNode.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
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 22 matching lines...) Expand all
33 #include "core/dom/ExceptionCode.h" 33 #include "core/dom/ExceptionCode.h"
34 #include "wtf/MathExtras.h" 34 #include "wtf/MathExtras.h"
35 35
36 namespace blink { 36 namespace blink {
37 37
38 const double maximumAllowedDelayTime = 180; 38 const double maximumAllowedDelayTime = 180;
39 39
40 DelayNode::DelayNode(AudioContext* context, float sampleRate, double maxDelayTim e, ExceptionState& exceptionState) 40 DelayNode::DelayNode(AudioContext* context, float sampleRate, double maxDelayTim e, ExceptionState& exceptionState)
41 : AudioBasicProcessorNode(NodeTypeDelay, context, sampleRate) 41 : AudioBasicProcessorNode(NodeTypeDelay, context, sampleRate)
42 { 42 {
43 if (maxDelayTime <= 0 || maxDelayTime >= maximumAllowedDelayTime || std::isn an(maxDelayTime)) { 43 if (maxDelayTime <= 0 || maxDelayTime >= maximumAllowedDelayTime) {
44 exceptionState.throwDOMException( 44 exceptionState.throwDOMException(
45 NotSupportedError, 45 NotSupportedError,
46 "max delay time (" + String::number(maxDelayTime) 46 "max delay time (" + String::number(maxDelayTime)
47 + ") must be between 0 and " + String::number(maximumAllowedDelayTim e) 47 + ") must be between 0 and " + String::number(maximumAllowedDelayTim e)
48 + ", exclusive."); 48 + ", exclusive.");
49 return; 49 return;
50 } 50 }
51 m_processor = new DelayProcessor(context, sampleRate, 1, maxDelayTime); 51 m_processor = new DelayProcessor(context, sampleRate, 1, maxDelayTime);
52 } 52 }
53 53
54 AudioParam* DelayNode::delayTime() 54 AudioParam* DelayNode::delayTime()
55 { 55 {
56 return delayProcessor()->delayTime(); 56 return delayProcessor()->delayTime();
57 } 57 }
58 58
59 } // namespace blink 59 } // namespace blink
60 60
61 #endif // ENABLE(WEB_AUDIO) 61 #endif // ENABLE(WEB_AUDIO)
OLDNEW
« no previous file with comments | « Source/modules/webaudio/AudioScheduledSourceNode.cpp ('k') | Source/modules/webaudio/OscillatorNode.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698