| // Copyright 2017 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| #include "net/nqe/network_quality_observation_source.h" |
| #include "base/logging.h" |
| static constexpr const char* kObservationSourceMapping[] = { |
| "TransportCachedEstimate", |
| static_assert(static_cast<size_t>(NETWORK_QUALITY_OBSERVATION_SOURCE_MAX) == |
| arraysize(kObservationSourceMapping), |
| "unhandled network quality observation source"); |
| // Returns the string equivalent of |source|. |
| const char* GetNameForObservationSource( |
| NetworkQualityObservationSource source) { |
| if (source >= NETWORK_QUALITY_OBSERVATION_SOURCE_MAX) { |
| return kObservationSourceMapping[static_cast<size_t>(source)]; |