Chromium Code Reviews| Index: chrome/renderer/pepper/ppb_nacl_private_impl.cc |
| diff --git a/chrome/renderer/pepper/ppb_nacl_private_impl.cc b/chrome/renderer/pepper/ppb_nacl_private_impl.cc |
| index f334bd0b002be508d72ffb551dcaaf810fea3bcf..21052e273cb6f5024793b3d088c5ba5a9fee24ee 100644 |
| --- a/chrome/renderer/pepper/ppb_nacl_private_impl.cc |
| +++ b/chrome/renderer/pepper/ppb_nacl_private_impl.cc |
| @@ -201,6 +201,19 @@ int32_t BrokerDuplicateHandle(PP_FileHandle source_handle, |
| #endif |
| } |
| +int32_t EnsurePnaclInstalled(PP_Instance instance, |
| + PP_CompletionCallback callback) { |
|
dmichael (off chromium)
2013/08/01 17:33:49
It might be good to DCHECK that you're on the main
jvoung (off chromium)
2013/08/01 23:14:07
Done. (within InitializePnaclResourceHost and shar
|
| + ppapi::thunk::EnterInstance enter(instance, callback); |
| + if (enter.failed()) |
| + return enter.retval(); |
| + if (!InitializePnaclResourceHost()) |
| + return enter.SetResult(PP_ERROR_FAILED); |
| + g_pnacl_resource_host.Get()->EnsurePnaclInstalled( |
| + instance, |
| + enter.callback()); |
| + return enter.SetResult(PP_OK_COMPLETIONPENDING); |
| +} |
| + |
| PP_FileHandle GetReadonlyPnaclFD(const char* filename) { |
| IPC::PlatformFileForTransit out_fd = IPC::InvalidPlatformFileForTransit(); |
| IPC::Sender* sender = content::RenderThread::Get(); |
| @@ -210,11 +223,9 @@ PP_FileHandle GetReadonlyPnaclFD(const char* filename) { |
| &out_fd))) { |
| return base::kInvalidPlatformFileValue; |
| } |
| - |
| if (out_fd == IPC::InvalidPlatformFileForTransit()) { |
| return base::kInvalidPlatformFileValue; |
| } |
| - |
| base::PlatformFile handle = |
| IPC::PlatformFileForTransitToPlatformFile(out_fd); |
| return handle; |
| @@ -346,6 +357,7 @@ const PPB_NaCl_Private nacl_interface = { |
| &UrandomFD, |
| &Are3DInterfacesDisabled, |
| &BrokerDuplicateHandle, |
| + &EnsurePnaclInstalled, |
| &GetReadonlyPnaclFD, |
| &CreateTemporaryFile, |
| &GetNexeFd, |