Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(147)

Unified Diff: ppapi/thunk/ppb_flash_file_modulelocal_thunk.cc

Issue 11359097: Refactored the PPB_Flash_File_ModuleLocal/FileRef to the new ppapi resource model (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ppapi/thunk/ppb_flash_file_modulelocal_thunk.cc
diff --git a/ppapi/thunk/ppb_flash_file_modulelocal_thunk.cc b/ppapi/thunk/ppb_flash_file_modulelocal_thunk.cc
index 7e9678a91e76d23e8777c6884152a75a3bf2992f..1399c14bb304b5280e58e060a3848007bcb0e0eb 100644
--- a/ppapi/thunk/ppb_flash_file_modulelocal_thunk.cc
+++ b/ppapi/thunk/ppb_flash_file_modulelocal_thunk.cc
@@ -5,7 +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_flash_file_api.h"
#include "ppapi/thunk/ppb_instance_api.h"
#include "ppapi/thunk/thunk.h"
@@ -15,19 +15,10 @@ 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,
@@ -37,7 +28,8 @@ int32_t OpenFile(PP_Instance instance,
EnterInstance enter(instance);
if (enter.failed())
return PP_ERROR_BADARGUMENT;
- return enter.functions()->GetFlashAPI()->OpenFile(instance, path, mode, file);
+ return enter.functions()->GetFlashFileAPI(instance)->OpenFile(
+ instance, path, mode, file);
}
int32_t RenameFile(PP_Instance instance,
@@ -46,8 +38,8 @@ int32_t RenameFile(PP_Instance instance,
EnterInstance enter(instance);
if (enter.failed())
return PP_ERROR_BADARGUMENT;
- return enter.functions()->GetFlashAPI()->RenameFile(instance,
- path_from, path_to);
+ return enter.functions()->GetFlashFileAPI(instance)->RenameFile(
+ instance, path_from, path_to);
}
int32_t DeleteFileOrDir(PP_Instance instance,
@@ -56,22 +48,24 @@ int32_t DeleteFileOrDir(PP_Instance instance,
EnterInstance enter(instance);
if (enter.failed())
return PP_ERROR_BADARGUMENT;
- return enter.functions()->GetFlashAPI()->DeleteFileOrDir(instance, path,
- recursive);
+ return enter.functions()->GetFlashFileAPI(instance)->DeleteFileOrDir(
+ instance, path, recursive);
}
int32_t CreateDir(PP_Instance instance, const char* path) {
EnterInstance enter(instance);
if (enter.failed())
return PP_ERROR_BADARGUMENT;
- return enter.functions()->GetFlashAPI()->CreateDir(instance, path);
+ return enter.functions()->GetFlashFileAPI(instance)->CreateDir(
+ instance, path);
}
int32_t QueryFile(PP_Instance instance, const char* path, PP_FileInfo* info) {
EnterInstance enter(instance);
if (enter.failed())
return PP_ERROR_BADARGUMENT;
- return enter.functions()->GetFlashAPI()->QueryFile(instance, path, info);
+ return enter.functions()->GetFlashFileAPI(instance)->QueryFile(
+ instance, path, info);
}
int32_t GetDirContents(PP_Instance instance,
@@ -80,15 +74,16 @@ int32_t GetDirContents(PP_Instance instance,
EnterInstance enter(instance);
if (enter.failed())
return PP_ERROR_BADARGUMENT;
- return enter.functions()->GetFlashAPI()->GetDirContents(instance, path,
- contents);
+ return enter.functions()->GetFlashFileAPI(instance)->GetDirContents(
+ instance, path, contents);
}
void FreeDirContents(PP_Instance instance,
PP_DirContents_Dev* contents) {
EnterInstance enter(instance);
if (enter.succeeded())
- enter.functions()->GetFlashAPI()->FreeDirContents(instance, contents);
+ enter.functions()->GetFlashFileAPI(instance)->FreeDirContents(
+ instance, contents);
}
int32_t CreateTemporaryFile(PP_Instance instance, PP_FileHandle* file) {
@@ -97,7 +92,8 @@ int32_t CreateTemporaryFile(PP_Instance instance, PP_FileHandle* file) {
return PP_ERROR_BADARGUMENT;
*file = PP_kInvalidFileHandle;
- return enter.functions()->GetFlashAPI()->CreateTemporaryFile(instance, file);
+ return enter.functions()->GetFlashFileAPI(instance)->CreateTemporaryFile(
+ instance, file);
}
const PPB_Flash_File_ModuleLocal_2_0 g_ppb_flash_file_modulelocal_thunk_2_0 = {

Powered by Google App Engine
This is Rietveld 408576698