|
Move BindToCurrentLoop from media/base/ to base/
PostTaskAndReplyWithResult works great when you need to call a
synchronous method on another thread, and get the reply back on the same
thread. But it doesn't work when you need to call an asynchronous method
on another thread, and pass in a callback that will be run on the same
thread.
media::BindToCurrentLoop allows this to be done cleanly, and would be
useful throughout Chrome for simplifying thread hops. For example, it
allows the following code:
static void RepostOnThread(
const scoped_refptr<SingleThreadTaskRunner>& task_runner,
A a, B b, C c, X x, Y y, Z z) {
task_runner->PostTask(FROM_HERE, Base::Bind(&TheActualCallback,
a, b, c, x, y, z));
}
...
RepliesOnWrongThread(base::Bind(&RepostOnThread,
MessageLoop::current()->task_runner(),
a, b, c));
to be replaced with just:
RepliesOnWrongThread(base::BindToCurrentLoop(base::Bind(&TheActualCallback,
a, b, c)));
This patch moves it to base/ so it can be used throughout Chrome.
BUG= 432381
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+270 lines, -514 lines) |
Patch |
|
M |
base/BUILD.gn
|
View
|
|
2 chunks |
+2 lines, -0 lines |
0 comments
|
Download
|
|
M |
base/base.gyp
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
base/base.gypi
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
A + |
base/bind_to_current_loop.h
|
View
|
|
3 chunks |
+26 lines, -24 lines |
0 comments
|
Download
|
|
A + |
base/bind_to_current_loop_unittest.cc
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
chrome/browser/extensions/api/cast_streaming/cast_streaming_apitest.cc
|
View
|
|
3 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
chrome/browser/sync_file_system/drive_backend/callback_helper.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
chrome/renderer/media/cast_receiver_session.cc
|
View
|
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
chrome/renderer/media/cast_rtp_stream.cc
|
View
|
|
3 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
chrome/renderer/media/cast_session.cc
|
View
|
|
6 chunks |
+10 lines, -10 lines |
0 comments
|
Download
|
|
M |
chromecast/browser/media/cast_browser_cdm_factory.cc
|
View
|
|
2 chunks |
+6 lines, -6 lines |
0 comments
|
Download
|
|
M |
chromecast/browser/media/cma_message_filter_host.cc
|
View
|
|
7 chunks |
+16 lines, -16 lines |
0 comments
|
Download
|
|
M |
chromecast/media/cma/base/buffering_frame_provider.cc
|
View
|
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
chromecast/media/cma/filters/cma_renderer.cc
|
View
|
|
8 chunks |
+13 lines, -13 lines |
0 comments
|
Download
|
|
M |
chromecast/media/cma/filters/demuxer_stream_adapter.cc
|
View
|
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
chromecast/media/cma/ipc_streamer/av_streamer_proxy.cc
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
chromecast/media/cma/pipeline/av_pipeline_impl.cc
|
View
|
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
|
M |
chromecast/renderer/media/audio_pipeline_proxy.cc
|
View
|
|
5 chunks |
+5 lines, -5 lines |
0 comments
|
Download
|
|
M |
chromecast/renderer/media/video_pipeline_proxy.cc
|
View
|
|
5 chunks |
+4 lines, -4 lines |
0 comments
|
Download
|
|
M |
content/browser/media/capture/content_video_capture_device_core.cc
|
View
|
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
|
M |
content/browser/media/capture/web_contents_audio_input_stream.cc
|
View
|
|
3 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
content/browser/media/capture/web_contents_audio_muter.cc
|
View
|
|
3 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
content/browser/renderer_host/media/audio_renderer_host_unittest.cc
|
View
|
|
3 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
content/browser/renderer_host/media/video_capture_device_client.cc
|
View
|
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
|
M |
content/browser/renderer_host/media/video_capture_manager.cc
|
View
|
|
3 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
content/browser/renderer_host/media/video_capture_texture_wrapper.cc
|
View
|
|
5 chunks |
+4 lines, -4 lines |
0 comments
|
Download
|
|
M |
content/common/gpu/media/v4l2_image_processor.cc
|
View
|
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
content/common/gpu/media/v4l2_slice_video_decode_accelerator.cc
|
View
|
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
|
M |
content/common/gpu/media/vaapi_video_decode_accelerator.cc
|
View
|
|
3 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
content/common/gpu/media/vaapi_video_encode_accelerator.cc
|
View
|
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
content/common/gpu/media/video_encode_accelerator_unittest.cc
|
View
|
|
3 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
content/renderer/media/android/media_source_delegate.cc
|
View
|
|
2 chunks |
+6 lines, -6 lines |
0 comments
|
Download
|
|
M |
content/renderer/media/android/webmediaplayer_android.cc
|
View
|
|
5 chunks |
+4 lines, -4 lines |
0 comments
|
Download
|
|
M |
content/renderer/media/media_stream_video_capture_source_unittest.cc
|
View
|
|
3 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
content/renderer/media/media_stream_video_capturer_source.cc
|
View
|
|
4 chunks |
+4 lines, -4 lines |
0 comments
|
Download
|
|
M |
content/renderer/media/mock_media_stream_video_sink.cc
|
View
|
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
content/renderer/media/rtc_video_decoder.cc
|
View
|
|
3 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
content/renderer/media/rtc_video_renderer.cc
|
View
|
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
content/renderer/media/video_capture_impl.cc
|
View
|
|
3 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
|
M |
content/renderer/media/video_capture_impl_manager.cc
|
View
|
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
|
M |
content/renderer/media/video_capture_impl_manager_unittest.cc
|
View
|
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
content/renderer/media/video_capture_impl_unittest.cc
|
View
|
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
|
M |
content/renderer/media/video_source_handler.cc
|
View
|
|
3 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
content/renderer/media/video_track_adapter.cc
|
View
|
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
content/renderer/media/webrtc/media_stream_remote_video_source.cc
|
View
|
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
|
M |
content/renderer/pepper/content_decryptor_delegate.cc
|
View
|
|
3 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
content/renderer/pepper/pepper_media_stream_video_track_host.cc
|
View
|
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
content/renderer/pepper/pepper_platform_camera_device.cc
|
View
|
|
3 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
content/renderer/pepper/pepper_platform_video_capture.cc
|
View
|
|
3 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
|
M |
content/renderer/pepper/pepper_video_encoder_host.cc
|
View
|
|
3 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
media/audio/mac/audio_device_listener_mac_unittest.cc
|
View
|
|
2 chunks |
+5 lines, -4 lines |
0 comments
|
Download
|
|
M |
media/audio/mac/audio_manager_mac.cc
|
View
|
|
3 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
media/audio/win/audio_manager_win.cc
|
View
|
|
3 chunks |
+5 lines, -4 lines |
0 comments
|
Download
|
|
M |
media/base/BUILD.gn
|
View
|
|
3 chunks |
+1 line, -5 lines |
0 comments
|
Download
|
|
M |
media/base/android/media_decoder_job.cc
|
View
|
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
media/base/android/media_source_player_unittest.cc
|
View
|
|
3 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
D |
media/base/bind_to_current_loop.h
|
View
|
|
1 chunk |
+0 lines, -69 lines |
0 comments
|
Download
|
|
D |
media/base/bind_to_current_loop_unittest.cc
|
View
|
|
1 chunk |
+0 lines, -168 lines |
0 comments
|
Download
|
|
M |
media/base/callback_holder.h
|
View
|
1
|
3 chunks |
+4 lines, -4 lines |
0 comments
|
Download
|
|
M |
media/base/test_helpers.cc
|
View
|
|
3 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
|
M |
media/base/text_renderer.cc
|
View
|
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
media/blink/encrypted_media_player_support.cc
|
View
|
|
2 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
|
M |
media/blink/texttrack_impl.cc
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
media/blink/webaudiosourceprovider_impl.cc
|
View
|
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
media/blink/webmediaplayer_impl.cc
|
View
|
|
3 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
|
M |
media/filters/chunk_demuxer.cc
|
View
|
|
4 chunks |
+4 lines, -4 lines |
0 comments
|
Download
|
|
M |
media/filters/decoder_selector.cc
|
View
|
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
media/filters/decoder_stream.cc
|
View
|
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
|
M |
media/filters/decrypting_audio_decoder.cc
|
View
|
|
9 chunks |
+9 lines, -9 lines |
0 comments
|
Download
|
|
M |
media/filters/decrypting_demuxer_stream.cc
|
View
|
|
6 chunks |
+7 lines, -7 lines |
0 comments
|
Download
|
|
M |
media/filters/decrypting_video_decoder.cc
|
View
|
|
8 chunks |
+10 lines, -10 lines |
0 comments
|
Download
|
|
M |
media/filters/fake_demuxer_stream.cc
|
View
|
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
media/filters/fake_video_decoder.cc
|
View
|
|
4 chunks |
+6 lines, -6 lines |
0 comments
|
Download
|
|
M |
media/filters/ffmpeg_audio_decoder.cc
|
View
|
|
4 chunks |
+4 lines, -4 lines |
0 comments
|
Download
|
|
M |
media/filters/ffmpeg_demuxer.cc
|
View
|
|
4 chunks |
+5 lines, -4 lines |
0 comments
|
Download
|
|
M |
media/filters/ffmpeg_video_decoder.cc
|
View
|
|
3 chunks |
+4 lines, -4 lines |
0 comments
|
Download
|
|
M |
media/filters/gpu_video_decoder.cc
|
View
|
|
7 chunks |
+6 lines, -6 lines |
0 comments
|
Download
|
|
M |
media/filters/opus_audio_decoder.cc
|
View
|
|
3 chunks |
+4 lines, -4 lines |
0 comments
|
Download
|
|
M |
media/filters/video_frame_scheduler_proxy.cc
|
View
|
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
media/filters/vpx_video_decoder.cc
|
View
|
|
5 chunks |
+4 lines, -4 lines |
0 comments
|
Download
|
|
M |
media/media.gyp
|
View
|
|
2 chunks |
+0 lines, -2 lines |
0 comments
|
Download
|
|
M |
media/mojo/services/mojo_renderer_impl.cc
|
View
|
|
2 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
|
M |
media/renderers/audio_renderer_impl.cc
|
View
|
|
3 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
media/renderers/renderer_impl.cc
|
View
|
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
|
M |
media/renderers/video_renderer_impl.cc
|
View
|
|
3 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
media/video/capture/linux/v4l2_capture_delegate.cc
|
View
|
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
Total messages: 18 (7 generated)
|