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

Unified Diff: include/core/SkTemplates.h

Issue 23621005: Replace SkTScopedPtr with SkAutoTDelete in Skia. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: port class comment Created 7 years, 4 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/core/SkTScopedPtr.h ('k') | include/pdf/SkPDFDevice.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkTemplates.h
diff --git a/include/core/SkTemplates.h b/include/core/SkTemplates.h
index e49cc47ea96b478d2aa16ded2c5af9527f9087ca..c63a1140d1def5a0eb489b7fcb071b2a1030a7d8 100644
--- a/include/core/SkTemplates.h
+++ b/include/core/SkTemplates.h
@@ -98,6 +98,16 @@ private:
T* fObj;
};
+/** \class SkAutoTDelete
+ An SkAutoTDelete<T> is like a T*, except that the destructor of SkAutoTDelete<T>
+ automatically deletes the pointer it holds (if any). That is, SkAutoTDelete<T>
+ owns the T object that it points to. Like a T*, an SkAutoTDelete<T> may hold
+ either NULL or a pointer to a T object. Also like T*, SkAutoTDelete<T> is
+ thread-compatible, and once you dereference it, you get the threadsafety
+ guarantees of T.
+
+ The size of a SkAutoTDelete is small: sizeof(SkAutoTDelete<T>) == sizeof(T*)
+*/
template <typename T> class SkAutoTDelete : SkNoncopyable {
public:
SkAutoTDelete(T* obj = NULL) : fObj(obj) {}
« no previous file with comments | « include/core/SkTScopedPtr.h ('k') | include/pdf/SkPDFDevice.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698