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

Issue 1553593002: Add base::BindToTaskRunner and BindToCurrentThread (Closed)

Created:
4 years, 11 months ago by kmackay
Modified:
4 years, 11 months ago
CC:
chromium-reviews, feature-media-reviews_chromium.org, vmpstr+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add base::BindToTaskRunner and BindToCurrentThread It is useful to be able to bind a callback that will run on a given TaskRunner. This is partially covered by media::BindToCurrentLoop, but it makes more sense for this functionality to be in base. For now I have marked media::BindToCurrentLoop as deprecated, and updated it to just wrap base::BindToCurrentThread. BUG= TEST= base_unittests

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+128 lines, -267 lines) Patch
M base/BUILD.gn View 1 chunk +1 line, -0 lines 0 comments Download
M base/base.gyp View 1 chunk +1 line, -0 lines 0 comments Download
A base/bind_to_task_runner.h View 1 chunk +82 lines, -0 lines 0 comments Download
A + base/bind_to_task_runner_unittest.cc View 5 chunks +40 lines, -44 lines 0 comments Download
M media/base/bind_to_current_loop.h View 1 chunk +4 lines, -53 lines 0 comments Download
D media/base/bind_to_current_loop_unittest.cc View 1 chunk +0 lines, -170 lines 0 comments Download

Messages

Total messages: 9 (3 generated)
kmackay
4 years, 11 months ago (2015-12-29 22:13:40 UTC) #2
Lei Zhang
Do you have other non-media/ users in mind? Unless there is strong demand for this ...
4 years, 11 months ago (2015-12-29 22:19:50 UTC) #3
kmackay
On 2015/12/29 22:19:50, Lei Zhang wrote: > Do you have other non-media/ users in mind? ...
4 years, 11 months ago (2015-12-29 22:25:00 UTC) #4
Lei Zhang
On 2015/12/29 22:25:00, kmackay wrote: > On 2015/12/29 22:19:50, Lei Zhang wrote: > > Do ...
4 years, 11 months ago (2015-12-29 22:36:52 UTC) #5
xhwang
I think there are actually more people wanting this. The fact that this isn't widely ...
4 years, 11 months ago (2016-01-04 19:05:21 UTC) #8
danakj
4 years, 11 months ago (2016-01-04 20:01:48 UTC) #9
Message was sent while issue was closed.
On 2016/01/04 19:05:21, xhwang wrote:
> I think there are actually more people wanting this. The fact that this isn't
> widely used is probably because it's not in base/....
> 
> Here's the bug to track this:
> 
> https://code.google.com/p/chromium/issues/detail?id=432381
> 
> One issue is that even though the callback is bound to a given task runner,
it's
> still possible that that callback can be destroyed on a different task runner,
> which could cause trouble in some cases. There's an attempt to fix this, but
> it's not finished:
> 
> https://chromiumcodereview.appspot.com/1082113004/

Ya... as from there we found no good compromise on making the tool not leaky and
I didn't want to add a leaky thing to base. Nothing has changed on either of
those afaik.

Powered by Google App Engine
This is Rietveld 408576698