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

Side by Side Diff: net/base/net_errors_win.cc

Issue 7583049: Record UMA statistics for file_stream operations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed extra logging. Created 9 years, 3 months 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 | Annotate | Revision Log
« no previous file with comments | « net/base/net_errors_posix.cc ('k') | net/net.gyp » ('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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "net/base/net_errors.h" 5 #include "net/base/net_errors.h"
6 6
7 #include <winsock2.h> 7 #include <winsock2.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 10
11 namespace net { 11 namespace net {
12 12
13 // Map winsock and system errors to Chromium errors. 13 // Map winsock and system errors to Chromium errors.
14 Error MapSystemError(int os_error) { 14 Error MapSystemError(int os_error) {
15 if (os_error != 0)
16 DVLOG(2) << "Error " << os_error;
17
15 // There are numerous Winsock error codes, but these are the ones we thus far 18 // There are numerous Winsock error codes, but these are the ones we thus far
16 // find interesting. 19 // find interesting.
17 switch (os_error) { 20 switch (os_error) {
18 case WSAEWOULDBLOCK: 21 case WSAEWOULDBLOCK:
19 return ERR_IO_PENDING; 22 return ERR_IO_PENDING;
20 case WSAEACCES: 23 case WSAEACCES:
21 return ERR_ACCESS_DENIED; 24 return ERR_ACCESS_DENIED;
22 case WSAENETDOWN: 25 case WSAENETDOWN:
23 return ERR_INTERNET_DISCONNECTED; 26 return ERR_INTERNET_DISCONNECTED;
24 case WSAETIMEDOUT: 27 case WSAETIMEDOUT:
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 case ERROR_SUCCESS: 111 case ERROR_SUCCESS:
109 return OK; 112 return OK;
110 default: 113 default:
111 LOG(WARNING) << "Unknown error " << os_error 114 LOG(WARNING) << "Unknown error " << os_error
112 << " mapped to net::ERR_FAILED"; 115 << " mapped to net::ERR_FAILED";
113 return ERR_FAILED; 116 return ERR_FAILED;
114 } 117 }
115 } 118 }
116 119
117 } // namespace net 120 } // namespace net
OLDNEW
« no previous file with comments | « net/base/net_errors_posix.cc ('k') | net/net.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698