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

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

Issue 2813023002: [Bindings] Make maplike<> and setlike<> imply a readonly size attribute. (Closed)
Patch Set: merge with 23752147e6f5f7dcaf4bad1bb1c306fb91e1ec5b Created 3 years, 8 months 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 // 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/logging.h" 10 #include "base/logging.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 const webrtc::RTCStats& next = *it_; 88 const webrtc::RTCStats& next = *it_;
89 ++it_; 89 ++it_;
90 if (IsWhitelistedStats(next)) { 90 if (IsWhitelistedStats(next)) {
91 return std::unique_ptr<blink::WebRTCStats>( 91 return std::unique_ptr<blink::WebRTCStats>(
92 new RTCStats(stats_report_, &next)); 92 new RTCStats(stats_report_, &next));
93 } 93 }
94 } 94 }
95 return std::unique_ptr<blink::WebRTCStats>(); 95 return std::unique_ptr<blink::WebRTCStats>();
96 } 96 }
97 97
98 size_t RTCStatsReport::Size() const {
99 return stats_report_->size();
100 }
101
98 RTCStats::RTCStats( 102 RTCStats::RTCStats(
99 const scoped_refptr<const webrtc::RTCStatsReport>& stats_owner, 103 const scoped_refptr<const webrtc::RTCStatsReport>& stats_owner,
100 const webrtc::RTCStats* stats) 104 const webrtc::RTCStats* stats)
101 : stats_owner_(stats_owner), 105 : stats_owner_(stats_owner),
102 stats_(stats), 106 stats_(stats),
103 stats_members_(stats->Members()) { 107 stats_members_(stats->Members()) {
104 DCHECK(stats_owner_); 108 DCHECK(stats_owner_);
105 DCHECK(stats_); 109 DCHECK(stats_);
106 DCHECK(stats_owner_->Get(stats_->id())); 110 DCHECK(stats_owner_->Get(stats_->id()));
107 } 111 }
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 for (size_t i = 0; i < sequence.size(); ++i) 278 for (size_t i = 0; i < sequence.size(); ++i)
275 web_sequence[i] = blink::WebString::FromUTF8(sequence[i]); 279 web_sequence[i] = blink::WebString::FromUTF8(sequence[i]);
276 return web_sequence; 280 return web_sequence;
277 } 281 }
278 282
279 void WhitelistStatsForTesting(const char* type) { 283 void WhitelistStatsForTesting(const char* type) {
280 GetStatsWhitelist()->WhitelistStatsForTesting(type); 284 GetStatsWhitelist()->WhitelistStatsForTesting(type);
281 } 285 }
282 286
283 } // namespace content 287 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/webrtc/rtc_stats.h ('k') | content/shell/test_runner/mock_webrtc_peer_connection_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698