Changeset 155198 in webkit
- Timestamp:
- Sep 6, 2013, 11:21:35 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r155195 r155198 1 2013-09-06 Anders Carlsson <andersca@apple.com> 2 3 Stop using fastNew/fastDelete in WebCore 4 https://bugs.webkit.org/show_bug.cgi?id=120867 5 6 Reviewed by Geoffrey Garen. 7 8 Using fastNew/fastDelete can be dangerous, especially when put into a smart pointer 9 such as OwnPtr which uses regular delete. Because of this I'd like to remove fastNew/fastDelete. 10 Turns out it's only used in a couple of places in WebCore, so just use new/delete here instead. 11 12 * platform/audio/FFTFrame.h: 13 * platform/audio/gstreamer/FFTFrameGStreamer.cpp: 14 (WebCore::FFTFrame::FFTFrame): 15 (WebCore::FFTFrame::~FFTFrame): 16 (WebCore::FFTFrame::doFFT): 17 (WebCore::FFTFrame::doInverseFFT): 18 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: 19 (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase): 20 (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase): 21 * platform/graphics/gstreamer/VideoSinkGStreamer.cpp: 22 (webkitVideoSinkDispose): 23 1 24 2013-09-06 Anders Carlsson <andersca@apple.com> 2 25 -
trunk/Source/WebCore/platform/audio/FFTFrame.h
r148921 r155198 69 69 70 70 #include <wtf/Forward.h> 71 #include <wtf/PassOwnArrayPtr.h> 71 72 #include <wtf/PassOwnPtr.h> 72 73 #include <wtf/Threading.h> … … 164 165 GstFFTF32* m_fft; 165 166 GstFFTF32* m_inverseFft; 166 GstFFTF32Complex*m_complexData;167 OwnArrayPtr<GstFFTF32Complex> m_complexData; 167 168 AudioFloatArray m_realData; 168 169 AudioFloatArray m_imagData; -
trunk/Source/WebCore/platform/audio/gstreamer/FFTFrameGStreamer.cpp
r106795 r155198 43 43 : m_FFTSize(fftSize) 44 44 , m_log2FFTSize(static_cast<unsigned>(log2(fftSize))) 45 , m_complexData(adoptArrayPtr(new GstFFTF32Complex[unpackedFFTDataSize(m_FFTSize)])) 45 46 , m_realData(unpackedFFTDataSize(m_FFTSize)) 46 47 , m_imagData(unpackedFFTDataSize(m_FFTSize)) 47 48 { 48 m_complexData = WTF::fastNewArray<GstFFTF32Complex>(unpackedFFTDataSize(m_FFTSize));49 50 49 int fftLength = gst_fft_next_fast_length(m_FFTSize); 51 50 m_fft = gst_fft_f32_new(fftLength, FALSE); … … 57 56 : m_FFTSize(0) 58 57 , m_log2FFTSize(0) 59 , m_complexData(0)60 58 { 61 59 int fftLength = gst_fft_next_fast_length(m_FFTSize); … … 68 66 : m_FFTSize(frame.m_FFTSize) 69 67 , m_log2FFTSize(frame.m_log2FFTSize) 68 , m_complexData(adoptArrayPtr(new GstFFTF32Complex[unpackedFFTDataSize(m_FFTSize)])) 70 69 , m_realData(unpackedFFTDataSize(frame.m_FFTSize)) 71 70 , m_imagData(unpackedFFTDataSize(frame.m_FFTSize)) 72 71 { 73 m_complexData = WTF::fastNewArray<GstFFTF32Complex>(unpackedFFTDataSize(m_FFTSize));74 75 72 int fftLength = gst_fft_next_fast_length(m_FFTSize); 76 73 m_fft = gst_fft_f32_new(fftLength, FALSE); … … 100 97 gst_fft_f32_free(m_inverseFft); 101 98 m_inverseFft = 0; 102 103 WTF::fastDeleteArray(m_complexData);104 99 } 105 100 … … 129 124 void FFTFrame::doFFT(const float* data) 130 125 { 131 gst_fft_f32_fft(m_fft, data, m_complexData );126 gst_fft_f32_fft(m_fft, data, m_complexData.get()); 132 127 133 128 // Scale the frequency domain data to match vecLib's scale factor … … 157 152 } 158 153 159 gst_fft_f32_inverse_fft(m_inverseFft, m_complexData , data);154 gst_fft_f32_inverse_fft(m_inverseFft, m_complexData.get(), data); 160 155 161 156 // Scale so that a forward then inverse FFT yields exactly the original data. -
trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp
r154970 r155198 119 119 { 120 120 #if GLIB_CHECK_VERSION(2, 31, 0) 121 m_bufferMutex = WTF::fastNew<GMutex>();121 m_bufferMutex = new GMutex; 122 122 g_mutex_init(m_bufferMutex); 123 123 #else … … 132 132 #if GLIB_CHECK_VERSION(2, 31, 0) 133 133 g_mutex_clear(m_bufferMutex); 134 WTF::fastDelete(m_bufferMutex);134 delete m_bufferMutex; 135 135 #else 136 136 g_mutex_free(m_bufferMutex); -
trunk/Source/WebCore/platform/graphics/gstreamer/VideoSinkGStreamer.cpp
r152710 r155198 39 39 #include <gst/video/gstvideopool.h> 40 40 #endif 41 #include <wtf/ FastAllocBase.h>41 #include <wtf/OwnPtr.h> 42 42 43 43 // CAIRO_FORMAT_RGB24 used to render the video buffers is little/big endian dependant. … … 118 118 sink->priv = G_TYPE_INSTANCE_GET_PRIVATE(sink, WEBKIT_TYPE_VIDEO_SINK, WebKitVideoSinkPrivate); 119 119 #if GLIB_CHECK_VERSION(2, 31, 0) 120 sink->priv->dataCondition = WTF::fastNew<GCond>();120 sink->priv->dataCondition = new GCond; 121 121 g_cond_init(sink->priv->dataCondition); 122 sink->priv->bufferMutex = WTF::fastNew<GMutex>();122 sink->priv->bufferMutex = new GMutex; 123 123 g_mutex_init(sink->priv->bufferMutex); 124 124 #else … … 280 280 #if GLIB_CHECK_VERSION(2, 31, 0) 281 281 g_cond_clear(priv->dataCondition); 282 WTF::fastDelete(priv->dataCondition);282 delete priv->dataCondition; 283 283 #else 284 284 g_cond_free(priv->dataCondition); … … 290 290 #if GLIB_CHECK_VERSION(2, 31, 0) 291 291 g_mutex_clear(priv->bufferMutex); 292 WTF::fastDelete(priv->bufferMutex);292 delete priv->bufferMutex; 293 293 #else 294 294 g_mutex_free(priv->bufferMutex);
Note:
See TracChangeset
for help on using the changeset viewer.