diff options
Diffstat (limited to 'ppapi/cpp/private/flash_file.cc')
-rw-r--r-- | ppapi/cpp/private/flash_file.cc | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/ppapi/cpp/private/flash_file.cc b/ppapi/cpp/private/flash_file.cc index a38f007..2aea2c3 100644 --- a/ppapi/cpp/private/flash_file.cc +++ b/ppapi/cpp/private/flash_file.cc @@ -40,6 +40,32 @@ bool FileModuleLocal::IsAvailable() { } // 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()); + } +} + +// static PP_FileHandle FileModuleLocal::OpenFile(const InstanceHandle& instance, const std::string& path, int32_t mode) { @@ -153,6 +179,11 @@ bool FileModuleLocal::GetDirContents( } // 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; |