Index: webkit/plugins/ppapi/ppb_file_system_impl.cc |
diff --git a/webkit/plugins/ppapi/ppb_file_system_impl.cc b/webkit/plugins/ppapi/ppb_file_system_impl.cc |
index 2a4bb05f7876e52ecc6d0e5bfc4d023d886c6216..ac9f900f6f09b51cd6c33b8101bc4206a8c834af 100644 |
--- a/webkit/plugins/ppapi/ppb_file_system_impl.cc |
+++ b/webkit/plugins/ppapi/ppb_file_system_impl.cc |
@@ -18,18 +18,16 @@ |
#include "webkit/plugins/ppapi/plugin_module.h" |
#include "webkit/plugins/ppapi/ppapi_plugin_instance.h" |
#include "webkit/plugins/ppapi/ppb_directory_reader_impl.h" |
-#include "webkit/plugins/ppapi/resource.h" |
-#include "webkit/plugins/ppapi/resource_tracker.h" |
+#include "webkit/plugins/ppapi/resource_helper.h" |
using ppapi::thunk::PPB_FileSystem_API; |
namespace webkit { |
namespace ppapi { |
-PPB_FileSystem_Impl::PPB_FileSystem_Impl(PluginInstance* instance, |
+PPB_FileSystem_Impl::PPB_FileSystem_Impl(PP_Instance instance, |
PP_FileSystemType type) |
: Resource(instance), |
- instance_(instance), |
type_(type), |
opened_(false), |
called_open_(false) { |
@@ -40,7 +38,7 @@ PPB_FileSystem_Impl::~PPB_FileSystem_Impl() { |
} |
// static |
-PP_Resource PPB_FileSystem_Impl::Create(PluginInstance* instance, |
+PP_Resource PPB_FileSystem_Impl::Create(PP_Instance instance, |
PP_FileSystemType type) { |
if (type != PP_FILESYSTEMTYPE_EXTERNAL && |
type != PP_FILESYSTEMTYPE_LOCALPERSISTENT && |
@@ -64,14 +62,18 @@ int32_t PPB_FileSystem_Impl::Open(int64_t expected_size, |
type_ != PP_FILESYSTEMTYPE_LOCALTEMPORARY) |
return PP_ERROR_FAILED; |
+ PluginInstance* plugin_instance = ResourceHelper::GetPluginInstance(this); |
+ if (!plugin_instance) |
+ return PP_ERROR_FAILED; |
+ |
fileapi::FileSystemType file_system_type = |
(type_ == PP_FILESYSTEMTYPE_LOCALTEMPORARY ? |
fileapi::kFileSystemTypeTemporary : |
fileapi::kFileSystemTypePersistent); |
- if (!instance()->delegate()->OpenFileSystem( |
- instance()->container()->element().document().url(), |
+ if (!plugin_instance->delegate()->OpenFileSystem( |
+ plugin_instance->container()->element().document().url(), |
file_system_type, expected_size, |
- new FileCallbacks(instance()->module()->AsWeakPtr(), |
+ new FileCallbacks(plugin_instance->module()->AsWeakPtr(), |
pp_resource(), callback, NULL, |
scoped_refptr<PPB_FileSystem_Impl>(this), NULL))) |
return PP_ERROR_FAILED; |