diff options
Diffstat (limited to 'chrome/common/file_system')
3 files changed, 27 insertions, 14 deletions
diff --git a/chrome/common/file_system/file_system_dispatcher.cc b/chrome/common/file_system/file_system_dispatcher.cc index a8761a2..e9bc96e 100644 --- a/chrome/common/file_system/file_system_dispatcher.cc +++ b/chrome/common/file_system/file_system_dispatcher.cc @@ -215,7 +215,8 @@ void FileSystemDispatcher::DidWrite( fileapi::FileSystemCallbackDispatcher* dispatcher = dispatchers_.Lookup(request_id); DCHECK(dispatcher); - dispatcher->DidWrite(bytes, complete); + // TODO(ericu): Coming soon. + // dispatcher->DidWrite(bytes, complete); if (complete) dispatchers_.Remove(request_id); } diff --git a/chrome/common/file_system/webfilesystem_callback_dispatcher.cc b/chrome/common/file_system/webfilesystem_callback_dispatcher.cc index bf8d901..c68ff18 100644 --- a/chrome/common/file_system/webfilesystem_callback_dispatcher.cc +++ b/chrome/common/file_system/webfilesystem_callback_dispatcher.cc @@ -18,6 +18,30 @@ using WebKit::WebFileSystemEntry; using WebKit::WebString; using WebKit::WebVector; +namespace { + +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; + } +} + +} + WebFileSystemCallbackDispatcher::WebFileSystemCallbackDispatcher( WebFileSystemCallbacks* callbacks) : callbacks_(callbacks) { @@ -32,11 +56,6 @@ void WebFileSystemCallbackDispatcher::DidReadMetadata( const base::PlatformFileInfo& file_info) { WebFileInfo web_file_info; web_file_info.modificationTime = file_info.last_modified.ToDoubleT(); - web_file_info.length = file_info.size; - if (file_info.is_directory) - web_file_info.type = WebFileInfo::TypeDirectory; - else - web_file_info.type = WebFileInfo::TypeFile; callbacks_->didReadMetadata(web_file_info); } @@ -59,11 +78,5 @@ void WebFileSystemCallbackDispatcher::DidOpenFileSystem( void WebFileSystemCallbackDispatcher::DidFail( base::PlatformFileError error_code) { - callbacks_->didFail( - webkit_glue::PlatformFileErrorToWebFileError(error_code)); + callbacks_->didFail(PlatformFileErrorToWebFileError(error_code)); } - -void WebFileSystemCallbackDispatcher::DidWrite(int64 bytes, bool complete) { - NOTREACHED(); -} - diff --git a/chrome/common/file_system/webfilesystem_callback_dispatcher.h b/chrome/common/file_system/webfilesystem_callback_dispatcher.h index 075d5bb..ade811b 100644 --- a/chrome/common/file_system/webfilesystem_callback_dispatcher.h +++ b/chrome/common/file_system/webfilesystem_callback_dispatcher.h @@ -34,7 +34,6 @@ class WebFileSystemCallbackDispatcher virtual void DidOpenFileSystem(const std::string&, const FilePath&); virtual void DidFail(base::PlatformFileError); - virtual void DidWrite(int64 bytes, bool complete); private: WebKit::WebFileSystemCallbacks* callbacks_; |