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

Unified Diff: include/core/SkData.h

Issue 13925021: Remove 'friend SkRefCnt' from SkData. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 8 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 | « no previous file | include/core/SkRefCnt.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkData.h
===================================================================
--- include/core/SkData.h (revision 8627)
+++ include/core/SkData.h (working copy)
@@ -122,41 +122,10 @@
SkData(const void* ptr, size_t size, ReleaseProc, void* context);
virtual ~SkData();
- // This is here because SkAutoTUnref creates an internal helper class
- // that derives from SkData (i.e., BlockRef) to prevent refs\unrefs.
- // This helper class generates a compiler warning on Windows since the
- // SkData's destructor is private. This friending gives the helper class
- // access to the destructor.
- friend class SkAutoTUnref<SkData>::BlockRef<SkData>;
-
typedef SkFlattenable INHERITED;
};
-/**
- * Specialized version of SkAutoTUnref<SkData> for automatically unref-ing a
- * SkData.
- */
-class SkAutoDataUnref : SkNoncopyable {
-public:
- SkAutoDataUnref(SkData* data) : fRef(data) {}
- ~SkAutoDataUnref() {
- SkSafeUnref(fRef);
- }
+/** Typedef of SkAutoTUnref<SkData> for automatically unref-ing a SkData. */
+typedef SkAutoTUnref<SkData> SkAutoDataUnref;
- SkData* get() const { return fRef; }
-
- void release() {
- if (fRef) {
- fRef->unref();
- fRef = NULL;
- }
- }
-
- SkData *operator->() const { return fRef; }
- operator SkData*() { return fRef; }
-
-private:
- SkData* fRef;
-};
-
#endif
« no previous file with comments | « no previous file | include/core/SkRefCnt.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698