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 22 matching lines...) Expand all Loading... |
33 // This needs to be the same as NatTypeCounters in histograms.xml. | 33 // This needs to be the same as NatTypeCounters in histograms.xml. |
34 enum NatType { | 34 enum NatType { |
35 NAT_TYPE_NONE, | 35 NAT_TYPE_NONE, |
36 NAT_TYPE_UNKNOWN, | 36 NAT_TYPE_UNKNOWN, |
37 NAT_TYPE_SYMMETRIC, | 37 NAT_TYPE_SYMMETRIC, |
38 NAT_TYPE_NON_SYMMETRIC, | 38 NAT_TYPE_NON_SYMMETRIC, |
39 NAT_TYPE_MAX | 39 NAT_TYPE_MAX |
40 }; | 40 }; |
41 | 41 |
42 // This needs to match "NatType" in histograms.xml. | 42 // This needs to match "NatType" in histograms.xml. |
43 const char* NatTypeNames[] = {"NoNAT", "UnknownNAT", "SymNAT", "NonSymNAT"}; | 43 const char* const NatTypeNames[] = |
| 44 {"NoNAT", "UnknownNAT", "SymNAT", "NonSymNAT"}; |
44 static_assert(arraysize(NatTypeNames) == NAT_TYPE_MAX, | 45 static_assert(arraysize(NatTypeNames) == NAT_TYPE_MAX, |
45 "NatType enums must match names"); | 46 "NatType enums must match names"); |
46 | 47 |
47 NatType GetNatType(stunprober::NatType nat_type) { | 48 NatType GetNatType(stunprober::NatType nat_type) { |
48 switch (nat_type) { | 49 switch (nat_type) { |
49 case stunprober::NATTYPE_NONE: | 50 case stunprober::NATTYPE_NONE: |
50 return NAT_TYPE_NONE; | 51 return NAT_TYPE_NONE; |
51 case stunprober::NATTYPE_UNKNOWN: | 52 case stunprober::NATTYPE_UNKNOWN: |
52 return NAT_TYPE_UNKNOWN; | 53 return NAT_TYPE_UNKNOWN; |
53 case stunprober::NATTYPE_SYMMETRIC: | 54 case stunprober::NATTYPE_SYMMETRIC: |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 void StunProberTrial::OnTimer() { | 304 void StunProberTrial::OnTimer() { |
304 DCHECK(thread_checker_.CalledOnValidThread()); | 305 DCHECK(thread_checker_.CalledOnValidThread()); |
305 probers_[started_probers_]->Start(this); | 306 probers_[started_probers_]->Start(this); |
306 started_probers_++; | 307 started_probers_++; |
307 | 308 |
308 if (started_probers_ == total_probers_) | 309 if (started_probers_ == total_probers_) |
309 timer_.Stop(); | 310 timer_.Stop(); |
310 } | 311 } |
311 | 312 |
312 } // namespace content | 313 } // namespace content |
OLD | NEW |