Skip to content

Commit 0239561

Browse files
Eugene Ostroukhovevanlucas
Eugene Ostroukhov
authored andcommitted
inspector: split HTTP/WS server from the inspector
Both our team experiments and some embedder request indicate a potential in implementing alternative transport for inspector - e.g. IPC pipes or custom embedder APIs. This change moves all HTTP specific code into a separate class and is a first attempt at defining a boundary between the inspector agent and transport. This API will be refined as new transports are implemented. Note that even without considering alternative transports, this change enables better testing of the HTTP server (Valgrind made it possible to identify and fix some existing memory leaks). PR-URL: #9630 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
1 parent abde764 commit 0239561

6 files changed

+1212
-301
lines changed

node.gyp

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,10 @@
318318
'sources': [
319319
'src/inspector_agent.cc',
320320
'src/inspector_socket.cc',
321-
'src/inspector_socket.h',
321+
'src/inspector_socket_server.cc',
322322
'src/inspector_agent.h',
323+
'src/inspector_socket.h',
324+
'src/inspector_socket_server.h',
323325
],
324326
'dependencies': [
325327
'deps/v8_inspector/src/inspector/inspector.gyp:standalone_inspector',
@@ -868,7 +870,8 @@
868870
'dependencies': [ 'deps/gtest/gtest.gyp:gtest' ],
869871
'include_dirs': [
870872
'src',
871-
'deps/v8/include'
873+
'deps/v8/include',
874+
'<(SHARED_INTERMEDIATE_DIR)'
872875
],
873876
'defines': [
874877
# gtest's ASSERT macros conflict with our own.
@@ -886,9 +889,21 @@
886889

887890
'conditions': [
888891
['v8_inspector=="true"', {
892+
'defines': [
893+
'HAVE_INSPECTOR=1',
894+
],
895+
'dependencies': [
896+
'deps/zlib/zlib.gyp:zlib',
897+
'v8_inspector_compress_protocol_json#host'
898+
],
899+
'include_dirs': [
900+
'<(SHARED_INTERMEDIATE_DIR)'
901+
],
889902
'sources': [
890903
'src/inspector_socket.cc',
891-
'test/cctest/test_inspector_socket.cc'
904+
'src/inspector_socket_server.cc',
905+
'test/cctest/test_inspector_socket.cc',
906+
'test/cctest/test_inspector_socket_server.cc'
892907
],
893908
'conditions': [
894909
[ 'node_shared_openssl=="false"', {

0 commit comments

Comments
 (0)