GCC Code Coverage Report
Directory: ../src/ Exec Total Coverage
File: /home/node-core-coverage/node-core-coverage/workdir/node/out/../src/req-wrap.h Lines: 1 1 100.0 %
Date: 2016-11-30 Branches: 0 0 0.0 %

Line Branch Exec Source
1
#ifndef SRC_REQ_WRAP_H_
2
#define SRC_REQ_WRAP_H_
3
4
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
5
6
#include "async-wrap.h"
7
#include "env.h"
8
#include "util.h"
9
#include "v8.h"
10
11
namespace node {
12
13
template <typename T>
14
class ReqWrap : public AsyncWrap {
15
 public:
16
  inline ReqWrap(Environment* env,
17
                 v8::Local<v8::Object> object,
18
                 AsyncWrap::ProviderType provider);
19
  inline ~ReqWrap() override;
20
  inline void Dispatched();  // Call this after the req has been dispatched.
21
48820
  T* req() { return &req_; }
22
23
 private:
24
  friend class Environment;
25
  ListNode<ReqWrap> req_wrap_queue_;
26
27
 protected:
28
  // req_wrap_queue_ needs to be at a fixed offset from the start of the class
29
  // because it is used by ContainerOf to calculate the address of the embedding
30
  // ReqWrap. ContainerOf compiles down to simple, fixed pointer arithmetic.
31
  // sizeof(req_) depends on the type of T, so req_wrap_queue_ would
32
  // no longer be at a fixed offset if it came after req_.
33
  T req_;
34
};
35
36
}  // namespace node
37
38
#endif  // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
39
40
#endif  // SRC_REQ_WRAP_H_