OLD | NEW |
(Empty) | |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef IOS_NET_PROTOCOL_HANDLER_UTIL_H_ |
| 6 #define IOS_NET_PROTOCOL_HANDLER_UTIL_H_ |
| 7 |
| 8 #import <Foundation/Foundation.h> |
| 9 |
| 10 namespace base { |
| 11 class Time; |
| 12 } // namespace base |
| 13 |
| 14 namespace net { |
| 15 class URLRequest; |
| 16 } // namespace net |
| 17 |
| 18 namespace net { |
| 19 |
| 20 // Creates a network NSError. |ns_error_code| is the iOS error code, |
| 21 // |net_error_code| is the network error from net/base/net_error_list.h. |
| 22 // |creation_time| is the time when the failing request was started and must be |
| 23 // valid. |
| 24 NSError* GetIOSError(NSInteger ns_error_code, |
| 25 int net_error_code, |
| 26 NSString* url, |
| 27 const base::Time& creation_time); |
| 28 |
| 29 // Builds a NSURLResponse from the response data in |request|. |
| 30 NSURLResponse* GetNSURLResponseForRequest(URLRequest* request); |
| 31 |
| 32 // Copy HTTP headers from |in_request| to |out_request|. |
| 33 void CopyHttpHeaders(NSURLRequest* in_request, URLRequest* out_request); |
| 34 |
| 35 } // namespace protocol_handler_util |
| 36 |
| 37 #endif // IOS_NET_PROTOCOL_HANDLER_UTIL_H_ |
OLD | NEW |