Remove some stray uses of OwnPtr and PassOwnPtr in WTF (outside of the template defin...
[WebKit-https.git] / Source / WTF / wtf / ThreadingWin.cpp
index d44f8b5d2e37b4f657617c40a3c1f871914560ae..ea4bd43ae1387e4431642d2a240a6679cc1b91ab 100644 (file)
@@ -99,8 +99,6 @@
 #include <wtf/CurrentTime.h>
 #include <wtf/HashMap.h>
 #include <wtf/MathExtras.h>
-#include <wtf/OwnPtr.h>
-#include <wtf/PassOwnPtr.h>
 #include <wtf/RandomNumberSeed.h>
 #include <wtf/WTFThreadData.h>
 
@@ -199,7 +197,7 @@ static void clearThreadHandleForIdentifier(ThreadIdentifier id)
 
 static unsigned __stdcall wtfThreadEntryPoint(void* param)
 {
-    OwnPtr<ThreadFunctionInvocation> invocation = adoptPtr(static_cast<ThreadFunctionInvocation*>(param));
+    std::unique_ptr<ThreadFunctionInvocation> invocation(static_cast<ThreadFunctionInvocation*>(param));
     invocation->function(invocation->data);
 
 #if !USE(PTHREADS) && OS(WINDOWS)
@@ -214,7 +212,7 @@ ThreadIdentifier createThreadInternal(ThreadFunction entryPoint, void* data, con
 {
     unsigned threadIdentifier = 0;
     ThreadIdentifier threadID = 0;
-    OwnPtr<ThreadFunctionInvocation> invocation = adoptPtr(new ThreadFunctionInvocation(entryPoint, data));
+    auto invocation = std::make_unique<ThreadFunctionInvocation>(entryPoint, data);
     HANDLE threadHandle = reinterpret_cast<HANDLE>(_beginthreadex(0, 0, wtfThreadEntryPoint, invocation.get(), 0, &threadIdentifier));
     if (!threadHandle) {
 #if !HAVE(ERRNO_H)
@@ -226,7 +224,7 @@ ThreadIdentifier createThreadInternal(ThreadFunction entryPoint, void* data, con
     }
 
     // The thread will take ownership of invocation.
-    ThreadFunctionInvocation* leakedInvocation = invocation.leakPtr();
+    ThreadFunctionInvocation* leakedInvocation = invocation.release();
     UNUSED_PARAM(leakedInvocation);
 
     threadID = static_cast<ThreadIdentifier>(threadIdentifier);