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
3 // found in the LICENSE file.
5 #ifndef LIBRARIES_NACL_IO_HTML5FS_HTML5_FS_NODE_H_
6 #define LIBRARIES_NACL_IO_HTML5FS_HTML5_FS_NODE_H_
8 #include <ppapi/c/pp_instance.h>
9 #include <ppapi/c/pp_resource.h>
10 #include "nacl_io/node.h"
15 class FileIoInterface
;
16 class FileRefInterface
;
19 class Html5FsNode
: public Node
{
21 // Normal OS operations on a node (file), can be called by the kernel
22 // directly so it must lock and unlock appropriately. These functions
23 // must not be called by the filesystem.
24 virtual Error
FSync();
25 virtual Error
GetDents(size_t offs
,
29 virtual Error
GetStat(struct stat
* stat
);
30 virtual Error
Read(const HandleAttr
& attr
,
34 virtual Error
FTruncate(off_t size
);
35 virtual Error
Write(const HandleAttr
& attr
,
40 virtual int GetType();
41 virtual Error
GetSize(off_t
* out_size
);
42 virtual Error
Fchmod(mode_t mode
);
45 Html5FsNode(Filesystem
* filesystem
, PP_Resource fileref
);
47 // Init with standard open flags
48 virtual Error
Init(int open_flags
);
49 virtual void Destroy();
52 FileIoInterface
* file_io_iface_
;
53 FileRefInterface
* file_ref_iface_
;
54 VarInterface
* var_iface_
;
55 PP_Resource fileref_resource_
;
56 PP_Resource fileio_resource_
; // 0 if the file is a directory.
61 } // namespace nacl_io
63 #endif // LIBRARIES_NACL_IO_HTML5FS_HTML5_FS_NODE_H_