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

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

Issue 227473008: make SetReceiveBufferSize and SetSendBufferSize return net error codes (instead of bools) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix linux typo Created 6 years, 8 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/strings/stringize_macros.h" 9 #include "base/strings/stringize_macros.h"
10 10
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 return net::ERR_ACCESS_DENIED; 52 return net::ERR_ACCESS_DENIED;
53 case base::File::FILE_ERROR_INVALID_URL: 53 case base::File::FILE_ERROR_INVALID_URL:
54 return net::ERR_INVALID_URL; 54 return net::ERR_INVALID_URL;
55 case base::File::FILE_ERROR_NOT_FOUND: 55 case base::File::FILE_ERROR_NOT_FOUND:
56 return net::ERR_FILE_NOT_FOUND; 56 return net::ERR_FILE_NOT_FOUND;
57 default: 57 default:
58 return net::ERR_FAILED; 58 return net::ERR_FAILED;
59 } 59 }
60 } 60 }
61 61
62 int MapSystemErrorWithDefault(int os_error, int default_net_error) {
63 int net_error = MapSystemError(os_error);
64 if (net_error != OK)
65 return net_error;
66 DLOG(WARNING) << "OS Error was not set meaningfully " << os_error;
wtc 2014/04/09 15:34:49 Hmm... the problem with this error message is that
67 DCHECK_NE(default_net_error, OK);
wtc 2014/04/09 15:34:49 This DCHECK should be at the beginning of the func
68 return default_net_error;
69 }
70
62 } // namespace net 71 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698