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

Side by Side Diff: src/trusted/service_runtime/sel_main_chrome.c

Issue 9960060: Handle-passing: Allow a handle-passing function to be supplied by Chromium (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Review Created 8 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/trusted/service_runtime/sel_main_chrome.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. 2 * Copyright (c) 2012 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be 3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file. 4 * found in the LICENSE file.
5 */ 5 */
6 6
7 #include "native_client/src/trusted/service_runtime/sel_main_chrome.h" 7 #include "native_client/src/trusted/service_runtime/sel_main_chrome.h"
8 8
9 #include "native_client/src/include/portability.h" 9 #include "native_client/src/include/portability.h"
10 #include "native_client/src/include/portability_io.h" 10 #include "native_client/src/include/portability_io.h"
(...skipping 27 matching lines...) Expand all
38 struct NaClChromeMainArgs *NaClChromeMainArgsCreate(void) { 38 struct NaClChromeMainArgs *NaClChromeMainArgsCreate(void) {
39 struct NaClChromeMainArgs *args = malloc(sizeof(*args)); 39 struct NaClChromeMainArgs *args = malloc(sizeof(*args));
40 if (args == NULL) 40 if (args == NULL)
41 return NULL; 41 return NULL;
42 args->imc_bootstrap_handle = NACL_INVALID_HANDLE; 42 args->imc_bootstrap_handle = NACL_INVALID_HANDLE;
43 args->irt_fd = -1; 43 args->irt_fd = -1;
44 args->enable_exception_handling = 0; 44 args->enable_exception_handling = 0;
45 args->enable_debug_stub = 0; 45 args->enable_debug_stub = 0;
46 args->create_memory_object_func = NULL; 46 args->create_memory_object_func = NULL;
47 args->validation_cache = NULL; 47 args->validation_cache = NULL;
48 #if NACL_WINDOWS
49 args->broker_duplicate_handle_func = NULL;
50 #endif
48 return args; 51 return args;
49 } 52 }
50 53
51 static void NaClLoadIrt(struct NaClApp *nap, int irt_fd) { 54 static void NaClLoadIrt(struct NaClApp *nap, int irt_fd) {
52 int file_desc; 55 int file_desc;
53 struct GioPio gio_pio; 56 struct GioPio gio_pio;
54 struct Gio *gio_desc; 57 struct Gio *gio_desc;
55 58
56 if (irt_fd == -1) { 59 if (irt_fd == -1) {
57 NaClLog(LOG_FATAL, "NaClLoadIrt: Integrated runtime (IRT) not present.\n"); 60 NaClLog(LOG_FATAL, "NaClLoadIrt: Integrated runtime (IRT) not present.\n");
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 } 117 }
115 118
116 errcode = LOAD_OK; 119 errcode = LOAD_OK;
117 120
118 if (args->create_memory_object_func != NULL) 121 if (args->create_memory_object_func != NULL)
119 NaClSetCreateMemoryObjectFunc(args->create_memory_object_func); 122 NaClSetCreateMemoryObjectFunc(args->create_memory_object_func);
120 123
121 /* Inject the validation caching interface, if it exists. */ 124 /* Inject the validation caching interface, if it exists. */
122 nap->validation_cache = args->validation_cache; 125 nap->validation_cache = args->validation_cache;
123 126
127 #if NACL_WINDOWS
128 if (args->broker_duplicate_handle_func != NULL)
129 NaClSetBrokerDuplicateHandleFunc(args->broker_duplicate_handle_func);
130 #endif
131
124 NaClAppInitialDescriptorHookup(nap); 132 NaClAppInitialDescriptorHookup(nap);
125 133
126 /* 134 /*
127 * NACL_SERVICE_PORT_DESCRIPTOR and NACL_SERVICE_ADDRESS_DESCRIPTOR 135 * NACL_SERVICE_PORT_DESCRIPTOR and NACL_SERVICE_ADDRESS_DESCRIPTOR
128 * are 3 and 4. 136 * are 3 and 4.
129 */ 137 */
130 138
131 /* import IMC handle - used to be "-i" */ 139 /* import IMC handle - used to be "-i" */
132 NaClAddImcHandle(nap, args->imc_bootstrap_handle, export_addr_to); 140 NaClAddImcHandle(nap, args->imc_bootstrap_handle, export_addr_to);
133 141
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 if (LOAD_OK != errcode) { 315 if (LOAD_OK != errcode) {
308 NaClBlockIfCommandChannelExists(nap); 316 NaClBlockIfCommandChannelExists(nap);
309 } 317 }
310 318
311 done_ctor: 319 done_ctor:
312 320
313 NaClAllModulesFini(); 321 NaClAllModulesFini();
314 322
315 NaClExit(ret_code); 323 NaClExit(ret_code);
316 } 324 }
OLDNEW
« no previous file with comments | « src/trusted/service_runtime/sel_main_chrome.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698