GCC Code Coverage Report
Directory: ../src/ Exec Total Coverage
File: /home/node-core-coverage/node-core-coverage/workdir/node/out/../src/env.h Lines: 4 4 100.0 %
Date: 2016-11-30 Branches: 0 0 0.0 %

Line Branch Exec Source
1
#ifndef SRC_ENV_H_
2
#define SRC_ENV_H_
3
4
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
5
6
#include "ares.h"
7
#include "debug-agent.h"
8
#if HAVE_INSPECTOR
9
#include "inspector_agent.h"
10
#endif
11
#include "handle_wrap.h"
12
#include "req-wrap.h"
13
#include "tree.h"
14
#include "util.h"
15
#include "uv.h"
16
#include "v8.h"
17
18
#include <stdint.h>
19
20
// Caveat emptor: we're going slightly crazy with macros here but the end
21
// hopefully justifies the means. We have a lot of per-context properties
22
// and adding and maintaining their getters and setters by hand would be
23
// a nightmare so let's make the preprocessor generate them for us.
24
//
25
// Make sure that any macros defined here are undefined again at the bottom
26
// of context-inl.h. The exceptions are NODE_CONTEXT_EMBEDDER_DATA_INDEX
27
// and NODE_ISOLATE_SLOT, they may have been defined externally.
28
namespace node {
29
30
// Pick an index that's hopefully out of the way when we're embedded inside
31
// another application. Performance-wise or memory-wise it doesn't matter:
32
// Context::SetAlignedPointerInEmbedderData() is backed by a FixedArray,
33
// worst case we pay a one-time penalty for resizing the array.
34
#ifndef NODE_CONTEXT_EMBEDDER_DATA_INDEX
35
#define NODE_CONTEXT_EMBEDDER_DATA_INDEX 32
36
#endif
37
38
// The slot 0 and 1 had already been taken by "gin" and "blink" in Chrome,
39
// and the size of isolate's slots is 4 by default, so using 3 should
40
// hopefully make node work independently when embedded into other
41
// application.
42
#ifndef NODE_ISOLATE_SLOT
43
#define NODE_ISOLATE_SLOT 3
44
#endif
45
46
// The number of items passed to push_values_to_array_function has diminishing
47
// returns around 8. This should be used at all call sites using said function.
48
#ifndef NODE_PUSH_VAL_TO_ARRAY_MAX
49
#define NODE_PUSH_VAL_TO_ARRAY_MAX 8
50
#endif
51
52
// Private symbols are per-isolate primitives but Environment proxies them
53
// for the sake of convenience.  Strings should be ASCII-only and have a
54
// "node:" prefix to avoid name clashes with third-party code.
55
#define PER_ISOLATE_PRIVATE_SYMBOL_PROPERTIES(V)                              \
56
  V(alpn_buffer_private_symbol, "node:alpnBuffer")                            \
57
  V(arrow_message_private_symbol, "node:arrowMessage")                        \
58
  V(contextify_context_private_symbol, "node:contextify:context")             \
59
  V(contextify_global_private_symbol, "node:contextify:global")               \
60
  V(decorated_private_symbol, "node:decorated")                               \
61
  V(npn_buffer_private_symbol, "node:npnBuffer")                              \
62
  V(processed_private_symbol, "node:processed")                               \
63
  V(selected_npn_buffer_private_symbol, "node:selectedNpnBuffer")             \
64
65
// Strings are per-isolate primitives but Environment proxies them
66
// for the sake of convenience.  Strings should be ASCII-only.
67
#define PER_ISOLATE_STRING_PROPERTIES(V)                                      \
68
  V(address_string, "address")                                                \
69
  V(args_string, "args")                                                      \
70
  V(async, "async")                                                           \
71
  V(async_queue_string, "_asyncQueue")                                        \
72
  V(buffer_string, "buffer")                                                  \
73
  V(bytes_string, "bytes")                                                    \
74
  V(bytes_parsed_string, "bytesParsed")                                       \
75
  V(bytes_read_string, "bytesRead")                                           \
76
  V(cached_data_string, "cachedData")                                         \
77
  V(cached_data_produced_string, "cachedDataProduced")                        \
78
  V(cached_data_rejected_string, "cachedDataRejected")                        \
79
  V(callback_string, "callback")                                              \
80
  V(change_string, "change")                                                  \
81
  V(oncertcb_string, "oncertcb")                                              \
82
  V(onclose_string, "_onclose")                                               \
83
  V(code_string, "code")                                                      \
84
  V(cwd_string, "cwd")                                                        \
85
  V(dest_string, "dest")                                                      \
86
  V(detached_string, "detached")                                              \
87
  V(disposed_string, "_disposed")                                             \
88
  V(domain_string, "domain")                                                  \
89
  V(emitting_top_level_domain_error_string, "_emittingTopLevelDomainError")   \
90
  V(exchange_string, "exchange")                                              \
91
  V(idle_string, "idle")                                                      \
92
  V(irq_string, "irq")                                                        \
93
  V(encoding_string, "encoding")                                              \
94
  V(enter_string, "enter")                                                    \
95
  V(env_pairs_string, "envPairs")                                             \
96
  V(errno_string, "errno")                                                    \
97
  V(error_string, "error")                                                    \
98
  V(events_string, "_events")                                                 \
99
  V(exiting_string, "_exiting")                                               \
100
  V(exit_code_string, "exitCode")                                             \
101
  V(exit_string, "exit")                                                      \
102
  V(expire_string, "expire")                                                  \
103
  V(exponent_string, "exponent")                                              \
104
  V(exports_string, "exports")                                                \
105
  V(ext_key_usage_string, "ext_key_usage")                                    \
106
  V(external_string, "external")                                              \
107
  V(external_stream_string, "_externalStream")                                \
108
  V(family_string, "family")                                                  \
109
  V(fatal_exception_string, "_fatalException")                                \
110
  V(fd_string, "fd")                                                          \
111
  V(file_string, "file")                                                      \
112
  V(fingerprint_string, "fingerprint")                                        \
113
  V(flags_string, "flags")                                                    \
114
  V(gid_string, "gid")                                                        \
115
  V(handle_string, "handle")                                                  \
116
  V(heap_total_string, "heapTotal")                                           \
117
  V(heap_used_string, "heapUsed")                                             \
118
  V(homedir_string, "homedir")                                                \
119
  V(hostmaster_string, "hostmaster")                                          \
120
  V(ignore_string, "ignore")                                                  \
121
  V(immediate_callback_string, "_immediateCallback")                          \
122
  V(infoaccess_string, "infoAccess")                                          \
123
  V(inherit_string, "inherit")                                                \
124
  V(input_string, "input")                                                    \
125
  V(internal_string, "internal")                                              \
126
  V(ipv4_string, "IPv4")                                                      \
127
  V(ipv6_string, "IPv6")                                                      \
128
  V(isalive_string, "isAlive")                                                \
129
  V(isclosing_string, "isClosing")                                            \
130
  V(issuer_string, "issuer")                                                  \
131
  V(issuercert_string, "issuerCertificate")                                   \
132
  V(kill_signal_string, "killSignal")                                         \
133
  V(mac_string, "mac")                                                        \
134
  V(max_buffer_string, "maxBuffer")                                           \
135
  V(message_string, "message")                                                \
136
  V(minttl_string, "minttl")                                                  \
137
  V(model_string, "model")                                                    \
138
  V(modulus_string, "modulus")                                                \
139
  V(name_string, "name")                                                      \
140
  V(netmask_string, "netmask")                                                \
141
  V(nice_string, "nice")                                                      \
142
  V(nsname_string, "nsname")                                                  \
143
  V(ocsp_request_string, "OCSPRequest")                                       \
144
  V(onchange_string, "onchange")                                              \
145
  V(onclienthello_string, "onclienthello")                                    \
146
  V(oncomplete_string, "oncomplete")                                          \
147
  V(onconnection_string, "onconnection")                                      \
148
  V(ondone_string, "ondone")                                                  \
149
  V(onerror_string, "onerror")                                                \
150
  V(onexit_string, "onexit")                                                  \
151
  V(onhandshakedone_string, "onhandshakedone")                                \
152
  V(onhandshakestart_string, "onhandshakestart")                              \
153
  V(onmessage_string, "onmessage")                                            \
154
  V(onnewsession_string, "onnewsession")                                      \
155
  V(onnewsessiondone_string, "onnewsessiondone")                              \
156
  V(onocspresponse_string, "onocspresponse")                                  \
157
  V(onread_string, "onread")                                                  \
158
  V(onreadstart_string, "onreadstart")                                        \
159
  V(onreadstop_string, "onreadstop")                                          \
160
  V(onselect_string, "onselect")                                              \
161
  V(onshutdown_string, "onshutdown")                                          \
162
  V(onsignal_string, "onsignal")                                              \
163
  V(onstop_string, "onstop")                                                  \
164
  V(onwrite_string, "onwrite")                                                \
165
  V(output_string, "output")                                                  \
166
  V(order_string, "order")                                                    \
167
  V(owner_string, "owner")                                                    \
168
  V(parse_error_string, "Parse Error")                                        \
169
  V(path_string, "path")                                                      \
170
  V(pbkdf2_error_string, "PBKDF2 Error")                                      \
171
  V(pid_string, "pid")                                                        \
172
  V(pipe_string, "pipe")                                                      \
173
  V(port_string, "port")                                                      \
174
  V(preference_string, "preference")                                          \
175
  V(priority_string, "priority")                                              \
176
  V(produce_cached_data_string, "produceCachedData")                          \
177
  V(raw_string, "raw")                                                        \
178
  V(readable_string, "readable")                                              \
179
  V(received_shutdown_string, "receivedShutdown")                             \
180
  V(refresh_string, "refresh")                                                \
181
  V(regexp_string, "regexp")                                                  \
182
  V(rename_string, "rename")                                                  \
183
  V(replacement_string, "replacement")                                        \
184
  V(retry_string, "retry")                                                    \
185
  V(rss_string, "rss")                                                        \
186
  V(serial_string, "serial")                                                  \
187
  V(scopeid_string, "scopeid")                                                \
188
  V(sent_shutdown_string, "sentShutdown")                                     \
189
  V(serial_number_string, "serialNumber")                                     \
190
  V(service_string, "service")                                                \
191
  V(servername_string, "servername")                                          \
192
  V(session_id_string, "sessionId")                                           \
193
  V(shell_string, "shell")                                                    \
194
  V(signal_string, "signal")                                                  \
195
  V(size_string, "size")                                                      \
196
  V(sni_context_err_string, "Invalid SNI context")                            \
197
  V(sni_context_string, "sni_context")                                        \
198
  V(speed_string, "speed")                                                    \
199
  V(stack_string, "stack")                                                    \
200
  V(status_string, "status")                                                  \
201
  V(stdio_string, "stdio")                                                    \
202
  V(subject_string, "subject")                                                \
203
  V(subjectaltname_string, "subjectaltname")                                  \
204
  V(sys_string, "sys")                                                        \
205
  V(syscall_string, "syscall")                                                \
206
  V(tick_callback_string, "_tickCallback")                                    \
207
  V(tick_domain_cb_string, "_tickDomainCallback")                             \
208
  V(ticketkeycallback_string, "onticketkeycallback")                          \
209
  V(timeout_string, "timeout")                                                \
210
  V(times_string, "times")                                                    \
211
  V(tls_ticket_string, "tlsTicket")                                           \
212
  V(type_string, "type")                                                      \
213
  V(uid_string, "uid")                                                        \
214
  V(unknown_string, "<unknown>")                                              \
215
  V(user_string, "user")                                                      \
216
  V(username_string, "username")                                              \
217
  V(valid_from_string, "valid_from")                                          \
218
  V(valid_to_string, "valid_to")                                              \
219
  V(verify_error_string, "verifyError")                                       \
220
  V(version_string, "version")                                                \
221
  V(weight_string, "weight")                                                  \
222
  V(windows_verbatim_arguments_string, "windowsVerbatimArguments")            \
223
  V(wrap_string, "wrap")                                                      \
224
  V(writable_string, "writable")                                              \
225
  V(write_queue_size_string, "writeQueueSize")                                \
226
  V(x_forwarded_string, "x-forwarded-for")                                    \
227
  V(zero_return_string, "ZERO_RETURN")                                        \
228
229
#define ENVIRONMENT_STRONG_PERSISTENT_PROPERTIES(V)                           \
230
  V(as_external, v8::External)                                                \
231
  V(async_hooks_destroy_function, v8::Function)                               \
232
  V(async_hooks_init_function, v8::Function)                                  \
233
  V(async_hooks_post_function, v8::Function)                                  \
234
  V(async_hooks_pre_function, v8::Function)                                   \
235
  V(binding_cache_object, v8::Object)                                         \
236
  V(buffer_constructor_function, v8::Function)                                \
237
  V(buffer_prototype_object, v8::Object)                                      \
238
  V(context, v8::Context)                                                     \
239
  V(domain_array, v8::Array)                                                  \
240
  V(domains_stack_array, v8::Array)                                           \
241
  V(fs_stats_constructor_function, v8::Function)                              \
242
  V(generic_internal_field_template, v8::ObjectTemplate)                      \
243
  V(jsstream_constructor_template, v8::FunctionTemplate)                      \
244
  V(module_load_list_array, v8::Array)                                        \
245
  V(pipe_constructor_template, v8::FunctionTemplate)                          \
246
  V(process_object, v8::Object)                                               \
247
  V(promise_reject_function, v8::Function)                                    \
248
  V(push_values_to_array_function, v8::Function)                              \
249
  V(script_context_constructor_template, v8::FunctionTemplate)                \
250
  V(script_data_constructor_function, v8::Function)                           \
251
  V(secure_context_constructor_template, v8::FunctionTemplate)                \
252
  V(tcp_constructor_template, v8::FunctionTemplate)                           \
253
  V(tick_callback_function, v8::Function)                                     \
254
  V(tls_wrap_constructor_function, v8::Function)                              \
255
  V(tls_wrap_constructor_template, v8::FunctionTemplate)                      \
256
  V(tty_constructor_template, v8::FunctionTemplate)                           \
257
  V(udp_constructor_function, v8::Function)                                   \
258
  V(write_wrap_constructor_function, v8::Function)                            \
259
260
class Environment;
261
262
struct node_ares_task {
263
  Environment* env;
264
  ares_socket_t sock;
265
  uv_poll_t poll_watcher;
266
  RB_ENTRY(node_ares_task) node;
267
};
268
269
RB_HEAD(node_ares_task_list, node_ares_task);
270
271
class IsolateData {
272
 public:
273
  inline IsolateData(v8::Isolate* isolate, uv_loop_t* event_loop,
274
                     uint32_t* zero_fill_field = nullptr);
275
  inline uv_loop_t* event_loop() const;
276
  inline uint32_t* zero_fill_field() const;
277
278
#define VP(PropertyName, StringValue) V(v8::Private, PropertyName)
279
#define VS(PropertyName, StringValue) V(v8::String, PropertyName)
280
#define V(TypeName, PropertyName)                                             \
281
  inline v8::Local<TypeName> PropertyName(v8::Isolate* isolate) const;
282
  PER_ISOLATE_PRIVATE_SYMBOL_PROPERTIES(VP)
283
  PER_ISOLATE_STRING_PROPERTIES(VS)
284
#undef V
285
#undef VS
286
#undef VP
287
288
 private:
289
#define VP(PropertyName, StringValue) V(v8::Private, PropertyName)
290
#define VS(PropertyName, StringValue) V(v8::String, PropertyName)
291
#define V(TypeName, PropertyName)                                             \
292
  v8::Eternal<TypeName> PropertyName ## _;
293
  PER_ISOLATE_PRIVATE_SYMBOL_PROPERTIES(VP)
294
  PER_ISOLATE_STRING_PROPERTIES(VS)
295
#undef V
296
#undef VS
297
#undef VP
298
299
  uv_loop_t* const event_loop_;
300
  uint32_t* const zero_fill_field_;
301
302
  DISALLOW_COPY_AND_ASSIGN(IsolateData);
303
};
304
305
class Environment {
306
 public:
307
  class AsyncHooks {
308
   public:
309
    inline uint32_t* fields();
310
    inline int fields_count() const;
311
    inline bool callbacks_enabled();
312
    inline void set_enable_callbacks(uint32_t flag);
313
314
   private:
315
    friend class Environment;  // So we can call the constructor.
316
    inline AsyncHooks();
317
318
    enum Fields {
319
      // Set this to not zero if the init hook should be called.
320
      kEnableCallbacks,
321
      kFieldsCount
322
    };
323
324
    uint32_t fields_[kFieldsCount];
325
326
    DISALLOW_COPY_AND_ASSIGN(AsyncHooks);
327
  };
328
329
  class AsyncCallbackScope {
330
   public:
331
    explicit AsyncCallbackScope(Environment* env);
332
    ~AsyncCallbackScope();
333
334
    inline bool in_makecallback();
335
336
   private:
337
    Environment* env_;
338
339
    DISALLOW_COPY_AND_ASSIGN(AsyncCallbackScope);
340
  };
341
342
  class DomainFlag {
343
   public:
344
    inline uint32_t* fields();
345
    inline int fields_count() const;
346
    inline uint32_t count() const;
347
348
   private:
349
    friend class Environment;  // So we can call the constructor.
350
    inline DomainFlag();
351
352
    enum Fields {
353
      kCount,
354
      kFieldsCount
355
    };
356
357
    uint32_t fields_[kFieldsCount];
358
359
    DISALLOW_COPY_AND_ASSIGN(DomainFlag);
360
  };
361
362
  class TickInfo {
363
   public:
364
    inline uint32_t* fields();
365
    inline int fields_count() const;
366
    inline uint32_t index() const;
367
    inline uint32_t length() const;
368
    inline void set_index(uint32_t value);
369
370
   private:
371
    friend class Environment;  // So we can call the constructor.
372
    inline TickInfo();
373
374
    enum Fields {
375
      kIndex,
376
      kLength,
377
      kFieldsCount
378
    };
379
380
    uint32_t fields_[kFieldsCount];
381
382
    DISALLOW_COPY_AND_ASSIGN(TickInfo);
383
  };
384
385
  typedef void (*HandleCleanupCb)(Environment* env,
386
                                  uv_handle_t* handle,
387
                                  void* arg);
388
389
14892
  class HandleCleanup {
390
   private:
391
    friend class Environment;
392
393
    HandleCleanup(uv_handle_t* handle, HandleCleanupCb cb, void* arg)
394
        : handle_(handle),
395
          cb_(cb),
396
16878
          arg_(arg) {
397
    }
398
399
    uv_handle_t* handle_;
400
    HandleCleanupCb cb_;
401
    void* arg_;
402
    ListNode<HandleCleanup> handle_cleanup_queue_;
403
  };
404
405
  static inline Environment* GetCurrent(v8::Isolate* isolate);
406
  static inline Environment* GetCurrent(v8::Local<v8::Context> context);
407
  static inline Environment* GetCurrent(
408
      const v8::FunctionCallbackInfo<v8::Value>& info);
409
410
  template <typename T>
411
  static inline Environment* GetCurrent(
412
      const v8::PropertyCallbackInfo<T>& info);
413
414
  inline Environment(IsolateData* isolate_data, v8::Local<v8::Context> context);
415
  inline ~Environment();
416
417
  void Start(int argc,
418
             const char* const* argv,
419
             int exec_argc,
420
             const char* const* exec_argv,
421
             bool start_profiler_idle_notifier);
422
  void AssignToContext(v8::Local<v8::Context> context);
423
424
  void StartProfilerIdleNotifier();
425
  void StopProfilerIdleNotifier();
426
427
  inline v8::Isolate* isolate() const;
428
  inline uv_loop_t* event_loop() const;
429
  inline bool async_wrap_callbacks_enabled() const;
430
  inline bool in_domain() const;
431
  inline uint32_t watched_providers() const;
432
433
  static inline Environment* from_immediate_check_handle(uv_check_t* handle);
434
  inline uv_check_t* immediate_check_handle();
435
  inline uv_idle_t* immediate_idle_handle();
436
437
  // Register clean-up cb to be called on environment destruction.
438
  inline void RegisterHandleCleanup(uv_handle_t* handle,
439
                                    HandleCleanupCb cb,
440
                                    void *arg);
441
  inline void FinishHandleCleanup(uv_handle_t* handle);
442
443
  inline AsyncHooks* async_hooks();
444
  inline DomainFlag* domain_flag();
445
  inline TickInfo* tick_info();
446
  inline uint64_t timer_base() const;
447
448
  static inline Environment* from_cares_timer_handle(uv_timer_t* handle);
449
  inline uv_timer_t* cares_timer_handle();
450
  inline ares_channel cares_channel();
451
  inline ares_channel* cares_channel_ptr();
452
  inline node_ares_task_list* cares_task_list();
453
  inline IsolateData* isolate_data() const;
454
455
  inline bool using_domains() const;
456
  inline void set_using_domains(bool value);
457
458
  inline bool printed_error() const;
459
  inline void set_printed_error(bool value);
460
461
  void PrintSyncTrace() const;
462
  inline void set_trace_sync_io(bool value);
463
464
  inline int64_t get_async_wrap_uid();
465
466
  inline uint32_t* heap_statistics_buffer() const;
467
  inline void set_heap_statistics_buffer(uint32_t* pointer);
468
469
  inline uint32_t* heap_space_statistics_buffer() const;
470
  inline void set_heap_space_statistics_buffer(uint32_t* pointer);
471
472
  inline char* http_parser_buffer() const;
473
  inline void set_http_parser_buffer(char* buffer);
474
475
  inline void ThrowError(const char* errmsg);
476
  inline void ThrowTypeError(const char* errmsg);
477
  inline void ThrowRangeError(const char* errmsg);
478
  inline void ThrowErrnoException(int errorno,
479
                                  const char* syscall = nullptr,
480
                                  const char* message = nullptr,
481
                                  const char* path = nullptr);
482
  inline void ThrowUVException(int errorno,
483
                               const char* syscall = nullptr,
484
                               const char* message = nullptr,
485
                               const char* path = nullptr,
486
                               const char* dest = nullptr);
487
488
  inline v8::Local<v8::FunctionTemplate>
489
      NewFunctionTemplate(v8::FunctionCallback callback,
490
                          v8::Local<v8::Signature> signature =
491
                              v8::Local<v8::Signature>());
492
493
  // Convenience methods for NewFunctionTemplate().
494
  inline void SetMethod(v8::Local<v8::Object> that,
495
                        const char* name,
496
                        v8::FunctionCallback callback);
497
  inline void SetProtoMethod(v8::Local<v8::FunctionTemplate> that,
498
                             const char* name,
499
                             v8::FunctionCallback callback);
500
  inline void SetTemplateMethod(v8::Local<v8::FunctionTemplate> that,
501
                                const char* name,
502
                                v8::FunctionCallback callback);
503
504
  inline v8::Local<v8::Object> NewInternalFieldObject();
505
506
  // Strings and private symbols are shared across shared contexts
507
  // The getters simply proxy to the per-isolate primitive.
508
#define VP(PropertyName, StringValue) V(v8::Private, PropertyName)
509
#define VS(PropertyName, StringValue) V(v8::String, PropertyName)
510
#define V(TypeName, PropertyName)                                             \
511
  inline v8::Local<TypeName> PropertyName() const;
512
  PER_ISOLATE_PRIVATE_SYMBOL_PROPERTIES(VP)
513
  PER_ISOLATE_STRING_PROPERTIES(VS)
514
#undef V
515
#undef VS
516
#undef VP
517
518
#define V(PropertyName, TypeName)                                             \
519
  inline v8::Local<TypeName> PropertyName() const;                            \
520
  inline void set_ ## PropertyName(v8::Local<TypeName> value);
521
  ENVIRONMENT_STRONG_PERSISTENT_PROPERTIES(V)
522
#undef V
523
524
  inline debugger::Agent* debugger_agent() {
525
16
    return &debugger_agent_;
526
  }
527
528
#if HAVE_INSPECTOR
529
  inline inspector::Agent* inspector_agent() {
530
1642
    return &inspector_agent_;
531
  }
532
#endif
533
534
  typedef ListHead<HandleWrap, &HandleWrap::handle_wrap_queue_> HandleWrapQueue;
535
  typedef ListHead<ReqWrap<uv_req_t>, &ReqWrap<uv_req_t>::req_wrap_queue_>
536
          ReqWrapQueue;
537
538
  inline HandleWrapQueue* handle_wrap_queue() { return &handle_wrap_queue_; }
539
  inline ReqWrapQueue* req_wrap_queue() { return &req_wrap_queue_; }
540
541
  static const int kContextEmbedderDataIndex = NODE_CONTEXT_EMBEDDER_DATA_INDEX;
542
543
 private:
544
  inline void ThrowError(v8::Local<v8::Value> (*fun)(v8::Local<v8::String>),
545
                         const char* errmsg);
546
547
  v8::Isolate* const isolate_;
548
  IsolateData* const isolate_data_;
549
  uv_check_t immediate_check_handle_;
550
  uv_idle_t immediate_idle_handle_;
551
  uv_prepare_t idle_prepare_handle_;
552
  uv_check_t idle_check_handle_;
553
  AsyncHooks async_hooks_;
554
  DomainFlag domain_flag_;
555
  TickInfo tick_info_;
556
  const uint64_t timer_base_;
557
  uv_timer_t cares_timer_handle_;
558
  ares_channel cares_channel_;
559
  node_ares_task_list cares_task_list_;
560
  bool using_domains_;
561
  bool printed_error_;
562
  bool trace_sync_io_;
563
  size_t makecallback_cntr_;
564
  int64_t async_wrap_uid_;
565
  debugger::Agent debugger_agent_;
566
#if HAVE_INSPECTOR
567
  inspector::Agent inspector_agent_;
568
#endif
569
570
  HandleWrapQueue handle_wrap_queue_;
571
  ReqWrapQueue req_wrap_queue_;
572
  ListHead<HandleCleanup,
573
           &HandleCleanup::handle_cleanup_queue_> handle_cleanup_queue_;
574
  int handle_cleanup_waiting_;
575
576
  uint32_t* heap_statistics_buffer_ = nullptr;
577
  uint32_t* heap_space_statistics_buffer_ = nullptr;
578
579
  char* http_parser_buffer_;
580
581
#define V(PropertyName, TypeName)                                             \
582
  v8::Persistent<TypeName> PropertyName ## _;
583
  ENVIRONMENT_STRONG_PERSISTENT_PROPERTIES(V)
584
#undef V
585
586
  DISALLOW_COPY_AND_ASSIGN(Environment);
587
};
588
589
}  // namespace node
590
591
#endif  // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
592
593
#endif  // SRC_ENV_H_