Replace use of OwnArrayPtr<Foo> with std::unique_ptr<Foo[]> in Tools
[WebKit-https.git] / Tools / TestWebKitAPI / mac / PlatformUtilitiesMac.mm
index 1e73adb..6f90dcd 100644 (file)
@@ -30,8 +30,8 @@
 #include <WebKit2/WKStringCF.h>
 #include <WebKit2/WKURLCF.h>
 #include <WebKit2/WKURLResponseNS.h>
-#include <wtf/OwnArrayPtr.h>
 #include <wtf/RetainPtr.h>
+#include <wtf/StdLibExtras.h>
 
 namespace TestWebKitAPI {
 namespace Util {
@@ -82,7 +82,7 @@ std::string toSTD(NSString *string)
         return std::string();
 
     size_t bufferSize = [string lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
-    OwnArrayPtr<char> buffer = adoptArrayPtr(new char[bufferSize]);
+    auto buffer = std::make_unique<char[]>(bufferSize);
     NSUInteger stringLength;
     [string getBytes:buffer.get() maxLength:bufferSize usedLength:&stringLength encoding:NSUTF8StringEncoding options:0 range:NSMakeRange(0, [string length]) remainingRange:0];
     return std::string(buffer.get(), stringLength);