summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ppapi/c/private/ppb_flash_file.h25
-rw-r--r--ppapi/cpp/private/flash_file.cc66
-rw-r--r--ppapi/thunk/interfaces_ppb_private_flash.h3
-rw-r--r--ppapi/thunk/ppb_flash_file_modulelocal_thunk.cc17
4 files changed, 1 insertions, 110 deletions
diff --git a/ppapi/c/private/ppb_flash_file.h b/ppapi/c/private/ppb_flash_file.h
index 758056f..c5aeeaf 100644
--- a/ppapi/c/private/ppb_flash_file.h
+++ b/ppapi/c/private/ppb_flash_file.h
@@ -23,7 +23,6 @@ struct PP_DirContents_Dev {
};
// PPB_Flash_File_ModuleLocal --------------------------------------------------
-#define PPB_FLASH_FILE_MODULELOCAL_INTERFACE_2_0 "PPB_Flash_File_ModuleLocal;2"
#define PPB_FLASH_FILE_MODULELOCAL_INTERFACE_3_0 "PPB_Flash_File_ModuleLocal;3"
#define PPB_FLASH_FILE_MODULELOCAL_INTERFACE \
PPB_FLASH_FILE_MODULELOCAL_INTERFACE_3_0
@@ -99,30 +98,6 @@ struct PPB_Flash_File_ModuleLocal_3_0 {
int32_t (*CreateTemporaryFile)(PP_Instance instance, PP_FileHandle* file);
};
-struct PPB_Flash_File_ModuleLocal_2_0 {
- bool (*CreateThreadAdapterForInstance)(PP_Instance instance);
- void (*ClearThreadAdapterForInstance)(PP_Instance instance);
- int32_t (*OpenFile)(PP_Instance instance,
- const char* path,
- int32_t mode,
- PP_FileHandle* file);
- int32_t (*RenameFile)(PP_Instance instance,
- const char* path_from,
- const char* path_to);
- int32_t (*DeleteFileOrDir)(PP_Instance instance,
- const char* path,
- PP_Bool recursive);
- int32_t (*CreateDir)(PP_Instance instance, const char* path);
- int32_t (*QueryFile)(PP_Instance instance,
- const char* path,
- struct PP_FileInfo* info);
- int32_t (*GetDirContents)(PP_Instance instance,
- const char* path,
- struct PP_DirContents_Dev** contents);
- void (*FreeDirContents)(PP_Instance instance,
- struct PP_DirContents_Dev* contents);
-};
-
typedef struct PPB_Flash_File_ModuleLocal_3_0 PPB_Flash_File_ModuleLocal;
// PPB_Flash_File_FileRef ------------------------------------------------------
diff --git a/ppapi/cpp/private/flash_file.cc b/ppapi/cpp/private/flash_file.cc
index 2aea2c3..7004b98 100644
--- a/ppapi/cpp/private/flash_file.cc
+++ b/ppapi/cpp/private/flash_file.cc
@@ -20,10 +20,6 @@ template <> const char* interface_name<PPB_Flash_File_ModuleLocal_3_0>() {
return PPB_FLASH_FILE_MODULELOCAL_INTERFACE_3_0;
}
-template <> const char* interface_name<PPB_Flash_File_ModuleLocal_2_0>() {
- return PPB_FLASH_FILE_MODULELOCAL_INTERFACE_2_0;
-}
-
} // namespace
namespace flash {
@@ -35,34 +31,7 @@ static FileModuleLocal::DirEntry ConvertDirEntry(const PP_DirEntry_Dev& entry) {
// static
bool FileModuleLocal::IsAvailable() {
- return has_interface<PPB_Flash_File_ModuleLocal_3_0>() ||
- has_interface<PPB_Flash_File_ModuleLocal_2_0>();
-}
-
-// static
-bool FileModuleLocal::CreateThreadAdapterForInstance(
- const InstanceHandle& instance) {
- bool rv = false;
- if (has_interface<PPB_Flash_File_ModuleLocal_3_0>()) {
- rv = get_interface<PPB_Flash_File_ModuleLocal_3_0>()->
- CreateThreadAdapterForInstance(instance.pp_instance());
- } else if (has_interface<PPB_Flash_File_ModuleLocal_2_0>()) {
- rv = get_interface<PPB_Flash_File_ModuleLocal_2_0>()->
- CreateThreadAdapterForInstance( instance.pp_instance());
- }
- return rv;
-}
-
-// static
-void FileModuleLocal::ClearThreadAdapterForInstance(
- const InstanceHandle& instance) {
- if (has_interface<PPB_Flash_File_ModuleLocal_3_0>()) {
- get_interface<PPB_Flash_File_ModuleLocal_3_0>()->
- ClearThreadAdapterForInstance(instance.pp_instance());
- } else if (has_interface<PPB_Flash_File_ModuleLocal_2_0>()) {
- get_interface<PPB_Flash_File_ModuleLocal_2_0>()->
- ClearThreadAdapterForInstance(instance.pp_instance());
- }
+ return has_interface<PPB_Flash_File_ModuleLocal_3_0>();
}
// static
@@ -74,9 +43,6 @@ PP_FileHandle FileModuleLocal::OpenFile(const InstanceHandle& instance,
if (has_interface<PPB_Flash_File_ModuleLocal_3_0>()) {
result = get_interface<PPB_Flash_File_ModuleLocal_3_0>()->
OpenFile(instance.pp_instance(), path.c_str(), mode, &file_handle);
- } else if (has_interface<PPB_Flash_File_ModuleLocal_2_0>()) {
- result = get_interface<PPB_Flash_File_ModuleLocal_2_0>()->
- OpenFile(instance.pp_instance(), path.c_str(), mode, &file_handle);
}
return (result == PP_OK) ? file_handle : PP_kInvalidFileHandle;
}
@@ -89,9 +55,6 @@ bool FileModuleLocal::RenameFile(const InstanceHandle& instance,
if (has_interface<PPB_Flash_File_ModuleLocal_3_0>()) {
result = get_interface<PPB_Flash_File_ModuleLocal_3_0>()->
RenameFile(instance.pp_instance(), path_from.c_str(), path_to.c_str());
- } else if (has_interface<PPB_Flash_File_ModuleLocal_2_0>()) {
- result = get_interface<PPB_Flash_File_ModuleLocal_2_0>()->
- RenameFile(instance.pp_instance(), path_from.c_str(), path_to.c_str());
}
return result == PP_OK;
}
@@ -105,10 +68,6 @@ bool FileModuleLocal::DeleteFileOrDir(const InstanceHandle& instance,
result = get_interface<PPB_Flash_File_ModuleLocal_3_0>()->
DeleteFileOrDir(instance.pp_instance(), path.c_str(),
PP_FromBool(recursive));
- } else if (has_interface<PPB_Flash_File_ModuleLocal_2_0>()) {
- result = get_interface<PPB_Flash_File_ModuleLocal_2_0>()->
- DeleteFileOrDir(instance.pp_instance(), path.c_str(),
- PP_FromBool(recursive));
}
return result == PP_OK;
}
@@ -120,9 +79,6 @@ bool FileModuleLocal::CreateDir(const InstanceHandle& instance,
if (has_interface<PPB_Flash_File_ModuleLocal_3_0>()) {
result = get_interface<PPB_Flash_File_ModuleLocal_3_0>()->
CreateDir(instance.pp_instance(), path.c_str());
- } else if (has_interface<PPB_Flash_File_ModuleLocal_2_0>()) {
- result = get_interface<PPB_Flash_File_ModuleLocal_2_0>()->
- CreateDir(instance.pp_instance(), path.c_str());
}
return result == PP_OK;
}
@@ -135,9 +91,6 @@ bool FileModuleLocal::QueryFile(const InstanceHandle& instance,
if (has_interface<PPB_Flash_File_ModuleLocal_3_0>()) {
result = get_interface<PPB_Flash_File_ModuleLocal_3_0>()->
QueryFile(instance.pp_instance(), path.c_str(), info);
- } else if (has_interface<PPB_Flash_File_ModuleLocal_2_0>()) {
- result = get_interface<PPB_Flash_File_ModuleLocal_2_0>()->
- QueryFile(instance.pp_instance(), path.c_str(), info);
}
return result == PP_OK;
}
@@ -162,28 +115,11 @@ bool FileModuleLocal::GetDirContents(
get_interface<PPB_Flash_File_ModuleLocal_3_0>()->
FreeDirContents(instance.pp_instance(), contents);
}
- } else if (has_interface<PPB_Flash_File_ModuleLocal_2_0>()) {
- PP_DirContents_Dev* contents = NULL;
- result = get_interface<PPB_Flash_File_ModuleLocal_2_0>()->
- GetDirContents(instance.pp_instance(), path.c_str(), &contents);
- if (result == PP_OK && contents) {
- for (int32_t i = 0; i < contents->count; i++)
- dir_contents->push_back(ConvertDirEntry(contents->entries[i]));
- }
- if (contents) {
- get_interface<PPB_Flash_File_ModuleLocal_2_0>()->
- FreeDirContents(instance.pp_instance(), contents);
- }
}
return result == PP_OK;
}
// static
-bool FileModuleLocal::IsCreateTemporaryFileAvailable() {
- return has_interface<PPB_Flash_File_ModuleLocal_3_0>();
-}
-
-// static
PP_FileHandle FileModuleLocal::CreateTemporaryFile(
const InstanceHandle& instance) {
PP_FileHandle file_handle = PP_kInvalidFileHandle;
diff --git a/ppapi/thunk/interfaces_ppb_private_flash.h b/ppapi/thunk/interfaces_ppb_private_flash.h
index ec2147d..eb42315 100644
--- a/ppapi/thunk/interfaces_ppb_private_flash.h
+++ b/ppapi/thunk/interfaces_ppb_private_flash.h
@@ -22,9 +22,6 @@ PROXIED_IFACE(PPB_Flash,
PPB_Flash_13_0)
PROXIED_IFACE(PPB_Flash,
- PPB_FLASH_FILE_MODULELOCAL_INTERFACE_2_0,
- PPB_Flash_File_ModuleLocal_2_0)
-PROXIED_IFACE(PPB_Flash,
PPB_FLASH_FILE_MODULELOCAL_INTERFACE_3_0,
PPB_Flash_File_ModuleLocal_3_0)
PROXIED_IFACE(PPB_Flash,
diff --git a/ppapi/thunk/ppb_flash_file_modulelocal_thunk.cc b/ppapi/thunk/ppb_flash_file_modulelocal_thunk.cc
index 7e9678a..70c45d4 100644
--- a/ppapi/thunk/ppb_flash_file_modulelocal_thunk.cc
+++ b/ppapi/thunk/ppb_flash_file_modulelocal_thunk.cc
@@ -100,18 +100,6 @@ int32_t CreateTemporaryFile(PP_Instance instance, PP_FileHandle* file) {
return enter.functions()->GetFlashAPI()->CreateTemporaryFile(instance, file);
}
-const PPB_Flash_File_ModuleLocal_2_0 g_ppb_flash_file_modulelocal_thunk_2_0 = {
- &CreateThreadAdapterForInstance,
- &ClearThreadAdapterForInstance,
- &OpenFile,
- &RenameFile,
- &DeleteFileOrDir,
- &CreateDir,
- &QueryFile,
- &GetDirContents,
- &FreeDirContents
-};
-
const PPB_Flash_File_ModuleLocal_3_0 g_ppb_flash_file_modulelocal_thunk_3_0 = {
&CreateThreadAdapterForInstance,
&ClearThreadAdapterForInstance,
@@ -127,11 +115,6 @@ const PPB_Flash_File_ModuleLocal_3_0 g_ppb_flash_file_modulelocal_thunk_3_0 = {
} // namespace
-const PPB_Flash_File_ModuleLocal_2_0*
- GetPPB_Flash_File_ModuleLocal_2_0_Thunk() {
- return &g_ppb_flash_file_modulelocal_thunk_2_0;
-}
-
const PPB_Flash_File_ModuleLocal_3_0*
GetPPB_Flash_File_ModuleLocal_3_0_Thunk() {
return &g_ppb_flash_file_modulelocal_thunk_3_0;