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

Line 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
34639
ReqWrap<T>::ReqWrap(Environment* env,
18
                    v8::Local<v8::Object> object,
19
                    AsyncWrap::ProviderType provider)
20
69278
    : AsyncWrap(env, object, provider) {
21
34639
  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
69278
  env->req_wrap_queue()->PushBack(reinterpret_cast<ReqWrap<uv_req_t>*>(this));
27
34639
}
28
29
template <typename T>
30
34620
ReqWrap<T>::~ReqWrap() {
31
34620
  CHECK_EQ(req_.data, this);  // Assert that someone has called Dispatched().
32
69240
  CHECK_EQ(false, persistent().IsEmpty());
33
69240
  ClearWrap(object());
34
69240
  persistent().Reset();
35
103860
}
36
37
template <typename T>
38
void ReqWrap<T>::Dispatched() {
39
34639
  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_