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

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

Issue 906233002: Use nullptr instead of 0 in WebAudio (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 5 years, 9 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/PeriodicWave.cpp ('k') | Source/platform/audio/AudioArray.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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 break; 66 break;
67 case 256: 67 case 256:
68 case 512: 68 case 512:
69 case 1024: 69 case 1024:
70 case 2048: 70 case 2048:
71 case 4096: 71 case 4096:
72 case 8192: 72 case 8192:
73 case 16384: 73 case 16384:
74 break; 74 break;
75 default: 75 default:
76 return 0; 76 return nullptr;
77 } 77 }
78 78
79 if (!numberOfInputChannels && !numberOfOutputChannels) 79 if (!numberOfInputChannels && !numberOfOutputChannels)
80 return 0; 80 return nullptr;
81 81
82 if (numberOfInputChannels > AudioContext::maxNumberOfChannels()) 82 if (numberOfInputChannels > AudioContext::maxNumberOfChannels())
83 return 0; 83 return nullptr;
84 84
85 if (numberOfOutputChannels > AudioContext::maxNumberOfChannels()) 85 if (numberOfOutputChannels > AudioContext::maxNumberOfChannels())
86 return 0; 86 return nullptr;
87 87
88 return new ScriptProcessorNode(context, sampleRate, bufferSize, numberOfInpu tChannels, numberOfOutputChannels); 88 return new ScriptProcessorNode(context, sampleRate, bufferSize, numberOfInpu tChannels, numberOfOutputChannels);
89 } 89 }
90 90
91 ScriptProcessorNode::ScriptProcessorNode(AudioContext* context, float sampleRate , size_t bufferSize, unsigned numberOfInputChannels, unsigned numberOfOutputChan nels) 91 ScriptProcessorNode::ScriptProcessorNode(AudioContext* context, float sampleRate , size_t bufferSize, unsigned numberOfInputChannels, unsigned numberOfOutputChan nels)
92 : AudioNode(NodeTypeJavaScript, context, sampleRate) 92 : AudioNode(NodeTypeJavaScript, context, sampleRate)
93 , m_doubleBufferIndex(0) 93 , m_doubleBufferIndex(0)
94 , m_doubleBufferIndexForEvent(0) 94 , m_doubleBufferIndexForEvent(0)
95 , m_bufferSize(bufferSize) 95 , m_bufferSize(bufferSize)
96 , m_bufferReadWriteIndex(0) 96 , m_bufferReadWriteIndex(0)
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 DEFINE_TRACE(ScriptProcessorNode) 302 DEFINE_TRACE(ScriptProcessorNode)
303 { 303 {
304 visitor->trace(m_inputBuffers); 304 visitor->trace(m_inputBuffers);
305 visitor->trace(m_outputBuffers); 305 visitor->trace(m_outputBuffers);
306 AudioNode::trace(visitor); 306 AudioNode::trace(visitor);
307 } 307 }
308 308
309 } // namespace blink 309 } // namespace blink
310 310
311 #endif // ENABLE(WEB_AUDIO) 311 #endif // ENABLE(WEB_AUDIO)
OLDNEW
« no previous file with comments | « Source/modules/webaudio/PeriodicWave.cpp ('k') | Source/platform/audio/AudioArray.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698