| Index: content/common/fileapi/webfilesystem_callback_dispatcher.cc
|
| diff --git a/content/common/fileapi/webfilesystem_callback_dispatcher.cc b/content/common/fileapi/webfilesystem_callback_dispatcher.cc
|
| index 24926c6f8b41e3c5dc2ca40bfe9e1fbb866d074e..30cf914459e1bf4ab0dc1cd6dc90d8b7739237d0 100644
|
| --- a/content/common/fileapi/webfilesystem_callback_dispatcher.cc
|
| +++ b/content/common/fileapi/webfilesystem_callback_dispatcher.cc
|
| @@ -33,13 +33,21 @@ WebFileSystemCallbackDispatcher::WebFileSystemCallbackDispatcher(
|
| DCHECK(callbacks_);
|
| }
|
|
|
| -void WebFileSystemCallbackDispatcher::DidSucceed() {
|
| - callbacks_->didSucceed();
|
| +void WebFileSystemCallbackDispatcher::DidFinish(base::PlatformFileError error) {
|
| + if (error == base::PLATFORM_FILE_OK)
|
| + callbacks_->didSucceed();
|
| + else
|
| + callbacks_->didFail(fileapi::PlatformFileErrorToWebFileError(error));
|
| }
|
|
|
| void WebFileSystemCallbackDispatcher::DidReadMetadata(
|
| + base::PlatformFileError error,
|
| const base::PlatformFileInfo& file_info,
|
| const base::FilePath& platform_path) {
|
| + if (error != base::PLATFORM_FILE_OK) {
|
| + callbacks_->didFail(fileapi::PlatformFileErrorToWebFileError(error));
|
| + return;
|
| + }
|
| WebFileInfo web_file_info;
|
| webkit_glue::PlatformFileInfoToWebFileInfo(file_info, &web_file_info);
|
| web_file_info.platformPath = webkit_base::FilePathToWebString(platform_path);
|
| @@ -47,8 +55,13 @@ void WebFileSystemCallbackDispatcher::DidReadMetadata(
|
| }
|
|
|
| void WebFileSystemCallbackDispatcher::DidCreateSnapshotFile(
|
| + base::PlatformFileError error,
|
| const base::PlatformFileInfo& file_info,
|
| const base::FilePath& platform_path) {
|
| + if (error != base::PLATFORM_FILE_OK) {
|
| + callbacks_->didFail(fileapi::PlatformFileErrorToWebFileError(error));
|
| + return;
|
| + }
|
| WebFileInfo web_file_info;
|
| webkit_glue::PlatformFileInfoToWebFileInfo(file_info, &web_file_info);
|
| web_file_info.platformPath = webkit_base::FilePathToWebString(platform_path);
|
| @@ -56,7 +69,13 @@ void WebFileSystemCallbackDispatcher::DidCreateSnapshotFile(
|
| }
|
|
|
| void WebFileSystemCallbackDispatcher::DidReadDirectory(
|
| - const std::vector<base::FileUtilProxy::Entry>& entries, bool has_more) {
|
| + base::PlatformFileError error,
|
| + const std::vector<base::FileUtilProxy::Entry>& entries,
|
| + bool has_more) {
|
| + if (error != base::PLATFORM_FILE_OK) {
|
| + callbacks_->didFail(fileapi::PlatformFileErrorToWebFileError(error));
|
| + return;
|
| + }
|
| WebVector<WebFileSystemEntry> file_system_entries(entries.size());
|
| for (size_t i = 0; i < entries.size(); i++) {
|
| file_system_entries[i].name =
|
| @@ -67,18 +86,13 @@ void WebFileSystemCallbackDispatcher::DidReadDirectory(
|
| }
|
|
|
| void WebFileSystemCallbackDispatcher::DidOpenFileSystem(
|
| + base::PlatformFileError error,
|
| const std::string& name, const GURL& root) {
|
| + if (error != base::PLATFORM_FILE_OK) {
|
| + callbacks_->didFail(fileapi::PlatformFileErrorToWebFileError(error));
|
| + return;
|
| + }
|
| callbacks_->didOpenFileSystem(UTF8ToUTF16(name), root);
|
| }
|
|
|
| -void WebFileSystemCallbackDispatcher::DidFail(
|
| - base::PlatformFileError error_code) {
|
| - callbacks_->didFail(
|
| - fileapi::PlatformFileErrorToWebFileError(error_code));
|
| -}
|
| -
|
| -void WebFileSystemCallbackDispatcher::DidWrite(int64 bytes, bool complete) {
|
| - NOTREACHED();
|
| -}
|
| -
|
| } // namespace content
|
|
|