| OLD | NEW | 
|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_MOUNT_NODE_SOCKET_H_ | 5 #ifndef LIBRARIES_NACL_IO_MOUNT_NODE_SOCKET_H_ | 
| 6 #define LIBRARIES_NACL_IO_MOUNT_NODE_SOCKET_H_ | 6 #define LIBRARIES_NACL_IO_MOUNT_NODE_SOCKET_H_ | 
| 7 | 7 | 
| 8 #include "nacl_io/ossocket.h" | 8 #include "nacl_io/ossocket.h" | 
| 9 #ifdef PROVIDES_SOCKET_API | 9 #ifdef PROVIDES_SOCKET_API | 
| 10 | 10 | 
| 11 #include <ppapi/c/pp_errors.h> | 11 #include <ppapi/c/pp_errors.h> | 
| 12 #include <ppapi/c/pp_resource.h> | 12 #include <ppapi/c/pp_resource.h> | 
| 13 #include <ppapi/c/ppb_net_address.h> | 13 #include <ppapi/c/ppb_net_address.h> | 
| 14 | 14 | 
| 15 #include "nacl_io/mount.h" | 15 #include "nacl_io/mount.h" | 
|  | 16 #include "nacl_io/mount_node.h" | 
| 16 #include "nacl_io/pepper_interface.h" | 17 #include "nacl_io/pepper_interface.h" | 
| 17 | 18 | 
| 18 namespace nacl_io { | 19 namespace nacl_io { | 
| 19 | 20 | 
| 20 /* Only allow single maximum transfers of 64K or less. Socket users | 21 /* Only allow single maximum transfers of 64K or less. Socket users | 
| 21  * should be looping on Send/Recv size. */ | 22  * should be looping on Send/Recv size. */ | 
| 22 static const size_t MAX_SOCK_TRANSFER = 65536; | 23 static const size_t MAX_SOCK_TRANSFER = 65536; | 
| 23 | 24 | 
| 24 class MountSocket; | 25 class MountStream; | 
| 25 | 26 | 
| 26 class MountNodeSocket : public MountNode { | 27 class MountNodeSocket : public MountNode { | 
| 27  public: | 28  public: | 
| 28   explicit MountNodeSocket(Mount* mount); | 29   explicit MountNodeSocket(Mount* mount); | 
| 29 | 30 | 
| 30  protected: | 31  protected: | 
| 31   virtual void Destroy(); | 32   virtual void Destroy(); | 
| 32   virtual Error Init(int flags) = 0; | 33   virtual Error Init(int flags) = 0; | 
| 33 | 34 | 
| 34  public: | 35  public: | 
| 35   virtual uint32_t GetEventStatus(); |  | 
| 36 |  | 
| 37   // Normal read/write operations on a file (recv/send). | 36   // Normal read/write operations on a file (recv/send). | 
| 38   virtual Error Read(size_t offs, void* buf, size_t count, int* out_bytes); | 37   virtual Error Read(size_t offs, void* buf, size_t count, int* out_bytes); | 
| 39   virtual Error Write(size_t offs, | 38   virtual Error Write(size_t offs, | 
| 40                       const void* buf, | 39                       const void* buf, | 
| 41                       size_t count, | 40                       size_t count, | 
| 42                       int* out_bytes); | 41                       int* out_bytes); | 
| 43 | 42 | 
| 44   // Unsuported Functions | 43   // Unsuported Functions | 
| 45   virtual Error Accept(const struct sockaddr* addr, socklen_t len); | 44   virtual Error Accept(const struct sockaddr* addr, socklen_t len); | 
| 46   virtual Error Listen(int backlog); | 45   virtual Error Listen(int backlog); | 
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 87                                struct sockaddr* out_addr); | 86                                struct sockaddr* out_addr); | 
| 88 | 87 | 
| 89   bool IsEquivalentAddress(PP_Resource addr1, PP_Resource addr2); | 88   bool IsEquivalentAddress(PP_Resource addr1, PP_Resource addr2); | 
| 90 | 89 | 
| 91  protected: | 90  protected: | 
| 92   PP_Resource socket_resource_; | 91   PP_Resource socket_resource_; | 
| 93   PP_Resource local_addr_; | 92   PP_Resource local_addr_; | 
| 94   PP_Resource remote_addr_; | 93   PP_Resource remote_addr_; | 
| 95 | 94 | 
| 96   friend class KernelProxy; | 95   friend class KernelProxy; | 
| 97   friend class MountSocket; | 96   friend class MountStream; | 
| 98 }; | 97 }; | 
| 99 | 98 | 
| 100 | 99 | 
| 101 }  // namespace nacl_io | 100 }  // namespace nacl_io | 
| 102 | 101 | 
| 103 | 102 | 
| 104 #endif  // PROVIDES_SOCKET_API | 103 #endif  // PROVIDES_SOCKET_API | 
| 105 #endif  // LIBRARIES_NACL_IO_MOUNT_NODE_SOCKET_H_ | 104 #endif  // LIBRARIES_NACL_IO_MOUNT_NODE_SOCKET_H_ | 
| OLD | NEW | 
|---|