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

Unified Diff: src/untrusted/init/simple_service.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/simple_lock.h ('k') | src/untrusted/init/simple_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/untrusted/init/simple_service.h
diff --git a/src/untrusted/init/simple_service.h b/src/untrusted/init/simple_service.h
new file mode 100644
index 0000000000000000000000000000000000000000..486e20f4b108ac9806a617c88cb350831b6fcb3d
--- /dev/null
+++ b/src/untrusted/init/simple_service.h
@@ -0,0 +1,64 @@
+// 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_KERNEL_SERVICE_H_
+#define NATIVE_CLIENT_SRC_UNTRUSTED_INIT_KERNEL_SERVICE_H_
+
+namespace nacl {
+
+class SimpleServiceConnection;
+
+class SimpleService {
+ public:
+ SimpleService();
+
+ ~SimpleService();
+
+ int AcceptAndSpawnHandler();
+
+ void RpcHandler(SimpleServiceConnection *conn);
+
+ protected:
+ SimpleServiceConnection *ConnectionFactoryWithInstanceData(
+ int d, void *instance_data)
+ SimpleServiceConnection *ConnectionFactory(int d);
+
+ private:
+ SimpleServiceConnection *AcceptConnection();
+
+ struct NaClDesc *bound_and_cap_[2];
+
+ NaClThreadIfFactoryFunction thread_factory_fn;
+ void *thread_factory_data;
+
+ // Acceptor thread
+ scoped_ptr<Thread> acceptor_;
+
+ DISALLOW_COPY_AND_ASSIGN(SimpleService);
+};
+
+class SimpleServiceConnection {
+ public:
+ SimpleServiceConnection(SimpleService *server,
+ int connection,
+ void *instance_data);
+
+ ~SimpleServiceConnection();
+
+ int ServerLoop();
+
+ private:
+ NaClSimpleService *server_;
+ int connected_socket_;
+
+ void *instance_data_;
+
+ //NaClThreadInterface *thread;
+
+ DISALLOW_COPY_AND_ASSIGN(SimpleServiceConnection);
+};
+
+} // namespace nacl
+
+#endif
« no previous file with comments | « src/untrusted/init/simple_lock.h ('k') | src/untrusted/init/simple_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698