OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef MOJO_SHELL_DOMAIN_SOCKET_NET_ERRORS_H__ | |
6 #define MOJO_SHELL_DOMAIN_SOCKET_NET_ERRORS_H__ | |
7 | |
8 #include <string> | |
9 #include <vector> | |
10 | |
11 #include "base/basictypes.h" | |
12 #include "base/files/file.h" | |
13 | |
14 namespace mojo { | |
15 namespace shell { | |
16 namespace net { | |
17 | |
18 // Error values are negative. | |
19 enum Error { | |
20 // No error. | |
21 OK = 0, | |
22 | |
23 #define NET_ERROR(label, value) ERR_ ## label = value, | |
24 #include "mojo/shell/domain_socket/net_error_list.h" | |
25 #undef NET_ERROR | |
26 | |
27 }; | |
28 | |
29 // Returns a textual representation of the error code for logging purposes. | |
30 std::string ErrorToString(int error); | |
31 | |
32 // A convenient function to translate file error to net error code. | |
33 Error FileErrorToNetError(base::File::Error file_error); | |
34 | |
35 // Map system error code to Error. | |
36 Error MapSystemError(int os_error); | |
37 | |
38 } // namespace net | |
39 } // namespace shell | |
40 } // namespace mojo | |
41 | |
42 #endif // MOJO_SHELL_DOMAIN_SOCKET_NET_ERRORS_H__ | |
OLD | NEW |