| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_DEVFS_JSPIPE_NODE_H_ | 5 #ifndef LIBRARIES_NACL_IO_DEVFS_JSPIPE_NODE_H_ |
| 6 #define LIBRARIES_NACL_IO_DEVFS_JSPIPE_NODE_H_ | 6 #define LIBRARIES_NACL_IO_DEVFS_JSPIPE_NODE_H_ |
| 7 | 7 |
| 8 #include <ppapi/c/pp_var.h> | 8 #include <ppapi/c/pp_var.h> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 * the other end. | 37 * the other end. |
| 38 * For example: { pipe: 'jspipe1', operation: 'ack', payload: 234 } | 38 * For example: { pipe: 'jspipe1', operation: 'ack', payload: 234 } |
| 39 * | 39 * |
| 40 * Messages coming from JavaScript must be delivered using the | 40 * Messages coming from JavaScript must be delivered using the |
| 41 * NACL_IOC_HANDLEMESSAGE ioctl on the file handle. | 41 * NACL_IOC_HANDLEMESSAGE ioctl on the file handle. |
| 42 */ | 42 */ |
| 43 class JSPipeNode : public Node { | 43 class JSPipeNode : public Node { |
| 44 public: | 44 public: |
| 45 explicit JSPipeNode(Filesystem* filesystem); | 45 explicit JSPipeNode(Filesystem* filesystem); |
| 46 | 46 |
| 47 virtual void Destroy() { LOG_TRACE("JSPipeNode: Destroy"); }; | 47 virtual void Destroy() { |
| 48 LOG_TRACE("JSPipeNode: Destroy"); |
| 49 } |
| 48 | 50 |
| 49 virtual JSPipeEventEmitter* GetEventEmitter(); | 51 virtual JSPipeEventEmitter* GetEventEmitter(); |
| 50 | 52 |
| 51 virtual Error VIoctl(int request, va_list args); | 53 virtual Error VIoctl(int request, va_list args); |
| 52 | 54 |
| 53 virtual Error Read(const HandleAttr& attr, | 55 virtual Error Read(const HandleAttr& attr, |
| 54 void* buf, | 56 void* buf, |
| 55 size_t count, | 57 size_t count, |
| 56 int* out_bytes); | 58 int* out_bytes); |
| 57 virtual Error Write(const HandleAttr& attr, | 59 virtual Error Write(const HandleAttr& attr, |
| 58 const void* buf, | 60 const void* buf, |
| 59 size_t count, | 61 size_t count, |
| 60 int* out_bytes); | 62 int* out_bytes); |
| 61 | 63 |
| 62 protected: | 64 protected: |
| 63 Error SendAck(); | 65 Error SendAck(); |
| 64 | 66 |
| 65 ScopedJSPipeEventEmitter pipe_; | 67 ScopedJSPipeEventEmitter pipe_; |
| 66 }; | 68 }; |
| 67 | 69 |
| 68 } // namespace nacl_io | 70 } // namespace nacl_io |
| 69 | 71 |
| 70 #endif // LIBRARIES_NACL_IO_DEVFS_JSPIPE_NODE_H_ | 72 #endif // LIBRARIES_NACL_IO_DEVFS_JSPIPE_NODE_H_ |
| OLD | NEW |