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

Unified Diff: third_party/WebKit/Source/platform/TimerTest.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/TimerTest.cpp
diff --git a/third_party/WebKit/Source/platform/TimerTest.cpp b/third_party/WebKit/Source/platform/TimerTest.cpp
index 22a5a8a1ff71ec3c7014b09c9878c712917cd1e3..dec685062c1e1cf09f5bd020d3bebf5b2e802fb2 100644
--- a/third_party/WebKit/Source/platform/TimerTest.cpp
+++ b/third_party/WebKit/Source/platform/TimerTest.cpp
@@ -11,7 +11,9 @@
#include "public/platform/WebViewScheduler.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "wtf/PtrUtil.h"
#include "wtf/RefCounted.h"
+#include <memory>
#include <queue>
using testing::ElementsAre;
@@ -20,10 +22,10 @@ namespace blink {
namespace {
double gCurrentTimeSecs = 0.0;
-// This class exists because gcc doesn't know how to move an OwnPtr.
+// This class exists because gcc doesn't know how to move an std::unique_ptr.
class RefCountedTaskContainer : public RefCounted<RefCountedTaskContainer> {
public:
- explicit RefCountedTaskContainer(WebTaskRunner::Task* task) : m_task(adoptPtr(task)) { }
+ explicit RefCountedTaskContainer(WebTaskRunner::Task* task) : m_task(wrapUnique(task)) { }
~RefCountedTaskContainer() { }
@@ -33,7 +35,7 @@ public:
}
private:
- OwnPtr<WebTaskRunner::Task> m_task;
+ std::unique_ptr<WebTaskRunner::Task> m_task;
};
class DelayedTask {
@@ -200,7 +202,7 @@ private:
class FakeWebThread : public WebThread {
public:
- FakeWebThread() : m_webScheduler(adoptPtr(new MockWebScheduler())) { }
+ FakeWebThread() : m_webScheduler(wrapUnique(new MockWebScheduler())) { }
~FakeWebThread() override { }
virtual bool isCurrentThread() const
@@ -237,13 +239,13 @@ public:
}
private:
- OwnPtr<MockWebScheduler> m_webScheduler;
+ std::unique_ptr<MockWebScheduler> m_webScheduler;
};
class TimerTestPlatform : public TestingPlatformSupport {
public:
TimerTestPlatform()
- : m_webThread(adoptPtr(new FakeWebThread())) { }
+ : m_webThread(wrapUnique(new FakeWebThread())) { }
~TimerTestPlatform() override { }
WebThread* currentThread() override
@@ -282,7 +284,7 @@ private:
return static_cast<MockWebScheduler*>(m_webThread->scheduler());
}
- OwnPtr<FakeWebThread> m_webThread;
+ std::unique_ptr<FakeWebThread> m_webThread;
};
class TimerTest : public testing::Test {
« no previous file with comments | « third_party/WebKit/Source/platform/SharedBufferTest.cpp ('k') | third_party/WebKit/Source/platform/TraceEvent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698