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

Unified Diff: webkit/common/fileapi/file_system_util.cc

Issue 23463048: Implement stream based cross file system copy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
Index: webkit/common/fileapi/file_system_util.cc
diff --git a/webkit/common/fileapi/file_system_util.cc b/webkit/common/fileapi/file_system_util.cc
index 6229bc22c795e4e4610d3f85e1e3b0b139052566..0f0710bb0ba1f47f503af5879878c3d80ccadfff 100644
--- a/webkit/common/fileapi/file_system_util.cc
+++ b/webkit/common/fileapi/file_system_util.cc
@@ -11,6 +11,7 @@
#include "base/strings/string_util.h"
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
+#include "net/base/net_errors.h"
#include "url/gurl.h"
#include "webkit/common/database/database_identifier.h"
@@ -396,4 +397,36 @@ std::string GetExternalFileSystemRootURIString(
return root;
}
+base::PlatformFileError NetErrorToPlatformFileError(int error) {
kinuko 2013/09/23 22:10:20 It's really great if you could split this CL. (Yo
hidehiko 2013/09/24 02:06:15 Done. crrev.com/24300003 I'll rebase this onto it
+ switch (error) {
+ case net::OK:
+ return base::PLATFORM_FILE_OK;
+ case net::ERR_ADDRESS_IN_USE:
+ return base::PLATFORM_FILE_ERROR_IN_USE;
+ case net::ERR_FILE_EXISTS:
+ return base::PLATFORM_FILE_ERROR_EXISTS;
+ case net::ERR_FILE_NOT_FOUND:
+ return base::PLATFORM_FILE_ERROR_NOT_FOUND;
+ case net::ERR_ACCESS_DENIED:
+ return base::PLATFORM_FILE_ERROR_ACCESS_DENIED;
+ case net::ERR_TOO_MANY_SOCKET_STREAMS:
+ return base::PLATFORM_FILE_ERROR_TOO_MANY_OPENED;
+ case net::ERR_OUT_OF_MEMORY:
+ return base::PLATFORM_FILE_ERROR_NO_MEMORY;
+ case net::ERR_FILE_NO_SPACE:
+ return base::PLATFORM_FILE_ERROR_NO_SPACE;
+ case net::ERR_INVALID_ARGUMENT:
+ case net::ERR_INVALID_HANDLE:
+ return base::PLATFORM_FILE_ERROR_INVALID_OPERATION;
+ case net::ERR_ABORTED:
+ case net::ERR_CONNECTION_ABORTED:
+ return base::PLATFORM_FILE_ERROR_ABORT;
+ case net::ERR_ADDRESS_INVALID:
+ case net::ERR_INVALID_URL:
+ return base::PLATFORM_FILE_ERROR_INVALID_URL;
+ default:
+ return base::PLATFORM_FILE_ERROR_FAILED;
+ }
+}
+
} // namespace fileapi

Powered by Google App Engine
This is Rietveld 408576698