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

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

Issue 2872553004: Rename kNodeTypeJavaScript to kNodeTypeScriptProcessor (Closed)
Patch Set: Created 3 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 case kNodeTypeOscillator: 120 case kNodeTypeOscillator:
121 return "OscillatorNode"; 121 return "OscillatorNode";
122 case kNodeTypeAudioBufferSource: 122 case kNodeTypeAudioBufferSource:
123 return "AudioBufferSourceNode"; 123 return "AudioBufferSourceNode";
124 case kNodeTypeMediaElementAudioSource: 124 case kNodeTypeMediaElementAudioSource:
125 return "MediaElementAudioSourceNode"; 125 return "MediaElementAudioSourceNode";
126 case kNodeTypeMediaStreamAudioDestination: 126 case kNodeTypeMediaStreamAudioDestination:
127 return "MediaStreamAudioDestinationNode"; 127 return "MediaStreamAudioDestinationNode";
128 case kNodeTypeMediaStreamAudioSource: 128 case kNodeTypeMediaStreamAudioSource:
129 return "MediaStreamAudioSourceNode"; 129 return "MediaStreamAudioSourceNode";
130 case kNodeTypeJavaScript: 130 case kNodeTypeScriptProcessor:
131 return "ScriptProcessorNode"; 131 return "ScriptProcessorNode";
132 case kNodeTypeBiquadFilter: 132 case kNodeTypeBiquadFilter:
133 return "BiquadFilterNode"; 133 return "BiquadFilterNode";
134 case kNodeTypePanner: 134 case kNodeTypePanner:
135 return "PannerNode"; 135 return "PannerNode";
136 case kNodeTypeStereoPanner: 136 case kNodeTypeStereoPanner:
137 return "StereoPannerNode"; 137 return "StereoPannerNode";
138 case kNodeTypeConvolver: 138 case kNodeTypeConvolver:
139 return "ConvolverNode"; 139 return "ConvolverNode";
140 case kNodeTypeDelay: 140 case kNodeTypeDelay:
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
634 exception_state.ThrowDOMException( 634 exception_state.ThrowDOMException(
635 kInvalidAccessError, 635 kInvalidAccessError,
636 "cannot connect to a destination " 636 "cannot connect to a destination "
637 "belonging to a different audio context."); 637 "belonging to a different audio context.");
638 return nullptr; 638 return nullptr;
639 } 639 }
640 640
641 // ScriptProcessorNodes with 0 output channels can't be connected to any 641 // ScriptProcessorNodes with 0 output channels can't be connected to any
642 // destination. If there are no output channels, what would the destination 642 // destination. If there are no output channels, what would the destination
643 // receive? Just disallow this. 643 // receive? Just disallow this.
644 if (Handler().GetNodeType() == AudioHandler::kNodeTypeJavaScript && 644 if (Handler().GetNodeType() == AudioHandler::kNodeTypeScriptProcessor &&
645 Handler().NumberOfOutputChannels() == 0) { 645 Handler().NumberOfOutputChannels() == 0) {
646 exception_state.ThrowDOMException(kInvalidAccessError, 646 exception_state.ThrowDOMException(kInvalidAccessError,
647 "cannot connect a ScriptProcessorNode " 647 "cannot connect a ScriptProcessorNode "
648 "with 0 output channels to any " 648 "with 0 output channels to any "
649 "destination node."); 649 "destination node.");
650 return nullptr; 650 return nullptr;
651 } 651 }
652 652
653 destination->Handler() 653 destination->Handler()
654 .Input(input_index) 654 .Input(input_index)
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
968 } 968 }
969 969
970 void AudioNode::DidAddOutput(unsigned number_of_outputs) { 970 void AudioNode::DidAddOutput(unsigned number_of_outputs) {
971 connected_nodes_.push_back(nullptr); 971 connected_nodes_.push_back(nullptr);
972 DCHECK_EQ(number_of_outputs, connected_nodes_.size()); 972 DCHECK_EQ(number_of_outputs, connected_nodes_.size());
973 connected_params_.push_back(nullptr); 973 connected_params_.push_back(nullptr);
974 DCHECK_EQ(number_of_outputs, connected_params_.size()); 974 DCHECK_EQ(number_of_outputs, connected_params_.size());
975 } 975 }
976 976
977 } // namespace blink 977 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698