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

Issue 10210008: Make MessageLoopProxy::current() usable on threads that don't have MessageLoop. (Closed)

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

Description

Add SingleThreadTaskRunner::current(). With this change now it is possible to get SingleThreadTaskRunner that corresponds to the current thread. That is useful for threads that don't have corresponding MessageLoop object (e.g. main thread in a plugin).

Patch Set 1 #

Patch Set 2 : SingleThreadTaskRunner::current() #

Total comments: 4

Patch Set 3 : #

Total comments: 6

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : #

Total comments: 2

Patch Set 7 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+108 lines, -2 lines) Patch
M base/base.gypi View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M base/message_loop_proxy.h View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M base/message_loop_proxy_impl.cc View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M base/message_loop_unittest.cc View 1 2 3 1 chunk +21 lines, -0 lines 0 comments Download
A base/thread_main_task_runner.h View 1 2 3 4 5 6 1 chunk +39 lines, -0 lines 0 comments Download
A base/thread_main_task_runner.cc View 1 2 3 4 5 1 chunk +43 lines, -0 lines 0 comments Download

Messages

Total messages: 48 (0 generated)
Sergey Ulanov
8 years, 8 months ago (2012-04-24 22:57:58 UTC) #1
willchan no longer on Chromium
On 2012/04/24 22:57:58, sergeyu wrote: This doesn't quite make sense to me. If your thread ...
8 years, 8 months ago (2012-04-24 23:25:09 UTC) #2
Sergey Ulanov
The goal is to make it possible to run code that relies on MessageLoopProxy::current() on ...
8 years, 8 months ago (2012-04-24 23:35:32 UTC) #3
Sergey Ulanov
On 2012/04/24 23:25:09, willchan wrote: > On 2012/04/24 22:57:58, sergeyu wrote: > > This doesn't ...
8 years, 8 months ago (2012-04-24 23:42:45 UTC) #4
willchan no longer on Chromium
MessageLoopProxy is not meant to be an interface. That's what the TaskRunners are for. MessageLoopProxy ...
8 years, 8 months ago (2012-04-25 00:28:12 UTC) #5
Sergey Ulanov
On Tue, Apr 24, 2012 at 5:28 PM, <willchan@chromium.org> wrote: > MessageLoopProxy is not meant ...
8 years, 8 months ago (2012-04-25 01:02:34 UTC) #6
willchan no longer on Chromium
On Tue, Apr 24, 2012 at 6:02 PM, Sergey Ulanov <sergeyu@chromium.org> wrote: > On Tue, ...
8 years, 8 months ago (2012-04-25 01:32:06 UTC) #7
Sergey Ulanov
Ok, I've changed this CL to add SingleThreadTaskRunner::current(). Let me know what you think about ...
8 years, 8 months ago (2012-04-25 02:21:14 UTC) #8
akalin
+Ami, since we talked about TaskRunner and ::current()-like functions before. On Wed, Apr 25, 2012 ...
8 years, 8 months ago (2012-04-25 07:08:39 UTC) #9
Ami GONE FROM CHROMIUM
drive-by thoughts; feel free to ignore. My reaction to this CL is to wonder why ...
8 years, 8 months ago (2012-04-25 17:27:55 UTC) #10
Sergey Ulanov
Thanks Fred for your input. I think it's useful to have a static method that ...
8 years, 8 months ago (2012-04-25 17:34:17 UTC) #11
Sergey Ulanov
On 2012/04/25 17:27:55, Ami Fischman wrote: > drive-by thoughts; feel free to ignore. > > ...
8 years, 8 months ago (2012-04-25 17:47:26 UTC) #12
Ami GONE FROM CHROMIUM
> > TaskRunner is more abstract than SignleThreadTaskRunner. E.g. TaskRunner > may use > multiple ...
8 years, 8 months ago (2012-04-25 18:17:41 UTC) #13
willchan no longer on Chromium
So there seem to be a discussion of the following options now: 1) Add a ...
8 years, 8 months ago (2012-04-25 18:42:29 UTC) #14
Ami GONE FROM CHROMIUM
On Wed, Apr 25, 2012 at 11:42 AM, William Chan (陈智昌) <willchan@chromium.org>wrote: > So there ...
8 years, 8 months ago (2012-04-25 19:27:30 UTC) #15
Sergey Ulanov
I agree that the situation when there are multiple STTR instances per thread may be ...
8 years, 8 months ago (2012-04-25 19:38:52 UTC) #16
willchan no longer on Chromium
On Wed, Apr 25, 2012 at 12:27 PM, Ami Fischman <fischman@chromium.org>wrote: > On Wed, Apr ...
8 years, 8 months ago (2012-04-25 20:20:22 UTC) #17
willchan no longer on Chromium
I need to run to a meeting, but my new inclination is that base::Timer may ...
8 years, 8 months ago (2012-04-25 20:30:03 UTC) #18
Sergey Ulanov
On Wed, Apr 25, 2012 at 1:20 PM, William Chan (陈智昌) <willchan@chromium.org>wrote: > On Wed, ...
8 years, 8 months ago (2012-04-25 23:43:15 UTC) #19
Sergey Ulanov
On Wed, Apr 25, 2012 at 1:30 PM, William Chan (陈智昌) <willchan@chromium.org>wrote: > I need ...
8 years, 8 months ago (2012-04-25 23:46:55 UTC) #20
willchan no longer on Chromium
On Wed, Apr 25, 2012 at 4:42 PM, Sergey Ulanov <sergeyu@chromium.org> wrote: > > > ...
8 years, 8 months ago (2012-04-26 00:11:19 UTC) #21
willchan no longer on Chromium
On Wed, Apr 25, 2012 at 4:46 PM, Sergey Ulanov <sergeyu@chromium.org> wrote: > On Wed, ...
8 years, 8 months ago (2012-04-26 00:14:39 UTC) #22
Sergey Ulanov
On Wed, Apr 25, 2012 at 5:11 PM, William Chan (陈智昌) <willchan@chromium.org>wrote: > On Wed, ...
8 years, 8 months ago (2012-04-26 00:32:56 UTC) #23
Sergey Ulanov
On Wed, Apr 25, 2012 at 5:14 PM, William Chan (陈智昌) <willchan@chromium.org>wrote: > On Wed, ...
8 years, 8 months ago (2012-04-26 00:38:16 UTC) #24
willchan no longer on Chromium
On Wed, Apr 25, 2012 at 5:32 PM, Sergey Ulanov <sergeyu@chromium.org> wrote: > > > ...
8 years, 8 months ago (2012-04-26 01:00:01 UTC) #25
Sergey Ulanov
On 2012/04/26 01:00:01, willchan wrote: > On Wed, Apr 25, 2012 at 5:32 PM, Sergey ...
8 years, 7 months ago (2012-04-30 19:27:55 UTC) #26
Sergey Ulanov
I've uploaded new version that adds ThreadMainTaskRunner interface with current(). http://codereview.chromium.org/10210008/diff/8001/base/single_thread_task_runner.cc File base/single_thread_task_runner.cc (right): http://codereview.chromium.org/10210008/diff/8001/base/single_thread_task_runner.cc#newcode21 ...
8 years, 7 months ago (2012-04-30 20:02:09 UTC) #27
Ami GONE FROM CHROMIUM
My main original concern is alleviated by the TMTR version (b/c it 's easy to ...
8 years, 7 months ago (2012-04-30 23:34:05 UTC) #28
Sergey Ulanov
also added unittest to verify that MessageLoop sets ThreadMainTaskRunner::current(). http://codereview.chromium.org/10210008/diff/21002/base/thread_main_task_runner.cc File base/thread_main_task_runner.cc (right): http://codereview.chromium.org/10210008/diff/21002/base/thread_main_task_runner.cc#newcode28 base/thread_main_task_runner.cc:28: ...
8 years, 7 months ago (2012-05-01 00:34:54 UTC) #29
willchan no longer on Chromium
OK, I'm sold on TMTR. Can you explain why you don't set the thread local ...
8 years, 7 months ago (2012-05-01 00:38:19 UTC) #30
Sergey Ulanov
I cannot do it in the destructor because the object is ref-counted and thus we ...
8 years, 7 months ago (2012-05-01 00:46:45 UTC) #31
willchan no longer on Chromium
The comment about the destructor makes sense. I'm not sure I think we shouldn't set ...
8 years, 7 months ago (2012-05-01 01:13:51 UTC) #32
Ami GONE FROM CHROMIUM
On Mon, Apr 30, 2012 at 6:13 PM, William Chan (陈智昌) <willchan@chromium.org>wrote: > provide a ...
8 years, 7 months ago (2012-05-01 01:32:37 UTC) #33
willchan no longer on Chromium
Interesting thought. Maybe you're exactly right! The only thing I can thing of is sometimes ...
8 years, 7 months ago (2012-05-01 01:40:24 UTC) #34
Sergey Ulanov
On Mon, Apr 30, 2012 at 6:13 PM, William Chan (陈智昌) <willchan@chromium.org>wrote: > The comment ...
8 years, 7 months ago (2012-05-01 01:41:32 UTC) #35
Sergey Ulanov
On Mon, Apr 30, 2012 at 6:41 PM, Sergey Ulanov <sergeyu@chromium.org> wrote: > On Mon, ...
8 years, 7 months ago (2012-05-01 01:43:13 UTC) #36
Sergey Ulanov
On Mon, Apr 30, 2012 at 6:32 PM, Ami Fischman <fischman@chromium.org> wrote: > On Mon, ...
8 years, 7 months ago (2012-05-01 01:44:46 UTC) #37
willchan no longer on Chromium
On Mon, Apr 30, 2012 at 6:42 PM, Sergey Ulanov <sergeyu@chromium.org> wrote: > On Mon, ...
8 years, 7 months ago (2012-05-01 02:05:07 UTC) #38
Sergey Ulanov
On 2012/05/01 02:05:07, willchan wrote: > On Mon, Apr 30, 2012 at 6:42 PM, Sergey ...
8 years, 7 months ago (2012-05-01 19:23:23 UTC) #39
willchan no longer on Chromium
LGTM, please remember to use the task_runner_test_template.h in your implementation's test. http://codereview.chromium.org/10210008/diff/30011/base/thread_main_task_runner.h File base/thread_main_task_runner.h (right): ...
8 years, 7 months ago (2012-05-02 00:17:12 UTC) #40
Sergey Ulanov
There is now problem that BrowserThreadImpl creates MessageLoopProxy instances that are different from MessageLoopImpl. This ...
8 years, 7 months ago (2012-05-02 00:30:35 UTC) #41
willchan no longer on Chromium
I have a pending CL to fix that. But I didn't account for the remoting/ ...
8 years, 7 months ago (2012-05-02 00:32:59 UTC) #42
willchan no longer on Chromium
Apparently I was wrong. I only did the merging (and didn't even delete the old ...
8 years, 7 months ago (2012-05-02 00:36:16 UTC) #43
Sergey Ulanov
On Tue, May 1, 2012 at 5:36 PM, William Chan (陈智昌) <willchan@chromium.org>wrote: > Apparently I ...
8 years, 7 months ago (2012-05-02 00:42:19 UTC) #44
willchan no longer on Chromium
I see. Yes, that sounds correct to me. On Tue, May 1, 2012 at 5:41 ...
8 years, 7 months ago (2012-05-02 00:43:25 UTC) #45
Sergey Ulanov
Ok, I've put together a CL to fix (1): http://codereview.chromium.org/10291011 On 2012/05/02 00:43:25, willchan wrote: ...
8 years, 7 months ago (2012-05-02 00:59:06 UTC) #46
akalin
Is this CL obsoleted by http://codereview.chromium.org/10380016/ ?
8 years, 7 months ago (2012-05-09 21:40:05 UTC) #47
Sergey Ulanov
8 years, 7 months ago (2012-05-09 22:06:48 UTC) #48
On 2012/05/09 21:40:05, akalin wrote:
> Is this CL obsoleted by http://codereview.chromium.org/10380016/ ?

Yes. Closing it.

Powered by Google App Engine
This is Rietveld 408576698