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

Issue 2657003003: Avoid unneeded refcount bump on disk_cache::File (Closed)

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

Description

Avoid unneeded refcount bump on disk_cache::File A PostTaskAndReply in disk_cache::File implementation has unneeded refcount bump, which is currently safe and going to be racy. This CL removes the count bump to avoid the race on the upcoming change. base::Callback retains the reference to disk_cache::File, and releases it on the callback destruction. PostTaskAndReply currently guarantees that it drops the reference to both `Task` callback and `Reply` callback on the origin thread. However after a proposed change for PostTaskAndReply, the `Task` callback will always be destroyed on the target thread of PostTaskAndReply. That implies that the refcount of disk_cache::File will be dropped on a worker thread, and causes a race on the refcount bump. https://codereview.chromium.org/2657603004/ Review-Url: https://codereview.chromium.org/2657003003 Cr-Commit-Position: refs/heads/master@{#446770} Committed: https://chromium.googlesource.com/chromium/src/+/dc974fef99b96b1a153fa7e7c35949de285c7e67

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+4 lines, -2 lines) Patch
M net/disk_cache/blockfile/file_posix.cc View 2 chunks +4 lines, -2 lines 0 comments Download

Messages

Total messages: 21 (14 generated)
tzik
PTAL
3 years, 10 months ago (2017-01-26 19:16:24 UTC) #6
mmenke
[+jkarlin]: Don't suppose you know the blockfile cache well enough to review this?
3 years, 10 months ago (2017-01-26 20:11:38 UTC) #8
jkarlin
On 2017/01/26 at 20:11:38, mmenke wrote: > [+jkarlin]: Don't suppose you know the blockfile cache ...
3 years, 10 months ago (2017-01-27 15:39:04 UTC) #9
mmenke
On 2017/01/27 15:39:04, jkarlin wrote: > On 2017/01/26 at 20:11:38, mmenke wrote: > > [+jkarlin]: ...
3 years, 10 months ago (2017-01-27 15:39:48 UTC) #12
gavinp
lgtm
3 years, 10 months ago (2017-01-27 17:21:43 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/2657003003/1
3 years, 10 months ago (2017-01-27 20:57:35 UTC) #18
commit-bot: I haz the power
3 years, 10 months ago (2017-01-27 21:14:34 UTC) #21
Message was sent while issue was closed.
Committed patchset #1 (id:1) as
https://chromium.googlesource.com/chromium/src/+/dc974fef99b96b1a153fa7e7c359...

Powered by Google App Engine
This is Rietveld 408576698