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

Side by Side Diff: webrtc/api/test/mockpeerconnectionobservers.h

Issue 2584553002: New method StatsObserver::OnCompleteReports, passing ownership. (Closed)
Patch Set: Drop unneeded ".get()". 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 | « webrtc/api/peerconnectioninterface.h ('k') | webrtc/sdk/android/src/jni/peerconnection_jni.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2012 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
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 rtc::scoped_refptr<webrtc::DataChannelInterface> channel_; 101 rtc::scoped_refptr<webrtc::DataChannelInterface> channel_;
102 DataChannelInterface::DataState state_; 102 DataChannelInterface::DataState state_;
103 std::vector<std::string> messages_; 103 std::vector<std::string> messages_;
104 }; 104 };
105 105
106 class MockStatsObserver : public webrtc::StatsObserver { 106 class MockStatsObserver : public webrtc::StatsObserver {
107 public: 107 public:
108 MockStatsObserver() : called_(false), stats_() {} 108 MockStatsObserver() : called_(false), stats_() {}
109 virtual ~MockStatsObserver() {} 109 virtual ~MockStatsObserver() {}
110 110
111 virtual void OnComplete(const StatsReports& reports) { 111 void OnCompleteReports(std::unique_ptr<StatsReports> reports) override {
112 ASSERT(!called_); 112 ASSERT(!called_);
113 called_ = true; 113 called_ = true;
114 stats_.Clear(); 114 stats_.Clear();
115 stats_.number_of_reports = reports.size(); 115 stats_.number_of_reports = reports->size();
116 for (const auto* r : reports) { 116 for (const auto* r : *reports) {
117 if (r->type() == StatsReport::kStatsReportTypeSsrc) { 117 if (r->type() == StatsReport::kStatsReportTypeSsrc) {
118 stats_.timestamp = r->timestamp(); 118 stats_.timestamp = r->timestamp();
119 GetIntValue(r, StatsReport::kStatsValueNameAudioOutputLevel, 119 GetIntValue(r, StatsReport::kStatsValueNameAudioOutputLevel,
120 &stats_.audio_output_level); 120 &stats_.audio_output_level);
121 GetIntValue(r, StatsReport::kStatsValueNameAudioInputLevel, 121 GetIntValue(r, StatsReport::kStatsValueNameAudioInputLevel,
122 &stats_.audio_input_level); 122 &stats_.audio_input_level);
123 GetIntValue(r, StatsReport::kStatsValueNameBytesReceived, 123 GetIntValue(r, StatsReport::kStatsValueNameBytesReceived,
124 &stats_.bytes_received); 124 &stats_.bytes_received);
125 GetIntValue(r, StatsReport::kStatsValueNameBytesSent, 125 GetIntValue(r, StatsReport::kStatsValueNameBytesSent,
126 &stats_.bytes_sent); 126 &stats_.bytes_sent);
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 int bytes_sent; 220 int bytes_sent;
221 int available_receive_bandwidth; 221 int available_receive_bandwidth;
222 std::string dtls_cipher; 222 std::string dtls_cipher;
223 std::string srtp_cipher; 223 std::string srtp_cipher;
224 } stats_; 224 } stats_;
225 }; 225 };
226 226
227 } // namespace webrtc 227 } // namespace webrtc
228 228
229 #endif // WEBRTC_API_TEST_MOCKPEERCONNECTIONOBSERVERS_H_ 229 #endif // WEBRTC_API_TEST_MOCKPEERCONNECTIONOBSERVERS_H_
OLDNEW
« no previous file with comments | « webrtc/api/peerconnectioninterface.h ('k') | webrtc/sdk/android/src/jni/peerconnection_jni.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698