OLD | NEW |
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_HANDLE_H_ | 5 #ifndef LIBRARIES_NACL_IO_KERNEL_HANDLE_H_ |
6 #define LIBRARIES_NACL_IO_KERNEL_HANDLE_H_ | 6 #define LIBRARIES_NACL_IO_KERNEL_HANDLE_H_ |
7 | 7 |
8 #include <fcntl.h> | 8 #include <fcntl.h> |
9 #include <pthread.h> | 9 #include <pthread.h> |
10 #include <ppapi/c/pp_resource.h> | 10 #include <ppapi/c/pp_resource.h> |
(...skipping 22 matching lines...) Expand all Loading... |
33 | 33 |
34 off_t offs; | 34 off_t offs; |
35 int flags; | 35 int flags; |
36 }; | 36 }; |
37 | 37 |
38 // KernelHandle provides a reference counted container for the open | 38 // KernelHandle provides a reference counted container for the open |
39 // file information, such as it's filesystem, node, access type and offset. | 39 // file information, such as it's filesystem, node, access type and offset. |
40 // KernelHandle can only be referenced when the KernelProxy lock is held. | 40 // KernelHandle can only be referenced when the KernelProxy lock is held. |
41 class KernelHandle : public sdk_util::RefObject { | 41 class KernelHandle : public sdk_util::RefObject { |
42 public: | 42 public: |
43 | |
44 KernelHandle(); | 43 KernelHandle(); |
45 KernelHandle(const ScopedFilesystem& fs, const ScopedNode& node); | 44 KernelHandle(const ScopedFilesystem& fs, const ScopedNode& node); |
46 ~KernelHandle(); | 45 ~KernelHandle(); |
47 | 46 |
48 Error Init(int open_flags); | 47 Error Init(int open_flags); |
49 | 48 |
50 Error Accept(PP_Resource* new_sock, struct sockaddr* addr, socklen_t* len); | 49 Error Accept(PP_Resource* new_sock, struct sockaddr* addr, socklen_t* len); |
51 Error Connect(const struct sockaddr* addr, socklen_t len); | 50 Error Connect(const struct sockaddr* addr, socklen_t len); |
52 Error Fcntl(int request, int* result, ...); | 51 Error Fcntl(int request, int* result, ...); |
53 Error VFcntl(int request, int* result, va_list args); | 52 Error VFcntl(int request, int* result, va_list args); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 | 89 |
91 friend class KernelProxy; | 90 friend class KernelProxy; |
92 DISALLOW_COPY_AND_ASSIGN(KernelHandle); | 91 DISALLOW_COPY_AND_ASSIGN(KernelHandle); |
93 }; | 92 }; |
94 | 93 |
95 typedef sdk_util::ScopedRef<KernelHandle> ScopedKernelHandle; | 94 typedef sdk_util::ScopedRef<KernelHandle> ScopedKernelHandle; |
96 | 95 |
97 } // namespace nacl_io | 96 } // namespace nacl_io |
98 | 97 |
99 #endif // LIBRARIES_NACL_IO_KERNEL_HANDLE_H_ | 98 #endif // LIBRARIES_NACL_IO_KERNEL_HANDLE_H_ |
OLD | NEW |