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

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: Add "broker" prefix to name 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
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 26 matching lines...) Expand all
37 37
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 #if NACL_WINDOWS
48 args->broker_duplicate_handle_func = NULL;
49 #endif
47 args->validation_cache = NULL; 50 args->validation_cache = NULL;
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) {
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 if (!NaClAppCtor(&state)) { 114 if (!NaClAppCtor(&state)) {
112 fprintf(stderr, "Error while constructing app state\n"); 115 fprintf(stderr, "Error while constructing app state\n");
113 goto done_ctor; 116 goto done_ctor;
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
124 #if NACL_WINDOWS
125 if (args->broker_duplicate_handle_func != NULL)
126 NaClSetBrokerDuplicateHandleFunc(args->broker_duplicate_handle_func);
127 #endif
128
121 /* Inject the validation caching interface, if it exists. */ 129 /* Inject the validation caching interface, if it exists. */
122 nap->validation_cache = args->validation_cache; 130 nap->validation_cache = args->validation_cache;
123 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
(...skipping 176 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
« src/shared/imc/win/nacl_imc.cc ('K') | « 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