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

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

Issue 1306653003: Add connection type to NCN::MaxBandwidthChanged (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove extra space in comment Created 5 years, 3 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
« no previous file with comments | « net/base/network_change_notifier_linux.cc ('k') | net/base/network_change_notifier_unittest.cc » ('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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 250
251 DCHECK_EQ(notifier_mac->run_loop_.get(), CFRunLoopGetCurrent()); 251 DCHECK_EQ(notifier_mac->run_loop_.get(), CFRunLoopGetCurrent());
252 252
253 ConnectionType new_type = CalculateConnectionType(flags); 253 ConnectionType new_type = CalculateConnectionType(flags);
254 ConnectionType old_type; 254 ConnectionType old_type;
255 { 255 {
256 base::AutoLock lock(notifier_mac->connection_type_lock_); 256 base::AutoLock lock(notifier_mac->connection_type_lock_);
257 old_type = notifier_mac->connection_type_; 257 old_type = notifier_mac->connection_type_;
258 notifier_mac->connection_type_ = new_type; 258 notifier_mac->connection_type_ = new_type;
259 } 259 }
260 if (old_type != new_type) 260 if (old_type != new_type) {
261 NotifyObserversOfConnectionTypeChange(); 261 NotifyObserversOfConnectionTypeChange();
262 double max_bandwidth_mbps =
263 NetworkChangeNotifier::GetMaxBandwidthForConnectionSubtype(
264 new_type == CONNECTION_NONE ? SUBTYPE_NONE : SUBTYPE_UNKNOWN);
265 NotifyObserversOfMaxBandwidthChange(max_bandwidth_mbps, new_type);
266 }
262 267
263 #if defined(OS_IOS) 268 #if defined(OS_IOS)
264 // On iOS, the SCDynamicStore API does not exist, and we use the reachability 269 // On iOS, the SCDynamicStore API does not exist, and we use the reachability
265 // API to detect IP address changes instead. 270 // API to detect IP address changes instead.
266 NotifyObserversOfIPAddressChange(); 271 NotifyObserversOfIPAddressChange();
267 #endif // defined(OS_IOS) 272 #endif // defined(OS_IOS)
268 } 273 }
269 274
270 } // namespace net 275 } // namespace net
OLDNEW
« no previous file with comments | « net/base/network_change_notifier_linux.cc ('k') | net/base/network_change_notifier_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698