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

Unified Diff: Source/modules/webaudio/AudioBuffer.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/modules/webaudio/AudioContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webaudio/AudioBuffer.cpp
diff --git a/Source/modules/webaudio/AudioBuffer.cpp b/Source/modules/webaudio/AudioBuffer.cpp
index 91f1526937124c09a7b7feb13d14bad070840909..4c42b3aee381d6691ec9de8262f9c6b13adf1796 100644
--- a/Source/modules/webaudio/AudioBuffer.cpp
+++ b/Source/modules/webaudio/AudioBuffer.cpp
@@ -46,12 +46,12 @@ namespace blink {
AudioBuffer* AudioBuffer::create(unsigned numberOfChannels, size_t numberOfFrames, float sampleRate)
{
if (!AudioUtilities::isValidAudioBufferSampleRate(sampleRate) || numberOfChannels > AudioContext::maxNumberOfChannels() || !numberOfChannels || !numberOfFrames)
- return 0;
+ return nullptr;
AudioBuffer* buffer = new AudioBuffer(numberOfChannels, numberOfFrames, sampleRate);
if (!buffer->createdSuccessfully(numberOfChannels))
- return 0;
+ return nullptr;
return buffer;
}
@@ -67,7 +67,7 @@ AudioBuffer* AudioBuffer::create(unsigned numberOfChannels, size_t numberOfFrame
ExceptionMessages::InclusiveBound,
AudioContext::maxNumberOfChannels(),
ExceptionMessages::InclusiveBound));
- return 0;
+ return nullptr;
}
if (!AudioUtilities::isValidAudioBufferSampleRate(sampleRate)) {
@@ -80,7 +80,7 @@ AudioBuffer* AudioBuffer::create(unsigned numberOfChannels, size_t numberOfFrame
ExceptionMessages::InclusiveBound,
AudioUtilities::maxAudioBufferSampleRate(),
ExceptionMessages::InclusiveBound));
- return 0;
+ return nullptr;
}
if (!numberOfFrames) {
@@ -90,7 +90,7 @@ AudioBuffer* AudioBuffer::create(unsigned numberOfChannels, size_t numberOfFrame
"number of frames",
numberOfFrames,
static_cast<size_t>(0)));
- return 0;
+ return nullptr;
}
AudioBuffer* audioBuffer = create(numberOfChannels, numberOfFrames, sampleRate);
@@ -117,17 +117,17 @@ AudioBuffer* AudioBuffer::createFromAudioFileData(const void* data, size_t dataS
return buffer;
}
- return 0;
+ return nullptr;
}
AudioBuffer* AudioBuffer::createFromAudioBus(AudioBus* bus)
{
if (!bus)
- return 0;
+ return nullptr;
AudioBuffer* buffer = new AudioBuffer(bus);
if (buffer->createdSuccessfully(bus->numberOfChannels()))
return buffer;
- return 0;
+ return nullptr;
}
bool AudioBuffer::createdSuccessfully(unsigned desiredNumberOfChannels) const
@@ -188,7 +188,7 @@ PassRefPtr<DOMFloat32Array> AudioBuffer::getChannelData(unsigned channelIndex, E
DOMFloat32Array* AudioBuffer::getChannelData(unsigned channelIndex)
{
if (channelIndex >= m_channels.size())
- return 0;
+ return nullptr;
return m_channels[channelIndex].get();
}
« no previous file with comments | « no previous file | Source/modules/webaudio/AudioContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698