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

Unified Diff: include/private/SkTemplates.h

Issue 1782973002: Revert of Use std::unique_ptr. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « include/private/SkOncePtr.h ('k') | include/private/SkUniquePtr.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/private/SkTemplates.h
diff --git a/include/private/SkTemplates.h b/include/private/SkTemplates.h
index e74f512623a55f5cedadc334092a4630496ef737..e36910e81446365e15c9cb2a2aa8124da7605f16 100644
--- a/include/private/SkTemplates.h
+++ b/include/private/SkTemplates.h
@@ -13,8 +13,8 @@
#include "SkMath.h"
#include "SkTLogic.h"
#include "SkTypes.h"
+#include "SkUniquePtr.h"
#include <limits.h>
-#include <memory>
#include <new>
/** \file SkTemplates.h
@@ -58,9 +58,9 @@
function.
*/
template <typename T, void (*P)(T*)> class SkAutoTCallVProc
- : public std::unique_ptr<T, SkFunctionWrapper<void, T, P>> {
-public:
- SkAutoTCallVProc(T* obj): std::unique_ptr<T, SkFunctionWrapper<void, T, P>>(obj) {}
+ : public skstd::unique_ptr<T, SkFunctionWrapper<void, T, P>> {
+public:
+ SkAutoTCallVProc(T* obj): skstd::unique_ptr<T, SkFunctionWrapper<void, T, P>>(obj) {}
operator T*() const { return this->get(); }
T* detach() { return this->release(); }
@@ -75,9 +75,9 @@
function.
*/
template <typename T, int (*P)(T*)> class SkAutoTCallIProc
- : public std::unique_ptr<T, SkFunctionWrapper<int, T, P>> {
-public:
- SkAutoTCallIProc(T* obj): std::unique_ptr<T, SkFunctionWrapper<int, T, P>>(obj) {}
+ : public skstd::unique_ptr<T, SkFunctionWrapper<int, T, P>> {
+public:
+ SkAutoTCallIProc(T* obj): skstd::unique_ptr<T, SkFunctionWrapper<int, T, P>>(obj) {}
operator T*() const { return this->get(); }
T* detach() { return this->release(); }
@@ -93,18 +93,18 @@
The size of a SkAutoTDelete is small: sizeof(SkAutoTDelete<T>) == sizeof(T*)
*/
-template <typename T> class SkAutoTDelete : public std::unique_ptr<T> {
-public:
- SkAutoTDelete(T* obj = NULL) : std::unique_ptr<T>(obj) {}
+template <typename T> class SkAutoTDelete : public skstd::unique_ptr<T> {
+public:
+ SkAutoTDelete(T* obj = NULL) : skstd::unique_ptr<T>(obj) {}
operator T*() const { return this->get(); }
void free() { this->reset(nullptr); }
T* detach() { return this->release(); }
};
-template <typename T> class SkAutoTDeleteArray : public std::unique_ptr<T[]> {
-public:
- SkAutoTDeleteArray(T array[]) : std::unique_ptr<T[]>(array) {}
+template <typename T> class SkAutoTDeleteArray : public skstd::unique_ptr<T[]> {
+public:
+ SkAutoTDeleteArray(T array[]) : skstd::unique_ptr<T[]>(array) {}
void free() { this->reset(nullptr); }
T* detach() { return this->release(); }
« no previous file with comments | « include/private/SkOncePtr.h ('k') | include/private/SkUniquePtr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698