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

Issue 1773453002: Add element_type, swap, operators, fix reset on sk_sp. (Closed)

Created:
4 years, 9 months ago by bungeman-skia
Modified:
4 years, 9 months ago
Reviewers:
hal.canary, mtklein, reed1
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

Add element_type, swap, operators, fix reset on sk_sp. The 'element_type' typedef is to play nice with std::pointer_traits. The full complement of operators and swap to match unique_ptr so that sk_sp can be properly compared to nullptr and used with standard containers. Update to 'reset' so that calling 'unref' is the last operation. This also adds tests for these changes, and sets the fPtr to nullptr in debug for easier bug finding. Committed: https://skia.googlesource.com/skia/+/c901c11549acd19e7fc225276f78374ac1600496

Patch Set 1 #

Total comments: 2

Patch Set 2 : Add additional reset test. #

Total comments: 2

Patch Set 3 : Clang! You were the chosen one! #

Unified diffs Side-by-side diffs Delta from patch set Stats (+161 lines, -17 lines) Patch
M include/core/SkRefCnt.h View 9 chunks +85 lines, -17 lines 0 comments Download
M include/private/SkTLogic.h View 1 chunk +2 lines, -0 lines 0 comments Download
M tests/RefCntTest.cpp View 1 2 1 chunk +74 lines, -0 lines 0 comments Download

Messages

Total messages: 29 (16 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1773453002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1773453002/1
4 years, 9 months ago (2016-03-07 05:53:04 UTC) #4
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 9 months ago (2016-03-07 06:03:02 UTC) #6
bungeman-skia
This adds most of the basic function that unique_ptr has that sk_sp doesn't have yet.
4 years, 9 months ago (2016-03-07 15:50:43 UTC) #8
hal.canary
lgtm https://codereview.chromium.org/1773453002/diff/1/include/core/SkRefCnt.h File include/core/SkRefCnt.h (right): https://codereview.chromium.org/1773453002/diff/1/include/core/SkRefCnt.h#newcode354 include/core/SkRefCnt.h:354: swap(fPtr, that.fPtr); `std::swap(fPtr, that.fPtr);` is less verbose. You ...
4 years, 9 months ago (2016-03-07 16:00:25 UTC) #9
bungeman-skia
https://codereview.chromium.org/1773453002/diff/1/include/core/SkRefCnt.h File include/core/SkRefCnt.h (right): https://codereview.chromium.org/1773453002/diff/1/include/core/SkRefCnt.h#newcode354 include/core/SkRefCnt.h:354: swap(fPtr, that.fPtr); On 2016/03/07 16:00:25, Hal Canary wrote: > ...
4 years, 9 months ago (2016-03-07 16:16:36 UTC) #10
bungeman-skia
https://codereview.chromium.org/1773453002/diff/20001/include/core/SkRefCnt.h File include/core/SkRefCnt.h (right): https://codereview.chromium.org/1773453002/diff/20001/include/core/SkRefCnt.h#newcode332 include/core/SkRefCnt.h:332: void reset(T* ptr = nullptr) { At the very ...
4 years, 9 months ago (2016-03-07 20:07:55 UTC) #13
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1773453002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1773453002/20001
4 years, 9 months ago (2016-03-07 20:59:57 UTC) #15
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: Build-Mac-Clang-x86_64-Release-Trybot on client.skia.compile (JOB_FAILED, http://build.chromium.org/p/client.skia.compile/builders/Build-Mac-Clang-x86_64-Release-Trybot/builds/974)
4 years, 9 months ago (2016-03-07 21:04:02 UTC) #17
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1773453002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1773453002/40001
4 years, 9 months ago (2016-03-07 22:51:43 UTC) #21
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 9 months ago (2016-03-07 23:13:48 UTC) #23
reed1
api lgtm
4 years, 9 months ago (2016-03-08 14:40:27 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1773453002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1773453002/40001
4 years, 9 months ago (2016-03-08 16:34:28 UTC) #27
commit-bot: I haz the power
4 years, 9 months ago (2016-03-08 16:35:26 UTC) #29
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://skia.googlesource.com/skia/+/c901c11549acd19e7fc225276f78374ac1600496

Powered by Google App Engine
This is Rietveld 408576698