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
diff --git a/talk/app/webrtc/statstypes.cc b/talk/app/webrtc/statstypes.cc
index de12d5d..f41bf7a 100644
--- a/talk/app/webrtc/statstypes.cc
+++ b/talk/app/webrtc/statstypes.cc
@@ -444,6 +444,10 @@
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());
}
diff --git a/talk/app/webrtc/statstypes.h b/talk/app/webrtc/statstypes.h
index ece686a..65549df 100644
--- a/talk/app/webrtc/statstypes.h
+++ b/talk/app/webrtc/statstypes.h
@@ -240,6 +240,7 @@
// 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.