diff options
author | anujk.sharma <anujk.sharma@samsung.com> | 2015-04-27 11:23:26 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-04-27 18:23:48 +0000 |
commit | 902e992a9b6447028bf8d4f3540892c425984b8f (patch) | |
tree | 9fa77fed6b4bb15e44a87f250f8441cae58b414c /media | |
parent | 34ef5c4166045a04475aae8058d459916300f3cf (diff) | |
download | chromium_src-902e992a9b6447028bf8d4f3540892c425984b8f.zip chromium_src-902e992a9b6447028bf8d4f3540892c425984b8f.tar.gz chromium_src-902e992a9b6447028bf8d4f3540892c425984b8f.tar.bz2 |
Replace MessageLoopProxy usage with ThreadTaskRunnerHandle in src/media.
MessageLoopProxy is deprecated.
This basically does a search and replace:
MessageLoopProxy::current() -> ThreadTaskRunnerHandle::Get().
BUG=391045
Review URL: https://codereview.chromium.org/1108773002
Cr-Commit-Position: refs/heads/master@{#327075}
Diffstat (limited to 'media')
22 files changed, 68 insertions, 41 deletions
diff --git a/media/audio/audio_input_controller.cc b/media/audio/audio_input_controller.cc index a8a0d02..85da58a 100644 --- a/media/audio/audio_input_controller.cc +++ b/media/audio/audio_input_controller.cc @@ -6,8 +6,10 @@ #include "base/bind.h" #include "base/metrics/histogram_macros.h" +#include "base/single_thread_task_runner.h" #include "base/strings/string_number_conversions.h" #include "base/strings/stringprintf.h" +#include "base/thread_task_runner_handle.h" #include "base/threading/thread_restrictions.h" #include "base/time/time.h" #include "media/audio/audio_parameters.h" @@ -119,7 +121,7 @@ AudioInputController::AudioInputController(EventHandler* handler, SyncWriter* sync_writer, UserInputMonitor* user_input_monitor, const bool agc_is_enabled) - : creator_task_runner_(base::MessageLoopProxy::current()), + : creator_task_runner_(base::ThreadTaskRunnerHandle::Get()), handler_(handler), stream_(NULL), data_is_active_(false), diff --git a/media/audio/audio_manager_base.cc b/media/audio/audio_manager_base.cc index 24e0883..09859de 100644 --- a/media/audio/audio_manager_base.cc +++ b/media/audio/audio_manager_base.cc @@ -7,7 +7,9 @@ #include "base/bind.h" #include "base/bind_helpers.h" #include "base/command_line.h" +#include "base/single_thread_task_runner.h" #include "base/strings/string_number_conversions.h" +#include "base/thread_task_runner_handle.h" #include "build/build_config.h" #include "media/audio/audio_output_dispatcher_impl.h" #include "media/audio/audio_output_proxy.h" @@ -93,7 +95,7 @@ AudioManagerBase::AudioManagerBase(AudioLogFactory* audio_log_factory) // thread leads to crashes and odd behavior. See http://crbug.com/158170. // TODO(dalecurtis): We should require the message loop to be passed in. if (base::MessageLoopForUI::IsCurrent()) { - task_runner_ = base::MessageLoopProxy::current(); + task_runner_ = base::ThreadTaskRunnerHandle::Get(); return; } #endif diff --git a/media/base/android/media_decoder_job.cc b/media/base/android/media_decoder_job.cc index 9009443..5aa8a4d 100644 --- a/media/base/android/media_decoder_job.cc +++ b/media/base/android/media_decoder_job.cc @@ -6,7 +6,8 @@ #include "base/bind.h" #include "base/callback_helpers.h" -#include "base/message_loop/message_loop_proxy.h" +#include "base/single_thread_task_runner.h" +#include "base/thread_task_runner_handle.h" #include "base/trace_event/trace_event.h" #include "media/base/android/media_codec_bridge.h" #include "media/base/android/media_drm_bridge.h" @@ -25,7 +26,7 @@ MediaDecoderJob::MediaDecoderJob( const base::Closure& request_data_cb, const base::Closure& config_changed_cb) : need_to_reconfig_decoder_job_(false), - ui_task_runner_(base::MessageLoopProxy::current()), + ui_task_runner_(base::ThreadTaskRunnerHandle::Get()), decoder_task_runner_(decoder_task_runner), needs_flush_(false), input_eos_encountered_(false), diff --git a/media/base/android/media_drm_bridge.cc b/media/base/android/media_drm_bridge.cc index 0aaeef4..8e22c60 100644 --- a/media/base/android/media_drm_bridge.cc +++ b/media/base/android/media_drm_bridge.cc @@ -14,12 +14,13 @@ #include "base/lazy_instance.h" #include "base/location.h" #include "base/logging.h" -#include "base/message_loop/message_loop_proxy.h" #include "base/numerics/safe_conversions.h" +#include "base/single_thread_task_runner.h" #include "base/stl_util.h" #include "base/strings/string_util.h" #include "base/sys_byteorder.h" #include "base/sys_info.h" +#include "base/thread_task_runner_handle.h" #include "jni/MediaDrmBridge_jni.h" #include "media/base/cdm_key_information.h" @@ -538,7 +539,7 @@ void MediaDrmBridge::SetMediaCryptoReadyCB(const base::Closure& closure) { DCHECK(media_crypto_ready_cb_.is_null()); if (!GetMediaCrypto().is_null()) { - base::MessageLoopProxy::current()->PostTask(FROM_HERE, closure); + base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, closure); return; } diff --git a/media/base/android/media_player_android.cc b/media/base/android/media_player_android.cc index 3600dc0..9f224c9 100644 --- a/media/base/android/media_player_android.cc +++ b/media/base/android/media_player_android.cc @@ -6,7 +6,8 @@ #include "base/android/jni_android.h" #include "base/logging.h" -#include "base/message_loop/message_loop_proxy.h" +#include "base/single_thread_task_runner.h" +#include "base/thread_task_runner_handle.h" #include "media/base/android/media_drm_bridge.h" #include "media/base/android/media_player_manager.h" @@ -23,7 +24,7 @@ MediaPlayerAndroid::MediaPlayerAndroid( frame_url_(frame_url), is_audible_(false), weak_factory_(this) { - listener_.reset(new MediaPlayerListener(base::MessageLoopProxy::current(), + listener_.reset(new MediaPlayerListener(base::ThreadTaskRunnerHandle::Get(), weak_factory_.GetWeakPtr())); } diff --git a/media/base/bind_to_current_loop.h b/media/base/bind_to_current_loop.h index cb3e28d..c9eda2ac 100644 --- a/media/base/bind_to_current_loop.h +++ b/media/base/bind_to_current_loop.h @@ -9,6 +9,7 @@ #include "base/location.h" #include "base/message_loop/message_loop_proxy.h" #include "base/single_thread_task_runner.h" +#include "base/thread_task_runner_handle.h" // This is a helper utility for base::Bind()ing callbacks to the current // MessageLoop. The typical use is when |a| (of class |A|) wants to hand a @@ -61,7 +62,7 @@ template<typename T> static base::Callback<T> BindToCurrentLoop( const base::Callback<T>& cb) { return base::Bind(&internal::TrampolineHelper<T>::Run, - base::MessageLoopProxy::current(), cb); + base::ThreadTaskRunnerHandle::Get(), cb); } } // namespace media diff --git a/media/base/fake_text_track_stream.cc b/media/base/fake_text_track_stream.cc index 183e61e..214eec4 100644 --- a/media/base/fake_text_track_stream.cc +++ b/media/base/fake_text_track_stream.cc @@ -6,13 +6,15 @@ #include "base/bind.h" #include "base/callback_helpers.h" +#include "base/single_thread_task_runner.h" +#include "base/thread_task_runner_handle.h" #include "media/base/decoder_buffer.h" #include "media/filters/webvtt_util.h" namespace media { FakeTextTrackStream::FakeTextTrackStream() - : task_runner_(base::MessageLoopProxy::current()), + : task_runner_(base::ThreadTaskRunnerHandle::Get()), stopping_(false) { } diff --git a/media/base/serial_runner.cc b/media/base/serial_runner.cc index 779566c..9e599307 100644 --- a/media/base/serial_runner.cc +++ b/media/base/serial_runner.cc @@ -7,8 +7,8 @@ #include "base/bind.h" #include "base/callback_helpers.h" #include "base/location.h" -#include "base/message_loop/message_loop_proxy.h" #include "base/single_thread_task_runner.h" +#include "base/thread_task_runner_handle.h" namespace media { @@ -68,7 +68,7 @@ bool SerialRunner::Queue::empty() { SerialRunner::SerialRunner(const Queue& bound_fns, const PipelineStatusCB& done_cb) - : task_runner_(base::MessageLoopProxy::current()), + : task_runner_(base::ThreadTaskRunnerHandle::Get()), bound_fns_(bound_fns), done_cb_(done_cb), weak_factory_(this) { diff --git a/media/blink/webcontentdecryptionmoduleaccess_impl.cc b/media/blink/webcontentdecryptionmoduleaccess_impl.cc index 5c28234..a72cbff 100644 --- a/media/blink/webcontentdecryptionmoduleaccess_impl.cc +++ b/media/blink/webcontentdecryptionmoduleaccess_impl.cc @@ -6,7 +6,8 @@ #include "base/bind.h" #include "base/location.h" -#include "base/message_loop/message_loop_proxy.h" +#include "base/single_thread_task_runner.h" +#include "base/thread_task_runner_handle.h" #include "media/blink/webencryptedmediaclient_impl.h" namespace media { @@ -79,7 +80,7 @@ void WebContentDecryptionModuleAccessImpl::createContentDecryptionModule( // As this object's lifetime is controlled by MediaKeySystemAccess on the // blink side, copy all values needed by CreateCdm() in case the blink object // gets garbage-collected. - base::MessageLoopProxy::current()->PostTask( + base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::Bind(&CreateCdm, client_, key_system_, allow_distinctive_identifier, allow_persistent_state, security_origin_, result)); diff --git a/media/blink/webmediaplayer_impl.cc b/media/blink/webmediaplayer_impl.cc index e8eec4c..79c134f 100644 --- a/media/blink/webmediaplayer_impl.cc +++ b/media/blink/webmediaplayer_impl.cc @@ -15,10 +15,10 @@ #include "base/callback_helpers.h" #include "base/debug/alias.h" #include "base/debug/crash_logging.h" -#include "base/message_loop/message_loop_proxy.h" #include "base/metrics/histogram.h" #include "base/single_thread_task_runner.h" #include "base/synchronization/waitable_event.h" +#include "base/thread_task_runner_handle.h" #include "base/trace_event/trace_event.h" #include "cc/blink/web_layer_impl.h" #include "cc/layers/video_layer.h" @@ -114,7 +114,7 @@ WebMediaPlayerImpl::WebMediaPlayerImpl( network_state_(WebMediaPlayer::NetworkStateEmpty), ready_state_(WebMediaPlayer::ReadyStateHaveNothing), preload_(BufferedDataSource::AUTO), - main_task_runner_(base::MessageLoopProxy::current()), + main_task_runner_(base::ThreadTaskRunnerHandle::Get()), media_task_runner_(params.media_task_runner()), media_log_(params.media_log()), pipeline_(media_task_runner_, media_log_.get()), diff --git a/media/cast/test/utility/tap_proxy.cc b/media/cast/test/utility/tap_proxy.cc index 6aca4f3..c8ad72d 100644 --- a/media/cast/test/utility/tap_proxy.cc +++ b/media/cast/test/utility/tap_proxy.cc @@ -23,7 +23,9 @@ #include "base/command_line.h" #include "base/logging.h" #include "base/rand_util.h" +#include "base/single_thread_task_runner.h" #include "base/synchronization/waitable_event.h" +#include "base/thread_task_runner_handle.h" #include "base/threading/thread.h" #include "base/time/default_tick_clock.h" #include "media/cast/test/utility/udp_proxy.h" @@ -81,7 +83,7 @@ class QueueManager : public base::MessageLoopForIO::Watcher { } else { packet_pipe_ = tmp.Pass(); } - packet_pipe_->InitOnIOThread(base::MessageLoopProxy::current(), + packet_pipe_->InitOnIOThread(base::ThreadTaskRunnerHandle::Get(), &tick_clock_); } @@ -209,7 +211,7 @@ void CheckByteCounters() { last_printout = now; } - base::MessageLoopProxy::current()->PostDelayedTask( + base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( FROM_HERE, base::Bind(&CheckByteCounters), base::TimeDelta::FromMilliseconds(100)); diff --git a/media/cast/test/utility/udp_proxy.cc b/media/cast/test/utility/udp_proxy.cc index 5c41dbe..eb38171 100644 --- a/media/cast/test/utility/udp_proxy.cc +++ b/media/cast/test/utility/udp_proxy.cc @@ -10,7 +10,9 @@ #include "base/logging.h" #include "base/rand_util.h" +#include "base/single_thread_task_runner.h" #include "base/synchronization/waitable_event.h" +#include "base/thread_task_runner_handle.h" #include "base/threading/thread.h" #include "base/time/default_tick_clock.h" #include "net/base/io_buffer.h" @@ -741,9 +743,9 @@ class UDPProxyImpl : public UDPProxy { socket_.reset(new net::UDPServerSocket(net_log, net::NetLog::Source())); BuildPipe(&to_dest_pipe_, new PacketSender(this, &destination_)); BuildPipe(&from_dest_pipe_, new PacketSender(this, &return_address_)); - to_dest_pipe_->InitOnIOThread(base::MessageLoopProxy::current(), + to_dest_pipe_->InitOnIOThread(base::ThreadTaskRunnerHandle::Get(), &tick_clock_); - from_dest_pipe_->InitOnIOThread(base::MessageLoopProxy::current(), + from_dest_pipe_->InitOnIOThread(base::ThreadTaskRunnerHandle::Get(), &tick_clock_); VLOG(0) << "From:" << local_port_.ToString(); diff --git a/media/cast/test/utility/udp_proxy_main.cc b/media/cast/test/utility/udp_proxy_main.cc index c1e269d..7d7e30f 100644 --- a/media/cast/test/utility/udp_proxy_main.cc +++ b/media/cast/test/utility/udp_proxy_main.cc @@ -13,6 +13,8 @@ #include "base/lazy_instance.h" #include "base/logging.h" #include "base/message_loop/message_loop.h" +#include "base/single_thread_task_runner.h" +#include "base/thread_task_runner_handle.h" #include "media/cast/test/utility/udp_proxy.h" class ByteCounter { @@ -115,7 +117,7 @@ void CheckByteCounters() { g_counter.Get().last_printout = now; } - base::MessageLoopProxy::current()->PostDelayedTask( + base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( FROM_HERE, base::Bind(&CheckByteCounters), base::TimeDelta::FromMilliseconds(100)); diff --git a/media/cdm/default_cdm_factory.cc b/media/cdm/default_cdm_factory.cc index 202f3cd..4132a24 100644 --- a/media/cdm/default_cdm_factory.cc +++ b/media/cdm/default_cdm_factory.cc @@ -7,7 +7,8 @@ #include "base/bind.h" #include "base/bind_helpers.h" #include "base/location.h" -#include "base/message_loop/message_loop_proxy.h" +#include "base/single_thread_task_runner.h" +#include "base/thread_task_runner_handle.h" #include "media/base/key_systems.h" #include "media/cdm/aes_decryptor.h" #include "url/gurl.h" @@ -32,7 +33,7 @@ void DefaultCdmFactory::Create( const SessionExpirationUpdateCB& session_expiration_update_cb, const CdmCreatedCB& cdm_created_cb) { if (!security_origin.is_valid() || !CanUseAesDecryptor(key_system)) { - base::MessageLoopProxy::current()->PostTask( + base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::Bind(cdm_created_cb, nullptr)); return; } @@ -40,7 +41,7 @@ void DefaultCdmFactory::Create( scoped_ptr<MediaKeys> cdm( new AesDecryptor(security_origin, session_message_cb, session_closed_cb, session_keys_change_cb)); - base::MessageLoopProxy::current()->PostTask( + base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::Bind(cdm_created_cb, base::Passed(&cdm))); } diff --git a/media/filters/clockless_video_frame_scheduler.cc b/media/filters/clockless_video_frame_scheduler.cc index b37d430..18ebaa5 100644 --- a/media/filters/clockless_video_frame_scheduler.cc +++ b/media/filters/clockless_video_frame_scheduler.cc @@ -6,7 +6,8 @@ #include "base/bind.h" #include "base/location.h" -#include "base/message_loop/message_loop_proxy.h" +#include "base/single_thread_task_runner.h" +#include "base/thread_task_runner_handle.h" #include "media/base/video_frame.h" namespace media { @@ -24,7 +25,7 @@ void ClocklessVideoFrameScheduler::ScheduleVideoFrame( base::TimeTicks /* wall_ticks */, const DoneCB& done_cb) { display_cb_.Run(frame); - base::MessageLoopProxy::current()->PostTask( + base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::Bind(done_cb, frame, DISPLAYED)); } diff --git a/media/filters/default_media_permission.cc b/media/filters/default_media_permission.cc index 80d7093..60623b9 100644 --- a/media/filters/default_media_permission.cc +++ b/media/filters/default_media_permission.cc @@ -7,7 +7,8 @@ #include "base/bind.h" #include "base/location.h" #include "base/logging.h" -#include "base/message_loop/message_loop_proxy.h" +#include "base/single_thread_task_runner.h" +#include "base/thread_task_runner_handle.h" namespace media { @@ -25,7 +26,7 @@ static void FirePermissionStatusCallback( "real user's consent. This should NOT be used for in a real " "user-facing product."; // Return the callback asynchronously. - base::MessageLoopProxy::current()->PostTask( + base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::Bind(permission_status_cb, allow)); } diff --git a/media/filters/fake_demuxer_stream.cc b/media/filters/fake_demuxer_stream.cc index aaffa51..15748d5 100644 --- a/media/filters/fake_demuxer_stream.cc +++ b/media/filters/fake_demuxer_stream.cc @@ -8,7 +8,8 @@ #include "base/callback_helpers.h" #include "base/location.h" #include "base/logging.h" -#include "base/message_loop/message_loop_proxy.h" +#include "base/single_thread_task_runner.h" +#include "base/thread_task_runner_handle.h" #include "media/base/bind_to_current_loop.h" #include "media/base/decoder_buffer.h" #include "media/base/test_helpers.h" @@ -33,7 +34,7 @@ const uint8 kIv[] = { FakeDemuxerStream::FakeDemuxerStream(int num_configs, int num_buffers_in_one_config, bool is_encrypted) - : task_runner_(base::MessageLoopProxy::current()), + : task_runner_(base::ThreadTaskRunnerHandle::Get()), num_configs_(num_configs), num_buffers_in_one_config_(num_buffers_in_one_config), config_changes_(num_configs > 1), diff --git a/media/filters/ffmpeg_demuxer.cc b/media/filters/ffmpeg_demuxer.cc index 7cb05d7..453027d 100644 --- a/media/filters/ffmpeg_demuxer.cc +++ b/media/filters/ffmpeg_demuxer.cc @@ -12,13 +12,14 @@ #include "base/callback.h" #include "base/callback_helpers.h" #include "base/memory/scoped_ptr.h" -#include "base/message_loop/message_loop_proxy.h" #include "base/metrics/sparse_histogram.h" +#include "base/single_thread_task_runner.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" #include "base/sys_byteorder.h" #include "base/task_runner_util.h" +#include "base/thread_task_runner_handle.h" #include "base/time/time.h" #include "media/base/audio_decoder_config.h" #include "media/base/bind_to_current_loop.h" @@ -90,7 +91,7 @@ static base::TimeDelta ExtractStartTime(AVStream* stream, FFmpegDemuxerStream::FFmpegDemuxerStream(FFmpegDemuxer* demuxer, AVStream* stream) : demuxer_(demuxer), - task_runner_(base::MessageLoopProxy::current()), + task_runner_(base::ThreadTaskRunnerHandle::Get()), stream_(stream), type_(UNKNOWN), liveness_(LIVENESS_UNKNOWN), diff --git a/media/video/capture/linux/video_capture_device_chromeos.cc b/media/video/capture/linux/video_capture_device_chromeos.cc index 4a6b501..5abfbff 100644 --- a/media/video/capture/linux/video_capture_device_chromeos.cc +++ b/media/video/capture/linux/video_capture_device_chromeos.cc @@ -6,7 +6,8 @@ #include "base/bind.h" #include "base/memory/ref_counted.h" -#include "base/message_loop/message_loop_proxy.h" +#include "base/single_thread_task_runner.h" +#include "base/thread_task_runner_handle.h" #include "ui/gfx/display.h" #include "ui/gfx/display_observer.h" #include "ui/gfx/screen.h" @@ -24,7 +25,7 @@ class VideoCaptureDeviceChromeOS::ScreenObserverDelegate scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) : capture_device_(capture_device), ui_task_runner_(ui_task_runner), - capture_task_runner_(base::MessageLoopProxy::current()) { + capture_task_runner_(base::ThreadTaskRunnerHandle::Get()) { ui_task_runner_->PostTask( FROM_HERE, base::Bind(&ScreenObserverDelegate::AddObserverOnUIThread, this)); diff --git a/media/video/capture/mac/video_capture_device_factory_mac_unittest.mm b/media/video/capture/mac/video_capture_device_factory_mac_unittest.mm index 7094f3d..71fcaab 100644 --- a/media/video/capture/mac/video_capture_device_factory_mac_unittest.mm +++ b/media/video/capture/mac/video_capture_device_factory_mac_unittest.mm @@ -3,7 +3,8 @@ // found in the LICENSE file. #include "base/command_line.h" -#include "base/message_loop/message_loop_proxy.h" +#include "base/single_thread_task_runner.h" +#include "base/thread_task_runner_handle.h" #import "media/base/mac/avfoundation_glue.h" #include "media/base/media_switches.h" #include "media/video/capture/mac/video_capture_device_factory_mac.h" @@ -25,7 +26,7 @@ TEST_F(VideoCaptureDeviceFactoryMacTest, ListDevicesAVFoundation) { return; } VideoCaptureDeviceFactoryMac video_capture_device_factory( - base::MessageLoopProxy::current()); + base::ThreadTaskRunnerHandle::Get()); VideoCaptureDevice::Names names; video_capture_device_factory.GetDeviceNames(&names); diff --git a/media/video/capture/mac/video_capture_device_mac.mm b/media/video/capture/mac/video_capture_device_mac.mm index b35729d..521a111 100644 --- a/media/video/capture/mac/video_capture_device_mac.mm +++ b/media/video/capture/mac/video_capture_device_mac.mm @@ -13,8 +13,9 @@ #include "base/logging.h" #include "base/mac/scoped_ioobject.h" #include "base/mac/scoped_ioplugininterface.h" -#include "base/message_loop/message_loop_proxy.h" +#include "base/single_thread_task_runner.h" #include "base/strings/string_number_conversions.h" +#include "base/thread_task_runner_handle.h" #include "base/time/time.h" #import "media/base/mac/avfoundation_glue.h" #import "media/video/capture/mac/platform_video_capturing_mac.h" @@ -345,7 +346,7 @@ const std::string VideoCaptureDevice::Name::GetModel() const { VideoCaptureDeviceMac::VideoCaptureDeviceMac(const Name& device_name) : device_name_(device_name), tried_to_square_pixels_(false), - task_runner_(base::MessageLoopProxy::current()), + task_runner_(base::ThreadTaskRunnerHandle::Get()), state_(kNotInitialized), capture_device_(nil), weak_factory_(this) { diff --git a/media/video/capture/video_capture_device_unittest.cc b/media/video/capture/video_capture_device_unittest.cc index 961957f..e0ef925 100644 --- a/media/video/capture/video_capture_device_unittest.cc +++ b/media/video/capture/video_capture_device_unittest.cc @@ -6,9 +6,10 @@ #include "base/bind_helpers.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" -#include "base/message_loop/message_loop_proxy.h" #include "base/run_loop.h" +#include "base/single_thread_task_runner.h" #include "base/test/test_timeouts.h" +#include "base/thread_task_runner_handle.h" #include "base/threading/thread.h" #include "media/base/video_capture_types.h" #include "media/video/capture/video_capture_device.h" @@ -80,7 +81,8 @@ class MockClient : public VideoCaptureDevice::Client { MOCK_METHOD1(OnError, void(const std::string& reason)); explicit MockClient(base::Callback<void(const VideoCaptureFormat&)> frame_cb) - : main_thread_(base::MessageLoopProxy::current()), frame_cb_(frame_cb) {} + : main_thread_(base::ThreadTaskRunnerHandle::Get()), + frame_cb_(frame_cb) {} void OnIncomingCapturedData(const uint8* data, int length, @@ -141,7 +143,7 @@ class VideoCaptureDeviceTest : public testing::Test { new MockClient(base::Bind(&VideoCaptureDeviceTest::OnFrameCaptured, base::Unretained(this)))), video_capture_device_factory_(VideoCaptureDeviceFactory::CreateFactory( - base::MessageLoopProxy::current())) { + base::ThreadTaskRunnerHandle::Get())) { device_enumeration_listener_ = new DeviceEnumerationListener(); } |