| Index: ppapi/thunk/ppb_flash_file_modulelocal_thunk.cc
|
| ===================================================================
|
| --- ppapi/thunk/ppb_flash_file_modulelocal_thunk.cc (revision 171259)
|
| +++ ppapi/thunk/ppb_flash_file_modulelocal_thunk.cc (working copy)
|
| @@ -5,7 +5,8 @@
|
| #include "ppapi/c/pp_errors.h"
|
| #include "ppapi/c/private/ppb_flash_file.h"
|
| #include "ppapi/thunk/enter.h"
|
| -#include "ppapi/thunk/ppb_flash_file_api.h"
|
| +#include "ppapi/thunk/ppb_flash_api.h"
|
| +#include "ppapi/thunk/ppb_instance_api.h"
|
| #include "ppapi/thunk/thunk.h"
|
|
|
| namespace ppapi {
|
| @@ -14,77 +15,89 @@
|
| namespace {
|
|
|
| bool CreateThreadAdapterForInstance(PP_Instance instance) {
|
| - return true;
|
| + EnterInstance enter(instance);
|
| + if (enter.failed())
|
| + return false;
|
| + return enter.functions()->GetFlashAPI()->CreateThreadAdapterForInstance(
|
| + instance);
|
| }
|
|
|
| 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) {
|
| - EnterInstanceAPI<PPB_Flash_File_API> enter(instance);
|
| + EnterInstance enter(instance);
|
| if (enter.failed())
|
| return PP_ERROR_BADARGUMENT;
|
| - return enter.functions()->OpenFile(instance, path, mode, file);
|
| + return enter.functions()->GetFlashAPI()->OpenFile(instance, path, mode, file);
|
| }
|
|
|
| int32_t RenameFile(PP_Instance instance,
|
| const char* path_from,
|
| const char* path_to) {
|
| - EnterInstanceAPI<PPB_Flash_File_API> enter(instance);
|
| + EnterInstance enter(instance);
|
| if (enter.failed())
|
| return PP_ERROR_BADARGUMENT;
|
| - return enter.functions()->RenameFile(instance, path_from, path_to);
|
| + return enter.functions()->GetFlashAPI()->RenameFile(instance,
|
| + path_from, path_to);
|
| }
|
|
|
| int32_t DeleteFileOrDir(PP_Instance instance,
|
| const char* path,
|
| PP_Bool recursive) {
|
| - EnterInstanceAPI<PPB_Flash_File_API> enter(instance);
|
| + EnterInstance enter(instance);
|
| if (enter.failed())
|
| return PP_ERROR_BADARGUMENT;
|
| - return enter.functions()->DeleteFileOrDir(instance, path, recursive);
|
| + return enter.functions()->GetFlashAPI()->DeleteFileOrDir(instance, path,
|
| + recursive);
|
| }
|
|
|
| int32_t CreateDir(PP_Instance instance, const char* path) {
|
| - EnterInstanceAPI<PPB_Flash_File_API> enter(instance);
|
| + EnterInstance enter(instance);
|
| if (enter.failed())
|
| return PP_ERROR_BADARGUMENT;
|
| - return enter.functions()->CreateDir(instance, path);
|
| + return enter.functions()->GetFlashAPI()->CreateDir(instance, path);
|
| }
|
|
|
| int32_t QueryFile(PP_Instance instance, const char* path, PP_FileInfo* info) {
|
| - EnterInstanceAPI<PPB_Flash_File_API> enter(instance);
|
| + EnterInstance enter(instance);
|
| if (enter.failed())
|
| return PP_ERROR_BADARGUMENT;
|
| - return enter.functions()->QueryFile(instance, path, info);
|
| + return enter.functions()->GetFlashAPI()->QueryFile(instance, path, info);
|
| }
|
|
|
| int32_t GetDirContents(PP_Instance instance,
|
| const char* path,
|
| PP_DirContents_Dev** contents) {
|
| - EnterInstanceAPI<PPB_Flash_File_API> enter(instance);
|
| + EnterInstance enter(instance);
|
| if (enter.failed())
|
| return PP_ERROR_BADARGUMENT;
|
| - return enter.functions()->GetDirContents(instance, path, contents);
|
| + return enter.functions()->GetFlashAPI()->GetDirContents(instance, path,
|
| + contents);
|
| }
|
|
|
| void FreeDirContents(PP_Instance instance,
|
| PP_DirContents_Dev* contents) {
|
| - EnterInstanceAPI<PPB_Flash_File_API> enter(instance);
|
| + EnterInstance enter(instance);
|
| if (enter.succeeded())
|
| - enter.functions()->FreeDirContents(instance, contents);
|
| + enter.functions()->GetFlashAPI()->FreeDirContents(instance, contents);
|
| }
|
|
|
| int32_t CreateTemporaryFile(PP_Instance instance, PP_FileHandle* file) {
|
| - EnterInstanceAPI<PPB_Flash_File_API> enter(instance);
|
| + EnterInstance enter(instance);
|
| if (enter.failed())
|
| return PP_ERROR_BADARGUMENT;
|
|
|
| *file = PP_kInvalidFileHandle;
|
| - return enter.functions()->CreateTemporaryFile(instance, file);
|
| + return enter.functions()->GetFlashAPI()->CreateTemporaryFile(instance, file);
|
| }
|
|
|
| const PPB_Flash_File_ModuleLocal_2_0 g_ppb_flash_file_modulelocal_thunk_2_0 = {
|
|
|