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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: src/trusted/manifest_name_service_proxy/manifest_proxy.h
===================================================================
--- src/trusted/manifest_name_service_proxy/manifest_proxy.h (revision 0)
+++ src/trusted/manifest_name_service_proxy/manifest_proxy.h (revision 0)
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2011 The Native Client Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef NATIVE_CLIENT_SRC_TRUSTED_MANIFEST_NAME_SERVICE_PROXY_MANIFEST_PROXY_H_
+#define NATIVE_CLIENT_SRC_TRUSTED_MANIFEST_NAME_SERVICE_PROXY_MANIFEST_PROXY_H_
+
+#include "native_client/src/include/nacl_base.h"
+
+#include "native_client/src/shared/srpc/nacl_srpc.h"
+#include "native_client/src/trusted/service_runtime/sel_ldr_thread_interface.h"
+#include "native_client/src/trusted/simple_service/nacl_simple_service.h"
+
+EXTERN_C_BEGIN
+
+/*
+ * Trusted SRPC server that proxies name service lookups to the
+ * browser plugin. This is Pepper2-specific code that could, in
+ * principle, be generalized.
+ *
+ * Manifest names are "short names". These are often sonames for
+ * dynamic libraries, but may be any read-only resource that the NaCl
+ * application needs, e.g., level data files, audio samples, etc.
+ */
+
+struct NaClManifestProxy {
+ struct NaClSimpleService base NACL_IS_REFCOUNT_SUBCLASS;
+
+ struct NaClApp *nap;
+};
+
+struct NaClManifestProxyConnection {
+ struct NaClSimpleServiceConnection base NACL_IS_REFCOUNT_SUBCLASS;
+
+ struct NaClMutex mu;
+ struct NaClCondVar cv;
+ int channel_initialized;
+ struct NaClSrpcChannel client_channel;
+};
+
+extern struct NaClSimpleServiceVtbl const kNaClManifestProxyVtbl;
+
+/*
+ * The nap reference is used by the connection factory to initiate a
+ * reverse connection: the connection factory enqueue a callback via
+ * the NaClSecureReverseClientCtor that wakes up the connection
+ * factory which issues an upcall on the existing reverse connection
+ * to ask for a new one. When the new connection arrives, the
+ * NaClManifestProxyConnectionFactory can wrap the reverse channel in
+ * the NaClManifestConnection object, and subsequent RPC handlers use
+ * the connection object's reverse channel to forward RPC requests.
+ */
+int NaClManifestProxyCtor(struct NaClManifestProxy *self,
+ NaClThreadIfFactoryFunction thread_factory_fn,
+ void *thread_factory_data,
+ struct NaClApp *nap);
+
+void NaClManifestProxyDtor(struct NaClRefCount *vself);
+
+int NaClManifestProxyConnectionCtor(struct NaClManifestProxyConnection *self,
+ struct NaClManifestProxy *server,
+ struct NaClDesc *conn);
+
+void NaClMaifestProxyConnectionDtor(struct NaClRefCount *vself);
+
+int NaClManifestProxyConnectionFactory(
+ struct NaClSimpleService *vself,
+ struct NaClDesc *conn,
+ struct NaClSimpleServiceConnection **out);
+
+extern struct NaClSimpleServiceConnectionVtbl
+ const kNaClManifestProxyConnectionVtbl;
+
+EXTERN_C_END
+
+#endif
Property changes on: src/trusted/manifest_name_service_proxy/manifest_proxy.h
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698