OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef IOS_WEB_WEB_STATE_ERROR_TRANSLATION_UTIL_H_ | 5 #ifndef IOS_WEB_WEB_STATE_ERROR_TRANSLATION_UTIL_H_ |
6 #define IOS_WEB_WEB_STATE_ERROR_TRANSLATION_UTIL_H_ | 6 #define IOS_WEB_WEB_STATE_ERROR_TRANSLATION_UTIL_H_ |
7 | 7 |
8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
9 | 9 |
10 namespace web { | 10 namespace web { |
11 | 11 |
12 // Translates an iOS-specific error into its net error equivalent and returns | 12 // Translates an iOS-specific error into its net error equivalent and returns |
13 // a copy of |error| with the translation as its final underlying error. The | 13 // a copy of |error| with the translation as its final underlying error. The |
14 // underlying net error will have an error code of net::ERR_FAILED if no | 14 // underlying net error will have an error code of net::ERR_FAILED if no |
15 // specific translation of the iOS error is found. | 15 // specific translation of the iOS error is found. |
16 NSError* NetErrorFromError(NSError* error); | 16 NSError* NetErrorFromError(NSError* error); |
17 | 17 |
| 18 // Same as above but uses |net_error_code| for underlying error. |
| 19 NSError* NetErrorFromError(NSError* error, NSInteger net_error_code); |
| 20 |
18 } // namespace web | 21 } // namespace web |
19 | 22 |
20 #endif // IOS_WEB_WEB_STATE_ERROR_TRANSLATION_UTIL_H_ | 23 #endif // IOS_WEB_WEB_STATE_ERROR_TRANSLATION_UTIL_H_ |
OLD | NEW |