| 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 #include "nacl_io/devfs/jspipe_node.h" | 5 #include "nacl_io/devfs/jspipe_node.h" |
| 6 | 6 |
| 7 #include <cstring> | 7 #include <cstring> |
| 8 | 8 |
| 9 #include "nacl_io/devfs/dev_fs.h" | 9 #include "nacl_io/devfs/dev_fs.h" |
| 10 #include "nacl_io/error.h" | 10 #include "nacl_io/error.h" |
| 11 #include "nacl_io/ioctl.h" | 11 #include "nacl_io/ioctl.h" |
| 12 #include "nacl_io/kernel_handle.h" | 12 #include "nacl_io/kernel_handle.h" |
| 13 #include "nacl_io/log.h" | 13 #include "nacl_io/log.h" |
| 14 #include "nacl_io/pepper_interface.h" | 14 #include "nacl_io/pepper_interface.h" |
| 15 | 15 |
| 16 #define TRACE(format, ...) LOG_TRACE("jspipe: " format, ##__VA_ARGS__) | 16 #define TRACE(format, ...) LOG_TRACE("jspipe: " format, ##__VA_ARGS__) |
| 17 #define ERROR(format, ...) LOG_TRACE("jspipe: " format, ##__VA_ARGS__) | 17 #define ERROR(format, ...) LOG_TRACE("jspipe: " format, ##__VA_ARGS__) |
| 18 | 18 |
| 19 namespace { | 19 namespace { |
| 20 const size_t kPostMessageBufferSize = 512*1024; | 20 const size_t kPostMessageBufferSize = 512 * 1024; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace nacl_io { | 23 namespace nacl_io { |
| 24 | 24 |
| 25 JSPipeNode::JSPipeNode(Filesystem* filesystem) | 25 JSPipeNode::JSPipeNode(Filesystem* filesystem) |
| 26 : Node(filesystem), | 26 : Node(filesystem), |
| 27 pipe_(new JSPipeEventEmitter(filesystem_->ppapi(), kPostMessageBufferSize)) | 27 pipe_(new JSPipeEventEmitter(filesystem_->ppapi(), |
| 28 { | 28 kPostMessageBufferSize)) { |
| 29 } | 29 } |
| 30 | 30 |
| 31 JSPipeEventEmitter* JSPipeNode::GetEventEmitter() { | 31 JSPipeEventEmitter* JSPipeNode::GetEventEmitter() { |
| 32 return pipe_.get(); | 32 return pipe_.get(); |
| 33 } | 33 } |
| 34 | 34 |
| 35 Error JSPipeNode::Read(const HandleAttr& attr, | 35 Error JSPipeNode::Read(const HandleAttr& attr, |
| 36 void* buf, | 36 void* buf, |
| 37 size_t count, | 37 size_t count, |
| 38 int* out_bytes) { | 38 int* out_bytes) { |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 } | 91 } |
| 92 default: | 92 default: |
| 93 TRACE("unknown ioctl: %#x", request); | 93 TRACE("unknown ioctl: %#x", request); |
| 94 break; | 94 break; |
| 95 } | 95 } |
| 96 | 96 |
| 97 return EINVAL; | 97 return EINVAL; |
| 98 } | 98 } |
| 99 | 99 |
| 100 } // namespace nacl_io | 100 } // namespace nacl_io |
| OLD | NEW |