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

Unified Diff: remoting/client/frame_consumer_proxy.cc

Issue 10454018: MessageLoopProxy cleanups in remoting client. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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 | « remoting/client/frame_consumer_proxy.h ('k') | remoting/client/plugin/chromoting_instance.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/frame_consumer_proxy.cc
diff --git a/remoting/client/frame_consumer_proxy.cc b/remoting/client/frame_consumer_proxy.cc
index b65f324d6a3b5870878c03c0bf9a005fd91b2240..11ac1e31c79ff9e67ae95178f922393f5e052f91 100644
--- a/remoting/client/frame_consumer_proxy.cc
+++ b/remoting/client/frame_consumer_proxy.cc
@@ -5,22 +5,23 @@
#include "remoting/client/frame_consumer_proxy.h"
#include "base/bind.h"
-#include "base/message_loop.h"
+#include "base/location.h"
+#include "base/single_thread_task_runner.h"
#include "ppapi/cpp/image_data.h"
namespace remoting {
FrameConsumerProxy::FrameConsumerProxy(
- scoped_refptr<base::MessageLoopProxy> frame_consumer_message_loop)
- : frame_consumer_message_loop_(frame_consumer_message_loop) {
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner)
+ : task_runner_(task_runner) {
}
void FrameConsumerProxy::ApplyBuffer(const SkISize& view_size,
const SkIRect& clip_area,
pp::ImageData* buffer,
const SkRegion& region) {
- if (!frame_consumer_message_loop_->BelongsToCurrentThread()) {
- frame_consumer_message_loop_->PostTask(FROM_HERE, base::Bind(
+ if (!task_runner_->BelongsToCurrentThread()) {
+ task_runner_->PostTask(FROM_HERE, base::Bind(
&FrameConsumerProxy::ApplyBuffer, this,
view_size, clip_area, buffer, region));
return;
@@ -31,8 +32,8 @@ void FrameConsumerProxy::ApplyBuffer(const SkISize& view_size,
}
void FrameConsumerProxy::ReturnBuffer(pp::ImageData* buffer) {
- if (!frame_consumer_message_loop_->BelongsToCurrentThread()) {
- frame_consumer_message_loop_->PostTask(FROM_HERE, base::Bind(
+ if (!task_runner_->BelongsToCurrentThread()) {
+ task_runner_->PostTask(FROM_HERE, base::Bind(
&FrameConsumerProxy::ReturnBuffer, this, buffer));
return;
}
@@ -42,8 +43,8 @@ void FrameConsumerProxy::ReturnBuffer(pp::ImageData* buffer) {
}
void FrameConsumerProxy::SetSourceSize(const SkISize& source_size) {
- if (!frame_consumer_message_loop_->BelongsToCurrentThread()) {
- frame_consumer_message_loop_->PostTask(FROM_HERE, base::Bind(
+ if (!task_runner_->BelongsToCurrentThread()) {
+ task_runner_->PostTask(FROM_HERE, base::Bind(
&FrameConsumerProxy::SetSourceSize, this, source_size));
return;
}
@@ -54,13 +55,12 @@ void FrameConsumerProxy::SetSourceSize(const SkISize& source_size) {
void FrameConsumerProxy::Attach(
const base::WeakPtr<FrameConsumer>& frame_consumer) {
- DCHECK(frame_consumer_message_loop_->BelongsToCurrentThread());
+ DCHECK(task_runner_->BelongsToCurrentThread());
DCHECK(frame_consumer_ == NULL);
frame_consumer_ = frame_consumer;
}
FrameConsumerProxy::~FrameConsumerProxy() {
- DCHECK(frame_consumer_message_loop_->BelongsToCurrentThread());
}
} // namespace remoting
« no previous file with comments | « remoting/client/frame_consumer_proxy.h ('k') | remoting/client/plugin/chromoting_instance.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698