OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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_MEMFS_MEM_FS_NODE_H_ | 5 #ifndef LIBRARIES_NACL_IO_MEMFS_MEM_FS_NODE_H_ |
6 #define LIBRARIES_NACL_IO_MEMFS_MEM_FS_NODE_H_ | 6 #define LIBRARIES_NACL_IO_MEMFS_MEM_FS_NODE_H_ |
7 | 7 |
8 #include "nacl_io/node.h" | 8 #include "nacl_io/node.h" |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 13 matching lines...) Expand all Loading... |
24 void* buf, | 24 void* buf, |
25 size_t count, | 25 size_t count, |
26 int* out_bytes); | 26 int* out_bytes); |
27 virtual Error Write(const HandleAttr& attr, | 27 virtual Error Write(const HandleAttr& attr, |
28 const void* buf, | 28 const void* buf, |
29 size_t count, | 29 size_t count, |
30 int* out_bytes); | 30 int* out_bytes); |
31 virtual Error FTruncate(off_t size); | 31 virtual Error FTruncate(off_t size); |
32 | 32 |
33 private: | 33 private: |
34 void Resize(off_t size); | 34 Error Resize(off_t size); |
35 | 35 |
36 std::vector<char> data_; | 36 char* data_; |
| 37 size_t data_capacity_; |
37 friend class MemFs; | 38 friend class MemFs; |
38 }; | 39 }; |
39 | 40 |
40 } // namespace nacl_io | 41 } // namespace nacl_io |
41 | 42 |
42 #endif // LIBRARIES_NACL_IO_MEMFS_MEM_FS_NODE_H_ | 43 #endif // LIBRARIES_NACL_IO_MEMFS_MEM_FS_NODE_H_ |
OLD | NEW |