OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/stun_field_trial.h" | 5 #include "content/renderer/media/webrtc/stun_field_trial.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 | 90 |
91 StunProberTrial::~StunProberTrial() {} | 91 StunProberTrial::~StunProberTrial() {} |
92 | 92 |
93 void StunProberTrial::SaveHistogramData() { | 93 void StunProberTrial::SaveHistogramData() { |
94 DCHECK(thread_checker_.CalledOnValidThread()); | 94 DCHECK(thread_checker_.CalledOnValidThread()); |
95 NatType nat_type = NAT_TYPE_UNKNOWN; | 95 NatType nat_type = NAT_TYPE_UNKNOWN; |
96 int interval_ms = 0; | 96 int interval_ms = 0; |
97 int count = 0; | 97 int count = 0; |
98 int total_requests_sent = 0; | 98 int total_requests_sent = 0; |
99 int total_responses_received = 0; | 99 int total_responses_received = 0; |
100 for (auto& prober : probers_) { | 100 for (auto* prober : probers_) { |
101 ++count; | 101 ++count; |
102 | 102 |
103 // Get the stats. | 103 // Get the stats. |
104 StunProber::Stats stats; | 104 StunProber::Stats stats; |
105 if (!prober->GetStats(&stats)) | 105 if (!prober->GetStats(&stats)) |
106 return; | 106 return; |
107 | 107 |
108 // Check if the NAT type is consistent. | 108 // Check if the NAT type is consistent. |
109 if (nat_type == NAT_TYPE_UNKNOWN) { | 109 if (nat_type == NAT_TYPE_UNKNOWN) { |
110 nat_type = GetNatType(stats.nat_type); | 110 nat_type = GetNatType(stats.nat_type); |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 void StunProberTrial::OnTimer() { | 304 void StunProberTrial::OnTimer() { |
305 DCHECK(thread_checker_.CalledOnValidThread()); | 305 DCHECK(thread_checker_.CalledOnValidThread()); |
306 probers_[started_probers_]->Start(this); | 306 probers_[started_probers_]->Start(this); |
307 started_probers_++; | 307 started_probers_++; |
308 | 308 |
309 if (started_probers_ == total_probers_) | 309 if (started_probers_ == total_probers_) |
310 timer_.Stop(); | 310 timer_.Stop(); |
311 } | 311 } |
312 | 312 |
313 } // namespace content | 313 } // namespace content |
OLD | NEW |