From 904de379dc61ba726bca2b9ec7f597574eadf4fc Mon Sep 17 00:00:00 2001 From: "raymes@chromium.org" Date: Fri, 7 Dec 2012 23:33:43 +0000 Subject: Remove PPB_Flash_File_ModuleLocal_2_0. PPB_Flash_File_ModuleLocal_2_0 was replaced in Flash by version 3_0 in M21 and can be removed. BUG= Review URL: https://codereview.chromium.org/11472036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171879 0039d316-1c4b-4281-b951-d872f2087c98 --- ppapi/c/private/ppb_flash_file.h | 25 ---------- ppapi/cpp/private/flash_file.cc | 66 +------------------------ ppapi/cpp/private/flash_file.h | 6 --- ppapi/tests/test_flash_file.cc | 2 - ppapi/thunk/interfaces_ppb_private_flash.h | 3 -- ppapi/thunk/ppb_flash_file_modulelocal_thunk.cc | 17 ------- 6 files changed, 1 insertion(+), 118 deletions(-) (limited to 'ppapi') 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() { return PPB_FLASH_FILE_MODULELOCAL_INTERFACE_3_0; } -template <> const char* interface_name() { - 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() || - has_interface(); -} - -// static -bool FileModuleLocal::CreateThreadAdapterForInstance( - const InstanceHandle& instance) { - bool rv = false; - if (has_interface()) { - rv = get_interface()-> - CreateThreadAdapterForInstance(instance.pp_instance()); - } else if (has_interface()) { - rv = get_interface()-> - CreateThreadAdapterForInstance( instance.pp_instance()); - } - return rv; -} - -// static -void FileModuleLocal::ClearThreadAdapterForInstance( - const InstanceHandle& instance) { - if (has_interface()) { - get_interface()-> - ClearThreadAdapterForInstance(instance.pp_instance()); - } else if (has_interface()) { - get_interface()-> - ClearThreadAdapterForInstance(instance.pp_instance()); - } + return has_interface(); } // static @@ -74,9 +43,6 @@ PP_FileHandle FileModuleLocal::OpenFile(const InstanceHandle& instance, if (has_interface()) { result = get_interface()-> OpenFile(instance.pp_instance(), path.c_str(), mode, &file_handle); - } else if (has_interface()) { - result = get_interface()-> - 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()) { result = get_interface()-> RenameFile(instance.pp_instance(), path_from.c_str(), path_to.c_str()); - } else if (has_interface()) { - result = get_interface()-> - 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()-> DeleteFileOrDir(instance.pp_instance(), path.c_str(), PP_FromBool(recursive)); - } else if (has_interface()) { - result = get_interface()-> - 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()) { result = get_interface()-> CreateDir(instance.pp_instance(), path.c_str()); - } else if (has_interface()) { - result = get_interface()-> - CreateDir(instance.pp_instance(), path.c_str()); } return result == PP_OK; } @@ -135,9 +91,6 @@ bool FileModuleLocal::QueryFile(const InstanceHandle& instance, if (has_interface()) { result = get_interface()-> QueryFile(instance.pp_instance(), path.c_str(), info); - } else if (has_interface()) { - result = get_interface()-> - QueryFile(instance.pp_instance(), path.c_str(), info); } return result == PP_OK; } @@ -162,28 +115,11 @@ bool FileModuleLocal::GetDirContents( get_interface()-> FreeDirContents(instance.pp_instance(), contents); } - } else if (has_interface()) { - PP_DirContents_Dev* contents = NULL; - result = get_interface()-> - 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()-> - FreeDirContents(instance.pp_instance(), contents); - } } return result == PP_OK; } // static -bool FileModuleLocal::IsCreateTemporaryFileAvailable() { - return has_interface(); -} - -// static PP_FileHandle FileModuleLocal::CreateTemporaryFile( const InstanceHandle& instance) { PP_FileHandle file_handle = PP_kInvalidFileHandle; diff --git a/ppapi/cpp/private/flash_file.h b/ppapi/cpp/private/flash_file.h index a7c655a..04ab195 100644 --- a/ppapi/cpp/private/flash_file.h +++ b/ppapi/cpp/private/flash_file.h @@ -24,9 +24,6 @@ class FileModuleLocal { // Returns true if the required interface is available. static bool IsAvailable(); - static bool CreateThreadAdapterForInstance(const InstanceHandle& instance); - static void ClearThreadAdapterForInstance(const InstanceHandle& instance); - // Returns |PP_kInvalidFileHandle| on error. static PP_FileHandle OpenFile(const InstanceHandle& instance, const std::string& path, @@ -51,9 +48,6 @@ class FileModuleLocal { const std::string& path, std::vector* dir_contents); - // Returns true if |CreateTemporaryFile()| is supported. - // TODO(viettrungluu): Remove this sometime after M21 ships to Stable? - static bool IsCreateTemporaryFileAvailable(); // Returns |PP_kInvalidFileHandle| on error. static PP_FileHandle CreateTemporaryFile(const InstanceHandle& instance); }; diff --git a/ppapi/tests/test_flash_file.cc b/ppapi/tests/test_flash_file.cc index ac88b34..a4a1169 100644 --- a/ppapi/tests/test_flash_file.cc +++ b/ppapi/tests/test_flash_file.cc @@ -94,8 +94,6 @@ void TestFlashFile::RunTests(const std::string& filter) { } std::string TestFlashFile::TestCreateTemporaryFile() { - ASSERT_TRUE(FileModuleLocal::IsCreateTemporaryFileAvailable()); - // Make sure that the root directory exists. FileModuleLocal::CreateDir(instance_, std::string()); 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; -- cgit v1.1