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

Issue 11418217: Add skia::RefPtr class to wrap ref counted classes from Skia. (Closed)

Created:
8 years ago by danakj
Modified:
8 years ago
Reviewers:
jamesr, Stephen White, awong, sky
CC:
chromium-reviews, cc-bugs_chromium.org, darin-cc_chromium.org, piman, backer
Visibility:
Public.

Description

Add skia::RefPtr class to wrap ref counted classes from Skia. This class behaves like scoped_refptr and wraps the raw SkRefCnt subclass so that we don't have to call ref() and unref() directly on the pointers. Tested by: unit_tests:RefPtrTest.ReferenceCounting unit_tests:RefPtrTest.Construct unit_tests:RefPtrTest.DeclareAndAssign unit_tests:RefPtrTest.Assign unit_tests:RefPtrTest.Upcast BUG=163454 NOTRY=true Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=170851

Patch Set 1 #

Patch Set 2 : nit #

Total comments: 1

Patch Set 3 : missed unittest file #

Patch Set 4 : skia/ext #

Patch Set 5 : compile #

Patch Set 6 : All of chrome #

Patch Set 7 : Drop TNoRef #

Total comments: 11

Patch Set 8 : AdoptRef #

Patch Set 9 : No SkAutoTUnref #

Patch Set 10 : Missed AdoptRef in a couple unit tests #

Patch Set 11 : Rebase #

Patch Set 12 : Just skia/ #

Total comments: 12

Patch Set 13 : Fix ui_unittests #

Patch Set 14 : review #

Total comments: 6

Patch Set 15 : #

Patch Set 16 : ajwong review #

Patch Set 17 : match linux #

Total comments: 2

Patch Set 18 : Remove include #

Total comments: 1

Patch Set 19 : nit+rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+321 lines, -94 lines) Patch
M chrome/chrome_tests_unit.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +1 line, -0 lines 0 comments Download
M chrome/renderer/automation/automation_renderer_helper.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M chrome/renderer/print_web_view_helper_linux.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +2 lines, -3 lines 0 comments Download
M chrome/renderer/print_web_view_helper_mac.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/renderer/print_web_view_helper_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +4 lines, -4 lines 0 comments Download
M skia/ext/bitmap_platform_device_android.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -1 line 0 comments Download
M skia/ext/bitmap_platform_device_linux.cc View 1 2 3 4 5 6 7 1 chunk +2 lines, -1 line 0 comments Download
M skia/ext/bitmap_platform_device_mac.h View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +4 lines, -4 lines 0 comments Download
M skia/ext/bitmap_platform_device_mac.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +6 lines, -6 lines 0 comments Download
M skia/ext/bitmap_platform_device_win.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +5 lines, -5 lines 0 comments Download
M skia/ext/bitmap_platform_device_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +5 lines, -8 lines 0 comments Download
M skia/ext/platform_canvas.h View 1 2 3 4 5 6 7 8 3 chunks +7 lines, -4 lines 0 comments Download
M skia/ext/platform_canvas.cc View 1 2 3 4 5 6 7 2 chunks +5 lines, -4 lines 0 comments Download
M skia/ext/platform_canvas_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 9 chunks +9 lines, -9 lines 0 comments Download
A skia/ext/refptr.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +98 lines, -0 lines 0 comments Download
A skia/ext/refptr_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +125 lines, -0 lines 0 comments Download
M skia/ext/vector_canvas.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +2 lines, -2 lines 0 comments Download
M skia/ext/vector_canvas_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 5 chunks +15 lines, -14 lines 0 comments Download
M skia/ext/vector_platform_device_emf_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +2 lines, -2 lines 0 comments Download
M skia/ext/vector_platform_device_skia.h View 1 2 3 4 5 2 chunks +2 lines, -2 lines 0 comments Download
M skia/ext/vector_platform_device_skia.cc View 1 2 3 4 5 6 7 2 chunks +3 lines, -4 lines 0 comments Download
M skia/skia.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +1 line, -0 lines 0 comments Download
M ui/gfx/blit_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +18 lines, -18 lines 0 comments Download

Messages

Total messages: 33 (0 generated)
danakj
https://codereview.appspot.com/6849109/ has gone nowhere except to prompt the removal of SkRefPtr from skia... So here ...
8 years ago (2012-11-28 22:08:06 UTC) #1
jamesr
https://codereview.chromium.org/11418217/diff/2001/cc/skia_refptr.h File cc/skia_refptr.h (right): https://codereview.chromium.org/11418217/diff/2001/cc/skia_refptr.h#newcode13 cc/skia_refptr.h:13: class SkiaRefPtr { This doesn't belong in cc/
8 years ago (2012-11-28 22:20:54 UTC) #2
danakj
PTAL. Moved it to skia/ext
8 years ago (2012-11-29 02:21:41 UTC) #3
danakj
In the last upload, I got rid of every call to ->ref() and ->unref() in ...
8 years ago (2012-11-29 04:17:21 UTC) #4
danakj
senorblanco can you please review skia/ jamesr can you please review cc/ and i'll find ...
8 years ago (2012-11-29 04:17:58 UTC) #5
jamesr
lgtm for cc/, content/renderer/, and webkit/ although I think Stephen should look over the cc ...
8 years ago (2012-11-29 07:34:05 UTC) #6
Stephen White
Thanks for taking this on! https://codereview.chromium.org/11418217/diff/6027/skia/ext/refptr.h File skia/ext/refptr.h (right): https://codereview.chromium.org/11418217/diff/6027/skia/ext/refptr.h#newcode26 skia/ext/refptr.h:26: RefPtr(T* ptr) : ptr_(ptr) ...
8 years ago (2012-11-29 18:42:04 UTC) #7
danakj
PTAL! We have skia::AdoptRef() now :) And I replaced all SkAutoTUnref's as well. https://codereview.chromium.org/11418217/diff/6027/skia/ext/refptr.h File ...
8 years ago (2012-11-29 21:37:11 UTC) #8
danakj
https://codereview.chromium.org/11418217/diff/6027/skia/ext/refptr.h File skia/ext/refptr.h (right): https://codereview.chromium.org/11418217/diff/6027/skia/ext/refptr.h#newcode33 skia/ext/refptr.h:33: // take ownership. On 2012/11/29 21:37:11, danakj wrote: > ...
8 years ago (2012-11-29 21:38:01 UTC) #9
danakj
I missed AdoptRef() in a couple unit test files when assigning, so I've updated the ...
8 years ago (2012-11-29 21:49:42 UTC) #10
danakj
I need to split this CL up. I'll do just skia/ on this one.
8 years ago (2012-11-29 22:12:46 UTC) #11
danakj
@senorblanco: This CL is just the skia/ bits (and a minimal change outside that falls ...
8 years ago (2012-11-29 22:38:53 UTC) #12
Stephen White
https://codereview.chromium.org/11418217/diff/7151/skia/ext/refptr.h File skia/ext/refptr.h (right): https://codereview.chromium.org/11418217/diff/7151/skia/ext/refptr.h#newcode35 skia/ext/refptr.h:35: // wrap the raw pointer immediately in a skia::RefPtr ...
8 years ago (2012-11-29 23:00:33 UTC) #13
Stephen White
https://codereview.chromium.org/11418217/diff/7151/skia/ext/vector_canvas_unittest.cc File skia/ext/vector_canvas_unittest.cc (right): https://codereview.chromium.org/11418217/diff/7151/skia/ext/vector_canvas_unittest.cc#newcode733 skia/ext/vector_canvas_unittest.cc:733: skia::RefPtr<SkPathEffect> effect = new SkDashPathEffect( In fact, it doesn't ...
8 years ago (2012-11-29 23:11:46 UTC) #14
danakj
https://codereview.chromium.org/11418217/diff/7151/skia/ext/refptr.h File skia/ext/refptr.h (right): https://codereview.chromium.org/11418217/diff/7151/skia/ext/refptr.h#newcode35 skia/ext/refptr.h:35: // wrap the raw pointer immediately in a skia::RefPtr ...
8 years ago (2012-11-29 23:15:52 UTC) #15
Stephen White
LGTM. Thanks for sticking with this! https://codereview.chromium.org/11418217/diff/7151/skia/ext/refptr.h File skia/ext/refptr.h (right): https://codereview.chromium.org/11418217/diff/7151/skia/ext/refptr.h#newcode35 skia/ext/refptr.h:35: // wrap the ...
8 years ago (2012-11-29 23:51:01 UTC) #16
danakj
Thanks! https://codereview.chromium.org/11418217/diff/7151/skia/ext/refptr.h File skia/ext/refptr.h (right): https://codereview.chromium.org/11418217/diff/7151/skia/ext/refptr.h#newcode35 skia/ext/refptr.h:35: // wrap the raw pointer immediately in a ...
8 years ago (2012-11-29 23:51:47 UTC) #17
sky
I'm adding Albert to this. I think he should take a look at skia/ext/refptr.h to ...
8 years ago (2012-11-29 23:57:31 UTC) #18
danakj
On 2012/11/29 23:57:31, sky wrote: > I'm adding Albert to this. I think he should ...
8 years ago (2012-11-30 00:05:57 UTC) #19
awong
This is actually closer to scoped_refptr<> rather than scoped_ptr<> because the type is copyable and ...
8 years ago (2012-11-30 00:10:24 UTC) #20
danakj
I think skia/ already depends on base, I see it in the gyp. However changing ...
8 years ago (2012-11-30 00:25:09 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/danakj@chromium.org/11418217/9060
8 years ago (2012-11-30 02:02:24 UTC) #22
commit-bot: I haz the power
Presubmit check for 11418217-9060 failed and returned exit status 1. Running presubmit commit checks ...
8 years ago (2012-11-30 02:02:36 UTC) #23
danakj
woops, pending sky@ review :)
8 years ago (2012-11-30 02:04:42 UTC) #24
sky
https://codereview.chromium.org/11418217/diff/10130/skia/ext/vector_canvas.h File skia/ext/vector_canvas.h (right): https://codereview.chromium.org/11418217/diff/10130/skia/ext/vector_canvas.h#newcode10 skia/ext/vector_canvas.h:10: #include "skia/ext/refptr.h" Do you really need this include here?
8 years ago (2012-12-03 15:25:04 UTC) #25
danakj
https://codereview.chromium.org/11418217/diff/10130/skia/ext/vector_canvas.h File skia/ext/vector_canvas.h (right): https://codereview.chromium.org/11418217/diff/10130/skia/ext/vector_canvas.h#newcode10 skia/ext/vector_canvas.h:10: #include "skia/ext/refptr.h" On 2012/12/03 15:25:04, sky wrote: > Do ...
8 years ago (2012-12-03 16:52:37 UTC) #26
danakj
PTAL
8 years ago (2012-12-03 16:57:41 UTC) #27
Stephen White
LGTM. https://codereview.chromium.org/11418217/diff/12143/skia/ext/vector_platform_device_emf_win.cc File skia/ext/vector_platform_device_emf_win.cc (right): https://codereview.chromium.org/11418217/diff/12143/skia/ext/vector_platform_device_emf_win.cc#newcode12 skia/ext/vector_platform_device_emf_win.cc:12: #include "skia/ext/refptr.h" Nit: can probably get rid of ...
8 years ago (2012-12-03 17:37:52 UTC) #28
sky
LGTM
8 years ago (2012-12-03 18:09:58 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/danakj@chromium.org/11418217/2074
8 years ago (2012-12-03 18:53:21 UTC) #30
commit-bot: I haz the power
Retried try job too often on win_rel for step(s) browser_tests
8 years ago (2012-12-04 00:32:55 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/danakj@chromium.org/11418217/2074
8 years ago (2012-12-04 00:35:37 UTC) #32
commit-bot: I haz the power
8 years ago (2012-12-04 00:37:14 UTC) #33
Message was sent while issue was closed.
Change committed as 170851

Powered by Google App Engine
This is Rietveld 408576698