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

Unified Diff: device/bluetooth/test/mock_bluetooth_cbservice_mac.mm

Issue 2025013003: Adding scoped_nsobject for MockCBService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removing synthesize Created 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/test/mock_bluetooth_cbservice_mac.mm
diff --git a/device/bluetooth/test/mock_bluetooth_cbservice_mac.mm b/device/bluetooth/test/mock_bluetooth_cbservice_mac.mm
index 9c372ff8ba286c6fac2a762f32b4685fd0221b94..48337c8e95a47e31605d4d70dc1e1dd502f15133 100644
--- a/device/bluetooth/test/mock_bluetooth_cbservice_mac.mm
+++ b/device/bluetooth/test/mock_bluetooth_cbservice_mac.mm
@@ -12,7 +12,7 @@ using base::mac::ObjCCast;
using base::scoped_nsobject;
@interface MockCBService () {
- CBUUID* _UUID;
+ scoped_nsobject<CBUUID> _UUID;
BOOL _primary;
}
@@ -20,23 +20,17 @@ using base::scoped_nsobject;
@implementation MockCBService
-@synthesize UUID = _UUID;
@synthesize isPrimary = _primary;
- (instancetype)initWithCBUUID:(CBUUID*)uuid primary:(BOOL)isPrimary {
self = [super init];
if (self) {
- _UUID = [uuid retain];
+ _UUID.reset([uuid retain]);
_primary = isPrimary;
}
return self;
}
-- (void)dealloc {
- [_UUID release];
- [super dealloc];
-}
-
- (BOOL)isKindOfClass:(Class)aClass {
if (aClass == [CBService class] ||
[aClass isSubclassOfClass:[CBService class]]) {
@@ -53,6 +47,10 @@ using base::scoped_nsobject;
return [super isKindOfClass:aClass];
}
+- (CBUUID*)UUID {
+ return _UUID.get();
+}
+
- (CBService*)service {
return ObjCCast<CBService>(self);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698