GCC Code Coverage Report
Directory: ../ Exec Total Coverage
File: /home/iojs/build/workspace/node-test-commit-linux-coverage-daily/nodes/benchmark/out/../src/node_dir.h Lines: 1 3 33.3 %
Date: 2020-02-19 22:14:06 Branches: 0 0 - %

Line Branch Exec Source
1
#ifndef SRC_NODE_DIR_H_
2
#define SRC_NODE_DIR_H_
3
4
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
5
6
#include "node_file.h"
7
8
namespace node {
9
10
namespace fs_dir {
11
12
// Needed to propagate `uv_dir_t`.
13
class DirHandle : public AsyncWrap {
14
 public:
15
  static constexpr int kDirHandleFieldCount = 1;
16
17
  static DirHandle* New(Environment* env, uv_dir_t* dir);
18
  ~DirHandle() override;
19
20
  static void New(const v8::FunctionCallbackInfo<v8::Value>& args);
21
  static void Read(const v8::FunctionCallbackInfo<v8::Value>& args);
22
  static void Close(const v8::FunctionCallbackInfo<v8::Value>& args);
23
24
22
  inline uv_dir_t* dir() { return dir_; }
25
26
  void MemoryInfo(MemoryTracker* tracker) const override;
27
  SET_MEMORY_INFO_NAME(DirHandle)
28
  SET_SELF_SIZE(DirHandle)
29
30
  DirHandle(const DirHandle&) = delete;
31
  DirHandle& operator=(const DirHandle&) = delete;
32
  DirHandle(const DirHandle&&) = delete;
33
  DirHandle& operator=(const DirHandle&&) = delete;
34
35
 private:
36
  DirHandle(Environment* env, v8::Local<v8::Object> obj, uv_dir_t* dir);
37
38
  // Synchronous close that emits a warning
39
  void GCClose();
40
41
  uv_dir_t* dir_;
42
  // Multiple entries are read through a single libuv call.
43
  std::vector<uv_dirent_t> dirents_;
44
  bool closing_ = false;
45
  bool closed_ = false;
46
};
47
48
}  // namespace fs_dir
49
50
}  // namespace node
51
52
#endif  // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
53
54
#endif  // SRC_NODE_DIR_H_