OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "net/base/network_change_notifier.h" | 5 #include "net/base/network_change_notifier.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
548 if (!g_network_change_notifier) { | 548 if (!g_network_change_notifier) { |
549 *config = DnsConfig(); | 549 *config = DnsConfig(); |
550 } else { | 550 } else { |
551 g_network_change_notifier->network_state_->GetDnsConfig(config); | 551 g_network_change_notifier->network_state_->GetDnsConfig(config); |
552 } | 552 } |
553 } | 553 } |
554 | 554 |
555 // static | 555 // static |
556 const char* NetworkChangeNotifier::ConnectionTypeToString( | 556 const char* NetworkChangeNotifier::ConnectionTypeToString( |
557 ConnectionType type) { | 557 ConnectionType type) { |
558 static const char* kConnectionTypeNames[] = { | 558 static const char* const kConnectionTypeNames[] = { |
559 "CONNECTION_UNKNOWN", | 559 "CONNECTION_UNKNOWN", |
560 "CONNECTION_ETHERNET", | 560 "CONNECTION_ETHERNET", |
561 "CONNECTION_WIFI", | 561 "CONNECTION_WIFI", |
562 "CONNECTION_2G", | 562 "CONNECTION_2G", |
563 "CONNECTION_3G", | 563 "CONNECTION_3G", |
564 "CONNECTION_4G", | 564 "CONNECTION_4G", |
565 "CONNECTION_NONE", | 565 "CONNECTION_NONE", |
566 "CONNECTION_BLUETOOTH" | 566 "CONNECTION_BLUETOOTH" |
567 }; | 567 }; |
568 static_assert(arraysize(kConnectionTypeNames) == | 568 static_assert(arraysize(kConnectionTypeNames) == |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
958 DCHECK(g_network_change_notifier); | 958 DCHECK(g_network_change_notifier); |
959 g_network_change_notifier = NULL; | 959 g_network_change_notifier = NULL; |
960 } | 960 } |
961 | 961 |
962 NetworkChangeNotifier::DisableForTest::~DisableForTest() { | 962 NetworkChangeNotifier::DisableForTest::~DisableForTest() { |
963 DCHECK(!g_network_change_notifier); | 963 DCHECK(!g_network_change_notifier); |
964 g_network_change_notifier = network_change_notifier_; | 964 g_network_change_notifier = network_change_notifier_; |
965 } | 965 } |
966 | 966 |
967 } // namespace net | 967 } // namespace net |
OLD | NEW |