| 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 "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/time.h" | 9 #include "base/time.h" |
| 10 #include "ppapi/c/dev/ppb_font_dev.h" | 10 #include "ppapi/c/dev/ppb_font_dev.h" |
| (...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 char* name_copy = new char[name.size() + 1]; | 491 char* name_copy = new char[name.size() + 1]; |
| 492 memcpy(name_copy, name.c_str(), name.size() + 1); | 492 memcpy(name_copy, name.c_str(), name.size() + 1); |
| 493 dest->name = name_copy; | 493 dest->name = name_copy; |
| 494 dest->is_dir = PP_FromBool(source.is_dir); | 494 dest->is_dir = PP_FromBool(source.is_dir); |
| 495 } | 495 } |
| 496 } | 496 } |
| 497 | 497 |
| 498 return ppapi::PlatformFileErrorToPepperError(error); | 498 return ppapi::PlatformFileErrorToPepperError(error); |
| 499 } | 499 } |
| 500 | 500 |
| 501 int32_t PPB_Flash_Proxy::CreateTemporaryFile(PP_Instance instance, |
| 502 PP_FileHandle* file) { |
| 503 if (!file) |
| 504 return PP_ERROR_BADARGUMENT; |
| 505 |
| 506 base::PlatformFileError error; |
| 507 IPC::PlatformFileForTransit transit_file; |
| 508 |
| 509 if (PluginGlobals::Get()->plugin_proxy_delegate()->SendToBrowser( |
| 510 new PepperFileMsg_CreateTemporaryFile(&error, &transit_file))) { |
| 511 *file = IPC::PlatformFileForTransitToPlatformFile(transit_file); |
| 512 } else { |
| 513 error = base::PLATFORM_FILE_ERROR_FAILED; |
| 514 *file = base::kInvalidPlatformFileValue; |
| 515 } |
| 516 |
| 517 return ppapi::PlatformFileErrorToPepperError(error); |
| 518 } |
| 519 |
| 501 int32_t PPB_Flash_Proxy::OpenFileRef(PP_Instance instance, | 520 int32_t PPB_Flash_Proxy::OpenFileRef(PP_Instance instance, |
| 502 PP_Resource file_ref_id, | 521 PP_Resource file_ref_id, |
| 503 int32_t mode, | 522 int32_t mode, |
| 504 PP_FileHandle* file) { | 523 PP_FileHandle* file) { |
| 505 EnterResourceNoLock<thunk::PPB_FileRef_API> enter(file_ref_id, true); | 524 EnterResourceNoLock<thunk::PPB_FileRef_API> enter(file_ref_id, true); |
| 506 if (enter.failed()) | 525 if (enter.failed()) |
| 507 return PP_ERROR_BADRESOURCE; | 526 return PP_ERROR_BADRESOURCE; |
| 508 | 527 |
| 509 int32_t result = PP_ERROR_FAILED; | 528 int32_t result = PP_ERROR_FAILED; |
| 510 IPC::PlatformFileForTransit transit; | 529 IPC::PlatformFileForTransit transit; |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 811 // It's rarely used enough that we just request this interface when needed. | 830 // It's rarely used enough that we just request this interface when needed. |
| 812 const PPB_Flash_Print_1_0* print_interface = | 831 const PPB_Flash_Print_1_0* print_interface = |
| 813 static_cast<const PPB_Flash_Print_1_0*>( | 832 static_cast<const PPB_Flash_Print_1_0*>( |
| 814 dispatcher()->local_get_interface()(PPB_FLASH_PRINT_INTERFACE_1_0)); | 833 dispatcher()->local_get_interface()(PPB_FLASH_PRINT_INTERFACE_1_0)); |
| 815 if (print_interface) | 834 if (print_interface) |
| 816 print_interface->InvokePrinting(instance); | 835 print_interface->InvokePrinting(instance); |
| 817 } | 836 } |
| 818 | 837 |
| 819 } // namespace proxy | 838 } // namespace proxy |
| 820 } // namespace ppapi | 839 } // namespace ppapi |
| OLD | NEW |