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

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

Issue 16917011: mac: Replace base::mac::ScopedCFTypeRef with base::ScopedCFTypeRef. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: with fixed off-by-1 in git-clang-format Created 7 years, 6 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/network_config_watcher_mac.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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 reachability_.reset(); 189 reachability_.reset();
190 } 190 }
191 } 191 }
192 192
193 void NetworkChangeNotifierMac::SetDynamicStoreNotificationKeys( 193 void NetworkChangeNotifierMac::SetDynamicStoreNotificationKeys(
194 SCDynamicStoreRef store) { 194 SCDynamicStoreRef store) {
195 #if defined(OS_IOS) 195 #if defined(OS_IOS)
196 // SCDynamicStore API does not exist on iOS. 196 // SCDynamicStore API does not exist on iOS.
197 NOTREACHED(); 197 NOTREACHED();
198 #else 198 #else
199 base::mac::ScopedCFTypeRef<CFMutableArrayRef> notification_keys( 199 base::ScopedCFTypeRef<CFMutableArrayRef> notification_keys(
200 CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks)); 200 CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks));
201 base::mac::ScopedCFTypeRef<CFStringRef> key( 201 base::ScopedCFTypeRef<CFStringRef> key(
202 SCDynamicStoreKeyCreateNetworkGlobalEntity( 202 SCDynamicStoreKeyCreateNetworkGlobalEntity(
203 NULL, kSCDynamicStoreDomainState, kSCEntNetInterface)); 203 NULL, kSCDynamicStoreDomainState, kSCEntNetInterface));
204 CFArrayAppendValue(notification_keys.get(), key.get()); 204 CFArrayAppendValue(notification_keys.get(), key.get());
205 key.reset(SCDynamicStoreKeyCreateNetworkGlobalEntity( 205 key.reset(SCDynamicStoreKeyCreateNetworkGlobalEntity(
206 NULL, kSCDynamicStoreDomainState, kSCEntNetIPv4)); 206 NULL, kSCDynamicStoreDomainState, kSCEntNetIPv4));
207 CFArrayAppendValue(notification_keys.get(), key.get()); 207 CFArrayAppendValue(notification_keys.get(), key.get());
208 key.reset(SCDynamicStoreKeyCreateNetworkGlobalEntity( 208 key.reset(SCDynamicStoreKeyCreateNetworkGlobalEntity(
209 NULL, kSCDynamicStoreDomainState, kSCEntNetIPv6)); 209 NULL, kSCDynamicStoreDomainState, kSCEntNetIPv6));
210 CFArrayAppendValue(notification_keys.get(), key.get()); 210 CFArrayAppendValue(notification_keys.get(), key.get());
211 211
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 264
265 #if defined(OS_IOS) 265 #if defined(OS_IOS)
266 // On iOS, the SCDynamicStore API does not exist, and we use the reachability 266 // On iOS, the SCDynamicStore API does not exist, and we use the reachability
267 // API to detect IP address changes instead. 267 // API to detect IP address changes instead.
268 if (new_type != CONNECTION_NONE) 268 if (new_type != CONNECTION_NONE)
269 NotifyObserversOfIPAddressChange(); 269 NotifyObserversOfIPAddressChange();
270 #endif // defined(OS_IOS) 270 #endif // defined(OS_IOS)
271 } 271 }
272 272
273 } // namespace net 273 } // namespace net
OLDNEW
« no previous file with comments | « net/base/network_change_notifier_mac.h ('k') | net/base/network_config_watcher_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698