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

Issue 2672753002: Refactor History's CommitLaterTask with CancelableCallback (Closed)

Created:
3 years, 10 months ago by mastiz
Modified:
3 years, 10 months ago
Reviewers:
Marc Treib, brettw, Gang Wu
CC:
chromium-reviews, vmpstr+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Refactor History's CommitLaterTask with CancelableCallback Addresses an old TODO to replace the class with CancelableCallback, which is almost a drop-in replacement. base::Unretained(this) is used for the callback because there should be, according to the DCHECK in the destructor, no scheduled commit during destruction. Review-Url: https://codereview.chromium.org/2672753002 Cr-Commit-Position: refs/heads/master@{#449735} Committed: https://chromium.googlesource.com/chromium/src/+/87585300304e2a813e13b18c3fca1022c167bf91

Patch Set 1 #

Patch Set 2 : Remove leftover friendship. #

Total comments: 5

Patch Set 3 : Use CancelableClosure instead, much simpler! #

Patch Set 4 : Minor comment change. #

Total comments: 5

Patch Set 5 : Reverted paranoid use of WeakPtr. #

Total comments: 2

Patch Set 6 : Added comment as suggested. #

Patch Set 7 : Explicitly close TestHistoryBackend. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+19 lines, -52 lines) Patch
M components/history/core/browser/history_backend.h View 1 2 3 4 5 4 chunks +5 lines, -5 lines 0 comments Download
M components/history/core/browser/history_backend.cc View 1 2 3 4 3 chunks +10 lines, -47 lines 0 comments Download
M components/history/core/browser/typed_url_syncable_service_unittest.cc View 1 2 3 4 5 6 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 44 (27 generated)
mastiz
treib@ for sanity-checking before looping in the owners.
3 years, 10 months ago (2017-02-02 10:42:17 UTC) #5
Marc Treib
Sanity check passed. I expect you'll be asked to add more tests for a base/ ...
3 years, 10 months ago (2017-02-02 10:52:21 UTC) #6
mastiz
PTAL. Sorry for the noise but I rethought the approach using CancelableCallback instead and it ...
3 years, 10 months ago (2017-02-02 12:35:54 UTC) #12
Marc Treib
Much simpler indeed! I expect that the base/ changes would be rejected if there's no ...
3 years, 10 months ago (2017-02-02 12:59:25 UTC) #13
mastiz
Thanks! https://codereview.chromium.org/2672753002/diff/60001/components/history/core/browser/history_backend.cc File components/history/core/browser/history_backend.cc (right): https://codereview.chromium.org/2672753002/diff/60001/components/history/core/browser/history_backend.cc#newcode2207 components/history/core/browser/history_backend.cc:2207: if (!scheduled_commit_.IsCancelled()) On 2017/02/02 12:59:24, Marc Treib wrote: ...
3 years, 10 months ago (2017-02-02 13:20:07 UTC) #17
mastiz
brettw@: I came across b/1165182 and decided to address it.
3 years, 10 months ago (2017-02-02 13:21:55 UTC) #19
brettw
Thanks! LGTM. https://codereview.chromium.org/2672753002/diff/80001/components/history/core/browser/history_backend.h File components/history/core/browser/history_backend.h (right): https://codereview.chromium.org/2672753002/diff/80001/components/history/core/browser/history_backend.h#newcode831 components/history/core/browser/history_backend.h:831: // can use Cancel() to cancel the ...
3 years, 10 months ago (2017-02-08 04:58:30 UTC) #22
mastiz
https://codereview.chromium.org/2672753002/diff/80001/components/history/core/browser/history_backend.h File components/history/core/browser/history_backend.h (right): https://codereview.chromium.org/2672753002/diff/80001/components/history/core/browser/history_backend.h#newcode831 components/history/core/browser/history_backend.h:831: // can use Cancel() to cancel the scheduled commit. ...
3 years, 10 months ago (2017-02-08 08:04:29 UTC) #23
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/2672753002/100001
3 years, 10 months ago (2017-02-08 08:05:53 UTC) #26
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/11018)
3 years, 10 months ago (2017-02-08 08:25:46 UTC) #28
mastiz
Adding gangwu@ because of newly added changes in typed_url_syncable_service_unittest.cc My change presumably introduces no behavioral ...
3 years, 10 months ago (2017-02-08 12:23:50 UTC) #34
mastiz
On 2017/02/08 12:23:50, mastiz wrote: > Adding gangwu@ because of newly added changes in > ...
3 years, 10 months ago (2017-02-09 08:14:07 UTC) #35
Gang Wu
lgtm
3 years, 10 months ago (2017-02-10 15:46:21 UTC) #36
Gang Wu
On 2017/02/09 08:14:07, mastiz wrote: > On 2017/02/08 12:23:50, mastiz wrote: > > Adding gangwu@ ...
3 years, 10 months ago (2017-02-10 16:29:02 UTC) #37
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/2672753002/120001
3 years, 10 months ago (2017-02-10 19:41:40 UTC) #40
commit-bot: I haz the power
Committed patchset #7 (id:120001) as https://chromium.googlesource.com/chromium/src/+/87585300304e2a813e13b18c3fca1022c167bf91
3 years, 10 months ago (2017-02-10 21:11:10 UTC) #43
msramek
3 years, 10 months ago (2017-02-13 09:43:58 UTC) #44
Message was sent while issue was closed.
A revert of this CL (patchset #7 id:120001) has been created in
https://codereview.chromium.org/2697513002/ by msramek@chromium.org.

The reason for reverting is: Suspect for introducing the memory leak in
~TypedUrlSyncableServiceTest_DeleteUrlAndVisits().

For more details, please see:
https://uberchromegw.corp.google.com/i/chromium.memory/builders/Linux%20Chrom....

Powered by Google App Engine
This is Rietveld 408576698