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

Side by Side Diff: Source/modules/webaudio/OscillatorNode.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, 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) 2012, Google Inc. All rights reserved. 2 * Copyright (C) 2012, 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 else if (type == "square") 105 else if (type == "square")
106 setType(SQUARE); 106 setType(SQUARE);
107 else if (type == "sawtooth") 107 else if (type == "sawtooth")
108 setType(SAWTOOTH); 108 setType(SAWTOOTH);
109 else if (type == "triangle") 109 else if (type == "triangle")
110 setType(TRIANGLE); 110 setType(TRIANGLE);
111 } 111 }
112 112
113 bool OscillatorNode::setType(unsigned type) 113 bool OscillatorNode::setType(unsigned type)
114 { 114 {
115 PeriodicWave* periodicWave = 0; 115 PeriodicWave* periodicWave = nullptr;
116 float sampleRate = this->sampleRate(); 116 float sampleRate = this->sampleRate();
117 117
118 switch (type) { 118 switch (type) {
119 case SINE: { 119 case SINE: {
120 DEFINE_STATIC_LOCAL(Persistent<PeriodicWave>, periodicWaveSine, (Periodi cWave::createSine(sampleRate))); 120 DEFINE_STATIC_LOCAL(Persistent<PeriodicWave>, periodicWaveSine, (Periodi cWave::createSine(sampleRate)));
121 periodicWave = periodicWaveSine; 121 periodicWave = periodicWaveSine;
122 break; 122 break;
123 } 123 }
124 case SQUARE: { 124 case SQUARE: {
125 DEFINE_STATIC_LOCAL(Persistent<PeriodicWave>, periodicWaveSquare, (Perio dicWave::createSquare(sampleRate))); 125 DEFINE_STATIC_LOCAL(Persistent<PeriodicWave>, periodicWaveSquare, (Perio dicWave::createSquare(sampleRate)));
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 { 346 {
347 visitor->trace(m_frequency); 347 visitor->trace(m_frequency);
348 visitor->trace(m_detune); 348 visitor->trace(m_detune);
349 visitor->trace(m_periodicWave); 349 visitor->trace(m_periodicWave);
350 AudioScheduledSourceNode::trace(visitor); 350 AudioScheduledSourceNode::trace(visitor);
351 } 351 }
352 352
353 } // namespace blink 353 } // namespace blink
354 354
355 #endif // ENABLE(WEB_AUDIO) 355 #endif // ENABLE(WEB_AUDIO)
OLDNEW
« no previous file with comments | « Source/modules/webaudio/OfflineAudioContext.cpp ('k') | Source/modules/webaudio/PeriodicWave.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698