Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(463)

Side by Side Diff: shell/domain_socket/net_errors.cc

Issue 775343004: Move //mojo/shell to //shell (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « shell/domain_socket/net_errors.h ('k') | shell/domain_socket/socket_descriptor.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "mojo/shell/domain_socket/net_errors.h" 5 #include "shell/domain_socket/net_errors.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <stdlib.h> 8 #include <stdlib.h>
9 #if defined(OS_POSIX) 9 #if defined(OS_POSIX)
10 #include <unistd.h> 10 #include <unistd.h>
11 #endif 11 #endif
12 #if defined(OS_WIN) 12 #if defined(OS_WIN)
13 #include <winsock2.h> 13 #include <winsock2.h>
14 #define EDQUOT WSAEDQUOT 14 #define EDQUOT WSAEDQUOT
15 #define EHOSTDOWN WSAEHOSTDOWN 15 #define EHOSTDOWN WSAEHOSTDOWN
(...skipping 10 matching lines...) Expand all
26 namespace shell { 26 namespace shell {
27 namespace net { 27 namespace net {
28 28
29 std::string ErrorToString(int error) { 29 std::string ErrorToString(int error) {
30 if (error == 0) 30 if (error == 0)
31 return "OK"; 31 return "OK";
32 32
33 const char* error_string; 33 const char* error_string;
34 switch (error) { 34 switch (error) {
35 #define NET_ERROR(label, value) \ 35 #define NET_ERROR(label, value) \
36 case ERR_ ## label: \ 36 case ERR_##label: \
37 error_string = # label; \ 37 error_string = #label; \
38 break; 38 break;
39 #include "mojo/shell/domain_socket/net_error_list.h" 39 #include "shell/domain_socket/net_error_list.h"
40 #undef NET_ERROR 40 #undef NET_ERROR
41 default: 41 default:
42 NOTREACHED(); 42 NOTREACHED();
43 error_string = "<unknown>"; 43 error_string = "<unknown>";
44 } 44 }
45 return std::string("ERR_") + error_string; 45 return std::string("ERR_") + error_string;
46 } 46 }
47 47
48 Error FileErrorToNetError(base::File::Error file_error) { 48 Error FileErrorToNetError(base::File::Error file_error) {
49 switch (file_error) { 49 switch (file_error) {
50 case base::File::FILE_OK: 50 case base::File::FILE_OK:
51 return net::OK; 51 return net::OK;
52 case base::File::FILE_ERROR_ACCESS_DENIED: 52 case base::File::FILE_ERROR_ACCESS_DENIED:
53 return net::ERR_ACCESS_DENIED; 53 return net::ERR_ACCESS_DENIED;
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 default: 159 default:
160 LOG(WARNING) << "Unknown error " << os_error 160 LOG(WARNING) << "Unknown error " << os_error
161 << " mapped to net::ERR_FAILED"; 161 << " mapped to net::ERR_FAILED";
162 return ERR_FAILED; 162 return ERR_FAILED;
163 } 163 }
164 } 164 }
165 165
166 } // namespace net 166 } // namespace net
167 } // namespace shell 167 } // namespace shell
168 } // namespace mojo 168 } // namespace mojo
OLDNEW
« no previous file with comments | « shell/domain_socket/net_errors.h ('k') | shell/domain_socket/socket_descriptor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698