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.
5 #ifndef IOS_NET_PROTOCOL_HANDLER_UTIL_H_
6 #define IOS_NET_PROTOCOL_HANDLER_UTIL_H_
8 #import <Foundation/Foundation.h>
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
24 NSError
* GetIOSError(NSInteger ns_error_code
,
27 const base::Time
& creation_time
);
29 // Builds a NSURLResponse from the response data in |request|.
30 NSURLResponse
* GetNSURLResponseForRequest(URLRequest
* request
);
32 // Copy HTTP headers from |in_request| to |out_request|.
33 void CopyHttpHeaders(NSURLRequest
* in_request
, URLRequest
* out_request
);
35 } // namespace protocol_handler_util
37 #endif // IOS_NET_PROTOCOL_HANDLER_UTIL_H_