GCC Code Coverage Report
Directory: ../ Exec Total Coverage
File: /home/iojs/build/workspace/node-test-commit-linux-coverage-daily/nodes/benchmark/out/../src/node_metadata.h Lines: 3 3 100.0 %
Date: 2021-06-02 04:11:51 Branches: 0 0 - %

Line Branch Exec Source
1
#ifndef SRC_NODE_METADATA_H_
2
#define SRC_NODE_METADATA_H_
3
4
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
5
6
#include <string>
7
#include "node_version.h"
8
9
#if HAVE_OPENSSL
10
#include <openssl/crypto.h>
11
#endif  // HAVE_OPENSSL
12
13
namespace node {
14
15
// if this is a release build and no explicit base has been set
16
// substitute the standard release download URL
17
#ifndef NODE_RELEASE_URLBASE
18
#if NODE_VERSION_IS_RELEASE
19
#define NODE_RELEASE_URLBASE "https://nodejs.org/download/release/"
20
#endif  // NODE_VERSION_IS_RELEASE
21
#endif  // NODE_RELEASE_URLBASE
22
23
#if defined(NODE_RELEASE_URLBASE)
24
#define NODE_HAS_RELEASE_URLS
25
#endif
26
27
#define NODE_VERSIONS_KEYS_BASE(V)                                             \
28
  V(node)                                                                      \
29
  V(v8)                                                                        \
30
  V(uv)                                                                        \
31
  V(zlib)                                                                      \
32
  V(brotli)                                                                    \
33
  V(ares)                                                                      \
34
  V(modules)                                                                   \
35
  V(nghttp2)                                                                   \
36
  V(napi)                                                                      \
37
  V(llhttp)                                                                    \
38
39
#if HAVE_OPENSSL
40
#define NODE_VERSIONS_KEY_CRYPTO(V) V(openssl)
41
#else
42
#define NODE_VERSIONS_KEY_CRYPTO(V)
43
#endif
44
45
#ifdef NODE_HAVE_I18N_SUPPORT
46
#define NODE_VERSIONS_KEY_INTL(V)                                              \
47
  V(cldr)                                                                      \
48
  V(icu)                                                                       \
49
  V(tz)                                                                        \
50
  V(unicode)
51
#else
52
#define NODE_VERSIONS_KEY_INTL(V)
53
#endif  // NODE_HAVE_I18N_SUPPORT
54
55
#ifdef OPENSSL_INFO_QUIC
56
#define NODE_VERSIONS_KEY_QUIC(V)                                             \
57
  V(ngtcp2)                                                                   \
58
  V(nghttp3)
59
#else
60
#define NODE_VERSIONS_KEY_QUIC(V)
61
#endif
62
63
#define NODE_VERSIONS_KEYS(V)                                                  \
64
  NODE_VERSIONS_KEYS_BASE(V)                                                   \
65
  NODE_VERSIONS_KEY_CRYPTO(V)                                                  \
66
  NODE_VERSIONS_KEY_INTL(V)                                                    \
67
  NODE_VERSIONS_KEY_QUIC(V)
68
69
4840
class Metadata {
70
 public:
71
  Metadata();
72
  Metadata(Metadata&) = delete;
73
  Metadata(Metadata&&) = delete;
74
  Metadata operator=(Metadata&) = delete;
75
  Metadata operator=(Metadata&&) = delete;
76
77
4840
  struct Versions {
78
    Versions();
79
80
#ifdef NODE_HAVE_I18N_SUPPORT
81
    // Must be called on the main thread after
82
    // i18n::InitializeICUDirectory()
83
    void InitializeIntlVersions();
84
#endif  // NODE_HAVE_I18N_SUPPORT
85
86
#define V(key) std::string key;
87
    NODE_VERSIONS_KEYS(V)
88
#undef V
89
  };
90
91
4840
  struct Release {
92
    Release();
93
94
    std::string name;
95
#if NODE_VERSION_IS_LTS
96
    std::string lts;
97
#endif  // NODE_VERSION_IS_LTS
98
99
#ifdef NODE_HAS_RELEASE_URLS
100
    std::string source_url;
101
    std::string headers_url;
102
#ifdef _WIN32
103
    std::string lib_url;
104
#endif  // _WIN32
105
#endif  // NODE_HAS_RELEASE_URLS
106
  };
107
108
  Versions versions;
109
  const Release release;
110
  const std::string arch;
111
  const std::string platform;
112
};
113
114
// Per-process global
115
namespace per_process {
116
extern Metadata metadata;
117
}
118
119
}  // namespace node
120
121
#endif  // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
122
#endif  // SRC_NODE_METADATA_H_