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

Issue 2820993002: Introduce base::IgnoreReuse() to wrap OnceCallback into RepeatingCallback (Closed)

Created:
3 years, 8 months ago by tzik
Modified:
3 years, 8 months ago
Reviewers:
dcheng
CC:
chromium-reviews, tfarina, danakj+watch_chromium.org, vmpstr+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Introduce base::IgnoreReuse() to wrap OnceCallback into RepeatingCallback This CL adds base::IgnoreReuse() and applies it to ImportantFileWriter. In some rare case such as ImportantFileWriter, ServiceWorkerStorage, and Mojo stuff, a called-only-once callback object is copied and passed to separate code paths, that blocks OnceCallback migration. base::IgnoreReuse() is a workaround for that by wrapping OnceCallback into a RepeatingCallback, and ignores past-first calls. BUG=668014 Review-Url: https://codereview.chromium.org/2820993002 Cr-Commit-Position: refs/heads/master@{#465979} Committed: https://chromium.googlesource.com/chromium/src/+/faa3495a7a1032e994a62ddb6009b23f2ac5a33c

Patch Set 1 #

Total comments: 2

Patch Set 2 : s/IgnoreReuse/AdaptCallbackForRepeating/, s/is_first_/has_run_/ #

Patch Set 3 : fix #

Patch Set 4 : fix #

Unified diffs Side-by-side diffs Delta from patch set Stats (+65 lines, -6 lines) Patch
M base/callback_helpers.h View 1 2 3 1 chunk +45 lines, -3 lines 0 comments Download
M base/callback_helpers_unittest.cc View 1 2 1 chunk +15 lines, -0 lines 0 comments Download
M base/files/important_file_writer.cc View 1 2 chunks +5 lines, -3 lines 0 comments Download

Messages

Total messages: 26 (21 generated)
tzik
PTAL
3 years, 8 months ago (2017-04-17 07:54:35 UTC) #5
dcheng
Code LGTM but I'm uncertain about the name. I don't want to block this CL ...
3 years, 8 months ago (2017-04-18 06:45:39 UTC) #8
tzik
https://codereview.chromium.org/2820993002/diff/1/base/callback_helpers.h File base/callback_helpers.h (right): https://codereview.chromium.org/2820993002/diff/1/base/callback_helpers.h#newcode49 base/callback_helpers.h:49: if (!subtle::NoBarrier_AtomicExchange(&is_first_, 0)) On 2017/04/18 06:45:39, dcheng (OOO through ...
3 years, 8 months ago (2017-04-20 06:06:05 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/2820993002/60001
3 years, 8 months ago (2017-04-20 12:15:57 UTC) #23
commit-bot: I haz the power
3 years, 8 months ago (2017-04-20 12:20:02 UTC) #26
Message was sent while issue was closed.
Committed patchset #4 (id:60001) as
https://chromium.googlesource.com/chromium/src/+/faa3495a7a1032e994a62ddb6009...

Powered by Google App Engine
This is Rietveld 408576698