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

Unified Diff: chrome/renderer/pepper/ppb_nacl_private_impl.cc

Issue 19863003: PNaCl on-demand installs: Make a separate async IPC to check if PNaCl is installed (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: const ref Created 7 years, 5 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: 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 4d918991a80114798958f78334ab9cfb30d767f4..d65cd3ecfd938f2c5162da4e8b24b13f3a9d8623 100644
--- a/chrome/renderer/pepper/ppb_nacl_private_impl.cc
+++ b/chrome/renderer/pepper/ppb_nacl_private_impl.cc
@@ -220,6 +220,19 @@ int32_t BrokerDuplicateHandle(PP_FileHandle source_handle,
#endif
}
+int32_t EnsurePnaclInstalled(PP_Instance instance,
+ PP_CompletionCallback callback) {
+ 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();
@@ -229,11 +242,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;
@@ -365,6 +376,7 @@ const PPB_NaCl_Private nacl_interface = {
&UrandomFD,
&Are3DInterfacesDisabled,
&BrokerDuplicateHandle,
+ &EnsurePnaclInstalled,
&GetReadonlyPnaclFD,
&CreateTemporaryFile,
&GetNexeFd,

Powered by Google App Engine
This is Rietveld 408576698