Replace use of OwnArrayPtr<Foo> with std::unique_ptr<Foo[]> in WebCore
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Sep 2013 00:15:13 +0000 (00:15 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Sep 2013 00:15:13 +0000 (00:15 +0000)
https://bugs.webkit.org/show_bug.cgi?id=121527

Reviewed by Anders Carlsson.

* Modules/webaudio/AudioBufferSourceNode.cpp:
(WebCore::AudioBufferSourceNode::setBuffer):
* Modules/webaudio/AudioBufferSourceNode.h:
* Modules/webaudio/OscillatorNode.h:
* css/CSSParser.cpp:
(WebCore::CSSParser::setupParser):
(WebCore::CSSParser::currentCharacter16):
* css/CSSParser.h:
* html/HTMLAreaElement.h:
* html/HTMLFrameSetElement.h:
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::copyTexSubImage2D):
(WebCore::WebGLRenderingContext::simulateVertexAttrib0):
(WebCore::WebGLRenderingContext::LRUImageBufferCache::LRUImageBufferCache):
* html/canvas/WebGLRenderingContext.h:
* platform/ScrollAnimatorNone.cpp:
* platform/audio/DynamicsCompressor.cpp:
(WebCore::DynamicsCompressor::setNumberOfChannels):
* platform/audio/DynamicsCompressor.h:
* platform/audio/FFTFrame.h:
* platform/audio/gstreamer/FFTFrameGStreamer.cpp:
(WebCore::FFTFrame::FFTFrame):
* platform/efl/ScrollbarEfl.cpp:
(ScrollbarEfl::updateThumbPositionAndProportion):
* platform/graphics/ANGLEWebKitBridge.cpp:
(WebCore::ANGLEWebKitBridge::compileShaderSource):
* platform/graphics/GraphicsContext3D.cpp:
(WebCore::GraphicsContext3D::texImage2DResourceSafe):
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/GraphicsContext3DPrivate.cpp:
(WebCore::GraphicsContext3DPrivate::paintToTextureMapper):
* platform/graphics/blackberry/LayerTexture.cpp:
* platform/graphics/ca/win/CACFLayerTreeHost.cpp:
(WebCore::getDirtyRects):
* platform/graphics/cg/GraphicsContext3DCG.cpp:
(WebCore::GraphicsContext3D::ImageExtractor::extractImage):
* platform/graphics/cg/GraphicsContextCG.cpp:
* platform/graphics/cg/ImageBufferCG.cpp:
* platform/graphics/gpu/Texture.cpp:
(WebCore::Texture::updateSubRect):
* platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
(WebCore::HarfBuzzShaper::HarfBuzzShaper):
(WebCore::HarfBuzzShaper::setNormalizedBuffer):
* platform/graphics/harfbuzz/HarfBuzzShaper.h:
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):
(WebCore::GraphicsContext3D::compileShader):
(WebCore::GraphicsContext3D::getActiveAttrib):
(WebCore::GraphicsContext3D::getActiveUniform):
(WebCore::GraphicsContext3D::getProgramInfoLog):
(WebCore::GraphicsContext3D::getShaderInfoLog):
* platform/graphics/opentype/OpenTypeSanitizer.cpp:
* platform/graphics/texmap/TextureMapperGL.cpp:
* platform/graphics/wince/SharedBitmap.cpp:
(WebCore::SharedBitmap::SharedBitmap):
(WebCore::SharedBitmap::to16bit):
* platform/graphics/wince/SharedBitmap.h:
* platform/image-decoders/blackberry/JPEGImageDecoder.cpp:
(WebCore::ImageReader::decode):
* platform/image-decoders/png/PNGImageDecoder.cpp:
(WebCore::PNGImageReader::createRowBuffer):
* platform/win/ContextMenuWin.cpp:
(WebCore::ContextMenu::getContextMenuItems):
* platform/win/LoggingWin.cpp:
(WebCore::logLevelString):
* plugins/PluginPackage.cpp:
* plugins/blackberry/PluginViewBlackBerry.cpp:
(WebCore::PluginView::handleTouchEvent):
* plugins/win/PluginPackageWin.cpp:
(WebCore::PluginPackage::fetchInfo):

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

40 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/webaudio/AudioBufferSourceNode.cpp
Source/WebCore/Modules/webaudio/AudioBufferSourceNode.h
Source/WebCore/Modules/webaudio/OscillatorNode.h
Source/WebCore/css/CSSParser.cpp
Source/WebCore/css/CSSParser.h
Source/WebCore/html/HTMLAreaElement.h
Source/WebCore/html/HTMLFrameSetElement.h
Source/WebCore/html/canvas/WebGLRenderingContext.cpp
Source/WebCore/html/canvas/WebGLRenderingContext.h
Source/WebCore/platform/ScrollAnimatorNone.cpp
Source/WebCore/platform/audio/DynamicsCompressor.cpp
Source/WebCore/platform/audio/DynamicsCompressor.h
Source/WebCore/platform/audio/FFTFrame.h
Source/WebCore/platform/audio/gstreamer/FFTFrameGStreamer.cpp
Source/WebCore/platform/efl/ScrollbarEfl.cpp
Source/WebCore/platform/graphics/ANGLEWebKitBridge.cpp
Source/WebCore/platform/graphics/GraphicsContext3D.cpp
Source/WebCore/platform/graphics/GraphicsContext3D.h
Source/WebCore/platform/graphics/GraphicsContext3DPrivate.cpp
Source/WebCore/platform/graphics/blackberry/LayerTexture.cpp
Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.cpp
Source/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp
Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp
Source/WebCore/platform/graphics/gpu/Texture.cpp
Source/WebCore/platform/graphics/harfbuzz/HarfBuzzShaper.cpp
Source/WebCore/platform/graphics/harfbuzz/HarfBuzzShaper.h
Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp
Source/WebCore/platform/graphics/opentype/OpenTypeSanitizer.cpp
Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp
Source/WebCore/platform/graphics/wince/SharedBitmap.cpp
Source/WebCore/platform/graphics/wince/SharedBitmap.h
Source/WebCore/platform/image-decoders/blackberry/JPEGImageDecoder.cpp
Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp
Source/WebCore/platform/win/ContextMenuWin.cpp
Source/WebCore/platform/win/LoggingWin.cpp
Source/WebCore/plugins/PluginPackage.cpp
Source/WebCore/plugins/blackberry/PluginViewBlackBerry.cpp
Source/WebCore/plugins/win/PluginPackageWin.cpp

index 0858dcf..5b49ea0 100644 (file)
@@ -1,3 +1,81 @@
+2013-09-17  Sam Weinig  <sam@webkit.org>
+
+        Replace use of OwnArrayPtr<Foo> with std::unique_ptr<Foo[]> in WebCore
+        https://bugs.webkit.org/show_bug.cgi?id=121527
+
+        Reviewed by Anders Carlsson.
+
+        * Modules/webaudio/AudioBufferSourceNode.cpp:
+        (WebCore::AudioBufferSourceNode::setBuffer):
+        * Modules/webaudio/AudioBufferSourceNode.h:
+        * Modules/webaudio/OscillatorNode.h:
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::setupParser):
+        (WebCore::CSSParser::currentCharacter16):
+        * css/CSSParser.h:
+        * html/HTMLAreaElement.h:
+        * html/HTMLFrameSetElement.h:
+        * html/canvas/WebGLRenderingContext.cpp:
+        (WebCore::WebGLRenderingContext::copyTexSubImage2D):
+        (WebCore::WebGLRenderingContext::simulateVertexAttrib0):
+        (WebCore::WebGLRenderingContext::LRUImageBufferCache::LRUImageBufferCache):
+        * html/canvas/WebGLRenderingContext.h:
+        * platform/ScrollAnimatorNone.cpp:
+        * platform/audio/DynamicsCompressor.cpp:
+        (WebCore::DynamicsCompressor::setNumberOfChannels):
+        * platform/audio/DynamicsCompressor.h:
+        * platform/audio/FFTFrame.h:
+        * platform/audio/gstreamer/FFTFrameGStreamer.cpp:
+        (WebCore::FFTFrame::FFTFrame):
+        * platform/efl/ScrollbarEfl.cpp:
+        (ScrollbarEfl::updateThumbPositionAndProportion):
+        * platform/graphics/ANGLEWebKitBridge.cpp:
+        (WebCore::ANGLEWebKitBridge::compileShaderSource):
+        * platform/graphics/GraphicsContext3D.cpp:
+        (WebCore::GraphicsContext3D::texImage2DResourceSafe):
+        * platform/graphics/GraphicsContext3D.h:
+        * platform/graphics/GraphicsContext3DPrivate.cpp:
+        (WebCore::GraphicsContext3DPrivate::paintToTextureMapper):
+        * platform/graphics/blackberry/LayerTexture.cpp:
+        * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
+        (WebCore::getDirtyRects):
+        * platform/graphics/cg/GraphicsContext3DCG.cpp:
+        (WebCore::GraphicsContext3D::ImageExtractor::extractImage):
+        * platform/graphics/cg/GraphicsContextCG.cpp:
+        * platform/graphics/cg/ImageBufferCG.cpp:
+        * platform/graphics/gpu/Texture.cpp:
+        (WebCore::Texture::updateSubRect):
+        * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
+        (WebCore::HarfBuzzShaper::HarfBuzzShaper):
+        (WebCore::HarfBuzzShaper::setNormalizedBuffer):
+        * platform/graphics/harfbuzz/HarfBuzzShaper.h:
+        * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
+        (WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):
+        (WebCore::GraphicsContext3D::compileShader):
+        (WebCore::GraphicsContext3D::getActiveAttrib):
+        (WebCore::GraphicsContext3D::getActiveUniform):
+        (WebCore::GraphicsContext3D::getProgramInfoLog):
+        (WebCore::GraphicsContext3D::getShaderInfoLog):
+        * platform/graphics/opentype/OpenTypeSanitizer.cpp:
+        * platform/graphics/texmap/TextureMapperGL.cpp:
+        * platform/graphics/wince/SharedBitmap.cpp:
+        (WebCore::SharedBitmap::SharedBitmap):
+        (WebCore::SharedBitmap::to16bit):
+        * platform/graphics/wince/SharedBitmap.h:
+        * platform/image-decoders/blackberry/JPEGImageDecoder.cpp:
+        (WebCore::ImageReader::decode):
+        * platform/image-decoders/png/PNGImageDecoder.cpp:
+        (WebCore::PNGImageReader::createRowBuffer):
+        * platform/win/ContextMenuWin.cpp:
+        (WebCore::ContextMenu::getContextMenuItems):
+        * platform/win/LoggingWin.cpp:
+        (WebCore::logLevelString):
+        * plugins/PluginPackage.cpp:
+        * plugins/blackberry/PluginViewBlackBerry.cpp:
+        (WebCore::PluginView::handleTouchEvent):
+        * plugins/win/PluginPackageWin.cpp:
+        (WebCore::PluginPackage::fetchInfo):
+
 2013-09-17  Commit Queue  <commit-queue@webkit.org>
 
         Unreviewed, rolling out r156001.
index 3688818..9bec347 100644 (file)
@@ -38,6 +38,7 @@
 #include <algorithm>
 #include <wtf/MainThread.h>
 #include <wtf/MathExtras.h>
+#include <wtf/StdLibExtras.h>
 
 using namespace std;
 
@@ -355,8 +356,8 @@ bool AudioBufferSourceNode::setBuffer(AudioBuffer* buffer)
 
         output(0)->setNumberOfChannels(numberOfChannels);
 
-        m_sourceChannels = adoptArrayPtr(new const float* [numberOfChannels]);
-        m_destinationChannels = adoptArrayPtr(new float* [numberOfChannels]);
+        m_sourceChannels = std::make_unique<const float*[]>(numberOfChannels);
+        m_destinationChannels = std::make_unique<float*[]>(numberOfChannels);
 
         for (unsigned i = 0; i < numberOfChannels; ++i) 
             m_sourceChannels[i] = buffer->getChannelData(i)->data();
index 7c71780..d6b5b31 100644 (file)
@@ -31,7 +31,7 @@
 #include "AudioScheduledSourceNode.h"
 #include "ExceptionCode.h"
 #include "PannerNode.h"
-#include <wtf/OwnArrayPtr.h>
+#include <memory>
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefPtr.h>
 #include <wtf/Threading.h>
@@ -115,8 +115,8 @@ private:
     RefPtr<AudioBuffer> m_buffer;
 
     // Pointers for the buffer and destination.
-    OwnArrayPtr<const float*> m_sourceChannels;
-    OwnArrayPtr<float*> m_destinationChannels;
+    std::unique_ptr<const float*[]> m_sourceChannels;
+    std::unique_ptr<float*[]> m_destinationChannels;
 
     // Used for the "gain" and "playbackRate" attributes.
     RefPtr<AudioParam> m_gain;
index 737926b..df58f95 100644 (file)
@@ -28,7 +28,6 @@
 #include "AudioBus.h"
 #include "AudioParam.h"
 #include "AudioScheduledSourceNode.h"
-#include <wtf/OwnArrayPtr.h>
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefPtr.h>
 #include <wtf/Threading.h>
index 40d5863..56de764 100644 (file)
@@ -89,6 +89,7 @@
 #include <limits.h>
 #include <wtf/BitArray.h>
 #include <wtf/HexNumber.h>
+#include <wtf/StdLibExtras.h>
 #include <wtf/dtoa.h>
 #include <wtf/text/StringBuffer.h>
 #include <wtf/text/StringBuilder.h>
@@ -406,7 +407,7 @@ void CSSParser::setupParser(const char* prefix, unsigned prefixLength, const Str
     m_length = length;
 
     if (!stringLength || string.is8Bit()) {
-        m_dataStart8 = adoptArrayPtr(new LChar[length]);
+        m_dataStart8 = std::make_unique<LChar[]>(length);
         for (unsigned i = 0; i < m_parsedTextPrefixLength; i++)
             m_dataStart8[i] = prefix[i];
 
@@ -428,7 +429,7 @@ void CSSParser::setupParser(const char* prefix, unsigned prefixLength, const Str
         return;
     }
 
-    m_dataStart16 = adoptArrayPtr(new UChar[length]);
+    m_dataStart16 = std::make_unique<UChar[]>(length);
     for (unsigned i = 0; i < m_parsedTextPrefixLength; i++)
         m_dataStart16[i] = prefix[i];
 
@@ -10183,7 +10184,7 @@ inline UChar*& CSSParser::currentCharacter<UChar>()
 UChar*& CSSParser::currentCharacter16()
 {
     if (!m_currentCharacter16) {
-        m_dataStart16 = adoptArrayPtr(new UChar[m_length]);
+        m_dataStart16 = std::make_unique<UChar[]>(m_length);
         m_currentCharacter16 = m_dataStart16.get();
     }
 
index 9106e16..7194916 100644 (file)
@@ -33,9 +33,9 @@
 #include "CSSValueKeywords.h"
 #include "Color.h"
 #include "MediaQuery.h"
+#include <memory>
 #include <wtf/HashMap.h>
 #include <wtf/HashSet.h>
-#include <wtf/OwnArrayPtr.h>
 #include <wtf/Vector.h>
 #include <wtf/text/AtomicString.h>
 
@@ -555,8 +555,8 @@ private:
 
     ParsingMode m_parsingMode;
     bool m_is8BitSource;
-    OwnArrayPtr<LChar> m_dataStart8;
-    OwnArrayPtr<UChar> m_dataStart16;
+    std::unique_ptr<LChar[]> m_dataStart8;
+    std::unique_ptr<UChar[]> m_dataStart16;
     LChar* m_currentCharacter8;
     UChar* m_currentCharacter16;
     union {
index e4cb43a..9cdbf66 100644 (file)
@@ -25,7 +25,7 @@
 
 #include "HTMLAnchorElement.h"
 #include "LayoutRect.h"
-#include <wtf/OwnArrayPtr.h>
+#include <memory>
 
 namespace WebCore {
 
index cc4a1d0..ee860e2 100644 (file)
@@ -24,8 +24,8 @@
 #ifndef HTMLFrameSetElement_h
 #define HTMLFrameSetElement_h
 
-#include <wtf/OwnArrayPtr.h>
 #include "HTMLElement.h"
+#include <memory>
 
 namespace WebCore {
 
index 0a6edb9..6d040d4 100644 (file)
@@ -77,7 +77,7 @@
 #include <runtime/Operations.h>
 #include <runtime/TypedArrayInlines.h>
 #include <runtime/Uint32Array.h>
-#include <wtf/OwnArrayPtr.h>
+#include <wtf/StdLibExtras.h>
 #include <wtf/text/CString.h>
 #include <wtf/text/StringBuilder.h>
 
@@ -1468,7 +1468,7 @@ void WebGLRenderingContext::copyTexSubImage2D(GC3Denum target, GC3Dint level, GC
         if (clip2D(x, y, width, height, getBoundFramebufferWidth(), getBoundFramebufferHeight(), &clippedX, &clippedY, &clippedWidth, &clippedHeight)) {
             GC3Denum format = tex->getInternalFormat(target, level);
             GC3Denum type = tex->getType(target, level);
-            OwnArrayPtr<unsigned char> zero;
+            std::unique_ptr<unsigned char[]> zero;
             if (width && height) {
                 unsigned int size;
                 GC3Denum error = m_context->computeImageSizeInBytes(format, type, width, height, m_unpackAlignment, &size, 0);
@@ -1476,7 +1476,7 @@ void WebGLRenderingContext::copyTexSubImage2D(GC3Denum target, GC3Dint level, GC
                     synthesizeGLError(error, "copyTexSubImage2D", "bad dimensions");
                     return;
                 }
-                zero = adoptArrayPtr(new unsigned char[size]);
+                zero = std::make_unique<unsigned char[]>(size);
                 if (!zero) {
                     synthesizeGLError(GraphicsContext3D::INVALID_VALUE, "copyTexSubImage2D", "out of memory");
                     return;
@@ -5730,7 +5730,7 @@ bool WebGLRenderingContext::simulateVertexAttrib0(GC3Dsizei numVertex)
             || attribValue.value[1] != m_vertexAttrib0BufferValue[1]
             || attribValue.value[2] != m_vertexAttrib0BufferValue[2]
             || attribValue.value[3] != m_vertexAttrib0BufferValue[3])) {
-        OwnArrayPtr<GC3Dfloat> bufferData = adoptArrayPtr(new GC3Dfloat[(numVertex + 1) * 4]);
+        auto bufferData = std::make_unique<GC3Dfloat[]>((numVertex + 1) * 4);
         for (GC3Dsizei ii = 0; ii < numVertex + 1; ++ii) {
             bufferData[ii * 4] = attribValue.value[0];
             bufferData[ii * 4 + 1] = attribValue.value[1];
@@ -5860,7 +5860,7 @@ String WebGLRenderingContext::ensureNotNull(const String& text) const
 }
 
 WebGLRenderingContext::LRUImageBufferCache::LRUImageBufferCache(int capacity)
-    : m_buffers(adoptArrayPtr(new OwnPtr<ImageBuffer>[capacity]))
+    : m_buffers(std::make_unique<OwnPtr<ImageBuffer>[]>(capacity))
     , m_capacity(capacity)
 {
 }
index 658728b..650b0ee 100644 (file)
@@ -34,9 +34,9 @@
 #include "Timer.h"
 #include "WebGLGetInfo.h"
 
+#include <memory>
 #include <runtime/Float32Array.h>
 #include <runtime/Int32Array.h>
-#include <wtf/OwnArrayPtr.h>
 #include <wtf/text/WTFString.h>
 
 namespace WebCore {
@@ -468,7 +468,7 @@ private:
         ImageBuffer* imageBuffer(const IntSize& size);
     private:
         void bubbleToFront(int idx);
-        OwnArrayPtr<OwnPtr<ImageBuffer> > m_buffers;
+        std::unique_ptr<OwnPtr<ImageBuffer>[]> m_buffers;
         int m_capacity;
     };
     LRUImageBufferCache m_videoCache;
index dc3381b..8794341 100644 (file)
@@ -36,7 +36,6 @@
 
 #include "FloatPoint.h"
 #include "NotImplemented.h"
-#include <wtf/OwnArrayPtr.h>
 #include "ScrollableArea.h"
 #include "ScrollbarTheme.h"
 #include <algorithm>
index c943b98..e3cecc0 100644 (file)
@@ -35,6 +35,7 @@
 #include "AudioBus.h"
 #include "AudioUtilities.h"
 #include <wtf/MathExtras.h>
+#include <wtf/StdLibExtras.h>
 
 namespace WebCore {
 
@@ -274,8 +275,8 @@ void DynamicsCompressor::setNumberOfChannels(unsigned numberOfChannels)
         m_postFilterPacks.append(adoptPtr(new ZeroPoleFilterPack4()));
     }
 
-    m_sourceChannels = adoptArrayPtr(new const float* [numberOfChannels]);
-    m_destinationChannels = adoptArrayPtr(new float* [numberOfChannels]);
+    m_sourceChannels = std::make_unique<const float*[]>(numberOfChannels);
+    m_destinationChannels = std::make_unique<float*[]>(numberOfChannels);
 
     m_compressor.setNumberOfChannels(numberOfChannels);
     m_numberOfChannels = numberOfChannels;
index f781afe..59c17e0 100644 (file)
@@ -32,8 +32,7 @@
 #include "AudioArray.h"
 #include "DynamicsCompressorKernel.h"
 #include "ZeroPole.h"
-
-#include <wtf/OwnArrayPtr.h>
+#include <memory>
 
 namespace WebCore {
 
@@ -103,8 +102,8 @@ protected:
     Vector<OwnPtr<ZeroPoleFilterPack4> > m_preFilterPacks;
     Vector<OwnPtr<ZeroPoleFilterPack4> > m_postFilterPacks;
 
-    OwnArrayPtr<const float*> m_sourceChannels;
-    OwnArrayPtr<float*> m_destinationChannels;
+    std::unique_ptr<const float*[]> m_sourceChannels;
+    std::unique_ptr<float*[]> m_destinationChannels;
 
     void setEmphasisStageParameters(unsigned stageIndex, float gain, float normalizedFrequency /* 0 -> 1 */);
     void setEmphasisParameters(float gain, float anchorFreq, float filterStageRatio);
index 783ff8e..8948f7c 100644 (file)
@@ -49,6 +49,7 @@
 
 #if USE(WEBAUDIO_GSTREAMER)
 #include <glib.h>
+#include <memory>
 G_BEGIN_DECLS
 #include <gst/fft/gstfftf32.h>
 G_END_DECLS
@@ -167,7 +168,7 @@ private:
 #if USE(WEBAUDIO_GSTREAMER)
     GstFFTF32* m_fft;
     GstFFTF32* m_inverseFft;
-    OwnArrayPtr<GstFFTF32Complex> m_complexData;
+    std::unique_ptr<GstFFTF32Complex[]> m_complexData;
     AudioFloatArray m_realData;
     AudioFloatArray m_imagData;
 #endif // USE(WEBAUDIO_GSTREAMER)
index a8f069c..6566c18 100644 (file)
@@ -26,6 +26,7 @@
 
 #include "VectorMath.h"
 #include <wtf/FastMalloc.h>
+#include <wtf/StdLibExtras.h>
 
 namespace {
 
@@ -42,7 +43,7 @@ namespace WebCore {
 FFTFrame::FFTFrame(unsigned fftSize)
     : m_FFTSize(fftSize)
     , m_log2FFTSize(static_cast<unsigned>(log2(fftSize)))
-    , m_complexData(adoptArrayPtr(new GstFFTF32Complex[unpackedFFTDataSize(m_FFTSize)]))
+    , m_complexData(std::make_unique<GstFFTF32Complex[]>(unpackedFFTDataSize(m_FFTSize)))
     , m_realData(unpackedFFTDataSize(m_FFTSize))
     , m_imagData(unpackedFFTDataSize(m_FFTSize))
 {
@@ -65,7 +66,7 @@ FFTFrame::FFTFrame()
 FFTFrame::FFTFrame(const FFTFrame& frame)
     : m_FFTSize(frame.m_FFTSize)
     , m_log2FFTSize(frame.m_log2FFTSize)
-    , m_complexData(adoptArrayPtr(new GstFFTF32Complex[unpackedFFTDataSize(m_FFTSize)]))
+    , m_complexData(std::make_unique<GstFFTF32Complex[]>(unpackedFFTDataSize(m_FFTSize)))
     , m_realData(unpackedFFTDataSize(frame.m_FFTSize))
     , m_imagData(unpackedFFTDataSize(frame.m_FFTSize))
 {
index 5715e83..d833672 100644 (file)
@@ -38,7 +38,7 @@
 #include <Evas.h>
 #include <new>
 #include <string>
-#include <wtf/OwnArrayPtr.h>
+#include <wtf/StdLibExtras.h>
 #include <wtf/text/CString.h>
 
 using namespace std;
@@ -171,7 +171,7 @@ void ScrollbarEfl::updateThumbPositionAndProportion()
     m_lastTotalSize = tSize;
     m_lastVisibleSize = vSize;
 
-    OwnArrayPtr<char> buffer = adoptArrayPtr(new char[sizeof(Edje_Message_Float_Set) + sizeof(double)]);
+    auto buffer = std::make_unique<char[]>(sizeof(Edje_Message_Float_Set) + sizeof(double));
     Edje_Message_Float_Set* message = new(buffer.get()) Edje_Message_Float_Set;
     message->count = 2;
 
index 9876c9f..b73cf21 100644 (file)
@@ -28,7 +28,7 @@
 #if USE(3D_GRAPHICS)
 
 #include "ANGLEWebKitBridge.h"
-#include <wtf/OwnArrayPtr.h>
+#include <wtf/StdLibExtras.h>
 
 namespace WebCore {
 
@@ -193,7 +193,7 @@ bool ANGLEWebKitBridge::compileShaderSource(const char* shaderSource, ANGLEShade
     if (!validateSuccess) {
         int logSize = getValidationResultValue(compiler, SH_INFO_LOG_LENGTH);
         if (logSize > 1) {
-            OwnArrayPtr<char> logBuffer = adoptArrayPtr(new char[logSize]);
+            auto logBuffer = std::make_unique<char[]>(logSize);
             if (logBuffer) {
                 ShGetInfoLog(compiler, logBuffer.get());
                 shaderValidationLog = logBuffer.get();
@@ -204,7 +204,7 @@ bool ANGLEWebKitBridge::compileShaderSource(const char* shaderSource, ANGLEShade
 
     int translationLength = getValidationResultValue(compiler, SH_OBJECT_CODE_LENGTH);
     if (translationLength > 1) {
-        OwnArrayPtr<char> translationBuffer = adoptArrayPtr(new char[translationLength]);
+        auto translationBuffer = std::make_unique<char[]>(translationLength);
         if (!translationBuffer)
             return false;
         ShGetObjectCode(compiler, translationBuffer.get());
index e988acd..159084a 100644 (file)
@@ -41,7 +41,7 @@
 #endif
 
 #include <runtime/ArrayBufferView.h>
-#include <wtf/OwnArrayPtr.h>
+#include <wtf/StdLibExtras.h>
 
 namespace WebCore {
 
@@ -113,7 +113,7 @@ GraphicsContext3D::DataFormat getDataFormat(GC3Denum destinationFormat, GC3Denum
 bool GraphicsContext3D::texImage2DResourceSafe(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height, GC3Dint border, GC3Denum format, GC3Denum type, GC3Dint unpackAlignment)
 {
     ASSERT(unpackAlignment == 1 || unpackAlignment == 2 || unpackAlignment == 4 || unpackAlignment == 8);
-    OwnArrayPtr<unsigned char> zero;
+    std::unique_ptr<unsigned char[]> zero;
     if (!isResourceSafe() && width > 0 && height > 0) {
         unsigned int size;
         GC3Denum error = computeImageSizeInBytes(format, type, width, height, unpackAlignment, &size, 0);
@@ -121,7 +121,7 @@ bool GraphicsContext3D::texImage2DResourceSafe(GC3Denum target, GC3Dint level, G
             synthesizeGLError(error);
             return false;
         }
-        zero = adoptArrayPtr(new unsigned char[size]);
+        zero = std::make_unique<unsigned char[]>(size);
         if (!zero) {
             synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
             return false;
@@ -1184,7 +1184,8 @@ public:
     {
         const unsigned MaxNumberOfComponents = 4;
         const unsigned MaxBytesPerComponent  = 4;
-        m_unpackedIntermediateSrcData = adoptArrayPtr(new uint8_t[m_width * MaxNumberOfComponents *MaxBytesPerComponent]);
+        m_unpackedIntermediateSrcData = std::make_unique<uint8_t[]>(m_width * MaxNumberOfComponents * MaxBytesPerComponent);
+
         ASSERT(m_unpackedIntermediateSrcData.get());
     }
 
@@ -1206,7 +1207,7 @@ private:
     void* const m_dstStart;
     const int m_srcStride, m_dstStride;
     bool m_success;
-    OwnArrayPtr<uint8_t> m_unpackedIntermediateSrcData;
+    std::unique_ptr<uint8_t[]> m_unpackedIntermediateSrcData;
 };
 
 void FormatConverter::convert(GraphicsContext3D::DataFormat srcFormat, GraphicsContext3D::DataFormat dstFormat, GraphicsContext3D::AlphaOp alphaOp)
index 4a38b3e..9854ea3 100644 (file)
 #include "Image.h"
 #include "IntRect.h"
 #include "PlatformLayer.h"
+#include <memory>
 #include <wtf/HashMap.h>
 #include <wtf/ListHashSet.h>
 #include <wtf/Noncopyable.h>
-#include <wtf/OwnArrayPtr.h>
 #include <wtf/RefCounted.h>
 #include <wtf/text/WTFString.h>
 
@@ -900,7 +900,7 @@ public:
         CGImageRef m_cgImage;
         RetainPtr<CGImageRef> m_decodedImage;
         RetainPtr<CFDataRef> m_pixelData;
-        OwnArrayPtr<uint8_t> m_formalizedRGBA8Data;
+        std::unique_ptr<uint8_t[]> m_formalizedRGBA8Data;
 #elif PLATFORM(QT)
         QImage m_qtImage;
 #elif PLATFORM(BLACKBERRY)
index dcf2680..eb5df98 100644 (file)
@@ -24,7 +24,7 @@
 
 #include "HostWindow.h"
 #include "NotImplemented.h"
-#include <wtf/OwnArrayPtr.h>
+#include <wtf/StdLibExtras.h>
 
 #if PLATFORM(NIX) && USE(EGL)
 #include "GLContextFromCurrentEGL.h"
@@ -107,7 +107,7 @@ void GraphicsContext3DPrivate::paintToTextureMapper(TextureMapper* textureMapper
         const int width = m_context->m_currentWidth;
         int totalBytes = width * height * 4;
 
-        OwnArrayPtr<unsigned char> pixels = adoptArrayPtr(new unsigned char[totalBytes]);
+        auto pixels = std::make_unique<unsigned char[]>(totalBytes);
         if (!pixels)
             return;
 
index db3c9d5..c5c3e73 100644 (file)
@@ -29,7 +29,6 @@
 #include <BlackBerryPlatformGraphicsContext.h>
 #include <GLES2/gl2.h>
 #include <wtf/CurrentTime.h>
-#include <wtf/OwnArrayPtr.h>
 
 namespace WebCore {
 
index afb229a..1ffe297 100644 (file)
@@ -38,7 +38,7 @@
 #include <limits.h>
 #include <QuartzCore/CABase.h>
 #include <wtf/CurrentTime.h>
-#include <wtf/OwnArrayPtr.h>
+#include <wtf/StdLibExtras.h>
 #include <wtf/win/GDIObject.h>
 
 #ifdef DEBUG_ALL
@@ -250,7 +250,7 @@ static void getDirtyRects(HWND window, Vector<CGRect>& outRects)
     }
 
     DWORD dataSize = ::GetRegionData(region.get(), 0, 0);
-    OwnArrayPtr<unsigned char> regionDataBuffer = adoptArrayPtr(new unsigned char[dataSize]);
+    auto regionDataBuffer = std::make_unique<unsigned char[]>(dataSize);
     RGNDATA* regionData = reinterpret_cast<RGNDATA*>(regionDataBuffer.get());
     if (!::GetRegionData(region.get(), dataSize, regionData))
         return;
index b9eddb6..d67a054 100644 (file)
@@ -44,6 +44,7 @@
 #include <CoreGraphics/CGImage.h>
 
 #include <wtf/RetainPtr.h>
+#include <wtf/StdLibExtras.h>
 
 namespace WebCore {
 
@@ -479,7 +480,7 @@ bool GraphicsContext3D::ImageExtractor::extractImage(bool premultiplyAlpha, bool
     // but it would premultiply the alpha channel as a side effect.
     // Prefer to mannually Convert 16bit per-component formats to RGBA8 formats instead.
     if (bitsPerComponent == 16) {
-        m_formalizedRGBA8Data = adoptArrayPtr(new uint8_t[m_imageWidth * m_imageHeight * 4]);
+        m_formalizedRGBA8Data = std::make_unique<uint8_t[]>(m_imageWidth * m_imageHeight * 4);
         const uint16_t* source = reinterpret_cast<const uint16_t*>(m_imagePixelData);
         uint8_t* destination = m_formalizedRGBA8Data.get();
         const ptrdiff_t srcStrideInElements = bytesPerRow / sizeof(uint16_t);
index 64252f6..44bf2d3 100644 (file)
@@ -41,7 +41,6 @@
 #include "Timer.h"
 #include <CoreGraphics/CoreGraphics.h>
 #include <wtf/MathExtras.h>
-#include <wtf/OwnArrayPtr.h>
 #include <wtf/RetainPtr.h>
 
 #if PLATFORM(MAC)
index 4e3acdf..e480d7b 100644 (file)
@@ -38,7 +38,6 @@
 #include <wtf/Assertions.h>
 #include <wtf/CheckedArithmetic.h>
 #include <wtf/MainThread.h>
-#include <wtf/OwnArrayPtr.h>
 #include <wtf/RetainPtr.h>
 #include <wtf/text/Base64.h>
 #include <wtf/text/WTFString.h>
index 9ade352..3706fee 100644 (file)
@@ -38,9 +38,8 @@
 #include "FloatRect.h"
 #include "GraphicsContext3D.h"
 #include "IntRect.h"
-
 #include <algorithm>
-#include <wtf/OwnArrayPtr.h>
+#include <wtf/StdLibExtras.h>
 
 using namespace std;
 
@@ -174,7 +173,7 @@ void Texture::updateSubRect(void* pixels, const IntRect& updateRect)
     int tempBuffSize = // Temporary buffer size is the smaller of the max texture size or the updateRectSanitized
         min(m_tiles.maxTextureSize().width(), m_tiles.borderTexels() + updateRectSanitized.width()) *
         min(m_tiles.maxTextureSize().height(), m_tiles.borderTexels() + updateRectSanitized.height());
-    OwnArrayPtr<uint32_t> tempBuff = adoptArrayPtr(new uint32_t[tempBuffSize]);
+    auto tempBuff = std::make_unique<uint32_t[]>(tempBuffSize);
 
     for (int tile = 0; tile < m_tiles.numTilesX() * m_tiles.numTilesY(); tile++) {
         int xIndex = tile % m_tiles.numTilesX();
index 572035e..9e0e05c 100644 (file)
@@ -39,6 +39,7 @@
 #include <unicode/normlzr.h>
 #include <unicode/uchar.h>
 #include <wtf/MathExtras.h>
+#include <wtf/StdLibExtras.h>
 #include <wtf/Vector.h>
 #include <wtf/unicode/Unicode.h>
 
@@ -195,7 +196,7 @@ HarfBuzzShaper::HarfBuzzShaper(const Font* font, const TextRun& run)
     , m_fromIndex(0)
     , m_toIndex(m_run.length())
 {
-    m_normalizedBuffer = adoptArrayPtr(new UChar[m_run.length() + 1]);
+    m_normalizedBuffer = std::make_unique<UChar[]>(m_run.length() + 1);
     m_normalizedBufferLength = m_run.length();
     normalizeCharacters(m_run, m_normalizedBuffer.get(), m_normalizedBufferLength);
     setPadding(m_run.expansion());
@@ -277,7 +278,7 @@ void HarfBuzzShaper::setNormalizedBuffer(NormalizeMode normalizeMode)
         sourceText = normalizedString.getBuffer();
     }
 
-    m_normalizedBuffer = adoptArrayPtr(new UChar[m_normalizedBufferLength + 1]);
+    m_normalizedBuffer = std::make_unique<UChar[]>(m_normalizedBufferLength + 1);
     normalizeSpacesAndMirrorChars(sourceText, m_normalizedBuffer.get(), m_normalizedBufferLength, normalizeMode);
 }
 
index 5a3d4fb..5747e43 100644 (file)
@@ -35,8 +35,8 @@
 #include "GlyphBuffer.h"
 #include "TextRun.h"
 #include "hb.h"
+#include <memory>
 #include <wtf/HashSet.h>
-#include <wtf/OwnArrayPtr.h>
 #include <wtf/OwnPtr.h>
 #include <wtf/PassOwnPtr.h>
 #include <wtf/Vector.h>
@@ -129,7 +129,7 @@ private:
     GlyphBufferAdvance createGlyphBufferAdvance(float, float);
 
     const Font* m_font;
-    OwnArrayPtr<UChar> m_normalizedBuffer;
+    std::unique_ptr<UChar[]> m_normalizedBuffer;
     unsigned m_normalizedBufferLength;
     const TextRun& m_run;
 
index 857019d..3ced078 100644 (file)
@@ -50,7 +50,6 @@
 #include <runtime/Int32Array.h>
 #include <runtime/Uint8Array.h>
 #include <wtf/MainThread.h>
-#include <wtf/OwnArrayPtr.h>
 #include <wtf/text/CString.h>
 
 #if USE(OPENGL_ES_2)
@@ -102,7 +101,7 @@ void GraphicsContext3D::paintRenderingResultsToCanvas(ImageBuffer* imageBuffer,
     int rowBytes = m_currentWidth * 4;
     int totalBytes = rowBytes * m_currentHeight;
 
-    OwnArrayPtr<unsigned char> pixels = adoptArrayPtr(new unsigned char[totalBytes]);
+    auto pixels = std::make_unique<unsigned char[]>(totalBytes);
     if (!pixels)
         return;
 
@@ -466,7 +465,7 @@ void GraphicsContext3D::compileShader(Platform3DObject shader)
         GraphicsContext3D::ShaderSourceEntry& entry = result->value;
 
         GLsizei size = 0;
-        OwnArrayPtr<GLchar> info = adoptArrayPtr(new GLchar[length]);
+        auto info = std::make_unique<GLchar[]>(length);
         ::glGetShaderInfoLog(shader, length, &size, info.get());
 
         entry.log = info.get();
@@ -619,7 +618,7 @@ bool GraphicsContext3D::getActiveAttrib(Platform3DObject program, GC3Duint index
     makeContextCurrent();
     GLint maxAttributeSize = 0;
     ::glGetProgramiv(program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &maxAttributeSize);
-    OwnArrayPtr<GLchar> name = adoptArrayPtr(new GLchar[maxAttributeSize]); // GL_ACTIVE_ATTRIBUTE_MAX_LENGTH includes null termination.
+    auto name = std::make_unique<GLchar[]>(maxAttributeSize); // GL_ACTIVE_ATTRIBUTE_MAX_LENGTH includes null termination.
     GLsizei nameLength = 0;
     GLint size = 0;
     GLenum type = 0;
@@ -646,7 +645,7 @@ bool GraphicsContext3D::getActiveUniform(Platform3DObject program, GC3Duint inde
     GLint maxUniformSize = 0;
     ::glGetProgramiv(program, GL_ACTIVE_UNIFORM_MAX_LENGTH, &maxUniformSize);
 
-    OwnArrayPtr<GLchar> name = adoptArrayPtr(new GLchar[maxUniformSize]); // GL_ACTIVE_UNIFORM_MAX_LENGTH includes null termination.
+    auto name = std::make_unique<GLchar[]>(maxUniformSize); // GL_ACTIVE_UNIFORM_MAX_LENGTH includes null termination.
     GLsizei nameLength = 0;
     GLint size = 0;
     GLenum type = 0;
@@ -1155,7 +1154,7 @@ String GraphicsContext3D::getProgramInfoLog(Platform3DObject program)
         return String(); 
 
     GLsizei size = 0;
-    OwnArrayPtr<GLchar> info = adoptArrayPtr(new GLchar[length]);
+    auto info = std::make_unique<GLchar[]>(length);
     ::glGetProgramInfoLog(program, length, &size, info.get());
 
     return String(info.get());
@@ -1222,7 +1221,7 @@ String GraphicsContext3D::getShaderInfoLog(Platform3DObject shader)
         return String(); 
 
     GLsizei size = 0;
-    OwnArrayPtr<GLchar> info = adoptArrayPtr(new GLchar[length]);
+    auto info = std::make_unique<GLchar[]>(length);
     ::glGetShaderInfoLog(shader, length, &size, info.get());
 
     return String(info.get());
index e3ac1ff..5d975c6 100644 (file)
@@ -35,7 +35,6 @@
 #include "SharedBuffer.h"
 #include "opentype-sanitiser.h"
 #include "ots-memory-stream.h"
-#include <wtf/OwnArrayPtr.h>
 
 namespace WebCore {
 
index f78d6d2..ca103d6 100644 (file)
@@ -31,7 +31,6 @@
 #include "TextureMapperShaderProgram.h"
 #include "Timer.h"
 #include <wtf/HashMap.h>
-#include <wtf/OwnArrayPtr.h>
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
 #include <wtf/TemporaryChange.h>
index 98401a1..aaafa36 100644 (file)
@@ -27,8 +27,9 @@
 #include "TransformationMatrix.h"
 #include "WinCEGraphicsExtras.h"
 #include <wtf/HashSet.h>
-#include <wtf/RefCountedLeakCounter.h>
 #include <wtf/OwnPtr.h>
+#include <wtf/RefCountedLeakCounter.h>
+#include <wtf/StdLibExtras.h>
 
 #include <windows.h>
 
@@ -74,7 +75,7 @@ SharedBitmap::SharedBitmap(const IntSize& size, BitmapInfo::BitCount bitCount, b
     if (bitCount == BitmapInfo::BitCount16)
         bufferSize /= 2;
 
-    m_pixelData = adoptArrayPtr(new unsigned[bufferSize]);
+    m_pixelData = std::make_unique<unsigned[]>(bufferSize);
     m_pixels = m_pixelData.get();
 
     if (initPixels)
@@ -133,7 +134,7 @@ bool SharedBitmap::to16bit()
     int width = newBmpInfo.width();
     int paddedWidth = newBmpInfo.paddedWidth();
     int bufferSize = paddedWidth * newBmpInfo.height();
-    OwnArrayPtr<unsigned> newPixelData = adoptArrayPtr(new unsigned[bufferSize / 2]);
+    auto newPixelData = std::make_unique<unsigned[]>(bufferSize / 2);
     void* newPixels = newPixelData.get();
 
     if (!newPixels)
index 0d1c738..c67abc2 100644 (file)
@@ -25,9 +25,9 @@
 #include "BitmapInfo.h"
 #include "ColorSpace.h"
 #include "GraphicsTypes.h"
+#include <memory>
 #include <wtf/PassOwnPtr.h>
 #include <wtf/PassRefPtr.h>
-#include <wtf/OwnArrayPtr.h>
 #include <wtf/RefCounted.h>
 #include <wtf/Vector.h>
 #include <wingdi.h>
@@ -132,7 +132,7 @@ private:
     BitmapInfo m_bmpInfo;
     OwnPtr<HBITMAP> m_hbitmap;
     void* m_pixels;
-    OwnArrayPtr<unsigned> m_pixelData;
+    std::unique_ptr<unsigned[]> m_pixelData;
     COLORREF m_transparentColor;
     int m_validHeight;
     bool m_locked;
index 8ae912a..03aba87 100644 (file)
@@ -26,8 +26,8 @@
 #include <errno.h>
 #include <img/img.h>
 #include <string.h>
-#include <wtf/OwnArrayPtr.h>
 #include <wtf/PassOwnPtr.h>
+#include <wtf/StdLibExtras.h>
 
 namespace WebCore {
 
@@ -135,7 +135,7 @@ int ImageReader::decode(size_t width, size_t height, ImageFrame* aFrame)
     const int ColorComponents = 3;
     // Use a multiple of 2 bytes to improve performance
     int stride = (ColorComponents * width + 3) & ~3;
-    OwnArrayPtr<_uint8> buffer = adoptArrayPtr(new _uint8[stride * height]);
+    auto buffer = std::make_unique<_uint8[]>(stride * height);
     if (!buffer)
         return -1;
     img.access.direct.data = buffer.get();
index acaee93..ec5a602 100644 (file)
@@ -42,8 +42,8 @@
 
 #include "Color.h"
 #include "png.h"
-#include <wtf/OwnArrayPtr.h>
 #include <wtf/PassOwnPtr.h>
+#include <wtf/StdLibExtras.h>
 
 #if USE(QCMSLIB)
 #include "qcms.h"
@@ -179,7 +179,7 @@ public:
     void createInterlaceBuffer(int size) { m_interlaceBuffer = new png_byte[size]; }
 #if USE(QCMSLIB)
     png_bytep rowBuffer() const { return m_rowBuffer.get(); }
-    void createRowBuffer(int size) { m_rowBuffer = adoptArrayPtr(new png_byte[size]); }
+    void createRowBuffer(int size) { m_rowBuffer = std::make_unique<png_byte[]>(size); }
     qcms_transform* colorTransform() const { return m_transform; }
 
     void createColorTransform(const ColorProfile& colorProfile, bool hasAlpha)
@@ -215,7 +215,7 @@ private:
     png_bytep m_interlaceBuffer;
 #if USE(QCMSLIB)
     qcms_transform* m_transform;
-    OwnArrayPtr<png_byte> m_rowBuffer;
+    std::unique_ptr<png_byte[]> m_rowBuffer;
 #endif
 };
 
index d3f378b..1818425 100644 (file)
@@ -32,7 +32,7 @@
 #include "Node.h"
 #include "NotImplemented.h"
 #include <windows.h>
-#include <wtf/OwnArrayPtr.h>
+#include <wtf/StdLibExtras.h>
 #include <wtf/Vector.h>
 #include <wtf/text/CString.h>
 
@@ -73,7 +73,7 @@ void ContextMenu::getContextMenuItems(HMENU menu, Vector<ContextMenuItem>& items
         }
 
         int menuStringLength = info.cch + 1;
-        OwnArrayPtr<WCHAR> menuString = adoptArrayPtr(new WCHAR[menuStringLength]);
+        auto menuString = std::make_unique<WCHAR[]>(menuStringLength);
         info.dwTypeData = menuString.get();
         info.cch = menuStringLength;
 
index 3e367d9..f36a141 100644 (file)
@@ -29,7 +29,7 @@
 #if !LOG_DISABLED
 
 #include <windows.h>
-#include <wtf/OwnArrayPtr.h>
+#include <wtf/StdLibExtras.h>
 #include <wtf/text/WTFString.h>
 
 namespace WebCore {
@@ -42,7 +42,7 @@ String logLevelString()
     if (!length)
         return emptyString();
 
-    OwnArrayPtr<char> buffer = adoptArrayPtr(new char[length]);
+    auto buffer = std::make_unique<char[]>(length);
 
     if (!GetEnvironmentVariableA(loggingEnvironmentVariable, buffer.get(), length))
         return emptyString();
index f9e2219..e9d21d6 100644 (file)
@@ -34,7 +34,6 @@
 #include "Timer.h"
 #include "npruntime_impl.h"
 #include <string.h>
-#include <wtf/OwnArrayPtr.h>
 #include <wtf/text/CString.h>
 
 namespace WebCore {
index 3a13dcd..061c132 100644 (file)
@@ -70,6 +70,7 @@
 #include <runtime/JSLock.h>
 #include <sys/keycodes.h>
 #include <vector>
+#include <wtf/StdLibExtras.h>
 
 const unsigned UninitializedCoordinate = 0xffffffff;
 
@@ -368,9 +369,9 @@ void PluginView::handleTouchEvent(TouchEvent* event)
     npTouchEvent.points = 0;
     npTouchEvent.size = touchList->length();
 
-    OwnArrayPtr<NPTouchPoint> touchPoints;
+    std::unique_ptr<NPTouchPoint[]> touchPoints;
     if (touchList->length()) {
-        touchPoints = adoptArrayPtr(new NPTouchPoint[touchList->length()]);
+        touchPoints = std::make_unique<NPTouchPoint[]>(touchList->length());
         npTouchEvent.points = touchPoints.get();
         for (unsigned i = 0; i < touchList->length(); i++) {
             Touch* touchItem = touchList->item(i);
index ab8459f..2270190 100644 (file)
@@ -35,7 +35,7 @@
 #include "Timer.h"
 #include "npruntime_impl.h"
 #include <string.h>
-#include <wtf/OwnArrayPtr.h>
+#include <wtf/StdLibExtras.h>
 #include <wtf/text/CString.h>
 #include <shlwapi.h>
 
@@ -171,7 +171,7 @@ bool PluginPackage::fetchInfo()
     if (versionInfoSize == 0)
         return false;
 
-    OwnArrayPtr<char> versionInfoData = adoptArrayPtr(new char[versionInfoSize]);
+    auto versionInfoData = std::make_unique<char[]>(versionInfoSize);
 
     if (!GetFileVersionInfoW(const_cast<UChar*>(m_path.charactersWithNullTermination().data()),
             0, versionInfoSize, versionInfoData.get()))