diff options
author | teravest@chromium.org <teravest@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-19 18:58:00 +0000 |
---|---|---|
committer | teravest@chromium.org <teravest@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-19 18:58:00 +0000 |
commit | 4371e27dd7a950f5ba7be5f56cfd351a58c34b80 (patch) | |
tree | 242cf47ec8646504fa7d9ef1854a071b0998470b /ppapi | |
parent | be168744edfa567c4cf5557289e3f47f37d44cd6 (diff) | |
download | chromium_src-4371e27dd7a950f5ba7be5f56cfd351a58c34b80.zip chromium_src-4371e27dd7a950f5ba7be5f56cfd351a58c34b80.tar.gz chromium_src-4371e27dd7a950f5ba7be5f56cfd351a58c34b80.tar.bz2 |
Pepper: Make PPB ReportLoadError set lastError.
This is part of a series of changes to move more error handling logic to
components/nacl/renderer from ppapi/native_client. I would have moved over some
of the console logging work as part of this change as well, but it started to
look pretty large.
BUG=239656
R=dmichael@chromium.org
Review URL: https://codereview.chromium.org/197873030
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@258050 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r-- | ppapi/api/private/ppb_nacl_private.idl | 1 | ||||
-rw-r--r-- | ppapi/c/private/ppb_nacl_private.h | 1 | ||||
-rw-r--r-- | ppapi/native_client/src/trusted/plugin/plugin.cc | 6 | ||||
-rw-r--r-- | ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c | 6 |
4 files changed, 7 insertions, 7 deletions
diff --git a/ppapi/api/private/ppb_nacl_private.idl b/ppapi/api/private/ppb_nacl_private.idl index 94a3bea..aa731ae 100644 --- a/ppapi/api/private/ppb_nacl_private.idl +++ b/ppapi/api/private/ppb_nacl_private.idl @@ -274,6 +274,7 @@ interface PPB_NaCl_Private { /* Report an error that occured while attempting to load a nexe. */ void ReportLoadError([in] PP_Instance instance, [in] PP_NaClError error, + [in] str_t error_message, [in] PP_Bool is_installed); /* Performs internal cleanup when an instance is destroyed. */ diff --git a/ppapi/c/private/ppb_nacl_private.h b/ppapi/c/private/ppb_nacl_private.h index cd20082..e2ccb2b 100644 --- a/ppapi/c/private/ppb_nacl_private.h +++ b/ppapi/c/private/ppb_nacl_private.h @@ -281,6 +281,7 @@ struct PPB_NaCl_Private_1_0 { /* Report an error that occured while attempting to load a nexe. */ void (*ReportLoadError)(PP_Instance instance, PP_NaClError error, + const char* error_message, PP_Bool is_installed); /* Performs internal cleanup when an instance is destroyed. */ void (*InstanceDestroyed)(PP_Instance instance); diff --git a/ppapi/native_client/src/trusted/plugin/plugin.cc b/ppapi/native_client/src/trusted/plugin/plugin.cc index 6f79e02..189895e 100644 --- a/ppapi/native_client/src/trusted/plugin/plugin.cc +++ b/ppapi/native_client/src/trusted/plugin/plugin.cc @@ -1261,15 +1261,13 @@ void Plugin::ReportLoadError(const ErrorInfo& error_info) { error_info.message().c_str())); nacl_interface_->ReportLoadError(pp_instance(), error_info.error_code(), + error_info.message().c_str(), PP_FromBool(is_installed_)); // Set the readyState attribute to indicate we need to start over. set_nacl_ready_state(DONE); set_nexe_error_reported(true); - // Report an error in lastError and on the JavaScript console. - nacl::string message = nacl::string("NaCl module load failed: ") + - error_info.message(); - set_last_error_string(message); + // Report an error on the JavaScript console. AddToConsole(nacl::string("NaCl module load failed: ") + error_info.console_message()); } diff --git a/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c b/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c index fbe2049..0728453 100644 --- a/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c +++ b/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c @@ -3161,9 +3161,9 @@ static void Pnacl_M25_PPB_NaCl_Private_SetReadOnlyProperty(PP_Instance instance, iface->SetReadOnlyProperty(instance, *key, *value); } -static void Pnacl_M25_PPB_NaCl_Private_ReportLoadError(PP_Instance instance, PP_NaClError error, PP_Bool is_installed) { +static void Pnacl_M25_PPB_NaCl_Private_ReportLoadError(PP_Instance instance, PP_NaClError error, const char* error_message, PP_Bool is_installed) { const struct PPB_NaCl_Private_1_0 *iface = Pnacl_WrapperInfo_PPB_NaCl_Private_1_0.real_iface; - iface->ReportLoadError(instance, error, is_installed); + iface->ReportLoadError(instance, error, error_message, is_installed); } static void Pnacl_M25_PPB_NaCl_Private_InstanceDestroyed(PP_Instance instance) { @@ -5071,7 +5071,7 @@ static const struct PPB_NaCl_Private_1_0 Pnacl_Wrappers_PPB_NaCl_Private_1_0 = { .OpenNaClExecutable = (PP_FileHandle (*)(PP_Instance instance, const char* file_url, uint64_t* file_token_lo, uint64_t* file_token_hi))&Pnacl_M25_PPB_NaCl_Private_OpenNaClExecutable, .DispatchEvent = (void (*)(PP_Instance instance, PP_NaClEventType event_type, const char* resource_url, PP_Bool length_is_computable, uint64_t loaded_bytes, uint64_t total_bytes))&Pnacl_M25_PPB_NaCl_Private_DispatchEvent, .SetReadOnlyProperty = (void (*)(PP_Instance instance, struct PP_Var key, struct PP_Var value))&Pnacl_M25_PPB_NaCl_Private_SetReadOnlyProperty, - .ReportLoadError = (void (*)(PP_Instance instance, PP_NaClError error, PP_Bool is_installed))&Pnacl_M25_PPB_NaCl_Private_ReportLoadError, + .ReportLoadError = (void (*)(PP_Instance instance, PP_NaClError error, const char* error_message, PP_Bool is_installed))&Pnacl_M25_PPB_NaCl_Private_ReportLoadError, .InstanceDestroyed = (void (*)(PP_Instance instance))&Pnacl_M25_PPB_NaCl_Private_InstanceDestroyed, .NaClDebugStubEnabled = (PP_Bool (*)(void))&Pnacl_M25_PPB_NaCl_Private_NaClDebugStubEnabled, .GetSandboxArch = (const char* (*)(void))&Pnacl_M25_PPB_NaCl_Private_GetSandboxArch, |