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

Side by Side 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: remove input dir path and output file name 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ppapi/proxy/ppb_flash_proxy.h" 5 #include "ppapi/proxy/ppb_flash_proxy.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after
795 char* name_copy = new char[name.size() + 1]; 795 char* name_copy = new char[name.size() + 1];
796 memcpy(name_copy, name.c_str(), name.size() + 1); 796 memcpy(name_copy, name.c_str(), name.size() + 1);
797 dest->name = name_copy; 797 dest->name = name_copy;
798 dest->is_dir = PP_FromBool(source.is_dir); 798 dest->is_dir = PP_FromBool(source.is_dir);
799 } 799 }
800 } 800 }
801 801
802 return ppapi::PlatformFileErrorToPepperError(error); 802 return ppapi::PlatformFileErrorToPepperError(error);
803 } 803 }
804 804
805 int32_t PPB_Flash_Proxy::CreateTemporaryFile(PP_Instance instance,
806 PP_FileHandle* file) {
807 if (!file)
808 return PP_ERROR_BADARGUMENT;
809
810 base::PlatformFileError error;
811 IPC::PlatformFileForTransit transit_file;
812
813 if (PluginGlobals::Get()->plugin_proxy_delegate()->SendToBrowser(
814 new PepperFileMsg_CreateTemporaryFile(&error, &transit_file))) {
815 *file = IPC::PlatformFileForTransitToPlatformFile(transit_file);
816 } else {
817 error = base::PLATFORM_FILE_ERROR_FAILED;
818 *file = base::kInvalidPlatformFileValue;
819 }
820
821 return ppapi::PlatformFileErrorToPepperError(error);
822 }
823
805 int32_t PPB_Flash_Proxy::OpenFileRef(PP_Instance instance, 824 int32_t PPB_Flash_Proxy::OpenFileRef(PP_Instance instance,
806 PP_Resource file_ref_id, 825 PP_Resource file_ref_id,
807 int32_t mode, 826 int32_t mode,
808 PP_FileHandle* file) { 827 PP_FileHandle* file) {
809 EnterResourceNoLock<thunk::PPB_FileRef_API> enter(file_ref_id, true); 828 EnterResourceNoLock<thunk::PPB_FileRef_API> enter(file_ref_id, true);
810 if (enter.failed()) 829 if (enter.failed())
811 return PP_ERROR_BADRESOURCE; 830 return PP_ERROR_BADRESOURCE;
812 831
813 int32_t result = PP_ERROR_FAILED; 832 int32_t result = PP_ERROR_FAILED;
814 IPC::PlatformFileForTransit transit; 833 IPC::PlatformFileForTransit transit;
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
1115 // It's rarely used enough that we just request this interface when needed. 1134 // It's rarely used enough that we just request this interface when needed.
1116 const PPB_Flash_Print_1_0* print_interface = 1135 const PPB_Flash_Print_1_0* print_interface =
1117 static_cast<const PPB_Flash_Print_1_0*>( 1136 static_cast<const PPB_Flash_Print_1_0*>(
1118 dispatcher()->local_get_interface()(PPB_FLASH_PRINT_INTERFACE_1_0)); 1137 dispatcher()->local_get_interface()(PPB_FLASH_PRINT_INTERFACE_1_0));
1119 if (print_interface) 1138 if (print_interface)
1120 print_interface->InvokePrinting(instance); 1139 print_interface->InvokePrinting(instance);
1121 } 1140 }
1122 1141
1123 } // namespace proxy 1142 } // namespace proxy
1124 } // namespace ppapi 1143 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698