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

Side by Side 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, 2 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
« no previous file with comments | « src/untrusted/init/simple_lock.h ('k') | src/untrusted/init/simple_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Native Client Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef NATIVE_CLIENT_SRC_UNTRUSTED_INIT_KERNEL_SERVICE_H_
6 #define NATIVE_CLIENT_SRC_UNTRUSTED_INIT_KERNEL_SERVICE_H_
7
8 namespace nacl {
9
10 class SimpleServiceConnection;
11
12 class SimpleService {
13 public:
14 SimpleService();
15
16 ~SimpleService();
17
18 int AcceptAndSpawnHandler();
19
20 void RpcHandler(SimpleServiceConnection *conn);
21
22 protected:
23 SimpleServiceConnection *ConnectionFactoryWithInstanceData(
24 int d, void *instance_data)
25 SimpleServiceConnection *ConnectionFactory(int d);
26
27 private:
28 SimpleServiceConnection *AcceptConnection();
29
30 struct NaClDesc *bound_and_cap_[2];
31
32 NaClThreadIfFactoryFunction thread_factory_fn;
33 void *thread_factory_data;
34
35 // Acceptor thread
36 scoped_ptr<Thread> acceptor_;
37
38 DISALLOW_COPY_AND_ASSIGN(SimpleService);
39 };
40
41 class SimpleServiceConnection {
42 public:
43 SimpleServiceConnection(SimpleService *server,
44 int connection,
45 void *instance_data);
46
47 ~SimpleServiceConnection();
48
49 int ServerLoop();
50
51 private:
52 NaClSimpleService *server_;
53 int connected_socket_;
54
55 void *instance_data_;
56
57 //NaClThreadInterface *thread;
58
59 DISALLOW_COPY_AND_ASSIGN(SimpleServiceConnection);
60 };
61
62 } // namespace nacl
63
64 #endif
OLDNEW
« 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