| OLD | NEW |
| 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/crn_http_url_response.h" | 5 #import "ios/net/crn_http_url_response.h" |
| 6 | 6 |
| 7 #include "base/mac/scoped_nsobject.h" | 7 #include "base/mac/scoped_nsobject.h" |
| 8 | 8 |
| 9 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 10 #error "This file requires ARC support." |
| 11 #endif |
| 12 |
| 9 @interface CRNHTTPURLResponse () { | 13 @interface CRNHTTPURLResponse () { |
| 10 base::scoped_nsobject<NSString> _cr_HTTPVersion; | 14 base::scoped_nsobject<NSString> _cr_HTTPVersion; |
| 11 } | 15 } |
| 12 @end | 16 @end |
| 13 | 17 |
| 14 @implementation CRNHTTPURLResponse | 18 @implementation CRNHTTPURLResponse |
| 15 | 19 |
| 16 - (NSString*)cr_HTTPVersion { | 20 - (NSString*)cr_HTTPVersion { |
| 17 return _cr_HTTPVersion; | 21 return _cr_HTTPVersion; |
| 18 } | 22 } |
| 19 | 23 |
| 20 - (instancetype)initWithURL:(NSURL*)url | 24 - (instancetype)initWithURL:(NSURL*)url |
| 21 statusCode:(NSInteger)statusCode | 25 statusCode:(NSInteger)statusCode |
| 22 HTTPVersion:(NSString*)HTTPVersion | 26 HTTPVersion:(NSString*)HTTPVersion |
| 23 headerFields:(NSDictionary*)headerFields { | 27 headerFields:(NSDictionary*)headerFields { |
| 24 self = [super initWithURL:url | 28 self = [super initWithURL:url |
| 25 statusCode:statusCode | 29 statusCode:statusCode |
| 26 HTTPVersion:HTTPVersion | 30 HTTPVersion:HTTPVersion |
| 27 headerFields:headerFields]; | 31 headerFields:headerFields]; |
| 28 if (self) { | 32 if (self) { |
| 29 _cr_HTTPVersion.reset([HTTPVersion copy]); | 33 _cr_HTTPVersion.reset([HTTPVersion copy]); |
| 30 } | 34 } |
| 31 return self; | 35 return self; |
| 32 } | 36 } |
| 33 | 37 |
| 34 @end | 38 @end |
| OLD | NEW |