Add a ToString() method to StatsReport::Value.

This is an interface change only at this point which will be followed up by a matching change in Chromium that removes the dependency on the 'value' member variable.  Once that's been done, I'll add native support for non-string types in the Value class.

R=magjed@webrtc.org
BUG=2822

Review URL: https://webrtc-codereview.appspot.com/40139004

Cr-Commit-Position: refs/heads/master@{#8550}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8550 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
tommi@webrtc.org 2015-03-02 11:27:48 +00:00
parent 50b2295091
commit afa6d16a05
2 changed files with 5 additions and 0 deletions

View File

@ -444,6 +444,10 @@ const char* StatsReport::Value::display_name() const {
return nullptr;
}
const std::string& StatsReport::Value::ToString() const {
return value;
}
StatsReport::StatsReport(scoped_ptr<Id> id) : id_(id.Pass()), timestamp_(0.0) {
ASSERT(id_.get());
}

View File

@ -240,6 +240,7 @@ class StatsReport {
// Returns the string representation of |name|.
const char* display_name() const;
const std::string& ToString() const;
const StatsValueName name;
// TODO(tommi): Support more value types than string.