Files
electron/patches/node/fix_build_and_expose_inspector_agent.patch
Electron Bot 9713fa09e7 chore: bump node to v12.8.0 (master) (#19521)
* chore: bump node in DEPS to v12.7.0

* chore: update node patches v12.6 to v12.7

Removed patches that are no longer necessary because we've upstreamed few changes already, and 3 way merge others

* fix: update build gn patch

* chore: bump node in DEPS to v12.8.0

* chore: update node patches v12.7 to v12.8

Removed patches that are no longer necessary because we've upstreamed few changes already, and 3 way merge others

* fix: Add patch to revert crypto createhash changes

The original node commit contains changes/calls to functions that are not supported in boringssl.

* disable node tests

* Remove outdated patch, already merged upstream
2019-08-12 17:29:34 -07:00

66 lines
2.3 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shelley Vohr <shelley.vohr@gmail.com>
Date: Mon, 30 Jul 2018 15:18:11 -0700
Subject: fix: build and expose inspector agent
Node inspector initialization happens in a different start-up function in node.cc, which we don't call in Electron. This allows for us to use the inspector agent in electron/atom/browser/node_debugger.cc
diff --git a/src/inspector_agent.cc b/src/inspector_agent.cc
index 2965483dea6244e7123c08c104f399fc023a84e0..b6624300e96daf6041a296fdc1ceeaf579e215cd 100644
--- a/src/inspector_agent.cc
+++ b/src/inspector_agent.cc
@@ -217,7 +217,7 @@ const int CONTEXT_GROUP_ID = 1;
std::string GetWorkerLabel(node::Environment* env) {
std::ostringstream result;
- result << "Worker[" << env->thread_id() << "]";
+ result << "Electron Worker[" << env->thread_id() << "]";
return result.str();
}
@@ -465,7 +465,7 @@ class NodeInspectorClient : public V8InspectorClient {
client_ = V8Inspector::create(env->isolate(), this);
// TODO(bnoordhuis) Make name configurable from src/node.cc.
std::string name =
- is_main_ ? GetHumanReadableProcessName() : GetWorkerLabel(env);
+ is_main_ ? "Electron Main Context" : GetWorkerLabel(env);
ContextInfo info(name);
info.is_default = true;
contextCreated(env->context(), info);
diff --git a/src/inspector_agent.h b/src/inspector_agent.h
index 4fb544f85bd1453d0705088dfb5511ae32bacad2..ac9352e3fa953e2f4ac0a032c2aacd7353c2cf71 100644
--- a/src/inspector_agent.h
+++ b/src/inspector_agent.h
@@ -6,7 +6,9 @@
#error("This header can only be used when inspector is enabled")
#endif
+#include "node.h"
#include "node_options.h"
+#include "node_platform.h"
#include "v8.h"
#include <cstddef>
@@ -40,7 +42,7 @@ class InspectorSessionDelegate {
= 0;
};
-class Agent {
+class NODE_EXTERN Agent {
public:
explicit Agent(node::Environment* env);
~Agent();
diff --git a/src/inspector_io.cc b/src/inspector_io.cc
index 76e481c9530d955a841a19d91b34f03bebaaecfb..8b61d73b8d7cc5d84a61b4a683a28ab1865ad71b 100644
--- a/src/inspector_io.cc
+++ b/src/inspector_io.cc
@@ -13,6 +13,8 @@
#include "util-inl.h"
#include "zlib.h"
+#include "libplatform/libplatform.h"
+
#include <deque>
#include <cstring>
#include <vector>