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

Unified Diff: src/untrusted/init/process_lib.h

Issue 25147002: nacl_init Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/untrusted/init/name_service.cc ('k') | src/untrusted/init/process_lib.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/untrusted/init/process_lib.h
diff --git a/src/untrusted/init/process_lib.h b/src/untrusted/init/process_lib.h
new file mode 100644
index 0000000000000000000000000000000000000000..67b0364414cddd1f5c293ac654d383d521acd581
--- /dev/null
+++ b/src/untrusted/init/process_lib.h
@@ -0,0 +1,50 @@
+// Copyright (c) 2013 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_UNTRUSTED_INIT_PROCESS_H_
+#define NATIVE_CLIENT_SRC_UNTRUSTED_INIT_PROCESS_H_
+
+#include "native_client/src/shared/srpc/nacl_srpc.h"
+
+#include <string>
+#include <vector>
+
+// NaClErrorCode
+#include "native_client/src/trusted/service_runtime/nacl_error_code.h"
+
+namespace nacl {
+
+class SrpcClientConnection {
+ public:
+ SrpcClientConnection();
+ virtual ~SrpcClientConnection();
+
+ // takes ownership of desc
+ bool InitializeFromConnectedDesc(int desc);
+
+ // uses cap to derive desc, but caller retains ownership
+ bool InitializeFromConnectionCapability(int cap);
+
+ bool initialized() const { return initialized_; }
+ NaClSrpcChannel *chan() { return &chan_; }
+
+ private:
+ bool initialized_;
+ int desc_;
+ NaClSrpcChannel chan_; // POD
+};
+
+class ServiceRuntimeClient : public SrpcClientConnection {
+ public:
+ ServiceRuntimeClient() {}
+
+ // Returns an NaClErrorCode -- LOAD_OK (0) is okay, non-zero is an error.
+ NaClErrorCode RunNaClModule(int module_descriptor);
+ // module_descriptor must be a valid descriptor.
+ // irt_descriptor may be -1 if no IRT is desired.
+};
+
+} // namespace nacl
+
+#endif
« no previous file with comments | « src/untrusted/init/name_service.cc ('k') | src/untrusted/init/process_lib.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698