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

Unified Diff: net/base/network_change_notifier_mac.cc

Issue 266243004: Clang format slam. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: net/base/network_change_notifier_mac.cc
diff --git a/net/base/network_change_notifier_mac.cc b/net/base/network_change_notifier_mac.cc
index 7fa97b48b61918805451c99d8fc203df3cc0109a..3d4a4ae7011147f3f66eb2576ae695898870df4a 100644
--- a/net/base/network_change_notifier_mac.cc
+++ b/net/base/network_change_notifier_mac.cc
@@ -24,9 +24,9 @@ NetworkChangeNotifier::ConnectionType CalculateConnectionType(
bool reachable = CalculateReachability(flags);
if (reachable) {
#if defined(OS_IOS)
- return (flags & kSCNetworkReachabilityFlagsIsWWAN) ?
- NetworkChangeNotifier::CONNECTION_3G :
- NetworkChangeNotifier::CONNECTION_WIFI;
+ return (flags & kSCNetworkReachabilityFlagsIsWWAN)
+ ? NetworkChangeNotifier::CONNECTION_3G
+ : NetworkChangeNotifier::CONNECTION_WIFI;
#else
// TODO(droger): Get something more detailed than CONNECTION_UNKNOWN.
// http://crbug.com/112937
@@ -43,18 +43,14 @@ class NetworkChangeNotifierMac::DnsConfigServiceThread : public base::Thread {
public:
DnsConfigServiceThread() : base::Thread("DnsConfigService") {}
- virtual ~DnsConfigServiceThread() {
- Stop();
- }
+ virtual ~DnsConfigServiceThread() { Stop(); }
virtual void Init() OVERRIDE {
service_ = DnsConfigService::CreateSystemService();
service_->WatchConfig(base::Bind(&NetworkChangeNotifier::SetDnsConfig));
}
- virtual void CleanUp() OVERRIDE {
- service_.reset();
- }
+ virtual void CleanUp() OVERRIDE { service_.reset(); }
private:
scoped_ptr<DnsConfigService> service_;
@@ -84,9 +80,8 @@ NetworkChangeNotifierMac::~NetworkChangeNotifierMac() {
// Now that StartReachabilityNotifications() has either run to completion or
// never run at all, unschedule reachability_ if it was previously scheduled.
if (reachability_.get() && run_loop_.get()) {
- SCNetworkReachabilityUnscheduleFromRunLoop(reachability_.get(),
- run_loop_.get(),
- kCFRunLoopCommonModes);
+ SCNetworkReachabilityUnscheduleFromRunLoop(
+ reachability_.get(), run_loop_.get(), kCFRunLoopCommonModes);
}
}
@@ -114,7 +109,7 @@ NetworkChangeNotifierMac::GetCurrentConnectionType() const {
return connection_type_;
}
-void NetworkChangeNotifierMac::Forwarder::Init() {
+void NetworkChangeNotifierMac::Forwarder::Init() {
net_config_watcher_->SetInitialConnectionType();
}
@@ -123,12 +118,12 @@ void NetworkChangeNotifierMac::Forwarder::StartReachabilityNotifications() {
}
void NetworkChangeNotifierMac::Forwarder::SetDynamicStoreNotificationKeys(
- SCDynamicStoreRef store) {
+ SCDynamicStoreRef store) {
net_config_watcher_->SetDynamicStoreNotificationKeys(store);
}
void NetworkChangeNotifierMac::Forwarder::OnNetworkConfigChange(
- CFArrayRef changed_keys) {
+ CFArrayRef changed_keys) {
net_config_watcher_->OnNetworkConfigChange(changed_keys);
}
@@ -170,11 +165,11 @@ void NetworkChangeNotifierMac::StartReachabilityNotifications() {
DCHECK(reachability_);
SCNetworkReachabilityContext reachability_context = {
- 0, // version
- this, // user data
- NULL, // retain
- NULL, // release
- NULL // description
+ 0, // version
+ this, // user data
+ NULL, // retain
+ NULL, // release
+ NULL // description
};
if (!SCNetworkReachabilitySetCallback(
reachability_,
@@ -182,9 +177,8 @@ void NetworkChangeNotifierMac::StartReachabilityNotifications() {
&reachability_context)) {
LOG(DFATAL) << "Could not set network reachability callback";
reachability_.reset();
- } else if (!SCNetworkReachabilityScheduleWithRunLoop(reachability_,
- run_loop_,
- kCFRunLoopCommonModes)) {
+ } else if (!SCNetworkReachabilityScheduleWithRunLoop(
+ reachability_, run_loop_, kCFRunLoopCommonModes)) {
LOG(DFATAL) << "Could not schedule network reachability on run loop";
reachability_.reset();
}
@@ -210,8 +204,8 @@ void NetworkChangeNotifierMac::SetDynamicStoreNotificationKeys(
CFArrayAppendValue(notification_keys.get(), key.get());
// Set the notification keys. This starts us receiving notifications.
- bool ret = SCDynamicStoreSetNotificationKeys(
- store, notification_keys.get(), NULL);
+ bool ret =
+ SCDynamicStoreSetNotificationKeys(store, notification_keys.get(), NULL);
// TODO(willchan): Figure out a proper way to handle this rather than crash.
CHECK(ret);
#endif // defined(OS_IOS)
@@ -225,8 +219,8 @@ void NetworkChangeNotifierMac::OnNetworkConfigChange(CFArrayRef changed_keys) {
DCHECK_EQ(run_loop_.get(), CFRunLoopGetCurrent());
for (CFIndex i = 0; i < CFArrayGetCount(changed_keys); ++i) {
- CFStringRef key = static_cast<CFStringRef>(
- CFArrayGetValueAtIndex(changed_keys, i));
+ CFStringRef key =
+ static_cast<CFStringRef>(CFArrayGetValueAtIndex(changed_keys, i));
if (CFStringHasSuffix(key, kSCEntNetIPv4) ||
CFStringHasSuffix(key, kSCEntNetIPv6)) {
NotifyObserversOfIPAddressChange();

Powered by Google App Engine
This is Rietveld 408576698