summaryrefslogtreecommitdiffstats
path: root/content/renderer/pepper/ppb_file_ref_impl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'content/renderer/pepper/ppb_file_ref_impl.cc')
-rw-r--r--content/renderer/pepper/ppb_file_ref_impl.cc38
1 files changed, 22 insertions, 16 deletions
diff --git a/content/renderer/pepper/ppb_file_ref_impl.cc b/content/renderer/pepper/ppb_file_ref_impl.cc
index 9a97bed..e0e2edc 100644
--- a/content/renderer/pepper/ppb_file_ref_impl.cc
+++ b/content/renderer/pepper/ppb_file_ref_impl.cc
@@ -9,9 +9,9 @@
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "content/renderer/pepper/common.h"
+#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
#include "content/renderer/pepper/plugin_delegate.h"
#include "content/renderer/pepper/plugin_module.h"
-#include "content/renderer/pepper/ppapi_plugin_instance_impl.h"
#include "content/renderer/pepper/resource_helper.h"
#include "net/base/escape.h"
#include "ppapi/c/pp_errors.h"
@@ -33,8 +33,7 @@ using ppapi::thunk::EnterResourceNoLock;
using ppapi::thunk::PPB_FileRef_API;
using ppapi::thunk::PPB_FileSystem_API;
-namespace webkit {
-namespace ppapi {
+namespace content {
namespace {
@@ -232,7 +231,7 @@ PPB_FileRef_Impl::~PPB_FileRef_Impl() {
PPB_FileRef_Impl* PPB_FileRef_Impl::CreateInternal(PP_Instance instance,
PP_Resource pp_file_system,
const std::string& path) {
- PluginInstanceImpl* plugin_instance =
+ PepperPluginInstanceImpl* plugin_instance =
ResourceHelper::PPInstanceToPluginInstance(instance);
if (!plugin_instance || !plugin_instance->delegate())
return 0;
@@ -309,7 +308,8 @@ int32_t PPB_FileRef_Impl::MakeDirectory(
if (!IsValidNonExternalFileSystem())
return PP_ERROR_NOACCESS;
- PluginInstanceImpl* plugin_instance = ResourceHelper::GetPluginInstance(this);
+ PepperPluginInstanceImpl* plugin_instance =
+ ResourceHelper::GetPluginInstance(this);
if (!plugin_instance)
return PP_ERROR_FAILED;
plugin_instance->delegate()->MakeDirectory(
@@ -324,7 +324,8 @@ int32_t PPB_FileRef_Impl::Touch(PP_Time last_access_time,
if (!IsValidNonExternalFileSystem())
return PP_ERROR_NOACCESS;
- PluginInstanceImpl* plugin_instance = ResourceHelper::GetPluginInstance(this);
+ PepperPluginInstanceImpl* plugin_instance =
+ ResourceHelper::GetPluginInstance(this);
if (!plugin_instance)
return PP_ERROR_FAILED;
plugin_instance->delegate()->Touch(
@@ -339,7 +340,8 @@ int32_t PPB_FileRef_Impl::Delete(scoped_refptr<TrackedCallback> callback) {
if (!IsValidNonExternalFileSystem())
return PP_ERROR_NOACCESS;
- PluginInstanceImpl* plugin_instance = ResourceHelper::GetPluginInstance(this);
+ PepperPluginInstanceImpl* plugin_instance =
+ ResourceHelper::GetPluginInstance(this);
if (!plugin_instance)
return PP_ERROR_FAILED;
plugin_instance->delegate()->Delete(
@@ -362,7 +364,8 @@ int32_t PPB_FileRef_Impl::Rename(PP_Resource new_pp_file_ref,
// TODO(viettrungluu): Also cancel when the new file ref is destroyed?
// http://crbug.com/67624
- PluginInstanceImpl* plugin_instance = ResourceHelper::GetPluginInstance(this);
+ PepperPluginInstanceImpl* plugin_instance =
+ ResourceHelper::GetPluginInstance(this);
if (!plugin_instance)
return PP_ERROR_FAILED;
plugin_instance->delegate()->Rename(
@@ -405,7 +408,8 @@ GURL PPB_FileRef_Impl::GetFileSystemURL() const {
// We need to trim off the '/' before calling Resolve, as FileSystem URLs
// start with a storage type identifier that looks like a path segment.
- PluginInstanceImpl* plugin_instance = ResourceHelper::GetPluginInstance(this);
+ PepperPluginInstanceImpl* plugin_instance =
+ ResourceHelper::GetPluginInstance(this);
PluginDelegate* delegate =
plugin_instance ? plugin_instance->delegate() : NULL;
if (!delegate)
@@ -415,7 +419,8 @@ GURL PPB_FileRef_Impl::GetFileSystemURL() const {
}
bool PPB_FileRef_Impl::IsValidNonExternalFileSystem() const {
- PluginInstanceImpl* plugin_instance = ResourceHelper::GetPluginInstance(this);
+ PepperPluginInstanceImpl* plugin_instance =
+ ResourceHelper::GetPluginInstance(this);
PluginDelegate* delegate =
plugin_instance ? plugin_instance->delegate() : NULL;
return delegate &&
@@ -425,7 +430,8 @@ bool PPB_FileRef_Impl::IsValidNonExternalFileSystem() const {
}
bool PPB_FileRef_Impl::HasValidFileSystem() const {
- PluginInstanceImpl* plugin_instance = ResourceHelper::GetPluginInstance(this);
+ PepperPluginInstanceImpl* plugin_instance =
+ ResourceHelper::GetPluginInstance(this);
PluginDelegate* delegate =
plugin_instance ? plugin_instance->delegate() : NULL;
return delegate && delegate->IsFileSystemOpened(pp_instance(), file_system_);
@@ -440,7 +446,7 @@ int32_t PPB_FileRef_Impl::Query(PP_FileInfo* info,
int32_t PPB_FileRef_Impl::QueryInHost(
linked_ptr<PP_FileInfo> info,
scoped_refptr<TrackedCallback> callback) {
- scoped_refptr<PluginInstanceImpl> plugin_instance =
+ scoped_refptr<PepperPluginInstanceImpl> plugin_instance =
ResourceHelper::GetPluginInstance(this);
if (!plugin_instance.get())
return PP_ERROR_FAILED;
@@ -462,7 +468,7 @@ int32_t PPB_FileRef_Impl::QueryInHost(
if (!HasValidFileSystem())
return PP_ERROR_NOACCESS;
- PluginInstanceImpl* plugin_instance =
+ PepperPluginInstanceImpl* plugin_instance =
ResourceHelper::GetPluginInstance(this);
PluginDelegate* delegate =
plugin_instance ? plugin_instance->delegate() : NULL;
@@ -493,7 +499,8 @@ int32_t PPB_FileRef_Impl::ReadDirectoryEntriesInHost(
if (!IsValidNonExternalFileSystem())
return PP_ERROR_NOACCESS;
- PluginInstanceImpl* plugin_instance = ResourceHelper::GetPluginInstance(this);
+ PepperPluginInstanceImpl* plugin_instance =
+ ResourceHelper::GetPluginInstance(this);
if (!plugin_instance)
return PP_ERROR_FAILED;
@@ -507,5 +514,4 @@ int32_t PPB_FileRef_Impl::ReadDirectoryEntriesInHost(
return PP_OK_COMPLETIONPENDING;
}
-} // namespace ppapi
-} // namespace webkit
+} // namespace content