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

Unified Diff: ppapi/proxy/ppb_flash_proxy.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
Index: ppapi/proxy/ppb_flash_proxy.cc
diff --git a/ppapi/proxy/ppb_flash_proxy.cc b/ppapi/proxy/ppb_flash_proxy.cc
index 5bfd5f47cc57bdb7caf14f3ad82eed29eeb95f32..b6ba7621f7b0fe11c75034338bb43323857344f4 100644
--- a/ppapi/proxy/ppb_flash_proxy.cc
+++ b/ppapi/proxy/ppb_flash_proxy.cc
@@ -802,6 +802,32 @@ int32_t PPB_Flash_Proxy::GetDirContents(PP_Instance,
return ppapi::PlatformFileErrorToPepperError(error);
}
+int32_t PPB_Flash_Proxy::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;
+
+ base::PlatformFileError error;
+ IPC::PlatformFileForTransit transit_file;
+ ppapi::PepperFilePath pepper_dir_path(
+ ppapi::PepperFilePath::DOMAIN_MODULE_LOCAL,
+ FilePath::FromUTF8Unsafe(dir_path));
+
+ if (PluginGlobals::Get()->plugin_proxy_delegate()->SendToBrowser(
+ new PepperFileMsg_CreateTemporaryFile(pepper_dir_path, &error,
+ &transit_file, file_name))) {
+ *file = IPC::PlatformFileForTransitToPlatformFile(transit_file);
+ } else {
+ error = base::PLATFORM_FILE_ERROR_FAILED;
+ *file = base::kInvalidPlatformFileValue;
+ file_name->clear();
+ }
+
+ return ppapi::PlatformFileErrorToPepperError(error);
+}
+
int32_t PPB_Flash_Proxy::OpenFileRef(PP_Instance instance,
PP_Resource file_ref_id,
int32_t mode,

Powered by Google App Engine
This is Rietveld 408576698