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

Issue 2406423003: Remove MessageLoop::current() from history_service.cc (Closed)

Created:
4 years, 2 months ago by fdoray
Modified:
4 years, 2 months ago
Reviewers:
sdefresne
CC:
chromium-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Remove MessageLoop::current() from history_service.cc Whenever possible, use Thread/SequencedTaskRunnerHandle::Get() instead of MessageLoop::current(). Thread/SequencedTaskRunnerHandle::Get() work within TaskScheduler while MessageLoop::current() doesn't. Good reasons to use MessageLoop::current(): - Add destruction, nesting or task observers. - Run nested loops. Bad reasons to use MessageLoop::current(): - Post tasks. Use Thread/SequencedTaskRunnerHandle::Get() instead. - Watch a file descriptor. Use FileDescriptorWatcher instead. - Verify that it is possible to post tasks to the current thread. Use Thread/SequencedTaskRunnerHandle::IsSet() instead. - Verify that code runs on a specific thread. Use SingleThreadTaskRunner::BelongsToCurrentThread() instead. BUG=650723 Committed: https://crrev.com/571fada22bd532cb22a98ff61092026826deb98b Cr-Commit-Position: refs/heads/master@{#425121}

Patch Set 1 #

Patch Set 2 : fix build error #

Total comments: 2

Patch Set 3 : CR sdefresne #11 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+12 lines, -14 lines) Patch
M components/history/core/browser/history_backend.h View 1 2 3 chunks +4 lines, -4 lines 0 comments Download
M components/history/core/browser/history_backend.cc View 4 chunks +6 lines, -8 lines 0 comments Download
M components/history/core/browser/history_service.cc View 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 18 (12 generated)
fdoray
PTAL
4 years, 2 months ago (2016-10-12 20:02:01 UTC) #10
sdefresne
lgtm https://codereview.chromium.org/2406423003/diff/20001/components/history/core/browser/history_backend.h File components/history/core/browser/history_backend.h (right): https://codereview.chromium.org/2406423003/diff/20001/components/history/core/browser/history_backend.h#newcode44 components/history/core/browser/history_backend.h:44: class MessageLoop; I think you can remove this ...
4 years, 2 months ago (2016-10-13 17:25:35 UTC) #11
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/2406423003/40001
4 years, 2 months ago (2016-10-13 18:25:24 UTC) #14
fdoray
https://codereview.chromium.org/2406423003/diff/20001/components/history/core/browser/history_backend.h File components/history/core/browser/history_backend.h (right): https://codereview.chromium.org/2406423003/diff/20001/components/history/core/browser/history_backend.h#newcode44 components/history/core/browser/history_backend.h:44: class MessageLoop; On 2016/10/13 17:25:35, sdefresne wrote: > I ...
4 years, 2 months ago (2016-10-13 18:30:27 UTC) #15
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 2 months ago (2016-10-13 19:15:54 UTC) #16
commit-bot: I haz the power
4 years, 2 months ago (2016-10-13 19:17:43 UTC) #18
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/571fada22bd532cb22a98ff61092026826deb98b
Cr-Commit-Position: refs/heads/master@{#425121}

Powered by Google App Engine
This is Rietveld 408576698