From afa6d16a05301c462ff65aa4f1537a1aa12a0a7a Mon Sep 17 00:00:00 2001 From: "tommi@webrtc.org" Date: Mon, 2 Mar 2015 11:27:48 +0000 Subject: [PATCH] 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 --- talk/app/webrtc/statstypes.cc | 4 ++++ talk/app/webrtc/statstypes.h | 1 + 2 files changed, 5 insertions(+) diff --git a/talk/app/webrtc/statstypes.cc b/talk/app/webrtc/statstypes.cc index de12d5d9c..f41bf7a6a 100644 --- a/talk/app/webrtc/statstypes.cc +++ b/talk/app/webrtc/statstypes.cc @@ -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.Pass()), timestamp_(0.0) { ASSERT(id_.get()); } diff --git a/talk/app/webrtc/statstypes.h b/talk/app/webrtc/statstypes.h index ece686af5..65549df85 100644 --- a/talk/app/webrtc/statstypes.h +++ b/talk/app/webrtc/statstypes.h @@ -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.