GCC Code Coverage Report
Directory: ../ Exec Total Coverage
File: /home/iojs/build/workspace/node-test-commit-linux-coverage/nodes/benchmark/out/../src/req-wrap-inl.h Lines: 14 14 100.0 %
Date: 2017-06-14 Branches: 10 16 62.5 %

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
35069
ReqWrap<T>::ReqWrap(Environment* env,
18
                    v8::Local<v8::Object> object,
19
                    AsyncWrap::ProviderType provider)
20
35069
    : AsyncWrap(env, object, provider) {
21

35069
  if (env->in_domain())
22
123
    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
35069
  env->req_wrap_queue()->PushBack(reinterpret_cast<ReqWrap<uv_req_t>*>(this));
27
35069
}
28
29
template <typename T>
30
34522
ReqWrap<T>::~ReqWrap() {
31

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

69044
  CHECK_EQ(false, persistent().IsEmpty());
33
34522
  persistent().Reset();
34

69044
}
35
36
template <typename T>
37
35069
void ReqWrap<T>::Dispatched() {
38
35069
  req_.data = this;
39
35069
}
40
41
}  // namespace node
42
43
#endif  // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
44
45
#endif  // SRC_REQ_WRAP_INL_H_