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

Side by Side Diff: webrtc/pc/rtcstatscollector.h

Issue 2514883002: Create //webrtc/api:libjingle_peerconnection_api + refactorings. (Closed)
Patch Set: Rebase Created 4 years 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 unified diff | Download patch
OLDNEW
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_PC_RTCSTATSCOLLECTOR_H_
12 #define WEBRTC_API_RTCSTATSCOLLECTOR_H_ 12 #define WEBRTC_PC_RTCSTATSCOLLECTOR_H_
13 13
14 #include <map> 14 #include <map>
15 #include <memory> 15 #include <memory>
16 #include <set> 16 #include <set>
17 #include <vector> 17 #include <vector>
18 18
19 #include "webrtc/api/datachannel.h"
20 #include "webrtc/api/datachannelinterface.h"
21 #include "webrtc/api/stats/rtcstats_objects.h" 19 #include "webrtc/api/stats/rtcstats_objects.h"
20 #include "webrtc/api/stats/rtcstatscollectorcallback.h"
22 #include "webrtc/api/stats/rtcstatsreport.h" 21 #include "webrtc/api/stats/rtcstatsreport.h"
23 #include "webrtc/base/asyncinvoker.h" 22 #include "webrtc/base/asyncinvoker.h"
24 #include "webrtc/base/optional.h" 23 #include "webrtc/base/optional.h"
25 #include "webrtc/base/refcount.h" 24 #include "webrtc/base/refcount.h"
26 #include "webrtc/base/scoped_ref_ptr.h" 25 #include "webrtc/base/scoped_ref_ptr.h"
27 #include "webrtc/base/sigslot.h" 26 #include "webrtc/base/sigslot.h"
28 #include "webrtc/base/sslidentity.h" 27 #include "webrtc/base/sslidentity.h"
29 #include "webrtc/base/timeutils.h" 28 #include "webrtc/base/timeutils.h"
30 #include "webrtc/media/base/mediachannel.h" 29 #include "webrtc/media/base/mediachannel.h"
30 #include "webrtc/pc/datachannel.h"
31 31
32 namespace cricket { 32 namespace cricket {
33 class Candidate; 33 class Candidate;
34 } // namespace cricket 34 } // namespace cricket
35 35
36 namespace rtc { 36 namespace rtc {
37 class SSLCertificate; 37 class SSLCertificate;
38 } // namespace rtc 38 } // namespace rtc
39 39
40 namespace webrtc { 40 namespace webrtc {
41 41
42 class PeerConnection; 42 class PeerConnection;
43 struct SessionStats; 43 struct SessionStats;
44 44
45 class RTCStatsCollectorCallback : public virtual rtc::RefCountInterface {
46 public:
47 virtual ~RTCStatsCollectorCallback() {}
48
49 virtual void OnStatsDelivered(
50 const rtc::scoped_refptr<const RTCStatsReport>& report) = 0;
51 };
52
53 // All public methods of the collector are to be called on the signaling thread. 45 // All public methods of the collector are to be called on the signaling thread.
54 // Stats are gathered on the signaling, worker and network threads 46 // Stats are gathered on the signaling, worker and network threads
55 // asynchronously. The callback is invoked on the signaling thread. Resulting 47 // asynchronously. The callback is invoked on the signaling thread. Resulting
56 // reports are cached for |cache_lifetime_| ms. 48 // reports are cached for |cache_lifetime_| ms.
57 class RTCStatsCollector : public virtual rtc::RefCountInterface, 49 class RTCStatsCollector : public virtual rtc::RefCountInterface,
58 public sigslot::has_slots<> { 50 public sigslot::has_slots<> {
59 public: 51 public:
60 static rtc::scoped_refptr<RTCStatsCollector> Create( 52 static rtc::scoped_refptr<RTCStatsCollector> Create(
61 PeerConnection* pc, 53 PeerConnection* pc,
62 int64_t cache_lifetime_us = 50 * rtc::kNumMicrosecsPerMillisec); 54 int64_t cache_lifetime_us = 50 * rtc::kNumMicrosecsPerMillisec);
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 InternalRecord internal_record_; 170 InternalRecord internal_record_;
179 }; 171 };
180 172
181 const char* CandidateTypeToRTCIceCandidateTypeForTesting( 173 const char* CandidateTypeToRTCIceCandidateTypeForTesting(
182 const std::string& type); 174 const std::string& type);
183 const char* DataStateToRTCDataChannelStateForTesting( 175 const char* DataStateToRTCDataChannelStateForTesting(
184 DataChannelInterface::DataState state); 176 DataChannelInterface::DataState state);
185 177
186 } // namespace webrtc 178 } // namespace webrtc
187 179
188 #endif // WEBRTC_API_RTCSTATSCOLLECTOR_H_ 180 #endif // WEBRTC_PC_RTCSTATSCOLLECTOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698