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

Issue 2404353002: Remove MessageLoop::current() from base_session_service.cc. (Closed)

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

Description

Remove MessageLoop::current() from base_session_service.cc. Whenever possible, use ThreadTaskRunnerHandle::Get() instead of MessageLoop::current(). ThreadTaskRunnerHandle::Get() works 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 ThreadTaskRunnerHandle::Get() instead. - Watch a file descriptor. Use FileDescriptorWatcher instead. - Verify that it is possible to post tasks to the current thread. Use ThreadTaskRunnerHandle::IsSet() instead. - Verify that code runs on a specific thread. Use SingleThreadTaskRunner::BelongsToCurrentThread() instead. BUG=650723 Committed: https://crrev.com/8df1700462b359e414db9718d201cb3acb4e094e Cr-Commit-Position: refs/heads/master@{#425363}

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2 lines, -2 lines) Patch
M components/sessions/core/base_session_service.cc View 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 21 (8 generated)
fdoray
PTAL
4 years, 2 months ago (2016-10-11 19:41:37 UTC) #6
Mr4D (OOO till 08-26)
I think this is okay, but I defer to sky - as there might have ...
4 years, 2 months ago (2016-10-13 14:19:49 UTC) #8
sky
This code always run on the main thread.
4 years, 2 months ago (2016-10-13 17:55:02 UTC) #9
fdoray
OK, can we still use ThreadTaskRunnerHandle::IsSet() instead of MessageLoop::current()? On Thu, Oct 13, 2016 at ...
4 years, 2 months ago (2016-10-13 17:57:05 UTC) #10
fdoray
On 2016/10/13 17:55:02, sky wrote: > This code always run on the main thread. OK, ...
4 years, 2 months ago (2016-10-13 17:57:17 UTC) #11
fdoray
On 2016/10/13 17:57:17, fdoray wrote: > On 2016/10/13 17:55:02, sky wrote: > > This code ...
4 years, 2 months ago (2016-10-13 17:59:02 UTC) #12
sky
Sorry I haven't kept up with all the name changes. Given this code runs on ...
4 years, 2 months ago (2016-10-14 00:02:48 UTC) #13
fdoray
On 2016/10/14 00:02:48, sky wrote: > Sorry I haven't kept up with all the name ...
4 years, 2 months ago (2016-10-14 12:02:10 UTC) #14
sky
Thanks for the clarification. I believe you're saying there is no difference in this code, ...
4 years, 2 months ago (2016-10-14 15:55:31 UTC) #15
fdoray
On 2016/10/14 15:55:31, sky wrote: > Thanks for the clarification. I believe you're saying there ...
4 years, 2 months ago (2016-10-14 15:56:07 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/2404353002/1
4 years, 2 months ago (2016-10-14 15:56:38 UTC) #18
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 2 months ago (2016-10-14 16:56:43 UTC) #19
commit-bot: I haz the power
4 years, 2 months ago (2016-10-14 16:59:35 UTC) #21
Message was sent while issue was closed.
Patchset 1 (id:??) landed as
https://crrev.com/8df1700462b359e414db9718d201cb3acb4e094e
Cr-Commit-Position: refs/heads/master@{#425363}

Powered by Google App Engine
This is Rietveld 408576698