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

Side by Side Diff: content/renderer/media/webrtc/rtc_stats.cc

Issue 2533223003: Reland of "WebRtcBrowserTest: Include all stats in getStats." (Closed)
Patch Set: Whitelist the 'missing' stats 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
« no previous file with comments | « chrome/test/data/webrtc/peerconnection.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/media/webrtc/rtc_stats.h" 5 #include "content/renderer/media/webrtc/rtc_stats.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 9
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/time/time.h" 12 #include "base/time/time.h"
13 #include "third_party/webrtc/api/stats/rtcstats_objects.h" 13 #include "third_party/webrtc/api/stats/rtcstats_objects.h"
14 14
15 namespace content { 15 namespace content {
16 16
17 namespace { 17 namespace {
18 18
19 class RTCStatsWhitelist { 19 class RTCStatsWhitelist {
20 public: 20 public:
21 RTCStatsWhitelist() { 21 RTCStatsWhitelist() {
22 whitelisted_stats_types_.insert(webrtc::RTCCertificateStats::kType); 22 whitelisted_stats_types_.insert(webrtc::RTCCertificateStats::kType);
23 whitelisted_stats_types_.insert(webrtc::RTCCodecStats::kType);
23 whitelisted_stats_types_.insert(webrtc::RTCDataChannelStats::kType); 24 whitelisted_stats_types_.insert(webrtc::RTCDataChannelStats::kType);
24 whitelisted_stats_types_.insert(webrtc::RTCIceCandidatePairStats::kType); 25 whitelisted_stats_types_.insert(webrtc::RTCIceCandidatePairStats::kType);
25 whitelisted_stats_types_.insert(webrtc::RTCIceCandidateStats::kType); 26 whitelisted_stats_types_.insert(webrtc::RTCIceCandidateStats::kType);
26 whitelisted_stats_types_.insert(webrtc::RTCLocalIceCandidateStats::kType); 27 whitelisted_stats_types_.insert(webrtc::RTCLocalIceCandidateStats::kType);
27 whitelisted_stats_types_.insert(webrtc::RTCRemoteIceCandidateStats::kType); 28 whitelisted_stats_types_.insert(webrtc::RTCRemoteIceCandidateStats::kType);
29 whitelisted_stats_types_.insert(webrtc::RTCMediaStreamStats::kType);
30 whitelisted_stats_types_.insert(webrtc::RTCMediaStreamTrackStats::kType);
28 whitelisted_stats_types_.insert(webrtc::RTCPeerConnectionStats::kType); 31 whitelisted_stats_types_.insert(webrtc::RTCPeerConnectionStats::kType);
29 whitelisted_stats_types_.insert(webrtc::RTCRTPStreamStats::kType); 32 whitelisted_stats_types_.insert(webrtc::RTCRTPStreamStats::kType);
30 whitelisted_stats_types_.insert(webrtc::RTCInboundRTPStreamStats::kType); 33 whitelisted_stats_types_.insert(webrtc::RTCInboundRTPStreamStats::kType);
31 whitelisted_stats_types_.insert(webrtc::RTCOutboundRTPStreamStats::kType); 34 whitelisted_stats_types_.insert(webrtc::RTCOutboundRTPStreamStats::kType);
32 whitelisted_stats_types_.insert(webrtc::RTCTransportStats::kType); 35 whitelisted_stats_types_.insert(webrtc::RTCTransportStats::kType);
33 } 36 }
34 37
35 bool IsWhitelisted(const webrtc::RTCStats& stats) { 38 bool IsWhitelisted(const webrtc::RTCStats& stats) {
36 return whitelisted_stats_types_.find(stats.type()) != 39 return whitelisted_stats_types_.find(stats.type()) !=
37 whitelisted_stats_types_.end(); 40 whitelisted_stats_types_.end();
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 for (size_t i = 0; i < sequence.size(); ++i) 273 for (size_t i = 0; i < sequence.size(); ++i)
271 web_sequence[i] = blink::WebString::fromUTF8(sequence[i]); 274 web_sequence[i] = blink::WebString::fromUTF8(sequence[i]);
272 return web_sequence; 275 return web_sequence;
273 } 276 }
274 277
275 void WhitelistStatsForTesting(const char* type) { 278 void WhitelistStatsForTesting(const char* type) {
276 g_whitelisted_stats.Get().WhitelistStatsForTesting(type); 279 g_whitelisted_stats.Get().WhitelistStatsForTesting(type);
277 } 280 }
278 281
279 } // namespace content 282 } // namespace content
OLDNEW
« no previous file with comments | « chrome/test/data/webrtc/peerconnection.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698