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

Unified Diff: remoting/client/chromoting_client.cc

Issue 8493020: Move code in src/remoting to the new callbacks. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fix win and mac Created 9 years, 1 month 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
Index: remoting/client/chromoting_client.cc
diff --git a/remoting/client/chromoting_client.cc b/remoting/client/chromoting_client.cc
index 327afa067dfa04bc9d65367bcc9acbc7e6b02725..bde10dabba8d17b163a03913496d8bd3bd0abf91 100644
--- a/remoting/client/chromoting_client.cc
+++ b/remoting/client/chromoting_client.cc
@@ -28,7 +28,7 @@ ChromotingClient::ChromotingClient(const ClientConfig& config,
ChromotingView* view,
RectangleUpdateDecoder* rectangle_decoder,
InputHandler* input_handler,
- Task* client_done)
+ const base::Closure& client_done)
: config_(config),
context_(context),
connection_(connection),
@@ -75,8 +75,9 @@ void ChromotingClient::OnDisconnected(const base::Closure& shutdown_task) {
}
void ChromotingClient::ClientDone() {
- if (client_done_ != NULL) {
+ if (!client_done_.is_null()) {
message_loop()->PostTask(FROM_HERE, client_done_);
+ client_done_.Reset();
}
}
@@ -146,8 +147,8 @@ void ChromotingClient::DispatchPacket() {
decode_start = base::Time::Now();
rectangle_decoder_->DecodePacket(
- packet, NewRunnableMethod(this, &ChromotingClient::OnPacketDone,
- last_packet, decode_start));
+ packet, base::Bind(&ChromotingClient::OnPacketDone,
+ base::Unretained(this), last_packet, decode_start));
}
void ChromotingClient::OnConnectionState(

Powered by Google App Engine
This is Rietveld 408576698