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

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

Issue 10854063: Clean-up inline members of nested classes (net/) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add a NET_EXPOR_PRIVATE Created 8 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « net/base/network_change_notifier_mac.h ('k') | net/base/transport_security_state.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_mac.h" 5 #include "net/base/network_change_notifier_mac.h"
6 6
7 #include <netinet/in.h> 7 #include <netinet/in.h>
8 #include <resolv.h> 8 #include <resolv.h>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 NetworkChangeNotifier::ConnectionType 75 NetworkChangeNotifier::ConnectionType
76 NetworkChangeNotifierMac::GetCurrentConnectionType() const { 76 NetworkChangeNotifierMac::GetCurrentConnectionType() const {
77 base::AutoLock lock(connection_type_lock_); 77 base::AutoLock lock(connection_type_lock_);
78 // Make sure the initial connection type is set before returning. 78 // Make sure the initial connection type is set before returning.
79 while (!connection_type_initialized_) { 79 while (!connection_type_initialized_) {
80 initial_connection_type_cv_.Wait(); 80 initial_connection_type_cv_.Wait();
81 } 81 }
82 return connection_type_; 82 return connection_type_;
83 } 83 }
84 84
85 void NetworkChangeNotifierMac::Forwarder::Init() {
86 net_config_watcher_->SetInitialConnectionType();
87 }
88
89 void NetworkChangeNotifierMac::Forwarder::StartReachabilityNotifications() {
90 net_config_watcher_->StartReachabilityNotifications();
91 }
92
93 void NetworkChangeNotifierMac::Forwarder::SetDynamicStoreNotificationKeys(
94 SCDynamicStoreRef store) {
95 net_config_watcher_->SetDynamicStoreNotificationKeys(store);
96 }
97
98 void NetworkChangeNotifierMac::Forwarder::OnNetworkConfigChange(
99 CFArrayRef changed_keys) {
100 net_config_watcher_->OnNetworkConfigChange(changed_keys);
101 }
102
85 void NetworkChangeNotifierMac::SetInitialConnectionType() { 103 void NetworkChangeNotifierMac::SetInitialConnectionType() {
86 // Called on notifier thread. 104 // Called on notifier thread.
87 105
88 // Try to reach 0.0.0.0. This is the approach taken by Firefox: 106 // Try to reach 0.0.0.0. This is the approach taken by Firefox:
89 // 107 //
90 // http://mxr.mozilla.org/mozilla2.0/source/netwerk/system/mac/nsNetworkLinkSe rvice.mm 108 // http://mxr.mozilla.org/mozilla2.0/source/netwerk/system/mac/nsNetworkLinkSe rvice.mm
91 // 109 //
92 // From my (adamk) testing on Snow Leopard, 0.0.0.0 110 // From my (adamk) testing on Snow Leopard, 0.0.0.0
93 // seems to be reachable if any network connection is available. 111 // seems to be reachable if any network connection is available.
94 struct sockaddr_in addr = {0}; 112 struct sockaddr_in addr = {0};
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 { 217 {
200 base::AutoLock lock(notifier_mac->connection_type_lock_); 218 base::AutoLock lock(notifier_mac->connection_type_lock_);
201 old_type = notifier_mac->connection_type_; 219 old_type = notifier_mac->connection_type_;
202 notifier_mac->connection_type_ = new_type; 220 notifier_mac->connection_type_ = new_type;
203 } 221 }
204 if (old_type != new_type) 222 if (old_type != new_type)
205 NotifyObserversOfConnectionTypeChange(); 223 NotifyObserversOfConnectionTypeChange();
206 } 224 }
207 225
208 } // namespace net 226 } // namespace net
OLDNEW
« no previous file with comments | « net/base/network_change_notifier_mac.h ('k') | net/base/transport_security_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698