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
This commit is contained in:
Родитель
105c63b0db
Коммит
5a903b71f8
4
node.gyp
4
node.gyp
|
@ -524,8 +524,8 @@
|
|||
'v8_inspector_compress_protocol_json#host',
|
||||
],
|
||||
'include_dirs': [
|
||||
'<(SHARED_INTERMEDIATE_DIR)/include', # for inspector
|
||||
'<(SHARED_INTERMEDIATE_DIR)',
|
||||
# '<(SHARED_INTERMEDIATE_DIR)/include', # for inspector
|
||||
# '<(SHARED_INTERMEDIATE_DIR)',
|
||||
'<(SHARED_INTERMEDIATE_DIR)/src', # for inspector
|
||||
],
|
||||
}, {
|
||||
|
|
|
@ -376,7 +376,7 @@ class NodeInspectorClient : public V8InspectorClient {
|
|||
explicit NodeInspectorClient(node::Environment* env) : env_(env) {
|
||||
client_ = V8Inspector::create(env->isolate(), this);
|
||||
// TODO(bnoordhuis) Make name configurable from src/node.cc.
|
||||
ContextInfo info(GetHumanReadableProcessName());
|
||||
ContextInfo info("Electron Main Context");
|
||||
info.is_default = true;
|
||||
contextCreated(env->context(), info);
|
||||
}
|
||||
|
|
|
@ -11,8 +11,10 @@
|
|||
#error("This header can only be used when inspector is enabled")
|
||||
#endif
|
||||
|
||||
#include "node.h"
|
||||
#include "node_options.h"
|
||||
#include "node_persistent.h"
|
||||
#include "node_platform.h"
|
||||
#include "v8.h"
|
||||
|
||||
namespace v8_inspector {
|
||||
|
@ -41,7 +43,7 @@ class InspectorSessionDelegate {
|
|||
= 0;
|
||||
};
|
||||
|
||||
class Agent {
|
||||
class NODE_EXTERN Agent {
|
||||
public:
|
||||
explicit Agent(node::Environment* env);
|
||||
~Agent();
|
||||
|
|
|
@ -12,6 +12,8 @@
|
|||
#include "util.h"
|
||||
#include "zlib.h"
|
||||
|
||||
#include "libplatform/libplatform.h"
|
||||
|
||||
#include <deque>
|
||||
#include <string.h>
|
||||
#include <vector>
|
||||
|
|
Загрузка…
Ссылка в новой задаче