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

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

Issue 10914138: Split secure command channel and untrusted application channel (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Created 8 years, 3 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
(Empty)
1 /*
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
4 * found in the LICENSE file.
5 */
6
7 #include "native_client/src/trusted/service_runtime/nacl_secure_service.h"
8
9 #include "native_client/src/shared/platform/nacl_exit.h"
10 #include "native_client/src/shared/platform/nacl_log.h"
11 #include "native_client/src/shared/platform/nacl_sync.h"
12 #include "native_client/src/shared/platform/nacl_sync_checked.h"
13 #include "native_client/src/shared/srpc/nacl_srpc.h"
14
15 #include "native_client/src/trusted/fault_injection/fault_injection.h"
16 #include "native_client/src/trusted/simple_service/nacl_simple_service.h"
17 #include "native_client/src/trusted/service_runtime/sel_ldr.h"
18
19
20 int NaClCommandServiceCtor(struct NaClCommandService *self,
21 struct NaClSrpcHandlerDesc const *srpc_handlers,
22 struct NaClApp *nap) {
23 NaClLog(4,
24 "Entered NaClCommandServiceCtor: self 0x%"NACL_PRIxPTR"\n",
25 (uintptr_t) self);
26 if (NACL_FI_ERROR_COND(
27 "NaClCommandServiceCtor__NaClSimpleService",
28 !NaClSimpleServiceCtor(
29 &self->base,
30 srpc_handlers,
31 NaClThreadInterfaceThreadFactory,
32 (void *) NULL))) {
33 goto failure_simple_ctor;
34 }
35 self->nap = nap;
36
37 NACL_VTBL(NaClRefCount, self) =
38 (struct NaClRefCountVtbl *) &kNaClCommandServiceVtbl;
39 return 1;
40 failure_simple_ctor:
41 return 0;
42 }
43
44 void NaClCommandServiceDtor(struct NaClRefCount *vself) {
45 struct NaClCommandService *self = (struct NaClCommandService *) vself;
46
47 NACL_VTBL(NaClRefCount, self) = (struct NaClRefCountVtbl const *)
48 &kNaClSimpleServiceVtbl;
49 (*NACL_VTBL(NaClRefCount, self)->Dtor)(vself);
50 }
51
52 int NaClCommandServiceConnectionFactory(
53 struct NaClSimpleService *vself,
54 struct NaClDesc *conn,
55 struct NaClSimpleServiceConnection **out) {
56 struct NaClCommandService *self =
57 (struct NaClCommandService *) vself;
58
59 /* our instance_data is not connection specific */
60 return NaClSimpleServiceConnectionFactoryWithInstanceData(
61 vself, conn, (void *) self->nap, out);
62 }
63
64 struct NaClSimpleServiceVtbl const kNaClCommandServiceVtbl = {
65 {
66 NaClCommandServiceDtor,
67 },
68 NaClCommandServiceConnectionFactory,
69 NaClSimpleServiceAcceptConnection,
70 NaClSimpleServiceAcceptAndSpawnHandler,
71 NaClSimpleServiceRpcHandler,
72 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698