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

Side by Side Diff: include/core/SkRefCnt.h

Issue 17880003: Alias deref -> unref. This allows Skia objects to be held by WTF::RefPtr (Closed) Base URL: http://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #ifndef SkRefCnt_DEFINED 10 #ifndef SkRefCnt_DEFINED
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 /** 74 /**
75 * Alias for ref(), for compatibility with scoped_refptr. 75 * Alias for ref(), for compatibility with scoped_refptr.
76 */ 76 */
77 void AddRef() { this->ref(); } 77 void AddRef() { this->ref(); }
78 78
79 /** 79 /**
80 * Alias for unref(), for compatibility with scoped_refptr. 80 * Alias for unref(), for compatibility with scoped_refptr.
81 */ 81 */
82 void Release() { this->unref(); } 82 void Release() { this->unref(); }
83 83
84 /**
85 * Alias for unref(), for compatibility with WTF::RefPtr.
86 */
87 void deref() { this->unref(); }
88
84 protected: 89 protected:
85 /** 90 /**
86 * Allow subclasses to call this if they've overridden internal_dispose 91 * Allow subclasses to call this if they've overridden internal_dispose
87 * so they can reset fRefCnt before the destructor is called. Should only 92 * so they can reset fRefCnt before the destructor is called. Should only
88 * be called right before calling through to inherited internal_dispose() 93 * be called right before calling through to inherited internal_dispose()
89 * or before calling the destructor. 94 * or before calling the destructor.
90 */ 95 */
91 void internal_dispose_restore_refcnt_to_1() const { 96 void internal_dispose_restore_refcnt_to_1() const {
92 #ifdef SK_DEBUG 97 #ifdef SK_DEBUG
93 SkASSERT(0 == fRefCnt); 98 SkASSERT(0 == fRefCnt);
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 typedef T* SkRefPtr::*unspecified_bool_type; 262 typedef T* SkRefPtr::*unspecified_bool_type;
258 operator unspecified_bool_type() const { 263 operator unspecified_bool_type() const {
259 return fObj ? &SkRefPtr::fObj : NULL; 264 return fObj ? &SkRefPtr::fObj : NULL;
260 } 265 }
261 266
262 private: 267 private:
263 T* fObj; 268 T* fObj;
264 }; 269 };
265 270
266 #endif 271 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698