OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #ifndef WEBRTC_API_RTCSTATSCOLLECTOR_H_ | 11 #ifndef WEBRTC_API_RTCSTATSCOLLECTOR_H_ |
12 #define WEBRTC_API_RTCSTATSCOLLECTOR_H_ | 12 #define WEBRTC_API_RTCSTATSCOLLECTOR_H_ |
13 | 13 |
14 #include <memory> | 14 #include <memory> |
15 #include <vector> | 15 #include <vector> |
16 | 16 |
| 17 #include "webrtc/api/datachannelinterface.h" |
17 #include "webrtc/api/stats/rtcstats_objects.h" | 18 #include "webrtc/api/stats/rtcstats_objects.h" |
18 #include "webrtc/api/stats/rtcstatsreport.h" | 19 #include "webrtc/api/stats/rtcstatsreport.h" |
19 #include "webrtc/base/asyncinvoker.h" | 20 #include "webrtc/base/asyncinvoker.h" |
20 #include "webrtc/base/refcount.h" | 21 #include "webrtc/base/refcount.h" |
21 #include "webrtc/base/scoped_ref_ptr.h" | 22 #include "webrtc/base/scoped_ref_ptr.h" |
22 #include "webrtc/base/timeutils.h" | 23 #include "webrtc/base/timeutils.h" |
23 | 24 |
24 namespace cricket { | 25 namespace cricket { |
25 class Candidate; | 26 class Candidate; |
26 } // namespace cricket | 27 } // namespace cricket |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 void AddPartialResults_s(rtc::scoped_refptr<RTCStatsReport> partial_report); | 79 void AddPartialResults_s(rtc::scoped_refptr<RTCStatsReport> partial_report); |
79 void DeliverCachedReport(); | 80 void DeliverCachedReport(); |
80 | 81 |
81 // Produces |RTCCertificateStats|. | 82 // Produces |RTCCertificateStats|. |
82 void ProduceCertificateStats_s( | 83 void ProduceCertificateStats_s( |
83 int64_t timestamp_us, const SessionStats& session_stats, | 84 int64_t timestamp_us, const SessionStats& session_stats, |
84 RTCStatsReport* report) const; | 85 RTCStatsReport* report) const; |
85 void ProduceCertificateStatsFromSSLCertificateAndChain_s( | 86 void ProduceCertificateStatsFromSSLCertificateAndChain_s( |
86 int64_t timestamp_us, const rtc::SSLCertificate& certificate, | 87 int64_t timestamp_us, const rtc::SSLCertificate& certificate, |
87 RTCStatsReport* report) const; | 88 RTCStatsReport* report) const; |
| 89 // Produces |RTCDataChannelStats|. |
| 90 void ProduceDataChannelStats_s( |
| 91 int64_t timestamp_us, RTCStatsReport* report) const; |
88 // Produces |RTCIceCandidatePairStats| and |RTCIceCandidateStats|. | 92 // Produces |RTCIceCandidatePairStats| and |RTCIceCandidateStats|. |
89 void ProduceIceCandidateAndPairStats_s( | 93 void ProduceIceCandidateAndPairStats_s( |
90 int64_t timestamp_us, const SessionStats& session_stats, | 94 int64_t timestamp_us, const SessionStats& session_stats, |
91 RTCStatsReport* report) const; | 95 RTCStatsReport* report) const; |
92 const std::string& ProduceIceCandidateStats_s( | 96 const std::string& ProduceIceCandidateStats_s( |
93 int64_t timestamp_us, const cricket::Candidate& candidate, bool is_local, | 97 int64_t timestamp_us, const cricket::Candidate& candidate, bool is_local, |
94 RTCStatsReport* report) const; | 98 RTCStatsReport* report) const; |
95 // Produces |RTCPeerConnectionStats|. | 99 // Produces |RTCPeerConnectionStats|. |
96 void ProducePeerConnectionStats_s( | 100 void ProducePeerConnectionStats_s( |
97 int64_t timestamp_us, RTCStatsReport* report) const; | 101 int64_t timestamp_us, RTCStatsReport* report) const; |
(...skipping 11 matching lines...) Expand all Loading... |
109 | 113 |
110 // A timestamp, in microseconds, that is based on a timer that is | 114 // A timestamp, in microseconds, that is based on a timer that is |
111 // monotonically increasing. That is, even if the system clock is modified the | 115 // monotonically increasing. That is, even if the system clock is modified the |
112 // difference between the timer and this timestamp is how fresh the cached | 116 // difference between the timer and this timestamp is how fresh the cached |
113 // report is. | 117 // report is. |
114 int64_t cache_timestamp_us_; | 118 int64_t cache_timestamp_us_; |
115 int64_t cache_lifetime_us_; | 119 int64_t cache_lifetime_us_; |
116 rtc::scoped_refptr<const RTCStatsReport> cached_report_; | 120 rtc::scoped_refptr<const RTCStatsReport> cached_report_; |
117 }; | 121 }; |
118 | 122 |
119 // Helper function, exposed for unittests. | 123 const char* CandidateTypeToRTCIceCandidateTypeForTesting( |
120 const char* CandidateTypeToRTCIceCandidateType(const std::string& type); | 124 const std::string& type); |
| 125 const char* DataStateToRTCDataChannelStateForTesting( |
| 126 DataChannelInterface::DataState state); |
121 | 127 |
122 } // namespace webrtc | 128 } // namespace webrtc |
123 | 129 |
124 #endif // WEBRTC_API_RTCSTATSCOLLECTOR_H_ | 130 #endif // WEBRTC_API_RTCSTATSCOLLECTOR_H_ |
OLD | NEW |