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

Issue 2033933002: Remove use of deprecated MessageLoop methods in sync. (Closed)

Created:
4 years, 6 months ago by fdoray
Modified:
4 years, 6 months ago
Reviewers:
maxbogue
CC:
chromium-reviews, sync-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Remove use of deprecated MessageLoop methods in sync. MessageLoop::PostTask/PostDelayedTask/DeleteSoon/ReleaseSoon are deprecated. This CL makes the following replacements to remove some uses of these methods: "MessageLoop(ForUI|ForIO)::current()->PostTask" -> "ThreadTaskRunnerHandle::Get()->PostTask" "MessageLoop(ForUI|ForIO)::current()->PostDelayedTask" -> "ThreadTaskRunnerHandle::Get()->PostDelayedTask" "MessageLoop(ForUI|ForIO)::current()->DeleteSoon" -> "ThreadTaskRunnerHandle::Get()->DeleteSoon" "MessageLoop(ForUI|ForIO)::current()->ReleaseSoon" -> "ThreadTaskRunnerHandle::Get()->ReleaseSoon" In files where these replacements are made, it adds these includes: #include "base/location.h" #include "base/single_thread_task_runner.h" #include "base/threading/thread_task_runner_handle.h" And removes this include if it is no longer required: #include "base/message_loop/message_loop.h" Why ThreadTaskRunnerHandle::Get() instead of MessageLoop::current()->task_runner()? - The two are equivalent on threads that run a MessageLoop. - MessageLoop::current() doesn't work in base/task_scheduler because the scheduler's thread don't run MessageLoops. This CL will therefore facilitate the migration of browser threads to base/task_scheduler. Steps to generate this patch: 1. Run message_loop_cleanup.py (see code on the bug). 2. Run tools/sort-headers.py on modified files. 3. Run git cl format. BUG=616447 R=maxbogue@chromium.org Committed: https://crrev.com/f7dac376dd528ef2d60adbb62a7373ccd91c221e Cr-Commit-Position: refs/heads/master@{#398082}

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+79 lines, -62 lines) Patch
M sync/engine/sync_scheduler_impl.cc View 2 chunks +5 lines, -3 lines 1 comment Download
M sync/engine/sync_scheduler_unittest.cc View 3 chunks +9 lines, -6 lines 0 comments Download
M sync/internal_api/attachments/attachment_downloader_impl.cc View 2 chunks +4 lines, -2 lines 0 comments Download
M sync/internal_api/attachments/attachment_downloader_impl_unittest.cc View 2 chunks +4 lines, -5 lines 0 comments Download
M sync/internal_api/attachments/attachment_service_impl.cc View 2 chunks +3 lines, -2 lines 0 comments Download
M sync/internal_api/attachments/attachment_service_impl_unittest.cc View 5 chunks +9 lines, -10 lines 0 comments Download
M sync/internal_api/attachments/attachment_service_proxy_unittest.cc View 2 chunks +5 lines, -3 lines 0 comments Download
M sync/internal_api/attachments/attachment_uploader_impl.cc View 2 chunks +7 lines, -7 lines 0 comments Download
M sync/internal_api/attachments/attachment_uploader_impl_unittest.cc View 2 chunks +6 lines, -7 lines 0 comments Download
M sync/internal_api/attachments/fake_attachment_downloader.cc View 2 chunks +4 lines, -2 lines 0 comments Download
M sync/internal_api/attachments/fake_attachment_uploader.cc View 2 chunks +5 lines, -3 lines 0 comments Download
M sync/internal_api/http_bridge.cc View 2 chunks +5 lines, -1 line 0 comments Download
M sync/internal_api/sync_encryption_handler_impl.cc View 3 chunks +9 lines, -9 lines 0 comments Download
M sync/syncable/directory_backing_store.cc View 2 chunks +4 lines, -2 lines 0 comments Download

Messages

Total messages: 11 (4 generated)
fdoray
Can you review this CL? Thanks.
4 years, 6 months ago (2016-06-06 16:36:36 UTC) #2
maxbogue
https://codereview.chromium.org/2033933002/diff/1/sync/engine/sync_scheduler_impl.cc File sync/engine/sync_scheduler_impl.cc (right): https://codereview.chromium.org/2033933002/diff/1/sync/engine/sync_scheduler_impl.cc#newcode17 sync/engine/sync_scheduler_impl.cc:17: #include "base/single_thread_task_runner.h" Has it been considered to just include ...
4 years, 6 months ago (2016-06-06 16:52:17 UTC) #3
fdoray
On 2016/06/06 16:52:17, maxbogue wrote: > https://codereview.chromium.org/2033933002/diff/1/sync/engine/sync_scheduler_impl.cc > File sync/engine/sync_scheduler_impl.cc (right): > > https://codereview.chromium.org/2033933002/diff/1/sync/engine/sync_scheduler_impl.cc#newcode17 > ...
4 years, 6 months ago (2016-06-06 17:08:48 UTC) #4
maxbogue
lgtm
4 years, 6 months ago (2016-06-06 17:18:17 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2033933002/1
4 years, 6 months ago (2016-06-06 17:19:16 UTC) #7
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 6 months ago (2016-06-06 19:07:03 UTC) #9
commit-bot: I haz the power
4 years, 6 months ago (2016-06-06 19:08:31 UTC) #11
Message was sent while issue was closed.
Patchset 1 (id:??) landed as
https://crrev.com/f7dac376dd528ef2d60adbb62a7373ccd91c221e
Cr-Commit-Position: refs/heads/master@{#398082}

Powered by Google App Engine
This is Rietveld 408576698