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

Side by Side Diff: remoting/client/chromoting_client.cc

Issue 6792038: Chromoting to report roundtrip latency (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add scriptable interface Created 9 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "remoting/client/chromoting_client.h" 5 #include "remoting/client/chromoting_client.h"
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "remoting/base/tracer.h" 8 #include "remoting/base/tracer.h"
9 #include "remoting/client/chromoting_view.h" 9 #include "remoting/client/chromoting_view.h"
10 #include "remoting/client/client_context.h" 10 #include "remoting/client/client_context.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 } 130 }
131 131
132 // Record size of the packet for statistics. 132 // Record size of the packet for statistics.
133 stats_.video_bandwidth()->Record(packet->data().size()); 133 stats_.video_bandwidth()->Record(packet->data().size());
134 134
135 // Record statistics received from host. 135 // Record statistics received from host.
136 if (packet->has_capture_time_ms()) 136 if (packet->has_capture_time_ms())
137 stats_.video_capture_ms()->Record(packet->capture_time_ms()); 137 stats_.video_capture_ms()->Record(packet->capture_time_ms());
138 if (packet->has_encode_time_ms()) 138 if (packet->has_encode_time_ms())
139 stats_.video_encode_ms()->Record(packet->encode_time_ms()); 139 stats_.video_encode_ms()->Record(packet->encode_time_ms());
140 if (packet->has_client_sequence_number() &&
141 packet->client_sequence_number()) {
Wez 2011/04/05 13:46:20 Checking for presence of client_sequence_number is
Alpha Left Google 2011/04/08 00:07:20 Sounds good to me. The reason I didn't want to not
142 base::TimeDelta round_trip_latency =
143 base::Time::Now() -
144 base::Time::FromInternalValue(packet->client_sequence_number());
145 stats_.round_trip_ms()->Record(round_trip_latency.InMilliseconds());
146 }
140 147
141 received_packets_.push_back(QueuedVideoPacket(packet, done)); 148 received_packets_.push_back(QueuedVideoPacket(packet, done));
142 if (!packet_being_processed_) 149 if (!packet_being_processed_)
143 DispatchPacket(); 150 DispatchPacket();
144 } 151 }
145 152
146 int ChromotingClient::GetPendingPackets() { 153 int ChromotingClient::GetPendingPackets() {
147 return received_packets_.size(); 154 return received_packets_.size();
148 } 155 }
149 156
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 if (msg->success()) { 297 if (msg->success()) {
291 connection_->OnClientAuthenticated(); 298 connection_->OnClientAuthenticated();
292 } 299 }
293 300
294 view_->UpdateLoginStatus(msg->success(), msg->error_info()); 301 view_->UpdateLoginStatus(msg->success(), msg->error_info());
295 done->Run(); 302 done->Run();
296 delete done; 303 delete done;
297 } 304 }
298 305
299 } // namespace remoting 306 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698