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 WebRTCLegacyStats_h |
| 6 #define WebRTCLegacyStats_h |
| 7 |
| 8 #include "WebCommon.h" |
| 9 #include "WebString.h" |
| 10 |
| 11 namespace blink { |
| 12 |
| 13 class WebRTCLegacyStatsMemberIterator; |
| 14 |
| 15 enum WebRTCLegacyStatsMemberType { |
| 16 WebRTCLegacyStatsMemberTypeInt, |
| 17 WebRTCLegacyStatsMemberTypeInt64, |
| 18 WebRTCLegacyStatsMemberTypeFloat, |
| 19 WebRTCLegacyStatsMemberTypeString, |
| 20 WebRTCLegacyStatsMemberTypeBool, |
| 21 WebRTCLegacyStatsMemberTypeId, |
| 22 }; |
| 23 |
| 24 class WebRTCLegacyStats { |
| 25 public: |
| 26 virtual ~WebRTCLegacyStats() {} |
| 27 |
| 28 virtual WebString id() const = 0; |
| 29 virtual WebString type() const = 0; |
| 30 virtual double timestamp() const = 0; |
| 31 |
| 32 // The caller owns the iterator. The iterator must not be used after |
| 33 // the |WebRTCLegacyStats| that created it is destroyed. |
| 34 virtual WebRTCLegacyStatsMemberIterator* iterator() const = 0; |
| 35 }; |
| 36 |
| 37 class WebRTCLegacyStatsMemberIterator { |
| 38 public: |
| 39 virtual ~WebRTCLegacyStatsMemberIterator() {} |
| 40 virtual bool isEnd() const = 0; |
| 41 virtual void next() = 0; |
| 42 |
| 43 virtual WebString name() const = 0; |
| 44 virtual WebRTCLegacyStatsMemberType type() const = 0; |
| 45 // Value getters. No conversion is performed; the function must match the |
| 46 // member's |type|. |
| 47 virtual int valueInt() const = 0; // WebRTCLegacyStatsMemberTypeInt |
| 48 virtual int64_t valueInt64() const = 0; // WebRTCLegacyStatsMemberTypeInt64 |
| 49 virtual float valueFloat() const = 0; // WebRTCLegacyStatsMemberTypeFloat |
| 50 virtual WebString valueString() const = 0; // WebRTCLegacyStatsMemberTypeStr
ing |
| 51 virtual bool valueBool() const = 0; // WebRTCLegacyStatsMemberTypeBool |
| 52 |
| 53 // Converts the value to string (regardless of |type|). |
| 54 virtual WebString valueToString() const = 0; |
| 55 }; |
| 56 |
| 57 } // namespace blink |
| 58 |
| 59 #endif // WebRTCLegacyStats_h |
OLD | NEW |