Index: ios/chrome/browser/voice/speech_input_locale_match_config.mm |
diff --git a/ios/chrome/browser/voice/speech_input_locale_match_config.mm b/ios/chrome/browser/voice/speech_input_locale_match_config.mm |
index e53a8a0b94280865235432b1666aef53308aef93..808d47e15a5ba536fccfa18cb71e8ab8b8042f47 100644 |
--- a/ios/chrome/browser/voice/speech_input_locale_match_config.mm |
+++ b/ios/chrome/browser/voice/speech_input_locale_match_config.mm |
@@ -5,7 +5,10 @@ |
#import "ios/chrome/browser/voice/speech_input_locale_match_config.h" |
#import "base/mac/foundation_util.h" |
-#import "base/mac/scoped_nsobject.h" |
+ |
+#if !defined(__has_feature) || !__has_feature(objc_arc) |
+#error "This file requires ARC support." |
+#endif |
namespace { |
@@ -20,7 +23,7 @@ NSString* const kMatchingLanguagesKey = @"MatchingLanguages"; |
@interface SpeechInputLocaleMatchConfig () { |
// Backing object for the property of the same name. |
- base::scoped_nsobject<NSArray> _matches; |
+ NSArray* _matches; |
} |
kkhorimoto
2017/05/25 19:07:36
This whole block within the curly braces can be re
lindsayw
2017/06/01 19:22:46
Done.
|
// Loads |_matches| from config file |plistFileName|. |
@@ -50,7 +53,7 @@ NSString* const kMatchingLanguagesKey = @"MatchingLanguages"; |
#pragma mark Accessors |
- (NSArray*)matches { |
- return _matches.get(); |
+ return _matches; |
} |
kkhorimoto
2017/05/25 19:07:36
This will also be handled by property synthesis
lindsayw
2017/06/01 19:22:46
Ok, so I just deleted the line 56, please let me k
|
#pragma mark - Private |
@@ -63,11 +66,11 @@ NSString* const kMatchingLanguagesKey = @"MatchingLanguages"; |
NSMutableArray* matches = [NSMutableArray array]; |
for (id item in configData) { |
NSDictionary* matchDict = base::mac::ObjCCastStrict<NSDictionary>(item); |
- base::scoped_nsobject<SpeechInputLocaleMatch> match( |
- [[SpeechInputLocaleMatch alloc] initWithDictionary:matchDict]); |
+ SpeechInputLocaleMatch* match = |
+ [[SpeechInputLocaleMatch alloc] initWithDictionary:matchDict]; |
[matches addObject:match]; |
} |
- _matches.reset([matches copy]); |
+ _matches = [matches copy]; |
} |
@end |
@@ -76,9 +79,9 @@ NSString* const kMatchingLanguagesKey = @"MatchingLanguages"; |
@interface SpeechInputLocaleMatch () { |
// Backing objects for properties of the same name. |
- base::scoped_nsobject<NSString> _matchedLocaleCode; |
- base::scoped_nsobject<NSArray> _matchingLocaleCodes; |
- base::scoped_nsobject<NSArray> _matchingLanguages; |
+ NSString* _matchedLocaleCode; |
+ NSArray* _matchingLocaleCodes; |
+ NSArray* _matchingLanguages; |
} |
@end |
kkhorimoto
2017/05/25 19:07:36
This whole @interface section can be removed if yo
lindsayw
2017/06/01 19:22:46
Done.
|
@@ -87,9 +90,9 @@ NSString* const kMatchingLanguagesKey = @"MatchingLanguages"; |
kkhorimoto
2017/05/25 19:07:37
@synthesize matchedLocaleCode = _matchedLocaleCode
lindsayw
2017/06/01 19:22:46
Done.
|
- (instancetype)initWithDictionary:(NSDictionary*)matchDict { |
if ((self = [super init])) { |
- _matchedLocaleCode.reset([matchDict[kMatchedLocaleKey] copy]); |
- _matchingLocaleCodes.reset([matchDict[kMatchingLocalesKey] copy]); |
- _matchingLanguages.reset([matchDict[kMatchingLanguagesKey] copy]); |
+ _matchedLocaleCode = [matchDict[kMatchedLocaleKey] copy]; |
+ _matchingLocaleCodes = [matchDict[kMatchingLocalesKey] copy]; |
+ _matchingLanguages = [matchDict[kMatchingLanguagesKey] copy]; |
} |
return self; |
} |