diff options
author | sanjeevr@chromium.org <sanjeevr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-04 03:36:18 +0000 |
---|---|---|
committer | sanjeevr@chromium.org <sanjeevr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-04 03:36:18 +0000 |
commit | 60398ccd46e3f31d5d4541c0b6de0edde7f98504 (patch) | |
tree | 4a196ebfcc9e4d9588d97eefe95c900154c2b0f9 /remoting/client/rectangle_update_decoder.cc | |
parent | 0fb9fcfe900b38f806253024852c8d9648ed7293 (diff) | |
download | chromium_src-60398ccd46e3f31d5d4541c0b6de0edde7f98504.zip chromium_src-60398ccd46e3f31d5d4541c0b6de0edde7f98504.tar.gz chromium_src-60398ccd46e3f31d5d4541c0b6de0edde7f98504.tar.bz2 |
Used MessageLoopProxy instead of MessageLoop in RectangleUpdateDecoder.
BUG=NONE
TEST=Chromoting client
Review URL: http://codereview.chromium.org/9049011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116279 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/client/rectangle_update_decoder.cc')
-rw-r--r-- | remoting/client/rectangle_update_decoder.cc | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/remoting/client/rectangle_update_decoder.cc b/remoting/client/rectangle_update_decoder.cc index 7c20438..697a913 100644 --- a/remoting/client/rectangle_update_decoder.cc +++ b/remoting/client/rectangle_update_decoder.cc @@ -5,8 +5,9 @@ #include "remoting/client/rectangle_update_decoder.h" #include "base/bind.h" +#include "base/location.h" #include "base/logging.h" -#include "base/message_loop.h" +#include "base/message_loop_proxy.h" #include "remoting/base/decoder.h" #include "remoting/base/decoder_row_based.h" #include "remoting/base/decoder_vp8.h" @@ -19,8 +20,8 @@ using remoting::protocol::SessionConfig; namespace remoting { -RectangleUpdateDecoder::RectangleUpdateDecoder(MessageLoop* message_loop, - FrameConsumer* consumer) +RectangleUpdateDecoder::RectangleUpdateDecoder( + base::MessageLoopProxy* message_loop, FrameConsumer* consumer) : message_loop_(message_loop), consumer_(consumer), screen_size_(SkISize::Make(0, 0)), @@ -47,7 +48,7 @@ void RectangleUpdateDecoder::Initialize(const SessionConfig& config) { void RectangleUpdateDecoder::DecodePacket(const VideoPacket* packet, const base::Closure& done) { - if (message_loop_ != MessageLoop::current()) { + if (!message_loop_->BelongsToCurrentThread()) { message_loop_->PostTask( FROM_HERE, base::Bind(&RectangleUpdateDecoder::DecodePacket, this, packet, done)); @@ -58,7 +59,7 @@ void RectangleUpdateDecoder::DecodePacket(const VideoPacket* packet, void RectangleUpdateDecoder::AllocateFrame(const VideoPacket* packet, const base::Closure& done) { - if (message_loop_ != MessageLoop::current()) { + if (!message_loop_->BelongsToCurrentThread()) { message_loop_->PostTask( FROM_HERE, base::Bind(&RectangleUpdateDecoder::AllocateFrame, this, packet, done)); @@ -102,7 +103,7 @@ void RectangleUpdateDecoder::AllocateFrame(const VideoPacket* packet, void RectangleUpdateDecoder::ProcessPacketData( const VideoPacket* packet, const base::Closure& done) { - if (message_loop_ != MessageLoop::current()) { + if (!message_loop_->BelongsToCurrentThread()) { message_loop_->PostTask( FROM_HERE, base::Bind(&RectangleUpdateDecoder::ProcessPacketData, this, packet, done)); @@ -127,7 +128,7 @@ void RectangleUpdateDecoder::ProcessPacketData( } void RectangleUpdateDecoder::SetOutputSize(const SkISize& size) { - if (message_loop_ != MessageLoop::current()) { + if (!message_loop_->BelongsToCurrentThread()) { message_loop_->PostTask( FROM_HERE, base::Bind(&RectangleUpdateDecoder::SetOutputSize, this, size)); @@ -150,7 +151,7 @@ void RectangleUpdateDecoder::SetOutputSize(const SkISize& size) { } void RectangleUpdateDecoder::UpdateClipRect(const SkIRect& new_clip_rect) { - if (message_loop_ != MessageLoop::current()) { + if (!message_loop_->BelongsToCurrentThread()) { message_loop_->PostTask( FROM_HERE, base::Bind(&RectangleUpdateDecoder::UpdateClipRect, this, new_clip_rect)); @@ -174,7 +175,7 @@ void RectangleUpdateDecoder::UpdateClipRect(const SkIRect& new_clip_rect) { } void RectangleUpdateDecoder::RefreshFullFrame() { - if (message_loop_ != MessageLoop::current()) { + if (!message_loop_->BelongsToCurrentThread()) { message_loop_->PostTask( FROM_HERE, base::Bind(&RectangleUpdateDecoder::RefreshFullFrame, this)); return; @@ -205,7 +206,7 @@ void RectangleUpdateDecoder::SubmitToConsumer() { } void RectangleUpdateDecoder::DoRefresh() { - DCHECK_EQ(message_loop_, MessageLoop::current()); + DCHECK(message_loop_->BelongsToCurrentThread()); if (refresh_rects_.empty()) return; @@ -216,7 +217,7 @@ void RectangleUpdateDecoder::DoRefresh() { } void RectangleUpdateDecoder::OnFrameConsumed(RectVector* rects) { - if (message_loop_ != MessageLoop::current()) { + if (!message_loop_->BelongsToCurrentThread()) { message_loop_->PostTask( FROM_HERE, base::Bind(&RectangleUpdateDecoder::OnFrameConsumed, this, rects)); |