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

Issue 2326473005: Use sk_sp<SkBitmap::Allocator> instead of raw pointers or WTF::RefPtr<T>. (Closed)

Created:
4 years, 3 months ago by Łukasz Anforowicz
Modified:
4 years, 3 months ago
CC:
chromium-reviews, krit, drott+blinkwatch_chromium.org, blink-reviews-platform-graphics_chromium.org, dshwang, pdr+graphicswatchlist_chromium.org, jbroman, Justin Novosad, Rik, f(malita), blink-reviews, danakj+watch_chromium.org, ajuma+watch_chromium.org, Stephen Chennney, rwlbuis, scroggo_chromium, danakj, dcheng
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Allocate ExternalMemoryAllocator on the stack. The change is desirable because: - Ref-counting doesn't result in memory safety here, because ExternalMemoryAllocator wraps a raw pointer to short-lived memory. Ref-counting cannot extend the lifetime of the memory this pointer points to. - No consumers of SkBitmap::Allocator currently use ref-counting. If SkBitmap::Allocator was designed today, it probably wouldn't use SkRefCnt as a base class. - Blink-to-Chromium style conversion will rename |ref| to |Ref| in WTF, but won't do it outside of Blink/WTF (e.g. in Skia), so RefPtr should only be used with Blink/WTF types going forward (i.e. Skia types should be wrapped in smart pointers provided by Skia). More discussion is in an older code review: https://codereview.chromium.org/1880993003/#msg10 BUG=641014 Committed: https://crrev.com/34971fa949b0957eb7c4feb575f372b2c0c6b98a Cr-Commit-Position: refs/heads/master@{#418657}

Patch Set 1 #

Total comments: 9

Patch Set 2 : Allocating ExternalMemoryAllocator on the stack. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+8 lines, -5 lines) Patch
M third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp View 1 1 chunk +8 lines, -5 lines 0 comments Download

Messages

Total messages: 32 (17 generated)
Łukasz Anforowicz
Stephen, could you please take a look? https://codereview.chromium.org/2326473005/diff/1/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp File third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp (right): https://codereview.chromium.org/2326473005/diff/1/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp#newcode281 third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp:281: (*decoder)->setMemoryAllocator(std::move(allocator)); |allocator| ...
4 years, 3 months ago (2016-09-09 20:10:04 UTC) #5
scroggo_chromium
https://codereview.chromium.org/2326473005/diff/1/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp File third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp (right): https://codereview.chromium.org/2326473005/diff/1/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp#newcode281 third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp:281: (*decoder)->setMemoryAllocator(std::move(allocator)); On 2016/09/09 20:10:04, Łukasz Anforowicz wrote: > |allocator| ...
4 years, 3 months ago (2016-09-09 20:51:05 UTC) #7
Łukasz Anforowicz
https://codereview.chromium.org/2326473005/diff/1/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp File third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp (right): https://codereview.chromium.org/2326473005/diff/1/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp#newcode281 third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp:281: (*decoder)->setMemoryAllocator(std::move(allocator)); On 2016/09/09 20:51:04, scroggo_chromium wrote: > On 2016/09/09 ...
4 years, 3 months ago (2016-09-12 20:50:09 UTC) #10
scroggo_chromium
https://codereview.chromium.org/2326473005/diff/1/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp File third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp (right): https://codereview.chromium.org/2326473005/diff/1/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp#newcode281 third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp:281: (*decoder)->setMemoryAllocator(std::move(allocator)); On 2016/09/12 20:50:09, Łukasz Anforowicz wrote: > On ...
4 years, 3 months ago (2016-09-13 14:54:42 UTC) #11
Łukasz Anforowicz
scroggo@, can you take another look please? (I've tried to also update the CL description ...
4 years, 3 months ago (2016-09-13 18:17:31 UTC) #15
scroggo_chromium
LGTM. Thanks!
4 years, 3 months ago (2016-09-13 18:24:02 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2326473005/20001
4 years, 3 months ago (2016-09-13 18:36:53 UTC) #19
Łukasz Anforowicz
senorblanco@, can you do an OWNERS review please?
4 years, 3 months ago (2016-09-13 18:38:30 UTC) #20
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/258533)
4 years, 3 months ago (2016-09-13 18:45:39 UTC) #22
Stephen White
LGTM
4 years, 3 months ago (2016-09-14 13:02:50 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2326473005/20001
4 years, 3 months ago (2016-09-14 14:10:13 UTC) #25
commit-bot: I haz the power
Try jobs failed on following builders: android_clang_dbg_recipe on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_clang_dbg_recipe/builds/128874)
4 years, 3 months ago (2016-09-14 18:04:11 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2326473005/20001
4 years, 3 months ago (2016-09-14 19:50:51 UTC) #29
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 3 months ago (2016-09-14 20:27:16 UTC) #30
commit-bot: I haz the power
4 years, 3 months ago (2016-09-14 20:29:16 UTC) #32
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/34971fa949b0957eb7c4feb575f372b2c0c6b98a
Cr-Commit-Position: refs/heads/master@{#418657}

Powered by Google App Engine
This is Rietveld 408576698