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

Issue 17880003: Alias deref -> unref. This allows Skia objects to be held by WTF::RefPtr (Closed)

Created:
7 years, 5 months ago by jbroman
Modified:
7 years, 5 months ago
Reviewers:
reed1
CC:
skia-review_googlegroups.com, tomhudson, danakj
Visibility:
Public.

Description

Alias deref -> unref. This allows Skia objects to be held by WTF::RefPtr smart pointers without need for another smart pointer type. Note that the semantics of SkRefCnt match those WTF expects. In particular, newly created objects have refcount 1 and objects are deallocated at refcount 0. This seems like a better fit than the AddRef/Release alises which exist for scoped_ptr (but seem unused). BUG=254509 Committed: http://code.google.com/p/skia/source/detail?r=9784

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+5 lines, -0 lines) Patch
M include/core/SkRefCnt.h View 1 chunk +5 lines, -0 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
reed1
lgtm
7 years, 5 months ago (2013-06-26 19:29:45 UTC) #1
bungeman-skia
On 2013/06/26 19:29:45, reed1 wrote: > lgtm I see no reason for this, there is ...
7 years, 5 months ago (2013-06-26 20:00:50 UTC) #2
jbroman
On 2013/06/26 20:00:50, bungeman1 wrote: > On 2013/06/26 19:29:45, reed1 wrote: > > lgtm > ...
7 years, 5 months ago (2013-06-26 20:02:14 UTC) #3
reed1
On 2013/06/26 20:02:14, jbroman wrote: > On 2013/06/26 20:00:50, bungeman1 wrote: > > On 2013/06/26 ...
7 years, 5 months ago (2013-06-26 20:13:15 UTC) #4
bungeman-skia
> Note that the semantics of SkRefCnt match those WTF expects. In > particular, newly ...
7 years, 5 months ago (2013-06-26 20:16:55 UTC) #5
jbroman
On 2013/06/26 20:16:55, bungeman1 wrote: > > Note that the semantics of SkRefCnt match those ...
7 years, 5 months ago (2013-06-26 20:51:36 UTC) #6
bungeman-skia
Ah, I see you have to do WTF::RefPtr<SkRefCnt> blah(WTF::adoptref(refCnt)); or an assignment. The thing that ...
7 years, 5 months ago (2013-06-26 21:07:01 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://skia-tree-status.appspot.com/cq/jbroman@chromium.org/17880003/1
7 years, 5 months ago (2013-06-26 21:12:00 UTC) #8
bungeman-skia
Oh, and yes, I was thinking of Chromium's RefCountedBase instead of WTF's RefCounted.
7 years, 5 months ago (2013-06-26 21:26:35 UTC) #9
commit-bot: I haz the power
7 years, 5 months ago (2013-06-26 22:20:24 UTC) #10
Message was sent while issue was closed.
Change committed as 9784

Powered by Google App Engine
This is Rietveld 408576698