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

Unified Diff: remoting/client/chromoting_client.cc

Issue 8116021: Switch remoting/protocol to new callbacks (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years, 2 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/chromoting_client.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/chromoting_client.cc
diff --git a/remoting/client/chromoting_client.cc b/remoting/client/chromoting_client.cc
index 22569625cbeb1413ce3f54a34abad2e26e3153e6..7251bd64b62b6f23ee8a4b33927398538af2f8ee 100644
--- a/remoting/client/chromoting_client.cc
+++ b/remoting/client/chromoting_client.cc
@@ -14,6 +14,14 @@
namespace remoting {
+ChromotingClient::QueuedVideoPacket::QueuedVideoPacket(
+ const VideoPacket* packet, const base::Closure& done)
+ : packet(packet), done(done) {
+}
+
+ChromotingClient::QueuedVideoPacket::~QueuedVideoPacket() {
+}
+
ChromotingClient::ChromotingClient(const ClientConfig& config,
ClientContext* context,
protocol::ConnectionToHost* connection,
@@ -82,14 +90,13 @@ void ChromotingClient::Repaint() {
}
void ChromotingClient::ProcessVideoPacket(const VideoPacket* packet,
- Task* done) {
+ const base::Closure& done) {
DCHECK(message_loop()->BelongsToCurrentThread());
// If the video packet is empty then drop it. Empty packets are used to
// maintain activity on the network.
if (!packet->has_data() || packet->data().size() == 0) {
- done->Run();
- delete done;
+ done.Run();
return;
}
@@ -172,8 +179,7 @@ void ChromotingClient::OnPacketDone(bool last_packet,
(base::Time::Now() - decode_start).InMilliseconds());
}
- received_packets_.front().done->Run();
- delete received_packets_.front().done;
+ received_packets_.front().done.Run();
received_packets_.pop_front();
packet_being_processed_ = false;
@@ -199,7 +205,7 @@ void ChromotingClient::Initialize() {
////////////////////////////////////////////////////////////////////////////
// ClientStub control channel interface.
void ChromotingClient::BeginSessionResponse(
- const protocol::LocalLoginStatus* msg, Task* done) {
+ const protocol::LocalLoginStatus* msg, const base::Closure& done) {
if (!message_loop()->BelongsToCurrentThread()) {
thread_proxy_.PostTask(FROM_HERE, base::Bind(
&ChromotingClient::BeginSessionResponse, base::Unretained(this),
@@ -216,8 +222,7 @@ void ChromotingClient::BeginSessionResponse(
}
view_->UpdateLoginStatus(msg->success(), msg->error_info());
- done->Run();
- delete done;
+ done.Run();
}
} // namespace remoting
« no previous file with comments | « remoting/client/chromoting_client.h ('k') | remoting/client/plugin/chromoting_instance.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698