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

Side by Side Diff: ios/net/clients/crn_simple_network_client_factory.mm

Issue 2489533003: [ObjC ARC] Converts ios/net to ARC. (Closed)
Patch Set: Created 4 years, 1 month 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ios/net/clients/crn_simple_network_client_factory.h" 5 #import "ios/net/clients/crn_simple_network_client_factory.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/mac/scoped_nsobject.h" 8 #include "base/mac/scoped_nsobject.h"
9 #import "ios/net/clients/crn_forwarding_network_client.h" 9 #import "ios/net/clients/crn_forwarding_network_client.h"
10 10
11 #if !defined(__has_feature) || !__has_feature(objc_arc)
12 #error "This file requires ARC support."
13 #endif
14
11 @interface CRNSimpleNetworkClientFactory () { 15 @interface CRNSimpleNetworkClientFactory () {
12 base::scoped_nsprotocol<Class> _clientClass; 16 base::scoped_nsprotocol<Class> _clientClass;
13 } 17 }
14 @end 18 @end
15 19
16 @implementation CRNSimpleNetworkClientFactory 20 @implementation CRNSimpleNetworkClientFactory
17 21
18 - (instancetype)initWithClass:(Class)clientClass { 22 - (instancetype)initWithClass:(Class)clientClass {
19 if (self = [super init]) { 23 if (self = [super init]) {
20 DCHECK([clientClass isSubclassOfClass:[CRNForwardingNetworkClient class]]); 24 DCHECK([clientClass isSubclassOfClass:[CRNForwardingNetworkClient class]]);
21 _clientClass.reset([clientClass retain]); 25 _clientClass.reset(clientClass);
22 } 26 }
23 return self; 27 return self;
24 } 28 }
25 29
26 - (CRNForwardingNetworkClient*)clientHandlingAnyRequest { 30 - (CRNForwardingNetworkClient*)clientHandlingAnyRequest {
27 return [[[_clientClass alloc] init] autorelease]; 31 return [[_clientClass alloc] init];
28 } 32 }
29 33
30 - (Class)clientClass { 34 - (Class)clientClass {
31 return _clientClass; 35 return _clientClass;
32 } 36 }
33 37
34 @end 38 @end
OLDNEW
« no previous file with comments | « ios/net/clients/crn_forwarding_network_client_factory.mm ('k') | ios/net/cookies/cookie_creation_time_manager.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698