Skip to content

Commit

Permalink
tools: update inspector_protocol to 94298cef795ec9
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 committed Mar 4, 2021
1 parent 3b2863d commit a0bae95
Show file tree
Hide file tree
Showing 82 changed files with 9,549 additions and 9,163 deletions.
17 changes: 3 additions & 14 deletions src/inspector/node_inspector.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,20 @@
'<(SHARED_INTERMEDIATE_DIR)/src/node/inspector/protocol/NodeRuntime.h',
],
'node_protocol_files': [
'<(protocol_tool_path)/lib/Allocator_h.template',
'<(protocol_tool_path)/lib/Array_h.template',
'<(protocol_tool_path)/lib/base_string_adapter_cc.template',
'<(protocol_tool_path)/lib/base_string_adapter_h.template',
'<(protocol_tool_path)/lib/DispatcherBase_cpp.template',
'<(protocol_tool_path)/lib/DispatcherBase_h.template',
'<(protocol_tool_path)/lib/encoding_cpp.template',
'<(protocol_tool_path)/lib/encoding_h.template',
'<(protocol_tool_path)/lib/ErrorSupport_cpp.template',
'<(protocol_tool_path)/lib/ErrorSupport_h.template',
'<(protocol_tool_path)/lib/Forward_h.template',
'<(protocol_tool_path)/lib/FrontendChannel_h.template',
'<(protocol_tool_path)/lib/Maybe_h.template',
'<(protocol_tool_path)/lib/Object_cpp.template',
'<(protocol_tool_path)/lib/Object_h.template',
'<(protocol_tool_path)/lib/Parser_cpp.template',
'<(protocol_tool_path)/lib/Parser_h.template',
'<(protocol_tool_path)/lib/Protocol_cpp.template',
'<(protocol_tool_path)/lib/ValueConversions_cpp.template',
'<(protocol_tool_path)/lib/ValueConversions_h.template',
'<(protocol_tool_path)/lib/Values_cpp.template',
'<(protocol_tool_path)/lib/Values_h.template',
'<(protocol_tool_path)/templates/Exported_h.template',
'<(protocol_tool_path)/templates/Imported_h.template',
'<(protocol_tool_path)/templates/TypeBuilder_cpp.template',
'<(protocol_tool_path)/templates/TypeBuilder_h.template',
'<(protocol_tool_path)/code_generator.py',
'<(protocol_tool_path)/templates/TypeBuilder_h.template'
]
},
'defines': [
Expand Down Expand Up @@ -107,6 +95,7 @@
'--jinja_dir', '<@(protocol_tool_path)',
'--output_base', '<(SHARED_INTERMEDIATE_DIR)/src/',
'--config', 'src/inspector/node_protocol_config.json',
'--inspector_protocol_dir', '<(protocol_tool_path)/',
],
'message': 'Generating node protocol sources from protocol json',
},
Expand Down
6 changes: 5 additions & 1 deletion src/inspector/node_protocol_config.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
{
"protocol": {
"path": "node_protocol.json",
"path": "node_protocol.pdl",
"package": "src/node/inspector/protocol",
"output": "node/inspector/protocol",
"namespace": ["node", "inspector", "protocol"]
},
"crdtp": {
"dir": "../tools/inspector_protocol/crdtp",
"namespace": "v8_inspector_protocol_crdtp"
},
"exported": {
"package": "include/inspector",
"output": "../../include/inspector",
Expand Down
8 changes: 4 additions & 4 deletions src/inspector_agent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ std::string GetWorkerLabel(node::Environment* env) {
}

class ChannelImpl final : public v8_inspector::V8Inspector::Channel,
public protocol::FrontendChannel {
public v8_inspector_protocol_crdtp::FrontendChannel {
public:
explicit ChannelImpl(Environment* env,
const std::unique_ptr<V8Inspector>& inspector,
Expand All @@ -220,7 +220,7 @@ class ChannelImpl final : public v8_inspector::V8Inspector::Channel,
: delegate_(std::move(delegate)), prevent_shutdown_(prevent_shutdown),
retaining_context_(false) {
session_ = inspector->connect(CONTEXT_GROUP_ID, this, StringView());
node_dispatcher_ = std::make_unique<protocol::UberDispatcher>(this);
node_dispatcher_ = std::make_unique<v8_inspector_protocol_crdtp::UberDispatcher>(this);
tracing_agent_ =
std::make_unique<protocol::TracingAgent>(env, main_thread_);
tracing_agent_->Wire(node_dispatcher_.get());
Expand Down Expand Up @@ -300,7 +300,7 @@ class ChannelImpl final : public v8_inspector::V8Inspector::Channel,
sendMessageToFrontend(Utf8ToStringView(message)->string());
}

using Serializable = protocol::Serializable;
using Serializable = v8_inspector_protocol_crdtp::Serializable;

void sendProtocolResponse(int callId,
std::unique_ptr<Serializable> message) override {
Expand All @@ -322,7 +322,7 @@ class ChannelImpl final : public v8_inspector::V8Inspector::Channel,
std::unique_ptr<protocol::WorkerAgent> worker_agent_;
std::unique_ptr<InspectorSessionDelegate> delegate_;
std::unique_ptr<v8_inspector::V8InspectorSession> session_;
std::unique_ptr<protocol::UberDispatcher> node_dispatcher_;
std::unique_ptr<v8_inspector_protocol_crdtp::UberDispatcher> node_dispatcher_;
bool prevent_shutdown_;
bool retaining_context_;
};
Expand Down
84 changes: 69 additions & 15 deletions tools/inspector_protocol/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,83 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

static_library("encoding") {
import("../../gni/v8.gni")

config("crdtp_config") {
visibility = [ "../../src/inspector:*", ":*" ]
configs = [ "../../:internal_config" ]
include_dirs = [ "../../include" ]
}

v8_source_set("crdtp") {
sources = [
"encoding/encoding.cc",
"encoding/encoding.h",
"crdtp/cbor.cc",
"crdtp/cbor.h",
"crdtp/dispatch.cc",
"crdtp/dispatch.h",
"crdtp/error_support.cc",
"crdtp/error_support.h",
"crdtp/export.h",
"crdtp/find_by_first.h",
"crdtp/json.cc",
"crdtp/json.h",
"crdtp/maybe.h",
"crdtp/parser_handler.h",
"crdtp/protocol_core.cc",
"crdtp/protocol_core.h",
"crdtp/serializable.cc",
"crdtp/serializable.h",
"crdtp/serializer_traits.h",
"crdtp/span.cc",
"crdtp/span.h",
"crdtp/status.cc",
"crdtp/status.h",
]
configs = [ ":crdtp_config" ]
deps = [ ":crdtp_platform" ]
}

# encoding_test is part of the unittests, defined in
# test/unittests/BUILD.gn.

import("../../gni/v8.gni")
# A small adapter library which only :crdtp may depend on.
v8_source_set("crdtp_platform") {
visibility = [ ":crdtp" ]
sources = [
"crdtp/json_platform.h",
"crdtp/json_platform_v8.cc",
]
public_deps = [ "../..:v8_libbase" ]
configs = [ ":crdtp_config" ]
}

v8_source_set("encoding_test") {
# These tests are linked into test/unittests.
v8_source_set("crdtp_test") {
sources = [
"encoding/encoding_test.cc",
"encoding/encoding_test_helper.h",
"crdtp/cbor_test.cc",
"crdtp/dispatch_test.cc",
"crdtp/error_support_test.cc",
"crdtp/find_by_first_test.cc",
"crdtp/glue_test.cc",
"crdtp/json_test.cc",
"crdtp/serializable_test.cc",
"crdtp/serializer_traits_test.cc",
"crdtp/span_test.cc",
"crdtp/status_test.cc",
"crdtp/status_test_support.cc",
"crdtp/status_test_support.h",
]
configs = [
"../..:external_config",
"../..:internal_config_base",
configs = [ ":crdtp_config" ]
deps = [ ":crdtp_test_platform" ]
testonly = true
}

# A small adapter library which only :crdtp_test may depend on.
v8_source_set("crdtp_test_platform") {
sources = [
"crdtp/test_platform.h",
"crdtp/test_platform_v8.cc",
]
deps = [
":encoding",
configs = [ ":crdtp_config" ]
public_deps = [
":crdtp",
"../..:v8_libbase",
"../../src/inspector:inspector_string_conversions",
"//testing/gmock",
Expand Down
1 change: 1 addition & 0 deletions tools/inspector_protocol/OWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ dgozman@chromium.org
kozyatinskiy@chromium.org
pfeldman@chromium.org
yangguo@chromium.org
johannes@chromium.org
19 changes: 2 additions & 17 deletions tools/inspector_protocol/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,5 @@ https://cs.chromium.org/chromium/src/v8/third_party/inspector_protocol/

See also [Contributing to Chrome Devtools Protocol](https://docs.google.com/document/d/1c-COD2kaK__5iMM5SEx-PzNA7HFmgttcYfOHHX0HaOM/edit).

We're working on enabling standalone builds for parts of this package for
testing and development, please feel free to ignore this for now.
But, if you're familiar with
[Chromium's development process](https://www.chromium.org/developers/contributing-code)
and have the depot_tools installed, you may use these commands
to fetch the package (and dependencies) and build and run the tests:

fetch inspector_protocol
cd src
gn gen out/Release
ninja -C out/Release json_parser_test
out/Release/json_parser_test

You'll probably also need to install g++, since Clang uses this to find the
standard C++ headers. E.g.,

sudo apt-get install g++-8
To build and run the tests of the crdtp library, see
[CRDTP - Chrome DevTools Protocol](crdtp/README.md).
2 changes: 1 addition & 1 deletion tools/inspector_protocol/README.node
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Name: inspector protocol
Short Name: inspector_protocol
URL: https://chromium.googlesource.com/deps/inspector_protocol/
Version: 0
Revision: 0aafd2876f7485db7b07c513c0457b7cbbbe3304
Revision: 94298cef795ec994106bdaff002c41182911b767
License: BSD
License File: LICENSE
Security Critical: no
Expand Down
Loading

0 comments on commit a0bae95

Please sign in to comment.