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

Unified Diff: src/trusted/service_runtime/sel_ldr.c

Issue 153453002: Expose NaClAppSetDesc() to Chromium for use at startup (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Rebase and fix Created 6 years, 10 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
« no previous file with comments | « src/trusted/service_runtime/sel_ldr.h ('k') | src/trusted/service_runtime/sel_main_chrome.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/trusted/service_runtime/sel_ldr.c
diff --git a/src/trusted/service_runtime/sel_ldr.c b/src/trusted/service_runtime/sel_ldr.c
index 662138c4182d2a99dd0997608d99fc2f1e824295..01f6c48c52a89be1531424072cf3457dc281579d 100644
--- a/src/trusted/service_runtime/sel_ldr.c
+++ b/src/trusted/service_runtime/sel_ldr.c
@@ -15,6 +15,7 @@
#include "native_client/src/include/nacl_macros.h"
#include "native_client/src/public/desc_metadata_types.h"
+#include "native_client/src/public/nacl_app.h"
#include "native_client/src/public/secure_service.h"
#include "native_client/src/shared/gio/gio.h"
@@ -78,6 +79,9 @@ int NaClAppWithSyscallTableCtor(struct NaClApp *nap,
struct NaClSyscallTableEntry *table) {
struct NaClDescEffectorLdr *effp;
+ /* Zero-initialize in case we miss any fields below. */
+ memset(nap, 0, sizeof(*nap));
+
/* The validation cache will be injected later, if it exists. */
nap->validation_cache = NULL;
@@ -333,6 +337,15 @@ int NaClAppCtor(struct NaClApp *nap) {
return NaClAppWithSyscallTableCtor(nap, nacl_syscall);
}
+struct NaClApp *NaClAppCreate(void) {
+ struct NaClApp *nap = malloc(sizeof(struct NaClApp));
+ if (nap == NULL)
+ NaClLog(LOG_FATAL, "Failed to allocate NaClApp\n");
+ if (!NaClAppCtor(nap))
+ NaClLog(LOG_FATAL, "NaClAppCtor() failed\n");
+ return nap;
+}
+
/*
* unaligned little-endian load. precondition: nbytes should never be
* more than 8.
« no previous file with comments | « src/trusted/service_runtime/sel_ldr.h ('k') | src/trusted/service_runtime/sel_main_chrome.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698