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

Unified Diff: ios/chrome/browser/voice/speech_input_locale_match_config.mm

Issue 2894623004: [ObjC ARC] Converts ios/chrome/browser/voice:voice to ARC. (Closed)
Patch Set: Created 3 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
« no previous file with comments | « ios/chrome/browser/voice/speech_input_locale_config_impl.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « ios/chrome/browser/voice/speech_input_locale_config_impl.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698