summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorericu@google.com <ericu@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-29 18:01:30 +0000
committerericu@google.com <ericu@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-29 18:01:30 +0000
commitd41c69dc6254efd7643d151d4265e996755ddb6c (patch)
tree24075a30988a2d72bb1241208924f766cbe8f3f4 /webkit
parentc2bfb817511464d5d0fbcece69f25b5c8789dcab (diff)
downloadchromium_src-d41c69dc6254efd7643d151d4265e996755ddb6c.zip
chromium_src-d41c69dc6254efd7643d151d4265e996755ddb6c.tar.gz
chromium_src-d41c69dc6254efd7643d151d4265e996755ddb6c.tar.bz2
This adds WebFileWriterImpl, which implements WebFileWriter and AsyncFileWriterClient.
BUG=none TEST=none Review URL: http://codereview.chromium.org/3397030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60964 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/glue/webkit_glue.cc20
-rw-r--r--webkit/glue/webkit_glue.h6
2 files changed, 26 insertions, 0 deletions
diff --git a/webkit/glue/webkit_glue.cc b/webkit/glue/webkit_glue.cc
index 33eff1a..661b87b 100644
--- a/webkit/glue/webkit_glue.cc
+++ b/webkit/glue/webkit_glue.cc
@@ -313,6 +313,26 @@ WebString FilePathToWebString(const FilePath& file_path) {
return FilePathStringToWebString(file_path.value());
}
+WebKit::WebFileError PlatformFileErrorToWebFileError(
+ base::PlatformFileError error_code) {
+ switch (error_code) {
+ case base::PLATFORM_FILE_ERROR_NOT_FOUND:
+ return WebKit::WebFileErrorNotFound;
+ case base::PLATFORM_FILE_ERROR_INVALID_OPERATION:
+ case base::PLATFORM_FILE_ERROR_EXISTS:
+ case base::PLATFORM_FILE_ERROR_NOT_A_DIRECTORY:
+ return WebKit::WebFileErrorInvalidModification;
+ case base::PLATFORM_FILE_ERROR_ACCESS_DENIED:
+ return WebKit::WebFileErrorNoModificationAllowed;
+ case base::PLATFORM_FILE_ERROR_FAILED:
+ return WebKit::WebFileErrorInvalidState;
+ case base::PLATFORM_FILE_ERROR_ABORT:
+ return WebKit::WebFileErrorAbort;
+ default:
+ return WebKit::WebFileErrorInvalidModification;
+ }
+}
+
namespace {
struct UserAgentState {
diff --git a/webkit/glue/webkit_glue.h b/webkit/glue/webkit_glue.h
index 6c7387d..380bf36 100644
--- a/webkit/glue/webkit_glue.h
+++ b/webkit/glue/webkit_glue.h
@@ -16,8 +16,10 @@
#include "app/clipboard/clipboard.h"
#include "base/file_path.h"
+#include "base/platform_file.h"
#include "base/string16.h"
#include "third_party/WebKit/WebKit/chromium/public/WebCanvas.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebFileError.h"
class GURL;
class SkBitmap;
@@ -132,6 +134,10 @@ WebKit::WebString FilePathStringToWebString(const FilePath::StringType& str);
FilePath WebStringToFilePath(const WebKit::WebString& str);
WebKit::WebString FilePathToWebString(const FilePath& file_path);
+// File error conversion
+WebKit::WebFileError PlatformFileErrorToWebFileError(
+ base::PlatformFileError error_code);
+
// Returns a WebCanvas pointer associated with the given Skia canvas.
WebKit::WebCanvas* ToWebCanvas(skia::PlatformCanvas*);