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

Unified Diff: net/base/net_errors.cc

Issue 10808043: Factor out common error-code conversion code for PlatformFileErrorToNetError. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Modified return value type. Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: net/base/net_errors.cc
diff --git a/net/base/net_errors.cc b/net/base/net_errors.cc
index 623c0716bbdfcd489e757c320cd930cfbea80d5f..7790c0774392f75995d54dfe89d6257c720ecb61 100644
--- a/net/base/net_errors.cc
+++ b/net/base/net_errors.cc
@@ -44,4 +44,18 @@ std::vector<int> GetAllErrorCodesForUma() {
kAllErrorCodes, arraysize(kAllErrorCodes));
}
+net::Error PlatformFileErrorToNetError(
willchan no longer on Chromium 2012/07/24 14:45:57 ditto on no need for net::
nhiroki (google) 2012/07/24 16:23:03 Done.
+ base::PlatformFileError file_error) {
+ switch (file_error) {
+ case base::PLATFORM_FILE_OK:
+ return net::OK;
+ case base::PLATFORM_FILE_ERROR_NOT_FOUND:
+ return net::ERR_FILE_NOT_FOUND;
+ case base::PLATFORM_FILE_ERROR_ACCESS_DENIED:
+ return net::ERR_ACCESS_DENIED;
+ default:
+ return net::ERR_FAILED;
+ }
+}
+
} // namespace net

Powered by Google App Engine
This is Rietveld 408576698