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

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

Issue 18045007: Show more different NaCl loading errors. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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
===================================================================
--- chrome/renderer/pepper/ppb_nacl_private_impl.cc (revision 211556)
+++ chrome/renderer/pepper/ppb_nacl_private_impl.cc (working copy)
@@ -94,10 +94,12 @@
PP_Bool enable_ppapi_dev,
PP_Bool enable_dyncode_syscalls,
PP_Bool enable_exception_handling,
- void* imc_handle) {
+ void* imc_handle,
+ struct PP_Var* error_message) {
nacl::FileDescriptor result_socket;
IPC::Sender* sender = content::RenderThread::Get();
DCHECK(sender);
+ *error_message = PP_MakeUndefined();
int routing_id = 0;
// If the nexe uses ppapi APIs, we need a routing ID.
// To get the routing ID, we must be on the main thread.
@@ -120,6 +122,8 @@
perm_bits |= ppapi::PERMISSION_DEV;
instance_info.permissions =
ppapi::PpapiPermissions::GetForCommandLine(perm_bits);
+ std::string error_message_string;
+ nacl::NaClLaunchResult launch_result;
if (!sender->Send(new NaClHostMsg_LaunchNaCl(
nacl::NaClLaunchParams(instance_info.url.spec(),
@@ -128,13 +132,18 @@
PP_ToBool(uses_irt),
PP_ToBool(enable_dyncode_syscalls),
PP_ToBool(enable_exception_handling)),
- &result_socket,
- &instance_info.channel_handle,
- &instance_info.plugin_pid,
- &instance_info.plugin_child_id))) {
+ &launch_result,
+ &error_message_string))) {
return PP_NACL_FAILED;
}
-
+ if (!error_message_string.empty()) {
+ *error_message = ppapi::StringVar::StringToPPVar(error_message_string);
+ return PP_NACL_FAILED;
+ }
+ result_socket = launch_result.imc_channel_handle;
+ instance_info.channel_handle = launch_result.ipc_channel_handle;
+ instance_info.plugin_pid = launch_result.plugin_pid;
+ instance_info.plugin_child_id = launch_result.plugin_child_id;
// Don't save instance_info if channel handle is invalid.
bool invalid_handle = instance_info.channel_handle.name.empty();
#if defined(OS_POSIX)

Powered by Google App Engine
This is Rietveld 408576698