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

Issue 2707993005: Avoid returning a shallow copy of gfx::Image from gfx::ImageFamily::CreateExact (Closed)

Created:
3 years, 10 months ago by tzik
Modified:
3 years, 10 months ago
CC:
chromium-reviews, rsesek+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Avoid returning a shallow copy of gfx::Image from gfx::ImageFamily::CreateExact gfx::ImageFamily::CreateExact() conditionally returns a shallow copy of an internal gfx::Image. In that case, the resulting gfx::Image shares gfx::internal::ImageStorage with an gfx::Image held by the gfx::ImageFamily. Where gfx::internal::ImageStorage has non-thread-safe ref count. That implies, if the gfx::ImageFamily is created on UI thread and ImageFamily::CreateExact() is called on another thread, the copy operation of gfx::Image causes a data race on the ref count. E.g. web_apps::internals::UpdatePlatformShortcuts() on Windows calls gfx::ImageFamily::CreateExact() via IconUtil::CreateIconFileFromImageFamily() on FILE thread. BUG=688072, 468010 Review-Url: https://codereview.chromium.org/2707993005 Cr-Commit-Position: refs/heads/master@{#452740} Committed: https://chromium.googlesource.com/chromium/src/+/06203bafdd105bf358fd8f216fd77ae0053f4ec7

Patch Set 1 #

Patch Set 2 : fix #

Total comments: 2

Patch Set 3 : +comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+8 lines, -2 lines) Patch
M ui/gfx/image/image_family.cc View 1 2 1 chunk +8 lines, -2 lines 0 comments Download

Messages

Total messages: 27 (18 generated)
tzik
PTAL
3 years, 10 months ago (2017-02-22 09:38:22 UTC) #11
Robert Sesek
https://codereview.chromium.org/2707993005/diff/20001/ui/gfx/image/image_family.cc File ui/gfx/image/image_family.cc (right): https://codereview.chromium.org/2707993005/diff/20001/ui/gfx/image/image_family.cc#newcode121 ui/gfx/image/image_family.cc:121: std::unique_ptr<gfx::ImageSkia> image_skia(image->CopyImageSkia()); I'd leave a comment here as to ...
3 years, 10 months ago (2017-02-22 18:44:46 UTC) #15
tzik
https://codereview.chromium.org/2707993005/diff/20001/ui/gfx/image/image_family.cc File ui/gfx/image/image_family.cc (right): https://codereview.chromium.org/2707993005/diff/20001/ui/gfx/image/image_family.cc#newcode121 ui/gfx/image/image_family.cc:121: std::unique_ptr<gfx::ImageSkia> image_skia(image->CopyImageSkia()); On 2017/02/22 18:44:46, Robert Sesek wrote: > ...
3 years, 10 months ago (2017-02-22 22:01:16 UTC) #16
Matt Giuca
I had a few concerns to think about: 1. The fact that this assumes the ...
3 years, 10 months ago (2017-02-22 22:30:26 UTC) #17
Robert Sesek
LGTM
3 years, 10 months ago (2017-02-23 20:37:17 UTC) #18
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/2707993005/40001
3 years, 10 months ago (2017-02-23 23:50:48 UTC) #20
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_tsan_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_tsan_rel_ng/builds/21257)
3 years, 10 months ago (2017-02-24 03:04:31 UTC) #22
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/2707993005/40001
3 years, 10 months ago (2017-02-24 03:08:42 UTC) #24
commit-bot: I haz the power
3 years, 10 months ago (2017-02-24 03:36:10 UTC) #27
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://chromium.googlesource.com/chromium/src/+/06203bafdd105bf358fd8f216fd7...

Powered by Google App Engine
This is Rietveld 408576698