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

Issue 2655213004: Avoid retaining a reference to ActivityIconLoader in its OnIconReady() (Closed)

Created:
3 years, 11 months ago by tzik
Modified:
3 years, 11 months ago
Reviewers:
hidehiko
CC:
chromium-reviews, elijahtaylor+arcwatch_chromium.org, hidehiko+watch_chromium.org, lhchavez+watch_chromium.org, yusukes+watch_chromium.org, Yusuke Sato
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Avoid retaining a reference to ActivityIconLoader in its OnIconReady() ActivityIconLoader has a non thread safe refcount, and hops to the other thread with PostTaskAndReplyWithResult. Though that is safe in the current implementation of PostTaskAndReplyWithResult, it's fragile and upcoming PostTaskAndReplyWithResult will break it. This CL removes the refcount bump on the thread hop to avoid a racy refcount decrement. Review-Url: https://codereview.chromium.org/2655213004 Cr-Commit-Position: refs/heads/master@{#446332} Committed: https://chromium.googlesource.com/chromium/src/+/7ef354f5af9e651f60ed079fdbb176b924952e31

Patch Set 1 #

Total comments: 2

Patch Set 2 : +static #

Patch Set 3 : +-DCHECK(thread_checker_.COVT()); #

Unified diffs Side-by-side diffs Delta from patch set Stats (+7 lines, -4 lines) Patch
M components/arc/intent_helper/activity_icon_loader.h View 1 1 chunk +1 line, -1 line 0 comments Download
M components/arc/intent_helper/activity_icon_loader.cc View 1 2 4 chunks +6 lines, -3 lines 0 comments Download

Messages

Total messages: 20 (14 generated)
tzik
PTAL
3 years, 11 months ago (2017-01-26 12:41:25 UTC) #4
hidehiko
CC: yusukes@. https://codereview.chromium.org/2655213004/diff/1/components/arc/intent_helper/activity_icon_loader.cc File components/arc/intent_helper/activity_icon_loader.cc (right): https://codereview.chromium.org/2655213004/diff/1/components/arc/intent_helper/activity_icon_loader.cc#newcode166 components/arc/intent_helper/activity_icon_loader.cc:166: base::Bind(&ActivityIconLoader::ResizeAndEncodeIcons, (I know it is not your ...
3 years, 11 months ago (2017-01-26 13:14:20 UTC) #7
tzik
https://codereview.chromium.org/2655213004/diff/1/components/arc/intent_helper/activity_icon_loader.cc File components/arc/intent_helper/activity_icon_loader.cc (right): https://codereview.chromium.org/2655213004/diff/1/components/arc/intent_helper/activity_icon_loader.cc#newcode166 components/arc/intent_helper/activity_icon_loader.cc:166: base::Bind(&ActivityIconLoader::ResizeAndEncodeIcons, On 2017/01/26 13:14:20, hidehiko wrote: > (I know ...
3 years, 11 months ago (2017-01-26 13:21:12 UTC) #12
hidehiko
lgtm Thanks!
3 years, 11 months ago (2017-01-26 13:54:31 UTC) #15
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/2655213004/40001
3 years, 11 months ago (2017-01-26 15:13:47 UTC) #17
commit-bot: I haz the power
3 years, 11 months ago (2017-01-26 15:18:21 UTC) #20
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://chromium.googlesource.com/chromium/src/+/7ef354f5af9e651f60ed079fdbb1...

Powered by Google App Engine
This is Rietveld 408576698