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

Unified Diff: remoting/client/chromoting_client.cc

Issue 9827006: Refactor VideoStub interface to accept ownership of video packets. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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
Index: remoting/client/chromoting_client.cc
diff --git a/remoting/client/chromoting_client.cc b/remoting/client/chromoting_client.cc
index 521a875a3874aaf6dda250580f5832a5883c20e3..33ba64848bcac80a64d46ecaa7c9c364cbf8ae1b 100644
--- a/remoting/client/chromoting_client.cc
+++ b/remoting/client/chromoting_client.cc
@@ -19,8 +19,8 @@ namespace remoting {
using protocol::AuthenticationMethod;
ChromotingClient::QueuedVideoPacket::QueuedVideoPacket(
- const VideoPacket* packet, const base::Closure& done)
- : packet(packet), done(done) {
+ scoped_ptr<VideoPacket> packet, const base::Closure& done)
+ : packet(packet.release()), done(done) {
Alpha Left Google 2012/03/26 20:29:18 This line seems odd to me, can we use different va
Sergey Ulanov 2012/03/26 20:42:13 done(done) was here before. We need to release()
}
ChromotingClient::QueuedVideoPacket::~QueuedVideoPacket() {
@@ -103,7 +103,7 @@ ChromotingStats* ChromotingClient::GetStats() {
return &stats_;
}
-void ChromotingClient::ProcessVideoPacket(const VideoPacket* packet,
+void ChromotingClient::ProcessVideoPacket(scoped_ptr<VideoPacket> packet,
const base::Closure& done) {
DCHECK(message_loop()->BelongsToCurrentThread());
@@ -132,7 +132,7 @@ void ChromotingClient::ProcessVideoPacket(const VideoPacket* packet,
stats_.round_trip_ms()->Record(round_trip_latency.InMilliseconds());
}
- received_packets_.push_back(QueuedVideoPacket(packet, done));
+ received_packets_.push_back(QueuedVideoPacket(packet.Pass(), done));
if (!packet_being_processed_)
DispatchPacket();
}

Powered by Google App Engine
This is Rietveld 408576698