DescriptionOnly use skia::RefPtr for refcounting
For consistency and sanity in Chromium, only use skia::RefPtr in Chromium to
ref count skia classes. SkRefPtr is unsafe to use for newly created objects
because it refs the object that is passed to its constructor. skia::RefPtr
makes this adoption explicit it via skia::AdoptRef and so is much clearer.
This patch also adds a skia::ShareRef function which makes it explicit that the
callsite is adopting a ref which is already owned somewhere else. Using
AdoptRef vs. ShareRef seems much clearer than using SkRefPtr vs. skia::RefPtr.
These are the remaining code sites that use internal Skia reference counted
classes. Once these have been removed, then we can use a PRESUBMIT rule to
prevent new uses from being added.
BUG=none
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=200989
Patch Set 1 #
Total comments: 10
Patch Set 2 : Add missing files oops #
Total comments: 3
Patch Set 3 : Comment rewording #
Total comments: 8
Patch Set 4 : Comment changes, SharePtr #
Messages
Total messages: 15 (0 generated)
|