2011-05-10 Ilya Tikhonovsky <loislo@chromium.org>
authorloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 11 May 2011 06:03:27 +0000 (06:03 +0000)
committerloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 11 May 2011 06:03:27 +0000 (06:03 +0000)
        Unreviewed buildfix for strict OwnPtr.

        * platform/audio/AudioBus.cpp:
        (WebCore::AudioBus::createBufferFromRange):
        (WebCore::AudioBus::createBySampleRateConverting):
        (WebCore::AudioBus::createByMixingToMono):
        * platform/audio/HRTFElevation.cpp:
        (WebCore::HRTFElevation::createForSubject):
        (WebCore::HRTFElevation::createByInterpolatingSlices):
        * platform/audio/Panner.cpp:
        (WebCore::Panner::create):
        * platform/audio/Reverb.cpp:
        (WebCore::Reverb::initialize):
        * platform/audio/chromium/AudioBusChromium.cpp:
        (WebCore::AudioBus::loadPlatformResource):
        (WebCore::createBusFromInMemoryAudioFile):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@86217 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/audio/AudioBus.cpp
Source/WebCore/platform/audio/HRTFElevation.cpp
Source/WebCore/platform/audio/Panner.cpp
Source/WebCore/platform/audio/Reverb.cpp
Source/WebCore/platform/audio/chromium/AudioBusChromium.cpp

index f57cdac..18cb1f8 100644 (file)
@@ -1,3 +1,22 @@
+2011-05-10  Ilya Tikhonovsky  <loislo@chromium.org>
+
+        Unreviewed buildfix for strict OwnPtr.
+
+        * platform/audio/AudioBus.cpp:
+        (WebCore::AudioBus::createBufferFromRange):
+        (WebCore::AudioBus::createBySampleRateConverting):
+        (WebCore::AudioBus::createByMixingToMono):
+        * platform/audio/HRTFElevation.cpp:
+        (WebCore::HRTFElevation::createForSubject):
+        (WebCore::HRTFElevation::createByInterpolatingSlices):
+        * platform/audio/Panner.cpp:
+        (WebCore::Panner::create):
+        * platform/audio/Reverb.cpp:
+        (WebCore::Reverb::initialize):
+        * platform/audio/chromium/AudioBusChromium.cpp:
+        (WebCore::AudioBus::loadPlatformResource):
+        (WebCore::createBusFromInMemoryAudioFile):
+
 2011-05-10  Adam Barth  <abarth@webkit.org>
 
         Build fix for font data madness.  I've had to whitelist this on several
index ecedfd1..36a5e63 100644 (file)
@@ -152,7 +152,7 @@ PassOwnPtr<AudioBus> AudioBus::createBufferFromRange(AudioBus* sourceBuffer, uns
     bool isRangeSafe = startFrame < endFrame && endFrame <= numberOfSourceFrames;
     ASSERT(isRangeSafe);
     if (!isRangeSafe)
-        return 0;
+        return nullptr;
 
     size_t rangeLength = endFrame - startFrame;
 
@@ -369,7 +369,7 @@ PassOwnPtr<AudioBus> AudioBus::createBySampleRateConverting(AudioBus* sourceBus,
     // sourceBus's sample-rate must be known.
     ASSERT(sourceBus && sourceBus->sampleRate());
     if (!sourceBus || !sourceBus->sampleRate())
-        return 0;
+        return nullptr;
 
     double sourceSampleRate = sourceBus->sampleRate();
     double destinationSampleRate = newSampleRate;
@@ -446,7 +446,7 @@ PassOwnPtr<AudioBus> AudioBus::createByMixingToMono(AudioBus* sourceBus)
     }
 
     ASSERT_NOT_REACHED();
-    return 0;
+    return nullptr;
 }
 
 } // WebCore
index 06d03ea..b0db862 100644 (file)
@@ -163,7 +163,7 @@ PassOwnPtr<HRTFElevation> HRTFElevation::createForSubject(const String& subjectN
     bool isElevationGood = elevation >= -45 && elevation <= 90 && (elevation / 15) * 15 == elevation;
     ASSERT(isElevationGood);
     if (!isElevationGood)
-        return 0;
+        return nullptr;
         
     OwnPtr<HRTFKernelList> kernelListL = adoptPtr(new HRTFKernelList(NumberOfTotalAzimuths));
     OwnPtr<HRTFKernelList> kernelListR = adoptPtr(new HRTFKernelList(NumberOfTotalAzimuths));
@@ -177,7 +177,7 @@ PassOwnPtr<HRTFElevation> HRTFElevation::createForSubject(const String& subjectN
 
         bool success = calculateKernelsForAzimuthElevation(rawIndex * AzimuthSpacing, actualElevation, sampleRate, subjectName, kernelListL->at(interpolatedIndex), kernelListR->at(interpolatedIndex));
         if (!success)
-            return 0;
+            return nullptr;
             
         interpolatedIndex += InterpolationFactor;
     }
@@ -203,7 +203,7 @@ PassOwnPtr<HRTFElevation> HRTFElevation::createByInterpolatingSlices(HRTFElevati
 {
     ASSERT(hrtfElevation1 && hrtfElevation2);
     if (!hrtfElevation1 || !hrtfElevation2)
-        return 0;
+        return nullptr;
         
     ASSERT(x >= 0.0 && x < 1.0);
     
index 5e8efca..d3d1a2a 100644 (file)
@@ -55,7 +55,7 @@ PassOwnPtr<Panner> Panner::create(PanningModel model, double sampleRate)
     case PanningModelSoundField:
     default:
         ASSERT_NOT_REACHED();
-        return 0;
+        return nullptr;
     }
 
     return panner.release();
index e59ff46..b6204ff 100644 (file)
@@ -121,7 +121,7 @@ void Reverb::initialize(AudioBus* impulseResponseBuffer, size_t renderSliceSize,
     // For "True" stereo processing we allocate a temporary buffer to avoid repeatedly allocating it in the process() method.
     // It can be bad to allocate memory in a real-time thread.
     if (numResponseChannels == 4)
-        m_tempBuffer = new AudioBus(2, MaxFrameSize);
+        m_tempBuffer = adoptPtr(new AudioBus(2, MaxFrameSize));
 }
 
 void Reverb::process(AudioBus* sourceBus, AudioBus* destinationBus, size_t framesToProcess)
index f34dc77..cc5b4fd 100644 (file)
@@ -39,7 +39,7 @@ PassOwnPtr<AudioBus> AudioBus::loadPlatformResource(const char* name, double sam
     // FIXME: the sampleRate parameter is ignored. It should be removed from the API.
     OwnPtr<AudioBus> audioBus = PlatformBridge::loadPlatformAudioResource(name, sampleRate);
     if (!audioBus.get())
-        return 0;
+        return nullptr;
     
     // If the bus is already at the requested sample-rate then return as is.
     if (audioBus->sampleRate() == sampleRate)
@@ -53,7 +53,7 @@ PassOwnPtr<AudioBus> createBusFromInMemoryAudioFile(const void* data, size_t dat
     // FIXME: the sampleRate parameter is ignored. It should be removed from the API.
     OwnPtr<AudioBus> audioBus = PlatformBridge::decodeAudioFileData(static_cast<const char*>(data), dataSize, sampleRate);
     if (!audioBus.get())
-      return 0;
+        return nullptr;
       
     // If the bus needs no conversion then return as is.
     if ((!mixToMono || audioBus->numberOfChannels() == 1) && audioBus->sampleRate() == sampleRate)