Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(41)

Side by Side Diff: net/base/network_change_notifier.cc

Issue 328793002: Add wifi AP info to system profile metrics (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "base/metrics/histogram.h" 7 #include "base/metrics/histogram.h"
8 #include "base/synchronization/lock.h" 8 #include "base/synchronization/lock.h"
9 #include "base/threading/thread_checker.h" 9 #include "base/threading/thread_checker.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 void SetDnsConfig(const DnsConfig& dns_config) { 393 void SetDnsConfig(const DnsConfig& dns_config) {
394 base::AutoLock lock(lock_); 394 base::AutoLock lock(lock_);
395 dns_config_ = dns_config; 395 dns_config_ = dns_config;
396 } 396 }
397 397
398 private: 398 private:
399 mutable base::Lock lock_; 399 mutable base::Lock lock_;
400 DnsConfig dns_config_; 400 DnsConfig dns_config_;
401 }; 401 };
402 402
403 NetworkChangeNotifier::WifiAccessPointInfo::WifiAccessPointInfo()
404 : security(WIFI_SECURITY_UNKNOWN) {
405 }
406
407 NetworkChangeNotifier::WifiAccessPointInfo::~WifiAccessPointInfo() {
408 }
409
403 NetworkChangeNotifier::NetworkChangeCalculatorParams:: 410 NetworkChangeNotifier::NetworkChangeCalculatorParams::
404 NetworkChangeCalculatorParams() { 411 NetworkChangeCalculatorParams() {
405 } 412 }
406 413
407 // Calculates NetworkChange signal from IPAddress and ConnectionType signals. 414 // Calculates NetworkChange signal from IPAddress and ConnectionType signals.
408 class NetworkChangeNotifier::NetworkChangeCalculator 415 class NetworkChangeNotifier::NetworkChangeCalculator
409 : public ConnectionTypeObserver, 416 : public ConnectionTypeObserver,
410 public IPAddressObserver { 417 public IPAddressObserver {
411 public: 418 public:
412 NetworkChangeCalculator(const NetworkChangeCalculatorParams& params) 419 NetworkChangeCalculator(const NetworkChangeCalculatorParams& params)
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 #elif defined(OS_LINUX) 526 #elif defined(OS_LINUX)
520 return NetworkChangeNotifierLinux::Create(); 527 return NetworkChangeNotifierLinux::Create();
521 #elif defined(OS_MACOSX) 528 #elif defined(OS_MACOSX)
522 return new NetworkChangeNotifierMac(); 529 return new NetworkChangeNotifierMac();
523 #else 530 #else
524 NOTIMPLEMENTED(); 531 NOTIMPLEMENTED();
525 return NULL; 532 return NULL;
526 #endif 533 #endif
527 } 534 }
528 535
536 bool NetworkChangeNotifier::GetCurrentWifiAccessPointInfo(
537 NetworkChangeNotifier::WifiAccessPointInfo* info) {
538 return false;
539 }
540
529 // static 541 // static
530 NetworkChangeNotifier::ConnectionType 542 NetworkChangeNotifier::ConnectionType
531 NetworkChangeNotifier::GetConnectionType() { 543 NetworkChangeNotifier::GetConnectionType() {
532 return g_network_change_notifier ? 544 return g_network_change_notifier ?
533 g_network_change_notifier->GetCurrentConnectionType() : 545 g_network_change_notifier->GetCurrentConnectionType() :
534 CONNECTION_UNKNOWN; 546 CONNECTION_UNKNOWN;
535 } 547 }
536 548
537 // static 549 // static
550 bool NetworkChangeNotifier::GetWifiAccessPointInfo(WifiAccessPointInfo* info) {
551 return g_network_change_notifier ?
552 g_network_change_notifier->GetCurrentWifiAccessPointInfo(info) :
553 false;
554 }
555
556 // static
538 void NetworkChangeNotifier::GetDnsConfig(DnsConfig* config) { 557 void NetworkChangeNotifier::GetDnsConfig(DnsConfig* config) {
539 if (!g_network_change_notifier) { 558 if (!g_network_change_notifier) {
540 *config = DnsConfig(); 559 *config = DnsConfig();
541 } else { 560 } else {
542 g_network_change_notifier->network_state_->GetDnsConfig(config); 561 g_network_change_notifier->network_state_->GetDnsConfig(config);
543 } 562 }
544 } 563 }
545 564
546 // static 565 // static
547 const char* NetworkChangeNotifier::ConnectionTypeToString( 566 const char* NetworkChangeNotifier::ConnectionTypeToString(
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
826 DCHECK(g_network_change_notifier); 845 DCHECK(g_network_change_notifier);
827 g_network_change_notifier = NULL; 846 g_network_change_notifier = NULL;
828 } 847 }
829 848
830 NetworkChangeNotifier::DisableForTest::~DisableForTest() { 849 NetworkChangeNotifier::DisableForTest::~DisableForTest() {
831 DCHECK(!g_network_change_notifier); 850 DCHECK(!g_network_change_notifier);
832 g_network_change_notifier = network_change_notifier_; 851 g_network_change_notifier = network_change_notifier_;
833 } 852 }
834 853
835 } // namespace net 854 } // namespace net
OLDNEW
« chromeos/network/network_change_notifier_chromeos.cc ('K') | « net/base/network_change_notifier.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698