OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef WebRTCStats_h |
| 6 #define WebRTCStats_h |
| 7 |
| 8 #include "WebCommon.h" |
| 9 #include "WebString.h" |
| 10 |
| 11 namespace blink { |
| 12 |
| 13 class WebRTCStatsMemberIterator; |
| 14 class WebRTCStatsMember; |
| 15 |
| 16 enum WebRTCStatsType { |
| 17 WebRTCStatsTypeUnknown |
| 18 }; |
| 19 |
| 20 enum WebRTCStatsMemberName { |
| 21 WebRTCStatsMemberNameUnknown |
| 22 }; |
| 23 |
| 24 enum WebRTCStatsMemberType { |
| 25 WebRTCStatsMemberTypeInt, |
| 26 WebRTCStatsMemberTypeInt64, |
| 27 WebRTCStatsMemberTypeFloat, |
| 28 WebRTCStatsMemberTypeString, |
| 29 WebRTCStatsMemberTypeBool, |
| 30 WebRTCStatsMemberTypeId, |
| 31 }; |
| 32 |
| 33 class WebRTCStats { |
| 34 public: |
| 35 virtual ~WebRTCStats() {} |
| 36 |
| 37 virtual WebString id() const = 0; |
| 38 virtual WebRTCStatsType type() const = 0; |
| 39 virtual WebString typeToString() const = 0; |
| 40 virtual double timestamp() const = 0; |
| 41 |
| 42 // The caller owns the iterator. The iterator must not be used after |
| 43 // the |WebRTCStats| that created it is destroyed. |
| 44 virtual WebRTCStatsMemberIterator* iterator() const = 0; |
| 45 }; |
| 46 |
| 47 class WebRTCStatsMemberIterator { |
| 48 public: |
| 49 virtual ~WebRTCStatsMemberIterator() {} |
| 50 virtual bool isEnd() const = 0; |
| 51 virtual void next() = 0; |
| 52 |
| 53 virtual WebRTCStatsMemberName name() const = 0; |
| 54 virtual WebString displayName() const = 0; |
| 55 |
| 56 virtual WebRTCStatsMemberType type() const = 0; |
| 57 // Value getters. No conversion is performed; the function must match the |
| 58 // member's |type|. |
| 59 virtual int valueInt() const = 0; // WebRTCStatsMemberTypeInt |
| 60 virtual int64_t valueInt64() const = 0; // WebRTCStatsMemberTypeInt64 |
| 61 virtual float valueFloat() const = 0; // WebRTCStatsMemberTypeFloat |
| 62 virtual WebString valueString() const = 0; // WebRTCStatsMemberTypeString |
| 63 virtual bool valueBool() const = 0; // WebRTCStatsMemberTypeBool |
| 64 |
| 65 // Converts the value to string (regardless of |type|). |
| 66 virtual WebString valueToString() const = 0; |
| 67 }; |
| 68 |
| 69 } // namespace blink |
| 70 |
| 71 #endif // WebRTCStats_h |
OLD | NEW |