Index: ios/chrome/browser/geolocation/location_manager.mm |
diff --git a/ios/chrome/browser/geolocation/location_manager.mm b/ios/chrome/browser/geolocation/location_manager.mm |
index cab3ea7f1d571affde0f366e4605a8143cc64663..a16d8f23f834a881f3b7d8a2d0d99c008c4b53a7 100644 |
--- a/ios/chrome/browser/geolocation/location_manager.mm |
+++ b/ios/chrome/browser/geolocation/location_manager.mm |
@@ -11,6 +11,10 @@ |
#import "ios/public/provider/chrome/browser/chrome_browser_provider.h" |
#import "ios/public/provider/chrome/browser/geolocation_updater_provider.h" |
+#if !defined(__has_feature) || !__has_feature(objc_arc) |
+#error "This file requires ARC support." |
+#endif |
+ |
namespace { |
const CLLocationDistance kLocationDesiredAccuracy = |
@@ -76,7 +80,6 @@ const NSTimeInterval kLocationUpdateInterval = 365.0 * 24.0 * 60.0 * 60.0; |
- (void)dealloc { |
[[NSNotificationCenter defaultCenter] removeObserver:self]; |
- [super dealloc]; |
} |
- (CLAuthorizationStatus)authorizationStatus { |
@@ -85,7 +88,7 @@ const NSTimeInterval kLocationUpdateInterval = 365.0 * 24.0 * 60.0 * 60.0; |
- (CLLocation*)currentLocation { |
if (!_currentLocation) |
- _currentLocation.reset([[_locationUpdater currentLocation] retain]); |
+ _currentLocation.reset([_locationUpdater currentLocation]); |
return _currentLocation; |
} |
@@ -124,7 +127,7 @@ const NSTimeInterval kLocationUpdateInterval = 365.0 * 24.0 * 60.0 * 60.0; |
->GetUpdateNewLocationKey(); |
CLLocation* location = [[notification userInfo] objectForKey:newLocationKey]; |
if (location) { |
- _currentLocation.reset([location retain]); |
+ _currentLocation.reset(location); |
if (_startTime) { |
NSTimeInterval interval = -[_startTime timeIntervalSinceNow]; |
@@ -144,7 +147,7 @@ const NSTimeInterval kLocationUpdateInterval = 365.0 * 24.0 * 60.0 * 60.0; |
#pragma mark - LocationManager+Testing |
- (void)setGeolocationUpdater:(id<GeolocationUpdater>)geolocationUpdater { |
- _locationUpdater.reset([geolocationUpdater retain]); |
+ _locationUpdater.reset(geolocationUpdater); |
} |
@end |