Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(321)

Unified Diff: webkit/plugins/ppapi/ppb_file_system_impl.cc

Issue 7669055: Remove webkit::ppapi::Resource. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nulls auditeed Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/plugins/ppapi/ppb_file_system_impl.h ('k') | webkit/plugins/ppapi/ppb_flash_file_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « webkit/plugins/ppapi/ppb_file_system_impl.h ('k') | webkit/plugins/ppapi/ppb_flash_file_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698