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

Side by Side Diff: src/trusted/manifest_name_service_proxy/manifest_proxy.h

Issue 7108031: this patch adds the manifest proxy server to sel_ldr and the manifest (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: '' Created 9 years, 6 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
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 /*
2 * Copyright (c) 2011 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 #ifndef NATIVE_CLIENT_SRC_TRUSTED_MANIFEST_NAME_SERVICE_PROXY_MANIFEST_PROXY_H_
8 #define NATIVE_CLIENT_SRC_TRUSTED_MANIFEST_NAME_SERVICE_PROXY_MANIFEST_PROXY_H_
9
10 #include "native_client/src/include/nacl_base.h"
11
12 #include "native_client/src/shared/srpc/nacl_srpc.h"
13 #include "native_client/src/trusted/service_runtime/sel_ldr_thread_interface.h"
14 #include "native_client/src/trusted/simple_service/nacl_simple_service.h"
15
16 EXTERN_C_BEGIN
17
18 /*
19 * Trusted SRPC server that proxies name service lookups to the
20 * browser plugin. This is Pepper2-specific code that could, in
21 * principle, be generalized.
22 *
23 * Manifest names are "short names". These are often sonames for
24 * dynamic libraries, but may be any read-only resource that the NaCl
25 * application needs, e.g., level data files, audio samples, etc.
26 */
27
28 struct NaClManifestProxy {
29 struct NaClSimpleService base NACL_IS_REFCOUNT_SUBCLASS;
30
31 struct NaClApp *nap;
32 };
33
34 struct NaClManifestProxyConnection {
35 struct NaClSimpleServiceConnection base NACL_IS_REFCOUNT_SUBCLASS;
36
37 struct NaClMutex mu;
38 struct NaClCondVar cv;
39 int channel_initialized;
40 struct NaClSrpcChannel client_channel;
41 };
42
43 extern struct NaClSimpleServiceVtbl const kNaClManifestProxyVtbl;
44
45 /*
46 * The nap reference is used by the connection factory to initiate a
47 * reverse connection: the connection factory enqueue a callback via
48 * the NaClSecureReverseClientCtor that wakes up the connection
49 * factory which issues an upcall on the existing reverse connection
50 * to ask for a new one. When the new connection arrives, the
51 * NaClManifestProxyConnectionFactory can wrap the reverse channel in
52 * the NaClManifestConnection object, and subsequent RPC handlers use
53 * the connection object's reverse channel to forward RPC requests.
54 */
55 int NaClManifestProxyCtor(struct NaClManifestProxy *self,
56 NaClThreadIfFactoryFunction thread_factory_fn,
57 void *thread_factory_data,
58 struct NaClApp *nap);
59
60 void NaClManifestProxyDtor(struct NaClRefCount *vself);
61
62 int NaClManifestProxyConnectionCtor(struct NaClManifestProxyConnection *self,
63 struct NaClManifestProxy *server,
64 struct NaClDesc *conn);
65
66 void NaClMaifestProxyConnectionDtor(struct NaClRefCount *vself);
67
68 int NaClManifestProxyConnectionFactory(
69 struct NaClSimpleService *vself,
70 struct NaClDesc *conn,
71 struct NaClSimpleServiceConnection **out);
72
73 extern struct NaClSimpleServiceConnectionVtbl
74 const kNaClManifestProxyConnectionVtbl;
75
76 EXTERN_C_END
77
78 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698