Index: ppapi/proxy/ppb_flash_file_proxy.cc |
=================================================================== |
--- ppapi/proxy/ppb_flash_file_proxy.cc (revision 100753) |
+++ ppapi/proxy/ppb_flash_file_proxy.cc (working copy) |
@@ -501,22 +501,17 @@ |
&FreeDirContents, |
}; |
-InterfaceProxy* CreateFlashFileModuleLocalProxy(Dispatcher* dispatcher) { |
- return new PPB_Flash_File_ModuleLocal_Proxy(dispatcher); |
+InterfaceProxy* CreateFlashFileModuleLocalProxy(Dispatcher* dispatcher, |
+ const void* target_interface) { |
+ return new PPB_Flash_File_ModuleLocal_Proxy(dispatcher, target_interface); |
} |
} // namespace |
PPB_Flash_File_ModuleLocal_Proxy::PPB_Flash_File_ModuleLocal_Proxy( |
- Dispatcher* dispatcher) |
- : InterfaceProxy(dispatcher), |
- ppb_flash_file_module_local_impl_(NULL) { |
- if (!dispatcher->IsPlugin()) { |
- ppb_flash_file_module_local_impl_ = |
- static_cast<const PPB_Flash_File_ModuleLocal*>( |
- dispatcher->local_get_interface()( |
- PPB_FLASH_FILE_MODULELOCAL_INTERFACE)); |
- } |
+ Dispatcher* dispatcher, |
+ const void* target_interface) |
+ : InterfaceProxy(dispatcher, target_interface) { |
} |
PPB_Flash_File_ModuleLocal_Proxy::~PPB_Flash_File_ModuleLocal_Proxy() { |
@@ -563,8 +558,8 @@ |
IPC::PlatformFileForTransit* file_handle, |
int32_t* result) { |
base::PlatformFile file; |
- *result = ppb_flash_file_module_local_impl_->OpenFile( |
- instance, path.c_str(), mode, &file); |
+ *result = ppb_flash_file_module_local_target()-> |
+ OpenFile(instance, path.c_str(), mode, &file); |
*file_handle = PlatformFileToPlatformFileForTransit( |
dispatcher(), result, file); |
} |
@@ -574,8 +569,8 @@ |
const std::string& from_path, |
const std::string& to_path, |
int32_t* result) { |
- *result = ppb_flash_file_module_local_impl_->RenameFile( |
- instance, from_path.c_str(), to_path.c_str()); |
+ *result = ppb_flash_file_module_local_target()-> |
+ RenameFile(instance, from_path.c_str(), to_path.c_str()); |
} |
void PPB_Flash_File_ModuleLocal_Proxy::OnMsgDeleteFileOrDir( |
@@ -583,23 +578,23 @@ |
const std::string& path, |
PP_Bool recursive, |
int32_t* result) { |
- *result = ppb_flash_file_module_local_impl_->DeleteFileOrDir( |
- instance, path.c_str(), recursive); |
+ *result = ppb_flash_file_module_local_target()-> |
+ DeleteFileOrDir(instance, path.c_str(), recursive); |
} |
void PPB_Flash_File_ModuleLocal_Proxy::OnMsgCreateDir(PP_Instance instance, |
const std::string& path, |
int32_t* result) { |
- *result = ppb_flash_file_module_local_impl_->CreateDir( |
- instance, path.c_str()); |
+ *result = ppb_flash_file_module_local_target()-> |
+ CreateDir(instance, path.c_str()); |
} |
void PPB_Flash_File_ModuleLocal_Proxy::OnMsgQueryFile(PP_Instance instance, |
const std::string& path, |
PP_FileInfo* info, |
int32_t* result) { |
- *result = ppb_flash_file_module_local_impl_->QueryFile( |
- instance, path.c_str(), info); |
+ *result = ppb_flash_file_module_local_target()-> |
+ QueryFile(instance, path.c_str(), info); |
} |
void PPB_Flash_File_ModuleLocal_Proxy::OnMsgGetDirContents( |
@@ -608,8 +603,8 @@ |
std::vector<SerializedDirEntry>* entries, |
int32_t* result) { |
PP_DirContents_Dev* contents = NULL; |
- *result = ppb_flash_file_module_local_impl_->GetDirContents( |
- instance, path.c_str(), &contents); |
+ *result = ppb_flash_file_module_local_target()-> |
+ GetDirContents(instance, path.c_str(), &contents); |
if (*result != PP_OK) |
return; |
@@ -619,7 +614,7 @@ |
(*entries)[i].name.assign(contents->entries[i].name); |
(*entries)[i].is_dir = PP_ToBool(contents->entries[i].is_dir); |
} |
- ppb_flash_file_module_local_impl_->FreeDirContents(instance, contents); |
+ ppb_flash_file_module_local_target()->FreeDirContents(instance, contents); |
} |
// PPB_Flash_File_FileRef ------------------------------------------------------ |
@@ -670,20 +665,17 @@ |
&QueryFileRefFile, |
}; |
-InterfaceProxy* CreateFlashFileFileRefProxy(Dispatcher* dispatcher) { |
- return new PPB_Flash_File_FileRef_Proxy(dispatcher); |
+InterfaceProxy* CreateFlashFileFileRefProxy(Dispatcher* dispatcher, |
+ const void* target_interface) { |
+ return new PPB_Flash_File_FileRef_Proxy(dispatcher, target_interface); |
} |
} // namespace |
PPB_Flash_File_FileRef_Proxy::PPB_Flash_File_FileRef_Proxy( |
- Dispatcher* dispatcher) |
- : InterfaceProxy(dispatcher), |
- ppb_flash_file_fileref_impl_(NULL) { |
- if (!dispatcher->IsPlugin()) { |
- ppb_flash_file_fileref_impl_ = static_cast<const PPB_Flash_File_FileRef*>( |
- dispatcher->local_get_interface()(PPB_FLASH_FILE_FILEREF_INTERFACE)); |
- } |
+ Dispatcher* dispatcher, |
+ const void* target_interface) |
+ : InterfaceProxy(dispatcher, target_interface) { |
} |
PPB_Flash_File_FileRef_Proxy::~PPB_Flash_File_FileRef_Proxy() { |
@@ -721,8 +713,8 @@ |
IPC::PlatformFileForTransit* file_handle, |
int32_t* result) { |
base::PlatformFile file; |
- *result = ppb_flash_file_fileref_impl_->OpenFile( |
- host_resource.host_resource(), mode, &file); |
+ *result = ppb_flash_file_module_local_target()-> |
+ OpenFile(host_resource.host_resource(), mode, &file); |
*file_handle = PlatformFileToPlatformFileForTransit( |
dispatcher(), result, file); |
} |
@@ -731,8 +723,8 @@ |
const HostResource& host_resource, |
PP_FileInfo* info, |
int32_t* result) { |
- *result = ppb_flash_file_fileref_impl_->QueryFile( |
- host_resource.host_resource(), info); |
+ *result = ppb_flash_file_module_local_target()-> |
+ QueryFile(host_resource.host_resource(), info); |
} |
} // namespace proxy |