OLD | NEW |
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 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
763 dest->is_dir = PP_FromBool(source.is_dir); | 763 dest->is_dir = PP_FromBool(source.is_dir); |
764 } | 764 } |
765 | 765 |
766 return result; | 766 return result; |
767 } | 767 } |
768 | 768 |
769 int32_t PPB_Flash_Proxy::OpenFileRef(PP_Instance instance, | 769 int32_t PPB_Flash_Proxy::OpenFileRef(PP_Instance instance, |
770 PP_Resource file_ref_id, | 770 PP_Resource file_ref_id, |
771 int32_t mode, | 771 int32_t mode, |
772 PP_FileHandle* file) { | 772 PP_FileHandle* file) { |
773 EnterResourceNoLock<PPB_FileRef> enter(file_ref_id, true); | 773 EnterResourceNoLock<thunk::PPB_FileRef_API> enter(file_ref_id, true); |
774 if (enter.failed()) | 774 if (enter.failed()) |
775 return PP_ERROR_BADRESOURCE; | 775 return PP_ERROR_BADRESOURCE; |
776 | 776 |
777 int32_t result = PP_ERROR_FAILED; | 777 int32_t result = PP_ERROR_FAILED; |
778 IPC::PlatformFileForTransit transit; | 778 IPC::PlatformFileForTransit transit; |
779 dispatcher()->Send(new PpapiHostMsg_PPBFlash_OpenFileRef( | 779 dispatcher()->Send(new PpapiHostMsg_PPBFlash_OpenFileRef( |
780 API_ID_PPB_FLASH, instance, enter.resource()->host_resource(), mode, | 780 API_ID_PPB_FLASH, instance, enter.resource()->host_resource(), mode, |
781 &transit, &result)); | 781 &transit, &result)); |
782 *file = IPC::PlatformFileForTransitToPlatformFile(transit); | 782 *file = IPC::PlatformFileForTransitToPlatformFile(transit); |
783 return result; | 783 return result; |
784 } | 784 } |
785 | 785 |
786 int32_t PPB_Flash_Proxy::QueryFileRef(PP_Instance instance, | 786 int32_t PPB_Flash_Proxy::QueryFileRef(PP_Instance instance, |
787 PP_Resource file_ref_id, | 787 PP_Resource file_ref_id, |
788 PP_FileInfo* info) { | 788 PP_FileInfo* info) { |
789 EnterResourceNoLock<PPB_FileRef> enter(file_ref_id, true); | 789 EnterResourceNoLock<thunk::PPB_FileRef_API> enter(file_ref_id, true); |
790 if (enter.failed()) | 790 if (enter.failed()) |
791 return PP_ERROR_BADRESOURCE; | 791 return PP_ERROR_BADRESOURCE; |
792 | 792 |
793 int32_t result = PP_ERROR_FAILED; | 793 int32_t result = PP_ERROR_FAILED; |
794 dispatcher()->Send(new PpapiHostMsg_PPBFlash_QueryFileRef( | 794 dispatcher()->Send(new PpapiHostMsg_PPBFlash_QueryFileRef( |
795 API_ID_PPB_FLASH, instance, enter.resource()->host_resource(), info, | 795 API_ID_PPB_FLASH, instance, enter.resource()->host_resource(), info, |
796 &result)); | 796 &result)); |
797 return result; | 797 return result; |
798 } | 798 } |
799 | 799 |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1174 // It's rarely used enough that we just request this interface when needed. | 1174 // It's rarely used enough that we just request this interface when needed. |
1175 const PPB_Flash_Print_1_0* print_interface = | 1175 const PPB_Flash_Print_1_0* print_interface = |
1176 static_cast<const PPB_Flash_Print_1_0*>( | 1176 static_cast<const PPB_Flash_Print_1_0*>( |
1177 dispatcher()->local_get_interface()(PPB_FLASH_PRINT_INTERFACE_1_0)); | 1177 dispatcher()->local_get_interface()(PPB_FLASH_PRINT_INTERFACE_1_0)); |
1178 if (print_interface) | 1178 if (print_interface) |
1179 print_interface->InvokePrinting(instance); | 1179 print_interface->InvokePrinting(instance); |
1180 } | 1180 } |
1181 | 1181 |
1182 } // namespace proxy | 1182 } // namespace proxy |
1183 } // namespace ppapi | 1183 } // namespace ppapi |
OLD | NEW |