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

Unified Diff: third_party/WebKit/public/platform/WebRTCStats.h

Issue 2186853002: WebRTCStats added, retaining type info when surfacing WebRTC stats into Blink (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed tommi's comments Created 4 years, 5 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
Index: third_party/WebKit/public/platform/WebRTCStats.h
diff --git a/third_party/WebKit/public/platform/WebRTCStats.h b/third_party/WebKit/public/platform/WebRTCStats.h
new file mode 100644
index 0000000000000000000000000000000000000000..68836a3c0efe8232f46b21982dcea244471894fc
--- /dev/null
+++ b/third_party/WebKit/public/platform/WebRTCStats.h
@@ -0,0 +1,71 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef WebRTCStats_h
+#define WebRTCStats_h
+
+#include "WebCommon.h"
+#include "WebString.h"
+
+namespace blink {
+
+class WebRTCStatsMemberIterator;
+class WebRTCStatsMember;
+
+enum WebRTCStatsType {
+ WebRTCStatsTypeUnknown
+};
+
+enum WebRTCStatsMemberName {
+ WebRTCStatsMemberNameUnknown
+};
+
+enum WebRTCStatsMemberType {
+ WebRTCStatsMemberTypeInt,
+ WebRTCStatsMemberTypeInt64,
+ WebRTCStatsMemberTypeFloat,
+ WebRTCStatsMemberTypeString,
+ WebRTCStatsMemberTypeBool,
+ WebRTCStatsMemberTypeId,
+};
+
+class WebRTCStats {
+public:
+ virtual ~WebRTCStats() {}
+
+ virtual WebString id() const = 0;
+ virtual WebRTCStatsType type() const = 0;
+ virtual WebString typeToString() const = 0;
+ virtual double timestamp() const = 0;
+
+ // The caller owns the iterator. The iterator must not be used after
+ // the |WebRTCStats| that created it is destroyed.
+ virtual WebRTCStatsMemberIterator* iterator() const = 0;
+};
+
+class WebRTCStatsMemberIterator {
+public:
+ virtual ~WebRTCStatsMemberIterator() {}
+ virtual bool isEnd() const = 0;
+ virtual void next() = 0;
+
+ virtual WebRTCStatsMemberName name() const = 0;
+ virtual WebString displayName() const = 0;
+
+ virtual WebRTCStatsMemberType type() const = 0;
+ // Value getters. No conversion is performed; the function must match the
+ // member's |type|.
+ virtual int valueInt() const = 0; // WebRTCStatsMemberTypeInt
+ virtual int64_t valueInt64() const = 0; // WebRTCStatsMemberTypeInt64
+ virtual float valueFloat() const = 0; // WebRTCStatsMemberTypeFloat
+ virtual WebString valueString() const = 0; // WebRTCStatsMemberTypeString
+ virtual bool valueBool() const = 0; // WebRTCStatsMemberTypeBool
+
+ // Converts the value to string (regardless of |type|).
+ virtual WebString valueToString() const = 0;
+};
+
+} // namespace blink
+
+#endif // WebRTCStats_h
« no previous file with comments | « third_party/WebKit/public/blink_headers.gypi ('k') | third_party/WebKit/public/platform/WebRTCStatsResponse.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698