diff options
author | raymes@chromium.org <raymes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-06 06:10:57 +0000 |
---|---|---|
committer | raymes@chromium.org <raymes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-06 06:10:57 +0000 |
commit | cd57d088c61b38881261c159792537e8b93eb6b8 (patch) | |
tree | b8623b5600833d4deeaca2b1617655c4ad2395c2 /ppapi/thunk/ppb_flash_file_modulelocal_thunk.cc | |
parent | 199e9257d7e6da23084e5ce1d971612bf8ad4c5a (diff) | |
download | chromium_src-cd57d088c61b38881261c159792537e8b93eb6b8.zip chromium_src-cd57d088c61b38881261c159792537e8b93eb6b8.tar.gz chromium_src-cd57d088c61b38881261c159792537e8b93eb6b8.tar.bz2 |
Revert 171389
The revert is causing browser tests to fail. Reverting the revert.
> Revert 171080
>
> > The refactors PPB_Flash_File_ModuleLocal/FileRef to the new resource model. Calls for both these interfaces are now made directly to the browser. This removes the in-process implementation for these interfaces also (as they are flash-only). Tests are added for PPB_Flash_File_ModuleLocal.
> >
> > Review URL: https://codereview.chromium.org/11359097
>
> TBR=raymes@chromium.org
>
> Review URL: https://codereview.chromium.org/11437038
TBR=raymes@chromium.org
Review URL: https://codereview.chromium.org/11450025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171408 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/thunk/ppb_flash_file_modulelocal_thunk.cc')
-rw-r--r-- | ppapi/thunk/ppb_flash_file_modulelocal_thunk.cc | 49 |
1 files changed, 18 insertions, 31 deletions
diff --git a/ppapi/thunk/ppb_flash_file_modulelocal_thunk.cc b/ppapi/thunk/ppb_flash_file_modulelocal_thunk.cc index 7e9678a..03d9032 100644 --- a/ppapi/thunk/ppb_flash_file_modulelocal_thunk.cc +++ b/ppapi/thunk/ppb_flash_file_modulelocal_thunk.cc @@ -5,8 +5,7 @@ #include "ppapi/c/pp_errors.h" #include "ppapi/c/private/ppb_flash_file.h" #include "ppapi/thunk/enter.h" -#include "ppapi/thunk/ppb_flash_api.h" -#include "ppapi/thunk/ppb_instance_api.h" +#include "ppapi/thunk/ppb_flash_file_api.h" #include "ppapi/thunk/thunk.h" namespace ppapi { @@ -15,89 +14,77 @@ namespace thunk { namespace { bool CreateThreadAdapterForInstance(PP_Instance instance) { - EnterInstance enter(instance); - if (enter.failed()) - return false; - return enter.functions()->GetFlashAPI()->CreateThreadAdapterForInstance( - instance); + return true; } void ClearThreadAdapterForInstance(PP_Instance instance) { - EnterInstance enter(instance); - if (enter.succeeded()) { - return enter.functions()->GetFlashAPI()->ClearThreadAdapterForInstance( - instance); - } } int32_t OpenFile(PP_Instance instance, const char* path, int32_t mode, PP_FileHandle* file) { - EnterInstance enter(instance); + EnterInstanceAPI<PPB_Flash_File_API> enter(instance); if (enter.failed()) return PP_ERROR_BADARGUMENT; - return enter.functions()->GetFlashAPI()->OpenFile(instance, path, mode, file); + return enter.functions()->OpenFile(instance, path, mode, file); } int32_t RenameFile(PP_Instance instance, const char* path_from, const char* path_to) { - EnterInstance enter(instance); + EnterInstanceAPI<PPB_Flash_File_API> enter(instance); if (enter.failed()) return PP_ERROR_BADARGUMENT; - return enter.functions()->GetFlashAPI()->RenameFile(instance, - path_from, path_to); + return enter.functions()->RenameFile(instance, path_from, path_to); } int32_t DeleteFileOrDir(PP_Instance instance, const char* path, PP_Bool recursive) { - EnterInstance enter(instance); + EnterInstanceAPI<PPB_Flash_File_API> enter(instance); if (enter.failed()) return PP_ERROR_BADARGUMENT; - return enter.functions()->GetFlashAPI()->DeleteFileOrDir(instance, path, - recursive); + return enter.functions()->DeleteFileOrDir(instance, path, recursive); } int32_t CreateDir(PP_Instance instance, const char* path) { - EnterInstance enter(instance); + EnterInstanceAPI<PPB_Flash_File_API> enter(instance); if (enter.failed()) return PP_ERROR_BADARGUMENT; - return enter.functions()->GetFlashAPI()->CreateDir(instance, path); + return enter.functions()->CreateDir(instance, path); } int32_t QueryFile(PP_Instance instance, const char* path, PP_FileInfo* info) { - EnterInstance enter(instance); + EnterInstanceAPI<PPB_Flash_File_API> enter(instance); if (enter.failed()) return PP_ERROR_BADARGUMENT; - return enter.functions()->GetFlashAPI()->QueryFile(instance, path, info); + return enter.functions()->QueryFile(instance, path, info); } int32_t GetDirContents(PP_Instance instance, const char* path, PP_DirContents_Dev** contents) { - EnterInstance enter(instance); + EnterInstanceAPI<PPB_Flash_File_API> enter(instance); if (enter.failed()) return PP_ERROR_BADARGUMENT; - return enter.functions()->GetFlashAPI()->GetDirContents(instance, path, - contents); + return enter.functions()->GetDirContents(instance, path, contents); } void FreeDirContents(PP_Instance instance, PP_DirContents_Dev* contents) { - EnterInstance enter(instance); + EnterInstanceAPI<PPB_Flash_File_API> enter(instance); if (enter.succeeded()) - enter.functions()->GetFlashAPI()->FreeDirContents(instance, contents); + enter.functions()->FreeDirContents(instance, contents); } int32_t CreateTemporaryFile(PP_Instance instance, PP_FileHandle* file) { - EnterInstance enter(instance); + EnterInstanceAPI<PPB_Flash_File_API> enter(instance); if (enter.failed()) return PP_ERROR_BADARGUMENT; *file = PP_kInvalidFileHandle; - return enter.functions()->GetFlashAPI()->CreateTemporaryFile(instance, file); + return enter.functions()->CreateTemporaryFile(instance, file); } const PPB_Flash_File_ModuleLocal_2_0 g_ppb_flash_file_modulelocal_thunk_2_0 = { |