GCC Code Coverage Report
Directory: ../ Exec Total Coverage
File: /home/node-core-coverage/node-core-coverage/workdir/node/out/../src/req-wrap-inl.h Lines: 13 13 100.0 %
Date: 2016-09-05 Branches: 8 12 66.7 %

Line Branch Exec Source
1
#ifndef SRC_REQ_WRAP_INL_H_
2
#define SRC_REQ_WRAP_INL_H_
3
4
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
5
6
#include "req-wrap.h"
7
#include "async-wrap.h"
8
#include "async-wrap-inl.h"
9
#include "env.h"
10
#include "env-inl.h"
11
#include "util.h"
12
#include "util-inl.h"
13
14
namespace node {
15
16
template <typename T>
17
36554
ReqWrap<T>::ReqWrap(Environment* env,
18
                    v8::Local<v8::Object> object,
19
                    AsyncWrap::ProviderType provider)
20
73108
    : AsyncWrap(env, object, provider) {
21

36554
  if (env->in_domain())
22
148
    object->Set(env->domain_string(), env->domain_array()->Get(0));
23
24
  // FIXME(bnoordhuis) The fact that a reinterpret_cast is needed is
25
  // arguably a good indicator that there should be more than one queue.
26
73108
  env->req_wrap_queue()->PushBack(reinterpret_cast<ReqWrap<uv_req_t>*>(this));
27
36554
}
28
29
template <typename T>
30
36533
ReqWrap<T>::~ReqWrap() {
31

36533
  CHECK_EQ(req_.data, this);  // Assert that someone has called Dispatched().
32

73066
  CHECK_EQ(false, persistent().IsEmpty());
33
73066
  ClearWrap(object());
34
73066
  persistent().Reset();
35
109599
}
36
37
template <typename T>
38
void ReqWrap<T>::Dispatched() {
39
36554
  req_.data = this;
40
}
41
42
}  // namespace node
43
44
#endif  // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
45
46
#endif  // SRC_REQ_WRAP_INL_H_