Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(522)

Unified Diff: third_party/WebKit/Source/platform/WebThreadSupportingGC.cpp

Issue 2050123002: Remove OwnPtr from Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: First attempt to land. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/WebThreadSupportingGC.cpp
diff --git a/third_party/WebKit/Source/platform/WebThreadSupportingGC.cpp b/third_party/WebKit/Source/platform/WebThreadSupportingGC.cpp
index 6c7f2cdc59892948860ed27437d02258636d9f61..bb85da48a415342ec8811f2988c549eb38580682 100644
--- a/third_party/WebKit/Source/platform/WebThreadSupportingGC.cpp
+++ b/third_party/WebKit/Source/platform/WebThreadSupportingGC.cpp
@@ -6,18 +6,20 @@
#include "platform/heap/SafePoint.h"
#include "public/platform/WebScheduler.h"
+#include "wtf/PtrUtil.h"
#include "wtf/Threading.h"
+#include <memory>
namespace blink {
-PassOwnPtr<WebThreadSupportingGC> WebThreadSupportingGC::create(const char* name, bool perThreadHeapEnabled)
+std::unique_ptr<WebThreadSupportingGC> WebThreadSupportingGC::create(const char* name, bool perThreadHeapEnabled)
{
- return adoptPtr(new WebThreadSupportingGC(name, nullptr, perThreadHeapEnabled));
+ return wrapUnique(new WebThreadSupportingGC(name, nullptr, perThreadHeapEnabled));
}
-PassOwnPtr<WebThreadSupportingGC> WebThreadSupportingGC::createForThread(WebThread* thread, bool perThreadHeapEnabled)
+std::unique_ptr<WebThreadSupportingGC> WebThreadSupportingGC::createForThread(WebThread* thread, bool perThreadHeapEnabled)
{
- return adoptPtr(new WebThreadSupportingGC(nullptr, thread, perThreadHeapEnabled));
+ return wrapUnique(new WebThreadSupportingGC(nullptr, thread, perThreadHeapEnabled));
}
WebThreadSupportingGC::WebThreadSupportingGC(const char* name, WebThread* thread, bool perThreadHeapEnabled)
@@ -32,7 +34,7 @@ WebThreadSupportingGC::WebThreadSupportingGC(const char* name, WebThread* thread
#endif
if (!m_thread) {
// If |thread| is not given, create a new one and own it.
- m_owningThread = adoptPtr(Platform::current()->createThread(name));
+ m_owningThread = wrapUnique(Platform::current()->createThread(name));
m_thread = m_owningThread.get();
}
}
@@ -49,7 +51,7 @@ WebThreadSupportingGC::~WebThreadSupportingGC()
void WebThreadSupportingGC::initialize()
{
ThreadState::attachCurrentThread(m_perThreadHeapEnabled);
- m_gcTaskRunner = adoptPtr(new GCTaskRunner(m_thread));
+ m_gcTaskRunner = wrapUnique(new GCTaskRunner(m_thread));
}
void WebThreadSupportingGC::shutdown()

Powered by Google App Engine
This is Rietveld 408576698