summaryrefslogtreecommitdiffstats
path: root/remoting/client/plugin
diff options
context:
space:
mode:
authorsergeyu <sergeyu@chromium.org>2015-09-16 17:45:24 -0700
committerCommit bot <commit-bot@chromium.org>2015-09-17 00:46:24 +0000
commitaa1f0239f0a5d0ace93c63022829fcf39fee99e7 (patch)
tree0a15e80333e1e0925ef42596526f5b066d052b66 /remoting/client/plugin
parentd24401d628410cc67c4ae7a7bc9c3a5e65fa0572 (diff)
downloadchromium_src-aa1f0239f0a5d0ace93c63022829fcf39fee99e7.zip
chromium_src-aa1f0239f0a5d0ace93c63022829fcf39fee99e7.tar.gz
chromium_src-aa1f0239f0a5d0ace93c63022829fcf39fee99e7.tar.bz2
Rename/Move ChromotingStats->protocol::PerformanceTracker
The class will be used directly from protocol dispatchers, so it needs to be accessible on the protocol layer. Also renamed it so the name reflects what the class is responsible for. Review URL: https://codereview.chromium.org/1351723004 Cr-Commit-Position: refs/heads/master@{#349295}
Diffstat (limited to 'remoting/client/plugin')
-rw-r--r--remoting/client/plugin/chromoting_instance.cc27
-rw-r--r--remoting/client/plugin/chromoting_instance.h2
-rw-r--r--remoting/client/plugin/pepper_video_renderer_2d.cc6
-rw-r--r--remoting/client/plugin/pepper_video_renderer_2d.h2
-rw-r--r--remoting/client/plugin/pepper_video_renderer_3d.cc12
-rw-r--r--remoting/client/plugin/pepper_video_renderer_3d.h6
6 files changed, 28 insertions, 27 deletions
diff --git a/remoting/client/plugin/chromoting_instance.cc b/remoting/client/plugin/chromoting_instance.cc
index 9111f61..82f1e40 100644
--- a/remoting/client/plugin/chromoting_instance.cc
+++ b/remoting/client/plugin/chromoting_instance.cc
@@ -641,7 +641,7 @@ void ChromotingInstance::HandleConnect(const base::DictionaryValue& data) {
CHECK(video_renderer_);
- video_renderer_->GetStats()->SetUpdateUmaCallbacks(
+ video_renderer_->GetPerformanceTracker()->SetUpdateUmaCallbacks(
base::Bind(&ChromotingInstance::UpdateUmaCustomHistogram,
weak_factory_.GetWeakPtr(), true),
base::Bind(&ChromotingInstance::UpdateUmaCustomHistogram,
@@ -719,7 +719,7 @@ void ChromotingInstance::HandleConnect(const base::DictionaryValue& data) {
FROM_HERE, base::Bind(&ChromotingInstance::SendPerfStats,
weak_factory_.GetWeakPtr()),
base::TimeDelta::FromSeconds(
- ChromotingStats::kStatsUpdateFrequencyInSeconds));
+ protocol::PerformanceTracker::kStatsUpdateFrequencyInSeconds));
}
void ChromotingInstance::HandleDisconnect(const base::DictionaryValue& data) {
@@ -1032,25 +1032,26 @@ void ChromotingInstance::SendPerfStats() {
FROM_HERE, base::Bind(&ChromotingInstance::SendPerfStats,
weak_factory_.GetWeakPtr()),
base::TimeDelta::FromSeconds(
- ChromotingStats::kStatsUpdateFrequencyInSeconds));
+ protocol::PerformanceTracker::kStatsUpdateFrequencyInSeconds));
// Fetch performance stats from the VideoRenderer and send them to the client
// for display to users.
scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue());
- ChromotingStats* stats = video_renderer_->GetStats();
- data->SetDouble("videoBandwidth", stats->video_bandwidth());
- data->SetDouble("videoFrameRate", stats->video_frame_rate());
- data->SetDouble("captureLatency", stats->video_capture_ms());
- data->SetDouble("encodeLatency", stats->video_encode_ms());
- data->SetDouble("decodeLatency", stats->video_decode_ms());
- data->SetDouble("renderLatency", stats->video_paint_ms());
- data->SetDouble("roundtripLatency", stats->round_trip_ms());
+ protocol::PerformanceTracker* perf_tracker =
+ video_renderer_->GetPerformanceTracker();
+ data->SetDouble("videoBandwidth", perf_tracker->video_bandwidth());
+ data->SetDouble("videoFrameRate", perf_tracker->video_frame_rate());
+ data->SetDouble("captureLatency", perf_tracker->video_capture_ms());
+ data->SetDouble("encodeLatency", perf_tracker->video_encode_ms());
+ data->SetDouble("decodeLatency", perf_tracker->video_decode_ms());
+ data->SetDouble("renderLatency", perf_tracker->video_paint_ms());
+ data->SetDouble("roundtripLatency", perf_tracker->round_trip_ms());
PostLegacyJsonMessage("onPerfStats", data.Pass());
// Record the video frame-rate, packet-rate and bandwidth stats to UMA.
- // TODO(anandc): Create a timer in ChromotingStats to do this work.
+ // TODO(anandc): Create a timer in PerformanceTracker to do this work.
// See http://crbug/508602.
- stats->UploadRateStatsToUma();
+ perf_tracker->UploadRateStatsToUma();
}
// static
diff --git a/remoting/client/plugin/chromoting_instance.h b/remoting/client/plugin/chromoting_instance.h
index 9e453d5..07fdad4 100644
--- a/remoting/client/plugin/chromoting_instance.h
+++ b/remoting/client/plugin/chromoting_instance.h
@@ -17,7 +17,6 @@
#include "ppapi/cpp/instance.h"
#include "ppapi/cpp/text_input_controller.h"
#include "ppapi/cpp/var.h"
-#include "remoting/client/chromoting_stats.h"
#include "remoting/client/client_context.h"
#include "remoting/client/client_user_interface.h"
#include "remoting/client/empty_cursor_filter.h"
@@ -35,6 +34,7 @@
#include "remoting/protocol/input_event_tracker.h"
#include "remoting/protocol/mouse_input_filter.h"
#include "remoting/protocol/negotiating_client_authenticator.h"
+#include "remoting/protocol/performance_tracker.h"
#include "remoting/protocol/third_party_client_authenticator.h"
namespace base {
diff --git a/remoting/client/plugin/pepper_video_renderer_2d.cc b/remoting/client/plugin/pepper_video_renderer_2d.cc
index 5d07277..94650fe 100644
--- a/remoting/client/plugin/pepper_video_renderer_2d.cc
+++ b/remoting/client/plugin/pepper_video_renderer_2d.cc
@@ -15,10 +15,10 @@
#include "ppapi/cpp/rect.h"
#include "ppapi/cpp/size.h"
#include "remoting/base/util.h"
-#include "remoting/client/chromoting_stats.h"
#include "remoting/client/client_context.h"
#include "remoting/client/software_video_renderer.h"
#include "remoting/proto/video.pb.h"
+#include "remoting/protocol/performance_tracker.h"
#include "third_party/libyuv/include/libyuv/scale_argb.h"
#include "third_party/webrtc/modules/desktop_capture/desktop_frame.h"
@@ -102,10 +102,10 @@ void PepperVideoRenderer2D::OnSessionConfig(
software_video_renderer_->OnSessionConfig(config);
}
-ChromotingStats* PepperVideoRenderer2D::GetStats() {
+protocol::PerformanceTracker* PepperVideoRenderer2D::GetPerformanceTracker() {
DCHECK(thread_checker_.CalledOnValidThread());
- return software_video_renderer_->GetStats();
+ return software_video_renderer_->GetPerformanceTracker();
}
protocol::VideoStub* PepperVideoRenderer2D::GetVideoStub() {
diff --git a/remoting/client/plugin/pepper_video_renderer_2d.h b/remoting/client/plugin/pepper_video_renderer_2d.h
index 6f8d35d..2da59c6 100644
--- a/remoting/client/plugin/pepper_video_renderer_2d.h
+++ b/remoting/client/plugin/pepper_video_renderer_2d.h
@@ -52,7 +52,7 @@ class PepperVideoRenderer2D : public PepperVideoRenderer,
// VideoRenderer interface.
void OnSessionConfig(const protocol::SessionConfig& config) override;
- ChromotingStats* GetStats() override;
+ protocol::PerformanceTracker* GetPerformanceTracker() override;
protocol::VideoStub* GetVideoStub() override;
private:
diff --git a/remoting/client/plugin/pepper_video_renderer_3d.cc b/remoting/client/plugin/pepper_video_renderer_3d.cc
index b437292..8625d31 100644
--- a/remoting/client/plugin/pepper_video_renderer_3d.cc
+++ b/remoting/client/plugin/pepper_video_renderer_3d.cc
@@ -14,8 +14,8 @@
#include "ppapi/cpp/instance.h"
#include "ppapi/lib/gl/include/GLES2/gl2.h"
#include "ppapi/lib/gl/include/GLES2/gl2ext.h"
-#include "remoting/client/chromoting_stats.h"
#include "remoting/proto/video.pb.h"
+#include "remoting/protocol/performance_tracker.h"
#include "remoting/protocol/session_config.h"
namespace remoting {
@@ -187,8 +187,8 @@ void PepperVideoRenderer3D::OnSessionConfig(
<< "video_decoder_.Initialize() returned " << result;
}
-ChromotingStats* PepperVideoRenderer3D::GetStats() {
- return &stats_;
+protocol::PerformanceTracker* PepperVideoRenderer3D::GetPerformanceTracker() {
+ return &perf_tracker_;
}
protocol::VideoStub* PepperVideoRenderer3D::GetVideoStub() {
@@ -199,7 +199,7 @@ void PepperVideoRenderer3D::ProcessVideoPacket(scoped_ptr<VideoPacket> packet,
const base::Closure& done) {
base::ScopedClosureRunner done_runner(done);
- stats_.RecordVideoPacketStats(*packet);
+ perf_tracker_.RecordVideoPacketStats(*packet);
// Don't need to do anything if the packet is empty. Host sends empty video
// packets when the screen is not changing.
@@ -344,7 +344,7 @@ void PepperVideoRenderer3D::OnPictureReady(int32_t result,
base::TimeDelta decode_time =
base::TimeTicks::Now() - frame_timer.decode_started_time;
- stats_.RecordDecodeTime(decode_time.InMilliseconds());
+ perf_tracker_.RecordDecodeTime(decode_time.InMilliseconds());
frame_decode_timestamps_.pop_front();
@@ -426,7 +426,7 @@ void PepperVideoRenderer3D::OnPaintDone(int32_t result) {
paint_pending_ = false;
base::TimeDelta paint_time =
base::TimeTicks::Now() - latest_paint_started_time_;
- stats_.RecordPaintTime(paint_time.InMilliseconds());
+ perf_tracker_.RecordPaintTime(paint_time.InMilliseconds());
PaintIfNeeded();
}
diff --git a/remoting/client/plugin/pepper_video_renderer_3d.h b/remoting/client/plugin/pepper_video_renderer_3d.h
index 3e0889f..545ffc5 100644
--- a/remoting/client/plugin/pepper_video_renderer_3d.h
+++ b/remoting/client/plugin/pepper_video_renderer_3d.h
@@ -15,8 +15,8 @@
#include "ppapi/cpp/instance_handle.h"
#include "ppapi/cpp/video_decoder.h"
#include "ppapi/utility/completion_callback_factory.h"
-#include "remoting/client/chromoting_stats.h"
#include "remoting/client/plugin/pepper_video_renderer.h"
+#include "remoting/protocol/performance_tracker.h"
#include "remoting/protocol/video_stub.h"
#include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h"
#include "third_party/webrtc/modules/desktop_capture/desktop_region.h"
@@ -42,7 +42,7 @@ class PepperVideoRenderer3D : public PepperVideoRenderer,
// VideoRenderer interface.
void OnSessionConfig(const protocol::SessionConfig& config) override;
- ChromotingStats* GetStats() override;
+ protocol::PerformanceTracker* GetPerformanceTracker() override;
protocol::VideoStub* GetVideoStub() override;
// protocol::VideoStub interface.
@@ -107,7 +107,7 @@ class PepperVideoRenderer3D : public PepperVideoRenderer,
webrtc::DesktopSize view_size_;
- ChromotingStats stats_;
+ protocol::PerformanceTracker perf_tracker_;
bool initialization_finished_;
bool decode_pending_;