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

Issue 2692343008: Convert gfx::internal::ImageStorage RefCountedThreadSafe (Closed)

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

Description

Convert gfx::internal::ImageStorage RefCountedThreadSafe gfx::internal::ImageStorage has non-thread-safe ref count, but the ref count is accessed from multiple threads. It is held by multiple gfx::Image instances, gfx::Image is held by gfx::ImageFamily, and web_app::ShortcutInfo has gfx::ImageFamily. Where, web_app::ShortcutInfo is created on UI thread, and destroyed on FILE thread. Implies, the ref count of gfx::internal::ImageStorage is touched from both FILE thread and UI thread, and causes a data race. This CL converts gfx::internal::ImageStorage from RefCounted to RefCountedThreadSafe to avoid the race. BUG=688072

Patch Set 1 #

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

Depends on Patchset:

Dependent Patchsets:

Messages

Total messages: 10 (7 generated)
tzik
PTAL
3 years, 10 months ago (2017-02-17 13:05:36 UTC) #6
Robert Sesek
I don't think it's this simple, unfortunately. The basic issue is that gfx::Image is not ...
3 years, 10 months ago (2017-02-17 20:44:56 UTC) #9
tzik
3 years, 10 months ago (2017-02-21 06:51:11 UTC) #10
On 2017/02/17 20:44:56, Robert Sesek wrote:
> I don't think it's this simple, unfortunately. The basic issue is that
> gfx::Image is not threadsafe and shouldn't be treated as such. Fixing the
> refcounting issue does not fix the actual thread safety problem. There's quite
a
> bit of history here:
> 
>
https://groups.google.com/a/chromium.org/d/msg/chromium-dev/8LqVoXQ_2bo/cW0tH...
> https://bugs.chromium.org/p/chromium/issues/detail?id=468010

Ah.. OK, make sense. Let me change the approach to fix the users of gfx::Image
rather than the ref count itself.

Powered by Google App Engine
This is Rietveld 408576698