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

Side by Side Diff: native_client_sdk/src/libraries/nacl_io/kernel_proxy.h

Issue 23005005: [NaCl SDK] nacl_io: Add initial implementations of kill and signal (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef LIBRARIES_NACL_IO_KERNEL_PROXY_H_ 5 #ifndef LIBRARIES_NACL_IO_KERNEL_PROXY_H_
6 #define LIBRARIES_NACL_IO_KERNEL_PROXY_H_ 6 #define LIBRARIES_NACL_IO_KERNEL_PROXY_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
11 #include "nacl_io/host_resolver.h" 11 #include "nacl_io/host_resolver.h"
12 #include "nacl_io/kernel_object.h" 12 #include "nacl_io/kernel_object.h"
13 #include "nacl_io/mount_factory.h" 13 #include "nacl_io/mount_factory.h"
14 #include "nacl_io/mount_socket.h" 14 #include "nacl_io/mount_socket.h"
15 #include "nacl_io/ossignal.h"
15 #include "nacl_io/ossocket.h" 16 #include "nacl_io/ossocket.h"
16 #include "nacl_io/ostypes.h" 17 #include "nacl_io/ostypes.h"
17 #include "nacl_io/osutime.h" 18 #include "nacl_io/osutime.h"
18 19
19 struct timeval; 20 struct timeval;
20 21
21 namespace nacl_io { 22 namespace nacl_io {
22 23
23 class PepperInterface; 24 class PepperInterface;
24 25
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 int prot, 119 int prot,
119 int flags, 120 int flags,
120 int fd, 121 int fd,
121 size_t offset); 122 size_t offset);
122 virtual int munmap(void* addr, size_t length); 123 virtual int munmap(void* addr, size_t length);
123 virtual int tcflush(int fd, int queue_selector); 124 virtual int tcflush(int fd, int queue_selector);
124 virtual int tcgetattr(int fd, struct termios* termios_p); 125 virtual int tcgetattr(int fd, struct termios* termios_p);
125 virtual int tcsetattr(int fd, int optional_actions, 126 virtual int tcsetattr(int fd, int optional_actions,
126 const struct termios *termios_p); 127 const struct termios *termios_p);
127 128
129 virtual int kill(pid_t pid, int sig);
130 virtual sighandler_t signal(int signum, sighandler_t handler);
131 virtual sighandler_t sigset(int signum, sighandler_t handler);
132
128 #ifdef PROVIDES_SOCKET_API 133 #ifdef PROVIDES_SOCKET_API
129 virtual int select(int nfds, fd_set* readfds, fd_set* writefds, 134 virtual int select(int nfds, fd_set* readfds, fd_set* writefds,
130 fd_set* exceptfds, struct timeval* timeout); 135 fd_set* exceptfds, struct timeval* timeout);
131 136
132 virtual int poll(struct pollfd *fds, nfds_t nfds, int timeout); 137 virtual int poll(struct pollfd *fds, nfds_t nfds, int timeout);
133 138
134 // Socket support functions 139 // Socket support functions
135 virtual int accept(int fd, struct sockaddr* addr, socklen_t* len); 140 virtual int accept(int fd, struct sockaddr* addr, socklen_t* len);
136 virtual int bind(int fd, const struct sockaddr* addr, socklen_t len); 141 virtual int bind(int fd, const struct sockaddr* addr, socklen_t len);
137 virtual int connect(int fd, const struct sockaddr* addr, socklen_t len); 142 virtual int connect(int fd, const struct sockaddr* addr, socklen_t len);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 virtual int socket(int domain, int type, int protocol); 177 virtual int socket(int domain, int type, int protocol);
173 virtual int socketpair(int domain, int type, int protocol, int* sv); 178 virtual int socketpair(int domain, int type, int protocol, int* sv);
174 #endif // PROVIDES_SOCKET_API 179 #endif // PROVIDES_SOCKET_API
175 180
176 protected: 181 protected:
177 MountFactoryMap_t factories_; 182 MountFactoryMap_t factories_;
178 sdk_util::ScopedRef<MountSocket> socket_mount_; 183 sdk_util::ScopedRef<MountSocket> socket_mount_;
179 int dev_; 184 int dev_;
180 PepperInterface* ppapi_; 185 PepperInterface* ppapi_;
181 static KernelProxy *s_instance_; 186 static KernelProxy *s_instance_;
187 sighandler_t sigwinch_handler_;
binji 2013/08/21 17:42:01 kernel_proxy is a bit of a god class, so can very
182 #ifdef PROVIDES_SOCKET_API 188 #ifdef PROVIDES_SOCKET_API
183 HostResolver host_resolver_; 189 HostResolver host_resolver_;
184 #endif 190 #endif
185 191
186 #ifdef PROVIDES_SOCKET_API 192 #ifdef PROVIDES_SOCKET_API
187 virtual int AcquireSocketHandle(int fd, ScopedKernelHandle* handle); 193 virtual int AcquireSocketHandle(int fd, ScopedKernelHandle* handle);
188 #endif 194 #endif
189 195
190 DISALLOW_COPY_AND_ASSIGN(KernelProxy); 196 DISALLOW_COPY_AND_ASSIGN(KernelProxy);
191 }; 197 };
192 198
193 } // namespace nacl_io 199 } // namespace nacl_io
194 200
195 #endif // LIBRARIES_NACL_IO_KERNEL_PROXY_H_ 201 #endif // LIBRARIES_NACL_IO_KERNEL_PROXY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698