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-12-18 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-inl.h"
29
#include "node_internals.h"
30
31
namespace node {
32
33
1452731
inline AsyncWrap::ProviderType AsyncWrap::provider_type() const {
34
1452731
  return provider_type_;
35
}
36
37
38
737715
inline double AsyncWrap::get_async_id() const {
39
737715
  return async_id_;
40
}
41
42
43
351644
inline double AsyncWrap::get_trigger_async_id() const {
44
351644
  return trigger_async_id_;
45
}
46
47
48
265093
inline v8::MaybeLocal<v8::Value> AsyncWrap::MakeCallback(
49
    const v8::Local<v8::String> symbol,
50
    int argc,
51
    v8::Local<v8::Value>* argv) {
52
530186
  v8::Local<v8::Value> cb_v = object()->Get(symbol);
53
265093
  CHECK(cb_v->IsFunction());
54
265093
  return MakeCallback(cb_v.As<v8::Function>(), argc, argv);
55
}
56
57
58
29212
inline v8::MaybeLocal<v8::Value> AsyncWrap::MakeCallback(
59
    uint32_t index,
60
    int argc,
61
    v8::Local<v8::Value>* argv) {
62
58424
  v8::Local<v8::Value> cb_v = object()->Get(index);
63
29212
  CHECK(cb_v->IsFunction());
64
29212
  return MakeCallback(cb_v.As<v8::Function>(), argc, argv);
65
}
66
67
}  // namespace node
68
69
#endif  // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
70
71
#endif  // SRC_ASYNC_WRAP_INL_H_