| Index: remoting/client/plugin/chromoting_scriptable_object.cc
|
| diff --git a/remoting/client/plugin/chromoting_scriptable_object.cc b/remoting/client/plugin/chromoting_scriptable_object.cc
|
| index 9a3e2c08e4e738a870566c3d30c416218909532c..64d6cd5761f4dd7de46b53be66e2e735b951a136 100644
|
| --- a/remoting/client/plugin/chromoting_scriptable_object.cc
|
| +++ b/remoting/client/plugin/chromoting_scriptable_object.cc
|
| @@ -8,6 +8,7 @@
|
| #include "base/stringprintf.h"
|
| #include "ppapi/cpp/var.h"
|
| #include "remoting/client/client_config.h"
|
| +#include "remoting/client/chromoting_stats.h"
|
| #include "remoting/client/plugin/chromoting_instance.h"
|
| #include "remoting/client/plugin/pepper_xmpp_proxy.h"
|
|
|
| @@ -26,6 +27,7 @@ const char kLoginChallenge[] = "loginChallenge";
|
| const char kSendIq[] = "sendIq";
|
| const char kQualityAttribute[] = "quality";
|
| const char kStatusAttribute[] = "status";
|
| +const char kVideoBandwidthAttribute[] = "videoBandwidth";
|
|
|
| } // namespace
|
|
|
| @@ -69,6 +71,9 @@ void ChromotingScriptableObject::Init() {
|
| AddAttribute(kDesktopWidth, Var(0));
|
| AddAttribute(kDesktopHeight, Var(0));
|
|
|
| + // Statistics.
|
| + AddAttribute(kVideoBandwidthAttribute, Var());
|
| +
|
| AddMethod("connect", &ChromotingScriptableObject::DoConnect);
|
| AddMethod("connectSandboxed",
|
| &ChromotingScriptableObject::DoConnectSandboxed);
|
| @@ -126,6 +131,12 @@ Var ChromotingScriptableObject::GetProperty(const Var& name, Var* exception) {
|
| return ScriptableObject::GetProperty(name, exception);
|
| }
|
|
|
| + // If this is a statistics attribute then return the value from
|
| + // ChromotingStats structure.
|
| + if (name.AsString() == kVideoBandwidthAttribute) {
|
| + return instance_->GetStats()->video_bandwidth()->Rate();
|
| + }
|
| +
|
| // TODO(ajwong): This incorrectly return a null object if a function
|
| // property is requested.
|
| return properties_[iter->second].attribute;
|
|
|