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

Unified Diff: remoting/client/plugin/chromoting_scriptable_object.cc

Issue 6903048: Merge 82973 - Cope gracefully with scripts querying stats before client has started. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/742/src/
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/client/plugin/chromoting_instance.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/plugin/chromoting_scriptable_object.cc
===================================================================
--- remoting/client/plugin/chromoting_scriptable_object.cc (revision 83090)
+++ remoting/client/plugin/chromoting_scriptable_object.cc (working copy)
@@ -141,16 +141,17 @@
// If this is a statistics attribute then return the value from
// ChromotingStats structure.
+ ChromotingStats* stats = instance_->GetStats();
if (name.AsString() == kVideoBandwidthAttribute)
- return instance_->GetStats()->video_bandwidth()->Rate();
+ return stats ? stats->video_bandwidth()->Rate() : Var();
if (name.AsString() == kVideoCaptureLatencyAttribute)
- return instance_->GetStats()->video_capture_ms()->Average();
+ return stats ? stats->video_capture_ms()->Average() : Var();
if (name.AsString() == kVideoEncodeLatencyAttribute)
- return instance_->GetStats()->video_encode_ms()->Average();
+ return stats ? stats->video_encode_ms()->Average() : Var();
if (name.AsString() == kVideoDecodeLatencyAttribute)
- return instance_->GetStats()->video_decode_ms()->Average();
+ return stats ? stats->video_decode_ms()->Average() : Var();
if (name.AsString() == kVideoRenderLatencyAttribute)
- return instance_->GetStats()->video_paint_ms()->Average();
+ return stats ? stats->video_paint_ms()->Average() : Var();
// TODO(ajwong): This incorrectly return a null object if a function
// property is requested.
« no previous file with comments | « remoting/client/plugin/chromoting_instance.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698