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

Unified Diff: webkit/plugins/ppapi/ppb_flash_impl.cc

Issue 10534045: Add CreateTemporaryFile to PPB_Flash_File_ModuleLocal. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 months 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
« ppapi/c/private/ppb_flash_file.h ('K') | « webkit/plugins/ppapi/ppb_flash_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/ppb_flash_impl.cc
diff --git a/webkit/plugins/ppapi/ppb_flash_impl.cc b/webkit/plugins/ppapi/ppb_flash_impl.cc
index 8b595ff594bc801603df41850222f41dc16d484d..ccc6a67f58e1dcfaf240c18284f9a9e4c1f45e5b 100644
--- a/webkit/plugins/ppapi/ppb_flash_impl.cc
+++ b/webkit/plugins/ppapi/ppb_flash_impl.cc
@@ -523,6 +523,30 @@ int32_t PPB_Flash_Impl::GetDirContents(PP_Instance pp_instance,
return PP_OK;
}
+int32_t PPB_Flash_Impl::CreateTemporaryFile(PP_Instance instance,
+ const char* dir_path,
+ PP_FileHandle* file,
+ std::string* file_name) {
+ if (!dir_path || !file || !file_name)
+ return PP_ERROR_BADARGUMENT;
+
+ PluginInstance* plugin_instance = HostGlobals::Get()->GetInstance(instance);
+ if (!plugin_instance) {
+ *file = PP_kInvalidFileHandle;
+ file_name->clear();
+ return PP_ERROR_FAILED;
+ }
+
+ base::PlatformFile temp_file = base::kInvalidPlatformFileValue;
+ base::PlatformFileError result =
+ plugin_instance->delegate()->CreateTemporaryFile(
+ ::ppapi::PepperFilePath::MakeModuleLocal(
+ plugin_instance->module()->name(), dir_path),
+ &temp_file, file_name);
+ *file = temp_file;
+ return ::ppapi::PlatformFileErrorToPepperError(result);
+}
+
int32_t PPB_Flash_Impl::OpenFileRef(PP_Instance pp_instance,
PP_Resource file_ref_id,
int32_t mode,
« ppapi/c/private/ppb_flash_file.h ('K') | « webkit/plugins/ppapi/ppb_flash_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698