| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2014 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 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 623 return (*value_.id_)->ToString(); | 623 return (*value_.id_)->ToString(); |
| 624 } | 624 } |
| 625 RTC_NOTREACHED(); | 625 RTC_NOTREACHED(); |
| 626 return std::string(); | 626 return std::string(); |
| 627 } | 627 } |
| 628 | 628 |
| 629 StatsReport::StatsReport(const Id& id) : id_(id), timestamp_(0.0) { | 629 StatsReport::StatsReport(const Id& id) : id_(id), timestamp_(0.0) { |
| 630 RTC_DCHECK(id_.get()); | 630 RTC_DCHECK(id_.get()); |
| 631 } | 631 } |
| 632 | 632 |
| 633 StatsReport::~StatsReport() = default; |
| 634 |
| 633 // static | 635 // static |
| 634 StatsReport::Id StatsReport::NewBandwidthEstimationId() { | 636 StatsReport::Id StatsReport::NewBandwidthEstimationId() { |
| 635 return Id(new RefCountedObject<BandwidthEstimationId>()); | 637 return Id(new RefCountedObject<BandwidthEstimationId>()); |
| 636 } | 638 } |
| 637 | 639 |
| 638 // static | 640 // static |
| 639 StatsReport::Id StatsReport::NewTypedId(StatsType type, const std::string& id) { | 641 StatsReport::Id StatsReport::NewTypedId(StatsType type, const std::string& id) { |
| 640 return Id(new RefCountedObject<TypedId>(type, id)); | 642 return Id(new RefCountedObject<TypedId>(type, id)); |
| 641 } | 643 } |
| 642 | 644 |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 778 // Looks for a report with the given |id|. If one is not found, NULL | 780 // Looks for a report with the given |id|. If one is not found, NULL |
| 779 // will be returned. | 781 // will be returned. |
| 780 StatsReport* StatsCollection::Find(const StatsReport::Id& id) { | 782 StatsReport* StatsCollection::Find(const StatsReport::Id& id) { |
| 781 RTC_DCHECK(thread_checker_.CalledOnValidThread()); | 783 RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
| 782 Container::iterator it = std::find_if(list_.begin(), list_.end(), | 784 Container::iterator it = std::find_if(list_.begin(), list_.end(), |
| 783 [&id](const StatsReport* r)->bool { return r->id()->Equals(id); }); | 785 [&id](const StatsReport* r)->bool { return r->id()->Equals(id); }); |
| 784 return it == list_.end() ? nullptr : *it; | 786 return it == list_.end() ? nullptr : *it; |
| 785 } | 787 } |
| 786 | 788 |
| 787 } // namespace webrtc | 789 } // namespace webrtc |
| OLD | NEW |