summaryrefslogtreecommitdiffstats
path: root/webkit/plugins/ppapi/ppb_file_io_impl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'webkit/plugins/ppapi/ppb_file_io_impl.cc')
-rw-r--r--webkit/plugins/ppapi/ppb_file_io_impl.cc25
1 files changed, 19 insertions, 6 deletions
diff --git a/webkit/plugins/ppapi/ppb_file_io_impl.cc b/webkit/plugins/ppapi/ppb_file_io_impl.cc
index 624ced4..20a95db 100644
--- a/webkit/plugins/ppapi/ppb_file_io_impl.cc
+++ b/webkit/plugins/ppapi/ppb_file_io_impl.cc
@@ -253,13 +253,26 @@ int32_t PPB_FileIO_Impl::Open(PPB_FileRef_Impl* file_ref,
} else {
flags |= base::PLATFORM_FILE_OPEN;
}
-
file_system_type_ = file_ref->GetFileSystemType();
- if (!instance()->delegate()->AsyncOpenFile(
- file_ref->GetSystemPath(), flags,
- callback_factory_.NewCallback(
- &PPB_FileIO_Impl::AsyncOpenFileCallback)))
- return PP_ERROR_FAILED;
+ switch (file_system_type_) {
+ case PP_FILESYSTEMTYPE_EXTERNAL:
+ if (!instance()->delegate()->AsyncOpenFile(
+ file_ref->GetSystemPath(), flags,
+ callback_factory_.NewCallback(
+ &PPB_FileIO_Impl::AsyncOpenFileCallback)))
+ return PP_ERROR_FAILED;
+ break;
+ case PP_FILESYSTEMTYPE_LOCALPERSISTENT:
+ case PP_FILESYSTEMTYPE_LOCALTEMPORARY:
+ if (!instance()->delegate()->AsyncOpenFileSystemURL(
+ file_ref->GetFileSystemURL(), flags,
+ callback_factory_.NewCallback(
+ &PPB_FileIO_Impl::AsyncOpenFileCallback)))
+ return PP_ERROR_FAILED;
+ break;
+ default:
+ return PP_ERROR_FAILED;
+ }
RegisterCallback(callback);
return PP_OK_COMPLETIONPENDING;