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

Line Branch Exec Source
1
// Copyright Joyent, Inc. and other Node contributors.
2
//
3
// Permission is hereby granted, free of charge, to any person obtaining a
4
// copy of this software and associated documentation files (the
5
// "Software"), to deal in the Software without restriction, including
6
// without limitation the rights to use, copy, modify, merge, publish,
7
// distribute, sublicense, and/or sell copies of the Software, and to permit
8
// persons to whom the Software is furnished to do so, subject to the
9
// following conditions:
10
//
11
// The above copyright notice and this permission notice shall be included
12
// in all copies or substantial portions of the Software.
13
//
14
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20
// USE OR OTHER DEALINGS IN THE SOFTWARE.
21
22
#ifndef SRC_ASYNC_WRAP_INL_H_
23
#define SRC_ASYNC_WRAP_INL_H_
24
25
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
26
27
#include "async-wrap.h"
28
#include "base-object.h"
29
#include "base-object-inl.h"
30
#include "env.h"
31
#include "env-inl.h"
32
#include "node_internals.h"
33
#include "util.h"
34
#include "util-inl.h"
35
#include "v8.h"
36
37
namespace node {
38
39
63021
inline AsyncWrap::ProviderType AsyncWrap::provider_type() const {
40
63021
  return provider_type_;
41
}
42
43
44
575585
inline double AsyncWrap::get_id() const {
45
575585
  return async_id_;
46
}
47
48
49
144337
inline double AsyncWrap::get_trigger_id() const {
50
144337
  return trigger_id_;
51
}
52
53
54
65295
inline v8::Local<v8::Value> AsyncWrap::MakeCallback(
55
    const v8::Local<v8::String> symbol,
56
    int argc,
57
    v8::Local<v8::Value>* argv) {
58
130590
  v8::Local<v8::Value> cb_v = object()->Get(symbol);
59
65295
  CHECK(cb_v->IsFunction());
60
65295
  return MakeCallback(cb_v.As<v8::Function>(), argc, argv);
61
}
62
63
64
35233
inline v8::Local<v8::Value> AsyncWrap::MakeCallback(
65
    uint32_t index,
66
    int argc,
67
    v8::Local<v8::Value>* argv) {
68
70466
  v8::Local<v8::Value> cb_v = object()->Get(index);
69
35233
  CHECK(cb_v->IsFunction());
70
35233
  return MakeCallback(cb_v.As<v8::Function>(), argc, argv);
71
}
72
73
}  // namespace node
74
75
#endif  // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
76
77
#endif  // SRC_ASYNC_WRAP_INL_H_