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

Side by Side Diff: webrtc/api/stats/rtcstats.h

Issue 2517163002: RTCStats operator== bugfix (Closed)
Patch Set: 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 | « no previous file | webrtc/stats/rtcstats_unittest.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 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
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 Type type() const override { return kType; } 264 Type type() const override { return kType; }
265 bool is_sequence() const override; 265 bool is_sequence() const override;
266 bool is_string() const override; 266 bool is_string() const override;
267 bool operator==(const RTCStatsMemberInterface& other) const override { 267 bool operator==(const RTCStatsMemberInterface& other) const override {
268 if (type() != other.type()) 268 if (type() != other.type())
269 return false; 269 return false;
270 const RTCStatsMember<T>& other_t = 270 const RTCStatsMember<T>& other_t =
271 static_cast<const RTCStatsMember<T>&>(other); 271 static_cast<const RTCStatsMember<T>&>(other);
272 if (!is_defined_) 272 if (!is_defined_)
273 return !other_t.is_defined(); 273 return !other_t.is_defined();
274 if (!other.is_defined())
275 return false;
274 return value_ == other_t.value_; 276 return value_ == other_t.value_;
275 } 277 }
276 std::string ValueToString() const override; 278 std::string ValueToString() const override;
277 279
278 // Assignment operators. 280 // Assignment operators.
279 T& operator=(const T& value) { 281 T& operator=(const T& value) {
280 value_ = value; 282 value_ = value;
281 is_defined_ = true; 283 is_defined_ = true;
282 return value_; 284 return value_;
283 } 285 }
(...skipping 29 matching lines...) Expand all
313 return &value_; 315 return &value_;
314 } 316 }
315 317
316 private: 318 private:
317 T value_; 319 T value_;
318 }; 320 };
319 321
320 } // namespace webrtc 322 } // namespace webrtc
321 323
322 #endif // WEBRTC_API_STATS_RTCSTATS_H_ 324 #endif // WEBRTC_API_STATS_RTCSTATS_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/stats/rtcstats_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698