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 #include <memory> | |
12 #include <string> | |
13 #include <vector> | |
14 | |
15 namespace blink { | |
16 | |
17 class WebRTCStatsMember; | |
18 | |
19 // Corresponds to |webrtc::RTCStatsMemberInterface::Type| in WebRTC. | |
perkj_chrome
2016/09/07 14:34:36
Can you really refer to webrtc:: in blink?
hbos_chromium
2016/09/08 08:38:31
Dunno, removed comment.
| |
20 enum WebRTCStatsMemberType { | |
21 WebRTCStatsMemberTypeInt32, | |
22 WebRTCStatsMemberTypeUint32, | |
23 WebRTCStatsMemberTypeInt64, | |
24 WebRTCStatsMemberTypeUint64, | |
25 WebRTCStatsMemberTypeDouble, | |
26 WebRTCStatsMemberTypeStaticString, | |
27 WebRTCStatsMemberTypeString, | |
28 | |
29 WebRTCStatsMemberTypeSequenceInt32, | |
30 WebRTCStatsMemberTypeSequenceUint32, | |
31 WebRTCStatsMemberTypeSequenceInt64, | |
32 WebRTCStatsMemberTypeSequenceUint64, | |
33 WebRTCStatsMemberTypeSequenceDouble, | |
34 WebRTCStatsMemberTypeSequenceStaticString, | |
35 WebRTCStatsMemberTypeSequenceString, | |
36 }; | |
37 | |
38 class WebRTCStats { | |
39 public: | |
40 virtual ~WebRTCStats() {} | |
41 | |
42 virtual WebString id() const = 0; | |
43 virtual WebString type() const = 0; | |
44 virtual double timestamp() const = 0; | |
45 | |
46 virtual size_t membersCount() const = 0; | |
47 virtual std::unique_ptr<WebRTCStatsMember> getMember(size_t) const = 0; | |
48 }; | |
49 | |
50 class WebRTCStatsMember { | |
51 public: | |
52 virtual WebString name() const = 0; | |
53 virtual WebRTCStatsMemberType type() const = 0; | |
54 | |
55 // Value getters. No conversion is performed; the function must match the me mber's |type|. | |
56 virtual int32_t valueInt32() const = 0; | |
57 virtual uint32_t valueUint32() const = 0; | |
58 virtual int64_t valueInt64() const = 0; | |
59 virtual uint64_t valueUint64() const = 0; | |
60 virtual double valueDouble() const = 0; | |
61 virtual const char* valueStaticString() const = 0; | |
62 virtual const std::string& valueString() const = 0; | |
63 virtual const std::vector<int32_t>& valueSequenceInt32() const = 0; | |
64 virtual const std::vector<uint32_t>& valueSequenceUint32() const = 0; | |
65 virtual const std::vector<int64_t>& valueSequenceInt64() const = 0; | |
66 virtual const std::vector<uint64_t>& valueSequenceUint64() const = 0; | |
67 virtual const std::vector<double>& valueSequenceDouble() const = 0; | |
68 virtual const std::vector<const char*>& valueSequenceStaticString() const = 0; | |
69 virtual const std::vector<std::string>& valueSequenceString() const = 0; | |
70 }; | |
71 | |
72 } // namespace blink | |
73 | |
74 #endif // WebRTCStats_h | |
OLD | NEW |