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

Unified Diff: chromecast/renderer/media/media_pipeline_proxy.cc

Issue 1142513004: Chromecast: MessageLoopProxy cleanup --> SingleThreadTaskRunner. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromecast/renderer/media/media_pipeline_proxy.h ('k') | chromecast/renderer/media/video_pipeline_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromecast/renderer/media/media_pipeline_proxy.cc
diff --git a/chromecast/renderer/media/media_pipeline_proxy.cc b/chromecast/renderer/media/media_pipeline_proxy.cc
index 830ac0fe1340933ed4652812077687885dc12eba..5168f4984540bc5b3df607db7deec7769b77d46c 100644
--- a/chromecast/renderer/media/media_pipeline_proxy.cc
+++ b/chromecast/renderer/media/media_pipeline_proxy.cc
@@ -8,7 +8,7 @@
#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 "chromecast/common/media/cma_messages.h"
#include "chromecast/media/cma/base/coded_frame_provider.h"
#include "chromecast/renderer/media/audio_pipeline_proxy.h"
@@ -149,44 +149,40 @@ void MediaPipelineProxyInternal::OnStateChanged(
base::ResetAndReturn(&status_cb_).Run(status);
}
-
-// A macro runs current member function on |io_message_loop_proxy_| thread.
-#define FORWARD_ON_IO_THREAD(param_fn, ...) \
- io_message_loop_proxy_->PostTask( \
- FROM_HERE, \
- base::Bind(&MediaPipelineProxyInternal::param_fn, \
- base::Unretained(proxy_.get()), ##__VA_ARGS__))
+// A macro runs current member function on |io_task_runner_| thread.
+#define FORWARD_ON_IO_THREAD(param_fn, ...) \
+ io_task_runner_->PostTask( \
+ FROM_HERE, base::Bind(&MediaPipelineProxyInternal::param_fn, \
+ base::Unretained(proxy_.get()), ##__VA_ARGS__))
MediaPipelineProxy::MediaPipelineProxy(
int render_frame_id,
- scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy,
+ scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
LoadType load_type)
- : io_message_loop_proxy_(io_message_loop_proxy),
+ : io_task_runner_(io_task_runner),
render_frame_id_(render_frame_id),
media_channel_proxy_(new MediaChannelProxy),
proxy_(new MediaPipelineProxyInternal(media_channel_proxy_)),
has_audio_(false),
has_video_(false),
- audio_pipeline_(new AudioPipelineProxy(
- io_message_loop_proxy, media_channel_proxy_)),
- video_pipeline_(new VideoPipelineProxy(
- io_message_loop_proxy, media_channel_proxy_)),
+ audio_pipeline_(
+ new AudioPipelineProxy(io_task_runner, media_channel_proxy_)),
+ video_pipeline_(
+ new VideoPipelineProxy(io_task_runner, media_channel_proxy_)),
weak_factory_(this) {
weak_this_ = weak_factory_.GetWeakPtr();
- io_message_loop_proxy_->PostTask(
+ io_task_runner_->PostTask(
FROM_HERE,
- base::Bind(&MediaChannelProxy::Open, media_channel_proxy_,
- load_type));
+ base::Bind(&MediaChannelProxy::Open, media_channel_proxy_, load_type));
thread_checker_.DetachFromThread();
}
MediaPipelineProxy::~MediaPipelineProxy() {
- io_message_loop_proxy_->PostTask(
+ io_task_runner_->PostTask(
FROM_HERE,
base::Bind(&MediaPipelineProxyInternal::Release, base::Passed(&proxy_)));
- io_message_loop_proxy_->PostTask(
- FROM_HERE,
- base::Bind(&MediaChannelProxy::Close, media_channel_proxy_));
+ io_task_runner_->PostTask(
+ FROM_HERE, base::Bind(&MediaChannelProxy::Close, media_channel_proxy_));
}
void MediaPipelineProxy::SetClient(
« no previous file with comments | « chromecast/renderer/media/media_pipeline_proxy.h ('k') | chromecast/renderer/media/video_pipeline_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698