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

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

Issue 54173005: Signal exceptions if start/stop is called out-of-order or too many times. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « Source/modules/webaudio/AudioNode.h ('k') | Source/modules/webaudio/AudioScheduledSourceNode.h » ('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 * 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 void AudioNode::initialize() 79 void AudioNode::initialize()
80 { 80 {
81 m_isInitialized = true; 81 m_isInitialized = true;
82 } 82 }
83 83
84 void AudioNode::uninitialize() 84 void AudioNode::uninitialize()
85 { 85 {
86 m_isInitialized = false; 86 m_isInitialized = false;
87 } 87 }
88 88
89 String AudioNode::nodeTypeName() const
90 {
91 switch (m_nodeType) {
92 case NodeTypeDestination:
93 return "AudioDestinationNode";
94 case NodeTypeOscillator:
95 return "OscillatorNode";
96 case NodeTypeAudioBufferSource:
97 return "AudioBufferSourceNode";
98 case NodeTypeMediaElementAudioSource:
99 return "MediaElementAudioSourceNode";
100 case NodeTypeMediaStreamAudioDestination:
101 return "MediaStreamAudioDestinationNode";
102 case NodeTypeMediaStreamAudioSource:
103 return "MediaStreamAudioSourceNode";
104 case NodeTypeJavaScript:
105 return "ScriptProcessorNode";
106 case NodeTypeBiquadFilter:
107 return "BiquadFilterNode";
108 case NodeTypePanner:
109 return "PannerNode";
110 case NodeTypeConvolver:
111 return "ConvolverNode";
112 case NodeTypeDelay:
113 return "DelayNode";
114 case NodeTypeGain:
115 return "GainNode";
116 case NodeTypeChannelSplitter:
117 return "ChannelSplitterNode";
118 case NodeTypeChannelMerger:
119 return "ChannelMergerNode";
120 case NodeTypeAnalyser:
121 return "AnalyserNode";
122 case NodeTypeDynamicsCompressor:
123 return "DynamicsCompressorNode";
124 case NodeTypeWaveShaper:
125 return "WaveShaperNode";
126 case NodeTypeUnknown:
127 case NodeTypeEnd:
128 default:
129 ASSERT_NOT_REACHED();
130 return "UnknownNode";
131 }
132 }
133
89 void AudioNode::setNodeType(NodeType type) 134 void AudioNode::setNodeType(NodeType type)
90 { 135 {
91 m_nodeType = type; 136 m_nodeType = type;
92 137
93 #if DEBUG_AUDIONODE_REFERENCES 138 #if DEBUG_AUDIONODE_REFERENCES
94 ++s_nodeCount[type]; 139 ++s_nodeCount[type];
95 #endif 140 #endif
96 } 141 }
97 142
98 void AudioNode::lazyInitialize() 143 void AudioNode::lazyInitialize()
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 fprintf(stderr, "%d: %d\n", i, s_nodeCount[i]); 624 fprintf(stderr, "%d: %d\n", i, s_nodeCount[i]);
580 625
581 fprintf(stderr, "===========================\n\n\n"); 626 fprintf(stderr, "===========================\n\n\n");
582 } 627 }
583 628
584 #endif // DEBUG_AUDIONODE_REFERENCES 629 #endif // DEBUG_AUDIONODE_REFERENCES
585 630
586 } // namespace WebCore 631 } // namespace WebCore
587 632
588 #endif // ENABLE(WEB_AUDIO) 633 #endif // ENABLE(WEB_AUDIO)
OLDNEW
« no previous file with comments | « Source/modules/webaudio/AudioNode.h ('k') | Source/modules/webaudio/AudioScheduledSourceNode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698