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

Unified Diff: include/private/SkFunction.h

Issue 1330503006: Add skstd::unique_ptr and use it. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Formatting. Created 5 years, 3 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/gpu/gl/GrGLExtensions.h ('k') | include/private/SkTLogic.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/private/SkFunction.h
diff --git a/include/private/SkFunction.h b/include/private/SkFunction.h
index 1b9903006ee7f61400c6d35a347bde6ee32aaa41..6be95394c8f8ac0116e1f090b475de5cfa56393e 100644
--- a/include/private/SkFunction.h
+++ b/include/private/SkFunction.h
@@ -10,7 +10,8 @@
// TODO: document, more pervasive move support in constructors, small-Fn optimization
-#include "SkTemplates.h"
+#include "SkUtility.h"
+#include "SkUniquePtr.h"
#include "SkTypes.h"
template <typename> class SkFunction;
@@ -29,7 +30,7 @@ public:
SkFunction(const SkFunction& other) { *this = other; }
SkFunction& operator=(const SkFunction& other) {
if (this != &other) {
- fFunction.reset(other.fFunction ? other.fFunction->clone() : nullptr);
+ fFunction.reset(other.fFunction.get() ? other.fFunction->clone() : nullptr);
}
return *this;
}
@@ -69,7 +70,7 @@ private:
R (*fFn)(Args...);
};
- SkAutoTDelete<Interface> fFunction;
+ skstd::unique_ptr<Interface> fFunction;
};
#endif//SkFunction_DEFINED
« no previous file with comments | « include/gpu/gl/GrGLExtensions.h ('k') | include/private/SkTLogic.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698