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

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 210749)
+++ chrome/renderer/pepper/ppb_nacl_private_impl.cc (working copy)
@@ -75,11 +75,13 @@
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();
if (sender == NULL)
sender = g_background_thread_sender.Pointer()->get();
+ *error_message = ppapi::StringVar::StringToPPVar("");
dmichael (off chromium) 2013/07/10 17:07:20 The PP_Var you're getting has a ref-count of 1, so
halyavin 2013/07/11 09:03:36 Done.
int routing_id = 0;
// If the nexe uses ppapi APIs, we need a routing ID.
@@ -103,6 +105,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(),
@@ -111,13 +115,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