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

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: Removed curly braces. 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..661bce5ebfc9b581d4a473f18abdc0f9008d5d05 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 {
@@ -18,10 +21,7 @@ NSString* const kMatchingLanguagesKey = @"MatchingLanguages";
#pragma mark - SpeechInputLocaleMatchConfig
-@interface SpeechInputLocaleMatchConfig () {
- // Backing object for the property of the same name.
- base::scoped_nsobject<NSArray> _matches;
-}
+@interface SpeechInputLocaleMatchConfig ()
// Loads |_matches| from config file |plistFileName|.
- (void)loadConfigFile:(NSString*)plistFileName;
@@ -29,6 +29,7 @@ NSString* const kMatchingLanguagesKey = @"MatchingLanguages";
@end
@implementation SpeechInputLocaleMatchConfig
+@synthesize matches = _matches;
+ (instancetype)sharedInstance {
static SpeechInputLocaleMatchConfig* matchConfig;
@@ -47,11 +48,6 @@ NSString* const kMatchingLanguagesKey = @"MatchingLanguages";
return self;
}
-#pragma mark Accessors
-
-- (NSArray*)matches {
- return _matches.get();
-}
#pragma mark - Private
@@ -63,49 +59,29 @@ 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
#pragma mark - SpeechInputLocaleMatch
-@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;
-}
-
-@end
-
@implementation SpeechInputLocaleMatch
+@synthesize matchedLocaleCode = _matchedLocaleCode;
+@synthesize matchingLocaleCodes = _matchingLocaleCodes;
+@synthesize matchingLanguages = _matchingLanguages;
- (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;
}
-#pragma mark Accessors
-
-- (NSString*)matchedLocaleCode {
- return _matchedLocaleCode;
-}
-
-- (NSArray*)matchingLocaleCodes {
- return _matchingLocaleCodes;
-}
-
-- (NSArray*)matchingLanguages {
- return _matchingLanguages;
-}
-
@end
« 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