|
1 |
| -#include "node.h" |
2 |
| -#include "node_internals.h" |
3 |
| -#include "node_errors.h" |
4 |
| -#include "base_object.h" |
5 | 1 | #include "base_object-inl.h"
|
| 2 | +#include "base_object.h" |
6 | 3 | #include "env-inl.h"
|
| 4 | +#include "node.h" |
| 5 | +#include "node_errors.h" |
| 6 | +#include "node_internals.h" |
| 7 | +#include "node_process.h" |
7 | 8 | #include "util-inl.h"
|
8 | 9 | #include "uv.h"
|
9 | 10 | #include "v8.h"
|
@@ -44,7 +45,6 @@ using v8::Local;
|
44 | 45 | using v8::Name;
|
45 | 46 | using v8::NewStringType;
|
46 | 47 | using v8::Object;
|
47 |
| -using v8::PropertyCallbackInfo; |
48 | 48 | using v8::String;
|
49 | 49 | using v8::Uint32;
|
50 | 50 | using v8::Uint32Array;
|
@@ -197,10 +197,6 @@ static void MemoryUsage(const FunctionCallbackInfo<Value>& args) {
|
197 | 197 | fields[3] = v8_heap_stats.external_memory();
|
198 | 198 | }
|
199 | 199 |
|
200 |
| -// Most of the time, it's best to use `console.error` to write |
201 |
| -// to the process.stderr stream. However, in some cases, such as |
202 |
| -// when debugging the stream.Writable class or the process.nextTick |
203 |
| -// function, it is useful to bypass JavaScript entirely. |
204 | 200 | void RawDebug(const FunctionCallbackInfo<Value>& args) {
|
205 | 201 | CHECK(args.Length() == 1 && args[0]->IsString() &&
|
206 | 202 | "must be called with a single string");
|
@@ -246,28 +242,6 @@ static void Uptime(const FunctionCallbackInfo<Value>& args) {
|
246 | 242 | args.GetReturnValue().Set(uptime / 1000);
|
247 | 243 | }
|
248 | 244 |
|
249 |
| -void ProcessTitleGetter(Local<Name> property, |
250 |
| - const PropertyCallbackInfo<Value>& info) { |
251 |
| - char buffer[512]; |
252 |
| - uv_get_process_title(buffer, sizeof(buffer)); |
253 |
| - info.GetReturnValue().Set(String::NewFromUtf8(info.GetIsolate(), buffer, |
254 |
| - NewStringType::kNormal).ToLocalChecked()); |
255 |
| -} |
256 |
| - |
257 |
| -void ProcessTitleSetter(Local<Name> property, |
258 |
| - Local<Value> value, |
259 |
| - const PropertyCallbackInfo<void>& info) { |
260 |
| - node::Utf8Value title(info.GetIsolate(), value); |
261 |
| - TRACE_EVENT_METADATA1("__metadata", "process_name", "name", |
262 |
| - TRACE_STR_COPY(*title)); |
263 |
| - uv_set_process_title(*title); |
264 |
| -} |
265 |
| - |
266 |
| -void GetParentProcessId(Local<Name> property, |
267 |
| - const PropertyCallbackInfo<Value>& info) { |
268 |
| - info.GetReturnValue().Set(uv_os_getppid()); |
269 |
| -} |
270 |
| - |
271 | 245 | static void GetActiveRequests(const FunctionCallbackInfo<Value>& args) {
|
272 | 246 | Environment* env = Environment::GetCurrent(args);
|
273 | 247 |
|
@@ -297,22 +271,6 @@ void GetActiveHandles(const FunctionCallbackInfo<Value>& args) {
|
297 | 271 | Array::New(env->isolate(), handle_v.data(), handle_v.size()));
|
298 | 272 | }
|
299 | 273 |
|
300 |
| -void DebugPortGetter(Local<Name> property, |
301 |
| - const PropertyCallbackInfo<Value>& info) { |
302 |
| - Environment* env = Environment::GetCurrent(info); |
303 |
| - int port = env->inspector_host_port()->port(); |
304 |
| - info.GetReturnValue().Set(port); |
305 |
| -} |
306 |
| - |
307 |
| - |
308 |
| -void DebugPortSetter(Local<Name> property, |
309 |
| - Local<Value> value, |
310 |
| - const PropertyCallbackInfo<void>& info) { |
311 |
| - Environment* env = Environment::GetCurrent(info); |
312 |
| - int32_t port = value->Int32Value(env->context()).FromMaybe(0); |
313 |
| - env->inspector_host_port()->set_port(static_cast<int>(port)); |
314 |
| -} |
315 |
| - |
316 | 274 | #ifdef __POSIX__
|
317 | 275 | static void DebugProcess(const FunctionCallbackInfo<Value>& args) {
|
318 | 276 | Environment* env = Environment::GetCurrent(args);
|
|
0 commit comments