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 5 20.0 %
Date: 2019-10-08 22:34:21 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
#include "node.h"
8
#include "req_wrap-inl.h"
9
10
namespace node {
11
12
namespace fs_dir {
13
14
// Needed to propagate `uv_dir_t`.
15
class DirHandle : public AsyncWrap {
16
 public:
17
  static constexpr int kDirHandleFieldCount = 1;
18
19
  static DirHandle* New(Environment* env, uv_dir_t* dir);
20
  ~DirHandle() override;
21
22
  static void New(const v8::FunctionCallbackInfo<v8::Value>& args);
23
  static void Open(const v8::FunctionCallbackInfo<Value>& args);
24
  static void Read(const v8::FunctionCallbackInfo<Value>& args);
25
  static void Close(const v8::FunctionCallbackInfo<Value>& args);
26
27
34
  inline uv_dir_t* dir() { return dir_; }
28
  AsyncWrap* GetAsyncWrap() { return this; }
29
30
  void MemoryInfo(MemoryTracker* tracker) const override {
31
    tracker->TrackFieldWithSize("dir", sizeof(*dir_));
32
  }
33
34
  SET_MEMORY_INFO_NAME(DirHandle)
35
  SET_SELF_SIZE(DirHandle)
36
37
  DirHandle(const DirHandle&) = delete;
38
  DirHandle& operator=(const DirHandle&) = delete;
39
  DirHandle(const DirHandle&&) = delete;
40
  DirHandle& operator=(const DirHandle&&) = delete;
41
42
 private:
43
  DirHandle(Environment* env, v8::Local<v8::Object> obj, uv_dir_t* dir);
44
45
  // Synchronous close that emits a warning
46
  void GCClose();
47
48
  uv_dir_t* dir_;
49
  uv_dirent_t dirent_;
50
  bool closing_ = false;
51
  bool closed_ = false;
52
};
53
54
}  // namespace fs_dir
55
56
}  // namespace node
57
58
#endif  // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
59
60
#endif  // SRC_NODE_DIR_H_