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

Unified Diff: third_party/WebKit/Source/platform/testing/TestingPlatformSupport.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/testing/TestingPlatformSupport.cpp
diff --git a/third_party/WebKit/Source/platform/testing/TestingPlatformSupport.cpp b/third_party/WebKit/Source/platform/testing/TestingPlatformSupport.cpp
index e8c7fbcf8f6907f6642bd081ed23fdc71db53e4a..971224d393d4160be420ac58ac85cf3a3b5d995d 100644
--- a/third_party/WebKit/Source/platform/testing/TestingPlatformSupport.cpp
+++ b/third_party/WebKit/Source/platform/testing/TestingPlatformSupport.cpp
@@ -30,6 +30,9 @@
#include "platform/testing/TestingPlatformSupport.h"
+#include "wtf/PtrUtil.h"
+#include <memory>
+
namespace blink {
TestingPlatformSupport::TestingPlatformSupport()
@@ -68,12 +71,12 @@ WebThread* TestingPlatformSupport::currentThread()
class TestingPlatformMockWebTaskRunner : public WebTaskRunner {
WTF_MAKE_NONCOPYABLE(TestingPlatformMockWebTaskRunner);
public:
- explicit TestingPlatformMockWebTaskRunner(Deque<OwnPtr<WebTaskRunner::Task>>* tasks) : m_tasks(tasks) { }
+ explicit TestingPlatformMockWebTaskRunner(Deque<std::unique_ptr<WebTaskRunner::Task>>* tasks) : m_tasks(tasks) { }
~TestingPlatformMockWebTaskRunner() override { }
void postTask(const WebTraceLocation&, Task* task) override
{
- m_tasks->append(adoptPtr(task));
+ m_tasks->append(wrapUnique(task));
}
void postDelayedTask(const WebTraceLocation&, Task*, double delayMs) override
@@ -99,13 +102,13 @@ public:
}
private:
- Deque<OwnPtr<WebTaskRunner::Task>>* m_tasks; // NOT OWNED
+ Deque<std::unique_ptr<WebTaskRunner::Task>>* m_tasks; // NOT OWNED
};
// TestingPlatformMockScheduler definition:
TestingPlatformMockScheduler::TestingPlatformMockScheduler()
- : m_mockWebTaskRunner(adoptPtr(new TestingPlatformMockWebTaskRunner(&m_tasks))) { }
+ : m_mockWebTaskRunner(wrapUnique(new TestingPlatformMockWebTaskRunner(&m_tasks))) { }
TestingPlatformMockScheduler::~TestingPlatformMockScheduler() { }
@@ -135,7 +138,7 @@ void TestingPlatformMockScheduler::runAllTasks()
class TestingPlatformMockWebThread : public WebThread {
WTF_MAKE_NONCOPYABLE(TestingPlatformMockWebThread);
public:
- TestingPlatformMockWebThread() : m_mockWebScheduler(adoptPtr(new TestingPlatformMockScheduler)) { }
+ TestingPlatformMockWebThread() : m_mockWebScheduler(wrapUnique(new TestingPlatformMockScheduler)) { }
~TestingPlatformMockWebThread() override { }
WebTaskRunner* getWebTaskRunner() override
@@ -160,17 +163,17 @@ public:
}
private:
- OwnPtr<TestingPlatformMockScheduler> m_mockWebScheduler;
+ std::unique_ptr<TestingPlatformMockScheduler> m_mockWebScheduler;
};
// TestingPlatformSupportWithMockScheduler definition:
TestingPlatformSupportWithMockScheduler::TestingPlatformSupportWithMockScheduler()
- : m_mockWebThread(adoptPtr(new TestingPlatformMockWebThread())) { }
+ : m_mockWebThread(wrapUnique(new TestingPlatformMockWebThread())) { }
TestingPlatformSupportWithMockScheduler::TestingPlatformSupportWithMockScheduler(const Config& config)
: TestingPlatformSupport(config)
- , m_mockWebThread(adoptPtr(new TestingPlatformMockWebThread())) { }
+ , m_mockWebThread(wrapUnique(new TestingPlatformMockWebThread())) { }
TestingPlatformSupportWithMockScheduler::~TestingPlatformSupportWithMockScheduler() { }

Powered by Google App Engine
This is Rietveld 408576698