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

Issue 10380016: Add base::ThreadTaskRunner class. (Closed)

Created:
8 years, 7 months ago by Sergey Ulanov
Modified:
8 years, 6 months ago
CC:
chromium-reviews, erikwright (departed), sadrul, brettw-cc_chromium.org, Wez, Ami GONE FROM CHROMIUM
Visibility:
Public.

Description

Add base::ThreadTaskRunnerHandler class. The class will be used to hold a reference to the thread's task runner. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=136110

Patch Set 1 #

Patch Set 2 : #

Total comments: 12

Patch Set 3 : #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+109 lines, -1 line) Patch
M base/base.gypi View 1 1 chunk +2 lines, -0 lines 0 comments Download
M base/message_loop.h View 1 2 chunks +3 lines, -1 line 0 comments Download
M base/message_loop.cc View 1 3 chunks +5 lines, -0 lines 2 comments Download
M base/message_loop_unittest.cc View 1 2 chunks +23 lines, -0 lines 0 comments Download
A base/thread_task_runner_handle.h View 1 2 1 chunk +35 lines, -0 lines 0 comments Download
A base/thread_task_runner_handle.cc View 1 1 chunk +41 lines, -0 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
Sergey Ulanov
8 years, 7 months ago (2012-05-04 23:34:43 UTC) #1
willchan no longer on Chromium
I don't like the name being TaskRunner suffixed. I think Handle is necessary, otherwise it ...
8 years, 7 months ago (2012-05-07 20:32:10 UTC) #2
Sergey Ulanov
On 2012/05/07 20:32:10, willchan wrote: > I don't like the name being TaskRunner suffixed. I ...
8 years, 7 months ago (2012-05-07 23:51:10 UTC) #3
willchan no longer on Chromium
Other folks chime in by tomorrow afternoon please. Otherwise I will approve as is. Thanks. ...
8 years, 7 months ago (2012-05-08 00:26:09 UTC) #4
Ami GONE FROM CHROMIUM
LGTM % English http://codereview.chromium.org/10380016/diff/2001/base/thread_task_runner_handle.h File base/thread_task_runner_handle.h (right): http://codereview.chromium.org/10380016/diff/2001/base/thread_task_runner_handle.h#newcode15 base/thread_task_runner_handle.h:15: // ThreadTaskRunner stores reference to the ...
8 years, 7 months ago (2012-05-08 01:30:14 UTC) #5
willchan no longer on Chromium
Sorry, I didn't actually read the code last time :) I have some nits, and ...
8 years, 7 months ago (2012-05-08 02:35:06 UTC) #6
Sergey Ulanov
http://codereview.chromium.org/10380016/diff/2001/base/message_loop.h File base/message_loop.h (right): http://codereview.chromium.org/10380016/diff/2001/base/message_loop.h#newcode521 base/message_loop.h:521: // The message loop proxy associated with this message ...
8 years, 7 months ago (2012-05-09 18:34:11 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sergeyu@chromium.org/10380016/8001
8 years, 7 months ago (2012-05-09 18:35:13 UTC) #8
willchan no longer on Chromium
http://codereview.chromium.org/10380016/diff/2001/base/message_loop.h File base/message_loop.h (right): http://codereview.chromium.org/10380016/diff/2001/base/message_loop.h#newcode521 base/message_loop.h:521: // The message loop proxy associated with this message ...
8 years, 7 months ago (2012-05-09 18:38:48 UTC) #9
commit-bot: I haz the power
Commit queue rejected this change because the description was changed between the time the change ...
8 years, 7 months ago (2012-05-09 19:59:24 UTC) #10
Ryan Sleevi
https://chromiumcodereview.appspot.com/10380016/diff/8001/base/message_loop.cc File base/message_loop.cc (right): https://chromiumcodereview.appspot.com/10380016/diff/8001/base/message_loop.cc#newcode204 base/message_loop.cc:204: thread_task_runner_handle_.reset(); Not to resurrect a dead review, but when ...
8 years, 6 months ago (2012-05-31 19:36:40 UTC) #11
Sergey Ulanov
8 years, 6 months ago (2012-05-31 20:14:04 UTC) #12
https://chromiumcodereview.appspot.com/10380016/diff/8001/base/message_loop.cc
File base/message_loop.cc (right):

https://chromiumcodereview.appspot.com/10380016/diff/8001/base/message_loop.c...
base/message_loop.cc:204: thread_task_runner_handle_.reset();
On 2012/05/31 19:36:41, Ryan Sleevi wrote:
> Not to resurrect a dead review, but when looking at this code after chatting
> with Will on IRC, shouldn't this code run /after/
> WillDestroyCurrentMessageLoop()?
> 
> Currently, any code that executes in WillDestroyCurrentMessageLoop() can
> "safely" call MessageLoopProxy::current() and still get the current proxy
(even
> if their tasks will never run).
> 
> With this change, any code updated to use ThreadTaskRunnerHandle::Get(), that
> runs within the context of WillDestroyCurrentMessageLoop(), will get NULL
> instead. Seems like a bug?
> 
> (Or not, but I was hoping someone could comment on this)

This code runs only after all message loop destruction observers are notified -
see FOR_EACH_OBSERVER() two lines above.
MessageLoopProxy::WillDestroyCurrentMessageLoop() is called later, but that
shouldn't matter - MessageLoopProxy shouldn't depend on ThreadTaskRunnerHandle.

Powered by Google App Engine
This is Rietveld 408576698