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

Side by Side Diff: components/autofill/ios/browser/form_suggestion.mm

Issue 2610923005: Replace ObjCPropertyReleaser with ReleaseProperties() project-wide. (Closed)
Patch Set: weak -> assign Created 3 years, 11 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #import "components/autofill/ios/browser/form_suggestion.h" 5 #import "components/autofill/ios/browser/form_suggestion.h"
6 6
7 #include "base/mac/objc_property_releaser.h" 7 #include "base/mac/objc_release_properties.h"
8 8
9 @interface FormSuggestion () 9 @interface FormSuggestion ()
10 // Local initializer for a FormSuggestion. 10 // Local initializer for a FormSuggestion.
11 - (id)initWithValue:(NSString*)value 11 - (id)initWithValue:(NSString*)value
12 displayDescription:(NSString*)displayDescription 12 displayDescription:(NSString*)displayDescription
13 icon:(NSString*)icon 13 icon:(NSString*)icon
14 identifier:(NSInteger)identifier; 14 identifier:(NSInteger)identifier;
15 @end 15 @end
16 16
17 @implementation FormSuggestion { 17 @implementation FormSuggestion
18 NSString* _value;
19 NSString* _displayDescription;
20 NSString* _icon;
21 NSInteger _identifier;
22 base::mac::ObjCPropertyReleaser _propertyReleaser_FormSuggestion;
23 }
24
25 @synthesize value = _value; 18 @synthesize value = _value;
26 @synthesize displayDescription = _displayDescription; 19 @synthesize displayDescription = _displayDescription;
27 @synthesize icon = _icon; 20 @synthesize icon = _icon;
28 @synthesize identifier = _identifier; 21 @synthesize identifier = _identifier;
29 22
30 - (id)initWithValue:(NSString*)value 23 - (id)initWithValue:(NSString*)value
31 displayDescription:(NSString*)displayDescription 24 displayDescription:(NSString*)displayDescription
32 icon:(NSString*)icon 25 icon:(NSString*)icon
33 identifier:(NSInteger)identifier { 26 identifier:(NSInteger)identifier {
34 self = [super init]; 27 self = [super init];
35 if (self) { 28 if (self) {
36 _propertyReleaser_FormSuggestion.Init(self, [FormSuggestion class]);
37 _value = [value copy]; 29 _value = [value copy];
38 _displayDescription = [displayDescription copy]; 30 _displayDescription = [displayDescription copy];
39 _icon = [icon copy]; 31 _icon = [icon copy];
40 _identifier = identifier; 32 _identifier = identifier;
41 } 33 }
42 return self; 34 return self;
43 } 35 }
44 36
37 - (void)dealloc {
38 base::mac::ReleaseProperties(self);
39 [super dealloc];
40 }
41
45 + (FormSuggestion*)suggestionWithValue:(NSString*)value 42 + (FormSuggestion*)suggestionWithValue:(NSString*)value
46 displayDescription:(NSString*)displayDescription 43 displayDescription:(NSString*)displayDescription
47 icon:(NSString*)icon 44 icon:(NSString*)icon
48 identifier:(NSInteger)identifier { 45 identifier:(NSInteger)identifier {
49 return [[[FormSuggestion alloc] initWithValue:value 46 return [[[FormSuggestion alloc] initWithValue:value
50 displayDescription:displayDescription 47 displayDescription:displayDescription
51 icon:icon 48 icon:icon
52 identifier:identifier] autorelease]; 49 identifier:identifier] autorelease];
53 } 50 }
54 51
55 @end 52 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698